/* =========================================================
   Unite the Right UK — styles.css
   Colour palette: Union Jack navy, red, white
   ========================================================= */

:root {
    --navy:        #012169;
    --navy-dark:   #00154d;
    --navy-light:  #1a3a8a;
    --red:         #C8102E;
    --red-dark:    #a50d25;
    --white:       #ffffff;
    --off-white:   #f5f6f8;
    --grey-light:  #e8eaed;
    --grey-mid:    #c9cdd4;
    --grey-text:   #5f6368;
    --dark-text:   #1a1a2e;

    /* Party colours */
    --con:         #0087DC;
    --con-dark:    #0066b5;
    --reform:      #12B6CF;
    --reform-dark: #0e9ab0;
    --restore:     #7B2D8B;
    --restore-dark:#5e1f6d;
    --labour:      #E4003B;

    --radius:      10px;
    --shadow:      0 2px 12px rgba(1, 33, 105, 0.10);
    --shadow-lg:   0 4px 24px rgba(1, 33, 105, 0.14);
}

/* ---- Reset & base ---- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--dark-text);
    background: var(--off-white);
}

a {
    color: var(--navy);
    text-decoration: underline;
}

strong {
    font-weight: 600;
}

.hidden {
    display: none !important;
}

.container {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---- Header ---- */
.site-header {
    background: var(--navy);
    padding: 14px 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-flag {
    font-size: 1.4rem;
    line-height: 1;
}

.logo-text {
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

/* ---- Hero ---- */
.hero {
    background: linear-gradient(145deg, var(--navy-dark) 0%, var(--navy) 60%, var(--navy-light) 100%);
    color: var(--white);
    padding: 70px 0 60px;
    text-align: center;
}

.hero h1 {
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 18px;
    letter-spacing: -0.5px;
}

.hero-sub {
    font-size: 1.05rem;
    opacity: 0.88;
    max-width: 580px;
    margin: 0 auto 28px;
    line-height: 1.75;
}

.hero-caveat {
    font-size: 0.82rem;
    opacity: 0.65;
    max-width: 520px;
    margin: 0 auto 28px;
    line-height: 1.6;
    font-style: italic;
}

/* ---- Constituency search ---- */
.or-divider {
    font-size: 0.82rem;
    opacity: 0.55;
    margin: 20px auto 12px;
    letter-spacing: 0.5px;
}

.constituency-search-wrap {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.constituency-input {
    width: 100%;
    padding: 13px 18px;
    font-size: 0.98rem;
    font-family: inherit;
    border: none;
    border-radius: var(--radius);
    outline: none;
    color: var(--dark-text);
    background: rgba(255,255,255,0.92);
}

.constituency-input:focus {
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.45);
}

.constituency-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    list-style: none;
    margin: 0;
    padding: 4px 0;
    z-index: 200;
    max-height: 280px;
    overflow-y: auto;
}

.cd-item {
    padding: 10px 16px;
    font-size: 0.93rem;
    color: var(--dark-text);
    cursor: pointer;
    transition: background 0.12s;
}

.cd-item:hover,
.cd-item:focus {
    background: var(--off-white);
    outline: none;
}

/* ---- Search ---- */
.search-box {
    display: flex;
    gap: 10px;
    max-width: 500px;
    margin: 0 auto;
    flex-wrap: wrap;
    justify-content: center;
}

.postcode-input {
    flex: 1;
    min-width: 190px;
    padding: 15px 20px;
    font-size: 1.1rem;
    font-family: inherit;
    border: none;
    border-radius: var(--radius);
    outline: none;
    letter-spacing: 1.5px;
    color: var(--dark-text);
}

.postcode-input:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.45);
}

.search-btn {
    padding: 15px 30px;
    background: var(--red);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.18s ease;
}

.search-btn:hover {
    background: var(--red-dark);
}

.search-btn:active {
    transform: translateY(1px);
}

.error-msg {
    margin-top: 14px;
    color: #ffc9c9;
    font-size: 0.95rem;
}

/* ---- Loading ---- */
.loading-section {
    padding: 70px 0;
    text-align: center;
    color: var(--grey-text);
}

