@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

:root {
    
    /* Clean Professional Civic Color System */
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-subtle: #f1f5f9;
    
    /* Royal Blue Primary */
    --primary: #1d4ed8;
    --primary-hover: #1e40af;
    --primary-light: #eff6ff;
    --primary-border: #bfdbfe;
    --primary-gradient: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    --primary-glow: rgba(37, 99, 235, 0.15);
    
    /* Accent Status Colors */
    --status-shifted-bg: #fff7ed;
    --status-shifted-text: #c2410c;
    --status-shifted-border: #ffedd5;
    
    --status-death-bg: #fef2f2;
    --status-death-text: #b91c1c;
    --status-death-border: #fee2e2;
    
    --status-enrolled-bg: #eff6ff;
    --status-enrolled-text: #1d4ed8;
    --status-enrolled-border: #dbeafe;
    
    --status-untraceable-bg: #fffbeb;
    --status-untraceable-text: #b45309;
    --status-untraceable-border: #fef3c7;
    
    --status-gold-bg: #fffbeb;
    --status-gold-text: #b45309;
    --status-gold-border: #fef3c7;
    
    /* High Contrast Typography */
    --text-main: #0f172a;
    --text-body: #334155;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    /* Borders & Shadows */
    --border-main: #e2e8f0;
    --border-hover: #93c5fd;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-card: 0 4px 12px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.03);
    --shadow-hover: 0 10px 25px rgba(37, 99, 235, 0.12);
    --shadow-modal: 0 20px 40px -10px rgba(15, 23, 42, 0.25);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;
}

html, body {
    width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--text-body);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-main);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 14px;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
}

/* ==========================================================================
   Top Sponsor Bar (Prominent Photo Header)
   ========================================================================== */
