/* Shared layer renderer: Admin map, Public map, legend, and style preview. */

.pm-layer-marker-shell {
    border: 0 !important;
    background: transparent !important;
    overflow: visible !important;
}

.pm-layer-symbol-host {
    min-width: 28px;
    min-height: 22px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.pm-layer-symbol-host::before,
.pm-layer-symbol-host::after {
    display: none !important;
}

.pm-layer-marker {
    --pm-marker-size: 32px;
    --pm-marker-color: #166534;
    --pm-icon-color: #fff;
    position: relative;
    width: var(--pm-marker-size);
    height: var(--pm-marker-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border: 2px solid rgba(255, 255, 255, .96);
    background: var(--pm-marker-color);
    color: var(--pm-icon-color);
    box-shadow: 0 3px 9px rgba(15, 23, 42, .28);
    transition: transform .16s ease, filter .16s ease;
}

.pm-layer-marker--circle {
    border-radius: 50%;
}

.pm-layer-marker--square {
    border-radius: 7px;
}

.pm-layer-marker--pin {
    border-radius: 50% 50% 50% 8%;
    transform: rotate(-45deg);
}

.pm-layer-marker--pin > .pm-layer-icon {
    transform: rotate(45deg);
}

.pm-layer-icon {
    --pm-icon-size: 18px;
    width: var(--pm-icon-size);
    height: var(--pm-icon-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    line-height: 1;
}

.pm-layer-icon__online {
    display: none;
    width: var(--pm-icon-size);
    height: var(--pm-icon-size);
    overflow: hidden;
    font-family: "Material Symbols Outlined";
    font-size: var(--pm-icon-size);
    font-style: normal;
    font-weight: 400;
    font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: "liga";
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "liga";
}

.pm-layer-icon__fallback {
    width: var(--pm-icon-size);
    height: var(--pm-icon-size);
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pm-material-symbols-ready .pm-layer-icon__online {
    display: inline-block;
}

.pm-material-symbols-ready .pm-layer-icon__fallback {
    display: none;
}

.pm-layer-icon-badge {
    --pm-badge-size: 28px;
    --pm-badge-color: #166534;
    --pm-icon-color: #fff;
    width: var(--pm-badge-size);
    height: var(--pm-badge-size);
    flex: 0 0 var(--pm-badge-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, .88);
    border-radius: 8px;
    background: var(--pm-badge-color);
    color: var(--pm-icon-color);
    box-shadow: 0 1px 4px rgba(15, 23, 42, .2);
}

.feature-hover .pm-layer-marker,
.pm-layer-marker-shell:hover .pm-layer-marker {
    filter: brightness(1.06);
    transform: scale(1.08);
}

.feature-hover .pm-layer-marker--pin,
.pm-layer-marker-shell:hover .pm-layer-marker--pin {
    transform: rotate(-45deg) scale(1.08);
}

.wg-feature-selected .pm-layer-marker,
.pm-layer-marker.is-highlighted {
    filter: brightness(1.08);
    outline: 3px solid rgba(15, 118, 110, .28);
    outline-offset: 2px;
}

.pm-layer-legend {
    position: relative;
    width: 28px;
    height: 22px;
    flex: 0 0 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.pm-layer-legend--point .pm-layer-marker {
    box-shadow: 0 2px 5px rgba(15, 23, 42, .2);
}

.pm-layer-legend--line::before {
    content: "";
    width: 26px;
    border-top: max(2px, var(--pm-stroke-width)) solid var(--pm-stroke-color);
}

.pm-layer-legend--line[style*="--pm-dash:dash"]::before {
    border-top-style: dashed;
}

.pm-layer-legend--line[style*="--pm-dash:dot"]::before {
    border-top-style: dotted;
}

.pm-layer-legend--line[style*="--pm-dash:dash-dot"]::before {
    height: max(2px, var(--pm-stroke-width));
    border: 0;
    background: repeating-linear-gradient(
        90deg,
        var(--pm-stroke-color) 0 8px,
        transparent 8px 12px,
        var(--pm-stroke-color) 12px 14px,
        transparent 14px 19px
    );
}

.pm-layer-legend--polygon {
    width: 24px;
    height: 18px;
    border: max(1px, var(--pm-stroke-width)) solid var(--pm-stroke-color);
    border-radius: 3px;
    background: color-mix(in srgb, var(--pm-fill-color) calc(var(--pm-fill-opacity) * 100%), transparent);
}

@supports not (background: color-mix(in srgb, #000 50%, transparent)) {
    .pm-layer-legend--polygon {
        background: var(--pm-fill-color);
        opacity: max(.18, var(--pm-fill-opacity));
    }
}

.pm-layer-legend--raster {
    width: 24px;
    height: 18px;
    border: 1px solid rgba(15, 23, 42, .2);
    border-radius: 3px;
    background:
        linear-gradient(135deg, transparent 45%, rgba(255, 255, 255, .78) 45% 55%, transparent 55%),
        var(--pm-raster-color);
}

.pm-layer-preview {
    min-height: 116px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    overflow: hidden;
    border: 1px solid #dce7df;
    border-radius: 12px;
    background-color: #f8fbf9;
    background-image:
        linear-gradient(rgba(22, 101, 52, .04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(22, 101, 52, .04) 1px, transparent 1px);
    background-size: 18px 18px;
}

.pm-layer-preview__symbol {
    min-width: 60px;
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pm-layer-preview__items {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 22px;
}

.pm-layer-preview__item {
    min-width: 76px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.pm-layer-preview__item small {
    color: #64748b;
    font-size: 8px;
    font-weight: 700;
}

.pm-layer-preview__caption {
    max-width: calc(100% - 24px);
    overflow: hidden;
    color: #475569;
    font-size: 10px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
    .pm-layer-marker {
        transition: none;
    }
}
