.app-property-map {
    border: 1px solid color-mix(in srgb, var(--app-border-color, #dfe3ee) 86%, var(--app-primary, #ff6f3c));
    border-radius: 12px;
    background: color-mix(in srgb, var(--app-surface, #ffffff) 94%, var(--app-primary, #ff6f3c));
    overflow: hidden;
}

.app-property-map__header,
.app-property-map__footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
}

.app-property-map__header {
    border-bottom: 1px solid var(--app-border-color, #e7e9f2);
}

.app-property-map__footer {
    border-top: 1px solid var(--app-border-color, #e7e9f2);
    flex-wrap: wrap;
}

.app-property-map__eyebrow {
    display: block;
    margin-bottom: 4px;
    color: var(--app-primary, #ff6f3c);
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.app-property-map__title {
    margin: 0;
    color: var(--app-heading-color, #181d4e);
    font-size: 1rem;
    font-weight: 700;
}

.app-property-map__help {
    margin: 6px 0 0;
    max-width: 64ch;
    color: var(--app-muted-color, #697386);
    font-size: .92rem;
}

.app-property-map__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.app-property-map__canvas {
    position: relative;
    min-height: 380px;
    width: 100%;
    background:
        linear-gradient(135deg, rgba(255, 111, 60, .08), rgba(24, 29, 78, .04)),
        color-mix(in srgb, var(--app-surface-muted, #f7f8fb) 90%, var(--app-primary, #ff6f3c));
}

.app-property-map__canvas .leaflet-container {
    font-family: inherit;
}

.app-property-map__empty {
    display: grid;
    min-height: 180px;
    place-items: center;
    gap: 10px;
    padding: 24px;
    color: var(--app-muted-color, #697386);
    text-align: center;
}

.app-property-map__empty span {
    color: var(--app-primary, #ff6f3c);
    font-size: 2.1rem;
    line-height: 1;
}

.app-property-map__empty strong {
    color: var(--app-heading-color, #181d4e);
    font-size: .95rem;
}

.app-property-map__status {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    border-radius: 999px;
    padding: 7px 12px;
    background: color-mix(in srgb, var(--app-primary, #ff6f3c) 10%, var(--app-surface, #ffffff));
    color: var(--app-heading-color, #181d4e);
    font-size: .88rem;
    font-weight: 600;
}

.app-property-map__status.is-error {
    background: color-mix(in srgb, #dc3545 12%, var(--app-surface, #ffffff));
    color: #b42318;
}

.app-property-map__coordinates {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.app-property-map__coordinate {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--app-border-color, #e7e9f2);
    border-radius: 999px;
    padding: 7px 11px;
    background: var(--app-surface, #ffffff);
    color: var(--app-muted-color, #697386);
    font-size: .84rem;
}

.app-property-map__coordinate strong {
    color: var(--app-heading-color, #181d4e);
    font-weight: 700;
}

.app-property-map--template,
.app-property-map--inline {
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
    padding: 0 !important;
}

.app-property-map--template .app-property-map__canvas,
.app-property-map--inline .app-property-map__canvas {
    overflow: hidden;
    border: 1px solid var(--app-border-color, #e7e9f2);
    background: #eef2f6;
}

.app-property-map--template .app-property-map__canvas {
    height: 550px;
    min-height: 550px;
}

.app-property-map--inline .app-property-map__canvas,
.app-property-map--inline .app-property-map__empty {
    height: 250px;
    min-height: 250px;
}

.app-property-map__footer--template,
.app-property-map__inline-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px 0 0;
    border: 0;
    background: transparent;
}

.app-property-map__feedback {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.app-coordinate-grid {
    border: 1px solid var(--app-border-color, #e7e9f2);
    border-radius: 12px;
    padding: 20px 20px 0;
    background: color-mix(in srgb, var(--app-surface, #ffffff) 96%, var(--app-primary, #ff6f3c));
}

.app-coordinate-grid__title {
    margin: 0 0 16px;
    color: var(--app-heading-color, #181d4e);
    font-size: .96rem;
    font-weight: 700;
}

.app-public-listing-map {
    position: relative;
    z-index: 1;
    width: 100%;
    overflow: hidden;
    background: #eef2f6;
}

.app-public-listing-map--header {
    height: 650px;
    min-height: 650px;
}

.app-public-listing-map--half {
    height: 100%;
    min-height: 720px;
}

.app-public-half-map {
    height: 100%;
    min-height: 720px;
}

.app-public-half-map .leaflet-container {
    min-height: 720px;
}

.app-public-map-empty {
    position: absolute;
    left: 50%;
    top: 18px;
    z-index: 500;
    transform: translateX(-50%);
    max-width: min(520px, calc(100% - 32px));
    border: 1px solid rgba(24, 29, 78, .08);
    border-radius: 999px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, .94);
    color: var(--app-heading-color, #181d4e);
    font-size: .88rem;
    font-weight: 700;
    box-shadow: 0 16px 40px rgba(24, 29, 78, .12);
}

.app-public-map-cluster {
    display: grid;
    place-items: center;
    border: 3px solid rgba(255, 255, 255, .92);
    border-radius: 50%;
    background: var(--app-heading-color, #181d4e);
    color: #fff;
    box-shadow: 0 8px 20px rgba(17, 24, 39, .28);
}

.app-public-map-cluster span {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    color: #fff;
    font-size: .78rem;
    font-weight: 800;
    line-height: 1;
}

.app-public-map-popup {
    display: grid;
    grid-template-columns: 86px 1fr;
    gap: 12px;
    width: 250px;
}

.app-public-map-popup__image,
.app-public-map-popup__placeholder {
    width: 86px;
    height: 76px;
    border-radius: 8px;
    object-fit: cover;
    background: #edf1f6;
}

.app-public-map-popup__placeholder {
    display: grid;
    place-items: center;
    color: var(--app-muted-color, #697386);
}

.app-public-map-popup__body {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.app-public-map-popup__body strong {
    color: var(--app-heading-color, #181d4e);
    font-size: .92rem;
    line-height: 1.25;
}

.app-public-map-popup__body span {
    color: var(--app-primary, #ff6f3c);
    font-weight: 800;
}

.app-public-map-popup__body small {
    color: var(--app-muted-color, #697386);
}

.app-public-map-popup__body a {
    color: var(--app-heading-color, #181d4e);
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.app-public-listing-map .leaflet-overlay-pane canvas {
    cursor: pointer !important;
}

.app-public-zone-tooltip {
    border: 0;
    border-radius: 10px;
    padding: 8px 10px;
    background: rgba(17, 24, 39, .94);
    color: #fff;
    box-shadow: 0 16px 34px rgba(17, 24, 39, .22);
}

.app-public-zone-tooltip strong,
.app-public-zone-tooltip span {
    display: block;
    color: #fff;
    line-height: 1.2;
}

.app-public-zone-tooltip span {
    margin-top: 2px;
    font-size: .78rem;
    opacity: .84;
}

.app-public-zone-tooltip small {
    display: block;
    margin-top: 4px;
    color: rgba(255, 255, 255, .72);
    font-size: .72rem;
    line-height: 1.2;
}

.app-zone-editor {
    border: 1px solid var(--app-border-color, #e7e9f2);
    border-radius: 12px;
    padding: 14px;
    background: #fff;
}

.app-zone-editor__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.app-zone-editor__header p {
    color: var(--app-muted-color, #697386);
    font-size: .88rem;
    line-height: 1.45;
}

.app-zone-editor__status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    border-radius: 999px;
    padding: 6px 10px;
    background: #f4f6fb;
    color: var(--app-heading-color, #181d4e);
    font-size: .78rem;
    font-weight: 800;
    white-space: nowrap;
}

.app-zone-editor__status[data-tone="ready"] {
    background: color-mix(in srgb, var(--app-primary, #ff6f3c) 13%, #fff);
    color: var(--app-heading-color, #181d4e);
}

.app-zone-editor__status[data-tone="warning"],
.app-zone-editor__status[data-tone="error"] {
    background: #fff4e8;
    color: #b54708;
}

.app-territory-zone-map {
    position: relative;
    z-index: 0;
    isolation: isolate;
    height: 360px;
    min-height: 360px;
    width: 100%;
    overflow: hidden;
    border-radius: 10px;
    background: #eef2f6;
}

.app-territory-zone-map--large {
    height: 620px;
    min-height: 620px;
}

.app-zone-editor__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.app-zone-editor-point {
    border: 3px solid #fff;
    border-radius: 999px;
    background: var(--app-primary, #ff6f3c);
    box-shadow: 0 8px 18px rgba(17, 24, 39, .22);
}

.app-zone-row-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.app-zone-modal .modal-content {
    border: 0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 28px 70px rgba(17, 24, 39, .22);
}

.app-zone-modal .modal-header,
.app-zone-modal .modal-footer {
    border-color: var(--app-border-color, #e7e9f2);
    padding: 20px 24px;
}

.app-zone-modal .modal-body {
    padding: 24px;
}

.app-zone-history {
    border: 1px solid var(--app-border-color, #e7e9f2);
    border-radius: 12px;
    padding: 16px;
    background: color-mix(in srgb, #fff 95%, var(--app-primary, #ff6f3c));
}

.app-zone-history__header {
    margin-bottom: 14px;
}

.app-zone-history__header p {
    color: var(--app-muted-color, #697386);
    font-size: .88rem;
    line-height: 1.45;
}

.app-zone-history__list {
    display: grid;
    gap: 10px;
}

.app-zone-history__item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--app-border-color, #e7e9f2);
    border-radius: 10px;
    padding: 12px;
    background: #fff;
}

.app-zone-history__item strong,
.app-zone-history__item span,
.app-zone-history__item small {
    display: block;
}

.app-zone-history__item strong {
    color: var(--app-heading-color, #181d4e);
    font-size: .92rem;
    line-height: 1.25;
}

.app-zone-history__item span,
.app-zone-history__item small {
    color: var(--app-muted-color, #697386);
    font-size: .82rem;
}

html[data-theme="dark"] .app-property-map,
html[data-theme="dark"] .app-coordinate-grid {
    border-color: rgba(255, 255, 255, .12);
    background: color-mix(in srgb, var(--app-surface, #101735) 92%, var(--app-primary, #ff6f3c));
}

html[data-theme="dark"] .app-property-map__canvas {
    background:
        linear-gradient(135deg, rgba(255, 111, 60, .14), rgba(255, 255, 255, .04)),
        #121a3b;
}

html[data-theme="dark"] .app-property-map__status,
html[data-theme="dark"] .app-property-map__coordinate {
    border-color: rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .06);
}

html[data-theme="dark"] .app-property-map--template,
html[data-theme="dark"] .app-property-map--inline {
    background: transparent;
}

@media (max-width: 767.98px) {
    .app-property-map__header,
    .app-property-map__footer {
        display: block;
        padding: 16px;
    }

    .app-property-map__actions {
        justify-content: flex-start;
        margin-top: 14px;
    }

    .app-property-map__canvas {
        min-height: 320px;
    }

    .app-property-map__status {
        margin-bottom: 12px;
    }

    .app-property-map--template .app-property-map__canvas {
        height: 380px;
        min-height: 380px;
    }

    .app-property-map--inline .app-property-map__canvas,
    .app-property-map--inline .app-property-map__empty {
        height: 220px;
        min-height: 220px;
    }

    .app-property-map__footer--template {
        padding-top: 14px;
    }

    .app-public-listing-map--header {
        height: 420px;
        min-height: 420px;
    }

    .app-public-listing-map--half {
        height: 340px;
        min-height: 340px;
    }

    .app-zone-editor__header {
        display: block;
    }

    .app-zone-editor__status {
        margin-top: 10px;
    }

    .app-territory-zone-map {
        height: 300px;
        min-height: 300px;
    }
}

.app-public-map-popup__operation {
    align-self: flex-start;
    background: #181a20;
    border-radius: 6px;
    color: #ffffff !important;
    display: inline-flex !important;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1;
    padding: 6px 8px;
    text-transform: none;
}