.sponsor-top-bar {
    background: #ffffff;
    border-bottom: 1px solid var(--border-main);
    padding: 10px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

.sponsor-flex-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.sponsor-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

/* Prominent, Large Face-Centered Avatar */
.sponsor-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 15%; /* Focuses directly on face/portrait */
    border: 2.5px solid var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.sponsor-avatar:hover {
    transform: scale(1.05);
}

.sponsor-details {
    min-width: 0;
    overflow: hidden;
}

.sponsor-details h2 {
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sponsor-details p {
    font-size: 0.76rem;
    color: var(--primary);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sponsor-badge-tag {
    display: inline-block;
    background: var(--status-gold-bg);
    color: var(--status-gold-text);
    font-size: 0.62rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid var(--status-gold-border);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.sponsor-quick-cta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.btn-call-compact {
    background: var(--primary-gradient);
    color: #ffffff;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    box-shadow: 0 2px 6px var(--primary-glow);
    min-height: 38px;
}

.helpline-pill-compact {
    font-size: 0.74rem;
    color: var(--primary);
    font-weight: 700;
    background: var(--primary-light);
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--primary-border);
    white-space: nowrap;
}

@media (max-width: 640px) {
    .sponsor-flex-card {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .sponsor-brand {
        width: 100%;
    }
    .sponsor-avatar {
        width: 48px;
        height: 48px;
    }
    .sponsor-details h2 {
        font-size: 0.95rem;
    }
    .sponsor-details p {
        display: block !important;
        font-size: 0.72rem;
    }
    .sponsor-quick-cta {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
    }
    .sponsor-quick-cta a, .sponsor-quick-cta span {
        flex: 1;
        text-align: center;
        justify-content: center;
        padding: 6px 8px;
        font-size: 0.75rem;
        min-height: 34px;
        box-sizing: border-box;
    }
    .helpline-pill-compact {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }
}

@media print {
    body, html {
        background: #ffffff !important;
        color: #000000 !important;
        min-height: auto !important;
        height: auto !important;
    }
    .modal-overlay:not(.active),
    .modal-backdrop:not(.active):not(.is-open),
    .modal-window:not(.active),
    .modal-card:not(.active),
    .sponsor-top-bar {
        display: none !important;
        visibility: hidden !important;
    }
    .app-header {
        position: static !important;
        box-shadow: none !important;
        border-bottom: 1px solid #ccc !important;
        padding: 10px 0 !important;
    }
    .header-actions {
        display: none !important;
    }
    .app-footer {
        margin-top: 20px !important;
        padding: 16px 0 !important;
        background: #ffffff !important;
        color: #333333 !important;
        border-top: 1px solid #ccc !important;
        page-break-inside: avoid;
    }
    .footer-brand-title, .footer-col-title {
        color: #000000 !important;
    }
    .footer-independence-notice, .footer-col a, .footer-statutory-note, .footer-copy {
        color: #444444 !important;
    }
    .legal-card-box {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
}

/* ==========================================================================
   Hero Intro & Unified Header Section
   ========================================================================== */
.unified-hero-header {
    margin: 16px 0 14px 0;
    text-align: center;
}

.hero-top-navigation-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-main, #e2e8f0);
}

.public-nav-pills {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.nav-pill {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted, #64748b);
    text-decoration: none;
    padding: 5px 12px;
    border-radius: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.15s ease;
}

.nav-pill:hover {
    color: var(--primary, #1d4ed8);
    background: #eff6ff;
    border-color: #bfdbfe;
}

.nav-pill.active {
    color: #ffffff;
    background: var(--primary, #1d4ed8);
    border-color: var(--primary, #1d4ed8);
}

.mobile-more-wrapper {
    position: relative;
    display: none;
}

.mobile-nav-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
    min-width: 180px;
    z-index: 999;
    padding: 6px 0;
    text-align: left;
}

.mobile-nav-dropdown.show {
    display: block;
}

.mobile-nav-dropdown a {
    display: block;
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #334155;
    text-decoration: none;
    transition: background 0.15s ease;
}

.mobile-nav-dropdown a:hover,
.mobile-nav-dropdown a.active-dropdown-item {
    background: #eff6ff;
    color: #1d4ed8;
}

@media (max-width: 600px) {
    .desktop-only-pill {
        display: none !important;
    }
    .mobile-more-wrapper {
        display: inline-block;
    }
    .hero-top-navigation-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 8px;
    }
    .public-nav-pills {
        justify-content: center;
        width: 100%;
    }
    .nav-pill {
        font-size: 0.74rem;
        padding: 4px 8px;
    }
    .civic-tag {
        font-size: 0.65rem !important;
        padding: 3px 8px !important;
    }
    .hero-title-area h1 {
        font-size: 1.35rem !important;
        line-height: 1.18 !important;
    }
    .hero-title-area p {
        font-size: 0.8rem !important;
        line-height: 1.4 !important;
    }
}

.hero-title-area {
    text-align: center;
    margin: 12px 0 14px 0;
}

.civic-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-light);
    border: 1px solid var(--primary-border);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.hero-title-area h1 {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--text-main);
    letter-spacing: -0.3px;
    margin-bottom: 4px;
}

.hero-title-area p {
    font-size: 0.84rem;
    color: var(--text-muted);
    max-width: 620px;
    margin: 0 auto;
}

/* ==========================================================================
   1-Row Compact Stats Bar
   ========================================================================== */
.compact-stats-bar {
    background: #ffffff;
    border: 1px solid var(--border-main);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
    width: 100%;
}

.stat-item-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
}

.stat-item-inline .icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.stat-text-box {
    min-width: 0;
    overflow: hidden;
}

.stat-num {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
    font-family: var(--font-heading);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-desc {
    font-size: 0.64rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 640px) {
    .compact-stats-bar {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 380px) {
    .compact-stats-bar {
        padding: 8px 6px;
    }
    .stat-num { font-size: 0.78rem; }
    .stat-desc { font-size: 0.6rem; }
    .stat-item-inline .icon { font-size: 0.95rem; }
}

/* Dynamic Coverage Card */
.coverage-bar-card {
    margin-bottom: 16px;
    background: #ffffff;
    border: 1px solid var(--border-main);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    box-shadow: var(--shadow-sm);
    font-size: 0.84rem;
}

.coverage-bar-header {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
}

.coverage-title-flex {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pulse-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.coverage-sync-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    color: var(--text-muted);
    background: var(--bg-subtle);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-main);
}

.coverage-details-accordion {
    margin-top: 10px;
    border-top: 1px dashed var(--border-main);
    padding-top: 10px;
}

.coverage-accordion-summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--primary);
    font-size: 0.8rem;
    user-select: none;
}

.coverage-accordion-summary:hover {
    text-decoration: underline;
}

.district-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.district-badge-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.district-badge-name {
    font-weight: 800;
    color: var(--text-main);
    font-size: 0.88rem;
}

.district-badge-meta {
    font-size: 0.74rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Search Card & Quick Examples Grid
   ========================================================================== */
.search-card-single {
    background: #ffffff;
    border: 2px solid var(--primary-border);
    border-radius: var(--radius-lg);
    padding: 14px;
    box-shadow: var(--shadow-card);
    margin-bottom: 16px;
    width: 100%;
    box-sizing: border-box;
}

.search-field-row {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    width: 100%;
}

.search-field-row .s-icon {
    position: absolute;
    left: 12px;
    font-size: 1.1rem;
    color: var(--primary);
    pointer-events: none;
}

.search-input-main {
    width: 100%;
    padding: 11px 36px 11px 40px;
    font-size: 0.9rem;
    font-family: var(--font-body);
    font-weight: 600;
    color: var(--text-main);
    background: #ffffff;
    border: 1.5px solid var(--border-main);
    border-radius: var(--radius-md);
    transition: border-color 0.2s;
    min-height: 44px;
}

.search-input-main:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.btn-clear-input {
    position: absolute;
    right: 10px;
    background: var(--bg-subtle);
    border: none;
    color: var(--text-muted);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.95rem;
    display: none;
    align-items: center;
    justify-content: center;
}

/* Mobile Stacked Controls */
.filter-controls-flex {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

@media (min-width: 580px) {
    .filter-controls-flex {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.booth-dropdown {
    width: 100%;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    background: #ffffff;
    border: 1px solid var(--border-main);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    min-height: 40px;
}

.search-hint-pill {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-muted);
    text-align: center;
    background: var(--bg-subtle);
    padding: 6px 10px;
    border-radius: 12px;
    border: 1px solid var(--border-main);
    width: 100%;
}

.search-hint-pill.active {
    color: #16a34a;
    background: var(--status-enrolled-bg);
    border-color: #bbf7d0;
}

/* Hierarchical Electoral Area Filters */
.electoral-filters-accordion {
    margin-bottom: 12px;
    background: #f8fafc;
    border: 1px solid var(--border-main);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.electoral-filters-summary {
    padding: 10px 14px;
    font-size: 0.84rem;
    font-weight: 800;
    color: var(--text-main);
    cursor: pointer;
    background: #f1f5f9;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-count-badge {
    background: #1d4ed8;
    color: #ffffff;
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 800;
}

.filter-controls-grid {
    padding: 12px 14px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    background: #ffffff;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-label {
    font-size: 0.76rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
}

.filter-actions-bar {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-main);
}

.btn-clear-filters {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-clear-filters:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

/* Civic Directory Hint Card */
.civic-directory-hint-card {
    margin-top: 12px;
    padding: 10px 14px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.cdh-text {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e40af;
}

.btn-browse-civic {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #1d4ed8;
    color: #ffffff !important;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 800;
    text-decoration: none;
    transition: background 0.15s ease;
}

.btn-browse-civic:hover {
    background: #1e40af;
}

/* 2x2 Quick Examples Grid */
.chips-section-box {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-main);
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.chips-label-head {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.chips-grid-2x2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 640px) {
    .chips-grid-2x2 {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 600px) {
    .chips-section-box {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
    .chips-grid-2x2 {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        gap: 6px !important;
    }
    .btn-chip {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
        box-sizing: border-box !important;
        padding: 8px 10px !important;
        font-size: 0.78rem !important;
        text-align: left !important;
        display: block !important;
    }
}

.btn-chip {
    background: var(--primary-light);
    border: 1.5px solid var(--primary-border);
    color: var(--primary);
    padding: 7px 10px;
    border-radius: 14px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.15s ease;
    width: 100%;
}

.btn-chip:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* Category Filter Tabs */
.category-tab-bar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 16px;
    width: 100%;
}

@media (min-width: 640px) {
    .category-tab-bar {
        grid-template-columns: repeat(4, 1fr);
    }
}

.c-tab-btn {
    background: #ffffff;
    border: 1.5px solid var(--border-main);
    color: var(--text-muted);
    padding: 9px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
    text-align: center;
    width: 100%;
}

.c-tab-btn.active {
    background: var(--primary-gradient);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 3px 10px var(--primary-glow);
}

@media (max-width: 480px) {
    .c-tab-btn {
        padding: 8px 6px;
        font-size: 0.76rem;
    }
}

/* ==========================================================================
   Voter Results Cards Grid
   ========================================================================== */
.results-header-text {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 12px;
}

.voter-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
    width: 100%;
}

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

.voter-card-box {
    background: #ffffff;
    border: 1.5px solid var(--border-main);
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.voter-card-box::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
    background: var(--primary);
}

.voter-card-box.shifted::before { background: var(--status-shifted-text); }
.voter-card-box.death::before { background: var(--status-death-text); }
.voter-card-box.enrolled::before { background: var(--primary); }

.card-header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 6px;
    width: 100%;
}

.badge-epic {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--primary-border);
    font-family: monospace;
    font-size: 0.85rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.3px;
    word-break: break-all;
}

.badge-status {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 10px;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

.badge-status.shifted { background: var(--status-shifted-bg); color: var(--status-shifted-text); border: 1px solid var(--status-shifted-border); }
.badge-status.death { background: var(--status-death-bg); color: var(--status-death-text); border: 1px solid var(--status-death-border); }
.badge-status.enrolled { background: var(--status-enrolled-bg); color: var(--status-enrolled-text); border: 1px solid var(--status-enrolled-border); }
.badge-status.other { background: var(--bg-subtle); color: var(--text-muted); border: 1px solid var(--border-main); }

.voter-name-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 4px;
    line-height: 1.25;
    word-break: break-word;
}

mark.search-hl {
    background: #fef08a;
    color: #854d0e;
    padding: 0 3px;
    border-radius: 3px;
    font-weight: 800;
}

.voter-sub-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 8px;
    word-break: break-word;
}

.polling-box-preview {
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--text-body);
    background: #f8fafc;
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid var(--border-main);
    display: flex;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
    word-break: break-word;
}

.polling-box-preview .p-icon {
    flex-shrink: 0;
    font-size: 0.9rem;
    margin-top: 1px;
}

.polling-box-preview .p-text-body {
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border-main);
    padding-top: 8px;
    font-size: 0.76rem;
    color: var(--text-muted);
    font-weight: 600;
    width: 100%;
}

.link-details-btn {
    color: var(--primary);
    font-weight: 800;
    font-size: 0.8rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

/* Skeleton Pulse Animation */
.skeleton-box {
    background: #ffffff;
    border: 1px solid var(--border-main);
    border-radius: var(--radius-md);
    padding: 14px;
    height: 150px;
    animation: skeletonPulse 1.5s infinite ease-in-out;
}

@keyframes skeletonPulse {
    0% { opacity: 0.5; }
    50% { opacity: 0.9; }
    100% { opacity: 0.5; }
}

/* Pagination Bar */
.pagination-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 20px 0 32px 0;
}

.btn-p-action {
    background: #ffffff;
    border: 1px solid var(--border-main);
    color: var(--text-main);
    padding: 7px 14px;
    border-radius: var(--radius-md);
    font-weight: 800;
    font-size: 0.82rem;
    cursor: pointer;
    min-height: 38px;
}

.btn-p-action:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.p-text {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 700;
}

/* ==========================================================================
   Voter Detail Modal Popup
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal-window {
    background: #ffffff;
    border: 2px solid var(--primary-border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-modal);
    position: relative;
    transform: scale(0.94);
    transition: transform 0.25s ease;
}

.modal-backdrop.active .modal-window {
    transform: scale(1);
}

.modal-header-bar {
    background: var(--primary-light);
    padding: 14px 18px;
    border-bottom: 1px solid var(--primary-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header-bar h3 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-main);
}

.btn-close-modal {
    background: #ffffff;
    border: 1px solid var(--border-main);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-inner-body {
    padding: 16px;
}

.reason-banner-box {
    background: var(--status-shifted-bg);
    border: 1px solid #fed7aa;
    border-radius: var(--radius-md);
    padding: 10px 12px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.reason-banner-box.death {
    background: var(--status-death-bg);
    border-color: #fecaca;
}

.reason-banner-text h5 {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--text-main);
}

.reason-banner-text p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.detail-specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: #f8fafc;
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-main);
    margin-bottom: 14px;
}

@media (max-width: 480px) {
    .detail-specs-grid {
        grid-template-columns: 1fr;
    }
}

.spec-cell label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 800;
    display: block;
    margin-bottom: 1px;
}

.spec-cell span {
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 700;
}

.timeline-guidance {
    background: var(--primary-light);
    border: 1px solid var(--primary-border);
    border-radius: var(--radius-lg);
    padding: 14px;
    margin-bottom: 14px;
}

.timeline-guidance h4 {
    font-size: 0.9rem;
    color: var(--primary);
    margin-bottom: 10px;
    font-weight: 800;
}

.timeline-step {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.s-circle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.s-content h6 {
    font-size: 0.85rem;
    color: var(--text-main);
    font-weight: 800;
}

.s-content p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.s-link {
    display: inline-block;
    margin-top: 2px;
    color: var(--primary);
    font-weight: 800;
    font-size: 0.78rem;
    text-decoration: none;
}

.modal-footer-actions {
    padding: 12px 16px;
    border-top: 1px solid var(--border-main);
    display: flex;
    justify-content: space-between;
    gap: 8px;
    background: #f8fafc;
}

@media (max-width: 480px) {
    .modal-footer-actions {
        flex-direction: column-reverse;
    }
}

.btn-m-close {
    background: #ffffff;
    border: 1px solid var(--border-main);
    color: var(--text-main);
    padding: 9px 16px;
    border-radius: var(--radius-md);
    font-weight: 800;
    font-size: 0.84rem;
    cursor: pointer;
    min-height: 40px;
}

.btn-m-print {
    background: var(--primary-gradient);
    color: #ffffff;
    border: none;
    padding: 9px 20px;
    border-radius: var(--radius-md);
    font-weight: 800;
    font-size: 0.84rem;
    cursor: pointer;
    box-shadow: 0 3px 10px var(--primary-glow);
    min-height: 40px;
}

/* Toast Message */
.toast-notice {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text-main);
    color: #ffffff;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    opacity: 0;
    transition: all 0.25s ease;
    pointer-events: none;
    white-space: nowrap;
}

.toast-notice.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

footer {
    margin-top: auto;
    background: #ffffff;
    border-top: 1px solid var(--border-main);
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
}

/* ==========================================================================
   Karnataka SIR-2026 ASDDO Additions
   ========================================================================== */
.badge-status.untraceable {
    background: var(--status-untraceable-bg);
    color: var(--status-untraceable-text);
    border: 1px solid var(--status-untraceable-border);
}

.reason-banner-box.untraceable {
    background: var(--status-untraceable-bg);
    border-color: var(--status-untraceable-border);
}

.statutory-disclaimer-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid var(--border-main);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin: 16px 0;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-body);
}

