/**
 * Homepage map, markers, popups & layout (index only)
 */
#daycare-map {
            height: 600px;
            width: 100%;
            border-radius: 16px;
            z-index: 1;
        }

        .map-section {
            position: relative;
        }

        .map-canvas-wrap {
            position: relative;
            border-radius: 16px;
            overflow: hidden;
        }

        .map-canvas-wrap #daycare-map {
            position: relative;
            z-index: 1;
        }

        .map-legend {
            position: absolute;
            bottom: 12px;
            right: 12px;
            left: auto;
            top: auto;
            background: rgba(255, 255, 255, 0.96);
            padding: 10px 12px;
            border-radius: 12px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
            z-index: 1000;
            font-size: 12px;
            max-width: min(11rem, calc(100% - 1.5rem));
            pointer-events: none;
        }

        @media (max-width: 640px) {
            .map-canvas-wrap .map-legend {
                bottom: 8px;
                right: 8px;
                top: auto;
                left: auto;
                max-width: min(10.5rem, calc(100% - 1.5rem));
                padding: 8px 10px;
                font-size: 11px;
            }

            .map-legend-grid {
                gap: 0.25rem;
            }
        }

        /* Institution detail modal - must be above everything */
        #institution-modal {
            position: fixed !important;
            inset: 0 !important;
            z-index: 999999 !important;
        }
        
        #institution-modal > div {
            z-index: 1000000 !important;
        }
        
        /* Ensure Leaflet popups are above map but below modal */
        .leaflet-popup {
            z-index: 1000 !important;
        }
        .leaflet-popup-pane {
            z-index: 1000 !important;
        }

        .map-legend-item {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 0;
            line-height: 1.35;
            white-space: nowrap;
        }

        .map-legend-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 0.35rem;
        }

        .map-legend-attribution {
            margin-top: 0.45rem;
            padding-top: 0.45rem;
            border-top: 1px solid #e2e8f0;
            font-size: 0.62rem;
            color: #94a3b8;
            line-height: 1.35;
        }

        .map-legend-dot {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            border: 1px solid rgba(0, 0, 0, 0.6);
        }

        .leaflet-popup-content-wrapper {
            border-radius: 12px !important;
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12) !important;
        }

        .leaflet-popup-content {
            margin: 14px 18px !important;
            font-family: "Inter", system-ui, -apple-system, sans-serif;
            line-height: 1.5;
        }

        .leaflet-popup-content strong {
            color: #1e3a8a;
        }

        .popup-address svg,
        .popup-detail-row svg,
        .popup-btn-call svg {
            width: 14px !important;
            height: 14px !important;
            flex-shrink: 0;
            display: inline-block;
        }

        .popup-btn-call svg {
            width: 16px !important;
            height: 16px !important;
        }

        .popup-name {
            font-weight: 700;
            font-size: 16px;
            color: #1e293b;
            margin-bottom: 2px;
            line-height: 1.2;
        }

        .popup-address {
            color: #64748b;
            font-size: 13px;
            margin-bottom: 12px;
            display: flex;
            align-items: flex-start;
            gap: 6px;
            line-height: 1.4;
        }

        .popup-badge {
            display: inline-block;
            padding: 2px 8px;
            border-radius: 8px;
            font-size: 11px;
            font-weight: 600;
            margin-right: 4px;
            margin-bottom: 4px;
        }

        .popup-badge-green {
            background: #dcfce7;
            color: #166534;
        }

        .popup-badge-red {
            background: #fef2f2;
            color: #991b1b;
        }

        .popup-badge-type {
            background: #f5f3ff;
            color: #7c3aed;
        }

        .popup-detail-row {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 13px;
            color: #475569;
            margin-bottom: 6px;
        }

        .popup-detail-row svg {
            width: 14px;
            height: 14px;
            color: #94a3b8;
        }

        .popup-stars {
            color: #f59e0b;
            letter-spacing: 1px;
        }

        .popup-btn-call {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            width: 100%;
            padding: 8px;
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 600;
            color: #1e293b;
            margin-top: 10px;
            text-decoration: none !important;
            transition: all 0.2s;
        }

        .popup-btn-call:hover {
            background: #f1f5f9;
            border-color: #cbd5e1;
        }

        .leaflet-popup-content .popup-btn-save,
        .leaflet-popup-content a[href*="favorites"] {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            width: 100%;
            margin-top: 8px;
            padding: 10px 12px;
            border-radius: 10px;
            background: #79ad87;
            color: #ffffff !important;
            font-size: 13px;
            font-weight: 700;
            text-decoration: none !important;
            border: none;
            cursor: pointer;
            transition: background 150ms ease;
        }

        .leaflet-popup-content .popup-btn-save:hover,
        .leaflet-popup-content a[href*="favorites"]:hover {
            background: #6a9d79;
        }

        .map-filter-bar {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            margin-bottom: 16px;
        }

        .map-filter-btn {
            padding: 6px 16px;
            border-radius: 20px;
            border: 1px solid #e2e8f0;
            background: white;
            font-size: 13px;
            cursor: pointer;
            transition: all 0.2s;
            font-weight: 500;
        }

        .map-filter-btn:hover {
            border-color: #3b82f6;
            color: #3b82f6;
        }

        .map-filter-btn.active {
            background: #3b82f6;
            color: white;
            border-color: #3b82f6;
        }

        /* Milo above pill — reserved padding in slot so overflow-x scroll does not clip */
        .nearby-milo-slot {
            display: inline-flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-end;
            flex-shrink: 0;
            position: relative;
            padding-top: 2.15rem;
            vertical-align: bottom;
        }

        .nearby-milo-peek {
            position: absolute;
            top: 0;
            left: 50%;
            width: 40px;
            height: 2.15rem;
            transform: translateX(-50%);
            flex-shrink: 0;
            pointer-events: none;
            z-index: 2;
            margin: 0;
            overflow: visible;
        }

        .nearby-milo-peek > picture {
            position: absolute;
            left: 50%;
            bottom: 0.2rem;
            transform: translateX(-50%);
            display: block;
            width: 36px;
            height: 36px;
            line-height: 0;
        }

        .nearby-milo {
            display: block;
            width: 36px;
            height: 36px;
            max-width: 36px;
            max-height: 36px;
            object-fit: contain;
            pointer-events: none;
            transition: opacity 0.2s ease;
        }

        .nearby-milo-wave {
            opacity: 0;
        }

        .nearby-milo-slot:hover .nearby-milo-adore {
            opacity: 0;
        }

        .nearby-milo-slot:hover .nearby-milo-wave {
            opacity: 1;
        }

        .nearby-milo-btn {
            position: relative;
            z-index: 1;
        }

        .nearby-milo-btn .nearby-label {
            line-height: 1.2;
        }

        .milo-inline-video {
            display: block;
            width: 72px;
            height: 72px;
            object-fit: contain;
            margin: 0 auto 16px;
            pointer-events: none;
        }

        .milo-map-title-video {
            display: block;
            width: 64px;
            height: 64px;
            object-fit: contain;
            margin: 0 auto 8px;
            pointer-events: none;
        }

        .user-location-icon {
            background: transparent !important;
            border: none !important;
            cursor: pointer;
        }

        .user-location-marker {
            position: relative;
            width: 40px;
            height: 40px;
        }

        .user-location-face {
            position: absolute;
            inset: 0;
            background-position: center;
            background-size: contain;
            background-repeat: no-repeat;
            transition: opacity 0.2s ease, transform 0.2s ease;
        }

        .user-location-face--base {
            background-image: url(/assets/img/milo.webp);
        }

        .user-location-face--hover {
            background-image: url(milo-thumbs-hover.png);
            opacity: 0;
        }

        .leaflet-marker-icon.user-location-icon:hover .user-location-face--base {
            opacity: 0;
            transform: translateY(-2px);
        }

        .leaflet-marker-icon.user-location-icon:hover .user-location-face--hover {
            opacity: 1;
            transform: translateY(-2px);
        }

        .map-counter {
            background: linear-gradient(135deg, #3b82f6, #6366f1);
            color: white;
            padding: 8px 16px;
            border-radius: 12px;
            font-size: 13px;
            font-weight: 600;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }

        .btn-dot {
            display: inline-block;
            width: 10px;
            height: 10px;
            border-radius: 50%;
            margin-right: 4px;
            vertical-align: middle;
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        .custom-marker {
            background: none !important;
            border: none !important;
        }

        .marker-dot {
            width: 14px;
            height: 14px;
            border-radius: 50%;
            border: 1.5px solid rgba(0, 0, 0, 0.6);
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
            transition: all 0.2s ease;
        }

        .filter-dot {
            display: inline-block;
            width: 12px;
            height: 12px;
            border-radius: 50%;
            border: 1.2px solid rgba(0, 0, 0, 0.6);
            margin-right: 6px;
            vertical-align: middle;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
        }

        .filter-dot--status,
        .map-legend-dot--status {
            background: #94a3b8;
        }

        .filter-dot--vuggestue,
        .map-legend-dot--vuggestue {
            background: #0d9488;
        }

        .filter-dot--bornehave,
        .map-legend-dot--bornehave {
            background: #2563eb;
        }

        .filter-dot--dagpleje,
        .map-legend-dot--dagpleje {
            background: #ea580c;
        }

        .map-legend-dot--user {
            background: linear-gradient(135deg, #3b82f6, #6366f1);
            border: 2px solid #fff;
            box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35);
        }

        .map-filter-btn:disabled {
            opacity: 0.55;
            cursor: not-allowed;
        }

        .map-filter-btn:disabled:hover {
            border-color: #e2e8f0;
            color: inherit;
        }

        #advanced-filters {
            border-radius: 14px;
            border: 1px solid #e2e8f0;
            background: rgba(248, 250, 252, 0.9);
        }

        .map-section .text-3xl {
            font-size: 1.75rem;
            font-weight: 800;
            color: #0f172a;
            letter-spacing: -0.02em;
        }

        .institution-modal-overlay {
            position: fixed;
            inset: 0;
            z-index: 99999;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 16px;
            background: rgba(15, 23, 42, 0.45);
            backdrop-filter: blur(4px);
        }

        .institution-modal-panel {
            position: relative;
            z-index: 100000;
            border: 1px solid #e2e8f0 !important;
            border-radius: 20px !important;
            box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18) !important;
        }

        .institution-modal-overlay .institution-modal-panel h2,
        .institution-modal-overlay .institution-modal-panel h3 {
            color: #172033;
            letter-spacing: -0.01em;
        }

        .institution-modal-overlay button.rounded-full {
            border-radius: 999px;
            transition: background 0.15s ease;
        }

        .institution-modal-overlay a.bg-blue-600,
        .institution-modal-overlay button.bg-\[\#79ad87\] {
            border-radius: 12px !important;
            font-weight: 700;
        }

        .institution-modal-panel .p-6 > h2 {
            line-height: 1.2;
        }

        .institution-modal-panel dl dt {
            font-size: 0.72rem;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            color: #64748b;
        }

        .institution-modal-panel dl dd {
            margin-bottom: 0.5rem;
            color: #334155;
        }

        .leaflet-popup-content-wrapper {
            min-width: 220px;
        }

        .leaflet-popup-content .popup-btn-save,
        .leaflet-popup-content button[onclick*="showInstitutionDetails"] {
            border-radius: 10px !important;
            min-height: 40px;
        }

        .marker-cluster-small {
            background-color: rgba(59, 130, 246, 0.2) !important;
        }

        .marker-cluster-small div {
            background-color: #3b82f6 !important;
            color: white !important;
            font-weight: 600;
        }

        .marker-cluster-medium {
            background-color: rgba(99, 102, 241, 0.2) !important;
        }

        .marker-cluster-medium div {
            background-color: #6366f1 !important;
            color: white !important;
            font-weight: 600;
        }

        .marker-cluster-large {
            background-color: rgba(139, 92, 246, 0.2) !important;
        }

        .marker-cluster-large div {
            background-color: #8b5cf6 !important;
            color: white !important;
            font-weight: 600;
        }

        /* Fix for overlapping status badges in institution cards */
        h3.font-semibold.tracking-tight {
            margin-top: 20px !important;
            display: block !important;
        }

        /* User location marker — no pulse ring */
        .user-location-marker::after {
            content: none;
        }

        .leaflet-marker-icon.user-location-icon {
            width: 40px !important;
            height: 40px !important;
            background: transparent !important;
            border: none !important;
        }

        /* Search Loader Overlay */
        #search-loader {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: #ffffff;
            z-index: 9999;
            display: none;
            align-items: center;
            justify-content: center;
            flex-direction: column;
            opacity: 0;
        }

        #search-loader.active {
            display: flex;
            opacity: 1;
        }

        #search-loader.fade-out {
            transition: opacity 0.3s ease;
            opacity: 0;
        }

        .loader-spinner {
            width: 48px;
            height: 48px;
            border: 4px solid #e2e8f0;
            border-top: 4px solid #3b82f6;
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
            margin-bottom: 20px;
        }

        @keyframes spin {
            to {
                transform: rotate(360deg);
            }
        }

        .loader-text {
            font-size: 16px;
            font-weight: 600;
            color: #1e293b;
            margin-bottom: 6px;
            transition: opacity 0.2s ease;
        }

        .loader-subtext {
            font-size: 13px;
            color: #94a3b8;
        }

        .loader-progress {
            width: 200px;
            height: 4px;
            background: #e2e8f0;
            border-radius: 4px;
            margin-top: 16px;
            overflow: hidden;
        }

        .loader-progress-bar {
            height: 100%;
            background: linear-gradient(90deg, #3b82f6, #6366f1);
            border-radius: 4px;
            width: 100%;
            transform-origin: left;
            transform: scaleX(0);
        }

        .loader-progress-bar.animate {
            animation: progressFill 1.5s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
        }

        @keyframes progressFill {
            0% {
                transform: scaleX(0);
            }

            20% {
                transform: scaleX(0.55);
            }

            50% {
                transform: scaleX(0.75);
            }

            80% {
                transform: scaleX(0.88);
            }

            100% {
                transform: scaleX(0.95);
            }
        }

        .loader-skeleton {
            display: flex;
            gap: 16px;
            margin-top: 32px;
            padding: 0 16px;
        }

        .skeleton-card {
            width: 200px;
            height: 120px;
            border-radius: 12px;
            background: #e2e8f0;
            position: relative;
            overflow: hidden;
            will-change: transform;
            transform: translate3d(0, 0, 0);
        }

        .skeleton-card::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 200%;
            height: 100%;
            background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.4) 30%, rgba(255, 255, 255, 0.7) 50%, rgba(255, 255, 255, 0.4) 70%, transparent 100%);
            animation: shimmer 0.9s ease-in-out infinite;
            will-change: transform;
            transform: translate3d(-100%, 0, 0);
        }

        @keyframes shimmer {
            0% {
                transform: translate3d(-100%, 0, 0);
            }

            100% {
                transform: translate3d(100%, 0, 0);
            }
        }

        @media (max-width: 640px) {
            .loader-skeleton {
                display: none;
            }

            .skeleton-card {
                width: 140px;
                height: 90px;
            }
        }

        /* Sponsored badge (Premium Blue Design) */
        .badge-sponsored {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            background: linear-gradient(135deg, #2563eb, #1e40af);
            color: white;
            font-size: 13px;
            font-weight: 700;
            padding: 6px 16px;
            border-radius: 8px;
            letter-spacing: 0.5px;
            text-transform: uppercase;
            box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
            margin-top: 18px !important;
            margin-bottom: 8px !important;
        }

        .badge-sponsored img {
            width: 20px;
            height: 20px;
            border-radius: 50%;
            object-fit: cover;
            border: 2px solid rgba(255, 255, 255, 0.8);
            background: white;
        }

        /* Affiliate partner cards */
        .partner-section {
            padding: 80px 0;
        }

        @media (min-width: 768px) {
            .partner-section {
                padding: 96px 0;
            }
        }

        .partner-card {
            background: white;
            border-radius: 16px;
            padding: 28px 24px;
            border: 1px solid #e5e7eb;
            transition: all 0.2s ease;
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
        }

        .partner-card:hover {
            border-color: #93c5fd;
            box-shadow: 0 8px 24px rgba(59, 130, 246, 0.12);
            transform: translateY(-2px);
        }

        .partner-icon {
            width: 56px;
            height: 56px;
            border-radius: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 0 16px;
            font-size: 28px;
        }

        .partner-cta {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            margin-top: 16px;
            padding: 10px 20px;
            background: #3b82f6;
            color: white;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 600;
            text-decoration: none;
            transition: all 0.2s;
        }

        .partner-cta:hover {
            background: #2563eb;
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
        }

/* Hide redundant map and toggle in results section */
        div.flex.bg-gray-100.rounded-lg.p-1 {
            display: none !important;
        }

        .order-last.lg\:order-none.col-span-1.hidden.lg\:block {
            display: none !important;
        }

        /* Ensure list takes full width when map is hidden */
        .lg\:col-span-3 {
            grid-column: span 3 / span 3 !important;
        }

@keyframes fadeInUp {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Homepage search + language (no Tailwind bundle) */
.site-ui.homepage .home-search-card .absolute.left-3.top-1\/2,
.site-ui.homepage .home-search-card .absolute.left-3 {
    top: 50%;
    left: 0.75rem;
    transform: translateY(-50%);
}

.site-ui.homepage .home-search-card select.pl-10 {
    padding-left: 2.5rem;
}

.site-ui.homepage .home-search-card .h-4.w-4 {
    width: 1rem;
    height: 1rem;
}

.site-ui.homepage #lang-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.25rem;
    width: 9rem;
    background: #fff;
    border: 1px solid #f3f4f6;
    border-radius: 0.5rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
    padding: 0.25rem 0;
    z-index: 50;
}

.site-ui.homepage #lang-menu a {
    display: block;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: #374151;
}

