@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #0366d6;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

/* ============================================================
   Live statistics - data-dense dashboard
   Flat colours only. Built on the theme's own components
   (.progress, .nav-pills, .card) and palette (--purple #5F4B8B).
   ============================================================ */

/* --- header --- */

.stats-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.stats-toolbar > * { margin: .25rem .75rem .25rem 0; }

.live-pill {
    display: inline-flex;
    align-items: center;
    padding: .2rem .6rem;
    border: 1px solid #dcdee3;
    border-radius: 999px;
    background-color: #f1f2f4;
    color: #5c5f68;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .06em;
}

.live-dot {
    width: .45rem;
    height: .45rem;
    margin-right: .4rem;
    border-radius: 50%;
    background-color: currentColor;
}

/* voting is open: green, and the dot pulses */
.live-pill.is-live {
    border-color: #b6ded0;
    background-color: #eaf5f1;
    color: #21735a;
}

.live-pill.is-live .live-dot { animation: live-pulse 1.6s ease-in-out infinite; }

/* voting has closed */
.live-pill.is-closed {
    border-color: #f1b7bd;
    background-color: #fdecee;
    color: #b02a37;
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .25; }
}

.stats-updated {
    font-size: .8125rem;
    color: #7c7f89;
    font-variant-numeric: tabular-nums;
}

/* --- election selector --- */

.election-tabs .nav-link {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: .5rem .9rem;
    color: #14141f;
    border: 1px solid rgba(20, 20, 31, .12);
    margin: 0 .5rem .5rem 0;
    cursor: pointer;
}

