:root {
    color-scheme: light;
    --dm-map-ink: #232132;
    --dm-map-violet: #59365f;
    --dm-map-violet-dark: #3d2446;
    --dm-map-teal: #247b78;
    --dm-map-gold: #e2ad45;
}

html,
body {
    min-height: 100%;
    margin: 0;
    background: #dfe9e9;
    color: var(--dm-map-ink);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.dm-anonymous-map {
    position: relative;
    display: grid;
    grid-template-rows: minmax(300px, 1fr) auto;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
}

.dm-anonymous-map__title,
.dm-anonymous-map__cluster-list {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.dm-anonymous-map__status,
.dm-anonymous-map__privacy,
.dm-anonymous-map__notice {
    z-index: 800;
    margin: 0;
    background: rgba(255, 255, 255, .96);
    color: #4f5665;
    font-size: 13px;
    line-height: 1.45;
}

.dm-anonymous-map__status {
    position: absolute;
    top: 14px;
    left: 50%;
    max-width: min(520px, calc(100% - 150px));
    padding: 9px 14px;
    border: 1px solid rgba(84, 75, 91, .14);
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(31, 35, 48, .14);
    text-align: center;
    transform: translateX(-50%);
}

.dm-anonymous-map__status:empty {
    display: none;
}

.dm-anonymous-map__privacy {
    grid-row: 2;
    padding: 9px 14px;
    border-top: 1px solid #d9dee5;
    text-align: center;
}

.dm-anonymous-map__canvas {
    grid-row: 1;
    min-height: 300px;
    background:
        radial-gradient(circle at 50% 20%, rgba(75, 154, 148, .18), transparent 45%),
        #dce6e7;
}

.dm-anonymous-map__canvas.leaflet-container {
    background: #d2e6ea;
}

.dm-community-marker-icon {
    border: 0;
    background: transparent;
    filter: drop-shadow(0 9px 10px rgba(39, 24, 45, .22));
}

.dm-community-bubble {
    position: relative;
    display: flex;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: visible;
    border: 3px solid rgba(255, 255, 255, .96);
    border-radius: 50%;
    color: #fff;
    line-height: 1;
    text-align: center;
    transform-origin: center;
    animation: dm-map-bubble-arrive .28s cubic-bezier(.2, .78, .25, 1.18) both;
}

.dm-community-bubble::before {
    position: absolute;
    inset: -7px;
    border: 2px solid rgba(89, 54, 95, .2);
    border-radius: inherit;
    content: "";
    transition: border-color .18s ease, transform .18s ease;
}

.dm-community-bubble::after {
    position: absolute;
    top: 7px;
    left: 19%;
    width: 27%;
    height: 13%;
    border-radius: 50%;
    background: rgba(255, 255, 255, .24);
    content: "";
    transform: rotate(-22deg);
}

.dm-community-bubble--group {
    background: linear-gradient(145deg, #78507d 0%, var(--dm-map-violet) 48%, var(--dm-map-violet-dark) 100%);
    box-shadow: inset 0 -5px 10px rgba(37, 21, 43, .26), 0 0 0 1px rgba(62, 38, 70, .16);
    cursor: zoom-in;
}

.dm-community-bubble--area {
    background: linear-gradient(145deg, #36a49a 0%, var(--dm-map-teal) 48%, #195f62 100%);
    box-shadow: inset 0 -5px 10px rgba(12, 74, 73, .25), 0 0 0 1px rgba(24, 91, 91, .16);
    cursor: pointer;
}

.dm-community-bubble--area::before {
    border-color: rgba(36, 123, 120, .25);
}

.dm-community-bubble__number {
    position: relative;
    z-index: 1;
    max-width: calc(100% - 6px);
    font-size: clamp(10px, 1.5vw, 13px);
    font-weight: 850;
    letter-spacing: -.04em;
    white-space: nowrap;
}

.dm-community-bubble__dots {
    position: relative;
    z-index: 1;
    height: 7px;
    margin-top: 2px;
    color: rgba(255, 255, 255, .76);
    font-size: 8px;
    letter-spacing: 1px;
}

.dm-community-marker-icon:hover .dm-community-bubble,
.dm-community-marker-icon:focus .dm-community-bubble {
    transform: translateY(-2px) scale(1.07);
}

.dm-person-marker-icon {
    border: 0;
    background: transparent;
    filter: drop-shadow(0 7px 8px rgba(22, 30, 45, .28));
}

.dm-person-marker {
    position: relative;
    display: grid;
    width: 44px;
    height: 44px;
    box-sizing: border-box;
    place-items: center;
    border: 3px solid #fff;
    border-radius: 50% 50% 50% 14%;
    color: #fff;
    transform: rotate(-45deg);
    transition: transform .18s ease, box-shadow .18s ease;
}

.dm-person-marker::after {
    position: absolute;
    inset: -7px;
    border: 2px solid rgba(55, 81, 111, .2);
    border-radius: inherit;
    content: "";
}

.dm-person-marker--female {
    background: linear-gradient(145deg, #bd6798, #7d3e6a);
}

.dm-person-marker--male {
    background: linear-gradient(145deg, #568db8, #315f8a);
}

.dm-person-marker--unspecified {
    background: linear-gradient(145deg, #42a49d, #247b78);
}

.dm-person-marker__glyph {
    display: block;
    font-size: 20px;
    font-weight: 850;
    line-height: 1;
    transform: rotate(45deg);
}

.dm-person-marker-icon:hover .dm-person-marker,
.dm-person-marker-icon:focus .dm-person-marker {
    box-shadow: 0 0 0 4px var(--dm-map-gold);
    transform: rotate(-45deg) translate(2px, -2px) scale(1.08);
}

.dm-person-marker-icon:focus {
    outline: none;
}

.dm-person-popup {
    min-width: 230px;
}

.dm-person-popup__title {
    display: block;
    margin-bottom: 9px;
    color: var(--dm-map-violet-dark);
    font-size: 15px;
}

.dm-person-popup__details {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 4px 10px;
    margin: 0 0 9px;
    font-size: 12px;
}

.dm-person-popup__details dt {
    color: #626978;
    font-weight: 650;
}

.dm-person-popup__details dd {
    margin: 0;
    color: #252937;
    font-weight: 750;
}

.dm-person-popup__location,
.dm-person-popup__unavailable {
    margin: 0 0 10px;
    color: #68707d;
    font-size: 11px;
    line-height: 1.4;
}

.dm-person-popup__contact {
    display: flex;
    min-height: 44px;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    border-radius: 7px;
    background: var(--dm-map-violet);
    color: #fff !important;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
    text-decoration: none !important;
}

.dm-person-popup__contact:hover,
.dm-person-popup__contact:focus {
    background: var(--dm-map-teal);
}

.dm-person-popup__contact:focus {
    outline: 3px solid var(--dm-map-gold);
    outline-offset: 2px;
}

.dm-community-marker-icon:hover .dm-community-bubble::before,
.dm-community-marker-icon:focus .dm-community-bubble::before {
    border-color: rgba(226, 173, 69, .68);
    transform: scale(1.07);
}

.dm-community-marker-icon:focus {
    outline: none;
}

.dm-community-marker-icon:focus .dm-community-bubble {
    box-shadow: 0 0 0 4px var(--dm-map-gold), inset 0 -5px 10px rgba(37, 21, 43, .22);
}

.dm-map-popup {
    min-width: 210px;
}

.dm-map-popup__title {
    display: block;
    margin-bottom: 6px;
    color: var(--dm-map-violet-dark);
    font-size: 14px;
}

.dm-map-popup__area,
.dm-map-popup__privacy {
    margin: 0;
    color: #5f6675;
    font-size: 12px;
    line-height: 1.4;
}

.dm-map-popup__area {
    margin-bottom: 6px;
}

.dm-map-legend {
    display: grid;
    gap: 4px;
    max-width: 245px;
    padding: 10px 12px;
    border: 1px solid rgba(61, 36, 70, .12);
    border-radius: 10px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 8px 22px rgba(31, 35, 48, .16);
    color: #3c4050;
    backdrop-filter: blur(7px);
}

.dm-map-legend__row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dm-map-legend__sample {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    border: 2px solid #fff;
    border-radius: 50% 50% 50% 5px;
    background: linear-gradient(145deg, #568db8, #315f8a);
    box-shadow: 0 0 0 2px rgba(49, 95, 138, .19);
    transform: rotate(-45deg);
}

.dm-map-legend strong {
    font-size: 12px;
}

.dm-map-legend small {
    color: #686f7d;
    font-size: 11px;
    line-height: 1.3;
}

.dm-map-locate__button {
    display: block;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: #fff;
    color: var(--dm-map-violet-dark);
    font-size: 25px;
    font-weight: 800;
    line-height: 44px;
    cursor: pointer;
}

.dm-map-directory {
    margin-top: 2px;
}

.leaflet-container .dm-map-directory__link {
    display: inline-flex;
    min-height: 44px;
    box-sizing: border-box;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid rgba(61, 36, 70, .18);
    border-radius: 9px;
    background: rgba(62, 38, 70, .96);
    box-shadow: 0 8px 22px rgba(31, 20, 38, .24);
    color: #fff;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.2;
    text-decoration: none;
}

.leaflet-container .dm-map-directory__link span {
    font-size: 18px;
    line-height: 1;
}

.dm-map-directory__link:hover,
.dm-map-directory__link:focus {
    background: #2d7d79;
    color: #fff;
    text-decoration: none;
}

.dm-map-directory__link:focus {
    outline: 3px solid var(--dm-map-gold);
    outline-offset: 2px;
}

.dm-map-locate__button:hover {
    background: #f2edf3;
}

.dm-map-locate__button:focus {
    outline: 3px solid var(--dm-map-gold);
    outline-offset: 2px;
}

.leaflet-control-zoom a {
    color: var(--dm-map-violet-dark);
}

.leaflet-bottom.leaflet-left {
    bottom: 26px;
}

.leaflet-control-attribution {
    max-width: 58%;
    font-size: 9px;
    line-height: 1.25;
    text-align: right;
}

.leaflet-popup-content-wrapper {
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(31, 35, 48, .2);
}

@keyframes dm-map-bubble-arrive {
    from {
        opacity: 0;
        transform: scale(.72);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 560px) {
    .dm-anonymous-map__privacy {
        padding: 7px 10px;
        font-size: 11px;
    }

    .dm-map-legend {
        max-width: 190px;
        padding: 8px 10px;
    }

    .dm-map-legend small {
        display: none;
    }

    .dm-map-directory__link {
        max-width: 210px;
        padding: 9px 11px;
        font-size: 12px;
    }

    .leaflet-bottom.leaflet-left {
        bottom: 34px;
    }

    .leaflet-control-attribution {
        max-width: 62%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dm-community-bubble,
    .dm-community-bubble::before,
    .dm-person-marker,
    .leaflet-zoom-animated,
    .leaflet-fade-anim .leaflet-popup {
        animation: none !important;
        transition: none !important;
    }
}
