/* Election section – full design copy (Nepal Bajar / nepsebajar reference) */

/* Slightly larger base font for election pages */
html:has(body.el-election-page) {
    font-size: 18px;
}

/* Hide main site header/footer when on election full page */
body.el-election-page .header,
body.el-election-page .mobile-header,
body.el-election-page .mobile-bottom-dock,
body.el-election-page .mobile-bottom-nav,
body.el-election-page .footer { display: none !important; }

body.el-election-page .main-wrapper { padding: 0; }

/* Some global/mobile styles add body safe-area padding for fixed headers.
   Election pages don't use the global fixed mobile header/footer, so force-reset it. */
body.el-election-page {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}
@supports (padding: max(0px)) {
    body.el-election-page {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
}

/* Variables */
.election-theme {
    --el-header-bg: #f0f2f5;
    --el-filter-bg: #e8eaed;
    --el-content-bg: #ffffff;
    --el-footer-bg: #1a2332;
    --el-primary: #18388e;
    --el-primary-hover: #18388e;
    --el-green: #16a34a;
    --el-green-hover: #15803d;
    --el-text: #1e293b;
    --el-text-muted: #64748b;
    --el-border: #e2e8f0;
    --el-card-header: #18388e;
}

/* Same variables for election section on main homepage (no .election-theme wrapper) */
.home-election-section {
    --el-header-bg: #f0f2f5;
    --el-filter-bg: #e8eaed;
    --el-content-bg: #ffffff;
    --el-footer-bg: #1a2332;
    --el-primary: #18388e;
    --el-primary-hover: #18388e;
    --el-green: #16a34a;
    --el-green-hover: #15803d;
    --el-text: #1e293b;
    --el-text-muted: #64748b;
    --el-border: #e2e8f0;
    --el-card-header: #18388e;
}

/* Wrapper */
.election-theme {
    background: var(--el-content-bg);
    color: var(--el-text);
    min-height: 100vh;
    padding: 0;
}

/* ========== Header (light grey) ========== */
.el-header {
    background: var(--el-header-bg);
    border-bottom: 1px solid var(--el-border);
    padding: 0.75rem 0;
}

/* Compact heading (between logo and menu) */
.el-election-inline{
    flex: 1 1 420px;
    max-width: 560px;
    min-width: 260px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--el-border);
    border-radius: 14px;
    background: #fff;
}

.el-election-inline__icon{
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--el-primary) 0%, #2b59ff 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}
.el-election-inline__icon i{ font-size: 1.35rem; line-height: 1; }

.el-election-inline__text{ min-width: 0; }
.el-election-inline__title{
    font-weight: 900;
    color: var(--el-primary);
    font-size: 0.95rem;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.02em;
}
.el-election-inline__subtitle{
    margin-top: 0.15rem;
    font-weight: 800;
    color: var(--el-text-muted);
    font-size: 0.8rem;
    line-height: 1.1;
}

.el-election-inline__days{
    margin-left: auto;
    padding: 0.35rem 0.55rem;
    border-radius: 12px;
    background: #eef2ff;
    text-align: center;
    flex: 0 0 auto;
}
.el-election-inline__days-num{
    font-size: 1.15rem;
    font-weight: 900;
    line-height: 1;
    color: #4f46e5;
}
.el-election-inline__days-label{
    margin-top: 0.2rem;
    font-size: 0.7rem;
    font-weight: 900;
    color: #4f46e5;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1;
}

.el-header__inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.el-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--el-text);
    font-weight: 700;
    font-size: 1.25rem;
}

.el-logo__stack{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.1;
}

.el-logo__icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--el-green) 0%, #0d9488 100%);
    border-radius: 8px;
    display: inline-block;
}

.el-logo__img {
    width: 180px;
    height: auto;
    object-fit: contain;
    display: block;
}

.el-logo__tag {
    font-size: 1rem;
    font-weight: 600;
    color: var(--el-text);
    margin-top: 0.25rem;
    display: inline-flex;
    align-items: baseline;
    gap: 0.5rem;
}

.el-logo__tag-date{
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--el-text-muted);
}

.el-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.el-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    color: var(--el-text);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

.el-nav__link:hover { background: rgba(0,0,0,0.06); color: var(--el-primary); }
.el-nav__link.active { color: var(--el-primary); font-weight: 600; }

.el-header__right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Hamburger – hidden on desktop */
.el-nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--el-text);
    font-size: 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.el-nav-toggle:hover { background: rgba(0,0,0,0.06); }
.el-nav-toggle:focus { outline: 2px solid var(--el-primary); outline-offset: 2px; }

.el-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
}

.el-pill--blue { background: var(--el-primary); color: #fff; }

.el-select-wrap { position: relative; }
.el-select {
    padding: 0.4rem 1.75rem 0.4rem 0.75rem;
    border: 1px solid var(--el-border);
    border-radius: 6px;
    background: #fff;
    font-size: 0.85rem;
    color: var(--el-text);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
}

.el-icon-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--el-text);
    text-decoration: none;
    font-size: 1.2rem;
    transition: background 0.2s;
}

.el-icon-btn:hover { background: rgba(0,0,0,0.06); }

.el-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.el-btn--primary { background: var(--el-primary); color: #fff; }
.el-btn--primary:hover { background: var(--el-primary-hover); color: #fff; }
.el-btn--green { background: var(--el-green); color: #fff; }
.el-btn--green:hover { background: var(--el-green-hover); color: #fff; }

.el-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--el-text-muted); display: inline-block; }

/* ========== Mobile: menu and layout ========== */
@media (max-width: 992px) {
    .el-nav-toggle { display: flex; }
    .el-header__right { margin-left: auto; }
    .el-nav {
        position: fixed;
        top: 0;
        right: 0;
        width: min(320px, 100vw);
        max-height: 100vh;
        overflow-y: auto;
        background: var(--el-header-bg);
        border-left: 1px solid var(--el-border);
        box-shadow: -4px 0 20px rgba(0,0,0,0.1);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 3.5rem 0 1.5rem;
        z-index: 1000;
        transform: translateX(100%);
        visibility: hidden;
        transition: transform 0.25s ease, visibility 0.25s;
    }
    .el-nav.is-open {
        transform: translateX(0);
        visibility: visible;
    }
    .el-nav__link {
        padding: 0.85rem 1.25rem;
        font-size: 1rem;
        border-radius: 0;
        border-bottom: 1px solid var(--el-border);
        min-height: 48px;
        align-items: center;
    }
    .el-nav__link:last-child { border-bottom: none; }
    body.el-nav-open { overflow: hidden; }
    .el-nav-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.3);
        z-index: 999;
    }
    body.el-nav-open .el-nav-overlay { display: block; }
}