.spinner {
    width: 44px;
    height: 44px;
    border: 4px solid var(--grey-light);
    border-top-color: var(--navy);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    margin: 0 auto 18px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---- Data mode banner ---- */
.data-mode-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.4;
}

.data-mode-banner.mode-actuals {
    background: #f0f4ff;
    border: 1px solid #c7d4f5;
    color: #2c3e7a;
}

.data-mode-banner.mode-projection {
    background: #e6f9fb;
    border: 1px solid #9de4ec;
    color: #0b5e6b;
}

.data-mode-banner.mode-override {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    color: #78350f;
}

.banner-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

/* ---- Results ---- */
.results-section,
.no-data-section {
    padding: 50px 0 60px;
}

.constituency-header {
    margin-bottom: 28px;
}

.section-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--grey-text);
    margin-bottom: 6px;
}

.constituency-header h2 {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--navy);
    line-height: 1.2;
}

/* ---- Recommendation box ---- */
.recommendation-box {
    border-radius: var(--radius);
    padding: 30px 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-lg);
    color: var(--white);
}

.recommendation-box.rec-conservative {
    background: linear-gradient(135deg, var(--con) 0%, var(--con-dark) 100%);
}

.recommendation-box.rec-reform {
    background: linear-gradient(135deg, var(--reform) 0%, var(--reform-dark) 100%);
}

.recommendation-box.rec-restore_britain {
    background: linear-gradient(135deg, var(--restore) 0%, var(--restore-dark) 100%);
}

.rec-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.8;
    margin-bottom: 8px;
}

.rec-party {
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 14px;
    line-height: 1.1;
}

.rec-reason {
    font-size: 1rem;
    line-height: 1.7;
    opacity: 0.95;
}

/* ---- Party bars ---- */
.results-breakdown {
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px 30px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.breakdown-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--grey-text);
    margin-bottom: 22px;
}

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

.party-bar-row:last-of-type {
    margin-bottom: 0;
}

.party-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 7px;
    gap: 8px;
}

.party-bar-name {
    font-size: 0.95rem;
    font-weight: 600;
}

.party-bar-recommended {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(0,0,0,0.08);
    padding: 2px 7px;
    border-radius: 20px;
    margin-left: 8px;
}

.party-bar-votes {
    font-size: 0.88rem;
    color: var(--grey-text);
    white-space: nowrap;
}

.party-bar-track {
    height: 12px;
    background: var(--grey-light);
    border-radius: 6px;
    overflow: hidden;
}

.party-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 2px;
}

.fill-conservative  { background: var(--con); }
.fill-reform        { background: var(--reform); }
.fill-restore_britain { background: var(--restore); }

.data-note {
    font-size: 0.78rem;
    color: var(--grey-text);
    margin-top: 18px;
}

/* ---- Vote impact ---- */
.vote-impact {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 20px 24px;
    margin-bottom: 28px;
    font-size: 0.95rem;
    line-height: 1.7;
}

.vote-impact-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #92400e;
    margin-bottom: 8px;
}

.vote-impact p {
    color: #78350f;
}

/* ---- No data card ---- */
.info-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px 30px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.info-card p {
    color: var(--grey-text);
    margin-bottom: 10px;
}

.info-card p:last-child {
    margin-bottom: 0;
}

/* ---- Reset button ---- */
.reset-btn {
    background: transparent;
    border: 2px solid var(--navy);
    color: var(--navy);
    padding: 12px 22px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.18s ease;
}

.reset-btn:hover {
    background: var(--navy);
    color: var(--white);
}

/* ---- Tactical voting chart ---- */
.chart-section {
    background: var(--white);
    padding: 60px 0 50px;
    border-top: 1px solid var(--grey-light);
}

.chart-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 10px;
    letter-spacing: -0.3px;
}

.chart-sub {
    font-size: 0.93rem;
    color: var(--grey-text);
    margin-bottom: 32px;
    line-height: 1.6;
}

.tactical-chart {
    position: relative;
    margin-bottom: 20px;
}

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

.legend-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.88rem;
    color: var(--dark-text);
}

.legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* Tooltip */
.chart-tooltip {
    position: absolute;
    background: var(--dark-text);
    color: var(--white);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.86rem;
    line-height: 1.7;
    pointer-events: none;
    z-index: 300;
    min-width: 190px;
    box-shadow: var(--shadow-lg);
}

