.poll-tracker-page {
    max-width: 1220px;
}

.poll-tracker-header {
    text-align: center;
    margin-bottom: 2rem;
}

.poll-tracker-kicker {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #2563eb;
}

.poll-tracker-intro {
    max-width: 820px;
    margin: 0.75rem auto 0;
    color: #475569;
    line-height: 1.7;
}

.poll-overview-grid,
.party-summary-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.poll-overview-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.party-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.poll-overview-card,
.party-summary-card,
.poll-chart-card,
.poll-table-card,
.poll-context-card,
.poll-error-card {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #dbe4ee;
    border-radius: 18px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

.poll-overview-card {
    padding: 1.25rem;
}

.poll-overview-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #64748b;
}

.poll-overview-value {
    display: block;
    font-size: 1.35rem;
    color: #0f172a;
}

.party-summary-card {
    padding: 1.25rem;
    border-top: 5px solid var(--party-colour, #94a3b8);
}

.party-summary-card.is-highlight {
    box-shadow: 0 22px 52px rgba(37, 99, 235, 0.12);
}

.party-summary-card--reform {
    --party-colour: #2563eb;
}

.party-summary-card--other {
    --party-colour: #f59e0b;
}

.party-summary-card--labour {
    --party-colour: #dc2626;
}

.party-summary-card--conservative {
    --party-colour: #0f766e;
}

.party-summary-card--libdem {
    --party-colour: #ea580c;
}

.party-summary-card--green {
    --party-colour: #16a34a;
}

.party-summary-card--snp {
    --party-colour: #ca8a04;
}

.party-summary-card--plaid {
    --party-colour: #15803d;
}

.party-summary-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.85rem;
}

.party-summary-label {
    font-weight: 700;
    color: #0f172a;
}

.party-summary-short {
    font-size: 0.85rem;
    color: #64748b;
    text-transform: uppercase;
}

.party-summary-main {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 1rem;
}

.party-summary-metrics {
    display: grid;
    gap: 0.75rem;
    margin: 0;
}

.party-summary-metrics div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.party-summary-metrics dt {
    color: #64748b;
}

.party-summary-metrics dd {
    margin: 0;
    font-weight: 600;
    color: #0f172a;
}

.poll-chart-card,
.poll-table-card,
.poll-context-card,
.poll-error-card {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.section-heading h2 {
    margin: 0 0 0.35rem;
    color: #0f172a;
}

.section-heading p,
.poll-generated-at {
    margin: 0;
    color: #64748b;
    line-height: 1.6;
}

.related-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.related-link:hover {
    background: #dbeafe;
}

.poll-chart-shell {
    position: relative;
    min-height: 360px;
}

.poll-chart-shell canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.table-responsive {
    overflow-x: auto;
}

.poll-table {
    width: 100%;
    min-width: 1080px;
    border-collapse: collapse;
}

.poll-table th,
.poll-table td {
    padding: 0.85rem 0.95rem;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.poll-table td {
    color: #0f172a;
}

.poll-table thead th {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
    background: #f8fafc;
}

.poll-table tbody tr:hover td {
    background: #f8fafc;
    color: #0f172a;
}

.poll-table th:first-child,
.poll-table td:first-child,
.poll-table th:nth-child(2),
.poll-table td:nth-child(2),
.poll-table th:nth-child(3),
.poll-table td:nth-child(3),
.poll-table th:last-child,
.poll-table td:last-child {
    text-align: left;
}

.poll-table td:first-child,
.poll-table td:nth-child(2),
.poll-table td:nth-child(3),
.poll-table td:last-child,
.poll-table td:nth-last-child(2) {
    color: #1e293b;
}

.poll-table td:last-child a {
    color: #1d4ed8;
    font-weight: 700;
}

.poll-table td:not(:first-child):not(:nth-child(2)):not(:nth-child(3)):not(:last-child),
.poll-table th:not(:first-child):not(:nth-child(2)):not(:nth-child(3)):not(:last-child) {
    text-align: right;
}

.party-header.is-highlight,
.party-cell.is-highlight {
    font-weight: 800;
}

.party-header--reform,
.party-cell--reform {
    color: #2563eb;
}

.party-header--other,
.party-cell--other {
    color: #d97706;
}

.party-header--labour,
.party-cell--labour {
    color: #dc2626;
}

.party-header--conservative,
.party-cell--conservative {
    color: #0f766e;
}

.party-header--libdem,
.party-cell--libdem {
    color: #ea580c;
}

.party-header--green,
.party-cell--green {
    color: #16a34a;
}

.party-header--snp,
.party-cell--snp {
    color: #a16207;
}

.party-header--plaid,
.party-cell--plaid {
    color: #15803d;
}

.poll-context-list {
    margin: 0;
    padding-left: 1.2rem;
    color: #334155;
    line-height: 1.8;
}

.poll-context-list a {
    color: #1d4ed8;
    font-weight: 600;
}

.poll-context-card,
.poll-error-card,
.poll-generated-at,
.section-heading p,
.poll-overview-label {
    color: #475569;
}

.poll-context-card h2,
.poll-error-card h2,
.poll-error-card p {
    color: #0f172a;
}

.poll-error-card h2,
.poll-context-card h2 {
    margin-top: 0;
}

.poll-error-card p {
    margin-bottom: 0.8rem;
    color: #475569;
}

@media (max-width: 768px) {
    .section-heading {
        flex-direction: column;
    }

    .poll-chart-shell {
        min-height: 280px;
    }

    .poll-table-card,
    .poll-chart-card,
    .poll-context-card,
    .poll-error-card {
        padding: 1.1rem;
    }
}