@media (max-width: 768px) {
    .el-header__inner {
        padding: 0 1rem;
        gap: 0.5rem;
        flex-wrap: nowrap;
        justify-content: flex-start;
    }

    .el-logo{
        flex: 1 1 auto;
        min-width: 0;
    }

    .el-logo__stack{
        flex-direction: row;
        align-items: center;
        gap: 0.6rem;
        min-width: 0;
    }

    .el-logo__img { width: 120px; }

    .el-logo__tag{
        margin-top: 0;
        font-size: 0.78rem;
        font-weight: 700;
        gap: 0.15rem;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        line-height: 1.05;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 210px;
        color: var(--el-text);
    }

    .el-logo__tag-date{
        font-size: 0.7rem;
        font-weight: 600;
        color: var(--el-text-muted);
    }

    .el-election-inline{
        display: inline-flex;
        flex: 0 0 auto;
        max-width: none;
        min-width: 0;
        padding: 0.3rem 0.45rem;
        gap: 0.5rem;
        border-radius: 12px;
        background: #eef2ff;
        border-color: #c7d2fe;
    }
    .el-election-inline__text{ display: none; }
    .el-election-inline__icon{ width: 34px; height: 34px; border-radius: 10px; }
    .el-election-inline__days{
        margin-left: 0;
        padding: 0;
        background: transparent;
        display: inline-flex;
        flex-direction: row;
        align-items: baseline;
        gap: 0.35rem;
    }
    .el-election-inline__days-num{ font-size: 1.05rem; }
    .el-election-inline__days-label{
        margin-top: 0;
        font-size: 0.85rem;
        letter-spacing: 0;
        text-transform: none;
    }

    .el-nav-toggle{
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .el-header__right{ gap: 0.5rem; }

    .el-header__right .el-btn{
        min-height: 40px;
        padding: 0.45rem 0.85rem;
        font-size: 0.9rem;
        border-radius: 12px;
    }

    /* Make the filter/search area compact (2-col grid) */
    .el-filter-bar { padding: 0.5rem 0; }
    .el-filter-bar__inner {
        display: grid;
        grid-template-columns: 1.3fr 0.7fr;
        align-items: center;
        padding: 0 1rem;
        gap: 0.5rem;
    }
    /* Row 1: Search Candidates + Province (auto placement) */
    .el-filter-bar__search-candidates { width: 100%; }
    .el-filter-select { min-width: 0; width: 100%; padding: 0.5rem 2rem 0.5rem 0.75rem; }
    .el-filter-bar__search {
        grid-column: 1 / -1;
        margin-left: 0;
        width: 100%;
        min-height: 44px;
        padding: 0.55rem 1rem;
        border-radius: 12px;
    }
    .el-filter-bar__search-input { padding: 0.55rem 0.85rem; font-size: 0.95rem; }
    .el-filter-bar__search-btn { width: 44px; }
    .el-main { padding: 1rem; }
    .el-hot-zone-grid { grid-template-columns: 1fr !important; gap: 1rem; }
    .el-constituency-card__body { grid-template-columns: 1fr; gap: 1rem; }
    .election-theme .candidates-grid { grid-template-columns: 1fr; }
    .el-province-grid { grid-template-columns: 1fr; }
    .el-map-wrap { min-height: 260px; }
    .el-voters-chart-row { flex-direction: column; }
}

@media (max-width: 576px) {
    html:has(body.el-election-page) { font-size: 16px; }
    .el-header__inner { padding: 0 0.75rem; gap: 0.4rem; }

    .el-logo__img { width: 108px; }
    .el-logo__tag { font-size: 0.72rem; max-width: 150px; }
    .el-logo__tag-date{ font-size: 0.7rem; }

    .el-election-inline{
        padding: 0.25rem 0.4rem;
        border-radius: 12px;
    }
    .el-election-inline__icon{ width: 32px; height: 32px; }
    .el-election-inline__days-num{ font-size: 1rem; }
    .el-election-inline__days-label{ font-size: 0.8rem; }

    .el-icon-btn, .el-nav-toggle { min-width: 40px; min-height: 40px; }

    .el-header__right .el-btn{
        min-height: 40px;
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
        border-radius: 12px;
    }

    /* Even tighter filter bar on very small screens */
    .el-filter-bar__inner { padding: 0 0.5rem; gap: 0.45rem; }
    .el-filter-select { font-size: 0.9rem; border-radius: 12px; }
    .el-filter-bar__search-input { font-size: 0.92rem; }
}

/* ========== Filter bar (lighter grey) ========== */
.el-filter-bar {
    background: var(--el-filter-bg);
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--el-border);
}

.el-filter-bar__inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.el-filter-select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid var(--el-border);
    border-radius: 6px;
    background: #fff;
    font-size: 0.875rem;
    color: var(--el-text);
    min-width: 140px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
}

.el-filter-bar__search { margin-left: auto; }

/* Search Candidates (unified input + icon button) */
.el-filter-bar__search-candidates {
    display: flex;
    align-items: stretch;
    min-width: 200px;
    max-width: 320px;
    flex: 1;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.el-filter-bar__search-input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1px solid var(--el-border);
    border-right: none;
    border-radius: 10px 0 0 10px;
    background: #fff;
    font-size: 0.9375rem;
    color: var(--el-text);
}
.el-filter-bar__search-input::placeholder {
    color: var(--el-text-muted);
}
.el-filter-bar__search-input:focus {
    outline: none;
    border-color: var(--el-primary);
}
.el-filter-bar__search-btn {
    width: 48px;
    flex-shrink: 0;
    border: none;
    border-radius: 0 10px 10px 0;
    background: #334155;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.el-filter-bar__search-btn:hover {
    background: #1e293b;
}
.el-filter-bar__search-btn i {
    font-size: 1.2rem;
}

