/* One map entry field, with secondary manual route and geometry tools. */
.unified-map-editor [hidden] {
    display: none !important;
}

.unified-map-editor .sidebar-search-header {
    flex-shrink: 0;
    max-height: calc(100dvh - var(--header-h) - 1rem);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.unified-map-editor .map-editor-header-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.unified-map-editor .map-editor-tool {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.4rem 0.55rem;
    font-size: 0.79rem;
    line-height: 1.3;
}

.unified-map-editor .map-editor-tool.active {
    border-color: var(--accent-cyan);
    background: rgba(56, 189, 248, 0.12);
}

.unified-map-editor .map-editor-return {
    display: none;
    margin-bottom: 0.55rem;
}

.unified-map-editor.mode-route .map-editor-return,
.unified-map-editor.mode-geometry .map-editor-return {
    display: flex;
}

.unified-map-editor .map-editor-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.unified-map-editor .map-editor-heading label {
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 650;
}

.unified-map-editor .map-editor-heading .text-action-btn {
    flex-shrink: 0;
    font-size: 0.72rem;
}

.unified-map-editor .map-editor-history-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-inline-start: auto;
}

.unified-map-editor .map-editor-composer {
    margin: 0;
    padding: 0;
    gap: 0;
}

.unified-map-editor .ask-input-row {
    width: 100%;
}

.unified-map-editor #askInput {
    border-color: var(--border-strong);
}

.unified-map-editor #askInput:focus {
    outline: 2px solid rgba(56, 189, 248, 0.35);
    outline-offset: 1px;
}

.unified-map-editor .editor-suggestions {
    max-height: min(16rem, 24dvh);
    overflow-y: auto;
    overscroll-behavior: contain;
    list-style: none;
    padding: 0.25rem;
    margin: 0.4rem 0 0;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    background: var(--bg-card);
    scrollbar-width: thin;
}

.unified-map-editor .editor-suggestion {
    display: flex;
    flex-direction: column;
    gap: 0.16rem;
    padding: 0.55rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    overflow-wrap: anywhere;
}

.unified-map-editor .editor-suggestion + .editor-suggestion {
    border-top: 1px solid var(--border);
}

.unified-map-editor .editor-suggestion:hover,
.unified-map-editor .editor-suggestion.is-active {
    background: rgba(56, 189, 248, 0.12);
    outline: 1px solid rgba(56, 189, 248, 0.45);
    outline-offset: -1px;
}

.unified-map-editor .editor-suggestion-label {
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.35;
}

.unified-map-editor .editor-suggestion-secondary {
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.35;
}

.unified-map-editor .map-editor-status {
    min-height: 1.35em;
    margin: 0.35rem 0;
    color: var(--text-muted);
    font-size: 0.71rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.unified-map-editor .map-editor-status:empty {
    min-height: 0;
    margin: 0;
}

.unified-map-editor .map-editor-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
}

.unified-map-editor .map-editor-actions .btn {
    min-height: 2.35rem;
    padding-inline: 0.9rem;
}

.unified-map-editor .map-editor-ask-instead {
    margin-inline-end: auto;
    text-align: start;
    font-size: 0.75rem;
}

.unified-map-editor .map-editor-examples .starter-chips {
    margin: 0.65rem 0 0;
    gap: 0.35rem;
}

.unified-map-editor .map-editor-examples .sample-query-btn {
    padding: 0.28rem 0.5rem;
    font-size: 0.74rem;
}

.unified-map-editor:has(#askInput:not(:placeholder-shown)) .map-editor-examples {
    display: none;
}

.unified-map-editor .map-editor-context-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem 0.65rem;
    margin-top: 0.6rem;
    font-size: 0.73rem;
}

.unified-map-editor .map-editor-context-actions .mobile-reopen-results-btn {
    margin-inline-start: auto;
}

.unified-map-editor .map-editor-route {
    margin-inline-start: auto;
    font-size: inherit;
}

.unified-map-editor .map-editor-route.active {
    color: var(--accent-cyan);
    text-decoration: underline;
}

.unified-map-editor .map-editor-section-title {
    margin: 0 0 0.65rem;
    font-size: 0.95rem;
}

.unified-map-editor .ask-chat-pane,
.unified-map-editor .sidebar-scroll-body {
    min-height: 0;
}

.unified-map-editor.mode-geometry .map-editor-shell {
    display: none;
}

@media (max-width: 860px) {
    .unified-map-editor.mode-route .map-editor-shell {
        display: none;
    }

    .unified-map-editor,
    .unified-map-editor.mode-route,
    .unified-map-editor.mode-geometry {
        max-height: min(84dvh, calc(100dvh - var(--header-h) - 1rem));
    }

    .unified-map-editor .sidebar-title-row {
        display: flex;
        gap: 0.5rem;
        margin-bottom: 0.4rem;
    }

    .unified-map-editor .sidebar-title-row h1 {
        font-size: 0.89rem;
    }

    .unified-map-editor .sidebar-title-row .text-action-btn {
        font-size: 0.69rem;
    }

    .unified-map-editor .map-editor-header-actions {
        gap: 0.5rem;
    }

    .unified-map-editor .map-editor-tool {
        min-height: 2rem;
        padding: 0.35rem 0.45rem;
    }

    .unified-map-editor .sidebar-search-header {
        max-height: min(84dvh, calc(100dvh - var(--header-h) - 1rem));
    }

    .unified-map-editor .map-editor-heading label {
        font-size: 0.79rem;
    }

    .unified-map-editor #askInput,
    .unified-map-editor .chat-bglang-mirror {
        min-height: 4.45rem;
        max-height: 7rem;
        font-size: 1rem;
    }

    .unified-map-editor .map-editor-actions .btn,
    .unified-map-editor .map-editor-ask-instead {
        min-height: 2.65rem;
    }

    .unified-map-editor .ask-sheet-toggle:not(.hidden) {
        margin-top: 0.4rem;
        margin-bottom: 0;
    }

    .unified-map-editor .editor-suggestions {
        max-height: 22dvh;
    }

    .unified-map-editor .editor-suggestion {
        min-height: 2.8rem;
        justify-content: center;
    }

    .unified-map-editor .map-editor-context-actions {
        margin-top: 0.4rem;
    }
}

@media (max-height: 650px) {
    .unified-map-editor .sidebar-search-header {
        max-height: calc(100dvh - var(--header-h) - 2.5rem);
    }

    .unified-map-editor .editor-suggestions {
        max-height: 22dvh;
    }
}
