/* AerialModel map/model measurement promotion and 2D orthomosaic tools. */
.aerialalign-measurement-promo {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
}

.aerialalign-measurement-promo-card {
    border: 1px solid rgba(37, 99, 235, .2);
    border-radius: .8rem;
    padding: .85rem;
    background: linear-gradient(145deg, rgba(239, 246, 255, .98), rgba(248, 250, 252, .98));
    box-shadow: 0 .35rem .8rem rgba(15, 23, 42, .06);
}

.aerialalign-measurement-promo-title {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin-bottom: .3rem;
    color: #0f172a;
    font-size: .95rem;
    font-weight: 800;
    line-height: 1.25;
}

.aerialalign-measurement-promo-title::before {
    content: "◎";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    flex: 0 0 1.65rem;
    border-radius: 999px;
    color: #fff;
    background: #2563eb;
    font-size: .9rem;
}

.aerialalign-measurement-promo-copy {
    margin: 0 0 .55rem;
    color: #475569;
    font-size: .82rem;
    line-height: 1.4;
}

.aerialalign-measurement-promo-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border-radius: 999px;
    padding: .4rem .8rem;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    color: #fff !important;
    background: #0d6efd;
    font-size: .8rem;
    font-weight: 800;
    line-height: 1;
    text-decoration: none !important;
}

.aerialalign-measurement-promo-link:hover,
.aerialalign-measurement-promo-link:focus {
    color: #fff !important;
    background: #0b5ed7;
}

#mapViewerRow {
    --aerial-map-viewer-height: clamp(520px, 68vh, 760px);
}

.map-render-column,
.map-sidebar-column {
    min-height: 0;
    transition: flex-basis .2s ease, max-width .2s ease, width .2s ease, opacity .2s ease;
}

#mapViewerRow .map-viewer-shell {
    min-height: var(--aerial-map-viewer-height);
    border-radius: .65rem;
    background: #e2e8f0;
    box-shadow: 0 .75rem 1.5rem rgba(15, 23, 42, .08);
}

#mapViewerRow #map {
    width: 100%;
    height: var(--aerial-map-viewer-height);
    min-height: 520px;
    max-height: 760px;
}

.map-sidebar-card {
    position: sticky;
    top: .75rem;
    display: flex;
    flex-direction: column;
    height: var(--aerial-map-viewer-height);
    min-height: 0;
    max-height: calc(100vh - 1.5rem);
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: .75rem;
    background: #fff;
    box-shadow: 0 .75rem 1.5rem rgba(15, 23, 42, .08);
}

.map-sidebar-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    min-height: 3.25rem;
    padding: .65rem .85rem;
    border-bottom: 1px solid rgba(15, 23, 42, .08);
    background: #f8fafc;
    flex: 0 0 auto;
}

.map-measurement-sidebar {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: .9rem;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}

.map-measurement-instructions {
    margin: 0 0 .75rem;
    color: #475569;
    font-size: .83rem;
    line-height: 1.4;
    text-align: center;
}

.map-measurement-tools {
    display: flex;
    flex-direction: column;
    gap: .12rem;
}

.map-measurement-tool {
    display: flex;
    align-items: center;
    gap: .45rem;
    width: 100%;
    min-height: 42px;
    border: 0;
    border-radius: .45rem;
    padding: .35rem .45rem;
    color: #20252b;
    background: transparent;
    font: inherit;
    font-size: .9rem;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.map-measurement-tool:hover,
.map-measurement-tool:focus-visible {
    color: #0f172a;
    background: #f1f5f9;
    outline: none;
}

.map-measurement-tool.is-active,
.map-measurement-tool[aria-pressed="true"] {
    color: #0b5ed7;
    background: #eaf2ff;
    box-shadow: inset 0 0 0 1px rgba(13, 110, 253, .22);
    font-weight: 700;
}

.map-measurement-tool-icon {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    object-fit: contain;
}

.map-measurement-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .45rem;
    margin-top: .75rem;
}

.map-measurement-actions .btn,
.map-measurement-label-toggle .btn {
    min-height: 44px;
    touch-action: manipulation;
}

.map-measurement-status {
    min-height: 2.8rem;
    margin-top: .65rem;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: .55rem;
    padding: .55rem .65rem;
    color: #475569;
    background: #f8fafc;
    font-size: .8rem;
    line-height: 1.35;
}

.map-measurement-divider {
    margin: .9rem 0 .45rem;
    color: #20252b;
    font-size: .9rem;
}

.map-measurement-label-toggle .btn {
    padding-top: .42rem;
    padding-bottom: .42rem;
}

.map-measurement-note {
    margin: .75rem 0 0;
    color: #64748b;
    font-size: .75rem;
    line-height: 1.35;
}

.leaflet-container.aerial-map-measurement-active,
.leaflet-container.aerial-map-measurement-active .leaflet-interactive {
    cursor: crosshair !important;
}

.leaflet-container.aerial-map-measurement-active {
    touch-action: none !important;
    -webkit-user-select: none;
    user-select: none;
}

.aerial-map-measurement-label-host {
    width: auto !important;
    height: auto !important;
    border: 0 !important;
    background: transparent !important;
}

.aerial-map-measurement-label {
    display: inline-block;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255, 255, 255, .75);
    border-radius: .4rem;
    padding: .28rem .42rem;
    color: #fff;
    background: rgba(15, 23, 42, .9);
    box-shadow: 0 .3rem .75rem rgba(15, 23, 42, .26);
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
}

.map-measurement-labels-hidden .aerial-map-measurement-label-host {
    display: none !important;
}

.aerial-map-point-label {
    white-space: normal;
    min-width: 11rem;
}

@media (max-width: 991.98px) {
    #mapViewerRow {
        --aerial-map-viewer-height: clamp(420px, 58svh, 620px);
    }

    #mapViewerRow #map {
        min-height: 420px;
        max-height: 620px;
    }

    .map-sidebar-card {
        position: relative;
        top: auto;
        height: auto;
        max-height: none;
    }

    .map-sidebar-card-header .btn {
        min-height: 44px;
        touch-action: manipulation;
    }

    .map-measurement-sidebar {
        max-height: 34rem;
    }
}

@media (max-width: 575.98px) {
    #mapViewerRow {
        --aerial-map-viewer-height: clamp(340px, 52svh, 500px);
    }

    #mapViewerRow #map {
        min-height: 340px;
        max-height: 500px;
    }

    .map-sidebar-card {
        overflow: visible;
    }

    .map-measurement-sidebar {
        max-height: none;
        overflow: visible;
        padding: .75rem;
    }

    .map-measurement-tools {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .35rem;
    }

    .map-measurement-tool {
        min-height: 52px;
        padding: .45rem .5rem;
        font-size: .84rem;
        line-height: 1.2;
    }

    .map-measurement-tool-icon {
        width: 28px;
        height: 28px;
        flex-basis: 28px;
    }

    .map-measurement-instructions {
        text-align: left;
    }

    .aerialalign-measurement-promo-card {
        padding: .8rem;
    }

    .aerialalign-measurement-promo-link {
        width: 100%;
        min-height: 44px;
    }

    .leaflet-control-zoom a,
    .leaflet-bar a {
        width: 42px;
        height: 42px;
        line-height: 42px;
    }
}
