:root {
    color-scheme: light;
    --brand-primary: #1c5145;
    --brand-secondary: #4b7f6a;
    --brand-primary-ink: #1c5145;
    --brand-secondary-ink: #4b7f6a;
    --brand-primary-on: #fff;
    --brand-secondary-on: #fff;
    --brand-primary-rgb: 28, 81, 69;
    --brand-secondary-rgb: 75, 127, 106;
    --paper: #f3f5ef;
    --surface: #fff;
    --surface-soft: #f8f9f5;
    --ink: #1d2c27;
    --muted: #74817b;
    --line: #e4e9e2;
    --forest: var(--brand-primary-ink);
    --forest-dark: var(--brand-primary-ink);
    --mint: rgba(var(--brand-secondary-rgb), 0.26);
    --coral: #dd745c;
    --coral-soft: #fae8e1;
    --gold: #bd8e3c;
    --blue: var(--brand-secondary-ink);
    --shadow: 0 18px 48px rgba(27, 55, 44, .07);
    font-family: 'DM Sans', sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    min-width: 320px;
}

body {
    margin: 0;
    min-width: 320px;
    color: var(--ink);
    background: var(--paper);
    font-size: 14px;
}

input,
select,
textarea {
    font: inherit;
}

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

button,
a {
    color: inherit;
    text-decoration: none;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    cursor: not-allowed;
    opacity: .55;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    letter-spacing: 0;
}

.eyebrow {
    margin: 0 0 11px;
    color: var(--forest);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.2px;
}

.muted,
.hint {
    color: var(--muted);
}

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

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--forest-dark);
    font-size: 18px;
    font-weight: 800;
}

.brand-mark {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    color: var(--brand-primary-on);
    background: var(--brand-primary);
    border-radius: 8px 8px 8px 2px;
    font-family: 'Manrope', sans-serif;
    font-size: 17px;
    font-weight: 800;
}

.brand.light {
    color: #fff;
}

.brand.light .brand-mark {
    color: var(--forest-dark);
    background: #e7f0e8;
}

.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 17px;
    border: 1px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    transition: background .18s ease, transform .18s ease, border-color .18s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button.primary {
    color: var(--brand-primary-on);
    background: var(--brand-primary);
}

.button.primary:hover {
    background: var(--brand-primary);
}

