/* ============================================================
   KIS — Global Styles
   ============================================================ */

:root {
    --inec-green: #008751;
    --inec-green-dark: #006b40;
    --inec-green-light: #e8f5ef;
    --inec-gold: #c9a227;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-600: #475569;
    --gray-800: #1e293b;
    --danger: #dc2626;
    --warning: #d97706;
    --success: #16a34a;
    --info: #0284c7;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    --radius: 12px;
}

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

body {
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--gray-800);
    min-height: 100vh;
    line-height: 1.6;
}

/* KIS watermark on every page */
body.inec-bg {
    background: var(--page-bg, #005c38);
    position: relative;
}

.bg-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(
        135deg,
        var(--page-overlay-start, rgba(0, 135, 81, 0.94)) 0%,
        var(--page-overlay-end, rgba(0, 80, 48, 0.96)) 100%
    );
    z-index: -1;
}

.bg-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url('../images/kis-mark.svg?v=3') 4% 12% / min(22vw, 240px) no-repeat;
    opacity: 0.16;
    pointer-events: none;
}

/* Header */
.main-header {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    border-bottom: 3px solid var(--inec-green);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

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

.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand-icon { font-size: 2rem; }
.brand-logo {
    display: block;
    height: 72px;
    width: auto;
    max-width: min(360px, 72vw);
    object-fit: contain;
    background: transparent;
}
.brand h1 { font-size: 1.15rem; color: var(--inec-green-dark); font-weight: 700; }
.brand p { font-size: 0.75rem; color: var(--gray-600); }

.main-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ---- Redesigned app navigation ---- */
.brand-link {
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.brand-link:hover {
    transform: translateY(-1px);
    opacity: 0.92;
}

.brand-link:active {
    transform: translateY(0);
}

.guest-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.guest-nav a {
    text-decoration: none;
    color: var(--gray-800);
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.guest-nav a:hover {
    background: var(--inec-green-light);
    color: var(--inec-green-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 135, 81, 0.15);
}

.guest-nav .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 135, 81, 0.25);
}

.guest-nav a.is-active {
    background: var(--inec-green-light);
    color: var(--inec-green-dark);
    font-weight: 600;
}

.guest-nav .btn.is-active {
    box-shadow: 0 0 0 2px rgba(0, 135, 81, 0.25);
}

/* ---- Public home / landing ---- */
.home-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    isolation: isolate;
    min-height: min(380px, 62vh);
    background: #003d28;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius);
    padding: clamp(1.5rem, 4vw, 2.75rem);
    margin-bottom: 1.5rem;
    color: var(--white);
    overflow: hidden;
}

.home-hero-media {
    position: absolute;
    inset: 0;
    z-index: 0;
    margin: 0;
    border: 0;
    border-radius: inherit;
    overflow: hidden;
    background: #003d28;
}

.home-hero-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 18%;
}

.home-hero-scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(
            105deg,
            rgba(0, 50, 32, 0.96) 0%,
            rgba(0, 70, 44, 0.9) 34%,
            rgba(0, 80, 48, 0.55) 58%,
            rgba(0, 80, 48, 0.18) 78%,
            rgba(0, 80, 48, 0.05) 100%
        );
}

.home-hero-copy {
    position: relative;
    z-index: 2;
    max-width: min(36rem, 100%);
}

.home-eyebrow {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--inec-gold);
    margin-bottom: 0.75rem;
}

.home-title {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    line-height: 1.15;
    font-weight: 800;
    max-width: 18ch;
    margin-bottom: 1rem;
}

.home-lead {
    max-width: 54ch;
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.92);
    margin-bottom: 1.5rem;
}

.home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.home-hero .btn-outline.home-btn-light {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.7);
    color: #ffffff;
}

.home-hero .btn-outline.home-btn-light:hover,
.home-hero .btn-outline.home-btn-light:focus-visible {
    background: rgba(255, 255, 255, 0.28);
    border-color: #ffffff;
    color: #ffffff;
}

.home-section {
    background: rgba(255, 255, 255, 0.97);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: clamp(1.25rem, 3vw, 2rem);
    margin-bottom: 1.25rem;
}

.home-section-title {
    font-size: 1.25rem;
    color: var(--inec-green-dark);
    margin-bottom: 0.35rem;
}

.home-section-lead {
    color: var(--gray-600);
    margin-bottom: 1.25rem;
    max-width: 60ch;
}

.home-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.home-feature-grid--visual .home-feature {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    overflow: hidden;
    padding-bottom: 1rem;
}

.home-feature-img,
.home-panel-img {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: cover;
    object-position: center top;
}

.home-feature-grid--visual .home-feature h4,
.home-feature-grid--visual .home-feature p {
    padding-left: 1rem;
    padding-right: 1rem;
}

.home-feature-grid--visual .home-feature h4 {
    margin-top: 0.9rem;
}

.home-feature h4 {
    color: var(--inec-green-dark);
    margin-bottom: 0.35rem;
    font-size: 1rem;
}

.home-feature p {
    color: var(--gray-600);
    font-size: 0.95rem;
}

.home-panel--media {
    overflow: hidden;
    padding-top: 0;
}

.home-panel-img {
    margin: 0 -clamp(1.25rem, 3vw, 1.75rem) 1rem;
    width: calc(100% + 2 * clamp(1.25rem, 3vw, 1.75rem));
    height: 200px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.home-section-split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.home-panel {
    background: rgba(255, 255, 255, 0.97);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: clamp(1.25rem, 3vw, 1.75rem);
}

.home-list {
    margin: 0 0 1.25rem 1.1rem;
    color: var(--gray-600);
}

.home-list li + li {
    margin-top: 0.4rem;
}

.home-audience-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.home-audience {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: clamp(1.1rem, 2.5vw, 1.5rem);
}

.home-audience-kicker {
    margin: 0 0 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--inec-green);
}

.home-audience h4 {
    margin: 0 0 0.65rem;
    font-size: 1.15rem;
    color: var(--inec-green-dark);
}

.home-audience-summary {
    margin: 0 0 1rem;
    color: var(--gray-700);
    font-size: 0.98rem;
    line-height: 1.55;
}

.home-audience-sub {
    margin: 0.85rem 0 0.4rem;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--gray-500);
}

.home-audience .home-list {
    margin-bottom: 0.35rem;
}

.home-audience .home-actions {
    margin-top: 1.15rem;
}

.home-audience-note {
    margin-top: 1.15rem;
    padding: 0.95rem 1.1rem;
    border-radius: 10px;
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: var(--gray-700);
}

.home-audience-note p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.55;
}

.home-audience-note a {
    color: var(--inec-green-dark);
    font-weight: 600;
}

.home-cta {
    background: linear-gradient(135deg, var(--inec-green-dark), var(--inec-green));
    color: var(--white);
    border-radius: var(--radius);
    padding: clamp(1.5rem, 3vw, 2.25rem);
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow);
}

.home-cta h3 {
    font-size: 1.35rem;
    margin-bottom: 0.4rem;
}

.home-cta p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.15rem;
    max-width: 50ch;
}

/* About / Contact marketing pages */
.site-page-hero {
    position: relative;
    min-height: 0;
    display: block;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    background: #003d28;
}
.site-page-hero:not(:has(.site-page-hero-media)) {
    min-height: min(42vh, 340px);
}
.site-page-hero--compact:not(:has(.site-page-hero-media)) {
    min-height: min(36vh, 280px);
}
.site-page-hero-media {
    position: relative;
    inset: auto;
    margin: 0;
}
.site-page-hero-media img {
    width: 100%;
    height: clamp(180px, 30vw, 260px);
    object-fit: cover;
    object-position: center top;
    display: block;
}
.site-page-hero-scrim {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            180deg,
            rgba(0, 50, 32, 0.25) 0%,
            rgba(0, 55, 34, 0.55) 45%,
            rgba(0, 45, 28, 0.92) 100%
        );
}
.site-page-hero-copy {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    padding: clamp(1.25rem, 3vw, 2rem);
    max-width: 46rem;
    color: #fff;
}
.site-page-section {
    margin-top: 0.25rem;
}
.site-prose-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
.site-prose-card {
    background: #fff;
    border: 1px solid rgba(15, 61, 36, 0.08);
    border-radius: var(--radius);
    padding: 1.25rem 1.35rem;
    box-shadow: var(--shadow);
}
.site-prose-card h2 {
    margin: 0 0 0.55rem;
    font-size: 1.15rem;
    color: var(--inec-green-dark);
}
.site-prose-card p {
    margin: 0;
    color: var(--gray-700, #374151);
    line-height: 1.55;
}
.site-pillar {
    background: #fff;
    border: 1px solid rgba(15, 61, 36, 0.08);
    border-radius: var(--radius);
    padding: 1.15rem 1.25rem;
}
.site-pillar h3 {
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
    color: var(--inec-green-dark);
}
.site-pillar p {
    margin: 0;
    color: var(--gray-700, #374151);
    line-height: 1.5;
}
.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr);
    gap: 1.25rem;
    align-items: start;
}
.contact-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}
.contact-card {
    background: #fff;
    border: 1px solid rgba(15, 61, 36, 0.08);
    border-radius: var(--radius);
    padding: 1.1rem 1.2rem;
    box-shadow: var(--shadow);
}
.contact-label {
    margin: 0 0 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--inec-green);
}
.contact-card a,
.contact-card p {
    margin: 0;
    color: var(--inec-green-dark);
    font-weight: 600;
    line-height: 1.45;
    text-decoration: none;
}
.contact-card a:hover {
    text-decoration: underline;
}
.contact-aside {
    background: #fff;
    border: 1px solid rgba(15, 61, 36, 0.08);
    border-radius: var(--radius);
    padding: 1.25rem 1.35rem;
    box-shadow: var(--shadow);
}
.contact-form-card {
    grid-column: 1 / -1;
}
.contact-form-intro {
    margin: 0 0 0.85rem;
    font-weight: 500;
    color: var(--gray-700, #374151);
}
.contact-form .form-group {
    margin-bottom: 0.75rem;
}
.contact-form label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--inec-green-dark);
}
.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(15, 61, 36, 0.18);
    border-radius: 8px;
    font: inherit;
}
.contact-form .btn {
    margin-top: 0.35rem;
}
.contact-aside h2 {
    margin: 0 0 0.55rem;
    font-size: 1.1rem;
    color: var(--inec-green-dark);
}
.contact-aside p {
    margin: 0 0 0.75rem;
    color: var(--gray-700, #374151);
    line-height: 1.55;
}
.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.85rem 1.15rem;
    margin: 0 0 0.65rem;
}
.footer-nav a {
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    font-weight: 600;
}
.footer-nav a:hover {
    text-decoration: underline;
}