@media (max-width: 991px) {
    .el-filter-bar__search-candidates {
        max-width: none;
        width: 100%;
    }
}

/* Mobile compact filter layout (must come AFTER base rules) */
@media (max-width: 991px) {
    .el-filter-bar { padding: 0.5rem 0; }

    .el-filter-bar__inner {
        display: grid !important;
        grid-template-columns: 1.3fr 0.7fr;
        align-items: center;
        gap: 0.5rem;
    }

    /* Row 1: Search Candidates + Province (auto placement) */
    .el-filter-bar__search-candidates { width: 100%; }

    .el-filter-select {
        min-width: 0;
        width: 100%;
        padding: 0.5rem 2rem 0.5rem 0.75rem;
        border-radius: 12px;
    }

    /* Rely on the icon button inside the search input */
    .el-filter-bar__search { display: none; }

    .el-filter-bar__search-input { padding: 0.55rem 0.85rem; font-size: 0.95rem; }
    .el-filter-bar__search-btn { width: 44px; }
}

@media (max-width: 576px) {
    .el-filter-bar__inner { gap: 0.45rem; }
    .el-filter-bar__search-input { font-size: 0.92rem; }
}

/* ========== Main content (white) ========== */
.el-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.5rem;
}

/* Charts row: Total Voters + Candidates Age Group side by side */
.el-charts-row {
    display: grid;
    grid-template-columns: 3fr 7fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: stretch;
}
@media (max-width: 991px) {
    .el-charts-row {
        grid-template-columns: 1fr;
    }
    .el-charts-row .el-voters-wrap,
    .el-charts-row .el-age-chart-wrap {
        height: auto;
        min-height: 0;
    }
}

/* Same height for both cards in the row */
.el-charts-row .el-voters-wrap,
.el-charts-row .el-age-chart-wrap {
    height: 420px;
    min-height: 420px;
    max-height: 420px;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}