.button.secondary {
    color: var(--brand-secondary-ink);
    background: color-mix(in srgb, var(--brand-secondary) 12%, #fff);
    border-color: color-mix(in srgb, var(--brand-secondary) 42%, var(--line));
}

.button.secondary:hover {
    border-color: var(--brand-secondary);
    background: color-mix(in srgb, var(--brand-secondary) 20%, #fff);
}

.text-button:hover,
.quiet-link:hover,
.table-link:hover {
    color: var(--brand-secondary);
}

.button.danger-outline {
    color: #a84e3d;
    border-color: #e9c2b7;
    background: #fff;
}

.button.small {
    min-height: 34px;
    padding: 0 12px;
    font-size: 11px;
}

.button.full {
    width: 100%;
}

.text-button,
.quiet-link,
.table-link {
    padding: 0;
    border: 0;
    color: var(--forest);
    background: none;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.account-actions {
    display: flex;
    min-width: 150px;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
}

.account-actions form {
    margin: 0;
}

.account-actions button,
.account-actions a {
    white-space: nowrap;
}

.account-actions .password-reset-button {
    color: #9b553f;
}

.row-actions {
    display: flex;
    justify-content: flex-end;
}

.row-actions-trigger {
    min-width: 34px;
    min-height: 34px;
}

.row-action-menu[popover] {
    position: fixed;
    inset: auto;
    min-width: 176px;
    margin: 0;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 5px;
    color: var(--ink);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.row-action-menu form {
    margin: 0;
}

.row-action-item {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    border: 0;
    border-radius: 3px;
    color: var(--ink);
    background: transparent;
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.row-action-item:hover,
.row-action-item:focus-visible {
    color: var(--brand-secondary-ink);
    background: color-mix(in srgb, var(--brand-secondary) 12%, var(--surface));
}

.row-action-item svg {
    width: 14px;
    height: 14px;
    color: var(--brand-secondary);
}

.row-action-item.password-reset-button {
    color: var(--coral);
}

.quiet-link span {
    margin-left: 6px;
}

.notice {
    margin: 0 0 20px;
    padding: 12px 15px;
    border: 1px solid;
    border-radius: 5px;
    font-size: 12px;
}

.notice.success {
    color: #28634c;
    border-color: #c5dfce;
    background: #edf6ee;
}

.notice.error {
    color: #974d3d;
    border-color: #efd0c5;
    background: #fff2ed;
}

.countdown-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--ink);
    font-size: 12px;
    font-weight: 600;
}

.countdown-banner span {
    color: var(--muted);
}

.countdown-banner strong {
    font-family: 'Manrope', sans-serif;
    letter-spacing: .02em;
}

.voter-election-countdown {
    justify-content: flex-start;
    width: fit-content;
    margin: 8px 0 0;
    padding: 6px 9px;
}

.countdown-banner-live {
    border-color: color-mix(in srgb, var(--brand-secondary) 35%, var(--line));
    background: color-mix(in srgb, var(--brand-secondary) 8%, var(--surface-soft));
}

.countdown-urgent {
    color: var(--coral);
    animation: countdown-pulse 1.4s steps(1, end) infinite;
}

.countdown-urgent-high {
    animation-duration: .85s;
}

.countdown-urgent-critical {
    animation-duration: .45s;
}

@keyframes countdown-pulse {

    0%,
    100% {
        border-color: color-mix(in srgb, var(--coral) 35%, var(--line));
        background: color-mix(in srgb, var(--coral) 10%, var(--surface));
    }

    50% {
        border-color: var(--coral);
        background: color-mix(in srgb, var(--coral) 24%, var(--surface));
    }
}

/* Entry and first-run setup */
.login-layout {
    display: grid;
    min-height: 100svh;
    grid-template-columns: minmax(360px, 1fr) minmax(400px, .9fr);
    background: #fff;
}

.login-story {
    --ballot-review-left: clamp(-92px, -12vw, -48px);
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    min-height: 100svh;
    flex-direction: column;
    justify-content: flex-start;
    gap: 20px;
    padding: clamp(24px, 4vw, 56px);
    color: #f7f8f1;
    background-color: var(--login-primary, var(--forest-dark));
    background-image: radial-gradient(ellipse at 78% 65%, color-mix(in srgb, var(--login-secondary, #4B7F6A) 34%, transparent), transparent 53%), linear-gradient(135deg, color-mix(in srgb, var(--login-primary, #1C5145) 42%, #10221e), color-mix(in srgb, var(--login-secondary, #4B7F6A) 38%, #10221e)), repeating-linear-gradient(135deg, transparent 0 34px, rgba(234, 244, 231, .035) 35px 36px);
}

.login-story .eyebrow {
    color: #adcdbc;
}

.story-copy {
    max-width: 560px;
    padding: 24px 0;
}

.story-copy h1 {
    margin-bottom: 20px;
    font-size: clamp(48px, 6.5vw, 82px);
    line-height: 1.04;
    font-weight: 600;
}

.story-copy>p:last-child {
    max-width: 370px;
    color: #d0ded5;
    font-size: 16px;
    line-height: 1.7;
}

.voting-process-visual {
    display: flex;
    width: min(100%, 760px);
    min-height: 0;
    flex: 1;
    flex-direction: column;
    align-self: center;
    margin: 0 auto;
    padding: 20px 24px 16px;
    border: 1px solid rgba(240, 249, 241, .2);
    border-radius: 7px;
    background: rgba(8, 26, 22, .24);
    box-shadow: 0 18px 50px rgba(5, 21, 18, .16);
}

.visual-caption,
.vote-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.visual-caption {
    color: #e1eee4;
    font-size: 9px;
    font-weight: 800;
}

.visual-live {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #b4d7c1;
    font-size: 8px;
}

.visual-live i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #a3dfaf;
    box-shadow: 0 0 0 3px rgba(163, 223, 175, .14);
}

.vote-stage {
    position: relative;
    min-height: 320px;
    flex: 1;
    margin-top: 10px;
}

.ballot-box {
    position: absolute;
    bottom: 5px;
    left: 50%;
    display: flex;
    width: 226px;
    height: 96px;
    align-items: center;
    justify-content: center;
    transform: translateX(-50%);
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 8px 8px 15px 15px;
    color: #f8fff8;
    background: linear-gradient(145deg, color-mix(in srgb, var(--login-secondary, #4B7F6A) 76%, #edf5ec), var(--login-primary, #1C5145));
    box-shadow: inset 0 1px rgba(255, 255, 255, .22), 0 13px 18px rgba(4, 19, 15, .2);
}

.box-slot {
    position: absolute;
    top: 8px;
    left: 50%;
    width: 88px;
    height: 6px;
    transform: translateX(-50%);
    border-radius: 5px;
    background: #112b24;
    box-shadow: 0 1px 2px rgba(255, 255, 255, .22);
}

.box-label {
    margin-top: 8px;
    font-size: 10px;
    font-weight: 800;
}

.box-check {
    position: absolute;
    right: 13px;
    bottom: 10px;
    display: grid;
    width: 18px;
    aspect-ratio: 1;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 50%;
    color: #effff0;
    font-size: 11px;
    opacity: .28;
    transform: scale(.72);
    animation: vote-success 8s ease-in-out infinite;
}

.box-submitted {
    position: absolute;
    bottom: 11px;
    left: 50%;
    color: #d9efdd;
    font-size: 8px;
    font-weight: 800;
    opacity: 0;
    transform: translateX(-50%) translateY(4px);
    animation: submitted-label 8s ease-in-out infinite;
}

.ballot-sheet {
    position: absolute;
    z-index: 2;
    top: 2px;
    left: 50%;
    display: grid;
    width: 184px;
    gap: 11px;
    padding: 15px 16px;
    transform: translateX(-50%);
    border: 1px solid #dfe8df;
    border-radius: 4px;
    color: #31443b;
    background: #fbfdf8;
    box-shadow: 0 7px 20px rgba(5, 18, 14, .24);
    animation: ballot-delivery 8s cubic-bezier(.44, 0, .2, 1) infinite;
}

.review-card {
    position: absolute;
    z-index: 1;
    top: 132px;
    right: 3%;
    display: grid;
    width: 190px;
    gap: 8px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 6px;
    color: #34483c;
    background: #f8fbf6;
    box-shadow: 0 14px 34px rgba(5, 18, 14, .2);
    opacity: 0;
    transform: translateX(14px) scale(.96);
    animation: review-selection 8s ease-in-out infinite;
}

.review-icon {
    display: grid;
    width: 28px;
    aspect-ratio: 1;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--login-secondary, #4B7F6A);
    font-weight: 800;
}

.review-title {
    color: #748579;
    font-size: 8px;
    font-weight: 800;
}

.review-card strong {
    font-size: 13px;
}

.review-detail {
    color: #78887e;
    font-size: 10px;
}

.cast-trail {
    position: absolute;
    z-index: 1;
    top: 135px;
    right: 50%;
    left: 50%;
    bottom: 102px;
    border-left: 2px dashed rgba(240, 249, 241, .68);
    opacity: 0;
    animation: cast-path 8s ease-in-out infinite;
}

.sheet-title {
    color: #78887e;
    font-size: 7px;
    font-weight: 800;
}

.sheet-line {
    display: flex;
    align-items: center;
    gap: 7px;
}

.sheet-line i {
    display: grid;
    width: 11px;
    aspect-ratio: 1;
    place-items: center;
    border: 1px solid #a7b9ac;
    border-radius: 2px;
    color: #fff;
    font-size: 8px;
    font-style: normal;
}

.sheet-line.selected i {
    border-color: var(--login-primary, #1C5145);
    background: var(--login-primary, #1C5145);
    animation: selection-mark 8s ease-in-out infinite;
}

.sheet-line b {
    width: 76px;
    height: 4px;
    border-radius: 3px;
    background: #dbe4dc;
}

.vote-steps {
    gap: 12px;
    margin: 8px 0 0;
    padding: 9px 0 0;
    border-top: 1px solid rgba(239, 249, 240, .16);
    list-style: none;
    color: #bed0c4;
    font-size: 8px;
}

.vote-steps li {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #bed0c4;
}

.vote-steps li:nth-child(1) {
    animation: step-select 8s ease-in-out infinite;
}

.vote-steps li:nth-child(2) {
    animation: step-review 8s ease-in-out infinite;
}

.vote-steps li:nth-child(3) {
    animation: step-submit 8s ease-in-out infinite;
}

.vote-steps b {
    color: #d6e9da;
    font-size: 8px;
}

@keyframes ballot-delivery {

    0%,
    18% {
        top: 2px;
        opacity: 1;
        transform: translate(-50%, 0) rotate(-2deg);
    }

    24%,
    40% {
        top: 2px;
        opacity: 1;
        transform: translate(calc(-50% + var(--ballot-review-left)), -18px) rotate(-1deg);
    }

    47%,
    54% {
        top: 2px;
        opacity: 1;
        transform: translate(-50%, 0) rotate(0);
    }

    70% {
        top: calc(100% - var(--ballot-drop-offset, 195px));
        opacity: 1;
        transform: translate(-50%, 0) rotate(3deg) scale(.82);
    }

    78%,
    91% {
        top: calc(100% - 200px);
        opacity: 0;
        transform: translate(-50%, 0) rotate(3deg) scale(.75);
    }

    100% {
        top: 2px;
        opacity: 1;
        transform: translate(-50%, 0) rotate(-2deg);
    }
}

@keyframes review-selection {

    0%,
    19%,
    52%,
    100% {
        opacity: 0;
        transform: translateX(14px) scale(.96);
    }

    25%,
    44% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes selection-mark {

    0%,
    6% {
        transform: scale(.6);
    }

    12%,
    100% {
        transform: scale(1);
    }
}

@keyframes cast-path {

    0%,
    56%,
    100% {
        opacity: 0;
        transform: scaleY(.3);
        transform-origin: top;
    }

    63%,
    76% {
        opacity: 1;
        transform: scaleY(1);
        transform-origin: top;
    }
}

@keyframes vote-success {

    0%,
    74% {
        opacity: .28;
        transform: scale(.72);
    }

    81%,
    92% {
        opacity: 1;
        transform: scale(1.18);
    }

    100% {
        opacity: .28;
        transform: scale(.72);
    }
}

@keyframes submitted-label {

    0%,
    77%,
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(4px);
    }

    83%,
    92% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes step-select {

    0%,
    18% {
        color: #fff;
    }

    22%,
    100% {
        color: #bed0c4;
    }
}

@keyframes step-review {

    0%,
    22%,
    48%,
    100% {
        color: #bed0c4;
    }

    27%,
    43% {
        color: #fff;
    }
}

@keyframes step-submit {

    0%,
    53%,
    100% {
        color: #bed0c4;
    }

    59%,
    82% {
        color: #fff;
    }
}

.story-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: #a8c2b4;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
}

.login-form-wrap {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 48px 32px;
    background: radial-gradient(ellipse at 80% 4%, rgba(219, 235, 222, .48), transparent 45%), #fff;
}

.security-page-header {
    display: flex;
    width: min(100%, 390px);
    min-height: 42px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex: 0 0 auto;
}

.security-brand {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    color: var(--brand-primary, #1C5145);
    font-family: 'Manrope', sans-serif;
    font-size: 17px;
    font-weight: 800;
    text-decoration: none;
}

.security-brand img {
    display: block;
    width: auto;
    max-width: 150px;
    height: 34px;
    object-fit: contain;
    object-position: left center;
}

.security-brand .brand-mark {
    flex: 0 0 32px;
}

.login-form-box {
    width: min(100%, 390px);
    margin-block: auto;
}

.login-form-box h2 {
    margin: 20px 0 9px;
    font-size: 32px;
    font-weight: 700;
}

.login-form-box>.muted {
    margin-bottom: 30px;
    font-size: 13px;
}

.login-footnote {
    margin: 20px 0;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.login-footnote a {
    color: var(--forest);
    font-weight: 700;
}

.security-note {
    margin-top: 45px;
    color: #98a29c;
    font-size: 10px;
    text-align: center;
}

.segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
}

.segmented label {
    cursor: pointer;
}

.segmented input {
    position: absolute;
    opacity: 0;
}

.segmented span {
    display: block;
    padding: 9px;
    border-radius: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.segmented input:checked+span {
    color: var(--forest-dark);
    background: #fff;
    box-shadow: 0 1px 5px rgba(24, 60, 48, .12);
}

.setup-page {
    display: grid;
    min-height: 100svh;
    place-items: center;
    padding: 24px;
    background: radial-gradient(circle at 20% 10%, color-mix(in srgb, var(--security-secondary, var(--brand-secondary)) 20%, transparent), transparent 38%), color-mix(in srgb, var(--security-primary, var(--brand-primary)) 4%, var(--paper));
}

.setup-shell {
    width: min(100%, 520px);
    padding: clamp(26px, 6vw, 52px);
    border: 1px solid color-mix(in srgb, var(--security-primary, var(--brand-primary)) 20%, var(--line));
    border-top: 3px solid var(--security-primary, var(--brand-primary));
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.setup-shell>.eyebrow {
    margin-top: 28px;
    color: var(--brand-primary-ink);
}

.setup-shell .button.primary {
    color: var(--brand-primary-on);
    background: var(--security-primary, var(--brand-primary));
}

.setup-shell .button.primary:hover {
    color: var(--brand-secondary-on);
    background: var(--brand-secondary);
}

.setup-shell h1 {
    margin-bottom: 10px;
    font-size: 34px;
}

.setup-shell>.muted {
    margin-bottom: 26px;
    line-height: 1.65;
}

/* Admin workspace */
.admin-shell {
    display: grid;
    min-height: 100svh;
    grid-template-columns: 252px minmax(0, 1fr);
    transition: grid-template-columns .2s ease;
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    height: 100svh;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
    padding: 25px 17px 18px;
    border-right: 1px solid #e5e9e2;
    background: #fbfcf8;
}

.sidebar-brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 22px 7px;
}

.sidebar-brand-row .brand {
    min-width: 0;
}

.sidebar-toggle {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 5px;
    color: #627168;
    background: #fff;
    cursor: pointer;
}

.sidebar-toggle:hover {
    color: var(--forest);
    border-color: #b8cdbd;
    background: #f3f7f1;
}

.sidebar-toggle:focus-visible,
.nav-link:focus-visible {
    outline: 3px solid rgba(66, 126, 83, .25);
    outline-offset: 2px;
}

.sidebar-toggle svg,
.nav-icon,
.signout-button svg {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    stroke-width: 1.8;
}

.org-switch {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px 10px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #fff;
}

.org-avatar,
.user-avatar {
    display: grid;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 5px;
    color: var(--forest);
    background: var(--mint);
    font-size: 13px;
    font-weight: 800;
}

.org-switch strong,
.org-switch small,
.topbar-user strong,
.topbar-user small {
    display: block;
    max-width: 155px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.org-switch strong,
.topbar-user strong {
    font-size: 11px;
}

.org-switch small,
.topbar-user small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
}

.side-nav {
    min-height: 0;
    flex: 1 1 auto;
    margin: 10px 0 8px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: #cbd6cd transparent;
    scrollbar-width: thin;
}

.nav-caption {
    margin: 0 10px 11px;
    color: #9ba59e;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.1px;
}

.nav-link {
    display: flex;
    min-height: 48px;
    align-items: center;
    gap: 10px;
    margin: 4px 0;
    padding: 7px 10px;
    border-radius: 5px;
    color: var(--muted);
}

.nav-link:hover {
    background: color-mix(in srgb, var(--brand-secondary) 12%, var(--surface-soft));
}

.nav-link:hover .nav-icon {
    color: var(--brand-secondary);
}

.nav-link.active {
    color: var(--brand-secondary-ink);
    background: color-mix(in srgb, var(--brand-secondary) 18%, var(--surface));
}

.nav-indicator {
    width: 3px;
    height: 28px;
    border-radius: 3px;
    background: transparent;
}

.nav-link.active .nav-indicator {
    background: var(--brand-secondary);
}

.nav-icon {
    color: #78867d;
}

.nav-link.active .nav-icon {
    color: var(--brand-secondary);
}

.nav-copy {
    min-width: 0;
}

.admin-shell.sidebar-collapsed {
    grid-template-columns: 78px minmax(0, 1fr);
}

.sidebar-collapsed .sidebar {
    padding-inline: 10px;
}

.sidebar-collapsed .sidebar-brand-row {
    flex-direction: column;
    margin-inline: 0;
}

.sidebar-collapsed .brand-name,
.sidebar-collapsed .org-switch-copy,
.sidebar-collapsed .nav-caption,
.sidebar-collapsed .nav-copy,
.sidebar-collapsed .side-status span,
.sidebar-collapsed .signout-button span {
    display: none;
}

.sidebar-collapsed .org-switch,
.sidebar-collapsed .side-status {
    justify-content: center;
}

.sidebar-collapsed .org-switch {
    padding-inline: 5px;
}

.sidebar-collapsed .nav-link {
    position: relative;
    justify-content: center;
    padding-inline: 0;
}

.sidebar-collapsed .nav-indicator {
    position: absolute;
    left: 0;
}

.sidebar-collapsed .signout-button {
    justify-content: center;
}

.nav-link strong,
.nav-link small {
    display: block;
}

.nav-link strong {
    font-size: 12px;
}

.nav-link small {
    margin-top: 3px;
    color: #8b9790;
    font-size: 10px;
}

.sidebar-bottom {
    margin-top: auto;
}

.side-status {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 12px 9px;
    color: #7c8980;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .65px;
}

.side-status i,
.live-refresh i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #61a77a;
    box-shadow: 0 0 0 3px #e6f2e8;
}

.sidebar-bottom form {
    border-top: 1px solid var(--line);
}

.signout-button {
    display: flex;
    width: 100%;
    justify-content: space-between;
    padding: 16px 9px 4px;
    border: 0;
    color: #65736b;
    background: none;
    font-size: 11px;
    cursor: pointer;
}

.app-main {
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    min-height: 90px;
    align-items: center;
    justify-content: space-between;
    padding: 16px clamp(22px, 4vw, 56px);
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .82);
    backdrop-filter: blur(8px);
}

.topbar-kicker {
    color: #9aa59e;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1px;
}

.topbar h1 {
    margin: 4px 0 0;
    font-size: 19px;
    font-weight: 700;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 9px;
}

.page-content {
    width: min(100%, 1440px);
    min-height: calc(100svh - 145px);
    margin: 0 auto;
    padding: 31px clamp(20px, 4vw, 56px) 56px;
}

.app-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 16px clamp(22px, 4vw, 56px);
    border-top: 1px solid var(--line);
    color: #9ba59f;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .55px;
}

.welcome-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.welcome-row h2,
.split-heading h2 {
    margin: 0 0 8px;
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 700;
}

.welcome-row p:last-child,
.split-heading p:last-child {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 34px;
}

.metric {
    min-height: 132px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #fff;
}

.metric-label {
    display: block;
    color: #8d9991;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .85px;
}

.metric>strong {
    display: block;
    margin: 14px 0 5px;
    font-family: 'Manrope', sans-serif;
    font-size: 31px;
    font-weight: 700;
    line-height: 1;
}

.metric>small {
    color: var(--muted);
    font-size: 10px;
}

.metric-accent {
    border-color: #cadccf;
    background: #e7f0e7;
}

.metric .metric-word {
    font-size: 24px;
}

.content-section {
    min-width: 0;
    padding: 21px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #fff;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 16px;
}

.section-heading h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
}

.section-heading p {
    margin-bottom: 6px;
}

.section-heading>div>p:last-child {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.count-pill {
    display: inline-grid;
    min-width: 23px;
    height: 22px;
    place-items: center;
    padding: 0 6px;
    border-radius: 20px;
    color: var(--forest);
    background: #e8f1e9;
    font-family: 'DM Sans', sans-serif;
    font-size: 10px;
    vertical-align: 2px;
}

.table-wrap {
    width: 100%;
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
    text-align: left;
}

th {
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    color: #9aa49e;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .7px;
}

td {
    padding: 13px 12px;
    border-bottom: 1px solid #eef0ec;
    color: #5e6b63;
    font-size: 11px;
}

tbody tr:last-child td {
    border-bottom: 0;
}

td strong {
    color: var(--ink);
    font-size: 11px;
}

.mono {
    color: #76847b;
    font-family: 'DM Sans', sans-serif;
    font-size: 10px;
}

.table-subline {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    font-size: 9px;
    font-weight: 800;
}

.status i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9da8a1;
}

.status-active {
    color: #357854;
}

.status-active i {
    background: #4b9c68;
}

.status-scheduled {
    color: #a97c30;
}

.status-scheduled i {
    background: #d3a248;
}

.status-paused {
    color: #a05b42;
}

.status-paused i {
    background: #cf7559;
}

.status-ended {
    color: #66736c;
}

.status-ended i {
    background: #85928a;
}

.status-cancelled,
.status-inactive {
    color: #a05248;
}

.status-cancelled i,
.status-inactive i {
    background: #ca6d5a;
}

.status-draft {
    color: #687981;
}

.status-draft i {
    background: #80959d;
}

.empty-inline {
    display: flex;
    min-height: 75px;
    align-items: center;
    gap: 14px;
    border-top: 1px solid var(--line);
}

.empty-inline>span {
    color: #bbcabd;
    font-family: 'Manrope', sans-serif;
    font-size: 22px;
}

.empty-inline strong {
    font-size: 12px;
}

.empty-inline p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.empty-inline>a {
    margin-left: auto;
    color: var(--forest);
    font-size: 11px;
    font-weight: 700;
}

.split-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 25px;
}

.election-page-heading {
    display: grid;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
    align-items: center;
}

.election-page-title,
.election-header-actions,
.session-picker-panel {
    min-width: 0;
}

.election-header-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.session-picker-panel,
.session-dropdown {
    width: 100%;
}

.election-create-trigger {
    flex: 0 0 auto;
    white-space: nowrap;
}

.management-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, .8fr);
    align-items: start;
    gap: 14px;
    margin-bottom: 16px;
}

.election-management-grid {
    grid-template-columns: minmax(0, 1fr);
}

.election-create-trigger {
    flex: 0 0 auto;
}

.management-grid>.create-panel,
.admin-account-manager {
    display: none;
}

.access-tab-panels>#access-panel-admins {
    grid-template-columns: minmax(0, 1fr);
}

.voter-groups-section {
    margin-bottom: 16px;
}

.voter-filter-section {
    min-width: 0;
    margin: 0 0 14px;
    padding: 0 0 14px;
    border-bottom: 1px solid var(--line);
}

.voter-filters {
    min-width: 0;
    max-width: 100%;
    margin-bottom: 0;
}

.voter-pagination {
    border-top: 0;
    padding-top: 0;
}

.voter-header-actions {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.voter-tools-menu[popover] {
    min-width: 228px;
}

.voter-export-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.voter-export-dialog>p {
    margin: 0 0 18px;
}

.csv-column-guide {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface-soft);
}

.csv-column-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.csv-column-heading>strong {
    font-size: 11px;
}

.csv-column-heading .quiet-link {
    flex: 0 0 auto;
    font-size: 10px;
}

.csv-column-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 10px;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: var(--surface);
}

.csv-column-list>div {
    display: grid;
    min-width: 0;
    gap: 5px;
    padding: 9px;
    border-right: 1px solid var(--line);
}

.csv-column-list>div:last-child {
    border-right: 0;
}

.csv-column-list code {
    overflow-wrap: anywhere;
    color: var(--ink);
    font-size: 10px;
    font-weight: 700;
}

.csv-column-list span {
    color: var(--muted);
    font-size: 9px;
}

.csv-column-list>div:last-child span {
    color: var(--brand-secondary-ink);
}

.csv-column-guide>p {
    margin: 9px 0 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.5;
}

.group-manager-layout {
    display: grid;
    grid-template-columns: minmax(230px, .8fr) minmax(0, 1.2fr);
    align-items: start;
    gap: 18px;
}

.group-create-form {
    margin: 0;
}

.voter-group-list {
    display: grid;
    min-width: 0;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
    column-gap: 14px;
    border-top: 1px solid var(--line);
}

.voter-group-row {
    display: flex;
    min-width: 0;
    min-height: 38px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 2px;
    border-bottom: 1px solid var(--line);
}

.voter-group-name {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--ink);
    font-size: 11px;
    font-weight: 600;
}

.voter-group-count {
    display: flex;
    flex: 0 0 auto;
    align-items: baseline;
    gap: 4px;
    color: var(--ink);
    font-size: 11px;
    font-weight: 700;
}

.voter-group-count small {
    color: var(--muted);
    font-size: 9px;
    font-weight: 500;
}

.generated-voter-id {
    display: grid;
    gap: 5px;
    padding: 11px 12px;
    border: 1px solid #dce7dc;
    border-radius: 4px;
    background: #f4f8f2;
}

.generated-voter-id span {
    color: var(--muted);
    font-size: 9px;
}

.generated-voter-id strong {
    color: var(--forest);
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
}

.create-panel {
    background: #fbfcf9;
}

.voter-management-grid {
    grid-template-columns: minmax(0, 1fr);
}

.create-panel h2 {
    margin: 0 0 18px;
    font-size: 17px;
}

.form-stack {
    display: grid;
    gap: 15px;
}

.form-stack.compact {
    gap: 12px;
}

label {
    display: grid;
    gap: 7px;
    color: #48564e;
    font-size: 11px;
    font-weight: 700;
}

input:not([type=radio]):not([type=checkbox]),
select,
textarea {
    width: 100%;
    min-width: 0;
    min-height: 39px;
    padding: 9px 11px;
    border: 1px solid #dfe5dd;
    border-radius: 4px;
    outline: 0;
    color: var(--ink);
    background: #fff;
    font-size: 11px;
    font-weight: 500;
}

textarea {
    min-height: 62px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #7eaa91;
    box-shadow: 0 0 0 3px rgba(83, 139, 103, .1);
}

input::placeholder,
textarea::placeholder {
    color: #a8b1ab;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.form-row input,
.form-row select {
    min-width: 0;
}

.schedule-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
    margin: 14px 0;
}

.schedule-form .form-row {
    display: contents;
}

.schedule-form button {
    white-space: nowrap;
}

.hint {
    font-size: 10px;
    font-weight: 400;
}

.check-label {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #68756d;
    font-weight: 500;
}

.check-label input {
    accent-color: var(--forest);
}

.election-list {
    display: grid;
}

.election-row {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
    padding: 12px 8px;
    border-bottom: 1px solid #edf0eb;
}

.election-row:last-child {
    border-bottom: 0;
}

.election-row.selected {
    background: color-mix(in srgb, var(--brand-secondary) 12%, var(--surface));
}

.election-date {
    display: grid;
    width: 42px;
    flex: 0 0 42px;
    justify-items: center;
    padding: 5px;
    border-radius: 4px;
    color: var(--forest);
    background: #e5efe5;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
}

.election-date strong {
    margin-top: 1px;
    font-family: 'Manrope', sans-serif;
    font-size: 17px;
}

.election-info {
    min-width: 0;
    flex: 1;
}

.election-info strong,
.election-info small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.election-info strong {
    font-size: 11px;
}

.election-info small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 9px;
}

.election-row>.status {
    font-size: 8px;
}

.election-workbench {
    margin-top: 17px;
}

.control-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.control-strip>span {
    margin-right: auto;
    color: var(--muted);
    font-size: 10px;
}

.control-strip form {
    margin: 0;
}

.session-dropdown {
    position: relative;
}

.session-current {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto 18px;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface-soft);
    cursor: pointer;
    list-style: none;
}

