/* Back and Done of a host that has no buttons of its own (editor-context.js, ``host.nav``). */
.ctx-nav {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 8px 0 0;
}
.ctx-search {
    position: relative;
    flex: 0 1 380px;
    min-width: 200px;
}
.ctx-search-form {
    position: relative;
    display: flex;
}
.ctx-search-form input {
    flex: 1;
    min-width: 0;
    height: 36px;
    padding: 6px 38px 6px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font: inherit;
    font-size: 14px;
}
.ctx-search-go {
    position: absolute;
    top: 2px;
    right: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: none;
    color: var(--gray-600);
    cursor: pointer;
}
.ctx-search-go:hover,
.ctx-search-go:focus-visible {
    background: var(--gray-100);
    color: var(--gray-900);
}
.ctx-search-status {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1001;
    margin: 0;
    padding: 6px 10px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: 0 6px 18px rgba(var(--black-rgb), 0.1);
    font-size: 12px;
    color: var(--gray-600);
}
.ctx-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1001;
    max-height: 280px;
    margin: 0;
    padding: 4px 0;
    overflow-y: auto;
    list-style: none;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: 0 8px 24px rgba(var(--black-rgb), 0.12);
}
.ctx-results button {
    display: block;
    width: 100%;
    padding: 6px 12px;
    border: none;
    background: none;
    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}
.ctx-results button:hover,
.ctx-results button:focus {
    background: var(--gray-100);
}
/* Leaflet's panes and controls (z-index up to 1000) stay inside the map, below the toolbar lists and the panel sheet. */
.ctx-body {
    display: grid;
    flex: 1;
    grid-template-columns: 220px minmax(0, 1fr);
    min-height: 320px;
}
.pf.ctx.is-tree-collapsed .ctx-body {
    grid-template-columns: 36px minmax(0, 1fr);
}
.ctx-map-wrap {
    position: relative;
    z-index: 0;
    min-width: 0;
    min-height: 320px;
}
/* "My layers": the user's drawings as a tree beside the map. */
.ctx-tree {
    min-width: 0;
    overflow-y: auto;
    border-right: 1px solid var(--gray-200);
    background: var(--white);
    font-size: 13px;
}
.ctx-tree.is-collapsed {
    display: flex;
    justify-content: center;
    padding-top: 6px;
}
.ctx-tree-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 6px 6px 12px;
}
.ctx-tree-head h3 {
    margin: 0;
    color: var(--gray-700);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.ctx-tree-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    border-radius: var(--radius);
    background: none;
    color: var(--gray-600);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}
.ctx-tree-toggle:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}
.ctx-tree-view {
    margin: 0 8px 6px;
    padding: 6px 8px;
    border-radius: var(--radius);
    background: var(--orange-fff4e6);
    font-size: 12px;
}
.ctx-tree-empty {
    margin: 4px 12px;
}
.ctx-tree-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.ctx-tree-list ul {
    margin: 0;
    padding: 0;
    list-style: none;
    padding-left: 22px;
}
.ctx-tree-group > ul {
    padding-left: 12px;
}
.ctx-tree-group > .ctx-tree-row .ctx-tree-label {
    color: var(--gray-700);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.ctx-tree-row {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 28px;
    padding: 0 6px;
}
.ctx-tree-row:hover {
    background: var(--gray-50);
}
.ctx-tree-caret {
    flex: none;
    width: 16px;
    height: 16px;
    padding: 0;
    border: none;
    background: none;
    color: var(--gray-500);
    cursor: pointer;
}
.ctx-tree-caret::before {
    content: '▸';
    display: inline-block;
    font-size: 11px;
    transition: transform 0.12s;
}
.ctx-tree-caret.is-open::before {
    transform: rotate(90deg);
}
.ctx-tree-caret.is-empty::before {
    content: '';
}
.ctx-tree-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ctx-tree-count {
    flex: none;
    color: var(--gray-500);
    font-size: 11px;
}
.ctx-tree-name {
    flex: 1;
    min-width: 0;
    padding: 2px 0;
    overflow: hidden;
    border: none;
    background: none;
    color: var(--gray-800);
    font: inherit;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}
.ctx-tree-name:hover {
    color: var(--gray-900);
    text-decoration: underline;
}
.ctx-tree-brief {
    flex: none;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green-2b8a3e);
}
.ctx-tree-more-wrap {
    position: relative;
    flex: none;
}
.ctx-tree-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: var(--gray-500);
    font: inherit;
    line-height: 1;
    cursor: pointer;
}
.ctx-tree-more:hover,
.ctx-tree-more[aria-expanded="true"] {
    background: var(--gray-100);
    color: var(--gray-800);
}
.ctx-tree-menu {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 20;
    min-width: 120px;
    padding: 4px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: 0 4px 14px rgba(var(--black-rgb), 0.12);
}
.ctx-tree-menu-item {
    display: block;
    width: 100%;
    padding: 6px 10px;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: var(--gray-800);
    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}
.ctx-tree-menu-item:hover {
    background: var(--gray-50);
}
.ctx-tree-menu-item.is-danger {
    color: var(--danger);
}
.ctx-tree-node.is-off > .ctx-tree-row .ctx-tree-label,
.ctx-tree-node.is-off .ctx-tree-name,
.ctx-tree-leaf.is-off .ctx-tree-name {
    color: var(--gray-500);
}
.ctx-eye {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: var(--radius);
    background: none;
    color: var(--gray-700);
    cursor: pointer;
}
.ctx-eye .ctx-svg {
    width: 16px;
    height: 16px;
}
.ctx-eye.is-off {
    color: var(--gray-400);
}
.ctx-eye:hover {
    background: var(--gray-100);
}