.el-charts-row .el-voters-wrap .el-section-title,
.el-charts-row .el-age-chart-wrap .el-section-title {
    flex: 0 0 auto;
    margin-bottom: 0.75rem;
}
.el-charts-row .el-voters-wrap .el-voters-chart-row {
    flex: 1;
    min-height: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    overflow: hidden;
}
.el-charts-row .el-age-chart-wrap .el-age-chart-container {
    flex: 1;
    min-height: 0;
    height: auto;
    max-height: none;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Total Voters pie chart */
.el-voters-wrap {
    margin-bottom: 2rem;
}
.el-voters-wrap .el-section-title {
    margin-bottom: 1rem;
}
.el-charts-row .el-age-chart-container {
    max-width: 100%;
}
.el-voters-chart-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2rem;
    background: #fff;
    border: 1px solid var(--el-border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.el-voters-chart-container {
    flex: 0 0 280px;
    max-width: 100%;
}

/* In the homepage charts row, keep pie + legend neatly stacked */
.el-charts-row .el-voters-wrap .el-voters-chart-container {
    flex: 0 0 auto;
    width: 100%;
    max-width: 160px;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.el-charts-row .el-voters-wrap .el-voters-chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}
.el-charts-row .el-voters-wrap .el-voters-legend {
    width: 100%;
    font-size: 0.85rem;
}
.el-charts-row .el-voters-wrap .el-voters-legend li {
    padding: 0;
}
.el-charts-row .el-voters-wrap .el-voters-legend__dot {
    width: 10px;
    height: 10px;
}
.el-charts-row .el-voters-wrap .el-voters-legend__total {
    margin-bottom: 0.15rem;
}
.el-voters-legend {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.9375rem;
    color: var(--el-text);
}
.el-voters-legend li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    line-height: 1;
}
.el-voters-legend__total {
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.el-voters-legend__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #64748b;
}
.el-voters-legend__dot--female { background: #f87171; }
.el-voters-legend__dot--male { background: #a78bfa; }
.el-voters-legend__dot--other { background: #7dd3fc; }

/* Candidates Age Group chart */
.el-age-chart-wrap {
    margin-bottom: 2rem;
}
.el-age-chart-wrap .el-section-title {
    margin-bottom: 1rem;
}
.el-age-chart-container {
    background: #fff;
    border: 1px solid var(--el-border);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    max-width: 640px;
}

/* Map placeholder and Nepal districts SVG map */
.el-map-wrap {
    border-radius: 12px;
    min-height: 380px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--el-text-muted);
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.el-map-wrap .el-nepal-map {
    max-height: 800px;
    width: 100%;
    height: auto;
    display: block;
}

.el-map-wrap .mkhover {
    fill: #cbd5e1;
    transition: fill 0.2s ease, stroke 0.2s ease;
}

.el-map-wrap .mkhover:hover {
    /* Lighter hover so labels stay readable */
    fill: #60a5fa;
    stroke: rgba(15, 23, 42, 0.35);
    stroke-width: 2;
}

.el-map-wrap .mkhover.prov1 { fill: #bfdbfe; }
.el-map-wrap .mkhover.prov2 { fill: #bbf7d0; }
.el-map-wrap .mkhover.prov3 { fill: #fde68a; }
.el-map-wrap .mkhover.prov4 { fill: #e9d5ff; }
.el-map-wrap .mkhover.prov5 { fill: #fed7aa; }
.el-map-wrap .mkhover.prov6 { fill: #a5f3fc; }
.el-map-wrap .mkhover.prov7 { fill: #fecaca; }

.el-map-wrap .mkhover.prov1:hover,
.el-map-wrap .mkhover.prov2:hover,
.el-map-wrap .mkhover.prov3:hover,
.el-map-wrap .mkhover.prov4:hover,
.el-map-wrap .mkhover.prov5:hover,
.el-map-wrap .mkhover.prov6:hover,
.el-map-wrap .mkhover.prov7:hover {
    fill: #60a5fa;
    stroke: rgba(15, 23, 42, 0.35);
    stroke-width: 2;
}

.el-map-wrap .maptext {
    pointer-events: none;
    /* Outline text so it's readable on any fill */
    fill: #0f172a;
    paint-order: stroke;
    stroke: rgba(255, 255, 255, 0.9);
    stroke-width: 3px;
    stroke-linejoin: round;
    font-size: 16px;
}

/* Constituency page: mute all districts, highlight only the current constituency's district */
.el-map-wrap--constituency .mkhover.prov1,
.el-map-wrap--constituency .mkhover.prov2,
.el-map-wrap--constituency .mkhover.prov3,
.el-map-wrap--constituency .mkhover.prov4,
.el-map-wrap--constituency .mkhover.prov5,
.el-map-wrap--constituency .mkhover.prov6,
.el-map-wrap--constituency .mkhover.prov7 {
    fill: #cbd5e1;
    transition: fill 0.2s ease;
}
.el-map-wrap--constituency .mkhover:hover:not(.el-district-active) {
    fill: #94a3b8;
}
.el-map-wrap--constituency .mkhover.el-district-active {
    fill: var(--el-primary);
    stroke: rgba(0, 0, 0, 0.3);
    stroke-width: 2;
}
.el-map-wrap--constituency .mkhover.el-district-active:hover {
    fill: var(--el-primary);
}

.el-map-placeholder {
    text-align: center;
    padding: 2rem;
}

.el-map-placeholder.el-map-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Section title */
.el-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--el-text);
    margin: 0 0 1.25rem 0;
}

/* ========== Hot zone – constituency cards (header + नतिजा button, 3 cols: अग्रता / निकटतम / तेस्रो) ========== */
.el-hot-zone-grid {
    display: grid;
    /* Force 2 cards per row on desktop */
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

/* Mobile/tablet: 1 card per row */
@media (max-width: 991px) {
    .el-hot-zone-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
}

.el-constituency-card {
    background: #fff;
    border: 1px solid var(--el-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.el-constituency-card__header {
    background: var(--el-primary);
    color: #fff;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.el-constituency-card__title {
    font-weight: 600;
    font-size: 1rem;
}

.el-constituency-card__result-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    background: #fff;
    color: var(--el-primary);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: opacity 0.2s, box-shadow 0.2s;
}
.el-constituency-card__result-btn:hover {
    opacity: 0.95;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.el-constituency-card__result-btn i {
    font-size: 0.9rem;
}

.el-constituency-card__body {
    padding: 1.25rem 1rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.el-hotzone-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.el-rank-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
    color: #fff;
}
.el-rank-pill i {
    font-size: 0.65rem;
}
.el-rank-pill--leading {
    background: var(--el-primary);
}
.el-rank-pill--closest {
    background: #eab308;
    color: #1e293b;
}
.el-rank-pill--third {
    background: #94a3b8;
}

.el-hotzone-candidate {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}
.el-hotzone-candidate--link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: opacity 0.2s;
}
.el-hotzone-candidate--link:hover {
    opacity: 0.85;
}

.el-hotzone-candidate__photo-wrap {
    position: relative;
    margin-bottom: 0.5rem;
}
.el-hotzone-candidate__photo-wrap--leading {
    padding: 4px;
    border-radius: 50%;
    border: 2px dashed var(--el-primary);
}
.el-hotzone-candidate__photo,
.el-hotzone-candidate__photo--placeholder {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background: var(--el-border);
}
.el-hotzone-candidate__photo-wrap--leading .el-hotzone-candidate__photo,
.el-hotzone-candidate__photo-wrap--leading .el-hotzone-candidate__photo--placeholder {
    width: 56px;
    height: 56px;
}
.el-hotzone-candidate__party-icon,
.el-hotzone-candidate__party-icon--placeholder {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--el-content-bg);
    border: 1px solid var(--el-border);
    display: block;
}
.el-hotzone-candidate__party-logo {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--el-border);
    background: var(--el-content-bg);
}

.el-hotzone-candidate__name {
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--el-text);
    margin-bottom: 0.2rem;
    line-height: 1.3;
}

.el-hotzone-candidate__party {
    font-size: 0.7rem;
    color: var(--el-text-muted);
    margin-bottom: 0.4rem;
    line-height: 1.25;
    /* Prevent long party names from stretching Hot Zone cards */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

.el-hotzone-candidate__votes {
    font-size: 0.75rem;
    color: var(--el-text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
}
.el-hotzone-candidate__votes--leading {
    padding: 0.35rem 0.75rem;
    background: var(--el-primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: 8px;
}
.el-hotzone-candidate__diff {
    font-size: 0.7rem;
    color: #64748b;
}

/* Legacy candidate box (keep for any other use) */
.el-candidate-box {
    background: #f8fafc;
    border: 1px solid var(--el-border);
    border-radius: 10px;
    padding: 0.75rem;
    text-align: center;
    position: relative;
}
.el-candidate-box__photo { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; margin: 0 auto 0.5rem; display: block; background: var(--el-border); }
.el-candidate-box__name { font-weight: 600; font-size: 0.8rem; color: var(--el-text); }
.el-candidate-box__party { font-size: 0.7rem; color: var(--el-text-muted); }
.el-candidate-box__votes { font-size: 0.8rem; font-weight: 600; color: var(--el-primary); }
.el-candidate-box__status { position: absolute; bottom: 0.5rem; left: 0.5rem; width: 8px; height: 8px; border-radius: 50%; }
.el-candidate-box__status.won { background: var(--el-green); }
.el-candidate-box__status.lost { background: #dc2626; }
.el-candidate-box__info { position: absolute; bottom: 0.5rem; right: 0.5rem; color: var(--el-text-muted); font-size: 0.85rem; }

/* ========== Constituency page (SEO-friendly URL) ========== */
.el-constituency-page-header {
    margin-bottom: 1.5rem;
}
.el-constituency-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--el-text);
    margin: 0 0 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.el-constituency-page-title i { color: var(--el-primary); }
.el-constituency-page-subtitle {
    font-size: 0.875rem;
    color: var(--el-text-muted);
    margin: 0;
}
.el-constituency-top-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}
@media (max-width: 768px) {
    .el-constituency-top-grid { grid-template-columns: 1fr; }
}
.el-card--constituency-map,
.el-card--demographics {
    border: 1px solid var(--el-border);
    border-radius: 12px;
    overflow: hidden;
    min-height: 200px;
}
.el-constituency-map-placeholder,
.el-demographics-placeholder {
    padding: 2rem;
    text-align: center;
    color: var(--el-text-muted);
    background: #f8fafc;
}
.el-constituency-map-placeholder i,
.el-demographics-placeholder i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
    color: #cbd5e1;
}
/* District page: 3-column panels (House of Representatives style) */
.el-section-title--banner {
    background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
    color: var(--el-text);
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.el-district-panels {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.el-district-panel {
    background: #fff;
    border: 1px solid var(--el-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.el-district-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: var(--el-primary);
    color: #fff;
    padding: 0.75rem 1rem;
}

.el-district-panel__title {
    font-weight: 600;
    font-size: 1rem;
}

.el-district-panel__viewall {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem;
    background: rgba(255,255,255,0.2);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s;
}
.el-district-panel__viewall:hover {
    background: rgba(255,255,255,0.3);
    color: #fff;
}

.el-district-panel__body {
    padding: 0.5rem 0;
    max-height: 420px;
    overflow-y: auto;
}

.el-district-candidate-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--el-border);
    transition: background 0.15s;
}
.el-district-candidate-row:last-child { border-bottom: none; }
.el-district-candidate-row:hover {
    background: #f8fafc;
}
.el-district-candidate-row--leading {
    background: #f0f9ff;
}

.el-district-candidate-row__photo,
.el-district-candidate-row__photo--placeholder {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--el-border);
}
.el-district-candidate-row__photo--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--el-text-muted);
    font-size: 1.25rem;
}

.el-district-candidate-row__info {
    flex: 1;
    min-width: 0;
}
.el-district-candidate-row__name {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--el-text);
}
.el-district-candidate-row__party {
    display: block;
    font-size: 0.75rem;
    color: var(--el-text-muted);
}
.el-district-candidate-row__votes {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--el-text);
    flex-shrink: 0;
    min-width: 2.5rem;
    text-align: right;
}
.el-district-candidate-row__party-logo,
.el-district-candidate-row__party-logo--placeholder {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    object-fit: contain;
}
.el-district-candidate-row__party-logo--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--el-text-muted);
    font-size: 1rem;
    background: #f1f5f9;
    border-radius: 6px;
}

.el-district-panel__empty {
    padding: 1rem;
}

@media (max-width: 992px) {
    .el-district-panels { grid-template-columns: 1fr; }
}

/* Legacy district cards (kept for any other use) */
.el-district-constituencies {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}
.el-district-constituency-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border: 1px solid var(--el-border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--el-text);
    font-weight: 600;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.el-district-constituency-card:hover {
    border-color: var(--el-primary);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}
.el-district-constituency-card__num {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--el-primary);
    color: #fff;
    border-radius: 8px;
    font-size: 1rem;
}
.el-district-constituency-card__label { flex: 1; }
.el-district-constituency-card__arrow {
    color: var(--el-text-muted);
    font-size: 1.25rem;
}

.el-constituency-year-cards {
    display: grid;
    /* 3-column layout on desktop (420px min keeps cards readable) */
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 1.25rem;
}
.el-year-card {
    background: #fff;
    border: 1px solid var(--el-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.el-year-card__header {
    background: var(--el-primary);
    color: #fff;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 1rem;
}
.el-year-card__body {
    padding: 0.75rem;
}
.el-year-card__row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--el-border);
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}
.el-year-card__row:last-child { border-bottom: none; }
.el-year-card__row:hover { background: #f8fafc; }
.el-year-card__row--leading { background: #f0f9ff; }
.el-year-card__photo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--el-border);
}
.el-year-card__photo--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--el-text-muted);
    font-size: 1.25rem;
}
.el-year-card__info {
    flex: 1;
    min-width: 0;
}
.el-year-card__name {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--el-text);
}
.el-year-card__party {
    font-size: 0.75rem;
    color: var(--el-text-muted);
}
.el-year-card__votes {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--el-primary);
}
.el-year-card__party-logo,
.el-year-card__party-logo--placeholder {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    object-fit: contain;
}
.el-year-card__party-logo--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--el-text-muted);
    font-size: 0.9rem;
    background: #f1f5f9;
    border-radius: 6px;
}
.el-year-card__footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--el-border);
    background: #f8fafc;
}
.el-btn--sm { padding: 0.4rem 0.75rem; font-size: 0.8125rem; }