.site-ui.homepage #lang-menu a:hover {
    background: #f9fafb;
}

.site-ui.homepage #daycare-list-grid > .institution-list-card-animate {
    animation: fadeInUp 0.35s ease both;
}

.site-ui.homepage #daycare-list-grid > div {
    animation: fadeInUp 0.35s ease both;
}

/* Institution modal panel */
#institution-modal > div {
    background: #fff;
    border-radius: 1rem;
    max-width: 28rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(15, 23, 42, 0.2);
}

#institution-modal .p-6 {
    padding: 1.5rem;
}

#institution-modal h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

#institution-modal .rounded-xl {
    border-radius: 0.75rem;
}

#institution-modal a.bg-blue-600,
#institution-modal a[class*="bg-blue-600"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border-radius: 0.5rem;
    font-weight: 700;
    text-decoration: none;
}

#institution-modal .flex.gap-3.mt-6 {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

#institution-modal .institution-application-path {
    margin: 1rem 0;
    padding: 1rem 1.1rem;
    border-radius: 12px;
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
}

#institution-modal .institution-application-path h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    color: #172033;
}

#institution-modal .institution-application-path p {
    margin: 0 0 0.75rem;
    font-size: 0.88rem;
    color: #166534;
    line-height: 1.55;
}

#institution-modal .match-signal-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0 0.75rem;
}