@media (max-width: 900px) {
    .site-prose-grid,
    .contact-grid,
    .contact-cards {
        grid-template-columns: 1fr;
    }

    .home-hero {
        min-height: min(420px, 72vh);
        align-items: flex-end;
    }

    .home-hero-media img {
        object-position: center 22%;
    }

    .home-hero-scrim {
        background:
            linear-gradient(
                180deg,
                rgba(0, 50, 32, 0.35) 0%,
                rgba(0, 60, 38, 0.55) 40%,
                rgba(0, 50, 32, 0.92) 72%,
                rgba(0, 40, 26, 0.97) 100%
            );
    }

    .home-audience-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .guest-nav {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .home-actions .btn {
        flex: 1 1 auto;
        text-align: center;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.app-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    justify-content: flex-end;
    min-width: 0;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    border: 2px solid var(--inec-green-light);
    border-radius: 10px;
    background: white;
    cursor: pointer;
    padding: 8px;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.nav-toggle:hover {
    background: var(--inec-green-light);
    border-color: var(--inec-green);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 135, 81, 0.18);
}

.nav-toggle-bar {
    display: block;
    height: 2px;
    background: var(--inec-green-dark);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
}

.app-nav.is-open .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.app-nav.is-open .nav-toggle-bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.app-nav.is-open .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-panel {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    justify-content: flex-end;
    min-width: 0;
}

.nav-primary {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.nav-item { position: relative; }

.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
    color: var(--gray-800);
    font-weight: 600;
    font-size: 0.84rem;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    overflow: hidden;
    transition:
        background 0.28s cubic-bezier(0.4, 0, 0.2, 1),
        color 0.28s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 5px;
    width: 0;
    height: 2px;
    background: var(--inec-green);
    border-radius: 2px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
    background: var(--inec-green-light);
    color: var(--inec-green-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 135, 81, 0.14);
}

.nav-link:hover::after {
    width: calc(100% - 1.5rem);
    left: 0.75rem;
}

.nav-link:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 135, 81, 0.1);
}

.nav-link.is-active,
.nav-dropdown-link.is-active,
.nav-item-group.is-active > .nav-group-toggle {
    background: var(--inec-green);
    color: white;
    box-shadow: 0 4px 14px rgba(0, 107, 64, 0.35);
}

.nav-link.is-active::after {
    background: rgba(255, 255, 255, 0.85);
    width: calc(100% - 1.5rem);
    left: 0.75rem;
}

.nav-link.is-active:hover {
    background: var(--inec-green-dark);
    color: white;
}

.nav-icon {
    font-size: 1rem;
    line-height: 1;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-link:hover .nav-icon,
.nav-group-toggle:hover .nav-icon {
    transform: scale(1.18) rotate(-4deg);
}

.nav-chevron {
    font-size: 0.7rem;
    margin-left: 0.15rem;
    opacity: 0.8;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}

.nav-item-group.is-open .nav-chevron,
.nav-item-group:hover .nav-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

@keyframes navDropdownIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.nav-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    min-width: 210px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    list-style: none;
    padding: 0.35rem;
    z-index: 120;
    transform-origin: top center;
}

.nav-item-group.is-open .nav-dropdown {
    display: block;
    animation: navDropdownIn 0.28s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@media (hover: hover) and (min-width: 993px) {
    .nav-item-group:hover .nav-dropdown {
        display: block;
        animation: navDropdownIn 0.28s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }

    .nav-item-group:hover > .nav-group-toggle {
        background: var(--inec-green-light);
        color: var(--inec-green-dark);
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0, 135, 81, 0.14);
    }
}

.nav-dropdown-link {
    display: block;
    position: relative;
    padding: 0.55rem 0.75rem 0.55rem 0.85rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--gray-800);
    font-size: 0.84rem;
    font-weight: 500;
    overflow: hidden;
    transition:
        background 0.22s ease,
        color 0.22s ease,
        padding-left 0.22s ease,
        transform 0.22s ease;
}

.nav-dropdown-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    bottom: 15%;
    width: 3px;
    border-radius: 0 2px 2px 0;
    background: var(--inec-green);
    transform: scaleY(0);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-dropdown-link:hover {
    background: var(--inec-green-light);
    color: var(--inec-green-dark);
    padding-left: 1.05rem;
    transform: translateX(3px);
}

.nav-dropdown-link:hover::before {
    transform: scaleY(1);
}

.nav-dropdown-link.is-active:hover {
    background: var(--inec-green-dark);
    color: white;
}

.nav-dropdown-link.is-active::before {
    background: rgba(255, 255, 255, 0.9);
    transform: scaleY(1);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding-left: 0.65rem;
    border-left: 2px solid var(--gray-200);
    margin-left: 0.35rem;
}

.nav-user-party .party-chip { font-size: 0.8rem; }

.nav-user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    max-width: 160px;
    transition: transform 0.25s ease;
}

.nav-user:hover .nav-user-meta {
    transform: translateX(-2px);
}

.nav-user-meta strong {
    font-size: 0.82rem;
    color: var(--inec-green-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-user-meta span {
    font-size: 0.72rem;
    color: var(--gray-600);
}

.nav-user-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.nav-action-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    text-decoration: none;
    background: var(--gray-100);
    font-size: 1rem;
    transition:
        background 0.25s ease,
        transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.25s ease;
}

.nav-action-btn:hover {
    background: var(--inec-green-light);
    transform: translateY(-2px) scale(1.08);
    box-shadow: 0 6px 14px rgba(0, 135, 81, 0.2);
}

.nav-action-btn:active {
    transform: translateY(0) scale(1);
}

.nav-user-actions .btn-outline:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 135, 81, 0.18);
}

@media (prefers-reduced-motion: reduce) {
    .nav-link,
    .nav-dropdown-link,
    .nav-action-btn,
    .nav-toggle,
    .nav-icon,
    .nav-chevron,
    .brand-link,
    .guest-nav a {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }

    .nav-link::after,
    .nav-dropdown-link::before {
        transition: none !important;
    }
}

.main-nav a {
    text-decoration: none;
    color: var(--gray-800);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

.main-nav a:hover { background: var(--inec-green-light); color: var(--inec-green-dark); }

.user-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
    background: var(--inec-green-light);
    color: var(--inec-green-dark);
    padding: 0.35rem 0.85rem;
    border-radius: 12px;
    max-width: 260px;
}

.user-badge-name {
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.user-badge-role {
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.user-badge-party {
    font-size: 0.68rem;
    font-weight: 500;
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Main content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.97);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--inec-green-light);
}

.card-header h2 {
    font-size: 1.25rem;
    color: var(--inec-green-dark);
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.97);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--inec-green);
    text-align: center;
}

.stat-card.warning { border-left-color: var(--warning); }
.stat-card.danger  { border-left-color: var(--danger); }
.stat-card.success { border-left-color: var(--success); }

.stat-value { font-size: 2rem; font-weight: 700; color: var(--inec-green-dark); }
.stat-label { font-size: 0.8rem; color: var(--gray-600); margin-top: 0.25rem; }

/* Forms */
.form-group { margin-bottom: 1rem; }

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.35rem;
    color: var(--gray-800);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--inec-green);
    box-shadow: 0 0 0 3px rgba(0, 135, 81, 0.15);
}

.password-field {
    position: relative;
    display: block;
}

.password-field > input[type="password"],
.password-field > input[type="text"] {
    width: 100%;
    padding-right: 2.75rem;
}

.password-toggle {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2.1rem;
    height: 2.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--gray-600, #64748b);
    cursor: pointer;
    padding: 0;
    border-radius: 6px;
    line-height: 0;
}