/* ========== Province results – chart cards ========== */
.el-province-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.el-province-card {
    background: #fff;
    border: 1px solid var(--el-border);
    border-radius: 12px;
    overflow: hidden;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.el-province-card__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--el-text);
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--el-border);
}

.el-province-legend {
    list-style: none;
    padding: 0;
    margin: 0;
}

.el-province-legend li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    font-size: 0.875rem;
    color: var(--el-text);
}

.el-province-legend .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Simple pie placeholder */
.el-pie-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    background: conic-gradient(#2563eb 0deg 120deg, #16a34a 120deg 220deg, #dc2626 220deg 360deg);
}

/* ========== Footer (dark) ========== */
.el-footer {
    background: var(--el-footer-bg);
    color: #cbd5e1;
    margin-top: 3rem;
    padding: 2.5rem 0 0;
}

.el-footer__inner { max-width: 1400px; margin: 0 auto; padding: 0 1.5rem; }

.el-footer__grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

@media (max-width: 992px) {
    .el-footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 576px) {
    .el-footer__grid { grid-template-columns: 1fr; }
}

.el-footer__logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    font-weight: 700;
    font-size: 1.25rem;
    text-decoration: none;
    margin-bottom: 0.5rem;
}

.el-footer__tagline {
    font-size: 0.875rem;
    color: #94a3b8;
    margin: 0 0 1rem 0;
}

.el-footer__social { display: flex; gap: 0.75rem; }
.el-footer__social-link {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #cbd5e1;
    font-size: 1.1rem;
    transition: background 0.2s;
}

.el-footer__social-link:hover { background: var(--el-primary); color: #fff; }

.el-footer__heading {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 1rem 0;
}

.el-footer__links { list-style: none; padding: 0; margin: 0; }
.el-footer__links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.875rem;
    display: block;
    padding: 0.25rem 0;
    transition: color 0.2s;
}

