:root {
    --infoq-red: #c8333a;
    --border-white: 2px solid #fff;
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.15);
}

html,
body {
    height: 100%;
    padding: 0;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
        Arial, sans-serif;
}

#map {
    z-index: 0;
    height: 100%;
}

.brand {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--infoq-red);
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.brand:hover {
    background: #fff;
}

.marker {
    width: 50px;
    height: 50px;
    background-size: cover;
    background-position: center;
    background-color: #eee;
    border-radius: 50%;
    cursor: pointer;
    border: var(--border-white);
    box-shadow: var(--shadow-md);
}

.cluster-marker {
    position: relative;
    pointer-events: none;
}

.cluster-grid {
    display: grid;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    border: var(--border-white);
    box-shadow: var(--shadow-md);
}

.cluster-image {
    background-size: cover;
    background-position: center;
    background-color: #eee;
}

.cluster-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: var(--infoq-red);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 10px;
    padding: 0 4px;
    border: var(--border-white);
    box-shadow: var(--shadow-md);
}

.maplibregl-popup-content {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 0;
    overflow: hidden;
    max-width: min(360px, 85vw);
}

.maplibregl-popup-close-button {
    font-size: 18px;
    color: #555;
    right: 8px;
    top: 8px;
    z-index: 1;
}

.maplibregl-popup-close-button:hover {
    color: #000;
    background: transparent;
}

.maplibregl-popup-tip {
    border-top-color: rgba(255, 255, 255, 0.92);
}

.popup-card {
    display: flex;
    align-items: center;
}

.popup-photo {
    width: 64px;
    height: 64px;
    background-size: cover;
    background-position: center;
    background-color: #eee;
    border-radius: 50%;
    flex-shrink: 0;
    margin: 14px 0 14px 14px;
    border: var(--border-white);
    box-shadow: var(--shadow-sm);
}

.popup-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.popup-name {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
    margin-bottom: 2px;
}

.popup-field {
    display: flex;
    gap: 8px;
    font-size: 12px;
    line-height: 1.4;
}

.popup-label {
    color: #888;
    flex-shrink: 0;
}

.popup-value {
    color: #333;
}

.popup-link {
    display: inline-block;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--infoq-red);
    text-decoration: none;
    transition: color 0.2s;
}

.popup-link:hover {
    color: #8a2227;
}

@media (max-width: 480px) {
    .popup-card {
        flex-direction: column;
    }
    .popup-photo {
        width: 72px;
        height: 72px;
        margin: 14px auto 0;
    }
}

.cluster-popup {
    width: min(320px, 85vw);
}

.cluster-popup-header {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 700;
    color: #1a1a1a;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.cluster-popup-list {
    max-height: 320px;
    overflow-y: auto;
}

.cluster-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background 0.15s;
}

.cluster-item:last-child {
    border-bottom: none;
}

.cluster-item:hover {
    background: rgba(200, 51, 58, 0.06);
}

.cluster-item-photo {
    width: 36px;
    height: 36px;
    background-size: cover;
    background-position: center;
    background-color: #eee;
    border-radius: 50%;
    flex-shrink: 0;
    border: var(--border-white);
    box-shadow: var(--shadow-sm);
}

.cluster-item-text {
    flex: 1;
    min-width: 0;
}

.cluster-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cluster-item-role {
    font-size: 11px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
