/* Council Projector - NYT/FT editorial style */

/* ── Context Panel ── */
.cp-context {
    position: fixed;
    top: 100px;
    right: 24px;
    width: 300px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: 3px solid #1a1a1a;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.cp-context-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 12px;
    border-bottom: 1px solid #e8e8e8;
    flex-shrink: 0;
}
.cp-context-kicker {
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #999;
    line-height: 1;
    margin-bottom: 4px;
}
.cp-context-title {
    display: block;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.1;
}
.cp-context-toggle {
    background: none;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.cp-context-toggle:hover { color: #333; }
.cp-context-body {
    overflow-y: auto;
    padding: 0;
    flex: 1;
}
.cp-context-card {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
}
.cp-context-card:last-child {
    border-bottom: none;
}
.cp-context-card p {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 13px;
    line-height: 1.55;
    color: #333;
    margin: 0;
}
.cp-context-card p strong {
    color: #1a1a1a;
}
.cp-context-card-watch {
    background: #fafafa;
}
.cp-context-card-watch p strong {
    color: #1a1a1a;
    font-style: italic;
}
.cp-context-link {
    padding: 12px 16px;
    background: #fafafa;
    border-top: 1px solid #e8e8e8;
}
.cp-context-link a {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-decoration: none;
    letter-spacing: 0.02em;
}
.cp-context-link a:hover {
    color: #1a1a1a;
}

/* Reopen button */
.cp-context-reopen {
    position: fixed;
    top: 100px;
    right: 24px;
    z-index: 1001;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 13px;
    font-weight: 700;
    color: #1a1a1a;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: 3px solid #1a1a1a;
    padding: 10px 16px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.cp-context-reopen:hover {
    background: #fafafa;
}

/* Wide desktop: position panel beside the 960px content area */
@media (min-width: 1600px) {
    .cp-context {
        right: calc((100vw - 960px) / 2 - 324px);
    }
    .cp-context-reopen {
        right: calc((100vw - 960px) / 2 - 324px);
    }
}

/* Tablet: narrower panel, tighter positioning */
@media (max-width: 1100px) {
    .cp-context {
        width: 260px;
        right: 12px;
    }
    .cp-context-reopen {
        right: 12px;
    }
}

/* Mobile: inline collapsible, collapsed by default */
@media (max-width: 768px) {
    .cp-context {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        max-height: none;
        margin: 0 auto;
        max-width: 960px;
        border: none;
        border-top: 3px solid #1a1a1a;
        border-bottom: 1px solid #e0e0e0;
        box-shadow: none;
    }
    .cp-context.cp-context--mobile-collapsed {
        display: none;
    }
    .cp-context-reopen {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        max-width: 960px;
        margin: 0 auto;
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: left;
        border: none;
        border-top: 3px solid #1a1a1a;
        border-bottom: 1px solid #e0e0e0;
        box-shadow: none;
        padding: 14px 16px;
        font-size: 15px;
    }
    .cp-context-reopen::after {
        content: '\25BC';
        font-size: 10px;
        color: #999;
    }
    .cp-context-body {
        max-height: 300px;
    }
}

/* ── Loading ── */
.cp-loading {
    max-width: 960px;
    margin: 48px auto 0;
    padding: 0 24px;
}

.cp-loading-bar {
    height: 2px;
    background: #e0e0e0;
    position: relative;
    overflow: hidden;
}

.cp-loading-bar::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 30%;
    background: #999;
    animation: cp-loading-slide 1.2s ease-in-out infinite;
}

@keyframes cp-loading-slide {
    0% { left: -30%; }
    100% { left: 100%; }
}

/* ── Typography ── */
.cp-header {
    max-width: 960px;
    margin: 0 auto;
    padding: 48px 24px 0;
    text-align: center;
}

.cp-kicker {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #999;
    margin: 0 0 8px;
}

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

.cp-subhead {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 16px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

/* ── Forecast Note ── */
.cp-forecast-note {
    max-width: 960px;
    margin: 24px auto 0;
    padding: 16px 24px;
    background: #fdf8f0;
    border-left: 3px solid #e8a838;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 13px;
    color: #555;
    line-height: 1.6;
}
.cp-forecast-note p {
    margin: 0 0 8px;
}
.cp-forecast-note p:last-child {
    margin-bottom: 0;
}
.cp-forecast-note a {
    color: #555;
    text-underline-offset: 2px;
}

/* ── Uncertainty Badge ── */
.cp-uncertainty-badge {
    display: inline-block;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #b45309;
    background: #fef3c7;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 6px;
    vertical-align: middle;
}

/* ── Seat Overview ── */
.cp-seat-overview {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 24px 0;
}

.cp-seat-label {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #999;
    margin: 0 0 8px;
}

.cp-seat-bar {
    display: flex;
    height: 48px;
    width: 100%;
    overflow: hidden;
}

.cp-seat-bar-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    transition: width 0.4s ease;
    position: relative;
}

.cp-seat-bar-label {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}

.cp-seat-legend {
    display: flex;
    gap: 24px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.cp-legend-entry {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 13px;
    color: #333;
}

.cp-legend-top {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.cp-legend-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.cp-legend-name { font-weight: 400; }
.cp-legend-count { font-weight: 700; font-variant-numeric: tabular-nums; }
.cp-legend-change { font-size: 11px; font-weight: 600; }
.cp-legend-change.positive { color: #2e7d32; }
.cp-legend-change.negative { color: #c62828; }

.cp-legend-from {
    font-size: 11px;
    color: #999;
    font-weight: 400;
}

.cp-legend-range {
    font-size: 10px;
    color: #aaa;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
    padding-left: 18px;
}

.cp-control-note {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 14px;
    color: #999;
    margin: 12px 0 0;
    padding-top: 10px;
    border-top: 0.5px solid #e0e0e0;
}

/* ── Polling Sliders ── */
.cp-sliders-section {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
}

.cp-slider-explainer {
    font-size: 13px;
    color: #666;
    margin: 0 0 10px;
    line-height: 1.4;
}

/* Inline mini-sliders (always visible) */
.cp-mini-sliders {
    display: flex;
    gap: 6px 14px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 0.5px solid #e0e0e0;
}

.cp-mini-slider {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.cp-mini-slider-party {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 11px;
    font-weight: 600;
    min-width: 24px;
}

.cp-mini-range {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 3px;
    background: #e0e0e0;
    outline: none;
    cursor: pointer;
}

.cp-mini-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    margin-top: -4.5px;
    background: var(--party-color, #333);
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}

.cp-mini-range::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--party-color, #333);
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}

.cp-mini-range::-webkit-slider-runnable-track {
    height: 3px;
    background: #e0e0e0;
}

.cp-mini-range::-moz-range-track {
    height: 3px;
    background: #e0e0e0;
}

.cp-mini-slider-val {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    min-width: 28px;
    color: #666;
}

.cp-mini-slider-actions {
    width: 100%;
    margin-top: 4px;
    display: flex;
    gap: 16px;
}

.cp-mini-slider-actions a {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 12px;
    color: #999;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cp-mini-slider-actions a:hover {
    color: #333;
}

.cp-slider-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 8px 0;
    border-bottom: 0.5px solid #e0e0e0;
    user-select: none;
}

.cp-slider-toggle-text {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 15px;
    font-weight: 600;
    color: #666;
}

.cp-slider-toggle-icon {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 18px;
    color: #999;
    font-weight: 300;
    line-height: 1;
}

.cp-slider-toggle:hover .cp-slider-toggle-text {
    color: #333;
}

/* Demographic modifier sliders */
.cp-demo-section { margin: 12px 0 0; padding: 8px 0 0; border-top: 1px solid var(--border, #e0e0e0); }
.cp-demo-header { display: flex; align-items: center; justify-content: space-between; }
.cp-demo-title { font-size: 0.72rem; font-weight: 600; color: var(--text-muted, #888); text-transform: uppercase; letter-spacing: 0.03em; }
.cp-demo-toggle { font-size: 0.72rem; color: var(--accent, #4a90d9); cursor: pointer; text-decoration: none; }
.cp-demo-toggle:hover { text-decoration: underline; }
.cp-demo-sliders { max-width: 480px; margin-top: 8px; }
.cp-demo-note { font-size: 0.68rem; color: var(--text-muted, #888); margin-bottom: 10px; }
.cp-demo-row { display: grid; grid-template-columns: 140px 1fr 30px; align-items: center; gap: 8px; margin-bottom: 6px; }
.cp-demo-label { font-size: 0.72rem; font-weight: 500; color: var(--text-secondary, #555); }
.cp-demo-range {
    width: 100%; height: 3px;
    -webkit-appearance: none; appearance: none;
    background: var(--border, #d0d0d0); border-radius: 2px; outline: none;
}
.cp-demo-range::-webkit-slider-thumb {
    -webkit-appearance: none; width: 14px; height: 14px;
    border-radius: 50%; background: #666; cursor: pointer;
    border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    margin-top: -5.5px;
}
.cp-demo-range::-moz-range-thumb {
    width: 14px; height: 14px;
    border-radius: 50%; background: #666; cursor: pointer;
    border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.cp-demo-value {
    font-size: 0.72rem; font-weight: 600;
    color: var(--text-primary, #333); text-align: right;
    font-variant-numeric: tabular-nums; min-width: 24px;
}
.cp-demo-reset {
    margin-top: 8px; font-size: 0.68rem;
    color: var(--text-muted, #888); background: none;
    border: 1px solid var(--border, #d0d0d0); border-radius: 4px;
    padding: 4px 10px; cursor: pointer;
}
.cp-demo-reset:hover { border-color: var(--text-muted, #888); }

.cp-slider-panel {
    padding: 16px 0 0;
}

/* Mode toggle: sliders / manual */
.cp-slider-mode {
    display: flex;
    gap: 0;
    margin: 0 0 12px;
}

.cp-mode-btn {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #999;
    background: none;
    border: 1px solid #e0e0e0;
    padding: 4px 12px;
    cursor: pointer;
}

.cp-mode-btn:first-child {
    border-right: none;
}

.cp-mode-btn.active {
    color: #333;
    background: #f5f5f5;
    font-weight: 600;
}

.cp-mode-btn:hover:not(.active) {
    color: #666;
}

.cp-slider-note {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 11px;
    color: #999;
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.cp-sliders {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 480px;
}

.cp-slider-row {
    display: grid;
    grid-template-columns: 110px 1fr 44px;
    align-items: center;
    gap: 10px;
}

.cp-slider-party {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
}

.cp-slider-value {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

/* Manual number input */
.cp-slider-input {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #333;
    width: 100%;
    padding: 4px 8px;
    border: 1px solid #e0e0e0;
    background: #fff;
    outline: none;
    -moz-appearance: textfield;
}

.cp-slider-input::-webkit-outer-spin-button,
.cp-slider-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cp-slider-input:focus {
    border-color: #333;
}

/* Range slider styling */
.cp-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: #e0e0e0;
    outline: none;
    cursor: pointer;
}

.cp-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--party-color, #333);
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
    margin-top: -5px;
}

.cp-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--party-color, #333);
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}

.cp-slider::-webkit-slider-runnable-track {
    height: 4px;
    background: #e0e0e0;
}

.cp-slider::-moz-range-track {
    height: 4px;
    background: #e0e0e0;
}

.cp-slider-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
    padding-top: 8px;
}

.cp-slider-reset {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #999;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cp-slider-reset:hover {
    color: #333;
}

.cp-slider-total {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: #999;
}

/* Row explore hint */
.cp-row-explore {
    display: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 11px;
    color: #999;
    grid-column: 1 / -1;
    margin-top: -4px;
}

.cp-council-row:hover .cp-row-explore {
    display: block;
}

/* ── Postcode Search ── */
.cp-search {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 24px 0;
}

.cp-search-label {
    display: block;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin: 0 0 4px;
}

.cp-search-hint {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 13px;
    color: #999;
    margin: 0 0 10px;
}

.cp-search-wrap {
    position: relative;
    max-width: 360px;
}

.cp-search-row {
    display: flex;
    gap: 0;
}

.cp-autocomplete {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1.5px solid #ccc;
    border-top: none;
    z-index: 50;
    max-height: 280px;
    overflow-y: auto;
}

.cp-ac-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #333;
    background: none;
    border: none;
    border-bottom: 0.5px solid #f0f0f0;
    cursor: pointer;
}

.cp-ac-item:last-child {
    border-bottom: none;
}

.cp-ac-item:hover,
.cp-ac-item.highlighted {
    background: #f5f5f5;
}

.cp-ac-item strong {
    font-weight: 700;
}

.cp-search-input {
    flex: 1;
    padding: 10px 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 15px;
    color: #333;
    border: 1.5px solid #ccc;
    border-right: none;
    background: #fff;
    outline: none;
}

.cp-search-input:focus {
    border-color: #333;
}

.cp-search-btn {
    padding: 10px 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: #333;
    border: 1.5px solid #333;
    cursor: pointer;
}

.cp-search-btn:hover {
    background: #555;
    border-color: #555;
}

.cp-search-result {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 13px;
    color: #666;
    margin: 8px 0 0;
    min-height: 20px;
}

.cp-search-result a {
    color: #333;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── Map styles (used by council drill-down ward maps) ── */
.cp-map-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.cp-map-container svg {
    width: 100%;
    height: auto;
    display: block;
}

.cp-map-path {
    stroke: #fff;
    stroke-width: 0.5;
    vector-effect: non-scaling-stroke;
    cursor: pointer;
    transition: fill-opacity 0.15s;
}

.cp-map-path:hover {
    fill-opacity: 0.75;
    stroke: #333;
    stroke-width: 1.5;
}

.cp-map-tooltip {
    position: absolute;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    background: rgba(255, 255, 255, 0.95);
    padding: 4px 8px;
    white-space: nowrap;
    z-index: 20;
    border: 0.5px solid #e0e0e0;
}

.cp-map-tooltip-control {
    font-weight: 400;
    font-size: 11px;
}

/* ── Tier Sections ── */
.cp-tiers {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 24px 48px;
}

.cp-tier {
    margin-bottom: 32px;
}

.cp-tier-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.cp-tier-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.cp-tier-count {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 12px;
    color: #999;
}

.cp-tier-desc {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 13px;
    color: #999;
    margin: 0 0 8px;
    line-height: 1.4;
}

/* Council row - 3 column grid */
.cp-council-row {
    display: grid;
    grid-template-columns: 200px 1fr 180px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 0.5px solid #f0f0f0;
    cursor: pointer;
    gap: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

.cp-council-row:hover {
    background: #fafafa;
}

/* Left column: name + meta */
.cp-row-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cp-council-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.cp-council-meta {
    font-size: 11px;
    color: #999;
}

/* Center column: status + key changes */
.cp-row-center {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cp-row-status {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.cp-arrow {
    color: #999;
    font-size: 11px;
}

.cp-row-changes {
    font-size: 12px;
}

.cp-key-changes {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
}

.cp-change {
    font-weight: 600;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}
.cp-change.up { color: #2e7d32; }
.cp-change.down { color: #c62828; }

.cp-change-sep {
    color: #ccc;
    font-size: 11px;
}

/* Probability gauge */
.cp-gauge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 4px;
}

.cp-gauge-track {
    display: inline-block;
    width: 40px;
    height: 6px;
    background: #f0f0f0;
    position: relative;
    overflow: hidden;
}

.cp-gauge-fill {
    display: block;
    height: 100%;
    background: #c62828;
    transition: width 0.3s;
}

.cp-gauge-label {
    font-size: 10px;
    color: #999;
    font-variant-numeric: tabular-nums;
    min-width: 24px;
}

/* Right column: mini seat bar with CI */
.cp-row-right {
    display: flex;
    align-items: center;
}

.cp-mini-bar {
    display: flex;
    height: 18px;
    width: 100%;
    overflow: visible;
    position: relative;
}

.cp-mini-bar-seg {
    height: 100%;
    min-width: 1px;
    transition: width 0.3s ease;
    position: relative;
}

.cp-mini-bar-seg:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 6px;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
}

/* Expand/collapse toggle */
.cp-tier-toggle {
    display: inline-block;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #999;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 0;
    margin-top: 4px;
}

.cp-tier-toggle:hover {
    color: #333;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── Council Detail (drill-down) ── */
.cp-detail {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 24px 48px;
}

.cp-back {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #999;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 0 16px;
    display: inline-block;
}

.cp-back:hover {
    color: #333;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cp-detail-header {
    margin: 0 0 24px;
}

.cp-detail-name {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 32px;
    font-weight: 700;
    color: #333;
    margin: 0 0 4px;
    line-height: 1.1;
}

.cp-detail-type {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cp-election-type {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.cp-detail-control {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-top: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 14px;
}

.cp-detail-control-label {
    font-size: 12px;
    color: #999;
    font-weight: 400;
}

/* Detail seat bar */
.cp-detail-seats {
    margin: 0 0 8px;
}

.cp-detail-bar {
    display: flex;
    height: 40px;
    width: 100%;
    overflow: visible;
    position: relative;
}

.cp-detail-bar-seg {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    transition: width 0.4s ease;
}

.cp-detail-bar-label {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}

/* Majority line - appears on mini bars and detail bars */
.cp-majority-line {
    position: absolute;
    left: 50%;
    top: -2px;
    height: calc(100% + 4px);
    width: 0;
    border-left: 2px solid #cc0000;
    pointer-events: none;
    z-index: 2;
}
.cp-majority-label {
    position: absolute;
    top: calc(100% + 3px);
    left: 0;
    transform: translateX(-50%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 10px;
    color: #999;
    white-space: nowrap;
}

.cp-detail-legend {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.cp-detail-legend-entry {
    display: flex;
    align-items: baseline;
    gap: 5px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 12px;
    color: #333;
}

.cp-detail-legend-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    flex-shrink: 0;
}

.cp-detail-legend-count {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.cp-detail-legend-ci {
    font-size: 10px;
    color: #999;
    font-variant-numeric: tabular-nums;
}

.cp-detail-legend-diff {
    font-size: 11px;
    font-weight: 600;
}

.cp-detail-legend-diff.positive { color: #2e7d32; }
.cp-detail-legend-diff.negative { color: #c62828; }

.cp-detail-ci-note {
    font-size: 11px;
    color: #999;
    margin-top: 6px;
}

/* Last election comparison */
.cp-last-election {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #e8e8e8;
}
.cp-last-election-header {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}
.cp-last-bar {
    display: flex;
    height: 20px;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}
.cp-last-bar-seg {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2px;
    transition: width 0.3s ease;
}
.cp-last-bar-label {
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.cp-last-votes {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
}
.cp-last-vote-entry {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #444;
}
.cp-last-vote-swatch {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 2px;
}
.cp-last-vote-pct {
    font-weight: 600;
}
.cp-last-vote-diff {
    font-size: 11px;
}
.cp-last-vote-diff.positive { color: #16a34a; }
.cp-last-vote-diff.negative { color: #dc2626; }

/* Uncertainty + probability */
.cp-detail-uncertainty {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 13px;
    color: #999;
    margin: 12px 0 0;
    padding-top: 12px;
    border-top: 0.5px solid #e0e0e0;
}

/* Detail map + table layout */
.cp-detail-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-top: 32px;
}

.cp-detail-map-wrap {
    position: relative;
}

.cp-detail-map-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 0 0 4px;
}

.cp-detail-map-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 15px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

/* Ward map colour mode tabs */
.cp-ward-mode-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.cp-ward-mode {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #999;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 5px 10px;
    margin-bottom: -1px;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s;
}

.cp-ward-mode:hover {
    color: #666;
}

.cp-ward-mode.active {
    color: #333;
    font-weight: 600;
    border-bottom-color: #333;
}

.cp-ward-mode-label {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 10px;
    font-weight: 600;
    color: #bbb;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    align-self: center;
    padding: 0 6px 0 2px;
}

.cp-ward-mode-label:nth-of-type(2) {
    border-left: 1px solid #e0e0e0;
    margin-left: 6px;
    padding-left: 10px;
}

.cp-map-mismatch-note {
    font-size: 11px;
    color: #999;
    margin-top: 6px;
    line-height: 1.5;
}

.cp-map-legend {
    margin-top: 8px;
}

.cp-map-legend-title {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin: 0 0 6px;
}

.cp-map-legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cp-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 12px;
    color: #333;
}

.cp-legend-item i.cp-legend-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    flex-shrink: 0;
}

.cp-legend-item i.cp-legend-gradient {
    display: inline-block;
    width: 32px;
    height: 10px;
    flex-shrink: 0;
    border-radius: 2px;
}

.cp-map-legend-bar {
    height: 10px;
    border-radius: 4px;
    max-width: 200px;
}

.cp-map-legend-range {
    display: flex;
    justify-content: space-between;
    max-width: 200px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

/* Ward table */
.cp-ward-table-wrap {
    overflow-x: auto;
}

.cp-ward-table-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 15px;
    font-weight: 700;
    color: #333;
    margin: 0 0 8px;
}

.cp-ward-table {
    width: 100%;
    border-collapse: collapse;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.cp-ward-table th {
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 6px 8px 6px 0;
    border-bottom: 1px solid #e0e0e0;
    white-space: nowrap;
}

.cp-ward-table th.num {
    text-align: right;
}

.cp-ward-table td {
    padding: 6px 8px 6px 0;
    border-bottom: 0.5px solid #f0f0f0;
    color: #333;
}

.cp-ward-table td.num {
    text-align: right;
}

.cp-ward-table tr:hover {
    background: #fafafa;
}

.cp-ward-table .ward-name {
    font-weight: 500;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cp-ward-table .ward-winner {
    font-weight: 600;
}

.cp-ward-table .ward-margin {
    font-size: 11px;
    color: #666;
}

.cp-ward-table .ward-seats {
    text-align: center;
}

.cp-ward-seat-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin: 0 1px;
    vertical-align: middle;
}

/* ── Ward Sidebar ── */
.cp-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1099;
}

@media (min-width: 769px) {
    .cp-sidebar-backdrop { display: none !important; }
}

body.cp-sidebar-open {
    overflow: hidden;
}

@media (min-width: 769px) {
    body.cp-sidebar-open { overflow: auto; }
}
.cp-ward-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    height: 100vh;
    background: #fff;
    border-left: 1px solid #e0e0e0;
    padding: 24px;
    overflow-y: auto;
    z-index: 1100;
    box-shadow: -4px 0 12px rgba(0,0,0,0.06);
}

.cp-sidebar-close {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 20px;
    color: #999;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.cp-sidebar-close:hover {
    color: #333;
}

.cp-sidebar-name {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin: 0 0 4px;
    padding-right: 32px;
    line-height: 1.2;
}

.cp-sidebar-seats {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 11px;
    color: #999;
}

.cp-sidebar-winner {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #333;
    margin: 12px 0 0;
    padding-bottom: 12px;
    border-bottom: 0.5px solid #e0e0e0;
}

.cp-sidebar-section-label {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 10px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 16px 0 8px;
}

.cp-sidebar-bars {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.cp-sidebar-bar-row {
    display: grid;
    grid-template-columns: 80px 1fr 40px;
    align-items: center;
    gap: 8px;
}

.cp-sidebar-bar-party {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 11px;
    font-weight: 600;
}

.cp-sidebar-bar-track {
    height: 12px;
    background: #f2f2f2;
    position: relative;
}

.cp-sidebar-bar-fill {
    height: 100%;
    display: block;
    transition: width 0.3s ease;
}

.cp-sidebar-bar-val {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #333;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.cp-sidebar-changes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 8px;
    border-top: 0.5px solid #e0e0e0;
}

.cp-sidebar-change {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.cp-sidebar-turnout {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 11px;
    color: #999;
    margin-top: 8px;
}

.cp-sidebar-allout-note {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 11px;
    color: #999;
    font-style: italic;
    line-height: 1.4;
    margin: 4px 0 8px;
}

.cp-sidebar-cc-note {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 12px;
    color: #333;
    margin: 4px 0 8px;
    line-height: 1.4;
}

.cp-sidebar-cc-caveat {
    font-size: 10px;
    color: #999;
    font-style: italic;
}

.cp-sidebar-link {
    display: inline-block;
    margin-top: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 12px;
    color: #999;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cp-sidebar-link:hover {
    color: #333;
}

/* Multi-seat ward allocation */
.cp-sidebar-seat-alloc {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-bottom: 4px;
}
.cp-sidebar-alloc-entry {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 12px;
    color: #333;
}
.cp-sidebar-alloc-swatch {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}
.cp-sidebar-alloc-name {
    font-weight: 400;
}
.cp-sidebar-alloc-count {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Selected ward row highlight */
.cp-ward-table tr.selected {
    background: #f5f5f5;
}

.cp-ward-table tr.selected td {
    font-weight: 600;
}

/* Data pack link */
/* ── By-elections section ── */

.cp-byelections-wrap {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 0.5px solid #e0e0e0;
}

.cp-byelections-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 15px;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
}

.cp-byelection-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 0.5px solid #f0f0f0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 12px;
    color: #333;
}

.cp-byelection-row:hover {
    background: #fafafa;
}

.cp-byelection-date {
    color: #999;
    font-size: 11px;
    min-width: 60px;
    font-variant-numeric: tabular-nums;
}

.cp-byelection-ward {
    flex: 1;
    font-weight: 500;
}

.cp-byelection-result {
    font-size: 12px;
    min-width: 100px;
    text-align: right;
}

.cp-byelection-gain {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border: 1.5px solid #999;
    color: #333;
    letter-spacing: 0.5px;
}

.cp-byelection-hold {
    font-size: 10px;
    font-weight: 500;
    padding: 1px 6px;
    color: #999;
    border: 1px solid #e0e0e0;
    letter-spacing: 0.5px;
}

.cp-byelection-more {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 12px;
    color: #999;
    cursor: pointer;
    padding: 8px 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cp-byelection-more:hover {
    color: #333;
}

.cp-detail-datapack {
    display: inline-block;
    margin-top: 24px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 13px;
    color: #333;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cp-detail-datapack:hover {
    color: #000;
}

/* ── Data credits ── */
.cp-credits {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 24px 16px;
    border-top: 0.5px solid #e0e0e0;
}

.cp-credits p {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 12px;
    color: #999;
    line-height: 1.5;
    margin: 0;
}

.cp-credits a {
    color: #999;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cp-credits a:hover {
    color: #666;
}

.cp-credits p:first-child a {
    color: #666;
    font-weight: 600;
}

/* ── Region Tabs ── */
.cp-region-tabs-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.cp-region-tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e0e0e0;
}

.cp-region-tab {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 8px 20px;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.cp-region-tab:hover {
    color: #333;
}

.cp-region-tab.active {
    color: #333;
    font-weight: 600;
    border-bottom-color: #333;
}

/* Region summary headline */
.cp-region-summary {
    max-width: 600px;
    margin: 16px auto 0;
    text-align: center;
}

.cp-region-summary-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin: 0 0 2px;
}

.cp-region-summary-meta {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 13px;
    color: #999;
    margin: 0 0 8px;
}

.cp-region-changes {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.cp-region-change {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.cp-region-content {
    display: grid;
    grid-template-columns: minmax(280px, 400px) 1fr;
    gap: 24px;
    align-items: start;
    margin-top: 16px;
}

.cp-region-list {
    max-height: 80vh;
    overflow-y: auto;
}

.cp-region-map {
    position: relative;
}

.cp-region-map svg {
    width: 100%;
    height: auto;
    display: block;
}

.cp-region-path {
    transition: opacity 0.15s ease;
}

.cp-region-map-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 4px;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
}

/* ── Democracy Club disclosure ── */
.cp-dc-disclosure {
    margin-top: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 13px;
    max-width: 520px;
}

.cp-dc-disclosure summary {
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

.cp-dc-disclosure summary:hover { color: #000; }

.cp-dc-body {
    padding: 0 14px 14px;
    line-height: 1.5;
    color: #444;
}

.cp-dc-date {
    font-weight: 700;
    font-size: 14px;
    color: #333;
    margin: 12px 0 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #eee;
}

.cp-dc-date:first-child { margin-top: 0; }

.cp-dc-ballot { margin-bottom: 12px; }

.cp-dc-ballot-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.cp-dc-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    padding: 1px 6px;
    border-radius: 3px;
    background: #f0f0f0;
    color: #666;
    margin-bottom: 4px;
}

.cp-dc-tag-cancel {
    background: #fef2f2;
    color: #dc2626;
}

.cp-dc-candidates {
    list-style: none;
    padding: 0;
    margin: 4px 0 0;
}

.cp-dc-candidates li {
    padding: 3px 0;
    border-bottom: 0.5px solid #f0f0f0;
}

.cp-dc-candidates li:last-child { border-bottom: none; }

.cp-dc-note {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.cp-dc-station,
.cp-dc-contact {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

.cp-dc-station a,
.cp-dc-contact a {
    color: #333;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cp-dc-attribution {
    margin-top: 12px;
    font-size: 11px;
    color: #999;
}

.cp-dc-attribution a { color: #999; }

.cp-dc-addr-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    margin-bottom: 4px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
}

.cp-dc-addr-btn:hover {
    background: #fafafa;
    border-color: #ccc;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .cp-header { padding: 32px 16px 0; }
    .cp-headline { font-size: 28px; }
    .cp-seat-overview { padding: 24px 16px 0; }
    .cp-seat-bar { height: 40px; }
    .cp-seat-bar-label { font-size: 12px; }
    .cp-seat-legend { gap: 16px; }
    .cp-legend-entry { font-size: 12px; }
    .cp-sliders-section { padding: 0 16px; }
    .cp-mini-range { width: 60px; }
    .cp-sliders { max-width: 100%; }
    .cp-slider-row { grid-template-columns: 90px 1fr 40px; gap: 6px; }
    .cp-slider-party { font-size: 12px; }
    .cp-search { padding: 24px 16px 0; }
    .cp-search-row { max-width: 100%; }
    .cp-tiers { padding: 24px 16px 48px; }

    .cp-council-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .cp-row-right {
        width: 100%;
    }

    .cp-mini-bar {
        height: 14px;
    }

    .cp-council-name { font-size: 13px; }
    .cp-council-meta { font-size: 10px; }
    .cp-gauge-track { width: 32px; }

    .cp-region-tab { font-size: 12px; padding: 6px 14px; }
    .cp-region-content { grid-template-columns: 1fr; }
    .cp-region-list { max-height: none; }

    .cp-detail { padding: 24px 16px 48px; }
    .cp-detail-name { font-size: 24px; }
    .cp-detail-body {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .cp-ward-mode { font-size: 11px; padding: 4px 7px; }
    .cp-ward-table { font-size: 11px; }
    .cp-ward-table th { font-size: 10px; }

    .cp-ward-sidebar {
        width: 100%;
        position: fixed;
        bottom: 0;
        top: auto;
        left: 0;
        right: 0;
        height: 60vh;
        border-left: none;
        border-top: 1px solid #e0e0e0;
        box-shadow: 0 -4px 12px rgba(0,0,0,0.06);
        border-radius: 12px 12px 0 0;
        padding-top: 28px;
    }
    .cp-ward-sidebar::before {
        content: '';
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 4px;
        background: #ccc;
        border-radius: 2px;
    }
}

/* ── SEO Landing Pages ── */
.cp-seo-landing {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 16px 48px;
    font-family: Georgia, "Times New Roman", serif;
}
.cp-seo-landing h1 {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 16px;
    color: #111;
}
.cp-seo-landing h2 {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 16px;
    font-weight: 700;
    margin: 24px 0 12px;
    color: #333;
}
.cp-breadcrumb {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 20px;
}
.cp-breadcrumb a { color: #2563eb; text-decoration: none; }
.cp-breadcrumb a:hover { text-decoration: underline; }
.cp-seo-summary {
    font-size: 18px;
    line-height: 1.6;
    color: #374151;
    margin: 0 0 24px;
}
.cp-seo-seat-bar {
    position: relative;
    display: flex;
    height: 32px;
    border-radius: 4px;
    overflow: hidden;
    margin: 0 0 24px;
}
.cp-seo-bar-seg {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2px;
}
.cp-seo-bar-label {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.cp-seo-majority-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    border-left: 2px dashed rgba(0,0,0,0.3);
}
.cp-seo-majority-line span {
    position: absolute;
    top: -16px;
    left: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 10px;
    color: #999;
    white-space: nowrap;
}
.cp-seo-table {
    width: 100%;
    border-collapse: collapse;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 14px;
    margin: 0 0 16px;
}
.cp-seo-table th {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 2px solid #333;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #666;
}
.cp-seo-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #e5e7eb;
}
.cp-seo-table .positive { color: #16a34a; }
.cp-seo-table .negative { color: #dc2626; }
.cp-seo-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}
.cp-seo-key-changes {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 13px;
    color: #555;
    margin: 0 0 16px;
}
.cp-seo-info {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #555;
    margin: 0 0 24px;
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 6px;
}
.cp-seo-info p { margin: 4px 0; }
.cp-seo-last-election {
    margin: 0 0 24px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}
.cp-seo-last-seats {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #555;
    margin: 0 0 8px;
}
.cp-seo-last-votes {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
}
.cp-seo-vote-entry {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #444;
}
.cp-seo-battleground ul {
    padding-left: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #444;
    line-height: 1.8;
}
.cp-seo-links {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cp-seo-link {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #2563eb;
    text-decoration: none;
}
.cp-seo-link:hover { text-decoration: underline; }

/* National SEO summary table (on council-projector.html) */
.cp-seo-national {
    max-width: 900px;
    margin: 0 auto 24px;
    padding: 0 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
.cp-seo-intro {
    font-size: 15px;
    color: #555;
    line-height: 1.6;
    margin: 0 0 16px;
}
.cp-seo-details summary {
    font-size: 14px;
    color: #2563eb;
    cursor: pointer;
    margin: 0 0 12px;
}
.cp-seo-council-table {
    width: 100%;
    font-size: 13px;
    border-collapse: collapse;
}
.cp-seo-council-table th {
    text-align: left;
    padding: 6px 10px;
    border-bottom: 2px solid #333;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #666;
}
.cp-seo-council-table td {
    padding: 5px 10px;
    border-bottom: 1px solid #f0f0f0;
}
.cp-seo-council-table a {
    color: #2563eb;
    text-decoration: none;
}
.cp-seo-council-table a:hover { text-decoration: underline; }