.el-footer__links a:hover { color: #fff; }

.el-footer__contact { list-style: none; padding: 0; margin: 0; }
.el-footer__contact li {
    font-size: 0.875rem;
    color: #94a3b8;
    padding: 0.35rem 0;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.el-footer__contact li i { margin-top: 0.2rem; flex-shrink: 0; color: var(--el-primary); }

.el-footer__bottom {
    padding: 1rem 0;
    text-align: center;
}

.el-footer__bottom p { margin: 0; font-size: 0.8rem; color: #64748b; }

/* ========== Year tabs (for index / candidates) ========== */
.election-theme .election-year-tabs {
    display: flex;
    gap: 0.25rem;
    background: #f1f5f9;
    padding: 0.25rem;
    border-radius: 8px;
    border: 1px solid var(--el-border);
}

.election-theme .election-year-tabs a {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    color: var(--el-text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.election-theme .election-year-tabs a:hover { color: var(--el-text); background: #fff; }
.election-theme .election-year-tabs a.active { background: var(--el-primary); color: #fff; }

/* Candidate list & profile (keep usable) */
.election-theme .candidates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.election-theme .candidate-card {
    background: #fff;
    border: 1px solid var(--el-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s;
}

.election-theme .candidate-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.election-theme .candidate-card a { color: inherit; text-decoration: none; display: block; padding: 1rem; cursor: pointer; }
.election-theme .candidate-card .candidate-photo {
    width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--el-border);
    float: left; margin-right: 0.75rem;
}
.election-theme .candidate-card .candidate-name { font-weight: 600; color: var(--el-text); margin-bottom: 0.25rem; }
.election-theme .candidate-card .candidate-party,
.election-theme .candidate-card .candidate-district { font-size: 0.8125rem; color: var(--el-text-muted); }
.election-theme .candidate-card .candidate-votes { font-size: 0.875rem; color: var(--el-primary); margin-top: 0.25rem; }

.election-theme .empty-state { text-align: center; padding: 2rem; color: var(--el-text-muted); }
.election-theme .breadcrumb-el { font-size: 0.875rem; margin-bottom: 1rem; }
.election-theme .breadcrumb-el a { color: var(--el-text-muted); text-decoration: none; }
.election-theme .breadcrumb-el a:hover { color: var(--el-primary); }
.election-theme a.btn-election {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--el-primary);
    color: #fff;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s;
}
.election-theme a.btn-election:hover { background: var(--el-primary-hover); color: #fff; }

/* Candidate profile page */
.election-theme .candidate-profile-header {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.election-theme .candidate-profile-header .photo-wrap img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--el-border);
}

.election-theme .candidate-profile-header .info h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: var(--el-text);
}

.election-theme .candidate-profile-header .info .meta {
    font-size: 0.875rem;
    color: var(--el-text-muted);
}

.election-theme .election-card {
    background: #fff;
    border: 1px solid var(--el-border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.election-theme .election-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--el-text);
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--el-border);
}

.election-theme .election-result-by-year .result-row {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--el-border);
    font-size: 0.875rem;
}

/* ========== Candidate page – two-column layout (Nepse Bajar style) ========== */
.el-main--candidate-page { padding: 1.5rem; }
.el-candidate-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    align-items: start;
}
@media (max-width: 992px) {
    .el-candidate-layout { grid-template-columns: 1fr; }
}

/* Candidate header: photo, name, party, age, constituency, actions */
.el-candidate-header {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--el-border);
    position: relative;
}
.el-candidate-header.is-winner { overflow: hidden; }
.el-candidate-header__photo {
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}
.el-candidate-header__photo img {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--el-border);
    background: var(--el-border);
}
.el-candidate-header__body {
    flex: 1;
    min-width: 0;
    position: relative;
    padding-right: 0;
    z-index: 2;
}
.el-candidate-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--el-text);
    margin: 0 0 0.35rem 0;
    line-height: 1.25;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Winner effect (per active year) */