.tip-title {
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 5px;
}

.tip-row {
    display: flex;
    align-items: center;
    gap: 7px;
}

.tip-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

/* ---- About section ---- */
.about-section {
    background: var(--navy);
    color: var(--white);
    padding: 70px 0;
}

.about-title {
    font-size: 1.6rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 40px;
    letter-spacing: -0.3px;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 20px;
}

.about-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius);
    padding: 26px;
}

.about-card-icon {
    font-size: 1.4rem;
    margin-bottom: 12px;
}

.about-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #a8d4ff;
}

.about-card p {
    font-size: 0.93rem;
    line-height: 1.75;
    opacity: 0.88;
}

/* ---- Contact section ---- */

.contact-section {
    background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%);
    padding: 60px 0;
}

.contact-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
}

.contact-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 10px;
    letter-spacing: -0.3px;
}

.contact-sub {
    font-size: 0.97rem;
    color: rgba(255,255,255,0.8);
    line-height: 1.7;
    max-width: 480px;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--red);
    color: var(--white);
    text-decoration: none;
    padding: 16px 28px;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    transition: background 0.18s ease, transform 0.18s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    flex-shrink: 0;
}

.contact-btn:hover {
    background: var(--red-dark);
    color: var(--white);
    text-decoration: none;
    transform: translateY(-2px);
}

.contact-btn-x {
    background: #000;
}

.contact-btn-x:hover {
    background: #222;
}

.contact-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

.footer-x-link {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.15s;
}

.footer-x-link:hover {
    color: var(--white);
}

@media (max-width: 600px) {
    .contact-inner {
        flex-direction: column;
        text-align: center;
    }
    .contact-sub {
        max-width: 100%;
    }
    .contact-actions {
        width: 100%;
    }
    .contact-btn {
        justify-content: center;
    }
}

/* ---- Explore section (homepage nav cards) ---- */

.explore-section {
    background: var(--off-white);
    padding: 32px 0;
    border-bottom: 1px solid var(--grey-light);
}

.explore-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.explore-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--white);
    border: 2px solid var(--grey-light);
    border-radius: var(--radius);
    padding: 18px 20px;
    text-decoration: none;
    color: var(--dark-text);
    transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
    box-shadow: var(--shadow);
}

.explore-card:hover {
    border-color: var(--navy);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    color: var(--dark-text);
    text-decoration: none;
}

.explore-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
    line-height: 1;
}

.explore-card-title {
    font-size: 0.97rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 3px;
}

.explore-card-sub {
    font-size: 0.8rem;
    color: var(--grey-text);
    line-height: 1.5;
}

.explore-arrow {
    font-size: 1.2rem;
    color: var(--grey-mid);
    margin-left: auto;
    flex-shrink: 0;
    transition: color 0.18s, transform 0.18s;
}

.explore-card:hover .explore-arrow {
    color: var(--navy);
    transform: translateX(3px);
}

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

/* ---- Recommendations page ---- */

.container-wide {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-hero {
    background: linear-gradient(145deg, var(--navy-dark) 0%, var(--navy) 60%, var(--navy-light) 100%);
    color: var(--white);
    padding: 48px 0 40px;
    text-align: center;
}

.page-hero-title {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.4px;
    margin-bottom: 12px;
}

.page-hero-sub {
    font-size: 0.97rem;
    opacity: 0.85;
    max-width: 580px;
    margin: 0 auto;
    line-height: 1.7;
}

.table-section {
    padding: 36px 0 60px;
}

.table-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 18px;
}

.filter-input {
    padding: 9px 14px;
    font-size: 0.93rem;
    font-family: inherit;
    border: 1px solid var(--grey-mid);
    border-radius: var(--radius);
    outline: none;
    color: var(--dark-text);
    background: var(--white);
    min-width: 210px;
    flex: 1;
}

.filter-input:focus {
    border-color: var(--navy);
    box-shadow: 0 0 0 2px rgba(1, 33, 105, 0.12);
}