#institution-modal .match-signal {
    display: inline-flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.45rem 0.65rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 0.78rem;
    line-height: 1.35;
}

#institution-modal .match-signal strong {
    color: #172033;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.site-ui.homepage .home-search-card button.bg-\[\#79ad87\],
.site-ui.homepage .home-search-card button[class*="79ad87"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    padding: 0 1.5rem;
    border: none;
    border-radius: 0.75rem;
    background: #79ad87;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.site-ui.homepage .home-search-card button.bg-\[\#79ad87\]:hover {
    background: #6a9d79;
}

/* Institution list cards (renderList) */
.site-ui.homepage #daycare-list-grid > .institution-list-card,
.site-ui.homepage #daycare-list-grid > div.bg-white {
    border-radius: 20px !important;
    transition: box-shadow 0.28s ease, border-color 0.28s ease, transform 0.28s ease;
}

.site-ui.homepage #daycare-list-grid > div.bg-white:hover,
.site-ui.homepage #daycare-list-grid > .institution-list-card:hover {
    transform: translateY(-3px);
}

.site-ui.homepage #daycare-list-grid h3.font-bold,
.site-ui.homepage #daycare-list-grid .institution-list-card h3 {
    color: var(--mb-navy, #172033) !important;
    letter-spacing: -0.01em;
}

.site-ui.homepage #daycare-list-grid .rounded-lg.bg-green-50 {
    background: #f0fdf4 !important;
    border: 1px solid #bbf7d0;
}

.site-ui.homepage #daycare-list-grid .rounded-lg.bg-blue-50 {
    background: #eff6ff !important;
    border: 1px solid #bfdbfe;
}