/* County Political Heatmap — matches KET site (gray-100, blue-600, white cards) */
.khm-page {
    --khm-blue: #2563eb;
    --khm-blue-dark: #1d4ed8;
    --khm-red: #dc2626;
    --khm-red-deep: #b91c1c;
    --khm-bg: #f3f4f6;
    --khm-card: #ffffff;
    --khm-border: #e5e7eb;
    --khm-text: #111827;
    --khm-muted: #6b7280;
}

.khm-hero {
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
    border-bottom: 1px solid var(--khm-border);
}

.khm-hero-accent {
    color: var(--khm-blue);
}

.khm-card {
    background: var(--khm-card);
    border: 1px solid var(--khm-border);
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.khm-layer-btn {
    transition: all 0.2s ease;
    background: #f9fafb;
    color: #374151;
    border: 1px solid var(--khm-border);
}
.khm-layer-btn:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: var(--khm-blue-dark);
}
.khm-layer-btn.active {
    background: var(--khm-blue);
    color: #fff;
    border-color: var(--khm-blue);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.khm-layer-btn.active i {
    color: #fff !important;
}

#khmMap {
    height: min(72vh, 640px);
    min-height: 420px;
    border-radius: 0.5rem;
    z-index: 1;
}

.khm-map-wrap {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid var(--khm-border);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
}

.khm-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.khm-zone-card {
    animation: khmSlideIn 0.35s ease;
}
@keyframes khmSlideIn {
    from { opacity: 0; transform: translateX(8px); }
    to { opacity: 1; transform: none; }
}

.leaflet-container {
    background: #e5e7eb;
    font-family: inherit;
}

.khm-party-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.khm-loading {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}
.khm-loading.show {
    opacity: 1;
    pointer-events: auto;
}

.khm-stat-bar {
    height: 6px;
    border-radius: 9999px;
    background: #e5e7eb;
    overflow: hidden;
}
.khm-stat-bar > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    transition: width 0.5s ease;
}

.khm-live-pill {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.khm-meta-pill {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.khm-info-card {
    background: linear-gradient(135deg, #fef2f2 0%, #fff 55%);
    border: 1px solid #fecaca;
}

.khm-info-card h3 {
    color: var(--khm-red-deep);
}

.khm-county-wrap {
    position: relative;
}
.khm-county-search::-webkit-search-cancel-button {
    cursor: pointer;
}
.khm-county-dd {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 4px;
    max-height: 220px;
    overflow-y: auto;
    border-radius: 0.375rem;
    border: 1px solid var(--khm-border);
    background: #fff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    z-index: 20;
}
.khm-county-dd.hidden {
    display: none;
}
.khm-county-opt {
    width: 100%;
    text-align: left;
    padding: 0.55rem 0.75rem;
    font-size: 0.875rem;
    color: var(--khm-text);
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.khm-county-opt:hover,
.khm-county-opt:focus {
    background: #eff6ff;
    outline: none;
}
.khm-county-opt--clear {
    color: var(--khm-muted);
    font-size: 0.8125rem;
    border-bottom: 1px solid var(--khm-border);
}
.khm-county-opt--empty {
    color: var(--khm-muted);
    font-size: 0.8125rem;
    cursor: default;
    pointer-events: none;
}