.password-toggle-icon {
    width: 1.2rem;
    height: 1.2rem;
    display: block;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: var(--inec-green);
    outline: none;
    background: rgba(0, 135, 81, 0.08);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.geo-filter-fields {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 1100px) {
    .geo-filter-fields {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

.form-hint { font-size: 0.78rem; color: var(--gray-600); margin-top: 0.25rem; }
.candidate-election-picker select.is-invalid,
.scope-election-picker select.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
    background-color: #fef2f2;
}
.candidate-election-picker .picker-hint-error,
.scope-election-picker .picker-hint-error {
    color: var(--danger);
    font-weight: 600;
}
.candidate-election-picker .picker-hint-warning,
.scope-election-picker .picker-hint-warning {
    color: #92400e;
    font-weight: 500;
}

.candidate-list-filter {
    margin: 0 0 1rem;
    padding: 1rem 1.1rem;
    background: var(--gray-50, #f9fafb);
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: 10px;
}
.candidate-list-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1.25rem;
}
.candidate-list-filter-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-700, #374151);
    min-width: 100%;
}
.candidate-list-filter-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    flex: 1;
}
.candidate-list-filter-geo {
    display: contents;
}
.candidate-list-filter-fields .form-group {
    margin: 0;
    min-width: 160px;
}
.candidate-list-filter-fields label {
    font-size: 0.75rem;
    margin-bottom: 0.2rem;
}
.candidate-list-filter-fields input[type="search"] {
    min-width: 180px;
}
.candidate-list-filter-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.candidate-list-scope-label {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.checkbox-label {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-weight: 500;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.consent-box {
    background: var(--inec-green-light);
    border: 1px solid var(--inec-green);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.consent-box label { display: flex; align-items: flex-start; gap: 0.5rem; cursor: pointer; font-weight: 500; }

.registration-terms-box {
    background: #f8fafc;
    border-color: var(--gray-300);
}

.registration-terms-hint {
    margin: 0.55rem 0 0 1.55rem;
    color: var(--gray-600);
    font-size: 0.85rem;
}

.email-verify-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: stretch;
}

.email-verify-row input[type="email"] {
    flex: 1 1 12rem;
    min-width: 0;
}

.email-verify-btn {
    white-space: nowrap;
    flex: 0 0 auto;
}

.email-otp-panel {
    margin-top: 0.65rem;
    padding: 0.75rem;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: #f8fafc;
}

.email-otp-panel[hidden] {
    display: none !important;
}

.email-otp-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: stretch;
}

.email-otp-row input {
    flex: 1 1 8rem;
    min-width: 0;
    letter-spacing: 0.2em;
    font-weight: 700;
}

.email-otp-resend {
    margin-top: 0.35rem;
    padding-left: 0;
}

.email-verify-status.is-error {
    color: #b91c1c;
}

.email-verify-status.is-success {
    color: #166534;
}

.reg-email-verify--attention {
    outline: 2px solid #dc2626;
    outline-offset: 4px;
    border-radius: 8px;
    animation: reg-email-pulse 0.8s ease 0s 2;
}

@keyframes reg-email-pulse {
    0%, 100% { outline-color: #dc2626; }
    50% { outline-color: #fca5a5; }
}

.site-legal-meta {
    margin: 0 0 1.25rem;
    color: var(--gray-600);
    font-size: 0.95rem;
}

.site-legal-meta p {
    margin: 0.15rem 0;
}

.site-legal-stack {
    display: grid;
    gap: 0.85rem;
}

.site-legal-card h2 {
    font-size: 1.05rem;
}

.site-legal-actions {
    margin-top: 1.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary { background: var(--inec-green); color: var(--white); }
.btn-primary:hover { background: var(--inec-green-dark); }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--inec-green);
    color: var(--inec-green);
}
.btn-outline:hover { background: var(--inec-green-light); }

.btn-danger { background: var(--danger); color: var(--white); }
.btn-warning { background: var(--warning); color: var(--white); }
.btn-success { background: var(--success); color: var(--white); }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }

.btn-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.results-status-filters {
    margin: 0 0 1rem;
}

.results-level-picker {
    margin-bottom: 1rem;
}

.results-level-picker .form-hint {
    margin: 0.5rem 0 0;
}

.results-level-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.results-level-tab {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--gray-300);
    background: var(--white);
    color: var(--gray-700);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
}

.results-level-tab:hover {
    border-color: var(--inec-green);
    color: var(--inec-green-dark);
}

.results-level-tab.is-active {
    background: var(--inec-green);
    border-color: var(--inec-green);
    color: var(--white);
}

.results-scope-badge {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 0.75rem;
    font-weight: 500;
}

.results-geo-panel[data-level-hidden="true"] {
    display: none;
}

/* Tables */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

table th {
    background: var(--inec-green);
    color: var(--white);
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

table td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: middle;
}

table tr:hover td { background: var(--gray-50); }

/* Badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-info    { background: #dbeafe; color: #1e40af; }
.badge-secondary { background: var(--gray-200); color: var(--gray-600); }

/* Alerts */
.alert {
    padding: 0.85rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }

/* Login page */
.login-container {
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.login-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    border-top: 4px solid var(--inec-green);
}

.login-card.register-card {
    max-width: 680px;
}

.login-card.register-card--hub {
    max-width: 720px;
}

.register-hub-grid {
    margin-top: 1.25rem;
}

.register-hub-card {
    padding: 1.35rem 1.4rem;
}

.register-hub-card--party {
    border-color: rgba(0, 135, 81, 0.35);
}

.register-hub-card--party:hover {
    border-color: var(--inec-green);
}

.register-hub-card--external {
    border-color: rgba(11, 61, 145, 0.35);
}

.register-hub-card--external:hover {
    border-color: #0b3d91;
}

.register-hub-card--external strong {
    color: #0b3d91;
}

.register-hub-card--candidate {
    border-color: rgba(180, 83, 9, 0.35);
}

.register-hub-card--candidate:hover {
    border-color: #b45309;
}

.register-hub-card--candidate strong {
    color: #b45309;
}

.form-section {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem 1.25rem 0.5rem;
    margin-bottom: 1.25rem;
}

.form-section legend {
    font-weight: 700;
    color: var(--inec-green-dark);
    padding: 0 0.5rem;
    font-size: 0.9rem;
}

.consent-error { margin-top: 0.5rem; }

select:disabled {
    background: var(--gray-100);
    cursor: not-allowed;
}

.login-card h2 {
    text-align: center;
    color: var(--inec-green-dark);
    margin-bottom: 0.5rem;
}

.login-card .subtitle {
    text-align: center;
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.login-footer {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.85rem;
    color: var(--gray-600);
}

.login-footer a { color: var(--inec-green); font-weight: 600; }

.demo-credentials {
    background: var(--gray-50);
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 1rem;
    font-size: 0.78rem;
    color: var(--gray-600);
}

.demo-credentials strong { color: var(--inec-green-dark); }

/* GPS status */
.gps-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    margin: 1rem 0;
}

