body {
    margin: 0;
    background: #f4f6f8;
    color: #1f2933;
    font-family: Verdana, Helvetica, sans-serif;
}

.app-shell {
    width: min(1320px, calc(100% - 24px));
    margin: 0 auto;
    padding: 18px 0 40px;
}

.data-loader {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(244, 246, 248, .92);
}

.data-loader.d-none {
    display: none;
}

.data-loader-box {
    display: flex;
    align-items: center;
    gap: 14px;
    width: min(420px, 100%);
    padding: 18px;
    background: #fff;
    border: 1px solid #dbe1e8;
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .14);
}

.data-loader-box strong,
.data-loader-box span {
    display: block;
}

.data-loader-box span {
    margin-top: 2px;
    color: #64748b;
    font-size: 13px;
}

body.is-loading-data .app-shell {
    pointer-events: none;
}

.site-header {
    display: flex;
    justify-content: center;
    padding: 8px 0 18px;
}

.site-header img {
    display: block;
    width: min(260px, 72vw);
    height: auto;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 18px;
    text-align: center;
}

.eyebrow {
    margin: 0 0 4px;
    color: #5f6b7a;
    font-size: 13px;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
}

.page-hint {
    max-width: 860px;
    margin: 8px auto 0;
    color: #64748b;
    font-size: 15px;
    line-height: 1.45;
}

.filters,
.panel,
.metric {
    background: #fff;
    border: 1px solid #dbe1e8;
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
}

.filters {
    padding: 16px;
    margin-bottom: 16px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.metric {
    padding: 14px 16px;
}

.metric span {
    display: block;
    color: #64748b;
    font-size: 13px;
}

.metric strong {
    display: block;
    margin-top: 4px;
    font-size: 24px;
    line-height: 1.2;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(420px, .9fr);
    gap: 16px;
    margin-bottom: 16px;
}

.content-grid.single-panel {
    grid-template-columns: 1fr;
}

.panel {
    padding: 16px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 12px;
}

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

#scopeLabel {
    color: #64748b;
    font-size: 13px;
    text-align: right;
}

.party-bar-row {
    margin-bottom: 12px;
}

.party-bar-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    margin-bottom: 5px;
    font-size: 14px;
}

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

.party-bar-value {
    color: #475569;
    font-weight: 700;
    text-align: right;
}

.party-total,
.party-detail {
    display: block;
}

.party-detail {
    margin-top: 2px;
    color: #64748b;
    font-size: 12px;
    font-weight: 400;
}

.party-bar-track {
    height: 13px;
    overflow: hidden;
    background: #e8edf3;
    border-radius: 6px;
}

.party-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width .25s ease;
}

.swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 7px;
    border-radius: 3px;
    vertical-align: -1px;
}

.color-list {
    display: grid;
    gap: 10px;
}

.color-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px;
    gap: 12px;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.color-item label {
    min-width: 0;
    margin: 0;
    font-size: 14px;
}

.loading,
.empty-state {
    padding: 24px;
    color: #64748b;
    text-align: center;
}

.table {
    margin-bottom: 0;
}

.site-footer {
    margin-top: 22px;
    padding: 14px 0 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.45;
    text-align: center;
}

.footer-logo {
    display: inline-block;
    margin-bottom: 12px;
}

.footer-logo img {
    display: block;
    width: min(180px, 58vw);
    height: auto;
}

.site-footer p {
    margin: 0 0 6px;
}

.site-footer a {
    color: #1a73b2;
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

@media (max-width: 991px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

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

    .topbar {
        align-items: flex-start;
    }

    h1 {
        font-size: 23px;
    }
}

@media (max-width: 575px) {
    .app-shell {
        width: min(100% - 16px, 1320px);
        padding-top: 14px;
    }

    .topbar {
        flex-direction: column;
    }

    .party-bar-meta {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .party-bar-label {
        white-space: normal;
    }
}
