body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

#map {
    height: 100vh;
    width: 100%;
}

.map-key {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 600;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    max-width: 300px;
    font-size: 12px;
}

.map-key h4 {
    margin: 0 0 8px 0;
    font-size: 13px;
}

.map-key-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.map-key-item+.map-key-item {
    margin-top: 5px;
}

.map-key-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: 0 0 10px;
    border: 1px solid rgba(0, 0, 0, 0.25);
}

.map-key-dot-blue {
    background: #0072B2;
}

.map-key-dot-red {
    background: #E69F00;
}

.map-key-dot-purple {
    background: #CC79A7;
}

.attribution-notice {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: white;
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 12px;
    z-index: 400;
}

.attribution-notice a {
    color: #0078d4;
    text-decoration: none;
}

.attribution-notice a:hover {
    text-decoration: underline;
}

.panel {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 10px;
    z-index: 500;
    background-color: white;
    width: 80%;
    max-width: 760px;
    min-height: 50px;
    margin: 0;
    padding: 10px;
    box-sizing: border-box;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.panel-actions {
    margin-top: 10px;
    display: flex;
    justify-content: center;
}

.add-scholar-btn {
    display: inline-block;
    text-decoration: none;
    border: 1px solid #0a66d9;
    background: #0a66d9;
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}

.add-scholar-btn:hover {
    background: #0857b8;
    border-color: #0857b8;
}

.filter-btn {
    border: 1px solid #c7c7c7;
    background: #f5f5f5;
    color: #1f1f1f;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.filter-btn:hover {
    background: #e9e9e9;
}

.filter-btn.is-active {
    background: #0a66d9;
    border-color: #0a66d9;
    color: white;
}

.popup-name-btn,
.popup-back-btn {
    display: block;
    width: 100%;
    text-align: left;
    border: 1px solid transparent;
    background: transparent;
    color: #1f1f1f;
    padding: 6px 8px;
    cursor: pointer;
    font: inherit;
    border-radius: 8px;
}

.popup-name-btn:hover,
.popup-back-btn:hover {
    background: #f3f6fb;
    border-color: #d5e4ff;
}

.popup-back-btn {
    margin: 12px auto 0;
    width: fit-content;
    color: #111;
    font-weight: 600;
    padding: 5px 9px;
}

.popup-back-chevron {
    font-size: 20px;
    line-height: 1;
    vertical-align: -2px;
    margin-right: 4px;
}

.popup-name-list {
    margin-top: 10px;
}

.popup-name-list .popup-name-btn+.popup-name-btn {
    margin-top: 1px;
}

.popup-name-role {
    display: inline-block;
    margin-left: 8px;
    font-size: 12px;
    color: #666;
}

.grouped-scholars-popup .leaflet-popup-content {
    margin: 12px 14px;
}

@media (max-width: 640px) {
    .panel {
        bottom: 10px;
    }

    .filter-buttons {
        flex-wrap: nowrap;
        gap: 6px;
    }

    .filter-btn {
        flex: 1 1 0;
        min-width: 0;
        padding: 8px 6px;
        font-size: 12px;
        white-space: nowrap;
    }

    .panel-actions {
        margin-top: 8px;
    }
}