.home-viewport {
    min-height: calc(100vh - 146px);
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.home-introduction,
.home-election-panel,
.home-public-tools {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.home-introduction {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    border-left: 4px solid var(--accent);
}

.home-introduction h2 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(1.35rem, 2.4vw, 1.9rem);
}

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

.home-election-panel {
    min-height: 0;
    overflow: hidden;
}

.home-election-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
}

.home-election-panel-header h2 {
    margin: 0;
}

.home-election-count {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    color: var(--muted);
}

.home-election-count strong {
    color: var(--primary);
    font-size: 1.35rem;
}

.home-election-scroll {
    max-height: min(56vh, 560px);
    overflow: auto;
    padding: 14px;
}

.home-election-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.home-election-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    border: 1px solid var(--line);
    border-top: 4px solid var(--line-strong);
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface);
}

.home-election-card--open { border-top-color: var(--success); }
.home-election-card--nominations { border-top-color: #5b4fa3; }
.home-election-card--published { border-top-color: var(--accent); }
.home-election-card--vetting { border-top-color: var(--warning); }

.home-election-card-header,
.home-election-card-body,
.home-election-card-footer {
    padding: 11px 13px;
}

.home-election-card-header {
    padding-bottom: 4px;
}

.home-election-card-body {
    flex: 1 1 auto;
}

.home-election-organisation {
    margin-bottom: 4px;
    color: var(--accent);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.home-election-description {
    color: var(--muted);
    font-size: .88rem;
}

.home-election-dates {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    border-block: 1px solid var(--line);
    background: var(--surface-soft);
}

.home-election-dates > div {
    min-width: 0;
    padding: 9px 12px;
}

.home-election-dates > div + div {
    border-left: 1px solid var(--line);
}

.home-election-dates dd {
    font-size: .82rem;
    overflow-wrap: anywhere;
}

.home-election-card-footer {
    display: flex;
    justify-content: flex-end;
}

.home-public-tools {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    color: var(--muted);
    font-size: .88rem;
}

.status-nominations {
    color: #51428c;
    background: #ebe7ff;
}

.status-vetting {
    color: var(--warning);
    background: #fff0cc;
}

@media (max-width: 760px) {
    .home-introduction,
    .home-election-panel-header,
    .home-public-tools {
        align-items: stretch;
        flex-direction: column;
    }

    .home-introduction-actions,
    .home-election-card-footer {
        justify-content: flex-start;
    }

    .home-election-scroll {
        max-height: none;
    }
}

@media (max-width: 480px) {
    .home-election-dates {
        grid-template-columns: 1fr;
    }

    .home-election-dates > div + div {
        border-top: 1px solid var(--line);
        border-left: 0;
    }
}