.statutory-disclaimer-card .d-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.statutory-disclaimer-card .d-body strong {
    color: var(--text-main);
    display: block;
    margin-bottom: 2px;
}

.statutory-disclaimer-card .d-body a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.statutory-disclaimer-card .d-body a:hover {
    text-decoration: underline;
}

.not-found-card-full {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    background: #ffffff;
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.not-found-card-full .nf-icon {
    font-size: 2.8rem;
    margin-bottom: 10px;
}

.not-found-card-full .nf-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1e3a8a;
    margin-bottom: 8px;
}

.not-found-card-full .nf-desc {
    color: var(--text-body);
    font-size: 0.92rem;
    max-width: 650px;
    margin: 0 auto 16px auto;
}

.not-found-card-full .nf-disclaimer-box {
    background: #fefce8;
    border: 1px solid #fef08a;
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 0.82rem;
    color: #854d0e;
    max-width: 650px;
    margin: 0 auto 12px auto;
    text-align: left;
}

.not-found-card-full .nf-disclaimer-box a {
    color: #1d4ed8;
    font-weight: 700;
}

.not-found-card-full .nf-sync-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.source-trace-card {
    background: #f8fafc;
    border: 1px solid var(--border-main);
    border-radius: var(--radius-md);
    padding: 14px;
    margin: 16px 0;
}

