/* Legends of the information layers that are on, bottom left on the map. */
.ctx-legend {
    position: absolute;
    left: 12px;
    bottom: 14px;
    z-index: 1000;
    width: 240px;
    max-width: calc(100% - 24px);
    max-height: calc(100% - 90px);
    overflow-y: auto;
    border-radius: var(--radius);
    background: rgba(var(--white-rgb), 0.96);
    box-shadow: 0 4px 14px rgba(var(--black-rgb), 0.16);
    font-size: 12px;
}
.ctx-legend summary {
    position: sticky;
    top: 0;
    padding: 6px 10px;
    background: inherit;
    font-weight: 600;
    cursor: pointer;
}
.ctx-legend ul {
    margin: 0;
    padding: 0 10px 8px;
    list-style: none;
}
.ctx-legend li + li {
    margin-top: 8px;
}
.ctx-legend h5 {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-800);
}
.ctx-legend img {
    display: block;
    max-width: 100%;
    height: auto;
}
.ctx-map {
    position: absolute;
    inset: 0;
}
.pf.ctx.is-drawing .ctx-map {
    cursor: crosshair;
}
.pf.ctx.is-identifying .ctx-map {
    cursor: help;
}
/* Drawing and view forms float over the map, top left. */
.ctx-card {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 1000;
    width: 300px;
    max-width: calc(100% - 24px);
    max-height: calc(100% - 24px);
    overflow-y: auto;
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: 0 8px 24px rgba(var(--black-rgb), 0.18);
    font-size: 13px;
}
.ctx-card:empty {
    display: none;
}
.ctx-card .ctx-section {
    border-bottom: none;
}
.ctx-pending-more {
    margin-top: 8px !important;
    padding-top: 8px;
    border-top: 1px solid var(--gray-200);
}
.ctx-popup .leaflet-popup-content {
    margin: 10px 12px;
    font-size: 13px;
    line-height: 1.4;
}
.ctx-popup .ctx-head {
    padding-right: 16px;
}
.ctx-popup .ctx-layer-result {
    padding: 5px 0;
}
.ctx-popup p {
    margin: 2px 0;
}
.ctx-mapbar {
    position: absolute;
    left: 50%;
    bottom: 14px;
    z-index: 1000;
    transform: translateX(-50%);
    max-width: calc(100% - 24px);
    pointer-events: none;
}
.ctx-map-hint {
    margin: 0;
    padding: 6px 12px;
    border-radius: var(--radius);
    background: rgba(var(--white-rgb), 0.94);
    box-shadow: 0 2px 10px rgba(var(--black-rgb), 0.15);
    font-size: 12px;
    color: var(--gray-700);
}
.ctx-drawbar {
    margin: 0;
    padding: 6px 12px;
    border-radius: var(--radius);
    background: rgba(var(--white-rgb), 0.94);
    box-shadow: 0 2px 10px rgba(var(--black-rgb), 0.15);
    font-size: 12px;
    color: var(--gray-700);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
}
.ctx-brief-views {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 6px 0 12px;
}
.ctx-brief-view figcaption {
    gap: 2px;
    margin-top: 6px;
}
.ctx-brief-view-name {
    width: 100%;
    padding: 3px 6px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: transparent;
    color: var(--gray-800);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
}
.ctx-brief-view-note {
    width: 100%;
    padding: 3px 6px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: transparent;
    color: var(--gray-800);
    font: inherit;
    resize: vertical;
    font-size: 13px;
    line-height: 1.4;
}
.ctx-brief-view-note::placeholder {
    color: var(--gray-500);
}
.ctx-brief-view-name:hover,
.ctx-brief-view-note:hover {
    border-color: var(--gray-200);
}
.ctx-brief-view-name:focus,
.ctx-brief-view-note:focus {
    border-color: var(--gray-400);
    background: var(--white);
    outline: none;
}
.ctx-brief-facts {
    margin-top: 4px;
    border-top: 1px solid var(--gray-200);
}
.ctx-brief-facts summary {
    padding: 8px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    cursor: pointer;
}
.ctx-brief-facts ul {
    margin: 0;
    padding: 0;
    list-style: none;
}
.ctx-fact {
    padding: 6px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 12px;
}
.ctx-fact-text {
    overflow-wrap: anywhere;
}
.ctx-fact-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    margin-top: 3px;
}
.ctx-fact-meta .pf-icon {
    margin-left: auto;
    padding: 0;
}
.ctx-fact-meta .ctx-confirm {
    margin-top: 0;
}
.ctx-status {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--gray-100);
    font-size: 11px;
    white-space: nowrap;
}
.ctx-status.is-binding {
    background: var(--blue-e7f5ff);
    color: var(--blue-1864ab);
}
.ctx-status.is-confirmed {
    background: var(--green-ebfbee);
    color: var(--green-2b8a3e);
}
.ctx-status.is-client-intent {
    background: var(--orange-fff4e6);
    color: var(--orange-d9480f);
}
.ctx-confirm {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    font-size: 11px;
    cursor: pointer;
}
.ctx-qtys {
    padding: 10px 16px 6px;
    border-bottom: 1px solid var(--gray-200);
}
.ctx-qty summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
    padding: 4px 0;
    font-size: 13px;
    cursor: pointer;
}
.ctx-qty-label {
    flex: 1;
    min-width: 8rem;
}
.ctx-qty-link {
    color: var(--gray-600);
    font-size: 11px;
}
.ctx-qty-inputs {
    margin: 0 0 6px 12px !important;
    font-size: 12px;
    color: var(--gray-700);
}
@media (min-width: 1100px) {
    .pf.ctx.is-panel-collapsed {
        grid-template-columns: minmax(0, 1fr) 44px;
    }
}
/* Below 1100 px the map takes the width; the panel opens from the edge tab. */
@media (max-width: 1099px) {
    #setup-shell:has(#setup-panel-new:not([hidden]) .pf.ctx) {
        height: auto;
    }
    .setup-shell #setup-step:has(.pf.ctx) {
        flex: none;
    }
    .pf.ctx,
    .pf.ctx.is-panelless {
        flex: none;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto;
        grid-template-areas: "main";
        overflow: visible;
    }
    .ctx-body {
        flex: none;
    }
    .ctx-map-wrap {
        height: max(360px, 65vh);
    }
}
@media (max-width: 640px) {
    .pf.ctx .pf-totals.is-bare {
        display: block;
    }
    .pf-totals-title {
        font-size: 13px;
        font-weight: 600;
        color: var(--gray-800);
    }
    .ctx-search {
        flex-basis: 100%;
    }
    .ctx-body,
    .pf.ctx.is-tree-collapsed .ctx-body {
        grid-template-columns: minmax(0, 1fr);
    }
    .ctx-tree {
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid var(--gray-200);
    }
    .ctx-tree.is-collapsed {
        justify-content: flex-start;
        padding: 4px 6px;
    }
    .ctx-site-wrap {
        margin-left: 0;
    }
    .ctx-site-wrap .ctx-menu {
        left: 0;
        right: auto;
    }
}
/* Context rule notes on Programme scenarios and options. */
.prog-context-note {
    margin: 6px 0;
    padding: 6px 8px;
    border-left: 3px solid var(--blue-1c7ed6);
    border-radius: 0 var(--radius) var(--radius) 0;
    background: var(--neutral-f1f8ff);
    font-size: 12px;
    color: var(--gray-800);
}
.prog-context-note.is-disable {
    border-left-color: var(--red-c92a2a);
    background: var(--red-fff5f5);
}
.prog-context-note.is-preselect {
    border-left-color: var(--green-2b8a3e);
    background: var(--green-ebfbee);
}
.prog-context-tag {
    margin-right: 6px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--white);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.prog-context-from {
    display: block;
    margin-top: 2px;
    color: var(--gray-600);
}
.prog-option.is-site-disabled {
    cursor: not-allowed;
}
/* Preview: Site and context table. */
.spv-site {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.spv-site td {
    padding: 5px 8px;
    border-bottom: 1px solid var(--gray-200);
    text-align: left;
    vertical-align: top;
}
.spv-site th {
    padding: 5px 8px;
    border-bottom: 1px solid var(--gray-200);
    text-align: left;
    vertical-align: top;
    color: var(--gray-600);
    font-weight: 600;
}
.spv-site tr[data-status="indicative"] td:last-child {
    color: var(--gray-600);
    font-style: italic;
}
.spv-site-note {
    color: var(--gray-600);
    font-size: 12px;
}
.spv-site-legend {
    margin: 8px 0 0;
    color: var(--gray-600);
    font-size: 12px;
}