.session-current::-webkit-details-marker {
    display: none;
}

.session-current::marker {
    content: '';
}

.session-current .election-date {
    width: 42px;
    margin: 0;
}

.session-current .election-info {
    flex: initial;
}

.session-current .status {
    white-space: nowrap;
}

.session-chevron {
    width: 18px;
    height: 18px;
    color: var(--brand-secondary);
    transition: transform .16s ease;
}

.session-dropdown[open] .session-chevron {
    transform: rotate(180deg);
}

.session-menu {
    position: absolute;
    z-index: 30;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.session-search-label {
    margin-bottom: 10px;
}

.session-options {
    display: grid;
    max-height: min(45svh, 360px);
    overflow-y: auto;
}

.session-option {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 11px;
    padding: 9px 7px;
    border-bottom: 1px solid var(--line);
    border-radius: 3px;
}

.session-option:last-of-type {
    border-bottom: 0;
}

.session-option:hover,
.session-option.selected {
    background: color-mix(in srgb, var(--brand-secondary) 12%, var(--surface));
}

.session-option .election-info {
    flex: 1;
}

.session-option .status {
    flex: 0 0 auto;
    font-size: 9px;
}

.session-search-empty {
    margin: 10px 7px;
    font-size: 11px;
}

.builder-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 25px;
    padding-top: 23px;
}

.builder-column {
    min-width: 0;
}

.subsection-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 11px;
}

.subsection-heading h3 {
    margin: 0;
    font-size: 13px;
}

.subsection-heading>.muted {
    font-size: 9px;
}

.position-header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.position-list {
    margin-bottom: 12px;
}