.source-trace-card .trace-header {
    font-size: 0.84rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-main);
    padding-bottom: 6px;
}

.source-trace-card .trace-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.source-trace-card .trace-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.84rem;
    gap: 10px;
    flex-wrap: wrap;
}

.source-trace-card .trace-row span {
    color: var(--text-muted);
}

.source-trace-card .trace-row strong {
    color: var(--text-main);
    text-align: right;
}

.source-trace-card .trace-link {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    font-size: 0.84rem;
}

.source-trace-card .trace-disclaimer {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-main);
    font-size: 0.78rem;
    color: #475569;
    line-height: 1.4;
}

.ref-epic-banner {
    margin-top: 8px;
    padding: 5px 8px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 4px;
    font-size: 0.78rem;
    color: #1e40af;
}

/* Admin Dashboard Elements */
.admin-tab-nav {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--border-main);
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.admin-tab-btn {
    background: none;
    border: none;
    padding: 9px 16px;
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.admin-tab-btn.active {
    background: var(--primary);
    color: #ffffff;
}

.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.admin-stat-card {
    background: #f8fafc;
    border: 1px solid var(--border-main);
    border-radius: var(--radius-md);
    padding: 14px;
}

.admin-stat-card .a-num {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    font-family: var(--font-heading);
}

.admin-stat-card .a-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 2px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
    margin-top: 12px;
}