.election-tabs .nav-link:hover { border-color: #5F4B8B; }

.election-tabs .nav-link.active {
    background-color: #5F4B8B;
    border-color: #5F4B8B;
    color: #ffffff;
}

.status-dot {
    width: .5rem;
    height: .5rem;
    margin-right: .5rem;
    border-radius: 50%;
    flex: 0 0 auto;
    background-color: #a7abb5;
}

.status-dot.is-live {
    background-color: #2A906F;
    animation: live-pulse 1.6s ease-in-out infinite;
}

.status-dot.is-closed { background-color: #b02a37; }

.nav-link.active .status-dot.is-live { background-color: #ffffff; }

.election-picker-wrap { margin-bottom: 0; }

.election-picker {
    height: 48px;
    font-size: 1rem;
    border-color: rgba(20, 20, 31, .18);
}

.election-picker:focus {
    border-color: #5F4B8B;
    box-shadow: 0 0 0 .2rem rgba(95, 75, 139, .25);
}

.election-picker-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-top: .6rem;
}

.election-picker-meta {
    margin-left: .6rem;
    font-size: .8125rem;
    color: #5c5f68;
}

.election-tab-meta {
    margin-left: .5rem;
    font-size: .75rem;
    color: #7c7f89;
}

.nav-link.active .election-picker-wrap { margin-bottom: 0; }

.election-picker {
    height: 48px;
    font-size: 1rem;
    border-color: rgba(20, 20, 31, .18);
}

.election-picker:focus {
    border-color: #5F4B8B;
    box-shadow: 0 0 0 .2rem rgba(95, 75, 139, .25);
}

.election-picker-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-top: .6rem;
}

.election-picker-meta {
    margin-left: .6rem;
    font-size: .8125rem;
    color: #5c5f68;
}

.election-tab-meta { color: rgba(255, 255, 255, .8); }

/* --- KPI tiles --- */

.stat-tile .card-body {
    display: flex;
    flex-direction: column;
    padding: .85rem 1rem;
}

.stat-label {
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #7c7f89;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.3;
    color: #14141f;
    font-variant-numeric: tabular-nums;
}

.stat-meta {
    font-size: .75rem;
    color: #7c7f89;
}

/* --- turnout --- */

.turnout-figure {
    font-size: 1.5rem;
    font-weight: 700;
    color: #5F4B8B;
    font-variant-numeric: tabular-nums;
}

/* --- position cards --- */

.position-card .card-header { padding: .85rem 1rem; }

.position-card .card-body { padding: .5rem 1rem 1rem; }

.candidate-row {
    display: flex;
    align-items: center;
    margin: 0 -.5rem;
    padding: .6rem .5rem;
    border-top: 1px solid rgba(20, 20, 31, .08);
    border-radius: .25rem;
    transition: background-color .15s ease;
}

.candidate-row:hover { background-color: #f5f6f8; }

.candidate-row:first-of-type { border-top: 0; }

.candidate-rank {
    flex: 0 0 auto;
    width: 1.6rem;
    height: 1.6rem;
    margin-right: .6rem;
    border-radius: 50%;
    background-color: #eceef2;
    color: #7c7f89;
    font-size: .75rem;
    font-weight: 700;
    line-height: 1.6rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.candidate-rank.leading {
    background-color: #5F4B8B;
    color: #ffffff;
}

.candidate-avatar {
    flex: 0 0 auto;
    margin-right: .6rem;
}

.candidate-detail {
    flex: 1 1 auto;
    min-width: 0;
}

.candidate-heading {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
}

.candidate-name {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    font-size: .875rem;
    color: #14141f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.candidate-flag {
    margin-left: .4rem;
    font-size: .625rem;
    font-weight: 600;
    letter-spacing: .04em;
}

.candidate-figure {
    margin-left: auto;
    padding-left: .75rem;
    white-space: nowrap;
    font-size: .875rem;
    font-variant-numeric: tabular-nums;
}

.candidate-figure .text-muted { font-size: .75rem; }

/* --- vote share donut --- */

.vote-donut-wrap {
    position: relative;
    display: inline-block;
    line-height: 0;
}

.vote-donut {
    width: 7.5rem;
    height: 7.5rem;
}

.vote-donut-label {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
}

.vote-donut-track {
    fill: none;
    stroke: #eceef2;
    stroke-width: 14;
}

.vote-donut-slice {
    fill: none;
    stroke-width: 14;
    transition: stroke-dasharray .6s ease, stroke-dashoffset .6s ease;
}

.vote-donut-value {
    font-size: 1.375rem;
    font-weight: 700;
    color: #14141f;
    font-variant-numeric: tabular-nums;
}

.vote-donut-caption {
    font-size: .625rem;
    font-weight: 600;
    letter-spacing: .1em;
    color: #7c7f89;
}

/* one flat colour per candidate, shared by the donut and the row bar */
.progress-bar.is-leading { background-color: #5F4B8B; }

.vote-donut-slice.seg-1 { stroke: #5F4B8B; }
.vote-donut-slice.seg-2 { stroke: #346CB0; }
.vote-donut-slice.seg-3 { stroke: #2A906F; }
.vote-donut-slice.seg-4 { stroke: #B26B00; }
.vote-donut-slice.seg-5 { stroke: #A33A5B; }
.vote-donut-slice.seg-6 { stroke: #4A5568; }

.progress-bar.seg-1 { background-color: #5F4B8B; }
.progress-bar.seg-2 { background-color: #346CB0; }
.progress-bar.seg-3 { background-color: #2A906F; }
.progress-bar.seg-4 { background-color: #B26B00; }
.progress-bar.seg-5 { background-color: #A33A5B; }
.progress-bar.seg-6 { background-color: #4A5568; }

/* --- small screens --- */

@media (max-width: 575.98px) {

    .stats-updated { font-size: .75rem; }

    .election-tabs .nav-link { width: 100%; }

    .stat-tile .card-body { padding: .7rem .75rem; }

    .stat-value { font-size: 1.375rem; }

    .stat-label { font-size: .625rem; }

    .stat-meta { font-size: .6875rem; }

    .turnout-figure { font-size: 1.25rem; }

    /* rank + photo both stay, so trim the gutter to keep the name readable */
    .candidate-rank {
        width: 1.25rem;
        height: 1.25rem;
        margin-right: .4rem;
        font-size: .625rem;
        line-height: 1.25rem;
    }

    .candidate-avatar { margin-right: .5rem; }

    /* name keeps its own line, figures drop underneath */
    .candidate-name {
        flex: 1 1 100%;
        font-size: .8125rem;
    }

    .candidate-figure {
        margin-left: 0;
        padding-left: 0;
        font-size: .8125rem;
    }

    .candidate-flag { margin-left: 0; margin-right: .4rem; }

    .position-card .card-header,
    .position-card .card-body { padding: .75rem .85rem; }

    .vote-donut {
        width: 6rem;
        height: 6rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .live-dot,
    .status-dot.is-live { animation: none; }

    .candidate-row,
    .progress-bar,
    .vote-donut-slice { transition: none; }
}

/* a real but tiny share (1 vote in thousands) must still be visible */
.progress-bar.has-value { min-width: 3px; }

/* ============================================================
   Home page - flat, touch-first
   ============================================================ */

.home-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem 1.25rem;
    margin: 1.5rem 0;
    border: 1px solid rgba(20, 20, 31, .1);
    border-radius: .25rem;
    background-color: #f7f6fa;
}

.home-hero-body { max-width: 34rem; }

.home-hero-title {
    margin: 0 0 .5rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: #14141f;
}

.home-hero-text {
    margin-bottom: 1rem;
    color: #5c5f68;
}

.home-hero-art {
    width: 12rem;
    max-width: 40%;
    margin-left: 1.5rem;
}

.home-hero-facts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.home-fact {
    display: flex;
    align-items: baseline;
    margin-right: 1.5rem;
}

.home-fact-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #5F4B8B;
    font-variant-numeric: tabular-nums;
}

.home-fact-label {
    margin-left: .35rem;
    font-size: .8125rem;
    color: #5c5f68;
}

.home-fact-action { min-height: 38px; }

.home-points {
    list-style: none;
    margin: 1.25rem 0 0;
    padding: 0;
    color: #5c5f68;
    font-size: .875rem;
}

.home-points li {
    display: flex;
    align-items: center;
    margin-bottom: .5rem;
}

.home-points i {
    width: 1.5rem;
    color: #5F4B8B;
}

/* --- election cards --- */

.election-card {
    margin-bottom: 1rem;
    transition: border-color .15s ease, background-color .15s ease;
}

.election-card:hover { border-color: #c9ccd4; }

.election-card .card-body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
}

.election-card-main {
    display: flex;
    align-items: flex-start;
    flex: 1 1 18rem;
    min-width: 0;
}

.election-card-icon {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    margin-right: .85rem;
    border-radius: .25rem;
    background-color: #f1f2f4;
    color: #5c5f68;
    font-size: 1.125rem;
}

.election-card-icon.is-live {
    background-color: #eaf5f1;
    color: #21735a;
}

.election-card-icon.is-closed {
    background-color: #fdecee;
    color: #b02a37;
}

.election-card-detail { min-width: 0; }

.election-card-heading {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.election-card-title {
    margin: 0 .5rem 0 0;
    font-size: 1.0625rem;
    font-weight: 600;
    color: #14141f;
}

.election-card-meta,
.election-card-timing {
    margin: .25rem 0 0;
    font-size: .8125rem;
    color: #7c7f89;
}

.election-card-timing { color: #5c5f68; }

.election-card-actions {
    flex: 0 0 auto;
    width: 100%;
    margin-top: 1rem;
}

.election-card-link {
    padding: .25rem 0 0;
    font-size: .8125rem;
    color: #5F4B8B;
}

/* --- primary action --- */

.btn-purple {
    min-height: 44px;
    color: #ffffff;
    background-color: #5F4B8B;
    border-color: #5F4B8B;
    transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}

.btn-purple:hover,
.btn-purple:focus {
    color: #ffffff;
    background-color: #503f75;
    border-color: #503f75;
}

.btn-purple:focus {
    box-shadow: 0 0 0 .2rem rgba(95, 75, 139, .35);
}

.btn-purple:active { transform: scale(.98); }

/* --- empty and loading states --- */

.empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background-color: #f1f2f4;
    color: #a7abb5;
    font-size: 1.5rem;
}

.skeleton {
    display: block;
    background-color: #eceef2;
    border-radius: .25rem;
    animation: skeleton-fade 1.4s ease-in-out infinite;
}

.skeleton-icon {
    width: 2.75rem;
    height: 2.75rem;
    margin-right: .85rem;
    flex: 0 0 auto;
}

.skeleton-line {
    height: .75rem;
    margin-bottom: .5rem;
}

@keyframes skeleton-fade {
    0%, 100% { opacity: 1; }
    50% { opacity: .45; }
}

@media (min-width: 768px) {

    .home-hero { padding: 2.5rem 2rem; }

    .home-hero-title { font-size: 2.25rem; }

    .election-card-actions {
        width: auto;
        margin-top: 0;
        margin-left: 1rem;
        text-align: right;
    }

    .election-card-actions .btn-block {
        display: inline-block;
        width: auto;
        min-width: 10rem;
    }

    .election-card-link { display: block; }
}

@media (max-width: 575.98px) {

    .home-hero {
        flex-direction: column-reverse;
        align-items: flex-start;
        padding: 1.25rem;
    }

    .home-hero-title { font-size: 1.5rem; }

    .home-hero-art {
        width: 8rem;
        max-width: 60%;
        margin: 0 auto 1rem;
    }

    .home-fact-value { font-size: 1.25rem; }

    .election-card .card-body { padding: .85rem; }

    .election-card-title { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
    .skeleton { animation: none; }
    .btn-purple:active { transform: none; }
}

/* ============================================================
   Election page
   ============================================================ */

.election-facts {
    display: flex;
    flex-wrap: wrap;
    padding: .5rem 1rem;
}

.election-fact {
    display: flex;
    flex-direction: column;
    flex: 1 1 8rem;
    padding: .65rem 1rem .65rem 0;
    margin-right: 1rem;
    border-right: 1px solid rgba(20, 20, 31, .08);
}

.election-fact:last-child {
    border-right: 0;
    margin-right: 0;
}

.election-fact-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    color: #14141f;
    font-variant-numeric: tabular-nums;
}

.election-fact-text {
    font-size: .9375rem;
    font-weight: 600;
    color: #14141f;
}

/* --- position panels --- */

.position-panel { margin-bottom: 1rem; }

.position-panel .card-header { padding: .85rem 1rem; }

.position-panel .card-body { padding: 1rem 1rem 0; }

/* --- candidate tiles --- */

.candidate-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    padding: 1rem .5rem;
    border: 1px solid rgba(20, 20, 31, .1);
    border-radius: .25rem;
    background-color: #ffffff;
    text-align: center;
    transition: border-color .15s ease, background-color .15s ease;
}

.candidate-tile:hover {
    border-color: #5F4B8B;
    background-color: #faf9fc;
}

.candidate-tile-name {
    width: 100%;
    margin-top: .65rem;
    font-size: .8125rem;
    font-weight: 600;
    line-height: 1.3;
    color: #14141f;
    overflow-wrap: anywhere;
}

.voter-search { width: 100%; max-width: 18rem; }

@media (max-width: 575.98px) {

    .election-facts { padding: .25rem .5rem; }

    .election-fact {
        flex: 1 1 45%;
        padding: .5rem .5rem .5rem 0;
        margin-right: .5rem;
    }

    .election-fact-value { font-size: 1.25rem; }

    .election-fact-text { font-size: .875rem; }

    .candidate-tile { padding: .75rem .35rem; }

    .candidate-tile-name { font-size: .75rem; }

    .voter-search { max-width: 100%; margin-top: .75rem; }
}

/* ============================================================
   Ballot
   ============================================================ */

.ballot-progress-figure {
    font-size: .875rem;
    font-weight: 600;
    color: #5F4B8B;
    font-variant-numeric: tabular-nums;
}

.ballot-row { margin-bottom: .75rem; }

.ballot-row .card-body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
}

.ballot-row.is-voted { background-color: #fbfcfc; }

.ballot-row-detail {
    flex: 1 1 14rem;
    min-width: 0;
}

.ballot-row-title {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 600;
    color: #14141f;
    text-transform: uppercase;
}

.ballot-row-meta {
    margin: .25rem 0 0;
    font-size: .8125rem;
    color: #7c7f89;
}

.ballot-row-action {
    flex: 0 0 auto;
    margin-top: .75rem;
    width: 100%;
}

.ballot-row-action .btn { width: 100%; }

/* --- vote modal --- */

.ballot-modal .modal-content { border: 0; }

.ballot-modal-header {
    align-items: flex-start;
    padding: 1rem 1.25rem;
    background-color: #5F4B8B;
    border-bottom: 0;
    color: #ffffff;
}

.ballot-modal-header .modal-title { color: #ffffff; }

.ballot-modal-header .close,
.ballot-modal-header .btn-close {
    color: #ffffff;
    opacity: .85;
    text-shadow: none;
}

.ballot-modal-eyebrow {
    display: block;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .75);
}

.ballot-modal-body { padding: 1.25rem; }

.ballot-modal-hint {
    margin-bottom: .75rem;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #7c7f89;
}

.ballot-modal-note {
    margin: 1rem 0 0;
    font-size: .75rem;
    color: #7c7f89;
}

/* --- candidate options --- */

.ballot-list {
    display: flex;
    flex-direction: column;
}

.ballot-option {
    display: flex;
    align-items: center;
    width: 100%;
    margin: 0 0 .625rem;
    padding: .75rem;
    border: 1px solid rgba(20, 20, 31, .12);
    border-radius: .375rem;
    background-color: #ffffff;
    cursor: pointer;
    touch-action: manipulation;
    transition: border-color .15s ease, background-color .15s ease;
}

.ballot-option:last-child { margin-bottom: 0; }

.ballot-option:hover { border-color: #b3a8c9; }

.ballot-option.is-selected {
    border-color: #5F4B8B;
    background-color: #f5f3f9;
    box-shadow: inset 0 0 0 1px #5F4B8B;
}

/* the radio stays in the accessibility tree; the whole row is the target */
.ballot-option-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.ballot-option-input:focus + .ballot-option-photo {
    box-shadow: 0 0 0 .2rem rgba(95, 75, 139, .35);
}

.ballot-option-photo {
    flex: 0 0 auto;
    width: 3.25rem;
    height: 3.25rem;
    font-size: 3.25rem;
    border-radius: 50%;
}

.ballot-option-body {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0 .75rem;
}

.ballot-option-name {
    display: block;
    font-size: .9375rem;
    font-weight: 600;
    line-height: 1.25;
    color: #14141f;
    overflow-wrap: anywhere;
}

.ballot-option-role {
    display: block;
    margin-top: .15rem;
    font-size: .75rem;
    color: #7c7f89;
}

.ballot-option-mark {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid #c9ccd4;
    border-radius: 50%;
    background-color: #ffffff;
    color: transparent;
    font-size: .6875rem;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.ballot-option.is-selected .ballot-option-mark {
    border-color: #5F4B8B;
    background-color: #5F4B8B;
    color: #ffffff;
}

/* --- confirmation --- */

.ballot-success {
    padding: 1.5rem 0;
    text-align: center;
}

.ballot-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background-color: #eaf5f1;
    color: #21735a;
    font-size: 1.5rem;
}

.ballot-success-title {
    margin: .85rem 0 .25rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #14141f;
}

.ballot-success-text {
    margin: 0;
    color: #5c5f68;
}

/* --- footer --- */

.ballot-modal-footer {
    display: block;
    padding: 1rem 1.25rem;
    background-color: #ffffff;
    border-top: 1px solid rgba(20, 20, 31, .08);
}

.ballot-modal-footer .btn { min-height: 46px; }

@media (min-width: 576px) {

    .ballot-row-action {
        width: auto;
        margin-top: 0;
        margin-left: 1rem;
    }

    .ballot-row-action .btn { width: auto; min-width: 8rem; }
}

@media (max-width: 575.98px) {

    .ballot-modal-header { padding: .85rem 1rem; }

    .ballot-modal-body { padding: 1rem; }

    .ballot-modal-footer { padding: .85rem 1rem; }

    .ballot-option { padding: .625rem; }

    .ballot-option-photo {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 2.75rem;
    }

    .ballot-option-body { margin: 0 .5rem; }

    .ballot-option-name { font-size: .875rem; }
}

/* ============================================================
   Shell: brand, top nav, shared states
   ============================================================ */

.app-brand {
    display: inline-flex;
    align-items: center;
    color: #ffffff;
    font-weight: 600;
}

.app-brand:hover,
.app-brand:focus {
    color: #ffffff;
    text-decoration: none;
}

.app-nav .nav-link {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: .5rem .85rem;
    color: rgba(255, 255, 255, .78);
    border-bottom: 2px solid transparent;
    transition: color .15s ease, border-color .15s ease;
}

.app-nav .nav-link:hover,
.app-nav .nav-link:focus { color: #ffffff; }

.app-nav .nav-link.active {
    color: #ffffff;
    border-bottom-color: #ffffff;
}

/* hide the desktop nav where the dropdown carries the same links */
@media (max-width: 767.98px) {
    .app-nav { display: none; }
}

.empty-icon-danger {
    background-color: #fdecee;
    color: #b02a37;
}

/* ============================================================
   Phones: the ballot opens as a bottom sheet
   Scoped to the ballot only - short dialogs such as the election
   code stay centred, where a sheet would look odd.
   ============================================================ */

@media (max-width: 575.98px) {

    .modal-dialog.ballot-modal {
        display: flex;
        align-items: flex-end;
        min-height: 100%;
        max-width: 100%;
        margin: 0;
    }

    .ballot-modal .modal-content {
        width: 100%;
        max-height: 94vh;
        border: 0;
        border-radius: .85rem .85rem 0 0;
    }

    .ballot-modal .modal-body { overflow-y: auto; }

    /* grab handle, so the sheet reads as a sheet */
    .ballot-modal-header {
        position: relative;
        padding-top: 1.35rem;
        border-radius: .85rem .85rem 0 0;
    }

    .ballot-modal-header::before {
        content: "";
        position: absolute;
        top: .5rem;
        left: 50%;
        width: 2.25rem;
        height: .25rem;
        margin-left: -1.125rem;
        border-radius: 999px;
        background-color: rgba(255, 255, 255, .45);
    }

    /* the submit button stays put while the list scrolls */
    .ballot-modal-footer {
        position: sticky;
        bottom: 0;
        padding-bottom: calc(.85rem + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -1px 0 rgba(20, 20, 31, .08);
    }

    /* comfortable thumb-sized rows */
    .ballot-option {
        padding: .75rem;
        margin-bottom: .5rem;
    }

    .ballot-option-photo {
        width: 3rem;
        height: 3rem;
        font-size: 3rem;
    }

    .ballot-option-mark {
        width: 1.65rem;
        height: 1.65rem;
    }

    .ballot-modal-footer .btn { min-height: 48px; }

    /* every other dialog: centred, just roomier on a small screen */
    .modal-dialog:not(.ballot-modal) {
        margin: .75rem;
        max-width: calc(100% - 1.5rem);
    }

    .code-modal .modal-body { padding: 1.25rem; }

    .code-modal .btn { min-height: 48px; }

    .code-input {
        height: 3.25rem;
        font-size: 1.375rem;
        letter-spacing: .4rem;
    }
}

/* --- position panel actions --- */

.position-panel-actions {
    display: flex;
    align-items: center;
}

.position-panel-actions .btn {
    min-height: 38px;
    margin-left: .5rem;
}

.position-panel-actions .btn:first-child { margin-left: 0; }

@media (max-width: 575.98px) {

    .position-panel .card-header { align-items: stretch; }

    .position-panel-actions {
        width: 100%;
        margin-top: .65rem;
    }

    /* thumb-sized on the screen most voters will use */
    .position-panel-actions .btn {
        flex: 1 1 0;
        min-height: 44px;
    }
}
