/* Constituency profile page — editorial design system */

:root {
    --con-color: #0087DC;
    --lab-color: #E4003B;
    --ld-color: #FAA61A;
    --ref-color: #12B6CF;
    --grn-color: #008066;
    --snp-color: #FCD34D;
    --pc-color: #005B54;
    --oth-color: #999999;
}

body.constituency-page {
    background: #fff;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    line-height: 1.5;
    margin: 0;
}

.con-wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 48px 24px 64px;
}

.con-breadcrumb {
    font-size: 13px;
    color: #999;
    margin-bottom: 24px;
}
.con-breadcrumb a { color: #666; text-decoration: none; }
.con-breadcrumb a:hover { text-decoration: underline; }
.con-breadcrumb .sep { margin: 0 6px; color: #ccc; }

.con-kicker {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    margin-bottom: 12px;
}

.con-headline {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 44px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.1;
    margin: 0 0 8px;
}

.con-subhead {
    font-size: 16px;
    color: #666;
    margin: 0 0 32px;
}

/* Hero card: MP + current projection */
.con-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    border-top: 2px solid #1a1a1a;
    border-bottom: 1px solid #e0e0e0;
    padding: 24px 0;
    margin-bottom: 40px;
}

.con-mp {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.con-mp-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    background: #eee;
    flex-shrink: 0;
    border: 2px solid #e0e0e0;
}
.con-mp-photo.placeholder {
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 11px;
}
.con-mp-meta { min-width: 0; }
.con-mp-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    margin-bottom: 4px;
}
.con-mp-name {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.2;
}
.con-mp-party {
    font-size: 13px;
    font-weight: 600;
    margin: 4px 0 8px;
    padding: 2px 8px;
    display: inline-block;
    border-radius: 2px;
    background: var(--party-color, #999);
    color: white;
}
.con-mp-facts {
    font-size: 13px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}
.con-mp-facts span + span::before {
    content: " · ";
    color: #ccc;
}

.con-projection {
    border-left: 1px solid #e0e0e0;
    padding-left: 24px;
}
.con-projection-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    margin-bottom: 4px;
}
.con-projection-winner {
    font-family: Georgia, serif;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 4px;
    line-height: 1.2;
}
.con-projection-winner .party-name {
    color: var(--party-color, #1a1a1a);
}
.con-projection-margin {
    font-size: 14px;
    color: #666;
    margin: 0 0 12px;
}
.con-projection-bar {
    display: flex;
    width: 100%;
    height: 24px;
    border-radius: 2px;
    overflow: hidden;
    background: #f5f5f5;
}
.con-projection-bar .seg {
    height: 100%;
    transition: width 0.2s ease;
}
.con-projection-bar .seg + .seg { border-left: 1px solid rgba(255,255,255,0.4); }

/* Snapshot (exec summary) */
.con-snapshot {
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    padding: 24px 0;
    margin-bottom: 40px;
}
.snap-tiles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}
.snap-tile {
    padding: 0 20px;
    border-right: 1px solid #e0e0e0;
}
.snap-tile:last-child { border-right: none; }
.snap-tile:first-child { padding-left: 0; }
.snap-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    margin-bottom: 6px;
}
.snap-value {
    font-family: Georgia, serif;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.2;
    margin-bottom: 4px;
}
.snap-context {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}
.snap-chips {
    display: flex;
    gap: 4px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
}
.snap-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 26px;
    padding: 0 6px;
    border-radius: 2px;
    background: var(--party-color, #999);
    color: white;
    font-weight: 700;
    font-size: 12px;
}
.snap-tags {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed #e0e0e0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.snap-tag {
    display: inline-block;
    padding: 4px 10px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

/* Section heading */
.con-section {
    margin: 48px 0;
}
.con-section h2 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}
.con-section .note {
    font-size: 14px;
    color: #666;
    margin: 8px 0 0;
}

/* Vote share comparison: 2024 vs projection */
.con-vote-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}
.con-vote-col h3 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    margin: 0 0 12px;
}
.con-vote-col .total {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
    font-variant-numeric: tabular-nums;
}
.con-vote-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.con-vote-row {
    display: grid;
    grid-template-columns: 4px 1fr auto;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}