.admin-table th, .admin-table td {
    padding: 10px 12px;
    border: 1px solid var(--border-main);
    text-align: left;
}

.admin-table th {
    background: #f1f5f9;
    font-weight: 700;
    color: var(--text-main);
}

.badge-source-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 800;
    background: #e0e7ff;
    color: #3730a3;
}

.badge-sync-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 800;
}

.badge-sync-status.completed { background: #dcfce7; color: #166534; }
.badge-sync-status.running { background: #fef9c3; color: #854d0e; }
.badge-sync-status.failed { background: #fee2e2; color: #991b1b; }

.btn-sync-action {
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.78rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-sync-action:hover {
    background: var(--primary-hover);
}

/* ==========================================================================
   MODAL & OVERLAY ARCHITECTURE (HIDDEN BY DEFAULT - MANDATORY FIX)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
    box-sizing: border-box;
}

.modal-overlay.active,
.modal-overlay.is-open {
    display: flex !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.modal-card {
    background: #ffffff;
    border-radius: var(--radius-lg, 12px);
    padding: 24px;
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-main, #cbd5e1);
    position: relative;
    box-sizing: border-box;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-main, #e2e8f0);
}

.modal-close {
    background: #f1f5f9;
    border: none;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.modal-close:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* ==========================================================================
   PUBLIC FOOTER & LEGAL STYLING SYSTEM
   ========================================================================== */
.app-footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 36px 0 20px 0;
    margin-top: 40px;
    border-top: 3px solid #1e40af;
    font-size: 0.88rem;
}
.footer-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}
.footer-brand-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #1e293b;
}
.footer-brand-title {
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 8px;
}
.footer-independence-notice {
    color: #cbd5e1;
    font-size: 0.84rem;
    line-height: 1.5;
    max-width: 900px;
}
.footer-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}
.footer-col-title {
    color: #f8fafc;
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 10px;
}
.footer-col a {
    color: #94a3b8;
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    transition: color 0.15s ease;
}
.footer-col a:hover {
    color: #38bdf8;
}
.footer-bottom-bar {
    padding-top: 20px;
    border-top: 1px solid #1e293b;
    font-size: 0.78rem;
    color: #64748b;
}
.footer-statutory-note {
    background: #1e293b;
    border-left: 3px solid #38bdf8;
    padding: 10px 14px;
    border-radius: 4px;
    color: #cbd5e1;
    margin-bottom: 12px;
    line-height: 1.45;
}
.footer-copy {
    text-align: center;
    color: #64748b;
    font-size: 0.76rem;
}