.filter-select {
    padding: 9px 14px;
    font-size: 0.93rem;
    font-family: inherit;
    border: 1px solid var(--grey-mid);
    border-radius: var(--radius);
    outline: none;
    color: var(--dark-text);
    background: var(--white);
    cursor: pointer;
}

.filter-select:focus {
    border-color: var(--navy);
}

.row-count {
    font-size: 0.85rem;
    color: var(--grey-text);
    margin-left: auto;
    white-space: nowrap;
}

.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: var(--white);
}

.rec-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    white-space: nowrap;
}

.rec-table thead {
    background: var(--navy);
    color: var(--white);
    position: sticky;
    top: 56px;
    z-index: 10;
}

.rec-table th {
    padding: 12px 14px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    text-align: left;
    user-select: none;
}

.rec-table th.num-col {
    text-align: right;
}

.rec-table th.sortable {
    cursor: pointer;
    transition: background 0.15s;
}

.rec-table th.sortable:hover {
    background: var(--navy-light);
}

.rec-table th.sort-asc,
.rec-table th.sort-desc {
    background: var(--navy-light);
}

.sort-icon {
    font-style: normal;
    opacity: 0.85;
}

.rec-table tbody tr {
    border-bottom: 1px solid var(--grey-light);
    transition: background 0.1s;
}

.rec-table tbody tr:hover {
    background: #f0f4ff;
}

.rec-table tbody tr:last-child {
    border-bottom: none;
}

.rec-table td {
    padding: 10px 14px;
    color: var(--dark-text);
    vertical-align: middle;
}

.rec-table td.num-col {
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--grey-text);
}

.rec-table td.right-total {
    color: var(--dark-text);
}

.col-name {
    min-width: 200px;
    position: sticky;
    left: 0;
    background: var(--white);
    z-index: 1;
    box-shadow: 2px 0 6px rgba(0,0,0,0.07);
}

.rec-table thead .col-name {
    background: var(--navy);
}

.rec-table tbody tr:hover .col-name {
    background: #f0f4ff;
}

@media (max-width: 540px) {
    .col-name {
        position: static;
        box-shadow: none;
        min-width: 140px;
    }
}

.party-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    color: var(--white);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.status-win {
    background: #dcfce7;
    color: #15803d;
}

.status-could {
    background: #fef9c3;
    color: #854d0e;
}

.status-long {
    background: #fee2e2;
    color: #b91c1c;
}

.loading-cell {
    text-align: center;
    padding: 40px 20px;
    color: var(--grey-text);
}

.table-note {
    font-size: 0.8rem;
    color: var(--grey-text);
    margin-top: 14px;
    line-height: 1.65;
}

/* ---- Map page ---- */

.scenario-controls {
    background: var(--white);
    border-bottom: 1px solid var(--grey-light);
    padding: 18px 0;
    position: sticky;
    top: 56px;
    z-index: 50;
}

.scenario-btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.scenario-btn {
    padding: 9px 22px;
    border: 2px solid var(--navy);
    border-radius: 30px;
    background: transparent;
    color: var(--navy);
    font-size: 0.92rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.18s ease;
}

.scenario-btn:hover {
    background: var(--navy);
    color: var(--white);
}

.scenario-btn.active {
    background: var(--navy);
    color: var(--white);
}

.scenario-label {
    font-size: 0.84rem;
    color: var(--grey-text);
    line-height: 1.5;
    min-height: 1.2em;
}

.map-section {
    padding: 24px 0 60px;
}

.map-outer {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px;
}

.map-status {
    text-align: center;
    padding: 60px 20px;
    color: var(--grey-text);
}

.map-content {
    width: 100%;
}

.map-and-panel {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.map-col {
    flex: 1;
    min-width: 0;
}

.map-container {
    position: relative;
    background: #e8f4f8;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.constituency-path {
    transition: opacity 0.15s;
    cursor: pointer;
}

.constituency-path:hover {
    opacity: 0.82;
}

.map-legend {
    margin-top: 14px;
}

.map-sidebar {
    width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Tally card */
.tally-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 20px;
}

.tally-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--grey-text);
    margin-bottom: 12px;
}

.tally-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.tally-table td {
    padding: 5px 0;
    vertical-align: middle;
}

.tally-num {
    text-align: right;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--dark-text);
}