.con-vote-swatch {
    width: 4px;
    height: 18px;
    background: var(--party-color, #999);
    border-radius: 1px;
}
.con-vote-name { color: #333; }
.con-vote-pct {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: #1a1a1a;
}

/* Mini-swingometer */
.con-swingometer {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    padding: 24px;
    border-radius: 4px;
}
.con-sliders {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 24px;
    margin-bottom: 24px;
}
.con-slider-row {
    display: grid;
    grid-template-columns: 90px 1fr 60px;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}
.con-slider-label {
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}
.con-slider-label::before {
    content: "";
    width: 4px;
    height: 14px;
    background: var(--party-color, #999);
    border-radius: 1px;
    display: inline-block;
}
.con-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    outline: none;
}
.con-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--party-color, #333);
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 0 1px #ccc;
}
.con-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--party-color, #333);
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 0 1px #ccc;
}
.con-slider-val {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: #1a1a1a;
}
.con-slider-row .delta {
    font-size: 11px;
    color: #999;
    font-weight: 400;
    margin-left: 4px;
}
.con-slider-row .delta.up { color: #2e7d32; }
.con-slider-row .delta.down { color: #c62828; }

.con-swing-reset {
    background: #333;
    color: white;
    border: none;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 2px;
}
.con-swing-reset:hover { background: #1a1a1a; }

.con-swing-output {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}
.con-swing-headline {
    font-family: Georgia, serif;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 12px;
}
.con-swing-headline .party-name { color: var(--party-color, #1a1a1a); }

/* Demographics grid */
.con-demo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.con-demo-tile {
    border-left: 2px solid #e0e0e0;
    padding: 4px 0 4px 12px;
}
.con-demo-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    margin-bottom: 4px;
}
.con-demo-value {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.con-demo-context {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

/* By-election callout */
.con-byelection {
    background: #fffbea;
    border: 1px solid #f4d03f;
    border-left: 4px solid #f4d03f;
    padding: 20px 24px;
    border-radius: 0 4px 4px 0;
    margin: 32px 0;
}
.con-byelection-kicker {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #b8860b;
    margin-bottom: 6px;
}
.con-byelection h3 {
    font-family: Georgia, serif;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px;
}
.con-byelection p {
    font-size: 14px;
    color: #333;
    margin: 4px 0;
    line-height: 1.5;
}
.con-byelection a.cta {
    display: inline-block;
    margin-top: 12px;
    color: #1a1a1a;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 600;
    font-size: 14px;
}

/* Strong inline caveat on the projection panel when a by-election is in
   progress, distinct from a normal grey .note (warning-tinted). */
.con-byelection-caveat {
    background: #fff8e6;
    border: 1px solid #f0d68a;
    color: #4a3b00;
    padding: 12px 16px;
    border-radius: 2px;
    font-size: 14px;
    line-height: 1.5;
    margin: 12px 0 20px;
}
.con-byelection-caveat strong { color: #1a1a1a; }
.con-byelection-caveat a {
    color: #1a1a1a;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 600;
}

/* Combined constituency map (ward + LSOA modes) */
.map-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.map-mode-pills {
    display: inline-flex;
    border: 1px solid #ccc;
    border-radius: 2px;
    overflow: hidden;
}
.map-mode-pill {
    background: white;
    border: none;
    border-right: 1px solid #ccc;
    padding: 8px 14px;
    font-family: inherit;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: background 0.15s;
}
.map-mode-pill:last-child { border-right: none; }
.map-mode-pill:hover { background: #f5f5f5; }
.map-mode-pill.active {
    background: #1a1a1a;
    color: white;
    font-weight: 600;
}
.map-demo-control {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.map-demo-label { color: #666; font-weight: 600; }
.map-demo-select {
    font-family: inherit;
    font-size: 13px;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 2px;
    background: white;
    cursor: pointer;
    min-width: 200px;
}
.map-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 24px;
    align-items: start;
}
.map-wrap {
    border: 1px solid #e0e0e0;
    border-radius: 2px;
    background: #fff;
    overflow: hidden;
}
.map-wrap svg { display: block; width: 100%; height: auto; }
.map-side { font-size: 12px; }
.map-tip {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    padding: 10px 12px;
    border-radius: 2px;
    margin-bottom: 16px;
    min-height: 110px;
    line-height: 1.5;
}
.map-tip em { color: #999; font-style: normal; }
.tip-name { font-weight: 600; color: #1a1a1a; font-size: 14px; }
.tip-meta { color: #999; font-size: 11px; margin: 2px 0 6px; }
.tip-result { font-size: 12px; margin-bottom: 6px; color: #333; }
.tip-row {
    display: grid;
    grid-template-columns: 8px 1fr auto;
    gap: 6px;
    align-items: center;
    font-size: 11px;
    padding: 2px 0;
}
.tip-swatch { width: 8px; height: 8px; border-radius: 1px; }
.tip-party { color: #333; }
.tip-pct { font-variant-numeric: tabular-nums; font-weight: 600; color: #1a1a1a; }
.legend-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    margin-bottom: 8px;
}
.legend-item {
    display: grid;
    grid-template-columns: 14px 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 12px;
}
.legend-swatch { width: 14px; height: 14px; border-radius: 2px; }
.legend-name { color: #333; }
.legend-count { color: #999; font-variant-numeric: tabular-nums; }
.legend-summary {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 12px;
}
.legend-summary span { color: #666; }
.legend-summary strong { color: #1a1a1a; font-variant-numeric: tabular-nums; font-weight: 600; }
.legend-diff {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 0;
    font-variant-numeric: tabular-nums;
}
.legend-diff.up { color: #c62828; }
.legend-diff.down { color: #1565c0; }
.legend-axis {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #999;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.tip-dev {
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.tip-dev.up { color: #c62828; }
.tip-dev.down { color: #1565c0; }
.legend-gradient {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    margin-top: 10px;
}
.legend-grad-swatch {
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.legend-grad-swatch span {
    background: rgba(255,255,255,0.85);
    padding: 1px 3px;
    border-radius: 1px;
    color: #1a1a1a;
}

/* Ward results table */
.ward-summary {
    font-size: 14px;
    color: #333;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #fafafa;
    border-left: 3px solid #1a1a1a;
}
.ward-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}
.ward-table th {
    text-align: left;
    border-bottom: 2px solid #1a1a1a;
    padding: 8px 10px;
    font-weight: 600;
    color: #1a1a1a;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
.ward-table th.num { text-align: right; }
.ward-table td {
    padding: 10px;
    border-bottom: 1px solid #e8e8e8;
    color: #333;
    vertical-align: middle;
}
.ward-table td.num { text-align: right; }
.ward-table tr:last-child td { border-bottom: 2px solid #1a1a1a; }
.ward-table tr:hover td { background: #fafafa; }
.ward-name {
    font-weight: 600;
    color: #1a1a1a;
}
.ward-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    background: var(--party-color, #999);
    margin-right: 4px;
}
.ward-chip .pct { font-variant-numeric: tabular-nums; }
.ward-runner {
    display: inline-block;
    color: #666;
    font-size: 12px;
    margin-left: 2px;
}
.ward-year-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 2px;
    margin-right: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-variant-numeric: tabular-nums;
}
.ward-year-tag.fresh { background: #e3f2fd; color: #0d47a1; }
.ward-year-tag.fallback { background: #fff3cd; color: #856404; }
.ward-merged-note {
    display: block;
    margin-top: 4px;
    font-size: 10px;
    color: #856404;
    font-style: italic;
}
.ward-margin {
    font-size: 11px;
    color: #999;
    margin-left: 4px;
}
.swing-bar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 80px;
    justify-content: flex-end;
}
.swing-bar .bar {
    height: 6px;
    background: linear-gradient(to right, #E4003B 0%, #12B6CF 100%);
    border-radius: 1px;
    width: 40px;
    position: relative;
}
.swing-bar .marker {
    position: absolute;
    top: -2px;
    width: 2px;
    height: 10px;
    background: #1a1a1a;
}
.swing-bar .val {
    font-weight: 600;
    color: #1a1a1a;
    font-variant-numeric: tabular-nums;
    min-width: 40px;
    text-align: right;
}
.shift-cell {
    text-align: right;
    line-height: 1.3;
}
.shift-cell .shift-label {
    font-size: 10px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.shift-cell .shift-val {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    font-variant-numeric: tabular-nums;
}

/* Electoral history table */
.con-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}
.con-history-table th {
    text-align: right;
    border-bottom: 2px solid #1a1a1a;
    padding: 8px 10px;
    font-weight: 600;
    color: #1a1a1a;
}
.con-history-table th:first-child,
.con-history-table th:nth-child(2),
.con-history-table th:nth-child(3) { text-align: left; }
.con-history-table td {
    padding: 10px;
    border-bottom: 1px solid #e8e8e8;
    text-align: right;
    color: #333;
}
.con-history-table td:first-child,
.con-history-table td:nth-child(2),
.con-history-table td:nth-child(3) { text-align: left; }
.con-history-table tr:last-child td { border-bottom: 2px solid #1a1a1a; }
.con-history-table .year { font-weight: 600; color: #1a1a1a; }
.con-history-table .pct-bar {
    display: inline-block;
    height: 8px;
    border-radius: 1px;
    vertical-align: middle;
    margin-right: 6px;
}
.con-history-caveat {
    font-size: 12px;
    color: #999;
    margin-top: 12px;
    font-style: italic;
}
.con-sources {
    margin-top: 64px;
    padding-top: 24px;
    border-top: 1px solid #e0e0e0;
}
.con-sources h2 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #666;
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 14px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 600;
}
.sources-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 12px;
    line-height: 1.55;
    color: #555;
}
.sources-list li {
    padding-left: 12px;
    border-left: 2px solid #e0e0e0;
}
.sources-list strong {
    color: #1a1a1a;
    font-weight: 600;
}
.sources-list a {
    color: #555;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: #ccc;
}
.sources-list a:hover {
    color: #1a1a1a;
    text-decoration-color: #1a1a1a;
}
.notional-mp-note {
    display: inline-block;
    margin-left: 4px;
    font-size: 10px;
    color: #999;
    font-style: italic;
    font-weight: 400;
}
.notional-tag {
    display: inline-block;
    margin-left: 6px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #856404;
    background: #fff3cd;
    border: 1px solid #f4d35e;
    padding: 1px 4px;
    border-radius: 2px;
    vertical-align: middle;
}

/* Council-context combined block */
/* Council + devolved-parliament sections: plain editorial layout. No
   background fill, no left-rule accent — same typography as the rest of
   the page, with NYT-style tables. */
.con-council-block,
.con-devolved-block {
    margin: 48px 0;
    padding: 0;
    background: none;
    border-left: none;
}
.con-council-block .block-kicker,
.con-devolved-block .block-kicker {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    margin-bottom: 8px;
}
.con-council-block > .block-lede,
.con-devolved-block > .block-lede {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin: 0 0 24px;
    max-width: 720px;
}
.con-council-block h3 {
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    margin: 28px 0 8px;
}

/* Council + devolved overlap tables (NYT/FT pattern) */
.con-overlap-table {
    width: 100%;
    border-collapse: collapse;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 14px;
    margin-top: 8px;
}
.con-overlap-table th {
    text-align: left;
    font-weight: 600;
    color: #1a1a1a;
    padding: 10px 12px 10px 0;
    border-bottom: 2px solid #1a1a1a;
}
.con-overlap-table td {
    padding: 12px 12px 12px 0;
    border-bottom: 1px solid #e8e8e8;
    color: #333;
    vertical-align: top;
}
.con-overlap-table tr:last-child td {
    border-bottom: 2px solid #1a1a1a;
}
.con-overlap-table th:last-child,
.con-overlap-table td:last-child {
    padding-right: 0;
}
.con-overlap-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.con-overlap-table .seat-name {
    font-weight: 600;
    color: #1a1a1a;
}
.con-overlap-table .seat-meta {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}
.con-overlap-table a.seat-link {
    color: #333;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Senedd map (devolved block) */
.senedd-map-wrap {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(0, 1.2fr);
    gap: 24px;
    align-items: start;
    margin: 8px 0 24px;
}
#senedd-map {
    background: #fff;
    border: 1px solid #e8e8e8;
    width: 100%;
}
#senedd-map svg { display: block; width: 100%; height: 100%; }
#senedd-map .senedd-poly:hover,
#senedd-map .senedd-poly:focus { outline: none; }
.senedd-map-detail {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
.sm-detail-head { margin-bottom: 14px; }
.sm-detail-name {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.2;
}
.sm-detail-meta {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}
.sm-bars { display: flex; flex-direction: column; gap: 6px; }
.sm-bar-row {
    display: grid;
    grid-template-columns: 110px 1fr 56px 90px;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #333;
}
.sm-bar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-bar-track {
    height: 10px;
    background: #f0f0f0;
    border-radius: 1px;
    overflow: hidden;
}
.sm-bar-fill { height: 100%; opacity: 0.85; }
.sm-bar-pct {
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: #1a1a1a;
    font-weight: 600;
}
.sm-bar-seats {
    font-size: 11px;
    color: #999;
    font-variant-numeric: tabular-nums;
    text-align: right;
}
.sm-members { margin-top: 18px; border-top: 1px solid #e8e8e8; padding-top: 12px; }
.sm-members-h {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    font-weight: 600;
    margin-bottom: 6px;
}
.sm-member-list {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
    line-height: 1.5;
    color: #333;
}
.sm-member-list li { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.sm-member-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.sm-member-party {
    margin-left: auto;
    color: #666;
    font-size: 12px;
}
@media (max-width: 720px) {
    .senedd-map-wrap { grid-template-columns: 1fr; }
    #senedd-map { height: 360px; }
    .sm-bar-row { grid-template-columns: 90px 1fr 50px; }
    .sm-bar-seats { display: none; }
}

/* Polling trajectory chart */
.traj-summary {
    margin-bottom: 12px;
}
.traj-summary-line {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}
.traj-summary-line strong { color: #1a1a1a; font-variant-numeric: tabular-nums; }
.traj-chart-wrap {
    border: 1px solid #e0e0e0;
    border-radius: 2px;
    padding: 8px 12px 4px;
    background: #fff;
}
.traj-chart-wrap svg { display: block; width: 100%; height: auto; }
.traj-axis path, .traj-axis line { stroke: #ccc; }
.traj-axis text { font-size: 11px; fill: #666; font-variant-numeric: tabular-nums; }
.traj-grid line { shape-rendering: crispEdges; }
.traj-hover {
    margin-top: 10px;
    padding: 8px 12px;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 2px;
    font-size: 12px;
    color: #333;
    line-height: 1.5;
    min-height: 36px;
}
.traj-hover em { color: #999; font-style: normal; }
.traj-hover strong { color: #1a1a1a; }

/* Similar constituencies */
.similar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}
.similar-card {
    display: block;
    padding: 14px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    background: white;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
}
.similar-card:hover {
    border-color: #1a1a1a;
    background: #fafafa;
}
.similar-card .sim-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}
.similar-card .sim-name {
    font-family: Georgia, serif;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.2;
}
.similar-card .sim-score {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    font-variant-numeric: tabular-nums;
    margin-left: 8px;
    white-space: nowrap;
}
.similar-card .sim-region {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}
.similar-card .sim-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.similar-card .sim-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 2px;
    color: white;
    font-weight: 600;
    --party-color: #999;
    background: var(--party-color);
}
.similar-card .sim-chip-label {
    font-size: 10px;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.similar-card .sim-shared-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    margin-bottom: 4px;
}
.similar-card .sim-shared-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.similar-card .sim-shared-row {
    display: grid;
    grid-template-columns: 12px 1fr auto auto;
    gap: 6px;
    align-items: baseline;
    font-size: 12px;
    color: #333;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
}
.similar-card .sim-arrow {
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
}
.similar-card .sim-arrow.up { color: #c62828; }
.similar-card .sim-arrow.down { color: #1565c0; }
.similar-card .sim-feat-label { color: #333; }
.similar-card .sim-feat-vals {
    font-weight: 600;
    color: #1a1a1a;
}
.similar-card .sim-feat-mean {
    color: #999;
    font-size: 11px;
    margin-left: 4px;
}

/* Related links */
.con-related {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 16px;
}
.con-related-card {
    display: block;
    padding: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    text-decoration: none;
    transition: border-color 0.15s;
}
.con-related-card:hover { border-color: #1a1a1a; background: #fafafa; }
.con-related-card .label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    margin-bottom: 4px;
}
.con-related-card .title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
}

/* Mobile */
@media (max-width: 768px) {
    .con-wrap { padding: 32px 16px 48px; }
    .con-headline { font-size: 32px; }
    .con-hero { grid-template-columns: 1fr; gap: 24px; }
    .con-projection { border-left: none; padding-left: 0; border-top: 1px solid #e0e0e0; padding-top: 24px; }
    .con-vote-grid { grid-template-columns: 1fr; gap: 24px; }
    .con-sliders { grid-template-columns: 1fr; }
    .con-demo-grid { grid-template-columns: repeat(2, 1fr); }
    .con-related { grid-template-columns: 1fr; }
    .map-layout { grid-template-columns: 1fr; }
    .snap-tiles { grid-template-columns: repeat(2, 1fr); gap: 16px 0; }
    .snap-tile { padding: 0 12px; }
    .snap-tile:nth-child(2n) { border-right: none; }
    .snap-tile:nth-child(2n+1) { padding-left: 0; }
    .con-history-table { font-size: 12px; }
    .con-history-table td, .con-history-table th { padding: 6px 4px; }
    .con-history-table .hide-mobile { display: none; }
    .con-council-pct { font-size: 22px; min-width: 60px; }
}