/* Search Result Disclaimer Card */
.search-result-disclaimer-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #1d4ed8;
    border-radius: 8px;
    padding: 10px 14px;
    margin-top: 12px;
    font-size: 0.8rem;
    color: #475569;
}
.search-result-disclaimer-box .srd-title {
    font-weight: 800;
    color: #1e293b;
    font-size: 0.82rem;
    margin-bottom: 2px;
}
.search-result-disclaimer-box .srd-body {
    line-height: 1.4;
    margin-bottom: 8px;
}
.btn-official-verify {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #1d4ed8;
    color: #ffffff !important;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.75rem;
    text-decoration: none;
}
.btn-official-verify:hover {
    background: #1e40af;
}

/* Legal Page Content Box */
.legal-card-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: clamp(16px, 3vw, 32px);
    box-shadow: 0 4px 12px rgba(15,23,42,0.04);
    margin-bottom: 30px;
    line-height: 1.6;
    color: #334155;
}
.legal-card-box h1 {
    font-size: clamp(1.4rem, 2.5vw, 1.8rem);
    color: #0f172a;
    font-weight: 800;
    margin-bottom: 6px;
}
.legal-card-box h2 {
    font-size: 1.15rem;
    color: #1e293b;
    font-weight: 800;
    margin: 22px 0 8px 0;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 4px;
}
.legal-card-box p {
    margin-bottom: 12px;
    font-size: 0.9rem;
}
.legal-card-box ul {
    margin: 8px 0 16px 20px;
    font-size: 0.9rem;
}
.legal-card-box li {
    margin-bottom: 6px;
}
.legal-alert-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-left: 4px solid #1d4ed8;
    padding: 14px;
    border-radius: 8px;
    margin: 16px 0;
    font-size: 0.88rem;
    color: #1e40af;
}