.gps-status.ok     { background: #dcfce7; color: #166534; }
.gps-status.warn   { background: #fef3c7; color: #92400e; }
.gps-status.error  { background: #fee2e2; color: #991b1b; }
.gps-status.loading { background: var(--gray-100); color: var(--gray-600); }

/* Map */
.map-legend {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 0;
    font-size: 0.85rem;
}

.map-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.map-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.legend-item { display: flex; align-items: center; gap: 0.4rem; }
.legend-filter {
    cursor: pointer;
    user-select: none;
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    background: var(--gray-50);
    transition: background 0.2s, border-color 0.2s;
}
.legend-filter:hover {
    border-color: var(--inec-green-light);
    background: var(--inec-green-light);
}
.legend-filter input {
    margin: 0;
    accent-color: var(--inec-green);
}
.legend-filter strong {
    color: var(--inec-green-dark);
    font-weight: 700;
}

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

.dot-green  { background: #16a34a; }
.dot-yellow { background: #d97706; }
.dot-red    { background: #dc2626; }
.dot-orange { background: #ea580c; }

.map-popup { line-height: 1.45; }
.map-popup-status { font-weight: 600; }

.map-status-cluster {
    background: transparent;
    border: none;
}
.map-status-cluster-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

#map-container {
    height: min(70vh, 640px);
    min-height: 420px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 2px solid var(--inec-green-light);
}

/* Result AI verification */
.verification-panel .card-header {
    align-items: flex-start;
    gap: 1rem;
}
.verification-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.verification-meta { padding: 0 1rem 1rem; }
.verification-section {
    padding: 0 1rem 1.25rem;
    border-top: 1px solid var(--border);
}
.verification-section h3 {
    margin: 1rem 0 0.5rem;
    font-size: 1.05rem;
}
.verification-section-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.verification-source-form { margin-bottom: 1rem; }
.verification-sources {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.verification-source-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    background: #fafafa;
}
.verification-source-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}
.verification-source-actions {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

/* Collation */
.collation-level {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.collation-level .level-btn {
    padding: 0.5rem 1rem;
    border: 1.5px solid var(--inec-green);
    background: white;
    color: var(--inec-green);
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
}

.collation-level .level-btn.active {
    background: var(--inec-green);
    color: white;
}

.candidate-bar {
    display: grid;
    grid-template-columns: 16rem minmax(0, 1fr) 5.75rem;
    align-items: center;
    column-gap: 1rem;
    margin-bottom: 0.75rem;
}

.candidate-bar .name {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.candidate-bar .name .party-chip-logo {
    flex-shrink: 0;
}

.candidate-bar .bar-wrap {
    min-width: 0;
    background: var(--gray-200);
    border-radius: 4px;
    height: 24px;
    overflow: hidden;
}

.candidate-bar .bar-fill {
    height: 100%;
    background: var(--inec-green);
    border-radius: 4px;
    transition: width 0.5s;
}

.candidate-bar .votes {
    font-weight: 700;
    color: var(--inec-green-dark);
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
    .candidate-bar {
        grid-template-columns: 9.5rem minmax(0, 1fr) 4.5rem;
        column-gap: 0.65rem;
    }
}

/* Footer */
.main-footer {
    text-align: center;
    padding: 1.5rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.8rem;
}

.footer-note { opacity: 0.75; margin-top: 0.25rem; font-size: 0.75rem; }

/* Print */
.collation-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.collation-dashboard .form-section {
    margin-bottom: 1.25rem;
}

@media print {
    .main-header, .main-footer, .main-nav, .btn, .no-print, .form-section, .party-logo-watermark { display: none !important; }
    body.inec-bg { background: white; }
    .bg-overlay { display: none; }
    .card { box-shadow: none; border: 1px solid #ccc; }
    .collation-dashboard .card { break-inside: avoid; }
    .print-only { display: block !important; }
    .roster-section { break-inside: avoid; page-break-inside: avoid; }
}

.print-only { display: none; }

.roster-summary {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    background: var(--inec-green-light);
    border-radius: 8px;
    color: var(--inec-green-dark);
}

.roster-section { margin-top: 1.5rem; }

.roster-section-title {
    font-size: 1.05rem;
    color: var(--inec-green-dark);
    margin-bottom: 0.75rem;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid var(--inec-green-light);
}

.party-roster-print-header {
    margin-bottom: 1rem;
    border: none;
    box-shadow: none;
    padding: 0 0 1rem;
}

.party-roster-print-header h2 {
    color: var(--inec-green-dark);
    margin-bottom: 0.25rem;
}

@media (max-width: 992px) {
    .header-inner {
        flex-wrap: wrap;
        align-items: stretch;
    }

    .app-nav {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .nav-toggle {
        display: flex;
        align-self: flex-end;
    }

    .nav-panel {
        display: none;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 1rem;
        padding-top: 0.5rem;
    }

    .app-nav.is-open .nav-panel {
        display: flex;
    }

    .nav-primary {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .nav-link,
    .nav-group-toggle {
        width: 100%;
        justify-content: flex-start;
    }

    .nav-link:hover,
    .nav-group-toggle:hover {
        transform: none;
        box-shadow: none;
    }

    .nav-dropdown {
        position: static;
        box-shadow: none;
        border: none;
        background: var(--gray-50);
        margin-top: 0.25rem;
    }

    .nav-item-group.is-open .nav-dropdown {
        display: block;
    }

    .nav-user {
        flex-direction: column;
        align-items: stretch;
        border-left: none;
        border-top: 2px solid var(--gray-200);
        padding: 0.75rem 0 0;
        margin: 0;
    }

    .nav-user-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .header-inner { flex-direction: column; align-items: flex-start; }
    .main-nav { width: 100%; }
}

/* Role dashboard header */
.role-dashboard-header {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--inec-green);
}

.role-dashboard-header h2 {
    color: var(--inec-green-dark);
    font-size: 1.35rem;
    margin-bottom: 0.25rem;
}

.role-dashboard-header p {
    color: var(--gray-600);
    font-size: 0.95rem;
}

.party-dashboard-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: white;
    border: 2px solid var(--inec-green-light);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.party-dashboard-identity {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
    flex-shrink: 0;
}

.party-dashboard-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 8px;
    background: var(--gray-50);
    padding: 0.25rem;
    flex-shrink: 0;
}

.party-dashboard-text {
    min-width: 0;
}

.party-dashboard-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--inec-green-dark);
}

.party-dashboard-code {
    font-size: 0.9rem;
    color: var(--gray-600);
    letter-spacing: 0.04em;
}

.party-dashboard-slogan {
    flex: 1;
    min-width: 0;
    text-align: right;
    font-size: 1.75rem;
    font-weight: 800;
    font-style: italic;
    color: var(--inec-green-dark);
    line-height: 1.3;
    animation:
        party-slogan-in 0.7s ease-out both,
        party-slogan-pulse 2.8s ease-in-out 0.7s infinite;
}

@keyframes party-slogan-in {
    from {
        opacity: 0;
        transform: translateX(1.25rem);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes party-slogan-pulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
        text-shadow: 0 0 0 transparent;
    }
    50% {
        opacity: 0.82;
        transform: scale(1.03);
        text-shadow: 0 0 12px rgba(0, 135, 81, 0.28);
    }
}

@media (prefers-reduced-motion: reduce) {
    .party-dashboard-slogan {
        animation: none;
    }
}

.party-settings-logo-preview {
    margin-bottom: 0.75rem;
}

.party-logo-watermark {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.party-logo-watermark img {
    width: min(55vw, 520px);
    max-height: 55vh;
    object-fit: contain;
    opacity: 0.12;
    filter: grayscale(0.15);
}

@media (max-width: 720px) {
    .party-dashboard-banner {
        flex-direction: column;
        align-items: flex-start;
    }

    .party-dashboard-slogan {
        text-align: left;
        width: 100%;
    }
}

.party-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    vertical-align: middle;
}

.party-chip-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
    background: var(--gray-50);
}

.party-chip-code {
    font-weight: 700;
    color: var(--inec-green-dark);
}

.party-chip-name {
    color: var(--gray-600);
    font-size: 0.9rem;
}

.stats-grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

/* Search bar */
.search-bar {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    margin-bottom: 1rem;
}

/* Compact list filters (tenant users, etc.) */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: flex-end;
    margin: 0 0 1.25rem;
    padding: 1rem 1.1rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
}

.filter-bar .form-group {
    margin: 0;
    min-width: 140px;
}

.filter-bar .form-group.filter-search {
    flex: 1 1 220px;
    min-width: 200px;
}

.filter-bar .form-group label {
    font-size: 0.75rem;
    margin-bottom: 0.2rem;
}

.filter-bar .form-group input,
.filter-bar .form-group select {
    padding: 0.55rem 0.75rem;
    font-size: 0.9rem;
}

.filter-bar .btn {
    align-self: flex-end;
    height: 2.45rem;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .filter-bar .form-group,
    .filter-bar .form-group.filter-search {
        flex: 1 1 100%;
        min-width: 0;
    }

    .filter-bar .btn {
        width: 100%;
    }
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
}

.modal-overlay[hidden] { display: none !important; }

.modal-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow);
}

.modal-card h3 {
    color: var(--inec-green-dark);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modal-info {
    background: var(--gray-50);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.modal-info p { margin: 0.25rem 0; }

/* Clickable user name → detail overlay */
.user-detail-trigger {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    font-weight: 700;
    color: var(--inec-green-dark);
    cursor: pointer;
    text-align: left;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.user-detail-trigger:hover,
.user-detail-trigger:focus-visible {
    color: var(--inec-green);
    outline: none;
}

.user-detail-card {
    max-width: 560px;
    padding: 0;
    overflow: hidden;
}

.user-detail-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.user-detail-card-header h3 {
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
    font-size: 1.15rem;
}

.user-detail-card-footer {
    display: flex;
    justify-content: flex-end;
    padding: 0.85rem 1.5rem 1.25rem;
    border-top: 1px solid var(--gray-200);
}

.user-detail-grid {
    display: grid;
    grid-template-columns: minmax(7.5rem, 9.5rem) 1fr;
    gap: 0.65rem 1rem;
    padding: 1.1rem 1.5rem;
    max-height: min(60vh, 420px);
    overflow: auto;
    background: var(--gray-50);
}

.user-detail-label {
    color: var(--gray-600);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding-top: 0.1rem;
}

.user-detail-value {
    color: var(--gray-800);
    font-size: 0.95rem;
    word-break: break-word;
}

@media (max-width: 520px) {
    .user-detail-grid {
        grid-template-columns: 1fr;
        gap: 0.2rem 0;
    }

    .user-detail-label {
        margin-top: 0.45rem;
    }

    .user-detail-label:first-child {
        margin-top: 0;
    }
}

/* Professional result submission form */
.result-form-document {
    background: rgba(255, 255, 255, 0.98);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 720px;
    margin: 0 auto 2rem;
    overflow: hidden;
    border: 2px solid var(--inec-green-light);
}

.result-form-header {
    text-align: center;
    padding: 2rem 1.5rem 1.25rem;
    border-bottom: 2px solid var(--inec-green);
    background: linear-gradient(180deg, var(--inec-green-light) 0%, white 100%);
}

.result-form-logo {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.result-form-header h2 {
    color: var(--inec-green-dark);
    font-size: 1.25rem;
    letter-spacing: 0.04em;
}

.result-form-header h3 {
    color: var(--gray-800);
    font-size: 1rem;
    margin-top: 0.35rem;
    font-weight: 600;
}

.result-form-election {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--gray-600);
    font-weight: 600;
}

.result-form-body { padding: 1.5rem; }

.result-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--gray-200);
}

.result-section:last-of-type { border-bottom: none; }

.result-section h4 {
    color: var(--inec-green-dark);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.75rem;
}

.result-field-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.6rem;
}

.result-field-row label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-600);
}

.result-field-row input[readonly] {
    background: var(--gray-50);
    border-color: var(--gray-200);
}

.votes-table {
    width: 100%;
    margin-bottom: 1rem;
}

.votes-table th:last-child,
.votes-table td:last-child { width: 120px; }

.votes-table input {
    width: 100%;
    padding: 0.5rem;
    border: 1.5px solid var(--gray-200);
    border-radius: 6px;
}

.result-form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding-top: 1rem;
}

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

