.poi-layer {
    position: absolute;
    inset: 0;
    z-index: 3;
    overflow: visible;
    pointer-events: none;
}

.poi {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
}

.poi-hidden {
    display: none;
}

.poi-line {
    position: absolute;
    left: 0;
    top: 0;
    height: 1.5px;
    transform-origin: 0 50%;
    background: rgba(255, 255, 255, .78);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .8);
    pointer-events: none;
}

.poi-marker {
    --poi-color: #444;
    position: absolute;
    width: max-content;
    min-width: 0;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    background: transparent;
    cursor: default;
    pointer-events: auto;
    transform-origin: 50% 100%;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .75));
    white-space: nowrap;
}

.poi-marker.poi-has-details {
    cursor: pointer;
}

.poi-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    display: grid;
    place-items: center;
    border: 2px solid rgba(255, 255, 255, .94);
    border-radius: 50%;
    background: var(--poi-color);
}

.poi-icon svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
}

.poi-label {
    display: block;
    max-width: 240px;
    padding: 5px 9px 5px 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: 5px;
    background: color-mix(in srgb, var(--poi-color) 88%, #000 12%);
    font-size: 13px;
    font-weight: 600;
    line-height: 18px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .65);
}

.poi-pin-only .poi-label {
    display: none;
}

.poi-popup {
    position: absolute;
    z-index: 30;
    width: min(420px, calc(100% - 24px));
    max-height: min(560px, calc(100% - 24px));
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .17);
    border-radius: 12px;
    color: #fff;
    background: rgba(10, 10, 10, .94);
    box-shadow: 0 14px 44px rgba(0, 0, 0, .55);
    backdrop-filter: blur(12px);
    user-select: text;
    pointer-events: auto;
    animation: poi-popup-in 160ms ease-out;
}

    .poi-popup a,
    .poi-popup button {
        pointer-events: auto;
    }

.poi-detail-link {
    cursor: pointer;
}

.poi-popup-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 12px 8px 14px;
}

.poi-popup-title {
    flex: 1;
    min-width: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.25;
}

.poi-popup-close {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, .10);
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
}

.poi-popup-content {
    max-height: 480px;
    overflow: auto;
    padding: 0 14px 14px;
    overscroll-behavior: contain;
}

.poi-detail-text {
    margin: 7px 0 10px;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.poi-detail-image,
.poi-detail-video {
    display: block;
    width: 100%;
    margin: 10px 0;
    border: 0;
    border-radius: 8px;
    background: #000;
}

.poi-detail-image {
    height: auto;
    max-height: 280px;
    object-fit: contain;
}

.poi-detail-video {
    aspect-ratio: 16 / 9;
}

.poi-detail-link {
    display: block;
    margin-top: 10px;
    overflow-wrap: anywhere;
    color: #8ec8ff;
    font-size: 13px;
}

@keyframes poi-popup-in {
    from { opacity: 0; transform: translateY(5px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 640px), (hover: none), (pointer: coarse) {
    .poi-popup {
        left: 12px !important;
        right: 12px;
        bottom: 82px;
        top: auto !important;
        width: auto;
        max-height: min(62%, 520px);
    }

    .poi-popup-content {
        max-height: calc(62vh - 65px);
    }

    .poi-marker {
        min-height: 34px;
    }

    .poi-icon {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
    }
}