.el-winner-badge{
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #1f2937;
    background: linear-gradient(135deg, #fbbf24 0%, #fde68a 100%);
    border: 1px solid rgba(245, 158, 11, 0.35);
}
.el-winner-badge i{ font-size: 0.95rem; color: #b45309; }
.el-candidate-header.is-winner .el-candidate-header__photo img{
    border-color: rgba(245, 158, 11, 0.9);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
}
.el-candidate-header.is-winner .el-candidate-total-votes{
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
}

/* Celebration falling stars (winner only) */
.el-celebrate-stars{
    position: absolute;
    inset: -20px 0 0 0;
    pointer-events: none;
    /* put effect ON TOP so it's clearly visible */
    z-index: 5;
}
.el-star{
    position: absolute;
    left: var(--left, 50%);
    top: -20px;
    width: var(--size, 10px);
    height: var(--size, 10px);
    opacity: var(--opacity, 0.85);
    transform: translateX(-50%) rotate(0deg);
    /* High-contrast multi-color confetti star (visible on white) */
    background: radial-gradient(
        circle at 35% 35%,
        #ffffff 0%,
        hsl(var(--hue, 42) 95% 70%) 35%,
        hsl(var(--hue, 42) 95% 55%) 70%,
        rgba(0, 0, 0, 0) 100%
    );
    outline: 1px solid rgba(17, 24, 39, 0.20);
    clip-path: polygon(
        50% 0%,
        61% 35%,
        98% 35%,
        68% 57%,
        79% 91%,
        50% 70%,
        21% 91%,
        32% 57%,
        2% 35%,
        39% 35%
    );
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.18));
    will-change: transform, opacity;
    animation: elStarFall var(--dur, 4.0s) ease-in infinite;
    animation-delay: var(--delay, 0s);
}
.el-star::after{
    content: '';
    position: absolute;
    left: 50%;
    top: 60%;
    width: 2px;
    height: 34px;
    transform: translateX(-50%) rotate(12deg);
    background: linear-gradient(
        to bottom,
        hsla(var(--hue, 42) 95% 55% / 0.65),
        hsla(var(--hue, 42) 95% 55% / 0.0)
    );
    border-radius: 999px;
}
@keyframes elStarFall{
    0%   { opacity: 0; transform: translateX(-50%) translateY(-40px) rotate(0deg) scale(0.9); }
    10%  { opacity: var(--opacity, 0.85); }
    100% { opacity: 0; transform: translateX(calc(-50% + var(--drift, 20px))) translateY(520px) rotate(260deg) scale(1.05); }
}
@media (prefers-reduced-motion: reduce) {
    /* Keep a visible "celebration" without motion */
    .el-star { animation: none !important; opacity: 0.25; top: 10px; }
}
.el-candidate-party {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: var(--el-text-muted);
    margin-bottom: 0.35rem;
}
.el-candidate-party i { color: var(--el-primary); font-size: 1rem; }
.el-candidate-party__logo{
    width: 52px;
    height: 52px;
    object-fit: contain;
    display: inline-block;
    border-radius: 6px;
    background: #fff;
    border: 1px solid var(--el-border);
    padding: 2px;
}
.el-candidate-total-votes {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    margin-bottom: 0;
    padding: 0.35rem 0.75rem;
    background: linear-gradient(135deg, var(--el-primary) 0%, var(--el-primary-hover, #2563eb) 100%);
    color: #fff;
    border-radius: 10px;
    font-size: 0.9rem;
}
.el-candidate-total-votes__label { opacity: 0.95; }
.el-candidate-total-votes__value { font-weight: 700; font-size: 1.1rem; }
.el-candidate-total-votes__year { opacity: 0.9; font-size: 0.85rem; }
.el-candidate-meta {
    font-size: 0.875rem;
    color: var(--el-text-muted);
}
.el-candidate-meta span + span::before { content: ' · '; }

/* Candidate header: meta left, total votes right */
.el-candidate-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.35rem;
}
.el-candidate-meta-row .el-candidate-total-votes {
    margin-left: auto;
    flex-shrink: 0;
}
@media (max-width: 576px) {
    .el-candidate-meta-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .el-candidate-meta-row .el-candidate-total-votes {
        margin-left: 0;
    }
}
.el-candidate-constituency { font-weight: 500; color: var(--el-text); }
.el-candidate-constituency--link { color: var(--el-primary); text-decoration: none; }
.el-candidate-constituency--link:hover { text-decoration: underline; }
.el-card__title-link { color: inherit; text-decoration: none; }
.el-card__title-link:hover { color: var(--el-primary); text-decoration: underline; }
.el-candidate-actions {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 0.5rem;
}
.el-btn--icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}
.el-btn--ghost { background: transparent; color: var(--el-text-muted); border: 1px solid var(--el-border); }
.el-btn--ghost:hover { background: #f1f5f9; color: var(--el-text); }

/* Election history (clickable year switch cards) */
.el-card--section { margin-bottom: 1.5rem; }
.el-election-history {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.el-election-history__item {
    margin: 0;
    padding: 0;
}

.el-election-history-card{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--el-border);
    border-radius: 14px;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.05s;
}
.el-election-history-card:hover{
    border-color: #c7d2fe;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
}
.el-election-history-card:active{ transform: translateY(1px); }
.el-election-history-card.is-active{
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12);
}

.el-election-history-card__left{
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    flex: 0 0 auto;
    min-width: 120px;
}
.el-election-history-card__badge{
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid #dbeafe;
    background: #eff6ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--el-primary);
    flex: 0 0 auto;
    overflow: hidden;
}
.el-election-history-card__badge i{ font-size: 1.4rem; }
.el-election-history-card__badge-img{
    width: 28px;
    height: 28px;
    object-fit: contain;
    display: block;
    filter: saturate(1.05) contrast(1.05);
}
.el-election-history-card__year{
    font-weight: 900;
    font-size: 1.05rem;
    color: #0f172a;
}

.el-election-history-card__main{
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.el-election-history-card__const{
    font-weight: 800;
    font-size: 1.05rem;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.el-election-history-card__party{
    font-size: 0.9rem;
    color: var(--el-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.el-election-history-card__right{
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    flex: 0 0 auto;
    color: var(--el-text-muted);
}
.el-election-history-card__votes{
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
}
.el-election-history-card__votes-label{
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--el-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.el-election-history-card__votes-value{
    font-weight: 900;
    color: #0f172a;
}
.el-election-history-card__status i{ color: var(--el-green); font-size: 1.25rem; }
.el-election-history-card__status--muted{ font-size: 0.9rem; font-weight: 700; color: var(--el-text-muted); }
.el-election-history-card__chev{ color: #94a3b8; font-size: 1.1rem; }

@media (max-width: 768px) {
    .el-election-history { gap: 0.6rem; }
    .el-election-history-card{ padding: 0.75rem 0.75rem; border-radius: 14px; }
    .el-election-history-card__badge{ width: 40px; height: 40px; border-radius: 12px; }
    .el-election-history-card__badge-img{ width: 24px; height: 24px; }
    .el-election-history-card__left{ min-width: 96px; gap: 0.6rem; }
    .el-election-history-card__year{ font-size: 1rem; }
    .el-election-history-card__const{ font-size: 1rem; }
    .el-election-history-card__party{ font-size: 0.85rem; }
    .el-election-history-card__votes-label{ display: none; }
    .el-election-history-card__status--muted{ display: none; }
}

/* Share bar */
.el-share-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding-top: 0.75rem;
    border-top: 1px solid var(--el-border);
}
.el-share-bar__label { font-size: 0.875rem; color: var(--el-text-muted); }
.el-share-bar__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #f1f5f9;
    color: var(--el-text-muted);
    font-size: 1.1rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.el-share-bar__link:hover { background: var(--el-primary); color: #fff; }

/* Introduction / biography */
.el-candidate-intro {
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--el-text);
}

/* Candidate info table (उम्मेदवारको जानकारी) */
.el-info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.el-info-table th,
.el-info-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--el-border);
    vertical-align: top;
}
.el-info-table th {
    width: 40%;
    max-width: 200px;
    font-weight: 600;
    color: var(--el-text-muted);
}
.el-info-table td { color: var(--el-text); }

/* Sidebar – category image card */
.el-candidate-category-card { padding: 0; overflow: hidden; }
.el-candidate-category-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.el-candidate-category-card__img {
    width: 100%;
    height: auto;
    max-height: 160px;
    object-fit: cover;
    display: block;
}
.el-candidate-category-card__label {
    display: block;
    padding: 0.6rem 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--el-text);
    background: #f8fafc;
    border-top: 1px solid var(--el-border);
}

/* Sidebar – other candidates from same constituency */
.el-candidate-sidebar { position: sticky; top: 1rem; }
.el-card--sidebar { margin-bottom: 1rem; }
.el-other-candidates {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 400px;
    overflow-y: auto;
}
.el-other-candidates__item { margin-bottom: 0.25rem; }
.el-other-candidates__link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--el-text);
    transition: background 0.2s;
}
.el-other-candidates__link:hover { background: #f8fafc; }
.el-other-candidates__photo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--el-border);
    flex-shrink: 0;
}
.el-other-candidates__photo--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--el-text-muted);
    font-size: 1.25rem;
}
.el-other-candidates__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.el-other-candidates__name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--el-text);
}
.el-other-candidates__party-row {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.el-other-candidates__party-logo {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.el-other-candidates__party-logo--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f1f5f9;
    color: var(--el-text-muted);
    font-size: 0.65rem;
}
.el-other-candidates__party {
    font-size: 0.75rem;
    color: var(--el-text-muted);
}
.el-other-candidates__votes {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--el-primary);
}
.el-other-candidates__arrow {
    color: var(--el-text-muted);
    font-size: 0.9rem;
    flex-shrink: 0;
}
.el-other-candidates__link:hover .el-other-candidates__arrow { color: var(--el-primary); }