/* Pagination */
.pagination { margin-top: 1.25rem; }
.pagination-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.pagination-info { font-size: 0.85rem; color: var(--gray-600); }
.pagination-links { display: flex; gap: 0.35rem; flex-wrap: wrap; }

/* EC 8A(I) official form */
.ec8a-form {
    background: #fff;
    max-width: 900px;
    margin: 0 auto 2rem;
    border: 2px solid var(--inec-green);
    box-shadow: var(--shadow);
    font-size: 0.85rem;
}

.ec8a-form-top {
    display: grid;
    grid-template-columns: 80px 1fr 70px;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 2px solid var(--inec-green);
    background: linear-gradient(180deg, var(--inec-green-light), #fff);
    align-items: start;
}

.ec8a-logo { font-size: 3rem; text-align: center; }
.ec8a-org { color: var(--inec-green-dark); font-weight: 700; font-size: 0.9rem; }
.ec8a-title-block h2 { font-size: 1rem; margin: 0.25rem 0; text-transform: uppercase; }
.ec8a-subtitle { font-size: 0.8rem; color: var(--gray-600); }
.ec8a-election { font-weight: 600; margin-top: 0.25rem; }
.ec8a-form-code { font-weight: 700; text-align: right; color: var(--inec-green-dark); }

.ec8a-body { padding: 1.25rem 1.5rem; }

.ec8a-location-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.ec8a-field label {
    display: block;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-bottom: 0.2rem;
}

.ec8a-field input {
    width: 100%;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    font-size: 0.85rem;
}

.ec8a-stats { margin-bottom: 1.25rem; }

.ec8a-stat-row {
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 0.75rem;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px dotted var(--gray-200);
}

.ec8a-stat-row label { font-size: 0.8rem; }
.ec8a-stat-row input { padding: 0.4rem; border: 1px solid var(--gray-200); border-radius: 4px; text-align: right; }

.ec8a-party-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.25rem;
    font-size: 0.8rem;
}

.ec8a-party-table th,
.ec8a-party-table td {
    border: 1px solid var(--gray-200);
    padding: 0.45rem 0.6rem;
}

.ec8a-party-table th { background: var(--inec-green); color: #fff; }
.ec8a-party-table input { width: 100%; border: 1px solid var(--gray-200); padding: 0.35rem; border-radius: 4px; }
.ec8a-words { font-style: italic; color: var(--gray-600); }
.ec8a-total-row { background: var(--gray-50); font-weight: 600; }

.ec8a-section {
    margin-bottom: 1.25rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-200);
}

.ec8a-section h4 {
    color: var(--inec-green-dark);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.ec8a-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding: 1rem 0;
}

.ec8a-verify-hint {
    text-align: center;
    margin: 0 1.5rem 1rem;
}

.ec8a-verify-hint.verified {
    color: var(--success);
    font-weight: 600;
}

.ec8a-actions .btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.ec8a-reupload,
.ec8a-resubmit {
    margin: 0 1.5rem 1.5rem;
    padding: 1rem;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
}

.role-select-grid {
    display: grid;
    gap: 1rem;
    margin: 1.5rem 0;
}

.role-select-card {
    display: block;
    padding: 1.25rem;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.role-select-card:hover {
    border-color: var(--inec-green);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.role-select-card strong {
    display: block;
    color: var(--inec-green-dark);
    margin-bottom: 0.35rem;
}

.role-select-card span {
    font-size: 0.85rem;
    color: var(--gray-600);
}

.view-result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 1rem;
}

.results-side-by-side-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
}

.results-side-by-side-item {
    padding: 0;
    overflow: hidden;
}

.results-side-by-side-item--flagged {
    border-color: var(--warning);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--warning) 35%, transparent);
}

.results-side-by-side-header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.results-side-by-side-heading {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.results-side-by-side-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    font-size: 0.9rem;
    color: var(--gray-600);
}

.results-side-by-side-item .view-result-grid {
    margin: 0;
    padding: 1rem;
}

.results-side-by-side-item .result-sheet-card,
.results-side-by-side-item .result-digital-card {
    margin: 0;
}

.result-sheet-iframe {
    width: 100%;
    height: 500px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
}

.result-sheet-actions {
    margin: 0.5rem 0 0;
}

.result-sheet-preview {
    width: 100%;
    max-height: 520px;
    object-fit: contain;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--gray-50);
}

.ec8a-view .ec8a-location-grid {
    margin-bottom: 1rem;
}

.ec8a-view-stats p {
    margin: 0.35rem 0;
    font-size: 0.9rem;
}

@media (max-width: 900px) {
    .view-result-grid { grid-template-columns: 1fr; }
    .results-side-by-side-header { flex-direction: column; align-items: flex-start; }
}

@media print {
    .no-print, nav, .site-header, .site-footer { display: none !important; }
    .view-result-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
    .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
    .result-sheet-preview { max-height: none; }
}

@media (max-width: 700px) {
    .ec8a-form-top { grid-template-columns: 1fr; }
    .ec8a-location-grid { grid-template-columns: 1fr; }
    .ec8a-stat-row { grid-template-columns: 1fr; }
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.action-card {
    display: block;
    background: rgba(255, 255, 255, 0.97);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.2rem 1.25rem;
    text-decoration: none;
    color: inherit;
    border-left: 4px solid var(--inec-green);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
}

.action-card h3 {
    color: var(--inec-green-dark);
    font-size: 1.05rem;
    margin-bottom: 0.35rem;
}

.action-card p {
    font-size: 0.85rem;
    color: var(--gray-600);
}

.tenant-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin: 1.25rem 0 0.5rem;
}