.reusable-position-form {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.reusable-position-empty {
    margin: 14px 0 0;
    font-size: 10px;
}

.position-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 0;
    border-bottom: 1px solid #eff1ed;
}

.position-row.position-inactive {
    opacity: .58;
}

.position-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.position-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.position-actions form {
    margin: 0;
}

.position-order {
    color: #9bab9e;
    font-family: 'Manrope', sans-serif;
    font-size: 12px;
    font-weight: 800;
}

.position-row strong,
.position-row small {
    display: block;
}

.position-row strong {
    font-size: 11px;
}

.position-row small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 9px;
}

.inline-form {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 9px;
}

.inline-form>input,
.inline-form>select {
    min-width: 80px;
    flex: 1;
}

.inline-form>input[type=number] {
    max-width: 70px;
}

.inline-form>input[placeholder="Ballot no."] {
    max-width: 90px;
}

.position-create-form {
    display: grid;
    grid-template-columns: minmax(190px, 1fr) minmax(125px, .55fr) minmax(160px, .7fr) auto;
    align-items: end;
    gap: 9px;
    margin: 16px 0 0;
}

.position-create-field {
    min-width: 0;
}

.position-order-hint {
    color: var(--muted);
    font-size: 9px;
    font-weight: 400;
}

.position-create-dialog {
    width: min(540px, calc(100% - 28px));
}

.position-create-dialog .position-create-form {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 0;
}

.position-create-dialog .position-create-form .dialog-actions {
    margin-top: 6px;
}

@media (max-width: 760px) {
    .position-create-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .position-name-field {
        grid-column: 1 / -1;
    }
}

@media (max-width: 480px) {
    .position-create-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .position-name-field {
        grid-column: auto;
    }

    .position-create-form>.button {
        width: 100%;
    }

    .position-create-dialog .position-name-field,
    .position-create-dialog .position-create-form .dialog-actions {
        grid-column: auto;
    }
}

.space-top {
    margin-top: 25px;
}

.roster-form {
    margin-bottom: 12px;
}

.assign-candidate {
    flex-wrap: wrap;
}

.assign-candidate select {
    min-width: 130px;
}

.bulk-candidate-assignment {
    display: grid;
    gap: 12px;
    margin: 14px 0;
}

.candidate-assignment-list {
    display: grid;
    max-height: 300px;
    gap: 0;
    overflow-y: auto;
    margin: 0;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface-soft);
}

.candidate-assignment-list legend {
    padding: 0 5px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.candidate-assignment-option {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(72px, 100px);
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 5px 0;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    font-size: 10px;
}

.candidate-assignment-option:last-of-type {
    border-bottom: 0;
}

.candidate-assignment-choice {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
    color: var(--ink);
    cursor: pointer;
}

.candidate-assignment-choice>input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--brand-secondary);
}

.candidate-assignment-photo,
.candidate-assignment-avatar {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border-radius: 5px;
    object-fit: cover;
    color: var(--brand-secondary-on);
    background: var(--brand-secondary);
    font-size: 9px;
    font-weight: 800;
}

.candidate-assignment-choice>span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.candidate-assignment-option>input[type="text"] {
    min-height: 30px;
    padding: 5px 7px;
    font-size: 10px;
}

.candidate-assignment-list>.muted {
    margin: 8px 0;
    font-size: 10px;
}

.voter-assign-form {
    margin: 8px 0;
}

.voter-group-unassign-form {
    margin: 9px 0 14px;
}

.voter-group-unassign-form select {
    min-width: 0;
    flex: 1;
}

.election-action-menu {
    position: relative;
    z-index: 5;
    width: max-content;
    margin: 10px 0 14px;
}

.election-action-menu-ballot {
    margin: 0 0 14px auto;
}

.election-action-menu>summary {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    cursor: pointer;
}

.election-action-menu>summary::-webkit-details-marker {
    display: none;
}

.election-action-menu>summary::marker {
    content: '';
}

.election-action-menu>summary svg {
    width: 14px;
    height: 14px;
    transition: transform .16s ease;
}

.election-action-menu[open]>summary svg {
    transform: rotate(180deg);
}

.election-action-items {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    display: grid;
    min-width: 220px;
    max-width: calc(100vw - 32px);
    gap: 3px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.election-action-item {
    display: flex;
    min-height: 36px;
    align-items: center;
    gap: 9px;
    padding: 7px 9px;
    border: 0;
    border-radius: 3px;
    color: var(--ink);
    background: transparent;
    text-align: left;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
}

.election-action-item:hover:not(:disabled) {
    background: var(--surface-soft);
}

.election-action-item:disabled {
    color: var(--muted);
    cursor: not-allowed;
    opacity: .55;
}

.election-action-item svg {
    width: 15px;
    height: 15px;
    color: var(--brand-secondary);
}

.election-action-dialog {
    width: min(760px, calc(100% - 28px));
}

.election-action-dialog .schedule-form {
    margin: 0;
}

.election-action-dialog .voter-bulk-assignment,
.election-action-dialog .voter-group-unassign-form {
    margin: 0;
}

.voter-bulk-assignment {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
    margin: 9px 0 14px;
}

.voter-bulk-assignment button {
    white-space: nowrap;
}

.voter-assignment-dropdown {
    min-width: 0;
}

.voter-assignment-dropdown>summary {
    display: flex;
    min-height: 39px;
    align-items: center;
    gap: 9px;
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--ink);
    background: var(--surface);
    cursor: pointer;
    list-style: none;
    font-size: 11px;
    font-weight: 600;
}

.voter-assignment-dropdown>summary::-webkit-details-marker {
    display: none;
}

.voter-assignment-dropdown>summary::marker {
    content: '';
}

.voter-assignment-dropdown>summary:hover,
.voter-assignment-dropdown[open]>summary {
    border-color: var(--brand-secondary);
}

.voter-assignment-count {
    margin-left: auto;
    color: var(--muted);
    font-size: 10px;
    font-weight: 500;
}

.voter-assignment-dropdown>summary svg {
    width: 15px;
    height: 15px;
    color: var(--muted);
    transition: transform .16s ease;
}

.voter-assignment-dropdown[open]>summary svg {
    transform: rotate(180deg);
}

.voter-assignment-menu {
    display: grid;
    gap: 8px;
    margin-top: 6px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.voter-assignment-search {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 10px;
}

.voter-assignment-list {
    min-width: 0;
    max-height: 230px;
    margin: 0;
}

.voter-assignment-option {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
    padding: 8px 2px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
}

.voter-assignment-option:last-child {
    border-bottom: 0;
}

.voter-assignment-option input[type="checkbox"] {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    margin: 0;
    accent-color: var(--brand-secondary);
}

.voter-assignment-option span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.compact-table {
    margin-top: 12px;
    max-height: 340px;
}

.table-search {
    max-width: 200px;
}

.filter-form select {
    min-width: 210px;
}

.access-roles {
    margin-top: 16px;
}

.admin-account-manager {
    margin-top: 16px;
}

.admin-self-reset {
    max-width: 620px;
    align-items: end;
    margin: 0 0 16px;
}

.admin-self-reset button {
    min-height: 39px;
    justify-self: start;
}

.admin-picker select {
    min-width: 260px;
}

.admin-edit-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(230px, .65fr);
    gap: 22px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.account-identity {
    padding: 10px 12px;
    border: 1px solid #dce7dc;
    border-radius: 4px;
    background: #f4f8f2;
}

.account-identity .eyebrow {
    margin: 0;
}

.admin-reset-panel {
    align-self: start;
    padding: 15px;
    border: 1px solid #eadbd3;
    border-radius: 5px;
    background: #fffaf7;
}

.admin-reset-panel>p:not(.eyebrow) {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.6;
}

.reset-password-form {
    margin-top: 14px;
}

.audit-section {
    padding: 18px;
}

.audit-filters {
    display: grid;
    grid-template-columns: minmax(180px, 1.5fr) repeat(3, minmax(120px, .8fr)) auto auto;
    align-items: end;
    gap: 9px;
    margin-bottom: 15px;
}

.audit-filters label {
    min-width: 0;
}

.audit-filters .button {
    white-space: nowrap;
}

.audit-results-summary {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 10px;
}

.audit-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 11px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.audit-pagination>span {
    color: var(--muted);
    font-size: 10px;
}

.audit-pagination .disabled {
    pointer-events: none;
    opacity: .45;
}

.role-grid {
    display: grid;
    grid-template-columns: minmax(250px, .8fr) minmax(0, 1.2fr);
    gap: 24px;
}

.role-create {
    min-width: 0;
    padding-right: 22px;
    border-right: 1px solid var(--line);
}

.role-create h3,
.role-entry h3 {
    margin: 0 0 14px;
    font-size: 14px;
}

.permission-fieldset {
    min-width: 0;
    margin: 0;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 4px;
}

.permission-fieldset legend {
    padding: 0 5px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

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

.permission-option {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    gap: 7px;
    padding: 7px;
    border-radius: 3px;
    background: #f7f9f5;
    cursor: pointer;
}

.permission-option input {
    flex: 0 0 auto;
    margin: 2px 0 0;
    accent-color: var(--forest);
}

.permission-option span {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.permission-option strong {
    color: var(--ink);
    font-size: 9px;
    line-height: 1.35;
}

.permission-option small {
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 8px;
    font-weight: 500;
}

.role-list {
    min-width: 0;
}

.role-entry {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.role-entry:first-child {
    padding-top: 0;
}

.role-entry:last-child {
    border-bottom: 0;
}

.role-entry-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.role-entry-heading .eyebrow {
    margin-bottom: 5px;
    font-size: 8px;
}

.role-entry h3 {
    margin-bottom: 8px;
}

.role-entry>.muted {
    margin: 0;
    font-size: 10px;
    line-height: 1.6;
}

.role-details summary {
    width: fit-content;
    margin-bottom: 12px;
    color: var(--forest);
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
}

.role-details[open] summary {
    margin-bottom: 15px;
}

.role-details form {
    max-width: 650px;
}

/* Results */
.results-summary {
    margin-bottom: 15px;
    padding: 22px;
    border-radius: 5px;
    color: var(--ink);
    background-color: rgba(var(--brand-primary-rgb), .08);
    background-image: repeating-linear-gradient(135deg, transparent 0 31px, rgba(var(--brand-primary-rgb), .035) 32px 33px);
}

.result-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.result-title h2 {
    margin: 11px 0 18px;
    font-size: 21px;
}

.results-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.export-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-title .status-active {
    color: var(--ink);
}

.result-title .status-active i {
    box-shadow: 0 0 0 3px rgba(96, 177, 123, .16);
}

.result-title .status-scheduled {
    color: var(--ink);
}

.live-refresh {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .6px;
}

.live-refresh-final i {
    background: var(--brand-primary);
    box-shadow: none;
}

.result-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 17px 0 14px;
    border-top: 1px solid rgba(var(--brand-primary-rgb), .16);
}

.result-metrics>div>span {
    display: block;
    color: var(--muted);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .75px;
}

.result-metrics strong {
    display: block;
    margin-top: 8px;
    font-family: 'Manrope', sans-serif;
    font-size: 24px;
    font-weight: 700;
}

.result-metrics strong small {
    display: inline;
    margin-left: 3px;
    color: var(--muted);
    font-size: 12px;
}

.turnout-track,
.result-track {
    height: 5px;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(var(--brand-primary-rgb), .16);
}

.turnout-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #e2a278;
    transition: width .4s ease;
}

.results-report-surface {
    display: grid;
    gap: 16px;
}

.results-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 14px;
}

.results-analytics {
    padding: 20px 18px 18px;
}

.results-tabs>.workbench-tabs {
    margin: 4px 0 0;
}

.voter-tabs {
    min-width: 0;
    margin-bottom: 18px;
}

.voter-tabs>.workbench-tabs {
    margin: 4px 0 16px;
}

.voter-tab-panel {
    min-width: 0;
}

.voter-tab-panel[hidden] {
    display: none !important;
}

.results-tab-panel[hidden] {
    display: none !important;
}

.results-tab-panel[role="tabpanel"] {
    min-width: 0;
}

.results-analytics>.section-heading p:not(.eyebrow) {
    margin: 6px 0 0;
    font-size: 11px;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.analytics-card {
    display: grid;
    gap: 6px;
    padding: 14px 12px;
    border: 1px solid rgba(var(--brand-primary-rgb), .12);
    border-radius: 6px;
    background: rgba(var(--brand-primary-rgb), .06);
}

.analytics-card span {
    color: var(--muted);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .7px;
    text-transform: uppercase;
}

.analytics-card strong {
    font-family: 'Manrope', sans-serif;
    font-size: 24px;
    line-height: 1.1;
}

.analytics-card small {
    color: var(--muted);
    font-size: 10px;
}

.analytics-table-wrap {
    margin-top: 14px;
    overflow: auto;
}

.analytics-table {
    width: 100%;
    border-collapse: collapse;
}

.analytics-table th,
.analytics-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    font-size: 12px;
}

.analytics-table thead th {
    color: var(--muted);
    font-size: 9px;
    letter-spacing: .75px;
    text-transform: uppercase;
}

.insight-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
    margin: 25px 0 12px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.insight-section-heading h3 {
    margin: 4px 0 0;
    font-size: 16px;
}

.insight-section-heading>span {
    color: var(--muted);
    font-size: 10px;
}

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

.insight-chart,
.group-insight {
    min-width: 0;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
}

.insight-chart h4,
.group-insight h4 {
    margin: 0;
    font-size: 13px;
}

.insight-chart>p {
    margin: 4px 0 17px;
    color: var(--muted);
    font-size: 10px;
}

.insight-bar-row {
    min-width: 0;
    margin-top: 15px;
}

.insight-bar-label {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    font-size: 10px;
}

.insight-bar-label strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.insight-bar-label span {
    flex: 0 0 auto;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.insight-bar-track {
    position: relative;
    height: 8px;
    margin: 12px 18px 17px 0;
    border-radius: 10px;
    background: var(--line);
}

.insight-bar-track>span {
    position: absolute;
    inset: 0 auto 0 0;
    min-width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand-secondary), #d59168);
}

.insight-bar-track>img,
.insight-bar-track>b {
    position: absolute;
    top: 50%;
    z-index: 1;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    transform: translate(-50%, -50%);
    border: 2px solid var(--surface);
    border-radius: 50%;
    background: var(--brand-secondary);
    box-shadow: 0 1px 4px rgba(25, 38, 29, .2);
    color: var(--brand-secondary-on);
    font-size: 9px;
    font-weight: 800;
}

.insight-bar-track>img {
    object-fit: cover;
}

.group-results-map {
    min-width: 0;
    margin: 0 0 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
}

.group-results-map-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.group-results-map-heading>span:last-child {
    color: var(--muted);
    font-size: 10px;
    text-align: right;
}

.group-map-board {
    position: relative;
    display: grid;
    min-width: 0;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
    gap: 10px;
    overflow: hidden;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background-color: var(--surface);
    background-image: linear-gradient(to right, color-mix(in srgb, var(--line) 34%, transparent) 1px, transparent 1px), linear-gradient(to bottom, color-mix(in srgb, var(--line) 34%, transparent) 1px, transparent 1px);
    background-size: 38px 38px;
}

.group-map-node {
    position: relative;
    z-index: 1;
    display: grid;
    min-width: 0;
    min-height: 54px;
    grid-template-columns: 20px minmax(0, 1fr);
    align-content: center;
    align-items: center;
    gap: 3px 8px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 5px;
    color: var(--ink);
    background: var(--surface);
    text-align: left;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.group-map-node:hover {
    transform: translateY(-2px);
    border-color: var(--brand-secondary);
}

.group-map-node.active,
.group-map-node[aria-pressed="true"] {
    border-color: var(--brand-secondary);
    background: color-mix(in srgb, var(--brand-secondary) 13%, var(--surface));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-secondary) 22%, transparent);
}