.tally-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 7px;
    flex-shrink: 0;
    vertical-align: middle;
}

/* Detail panel */
.detail-panel {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 20px;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 10px;
}

.detail-name {
    font-size: 1rem;
    font-weight: 800;
    color: var(--navy);
    line-height: 1.3;
    margin-top: 4px;
}

.detail-region {
    font-size: 0.78rem;
    color: var(--grey-text);
    margin-top: 2px;
}

.detail-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--grey-text);
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
    flex-shrink: 0;
}

.detail-close:hover {
    color: var(--dark-text);
}

.detail-bar-row {
    margin-bottom: 10px;
}

.detail-bar-row:last-child {
    margin-bottom: 0;
}

.detail-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
    gap: 6px;
}

.detail-bar-name {
    font-size: 0.82rem;
    font-weight: 600;
}

.rec-star {
    font-size: 0.7rem;
    font-weight: 700;
    opacity: 0.8;
    background: rgba(0,0,0,0.08);
    padding: 1px 5px;
    border-radius: 10px;
    margin-left: 4px;
}

.detail-bar-pct {
    font-size: 0.8rem;
    color: var(--grey-text);
    white-space: nowrap;
}

.detail-bar-track {
    height: 8px;
    background: var(--grey-light);
    border-radius: 4px;
    overflow: hidden;
}

.detail-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
    min-width: 2px;
}

/* Zoom reset button */
.zoom-reset {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.92);
    border: 1px solid var(--grey-mid);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 0.8rem;
    font-family: inherit;
    font-weight: 600;
    color: var(--navy);
    cursor: pointer;
    z-index: 20;
    transition: background 0.15s;
}

.zoom-reset:hover {
    background: var(--white);
}

.map-hint {
    font-size: 0.78rem;
    color: var(--grey-text);
    margin-top: 8px;
    margin-bottom: 4px;
}

/* Detail panel recommendation */
.detail-rec-box {
    border-radius: 8px;
    padding: 16px 18px;
    margin-bottom: 12px;
    color: var(--white);
}

.detail-rec-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    opacity: 0.8;
    margin-bottom: 4px;
}

.detail-rec-party {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 8px;
    line-height: 1.2;
}

.detail-rec-reason {
    font-size: 0.82rem;
    line-height: 1.6;
    opacity: 0.95;
}

.detail-winner {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 14px;
    background: var(--off-white);
    border-radius: 8px;
    font-size: 0.84rem;
}

.detail-winner-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--grey-text);
}

.detail-winner-party {
    font-weight: 700;
    color: var(--dark-text);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Missing boundary data message */
.map-missing {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px 36px;
    max-width: 560px;
    margin: 0 auto;
}

.map-missing-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 10px;
}

.map-missing p {
    color: var(--grey-text);
    font-size: 0.93rem;
    line-height: 1.7;
    margin-bottom: 14px;
}

.map-missing ol {
    color: var(--dark-text);
    font-size: 0.93rem;
    line-height: 1.9;
    padding-left: 20px;
}

.map-missing code {
    background: var(--off-white);
    border: 1px solid var(--grey-light);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.88rem;
    font-family: monospace;
}

/* Map responsive */
@media (max-width: 760px) {
    .map-and-panel {
        flex-direction: column;
    }
    .map-sidebar {
        width: 100%;
    }
}

/* ---- Header nav (shared) ---- */

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-link {
    text-decoration: none;
}

.site-nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.site-nav a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.15s;
}

.site-nav a:hover {
    color: var(--white);
}

/* ---- Footer ---- */
.site-footer {
    background: var(--navy-dark);
    color: rgba(255, 255, 255, 0.5);
    padding: 22px 0;
    text-align: center;
    font-size: 0.83rem;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.7);
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .hero {
        padding: 50px 0 44px;
    }

    .hero h1 {
        font-size: 1.55rem;
    }

    .hero-sub {
        font-size: 0.97rem;
    }

    .search-box {
        flex-direction: column;
    }

    .postcode-input,
    .search-btn {
        width: 100%;
    }

    .constituency-header h2 {
        font-size: 1.45rem;
    }

    .rec-party {
        font-size: 1.5rem;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }
}