.tenant-choice-card {
    background: rgba(255, 255, 255, 0.97);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem 1.4rem;
    border-top: 4px solid var(--inec-green);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tenant-choice-card--rh {
    border-top-color: #0b3d91;
}

.tenant-choice-card h3 {
    margin: 0;
    color: var(--inec-green-dark);
    font-size: 1.25rem;
}

.tenant-choice-card--rh h3 {
    color: #0b3d91;
}

.tenant-choice-card p {
    margin: 0;
    flex: 1;
    color: var(--gray-600);
    font-size: 0.95rem;
    line-height: 1.45;
}

.tenant-choice-card .btn {
    align-self: flex-start;
}

/* Branded themes (external orgs + political parties) — colors injected on body */
body.has-theme-overlay .bg-overlay {
    background:
        radial-gradient(ellipse at 18% 8%, var(--page-wash-a, rgba(11, 61, 145, 0.22)), transparent 48%),
        radial-gradient(ellipse at 88% 0%, var(--page-wash-b, rgba(196, 92, 38, 0.14)), transparent 42%),
        linear-gradient(
            155deg,
            var(--page-overlay-start, rgba(11, 61, 145, 0.92)) 0%,
            var(--page-overlay-end, rgba(7, 42, 99, 0.96)) 55%,
            color-mix(in srgb, var(--inec-green-dark, #072a63) 88%, #000) 100%
        );
}

body.theme-external .main-header,
body.theme-parties.has-theme-overlay .main-header {
    border-bottom-color: var(--inec-green);
}

body.theme-external .tenant-choice-card--rh,
body.theme-external .action-card,
body.theme-parties.has-theme-overlay .action-card {
    border-left-color: var(--inec-green);
}

body.theme-external .login-card.register-card--external {
    border-top: 4px solid var(--inec-green);
}

.theme-picker-shell {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 560px;
}

.theme-picker-dropdown {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.theme-picker-dropdown-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--gray-700, #374151);
}

.theme-picker-select {
    width: 100%;
    max-width: 100%;
    padding: 0.65rem 0.85rem;
    border: 2px solid var(--gray-200, #e5e7eb);
    border-radius: 10px;
    background: #fff;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--gray-800, #1f2937);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.theme-picker-select:hover {
    border-color: color-mix(in srgb, var(--inec-green) 35%, var(--gray-200, #e5e7eb));
}

.theme-picker-select:focus {
    outline: none;
    border-color: var(--inec-green);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--inec-green) 20%, transparent);
}

.theme-picker-live {
    border: 2px solid var(--gray-200, #e5e7eb);
    border-radius: 12px;
    padding: 1rem 1.1rem 0.85rem;
    background: linear-gradient(180deg, #fafafa 0%, #fff 100%);
}

.theme-picker-live-caption {
    margin: 0.75rem 0 0;
    font-size: 0.85rem;
    color: var(--gray-600, #4b5563);
    text-align: center;
}

.theme-picker-live-kicker {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.68rem;
    color: var(--gray-500, #6b7280);
    margin-right: 0.35rem;
}

.theme-picker-live-name {
    font-weight: 700;
    color: var(--gray-800, #1f2937);
}

.theme-preview-app {
    display: flex;
    flex-direction: column;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: var(--preview-dark, #072a63);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.theme-preview-app--live {
    aspect-ratio: 16 / 7;
    max-width: 520px;
    margin: 0 auto;
}

.theme-preview-app-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.35rem;
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.theme-preview-app-nav-brand {
    width: 28%;
    height: 6px;
    border-radius: 999px;
    background: var(--preview-primary, #0b3d91);
    margin-right: auto;
}

.theme-preview-app-nav-link {
    width: 14%;
    height: 5px;
    border-radius: 999px;
    background: #e5e7eb;
}

.theme-preview-app-nav-link.is-active {
    background: var(--preview-primary, #0b3d91);
}

.theme-preview-app-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    padding: 0.35rem;
    background:
        radial-gradient(circle at 12% 18%, color-mix(in srgb, var(--preview-primary, #0b3d91) 36%, transparent), transparent 42%),
        radial-gradient(circle at 88% 82%, color-mix(in srgb, var(--preview-accent, #c45c26) 24%, transparent), transparent 38%),
        linear-gradient(160deg, var(--preview-dark, #072a63) 0%, color-mix(in srgb, var(--preview-primary, #0b3d91) 88%, #000) 100%);
}

.theme-preview-app-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
    padding: 0.22rem 0.28rem;
    border-radius: 4px;
    background: #fff;
    border: 1px solid var(--preview-light, #e8eef8);
}

.theme-preview-app-banner-logo {
    width: 34%;
    height: 5px;
    border-radius: 999px;
    background: var(--preview-light, #e8eef8);
}

.theme-preview-app-banner-slogan {
    width: 28%;
    height: 5px;
    border-radius: 999px;
    background: var(--preview-primary, #0b3d91);
}

.theme-preview-app-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.22rem;
    padding: 0.28rem;
    border-radius: 4px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    flex: 1;
}

.theme-preview-stat {
    border-radius: 3px;
    background: linear-gradient(180deg, var(--preview-light, #e8eef8) 0%, #fff 100%);
    border: 1px solid color-mix(in srgb, var(--preview-primary, #0b3d91) 18%, transparent);
    min-height: 100%;
}

.theme-preview-app-btn {
    align-self: flex-start;
    padding: 0.14rem 0.42rem;
    border-radius: 999px;
    font-size: 0.48rem;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
    background: var(--preview-primary, #0b3d91);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

.org-dashboard-banner {
    border-left: 4px solid var(--inec-green);
}

.election-switcher-card {
    background: #fff;
}

.election-switcher {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
}

.election-switcher-heading {
    font-weight: 700;
    color: var(--inec-green-dark);
    font-size: 0.9rem;
}

.election-switcher-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem;
}

.election-switcher-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.election-switcher label {
    font-weight: 600;
    color: var(--inec-green-dark);
    font-size: 0.8rem;
    white-space: nowrap;
}

@media (max-width: 720px) {
    .election-switcher-fields {
        grid-template-columns: 1fr;
    }
}

.election-switcher select {
    width: 100%;
    min-width: 0;
    padding: 0.55rem 2.2rem 0.55rem 0.85rem;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    background-color: #fff;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23006b40' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.election-switcher select:focus {
    outline: none;
    border-color: var(--inec-green);
    box-shadow: 0 0 0 3px rgba(0, 135, 81, 0.15);
}

.badge-mismatch {
    background: #7f1d1d;
    color: #fff;
    animation: mismatch-pulse 1.6s ease-in-out infinite;
}

@keyframes mismatch-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(127, 29, 29, 0.55); }
    50% { box-shadow: 0 0 0 6px rgba(127, 29, 29, 0); }
}

.row-discrepancy td {
    background: #fee2e2 !important;
}

.discrepancy-banner {
    background: #7f1d1d;
    color: #fff;
    border-radius: var(--radius);
    padding: 1.1rem 1.35rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 0 4px rgba(127, 29, 29, 0.25), var(--shadow);
}

.discrepancy-banner-title {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    margin-bottom: 0.4rem;
}

.discrepancy-banner p,
.discrepancy-banner li {
    color: #fecaca;
    font-size: 0.92rem;
}

.discrepancy-banner ul {
    margin: 0.5rem 0 0 1.1rem;
}

.notif-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    text-decoration: none;
    font-size: 1.15rem;
    border-radius: 999px;
    background: var(--inec-green-light);
}

.notif-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: #b91c1c;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.notification-item {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 0.9rem 1rem;
}

.notification-item.unread {
    background: #fef2f2;
    border-color: #fca5a5;
}

.notification-item-title {
    font-weight: 700;
    color: var(--inec-green-dark);
    margin-bottom: 0.25rem;
}

.notification-item.unread .notification-item-title {
    color: #7f1d1d;
}

.notification-item p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--gray-600);
}

.notification-item small {
    display: block;
    margin-top: 0.4rem;
    color: var(--gray-600);
    font-size: 0.78rem;
}

/* Dashboard tabs + incident reports */
.dash-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.dash-tab {
    border: 1.5px solid var(--inec-green-light);
    background: white;
    color: var(--inec-green-dark);
    border-radius: 999px;
    padding: 0.5rem 1.1rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.dash-tab:hover {
    background: var(--inec-green-light);
}

.dash-tab.is-active {
    background: var(--inec-green);
    border-color: var(--inec-green);
    color: white;
}

.dash-tab-panel { display: none; }
.dash-tab-panel.is-active { display: block; }
/* Keep map panel laid out when inactive so Leaflet does not init at 0×0. */
.dash-tab-panel[data-totals-panel="map"] {
    display: block;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
}
.dash-tab-panel[data-totals-panel="map"].is-active {
    height: auto;
    overflow: visible;
    visibility: visible;
    pointer-events: auto;
}

.collation-dashboard > .dash-tabs {
    padding: 0 1.5rem 0.75rem;
    margin-bottom: 0;
}

.collation-totals-tabs {
    margin: 0 0 1rem;
}

.collation-map-leader {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--gray-200);
    background: #f8fafc;
    color: var(--gray-800);
}

.collation-map-leader[hidden] {
    display: none;
}

.collation-map-leader-swatch {
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 4px;
    flex-shrink: 0;
    border: 1px solid rgba(15, 23, 42, 0.2);
}

.collation-map-leader-body {
    min-width: 0;
}

.collation-map-leader-label {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--gray-500);
    margin-bottom: 0.15rem;
}

.collation-map-leader-name {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
}

.collation-map-leader-meta {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-top: 0.1rem;
}

.collation-leading-map {
    width: 100%;
    height: min(62vh, 520px);
    min-height: 340px;
    border-radius: 10px;
    border: 1px solid var(--gray-200);
    background: #e8eef5;
    z-index: 1;
    /* Leaflet overlays drift from tiles if inherited font-size/transform differs. */
    font-size: 12px;
    line-height: 1.2;
    transform: none;
}

.collation-leading-map .leaflet-container {
    font-size: 12px;
    width: 100%;
    height: 100%;
    background: #e8eef5;
}

.collation-map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 0.9rem;
    margin-top: 0.85rem;
}

.collation-map-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--gray-600);
}

.collation-map-legend-item i {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 3px;
    display: inline-block;
    border: 1px solid rgba(15, 23, 42, 0.25);
}

.leaflet-tooltip.collation-map-winner-label {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
    pointer-events: none;
}

.leaflet-tooltip.collation-map-winner-label::before {
    display: none;
}

.collation-map-winner-chip-wrap {
    background: transparent !important;
    border: none !important;
}

.collation-map-winner-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.1rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    border: 1px solid rgba(15, 23, 42, 0.35);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.03em;
    line-height: 1.2;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
    white-space: nowrap;
}

.voice-recorder {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.incident-description {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem 1.15rem;
    line-height: 1.55;
    white-space: pre-wrap;
}

.incident-photo {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--gray-200);
    display: block;
    cursor: pointer;
}

.incident-audio {
    width: 100%;
    max-width: 480px;
}

.incident-comments {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.incident-comment {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    background: white;
}

.incident-comment-head {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.45rem;
}

.incident-comment-head small {
    color: var(--gray-600);
    margin-left: auto;
}

.incident-comment-body {
    line-height: 1.5;
    color: var(--gray-800);
}

/* Party payment */
.payment-page,
.payment-locked-page {
    max-width: 720px;
    margin: 0 auto;
}
.payment-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.payment-fee-table td {
    padding: 0.65rem 0.5rem;
    border-bottom: 1px solid var(--gray-100);
}
.payment-fee-table .text-right { text-align: right; white-space: nowrap; }
.payment-total-row td {
    border-bottom: none;
    padding-top: 0.9rem;
    font-size: 1.05rem;
}
.payment-provider-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}
.payment-provider-actions form {
    margin: 0;
    flex: 1 1 220px;
    min-width: 220px;
}
.payment-provider-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    min-height: 140px;
    padding: 1rem 1.25rem;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.payment-provider-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}
.payment-provider-btn--paystack:hover {
    border-color: #00b8f0;
}
.payment-provider-btn--flutterwave {
    background: #0b1f35;
    border-color: #0b1f35;
}
.payment-provider-btn--flutterwave:hover {
    border-color: #17365c;
    box-shadow: 0 8px 20px rgba(11, 31, 53, 0.25);
}
.payment-provider-logo {
    display: block;
    max-width: 160px;
    max-height: 56px;
    width: auto;
    height: auto;
    object-fit: contain;
}
.payment-provider-btn--paystack .payment-provider-logo {
    max-height: 48px;
}
.payment-provider-btn--flutterwave .payment-provider-logo {
    max-width: 72px;
    max-height: 72px;
}
.payment-provider-btn span {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-800, #1f2937);
}
.payment-provider-btn--flutterwave span {
    color: #ffffff;
}
.payment-actions .btn-lg {
    display: inline-block;
    padding: 0.85rem 1.5rem;
    font-size: 1.05rem;
}
.payment-prefill-summary {
    margin: 1rem 0;
    padding: 0.85rem 1rem;
    background: var(--gray-50, #f8fafc);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
}
.payment-prefill-summary h4 {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
}
.payment-prefill-summary ul {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--gray-700);
    font-size: 0.9rem;
}
.payment-prefill-summary li { margin: 0.2rem 0; }
.payment-claim-form {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}
.payment-claim-form h4 { margin: 0 0 0.75rem; }
.inline-action-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}
.inline-action-form input[type="text"] {
    min-width: 140px;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
}
.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.hidden { display: none !important; }

/* Incident messenger */
.incident-messenger {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 0;
    min-height: calc(100vh - 220px);
    max-height: calc(100vh - 160px);
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.im-sidebar {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--gray-200);
    background: var(--gray-50);
    min-height: 0;
}

.im-sidebar-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1rem 0.5rem;
}

.im-sidebar-head h2 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--inec-green-dark);
}

.im-search-wrap {
    padding: 0 1rem 0.75rem;
}

.im-search {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--gray-200);
    border-radius: 999px;
    background: #fff;
    font: inherit;
}

.im-thread-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.35rem;
}

.im-thread-item {
    width: 100%;
    text-align: left;
    border: 1px solid transparent;
    background: #fff;
    border-radius: 10px;
    padding: 0.75rem 0.85rem;
    margin-bottom: 0.35rem;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.im-thread-item:hover,
.im-thread-item.is-active {
    border-color: rgba(0, 104, 71, 0.25);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
}

.im-thread-item.is-active {
    background: #f0fdf4;
}

.im-thread-item-top {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    align-items: baseline;
}

.im-thread-item-top strong {
    font-size: 0.92rem;
    color: var(--gray-900);
}

.im-thread-time {
    font-size: 0.75rem;
    color: var(--gray-500);
    white-space: nowrap;
}

.im-thread-item-sub,
.im-thread-item-preview {
    font-size: 0.82rem;
    color: var(--gray-600);
    margin-top: 0.2rem;
    line-height: 1.35;
}

.im-thread-item-preview {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.im-thread-media {
    margin-right: 0.25rem;
}

.im-thread-item-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.45rem;
}

.im-thread-count {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.im-empty {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--gray-600);
    font-size: 0.9rem;
}

.im-chat {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #fff;
    position: relative;
}

.im-chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    color: var(--gray-700);
}

.im-chat-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.im-chat-active,
.im-compose-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.im-chat-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    background: #fff;
}

.im-back-btn {
    display: none;
    border: 1px solid var(--gray-200);
    background: #fff;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 1rem;
}

.im-chat-head-meta {
    flex: 1;
    min-width: 0;
}

.im-chat-head-meta strong {
    display: block;
    font-size: 0.98rem;
}

.im-chat-head-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.im-status-select {
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font: inherit;
    font-size: 0.85rem;
}

.im-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.im-msg {
    display: flex;
}

.im-msg-mine {
    justify-content: flex-end;
}

.im-msg-theirs {
    justify-content: flex-start;
}

.im-msg-bubble {
    max-width: min(78%, 640px);
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 14px;
    padding: 0.75rem 0.9rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.im-msg-mine .im-msg-bubble {
    background: #ecfdf5;
    border-color: rgba(0, 104, 71, 0.18);
}

.im-msg-head {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    align-items: center;
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
    color: var(--gray-600);
}

.im-msg-head strong {
    color: var(--gray-900);
    font-size: 0.84rem;
}

.im-msg-head time {
    margin-left: auto;
    white-space: nowrap;
}

.im-msg-role {
    text-transform: capitalize;
    background: var(--gray-100);
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
}

.im-msg-body {
    line-height: 1.5;
    color: var(--gray-800);
    font-size: 0.92rem;
    word-break: break-word;
}

.im-msg-image {
    display: block;
    width: 88px;
    height: 88px;
    object-fit: cover;
    margin-top: 0.5rem;
    border-radius: 10px;
    border: 1px solid var(--gray-200);
    cursor: pointer;
}

.im-msg-audio {
    width: 100%;
    margin-top: 0.5rem;
}

.im-composer {
    border-top: 1px solid var(--gray-200);
    padding: 0;
    background: #efeae2;
    overflow: visible;
}

.im-composer-form {
    display: block;
}

.chat-attach-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    width: 100%;
    align-items: center;
}

.chat-attach-label {
    margin: 0;
    cursor: pointer;
}

.wa-composer {
    display: block;
    padding: 0.45rem 0.55rem 0.55rem;
    background: #efeae2;
    border-top: 1px solid #e1d9ce;
}

.wa-composer-row {
    display: flex;
    align-items: flex-end;
    gap: 0.35rem;
}

.wa-icon-btn {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #54656f;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
}

.wa-icon-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.wa-mic,
.wa-send {
    background: #00a884;
    color: #fff;
}

.wa-mic:hover,
.wa-send:hover {
    background: #008f6f;
}

.wa-send {
    display: none;
}

.wa-composer.is-ready .wa-mic,
.wa-composer.is-recording .wa-mic,
.wa-composer.is-recording .wa-attach {
    display: none;
}

.wa-composer.is-ready .wa-send,
.wa-composer.is-recording .wa-send {
    display: inline-flex;
}

.wa-input-wrap {
    flex: 1;
    min-width: 0;
    background: #fff;
    border-radius: 21px;
    border: 1px solid #e9edef;
    min-height: 42px;
    display: flex;
    align-items: center;
}

.wa-input-wrap textarea {
    flex: 1;
    width: 100%;
    border: 0 !important;
    min-height: 42px;
    max-height: 120px;
    resize: none;
    padding: 0.6rem 0.9rem;
    background: transparent;
    box-shadow: none;
    font: inherit;
    line-height: 1.35;
}

.wa-record-bar {
    display: none;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    padding: 0 0.35rem 0 0.15rem;
    color: #e11d48;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 0.92rem;
}

.wa-composer.is-recording .wa-input-wrap textarea {
    display: none;
}

.wa-composer.is-recording .wa-record-bar {
    display: flex;
}

.wa-cancel {
    color: #667781;
    width: 36px;
    height: 36px;
}

.wa-rec-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e11d48;
    animation: wa-pulse 1s ease-in-out infinite;
}

@keyframes wa-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.25; }
}

.wa-attach {
    position: relative;
}

.wa-attach-menu {
    position: absolute;
    bottom: 48px;
    left: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(11, 20, 26, 0.16);
    padding: 0.35rem;
    min-width: 150px;
    z-index: 6;
}

.wa-attach-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0.55rem 0.7rem;
    cursor: pointer;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #111b21;
}

.wa-attach-item:hover {
    background: #f5f6f6;
}

.wa-pending {
    display: none;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.35rem 3.2rem 0 3.2rem;
}

.wa-pending:not(:empty) {
    display: flex;
}

.wa-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #fff;
    border-radius: 999px;
    padding: 0.18rem 0.45rem 0.18rem 0.65rem;
    font-size: 0.78rem;
    color: #111b21;
}

.wa-chip-x {
    border: 0;
    background: transparent;
    color: #667781;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 0.15rem;
}

.chat-file {
    display: inline-flex;
    margin-top: 0.45rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.voice-player {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    margin-top: 0.5rem;
}

.voice-player .im-msg-audio {
    width: 100%;
    margin-top: 0;
}

.voice-open-link {
    font-size: 0.8rem;
}

.im-composer-form textarea {
    flex: 1;
    resize: vertical;
    min-height: 44px;
    max-height: 140px;
    border-radius: 10px;
    border: 1px solid var(--gray-200);
    padding: 0.65rem 0.75rem;
    font: inherit;
}

.wa-input-wrap textarea,
.im-composer-form .wa-input-wrap textarea,
.cm-composer .wa-input-wrap textarea {
    flex: 1;
    width: 100%;
    border: 0 !important;
    border-radius: 21px;
    min-height: 42px;
    max-height: 120px;
    resize: none;
    padding: 0.6rem 0.9rem;
    background: transparent;
    box-shadow: none;
    font: inherit;
    line-height: 1.35;
}

.im-compose-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

@media (max-width: 900px) {
    .incident-messenger {
        grid-template-columns: 1fr;
        min-height: calc(100vh - 180px);
        max-height: none;
    }

    .im-back-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .incident-messenger.im-mobile-chat-open .im-sidebar {
        display: none;
    }

    .incident-messenger:not(.im-mobile-chat-open) .im-chat-active,
    .incident-messenger:not(.im-mobile-chat-open) .im-compose-panel {
        display: none !important;
    }
}

/* Party / Organization / Campaign structure hub */
.structure-groups {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    margin-top: 1.25rem;
}

.structure-group {
    padding: 0;
}

.structure-group-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
    padding-bottom: 0.65rem;
    border-bottom: 2px solid #d7e3db;
}

.structure-group-title {
    margin: 0;
    font-size: 1.15rem;
    color: var(--inec-green-dark);
    font-weight: 700;
}

.structure-group-desc {
    margin: 0.2rem 0 0;
    font-size: 0.84rem;
    color: var(--gray-600);
}

.structure-group-totals {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
    font-size: 0.8rem;
    color: var(--gray-600);
}

.structure-group-totals strong {
    color: var(--inec-green-dark);
    font-weight: 700;
}

.structure-group-coverage {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--inec-green-dark);
    background: #e8f5ef;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
}