.group-map-node>[data-lucide] {
    width: 17px;
    height: 17px;
    grid-row: 1 / 3;
    color: var(--brand-secondary);
}

.group-map-node>span {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 11px;
    font-weight: 700;
}

.group-map-node>small {
    grid-column: 2;
    color: var(--muted);
    font-size: 9px;
}

.group-map-node>small b {
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.group-insight-heading {
    margin-top: 28px;
}

.group-insight-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--line);
}

.group-insight-title .eyebrow {
    margin: 0 0 4px;
}

.group-insight-title>strong {
    flex: 0 0 auto;
    font-size: 16px;
    text-align: right;
}

.group-insight-title>strong small {
    display: block;
    color: var(--muted);
    font-size: 8px;
    font-weight: 600;
}

.group-insight-empty-note {
    margin: 13px 0 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.5;
}

.group-insight-row:first-of-type {
    margin-top: 13px;
}

.group-insight-empty {
    grid-column: 1 / -1;
}

.result-position .section-heading {
    align-items: start;
}

.result-position .section-heading>.muted {
    padding-top: 4px;
    font-size: 9px;
}

.candidate-result {
    padding: 12px 0;
    border-top: 1px solid #eef0ec;
}

.candidate-management-panel {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.candidate-manager-list {
    display: grid;
    gap: 12px;
}

.candidate-manager-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.candidate-avatar-wrap {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    overflow: hidden;
    border-radius: 10px;
    background: var(--mint);
}

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

.candidate-manager-avatar {
    color: var(--forest);
    font-size: 12px;
    font-weight: 800;
}

.candidate-manager-meta {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.candidate-manager-meta strong {
    font-size: 13px;
}

.candidate-manager-meta small {
    color: var(--muted);
}

.candidate-assigned-tag {
    display: inline-flex;
    align-self: flex-start;
    padding: 3px 8px;
    border-radius: 999px;
    background: #edf4ef;
    color: var(--forest-dark);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .02em;
}

.muted-tag {
    background: #f3f4f3;
    color: var(--muted);
}

.candidate-manager-action {
    margin-left: auto;
}

.danger-text {
    color: #b94949;
}

.candidate-result-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.candidate-result-person {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
}

.candidate-result-person>strong {
    min-width: 0;
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.candidate-result-person .candidate-number {
    flex: 0 0 auto;
}

.result-lead-indicator {
    display: inline-grid;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    place-items: center;
    border-radius: 50%;
}

.result-lead-indicator[data-state="leader"] {
    color: #8d641a;
    background: #f5ebcf;
}

.result-lead-indicator[data-state="tie"] {
    color: var(--brand-secondary);
    background: color-mix(in srgb, var(--brand-secondary) 16%, var(--surface));
}

.result-lead-indicator svg {
    width: 13px;
    height: 13px;
    stroke-width: 2.5;
}

body[data-theme="dark"] .result-lead-indicator[data-state="leader"] {
    color: #f0c969;
    background: #493d21;
}

.candidate-number {
    color: var(--forest);
    font-size: 9px;
    font-weight: 800;
}

.candidate-tally {
    display: flex;
    align-items: baseline;
    gap: 9px;
}

.candidate-tally strong {
    font-family: 'Manrope', sans-serif;
    font-size: 17px;
}

.candidate-tally span {
    min-width: 42px;
    color: var(--muted);
    font-size: 9px;
    text-align: right;
}

.result-track {
    position: relative;
    height: 6px;
    overflow: visible;
    background: #eef1ec;
}

.result-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand-primary), #77a583);
    transition: width .65s cubic-bezier(.2, .75, .25, 1);
}

.result-track-marker {
    position: absolute;
    top: 50%;
    left: clamp(16px, var(--result-marker-position), calc(100% - 16px));
    z-index: 1;
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    transform: translate(-50%, -50%);
    border: 2px solid var(--surface);
    border-radius: 50%;
    background: var(--brand-secondary);
    box-shadow: 0 1px 4px rgba(25, 38, 29, .2);
    color: var(--brand-secondary-on);
    font-size: 9px;
    font-weight: 800;
    transition: left .65s cubic-bezier(.2, .75, .25, 1), box-shadow .3s ease;
}

.result-track-marker:is(img) {
    object-fit: cover;
}

.vote-count-update {
    animation: result-count-arrival .55s cubic-bezier(.2, .75, .25, 1);
}

.vote-bar-update {
    animation: result-bar-arrival .65s ease-out;
}

.vote-marker-update {
    animation: result-marker-arrival .65s cubic-bezier(.2, .75, .25, 1);
}

@keyframes result-count-arrival {
    40% {
        color: var(--brand-primary);
        transform: scale(1.2);
    }

    100% {
        color: inherit;
        transform: scale(1);
    }
}

@keyframes result-bar-arrival {
    45% {
        filter: brightness(1.25);
    }

    100% {
        filter: brightness(1);
    }
}

@keyframes result-marker-arrival {
    40% {
        box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand-secondary) 24%, transparent);
        transform: translate(-50%, -50%) scale(1.16);
    }

    100% {
        box-shadow: 0 1px 4px rgba(25, 38, 29, .2);
        transform: translate(-50%, -50%) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {

    .result-track i,
    .result-track-marker {
        transition: none;
    }

    .vote-count-update,
    .vote-bar-update,
    .vote-marker-update {
        animation: none;
    }
}

.result-certificate {
    padding: 20px;
    border-left: 3px solid #32845a;
}

.result-certificate-invalid {
    border-left-color: #b94949;
}

.result-certificate .section-heading {
    align-items: center;
    margin-bottom: 16px;
}

.result-certificate .section-heading h2 {
    margin: 3px 0;
    font-size: 18px;
}

.result-certificate-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 12px 18px;
    margin: 0 0 16px;
}

.result-certificate-details dt {
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
}

.result-certificate-details dd {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--ink);
    font-family: monospace;
    font-size: 10px;
    line-height: 1.6;
}

.result-certificate-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Voter ballot */
.voter-shell {
    width: min(100% - 36px, 910px);
    min-height: 100svh;
    margin: auto;
    padding-bottom: 54px;
}

.voter-top {
    display: flex;
    height: 76px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}

.voter-account {
    display: flex;
    align-items: center;
    gap: 18px;
    color: #66736b;
    font-size: 11px;
}

.voter-account form {
    margin: 0;
}

.ballot-heading {
    padding: 43px 0 24px;
}

.ballot-heading h1 {
    margin: 0 0 9px;
    font-size: clamp(25px, 5vw, 37px);
}

.ballot-heading>p:last-child {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
}