/* ========== Candidates list table ========== */
.el-candidates-table-wrap {
    overflow-x: auto;
    background: #fff;
    border: 1px solid var(--el-border);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.el-candidates-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
    table-layout: fixed;
    display: table;
}
.el-candidates-table thead {
    display: table-header-group;
    background: #f8fafc;
    border-bottom: 1px solid var(--el-border);
}
.el-candidates-table tbody {
    display: table-row-group;
}
.el-candidates-table tr {
    display: table-row;
}
.el-candidates-table th,
.el-candidates-table td {
    display: table-cell;
}
.el-candidates-table th {
    text-align: left;
    padding: 0.875rem 1rem;
    font-weight: 600;
    color: var(--el-text);
}
.el-candidates-table__col-candidate { width: 28%; }
.el-candidates-table__col-party { width: 30%; }
.el-candidates-table__col-constituency { width: 24%; }
.el-candidates-table__col-votes { width: 10%; }
.el-candidates-table th:nth-child(1) { width: 28%; min-width: 140px; }
.el-candidates-table th:nth-child(2) { width: 30%; min-width: 160px; }
.el-candidates-table th:nth-child(3) { width: 24%; min-width: 140px; }
.el-candidates-table th:nth-child(4) { width: 10%; min-width: 70px; }
.el-candidates-table td:nth-child(2) {
    border-right: 1px solid var(--el-border);
}
.el-candidates-table td:nth-child(3) {
    white-space: normal;
    border-right: 1px solid var(--el-border);
}
.el-candidates-table td:nth-child(4) {
    text-align: right;
}
.el-candidates-table tbody tr {
    border-bottom: 1px solid var(--el-border);
}
.el-candidates-table tbody tr:last-child {
    border-bottom: none;
}
.el-candidates-table tbody tr:hover {
    background: #f8fafc;
}
.el-candidates-table td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    overflow: hidden;
}
.el-candidates-table__candidate-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}
.el-candidates-table__candidate-link:hover {
    color: var(--el-primary);
}
.el-candidates-table__photo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--el-border);
}
.el-candidates-table__photo--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    color: var(--el-text-muted);
    font-size: 1.25rem;
}
.el-candidates-table__candidate-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.el-candidates-table__name {
    font-weight: 600;
    color: var(--el-text);
}
.el-candidates-table__meta {
    font-size: 0.8125rem;
    color: var(--el-text-muted);
}
.el-candidates-table__party-inner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 100%;
}
.el-candidates-table__party {
    vertical-align: middle;
}
.el-candidates-table__party .el-candidates-table__party-logo {
    flex-shrink: 0;
}
.el-candidates-table__party-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.el-candidates-table__party-logo--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f5f9;
    color: var(--el-text-muted);
    font-size: 0.9rem;
}
.el-candidates-table__party-name {
    color: var(--el-text);
}
.el-candidates-table__constituency-inner {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.el-candidates-table__constituency {
    vertical-align: middle;
}
.el-candidates-table__constituency-link {
    color: var(--el-primary);
    text-decoration: none;
    font-weight: 500;
}
.el-candidates-table__constituency-link:hover {
    text-decoration: underline;
}
.el-candidates-table__constituency-meta {
    font-size: 0.8125rem;
    color: var(--el-text-muted);
}
.el-candidates-table__votes-num {
    font-weight: 600;
    color: var(--el-text);
}

/* ===== Candidates list (mobile) – match app-style rows ===== */
.el-candidates-mobile-list {
    display: none;
    background: #fff;
    border: 1px solid var(--el-border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.el-candidate-mobile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--el-border);
    text-decoration: none;
    color: inherit;
}
.el-candidate-mobile-row:last-child { border-bottom: 0; }
.el-candidate-mobile-row__left {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
    flex: 1;
}
.el-candidate-mobile-row__photo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--el-border);
    background: #f8fafc;
}
.el-candidate-mobile-row__photo--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--el-text-muted);
}
.el-candidate-mobile-row__info { min-width: 0; }
.el-candidate-mobile-row__name {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--el-text);
    line-height: 1.15;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.el-candidate-mobile-row__party {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--el-text-muted);
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
    min-width: 0;
}
.el-candidate-mobile-row__party-logo {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
}
.el-candidate-mobile-row__party-logo--placeholder {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--el-text-muted);
}
.el-candidate-mobile-row__party-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.el-candidate-mobile-row__meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    font-size: 0.95rem;
}
.el-candidate-mobile-row__dot { opacity: 0.7; }
.el-candidate-mobile-row__right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.45rem;
    flex-shrink: 0;
}
.el-candidate-mobile-row__votes {
    min-width: 40px;
    text-align: center;
    padding: 0.35rem 0.6rem;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid var(--el-border);
    font-weight: 800;
    color: var(--el-text);
}
.el-candidate-mobile-row__gender {
    font-size: 0.9rem;
    color: #94a3b8;
}
.el-candidate-mobile-row:hover { background: #f8fafc; }

@media (max-width: 768px) {
    .el-candidates-mobile-list { display: block; }
    .el-candidates-table-wrap--desktop { display: none; }
}