.structure-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 0;
}

.structure-card {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 1.15rem 1.2rem;
    border-radius: var(--radius);
    background: #fff;
    border: 1px solid #d7e3db;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    min-height: 210px;
}

.structure-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(15, 61, 36, 0.12);
    border-color: var(--inec-green);
}

.structure-card.is-complete { border-left: 4px solid var(--success); }
.structure-card.is-partial { border-left: 4px solid var(--warning); }
.structure-card.is-empty { border-left: 4px solid #c5cdd0; }

.structure-card.has-pending-approval {
    border-left-color: var(--danger, #c2410c);
    border-color: #f0c7b4;
    background: linear-gradient(180deg, #fff8f4 0%, #fff 42%);
}

.structure-card.has-pending-approval:hover {
    border-color: var(--danger, #c2410c);
}

.structure-card-pending-badge {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #9a3412;
    background: #ffedd5;
    border: 1px solid #fdba74;
    border-radius: 999px;
    padding: 0.22rem 0.65rem;
}

.structure-group-pending-approval {
    color: #9a3412;
    font-weight: 600;
}

.structure-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.structure-card-icon { font-size: 1.45rem; line-height: 1; }
.structure-card-coverage {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--inec-green-dark);
    background: #e8f5ef;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
}

.structure-card-title {
    margin: 0;
    font-size: 1.05rem;
    color: var(--inec-green-dark);
    line-height: 1.3;
}

.structure-card-desc {
    margin: 0;
    font-size: 0.82rem;
    color: var(--gray-600);
    line-height: 1.4;
    flex: 1;
}

.structure-card-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    padding-top: 0.55rem;
    border-top: 1px solid #e6eee9;
}

.structure-card-stats div {
    text-align: center;
}

.structure-card-stats strong {
    display: block;
    font-size: 1.05rem;
    color: var(--inec-green-dark);
}

.structure-card-stats span {
    font-size: 0.68rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.structure-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--gray-600);
}

.structure-card-cta {
    color: var(--inec-green);
    font-weight: 600;
}

.structure-summary {
    margin-bottom: 1.25rem;
}

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

    .structure-group-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Community chat (party / org / campaign) */
.community-messenger {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 0;
    height: calc(100vh - 200px);
    min-height: 420px;
    max-height: calc(100vh - 160px);
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.cm-sidebar {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--gray-200);
    background: var(--gray-50);
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}

.cm-sidebar-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1rem 0.5rem;
    flex-shrink: 0;
}