.dot-separator {
    padding: 0 7px;
    color: #aeb9b0;
}

.live-label {
    color: #38845b;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .7px;
}

.ballot-progress {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 0 20px;
    color: var(--muted);
    font-size: 10px;
}

.progress-track {
    height: 5px;
    flex: 1;
    overflow: hidden;
    border-radius: 8px;
    background: #e3e9e1;
}

.progress-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--brand-primary);
    transition: width .3s ease;
}

.ballot-step {
    display: none;
    padding: clamp(18px, 4vw, 30px);
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(31, 67, 49, .035);
}

.ballot-step.active {
    display: block;
    animation: ballot-step-enter .42s cubic-bezier(.2, .75, .25, 1) both;
}

.ballot-step.active .candidate-choice {
    animation: ballot-choice-enter .38s cubic-bezier(.2, .75, .25, 1) both;
}

.ballot-step.active .candidate-choice:nth-child(2) {
    animation-delay: 45ms;
}

.ballot-step.active .candidate-choice:nth-child(3) {
    animation-delay: 90ms;
}

.ballot-step.active .candidate-choice:nth-child(4) {
    animation-delay: 135ms;
}

@keyframes ballot-step-enter {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ballot-choice-enter {
    from {
        opacity: 0;
        transform: translateY(9px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-heading {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 24px;
}

.step-count {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 50%;
    color: var(--forest);
    background: #e6f0e7;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 800;
}

.step-heading .eyebrow {
    margin: 3px 0 5px;
}

.step-heading h2 {
    margin: 0 0 4px;
    font-size: 22px;
}

.step-heading p:last-child {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
}

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

.candidate-choice {
    display: grid;
    gap: 6px;
}

.candidate-option {
    position: relative;
    display: block;
    cursor: pointer;
}

.candidate-option>input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.candidate-card {
    display: flex;
    min-height: 84px;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid #e4eae2;
    border-radius: 5px;
    background: #fff;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.candidate-option:hover .candidate-card {
    border-color: #abc7b1;
}

.candidate-option>input:checked+.candidate-card {
    border-color: var(--forest);
    background: #f0f6ef;
    box-shadow: inset 0 0 0 1px var(--forest);
}

.candidate-choice.vote-confirmed .candidate-card {
    animation: ballot-choice-confirm .48s cubic-bezier(.2, .75, .25, 1) both;
}

.candidate-choice.vote-confirmed .candidate-vote-button [data-lucide] {
    animation: ballot-icon-confirm .42s cubic-bezier(.2, .75, .25, 1) both;
}

@keyframes ballot-choice-confirm {
    40% {
        box-shadow: inset 0 0 0 1px var(--forest), 0 0 0 4px color-mix(in srgb, var(--brand-secondary) 22%, transparent);
    }

    100% {
        box-shadow: inset 0 0 0 1px var(--forest), 0 0 0 0 transparent;
    }
}

@keyframes ballot-icon-confirm {
    45% {
        transform: scale(1.28);
    }

    100% {
        transform: scale(1);
    }
}

.candidate-option>input:focus-visible+.candidate-card {
    outline: 3px solid rgba(66, 126, 83, .25);
}

.candidate-avatar {
    display: grid;
    width: 43px;
    height: 43px;
    flex: 0 0 43px;
    place-items: center;
    border-radius: 50%;
    color: var(--brand-secondary-on);
    background: var(--brand-secondary);
    font-family: 'Manrope', sans-serif;
    font-size: 12px;
    font-weight: 800;
}

.candidate-choice:nth-child(3n + 2) .candidate-avatar {
    background: #bd755c;
}

.candidate-choice:nth-child(3n) .candidate-avatar {
    background: #a28b54;
}

.candidate-photo {
    display: block;
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    border-radius: 50%;
    object-fit: cover;
    background: #e7eee7;
}

.candidate-details {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.candidate-details strong {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.candidate-details small {
    color: var(--muted);
    font-size: 9px;
}

.candidate-details .candidate-bio {
    display: -webkit-box;
    overflow: hidden;
    max-width: 330px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    line-height: 1.45;
}

.selection-mark {
    display: grid;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    place-items: center;
    margin-left: auto;
    border: 1px solid #dbe2da;
    border-radius: 50%;
    color: transparent;
    font-size: 11px;
}

.candidate-option>input:checked+.candidate-card .selection-mark {
    border-color: var(--forest);
    color: var(--brand-primary-on);
    background: var(--brand-primary);
}

.candidate-vote-button {
    display: flex;
    min-height: 34px;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    border: 1px solid #dfe8de;
    border-radius: 4px;
    color: var(--forest);
    background: #f8faf6;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.candidate-vote-button:hover,
.candidate-vote-button.selected {
    color: var(--brand-primary-on);
    border-color: var(--forest);
    background: var(--brand-primary);
}

.candidate-vote-button [data-lucide] {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    stroke-width: 2.2;
}

.votesphere-swal {
    border: 1px solid var(--line) !important;
    border-radius: 8px !important;
    background: var(--surface) !important;
    color: var(--ink) !important;
    box-shadow: var(--shadow) !important;
    font-family: 'DM Sans', sans-serif !important;
}

.votesphere-swal .swal2-title {
    color: var(--ink);
    font-family: 'Manrope', sans-serif;
    font-size: 22px;
}

.votesphere-swal .swal2-html-container {
    color: var(--muted);
    font-size: 11px;
}

.votesphere-swal .swal2-actions {
    gap: 8px;
}

.votesphere-swal .swal2-styled.swal2-confirm,
.votesphere-swal .swal2-styled.swal2-cancel {
    border: 0 !important;
    font-weight: 700;
}

.votesphere-swal .swal2-styled.swal2-confirm {
    color: var(--brand-primary-on) !important;
    background: var(--brand-primary) !important;
}

.votesphere-swal .swal2-styled.swal2-cancel {
    color: var(--ink) !important;
    background: var(--surface-soft) !important;
    border: 1px solid var(--line) !important;
}

.swal-ballot-review {
    max-height: 43vh;
    overflow: auto;
    text-align: left;
}

.swal-position-review {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.swal-position-review>span {
    display: block;
    margin-bottom: 7px;
    color: var(--forest);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .6px;
    text-transform: uppercase;
}

.swal-candidate-choice {
    display: flex;
    min-height: 48px;
    align-items: center;
    gap: 10px;
    padding: 3px 0;
    color: var(--ink);
}

.swal-candidate-choice strong {
    font-size: 11px;
}

.swal-candidate-photo,
.swal-candidate-initials {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border-radius: 50%;
    object-fit: cover;
    color: var(--brand-secondary-on);
    background: var(--brand-secondary);
    font-size: 10px;
    font-weight: 800;
}

.swal-warning-copy {
    margin: 14px 0 0;
    padding: 10px;
    border-left: 3px solid var(--coral);
    color: #8d5748;
    background: #fff5f0;
    font-size: 10px;
    text-align: left;
}

.ballot-actions {
    display: flex;
    min-height: 74px;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.ballot-actions .muted {
    margin-right: auto;
    font-size: 10px;
}

.review-dialog {
    width: min(calc(100% - 30px), 490px);
    max-height: min(85svh, 720px);
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--ink);
    background: #fff;
    box-shadow: 0 22px 90px rgba(14, 40, 30, .2);
}

.review-dialog::backdrop {
    background: rgba(14, 37, 29, .5);
    backdrop-filter: blur(3px);
}

.review-dialog h2 {
    margin: 0 0 18px;
    font-size: 23px;
}

.dialog-close {
    position: absolute;
    top: 12px;
    right: 15px;
    border: 0;
    color: var(--muted);
    background: transparent;
    font-size: 22px;
    cursor: pointer;
}

.review-list {
    max-height: 42svh;
    overflow: auto;
}

.review-item {
    padding: 11px 0;
    border-top: 1px solid var(--line);
}

.review-item strong,
.review-item span {
    display: block;
}

.review-item strong {
    margin-bottom: 5px;
    font-size: 11px;
}

.review-item span {
    color: var(--muted);
    font-size: 11px;
}

.warning-copy {
    margin: 18px 0;
    padding: 11px;
    border-left: 3px solid var(--coral);
    color: #8d5748;
    background: #fff5f0;
    font-size: 11px;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
}

.receipt-panel,
.empty-state {
    display: grid;
    justify-items: center;
    padding: 15vh 16px 30px;
    text-align: center;
}

.receipt-panel h1,
.empty-state h1 {
    margin: 9px 0;
    font-size: 34px;
}

.receipt-panel>p:not(.eyebrow),
.empty-state>p:not(.eyebrow) {
    max-width: 410px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}

.receipt-icon {
    display: grid;
    width: 56px;
    height: 56px;
    place-items: center;
    margin-bottom: 22px;
    border-radius: 50%;
    color: var(--brand-primary-on);
    background: var(--brand-primary);
    font-size: 24px;
}

.receipt-selections {
    width: min(100%, 440px);
    margin: 13px 0 18px;
    padding: 15px 18px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #fff;
    text-align: left;
}

.receipt-selections>.eyebrow {
    margin-bottom: 9px;
}

.receipt-choice {
    display: flex;
    min-height: 58px;
    align-items: center;
    gap: 11px;
    padding: 8px 0;
    border-top: 1px solid #edf0eb;
}

.receipt-choice img,
.receipt-initials {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    border-radius: 50%;
    object-fit: cover;
    color: var(--brand-secondary-on);
    background: var(--brand-secondary);
    font-size: 10px;
    font-weight: 800;
}

.receipt-choice>span:last-child {
    display: grid;
    gap: 4px;
}

.receipt-choice small {
    color: var(--muted);
    font-size: 9px;
}

.receipt-choice strong {
    color: var(--ink);
    font-size: 11px;
}

.receipt-panel code {
    margin: 7px 0 23px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--forest);
    background: #fff;
    font-size: 12px;
    letter-spacing: 1px;
}

.empty-state .button {
    margin-top: 10px;
}

.voter-home-heading {
    padding: 48px 0 28px;
}

.voter-home-heading h1 {
    max-width: 720px;
    margin: 0 0 10px;
    font-size: clamp(28px, 5vw, 42px);
}

.voter-home-heading>p:last-child {
    max-width: 550px;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}

.voter-election-section {
    padding: clamp(17px, 4vw, 27px);
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

.voter-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.voter-section-heading h2 {
    margin: 0;
    font-size: 18px;
}

.voter-section-heading .eyebrow {
    margin-bottom: 6px;
}

.voter-election-list {
    border-top: 1px solid var(--line);
}

.voter-election {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 17px 4px;
    border-bottom: 1px solid #edf0eb;
}

.voter-election:last-child {
    border-bottom: 0;
}

.voter-election-date {
    display: grid;
    width: 50px;
    min-height: 58px;
    align-content: center;
    justify-items: center;
    border-radius: 4px;
    color: var(--forest);
    background: #e9f1e9;
}

.voter-election-date span {
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
}

.voter-election-date strong {
    font-family: 'Manrope', sans-serif;
    font-size: 21px;
    line-height: 1.1;
}

.voter-election-date small {
    margin-top: 2px;
    color: #72827a;
    font-size: 8px;
}

.voter-election-info {
    min-width: 0;
}

.voter-election-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 13px;
}

.voter-election-title h3 {
    margin: 0;
    font-size: 14px;
}

.voter-election-info>p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.5;
}

.voter-election-time {
    display: block;
    margin-top: 7px;
    color: #77847d;
    font-size: 9px;
}

.voter-election-time span {
    padding: 0 4px;
    color: #a5afa8;
}

.voter-election-action {
    display: flex;
    justify-content: flex-end;
}

.voter-election-action .button {
    white-space: nowrap;
}

.voter-state-note {
    color: var(--muted);
    font-size: 10px;
    text-align: right;
}

.voter-empty {
    display: grid;
    justify-items: center;
    padding: 54px 20px 46px;
    border-top: 1px solid var(--line);
    text-align: center;
}

.empty-calendar {
    display: grid;
    width: 43px;
    height: 43px;
    place-items: center;
    margin-bottom: 12px;
    border-radius: 50%;
    color: var(--forest);
    background: var(--mint);
    font-size: 18px;
}

.voter-empty h3 {
    margin: 0 0 6px;
    font-size: 14px;
}

.voter-empty p {
    max-width: 360px;
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.6;
}

.voter-home-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 32px;
    padding-top: 13px;
    border-top: 1px solid var(--line);
    color: #9ba59f;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .5px;
}

@keyframes reveal {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1050px) {
    .responsive-create-panel {
        display: none;
    }

    .responsive-create-trigger {
        display: inline-flex;
        width: 100%;
        justify-content: center;
        margin-bottom: 16px;
    }

    .admin-shell {
        grid-template-columns: 215px minmax(0, 1fr);
    }

    .sidebar {
        padding-inline: 12px;
    }

    .sidebar-collapsed .sidebar {
        padding-inline: 10px;
    }

    .management-grid {
        grid-template-columns: 1fr;
    }

    .group-manager-layout {
        grid-template-columns: 1fr;
    }

    .create-panel {
        max-width: none;
    }

    .builder-grid {
        gap: 16px;
    }

    .voter-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .voter-filters>label:first-of-type {
        grid-column: 1 / -1;
    }

    .voter-filters>label,
    .voter-filters>label input,
    .voter-filters>label select {
        min-width: 0;
        width: 100%;
    }

    .voter-filters>.button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 760px) {
    .login-layout {
        grid-template-columns: 1fr;
        grid-template-rows: 43svh minmax(0, 1fr);
        min-height: 100svh;
    }

    .login-story {
        --ballot-drop-offset: clamp(120px, 16svh, 134px);
        min-height: 0;
        height: 43svh;
        gap: 8px;
        padding: 10px 18px 8px;
    }

    .voting-process-visual {
        width: 100%;
        min-height: 0;
        padding: 8px 12px 7px;
    }

    .vote-stage {
        min-height: 0;
    }

    .ballot-box {
        width: 158px;
        height: 58px;
    }

    .box-slot {
        width: 62px;
        height: 5px;
    }

    .ballot-sheet {
        width: 132px;
        gap: 6px;
        padding: 8px 10px;
    }

    .review-card {
        top: 54px;
        right: 1%;
        width: 128px;
        gap: 4px;
        padding: 8px;
    }

    .review-card strong {
        font-size: 11px;
    }

    .review-detail {
        font-size: 9px;
    }

    .cast-trail {
        top: 74px;
        bottom: 64px;
    }

    .login-form-wrap {
        min-height: 0;
        padding: 12px 22px 14px;
    }

    .login-form-box {
        align-self: center;
    }

    .security-page-header {
        min-height: 34px;
    }

    .security-brand {
        gap: 8px;
        font-size: 15px;
    }

    .security-brand img {
        max-width: 128px;
        height: 30px;
    }

    .login-form-box h2 {
        margin: 6px 0 5px;
    }

    .login-form-box>.muted {
        margin-bottom: 12px;
    }

    .login-form-box .form-stack {
        gap: 10px;
    }

    .login-footnote {
        margin: 10px 0;
    }

    .security-note {
        margin-top: 10px;
    }

    .admin-shell {
        display: block;
    }

    .sidebar {
        position: relative;
        display: grid;
        height: auto;
        min-height: 0;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "brand brand"
            "nav logout";
        align-items: center;
        column-gap: 8px;
        padding: 12px 15px 0;
        overflow: visible;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .sidebar-brand-row {
        grid-area: brand;
        margin: 0 0 10px 2px;
    }

    .org-switch,
    .nav-caption {
        display: none;
    }

    .side-nav {
        grid-area: nav;
        display: flex;
        min-width: 0;
        min-height: 0;
        flex: 0 0 auto;
        gap: 5px;
        margin: 0 -2px;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 7px;
        scrollbar-width: thin;
    }

    .sidebar-bottom {
        grid-area: logout;
        display: flex;
        align-self: center;
        justify-content: flex-end;
        margin: 0;
    }

    .sidebar-bottom .side-status {
        display: none;
    }

    .sidebar-bottom form {
        border: 0;
    }

    .signout-button {
        width: auto;
        align-items: center;
        justify-content: flex-start;
        gap: 7px;
        padding: 6px 8px 9px;
    }

    .sidebar-collapsed .sidebar {
        padding-bottom: 0;
    }

    .sidebar-collapsed .sidebar-brand-row {
        flex-direction: row;
        margin-bottom: 0;
    }

    .sidebar-collapsed .brand-name {
        display: inline;
    }

    .sidebar-collapsed .side-nav {
        display: none;
    }

    .nav-link {
        min-height: 43px;
        flex: 0 0 auto;
        gap: 7px;
        padding: 6px 10px;
    }

    .nav-icon {
        width: 15px;
        height: 15px;
        flex-basis: 15px;
    }

    .nav-indicator {
        display: none;
    }

    .nav-link strong {
        font-size: 10px;
    }

    .sidebar-collapsed .nav-link {
        justify-content: flex-start;
        padding-inline: 10px;
    }

    .nav-link small {
        display: none;
    }

    .topbar {
        min-height: 70px;
        padding: 12px 18px;
    }

    .page-content {
        min-height: calc(100svh - 170px);
        padding: 23px 16px 40px;
    }

    .app-footer {
        flex-wrap: wrap;
        padding: 14px 18px;
        font-size: 8px;
    }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .metric {
        min-height: 112px;
        padding: 13px;
    }

    .metric>strong {
        margin-top: 12px;
        font-size: 26px;
    }

    .metric .metric-word {
        font-size: 21px;
    }

    .welcome-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .welcome-row .button {
        align-self: stretch;
    }

    .content-section {
        padding: 15px;
    }

    .builder-grid {
        grid-template-columns: 1fr;
    }

    .role-grid {
        grid-template-columns: 1fr;
    }

    .admin-edit-layout {
        grid-template-columns: 1fr;
    }

    .audit-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .role-create {
        padding: 0 0 20px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .insight-chart-grid,
    .group-insight-grid {
        grid-template-columns: 1fr;
    }

    .insight-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .result-metrics {
        grid-template-columns: repeat(2, 1fr);
        row-gap: 17px;
    }

    .result-metrics strong {
        font-size: 21px;
    }

    .result-title {
        align-items: flex-start;
        flex-direction: column;
        gap: 0;
    }

    .result-title h2 {
        margin-bottom: 13px;
    }

    .control-strip {
        flex-wrap: wrap;
    }

    .control-strip>span {
        flex-basis: 100%;
    }

    .empty-inline {
        flex-wrap: wrap;
        padding: 10px 0;
    }

    .empty-inline>a {
        margin-left: 36px;
    }
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .schedule-form {
        grid-template-columns: 1fr;
    }

    .schedule-form .form-row {
        display: grid;
        grid-template-columns: 1fr;
    }

    .voter-bulk-assignment {
        grid-template-columns: 1fr;
    }

    .voter-bulk-assignment button {
        width: 100%;
    }

    .split-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .voter-header-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .election-page-heading {
        grid-template-columns: 1fr;
    }

    .election-header-actions {
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
    }

    .election-create-trigger {
        justify-self: start;
    }

    .filter-form,
    .filter-form select {
        width: 100%;
    }

    .audit-filters {
        grid-template-columns: 1fr;
    }

    .voter-filters {
        grid-template-columns: minmax(0, 1fr);
    }

    .voter-filters>label:first-of-type {
        grid-column: auto;
    }

    .audit-filters .button {
        width: 100%;
    }

    .section-heading {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .section-heading .table-search {
        max-width: 100%;
    }

    .candidate-grid {
        grid-template-columns: 1fr;
    }

    .candidate-card {
        min-height: 76px;
    }

    .voter-shell {
        width: min(100% - 26px, 910px);
    }

    .voter-home-heading {
        padding: 32px 0 20px;
    }

    .voter-election {
        grid-template-columns: 46px minmax(0, 1fr);
        gap: 11px;
    }

    .voter-election-date {
        width: 44px;
        min-height: 54px;
    }

    .voter-election-title {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .voter-election-title h3 {
        font-size: 12px;
    }

    .voter-election-action {
        grid-column: 2;
        justify-content: flex-start;
    }

    .voter-election-action .button {
        min-height: 37px;
    }

    .voter-state-note {
        text-align: left;
    }

    .voter-home-footer {
        flex-wrap: wrap;
        line-height: 1.5;
    }

    .voter-top {
        height: 65px;
    }

    .voter-account {
        gap: 10px;
        font-size: 10px;
    }

    .ballot-heading {
        padding: 31px 0 17px;
    }

    .ballot-step {
        padding: 18px 14px;
    }

    .step-heading h2 {
        font-size: 19px;
    }

    .ballot-actions {
        gap: 7px;
    }

    .ballot-actions .button {
        padding-inline: 11px;
    }

    .review-dialog {
        padding: 26px 20px 20px;
    }

    .dialog-actions .button {
        padding-inline: 11px;
    }

    .story-footer span:last-child {
        text-align: right;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

body[data-theme="dark"] {
    color-scheme: dark;
    --paper: #121916;
    --surface: #1d2822;
    --surface-soft: #253129;
    --ink: #e6ede8;
    --muted: #a2b0a7;
    --line: #39483f;
    --forest: rgba(var(--brand-primary-rgb), 0.88);
    --forest-dark: var(--brand-primary);
    --mint: rgba(var(--brand-secondary-rgb), 0.28);
    --shadow: 0 18px 48px rgba(0, 0, 0, .28);
}

.brand-logo {
    display: block;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 5px;
    object-fit: contain;
}

.theme-toggle {
    display: inline-flex;
    min-width: 36px;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 5px;
    color: var(--ink);
    background: var(--surface);
    cursor: pointer;
}

.theme-toggle svg {
    width: 16px;
    height: 16px;
}

.theme-toggle span {
    font-size: 10px;
    font-weight: 700;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.account-nav-link {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--brand-primary, #1C5145);
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.account-nav-link:hover {
    background: rgba(var(--brand-primary-rgb, 28, 81, 69), .07);
}

.account-dialog {
    width: min(680px, calc(100% - 28px));
    max-height: min(88svh, 820px);
    overflow: auto;
    margin: auto;
    padding: clamp(20px, 4vw, 30px);
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--ink);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.voter-create-dialog {
    width: min(560px, calc(100% - 28px));
}

.account-dialog::backdrop {
    background: rgba(13, 30, 23, .52);
    backdrop-filter: blur(3px);
}

.account-dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.account-dialog-head h2 {
    margin: 0;
    font-size: 22px;
}

.account-dialog-head .eyebrow {
    margin-bottom: 5px;
}

.icon-button {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--muted);
    background: var(--surface);
    transition: border-color .18s ease, color .18s ease, background .18s ease;
}

.icon-button:hover {
    border-color: color-mix(in srgb, var(--brand-secondary) 52%, var(--line));
    color: var(--brand-secondary);
    background: color-mix(in srgb, var(--brand-secondary) 10%, var(--surface));
}

.icon-button svg {
    width: 16px;
    height: 16px;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
}

.branding-settings,
.appearance-settings {
    margin-bottom: 16px;
}

.branding-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, .75fr);
    align-items: start;
    gap: 20px 28px;
}

.branding-form-fields {
    display: grid;
    gap: 15px;
}

.brand-color-field>div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-color-field input[type=color] {
    width: 48px;
    height: 39px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface);
    cursor: pointer;
}

.brand-color-field code {
    color: var(--muted);
    font-size: 10px;
}

.current-logo {
    display: flex;
    align-items: center;
    gap: 13px;
}

.current-logo .eyebrow {
    margin: 0;
}

.current-logo img {
    width: 50px;
    height: 50px;
    border: 1px solid var(--line);
    border-radius: 5px;
    object-fit: contain;
}

.branding-preview {
    display: grid;
    gap: 12px;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface-soft);
}

.branding-preview>.eyebrow,
.branding-preview>p {
    margin: 0;
}

.branding-preview>div {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
}

.preview-logo {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 6px 6px 6px 2px;
    color: var(--brand-primary-on);
    background: var(--brand-primary);
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
}

.preview-logo img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: contain;
}

.branding-preview strong {
    margin-right: auto;
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
}

.preview-chip {
    padding: 6px 8px;
    border-radius: 3px;
    color: var(--brand-primary-on);
    background: var(--brand-primary);
    font-size: 8px;
    font-weight: 800;
}

.secondary-chip {
    color: var(--brand-secondary-on);
    background: var(--brand-secondary);
}

.branding-form>.button {
    justify-self: start;
}

.appearance-settings {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.appearance-settings h2 {
    margin: 0 0 5px;
    font-size: 17px;
}

.appearance-settings p {
    margin: 0;
    font-size: 10px;
}

body[data-theme="dark"] {
    background: var(--paper);
}

body[data-theme="dark"] .sidebar,
body[data-theme="dark"] .topbar,
body[data-theme="dark"] .org-switch,
body[data-theme="dark"] .content-section,
body[data-theme="dark"] .metric,
body[data-theme="dark"] .candidate-card,
body[data-theme="dark"] .login-form-wrap,
body[data-theme="dark"] .setup-shell,
body[data-theme="dark"] .voter-election-section,
body[data-theme="dark"] .ballot-step,
body[data-theme="dark"] .review-dialog,
body[data-theme="dark"] .receipt-selections,
body[data-theme="dark"] .create-panel {
    color: var(--ink);
    border-color: var(--line);
    background-color: var(--surface);
}

body[data-theme="dark"] .sidebar,
body[data-theme="dark"] .topbar,
body[data-theme="dark"] .app-footer,
body[data-theme="dark"] .voter-top,
body[data-theme="dark"] .voter-home-footer {
    border-color: var(--line);
}

body[data-theme="dark"] .metric-accent,
body[data-theme="dark"] .branding-preview,
body[data-theme="dark"] .permission-option,
body[data-theme="dark"] .empty-inline,
body[data-theme="dark"] .voter-election-date,
body[data-theme="dark"] .election-date {
    color: var(--ink);
    border-color: var(--line);
    background-color: var(--surface-soft);
}

body[data-theme="dark"] input:not([type=radio]):not([type=checkbox]):not([type=color]),
body[data-theme="dark"] select,
body[data-theme="dark"] textarea {
    color: var(--ink);
    border-color: var(--line);
    background: #18211c;
}

body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder {
    color: #91a096;
}

body[data-theme="dark"] td,
body[data-theme="dark"] label,
body[data-theme="dark"] .table-link,
body[data-theme="dark"] .text-button,
body[data-theme="dark"] .signout-button {
    color: var(--ink);
}

body[data-theme="dark"] th,
body[data-theme="dark"] td,
body[data-theme="dark"] .candidate-result,
body[data-theme="dark"] .election-row,
body[data-theme="dark"] .position-row,
body[data-theme="dark"] .voter-election,
body[data-theme="dark"] .role-entry {
    border-color: var(--line);
}

body[data-theme="dark"] .button.secondary,
body[data-theme="dark"] .sidebar-toggle,
body[data-theme="dark"] .theme-toggle,
body[data-theme="dark"] .icon-button {
    color: var(--ink);
    border-color: var(--line);
    background: var(--surface-soft);
}

body[data-theme="dark"] .result-track {
    background: #36453b;
}

body[data-theme="dark"] .login-story {
    background-color: #14251d;
}

@media (max-width: 760px) {
    .branding-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .appearance-settings {
        align-items: flex-start;
        flex-direction: column;
    }
}

.workbench-tabs {
    display: flex;
    gap: 6px;
    margin: 24px 0 18px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
}

.workbench-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 14px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
}

.workbench-tab.active {
    background: color-mix(in srgb, var(--brand-secondary) 16%, var(--surface));
    box-shadow: 0 2px 8px rgba(var(--brand-secondary-rgb), .12);
    color: var(--brand-secondary-ink);
}

.workbench-tab.active i {
    color: var(--brand-secondary);
}

.builder-tab-panel {
    display: none;
}

.builder-tab-panel.active {
    display: block;
}

.candidate-manager-action {
    display: flex;
    align-items: center;
    gap: 12px;
}

.candidate-edit-dialog {
    width: min(620px, calc(100vw - 32px));
}

.candidate-create-dialog {
    width: min(620px, calc(100vw - 32px));
}

.candidate-assignment-hint {
    margin-bottom: 0;
    font-size: 10px;
    line-height: 1.5;
}

.candidate-assignment-dialog {
    width: min(760px, calc(100vw - 32px));
}

.candidate-assignment-dialog .bulk-candidate-assignment {
    margin: 0;
}

.candidate-assignment-dialog .candidate-assignment-list {
    max-height: min(45svh, 380px);
}

.existing-position-dialog {
    width: min(620px, calc(100vw - 32px));
}

.existing-position-list {
    max-height: min(55svh, 460px);
}

.existing-position-option {
    min-height: 42px;
    padding: 6px 3px;
    border-bottom: 1px solid var(--line);
    font-size: 11px;
}

.existing-position-option:last-of-type {
    border-bottom: 0;
}

.admin-create-dialog {
    width: min(560px, calc(100vw - 32px));
}

.responsive-create-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 16px auto;
}

.responsive-create-panel {
    display: none;
}

.button-icon {
    margin-right: 7px;
    font-size: .9em;
}

.election-create-dialog {
    width: min(640px, calc(100vw - 32px));
}

.image-upload-control {
    position: relative;
}

.image-upload-control input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.upload-preview {
    display: grid;
    min-height: 84px;
    place-items: center;
    gap: 4px;
    padding: 10px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--muted);
    cursor: pointer;
    font-size: 10px;
    text-align: center;
}

.upload-preview img {
    width: 58px;
    height: 58px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--surface);
}

.position-edit-dialog {
    width: min(620px, calc(100vw - 32px));
}

.candidate-register-trigger {
    margin-bottom: 16px;
}

.collection-controls {
    display: flex;
    gap: 8px;
    margin: 0 0 12px;
}

.collection-controls input,
.collection-controls select {
    min-width: 0;
    flex: 1 1 0;
}

.collection-controls .election-action-menu {
    flex: 0 0 auto;
    margin: 0;
}

.collection-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 10px;
}

.collection-pagination span {
    margin-right: auto;
}

.collection-pagination button {
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--brand-secondary-ink);
    cursor: pointer;
    font: inherit;
    font-size: 10px;
    font-weight: 700;
}

.collection-pagination button:hover:not(:disabled) {
    background: color-mix(in srgb, var(--brand-secondary) 12%, var(--surface));
}

.collection-pagination button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

body[data-theme="dark"] .collection-pagination button {
    color: var(--ink);
}

body[data-theme="dark"] .collection-pagination button:disabled {
    opacity: .68;
}

@media (max-width: 1050px) {
    .responsive-create-panel {
        display: none;
    }

    .responsive-create-trigger {
        display: inline-flex;
        width: 100%;
        justify-content: center;
        margin-bottom: 16px;
    }
}

.workbench-tab i {
    font-size: 12px;
}

@media (min-width: 761px) and (max-height: 720px) {
    .login-story {
        gap: 10px;
        padding-block: 16px;
    }

    .voting-process-visual {
        padding-block: 11px 9px;
    }

    .vote-stage {
        min-height: 250px;
    }

    .login-form-wrap {
        padding-block: 16px;
    }

    .login-form-box h2 {
        margin: 14px 0 6px;
    }

    .login-form-box>.muted {
        margin-bottom: 14px;
    }

    .login-form-box .form-stack {
        gap: 10px;
    }

    .login-footnote {
        margin: 10px 0;
    }

    .security-note {
        margin-top: 12px;
    }
}

@media (max-width: 760px) and (max-height: 720px) {
    .login-layout {
        grid-template-rows: 30svh minmax(0, 1fr);
    }

    .login-story {
        height: 30svh;
        min-height: 185px;
        --ballot-drop-offset: clamp(112px, 18svh, 125px);
        gap: 5px;
        padding: 7px 14px 5px;
    }

    .voting-process-visual {
        padding: 5px 9px 4px;
    }

    .visual-caption {
        font-size: 8px;
    }

    .vote-stage {
        margin-top: 3px;
    }

    .ballot-box {
        width: 142px;
        height: 50px;
    }

    .box-slot {
        width: 56px;
        height: 4px;
        top: 6px;
    }

    .review-card {
        top: 42px;
        width: 116px;
        padding: 6px;
    }

    .review-icon {
        width: 21px;
    }

    .review-card strong {
        font-size: 10px;
    }

    .review-detail {
        font-size: 8px;
    }

    .cast-trail {
        top: 58px;
        bottom: 56px;
    }

    .vote-steps {
        gap: 6px;
        margin-top: 3px;
        padding-top: 5px;
    }

    .login-form-wrap {
        padding: 8px 18px 10px;
    }

    .security-page-header .theme-toggle {
        width: 32px;
        height: 32px;
    }

    .login-form-box h2 {
        margin: 0 0 4px;
        font-size: 28px;
    }

    .login-form-box>.muted {
        margin-bottom: 8px;
    }

    .login-form-box .form-stack {
        gap: 7px;
    }

    .login-form-box label {
        gap: 4px;
    }

    .login-form-box input:not([type=radio]):not([type=checkbox]) {
        min-height: 35px;
        padding-block: 6px;
    }

    .login-footnote {
        margin: 7px 0;
    }

    .security-note {
        margin-top: 7px;
    }
}

body[data-theme="dark"] .nav-link.active {
    color: var(--ink);
}

body[data-theme="dark"] .workbench-tab.active {
    color: var(--ink);
}