.cm-sidebar-head h2 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--inec-green-dark);
}

.cm-search-wrap {
    padding: 0 1rem 0.75rem;
    flex-shrink: 0;
}

.cm-search {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--gray-200);
    border-radius: 999px;
    background: #fff;
    font: inherit;
}

.cm-room-list,
.cm-peer-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 0.35rem;
}

.cm-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
    padding: 0.55rem 0.85rem 0.25rem;
}

.cm-group {
    margin-bottom: 0.35rem;
}

.cm-group-toggle,
.cm-subgroup-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border: none;
    background: transparent;
    padding: 0.45rem 0.7rem;
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: var(--gray-700);
    list-style: none;
}
.cm-group-toggle::-webkit-details-marker {
    display: none;
}

.cm-group-toggle:hover,
.cm-subgroup-toggle:hover {
    background: rgba(0, 104, 71, 0.06);
    border-radius: 8px;
}

.cm-group-chevron {
    width: 0.9rem;
    color: var(--inec-green-dark);
    font-size: 0.75rem;
}

.cm-group-title {
    flex: 1;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-600);
}

.cm-group-count {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-500);
    background: #e8eee9;
    border-radius: 999px;
    padding: 0.05rem 0.45rem;
}

.cm-group-body {
    padding: 0 0.15rem 0.25rem;
}

.cm-group-body.hidden,
.cm-subgroup-body.hidden {
    display: none !important;
}

.cm-subgroup {
    margin: 0.15rem 0 0.35rem 0.35rem;
    border-left: 2px solid #d7e3db;
    padding-left: 0.25rem;
}

.cm-subgroup-toggle {
    padding: 0.35rem 0.55rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--inec-green-dark);
}

.cm-subgroup-body {
    padding: 0 0 0.15rem;
}

.cm-room-item,
.cm-peer-item {
    width: 100%;
    text-align: left;
    border: 1px solid transparent;
    background: #fff;
    border-radius: 10px;
    padding: 0.75rem 0.85rem;
    margin-bottom: 0.35rem;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    display: block;
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
}

.cm-peer-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.cm-peer-item span {
    font-size: 0.78rem;
    color: var(--gray-600);
}

.cm-room-item:hover,
.cm-room-item.is-active,
.cm-peer-item:hover {
    border-color: rgba(0, 104, 71, 0.25);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
}

.cm-room-item.is-active { background: #f0fdf4; }

.cm-room-item-top {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    align-items: baseline;
}

.cm-room-item-top strong {
    font-size: 0.92rem;
    color: var(--gray-900);
}

.cm-room-time {
    font-size: 0.75rem;
    color: var(--gray-500);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.cm-unread {
    background: var(--inec-green);
    color: #fff;
    border-radius: 999px;
    padding: 0.05rem 0.4rem;
    font-size: 0.68rem;
    font-weight: 700;
}

.cm-room-preview {
    font-size: 0.82rem;
    color: var(--gray-600);
    margin-top: 0.2rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cm-empty {
    text-align: center;
    color: var(--gray-600);
    padding: 1.5rem 1rem;
    font-size: 0.9rem;
}

.cm-chat {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #fafcfb;
}

.cm-chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    text-align: center;
}

.cm-chat-empty-icon { font-size: 2.4rem; }

.cm-chat-active,
.cm-dm-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.cm-chat-active.hidden,
.cm-dm-panel.hidden,
.cm-chat-empty.hidden,
.cm-composer.hidden,
.cm-readonly-hint.hidden {
    display: none !important;
}

.cm-chat-head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    background: #fff;
}

.cm-chat-head-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cm-chat-head-meta strong {
    color: var(--inec-green-dark);
}

.cm-back-btn {
    display: none;
    border: none;
    background: transparent;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem 0.4rem;
    color: var(--inec-green-dark);
}

.cm-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.cm-bubble {
    max-width: min(78%, 520px);
    align-self: flex-start;
    background: #fff;
    border: 1px solid #e3ebe6;
    border-radius: 12px 12px 12px 4px;
    padding: 0.65rem 0.85rem;
}

.cm-bubble.is-mine {
    align-self: flex-end;
    background: #e8f5ef;
    border-color: #c6e4d4;
    border-radius: 12px 12px 4px 12px;
}

.cm-bubble-meta {
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.cm-bubble-body {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--gray-900);
}

.cm-bubble-time {
    margin-top: 0.3rem;
    font-size: 0.7rem;
    color: var(--gray-500);
    text-align: right;
}

.cm-composer input[type="file"] {
    width: auto;
    max-width: 9.5rem;
    font-size: 0.75rem;
    padding: 0.35rem 0;
}
.cm-composer {
    display: block;
    padding: 0;
    border-top: 0;
    background: transparent;
    align-items: stretch;
}

.cm-composer.wa-composer {
    padding: 0.45rem 0.55rem 0.55rem;
}

.cm-composer textarea {
    flex: 1;
    resize: none;
    font: inherit;
}

.cm-readonly-hint {
    margin: 0;
    padding: 0.65rem 1rem 0.9rem;
    font-size: 0.82rem;
    color: var(--gray-600);
    background: #fff;
    border-top: 1px solid var(--gray-200);
}

.ems-offline-banner {
    position: sticky;
    top: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    background: #92400e;
    color: #fff7ed;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.ems-offline-banner[hidden] { display: none !important; }
.ems-offline-banner .btn { white-space: nowrap; }

@media (max-width: 860px) {
    .community-messenger {
        grid-template-columns: 1fr;
        height: calc(100vh - 170px);
        max-height: calc(100vh - 150px);
        min-height: 360px;
    }

    .cm-back-btn { display: inline-block; }

    .community-messenger:not(.cm-mobile-chat-open) .cm-chat {
        display: none;
    }

    .community-messenger.cm-mobile-chat-open .cm-sidebar {
        display: none;
    }
}

.chat-thumb-btn {
    display: inline-block;
    padding: 0;
    margin-top: 0.45rem;
    border: 0;
    background: none;
    cursor: pointer;
    line-height: 0;
}
.chat-thumb {
    display: block;
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--gray-200);
}
.img-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(15, 23, 42, 0.88);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.img-lightbox.is-open {
    display: flex;
}
.img-lightbox img {
    max-width: min(96vw, 1100px);
    max-height: 90vh;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.img-lightbox-close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}
body.img-lightbox-open {
    overflow: hidden;
}

body.ems-app-embed .main-header,
body.ems-app-embed .main-footer {
    display: none !important;
}

body.ems-app-embed .main-content {
    padding-top: 0.75rem;
}

.ems-app-bar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    background: #0f3d24;
    color: #fff;
}

.ems-app-bar strong {
    font-size: 0.95rem;
}

.ems-app-back {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    padding: 0.25rem 0.45rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
}

