        :root {
            --app-height: 100dvh;
        }

.route-context-menu {
    position: fixed;
    z-index: 80;
    min-width: 168px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.route-context-menu button {
    display: block;
    width: 100%;
    border: 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    background: transparent;
    padding: 11px 14px;
    color: #1f2937;
    font: inherit;
    font-weight: 650;
    text-align: left;
    cursor: pointer;
}

.route-context-menu button:last-child {
    border-bottom: 0;
}

.route-context-menu button:hover,
.route-context-menu button:focus-visible {
    background: #eff6ff;
    outline: none;
}

.route-context-menu button.route-context-menu-danger {
    color: #b91c1c;
}

.route-context-menu button.route-context-menu-danger:hover,
.route-context-menu button.route-context-menu-danger:focus-visible {
    background: #fef2f2;
}

        html, body {
            margin: 0;
            padding: 0;
            height: 100%;
            font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
            background: #f0f2f5;
            overflow: hidden;
        }

        #app {
            display: flex;
            height: var(--app-height);
            width: 100vw;
        }

        #sidebar {
            width: 360px;
            min-width: 240px;
            max-width: 800px;
            background: #ffffff;
            border-right: 1px solid #d0d0d0;
            box-shadow: 2px 0 4px rgba(0,0,0,0.08);
            box-sizing: border-box;
            padding: 10px 10px 12px 10px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            overflow: hidden;
            position: relative;
        }

        /* --- Vertical split inside sidebar (Query/Response vs Results) --- */
        #sidebarTop {
            flex: 0 0 auto;              /* height is controlled via flex-basis set in JS */
            min-height: 160px;
            display: flex;
            flex-direction: column;
            gap: 6px;
            overflow: hidden;            /* ensure inner flex children can shrink/grow */
        }

        #hDivider {
            height: 6px;
            cursor: row-resize;
            background: #e0e0e0;
            border-radius: 3px;
            touch-action: none;   /* enable dragging on touch */
            user-select: none;
        }

        #hDivider:hover {
            background: #c0c0c0;
        }

        #sidebarBottom {
            flex: 1 1 auto;
            min-height: 120px;
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        #divider {
            width: 5px;
            cursor: col-resize;
            background: #e0e0e0;
            touch-action: none;   /* enable dragging on touch */
            user-select: none;
        }

        #divider:hover {
            background: #c0c0c0;
        }

        #map {
            flex: 1;
            height: var(--app-height);
            min-width: 0;
            position: relative;
            cursor: default;
        }

        .maplibregl-canvas {
            filter: grayscale(30%);
            cursor: default !important;
        }

        .maplibregl-canvas-container {
            cursor: default !important;
        }

        .top-row {
            display: flex;
            align-items: center;
            flex-wrap: nowrap;
            gap: 6px;
            margin-bottom: 4px;
            overflow: visible;
            scrollbar-width: none;
        }

        .top-row::-webkit-scrollbar {
            display: none;
        }

        .btn-primary {
            padding: 5px 10px;
            border-radius: 7px;
            border: 1px solid #386dd8;
            background: linear-gradient(180deg, #5c89ea, #4472d6);
            color: #ffffff;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            min-height: 31px;
            box-shadow: 0 1px 2px rgba(30, 64, 175, 0.16);
            display: inline-flex;
            align-items: center;
            gap: 6px;
            white-space: nowrap;
        }

        .btn-primary:hover {
            background: linear-gradient(180deg, #668ff0, #4d79db);
        }

        .btn-secondary {
            padding: 5px 9px;
            border-radius: 7px;
            border: 1px solid #cfd6e2;
            background: linear-gradient(180deg, #ffffff, #f2f5f9);
            color: #3b4758;
            font-size: 11px;
            cursor: pointer;
            min-height: 31px;
            box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            white-space: nowrap;
        }

        .btn-secondary:hover {
            background: linear-gradient(180deg, #ffffff, #e9eef5);
        }

        .btn-secondary.is-on {
            border-color: #97b7f2;
            background: linear-gradient(180deg, #eef5ff, #dce9ff);
            color: #23406b;
        }

        .toolbar-btn {
            border-radius: 999px;
            padding: 5px 11px;
            background: linear-gradient(180deg, #fbfcfe, #eef3f8);
            border-color: #d5dde8;
            box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
        }

        .toolbar-btn:hover {
            background: linear-gradient(180deg, #ffffff, #e7eef6);
        }

        .toolbar-btn .btn-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 16px;
            height: 16px;
            border-radius: 999px;
            background: rgba(71, 101, 153, 0.10);
            color: #3f5f95;
            font-size: 11px;
            font-weight: 700;
        }

        .toolbar-btn.is-on .btn-icon {
            background: rgba(53, 97, 177, 0.16);
            color: #23406b;
        }

        .translate-model-info {
            margin-top: -2px;
            color: #64748b;
            font-size: 11px;
            line-height: 1.35;
        }

        .mobile-only {
            display: none;
        }

        .toggle-chip {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 5px 10px;
            border-radius: 999px;
            border: 1px solid #d6dce8;
            background: linear-gradient(180deg, #fafbfd, #eef2f7);
            color: #334155;
            font-size: 11px;
            cursor: pointer;
            box-shadow: 0 1px 2px rgba(15,23,42,0.06);
            user-select: none;
            min-height: 31px;
        }

        .toggle-chip:hover {
            background: linear-gradient(180deg, #f7f9fc, #e8edf4);
        }

        .toggle-chip .toggle-icon {
            font-size: 12px;
        }

        .toggle-chip .toggle-label {
            font-weight: 500;
        }

        .btn-icon {
            flex: 0 0 auto;
            font-size: 12px;
            line-height: 1;
        }

        .btn-label {
            flex: 0 1 auto;
        }

        .icon-only-btn {
            width: 31px;
            min-width: 31px;
            padding: 0;
            justify-content: center;
        }

        .geocode-bar {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            min-width: 150px;
            max-width: 260px;
            flex: 1 1 190px;
            box-sizing: border-box;
        }

        .map-geocode-bar {
            position: absolute;
            z-index: 7;
            top: 14px;
            left: 14px;
            width: min(540px, calc(100% - 28px));
            max-width: 540px;
            flex: none;
            pointer-events: auto;
        }

        .map-geocode-bar .geocode-input {
            flex: 1 1 auto;
            width: auto;
        }

        .route-profile-select {
            flex: 0 0 112px;
            min-width: 0;
            height: 31px;
            border-radius: 7px;
            border: 1px solid #cfd6e2;
            background: #ffffff;
            color: #334155;
            font: 12px/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
            padding: 0 7px;
            box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
        }

        .route-profile-select:focus {
            outline: none;
            border-color: #6b93e5;
            box-shadow: 0 0 0 2px rgba(90, 127, 222, 0.16);
        }

        .route-profile-edit-btn {
            flex: 0 0 auto;
            height: 31px;
            border-radius: 7px;
            border: 1px solid #cfd6e2;
            background: #ffffff;
            color: #475569;
            font: 600 12px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
            padding: 0 9px;
            box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
            cursor: pointer;
        }

        .route-profile-edit-btn:hover {
            background: #f8fafc;
            border-color: #b8c4d8;
        }

        .route-profile-edit-btn:disabled {
            opacity: 0.45;
            cursor: default;
        }

        .route-profile-editor-overlay {
            position: absolute;
            z-index: 18;
            top: 62px;
            left: 12px;
            width: min(560px, calc(100vw - 28px));
            pointer-events: none;
        }

        .route-profile-editor-overlay[hidden] {
            display: none;
        }

        .route-profile-editor-card {
            width: 100%;
            max-height: min(720px, calc(100vh - 84px));
            display: flex;
            flex-direction: column;
            gap: 10px;
            border-radius: 10px;
            border: 1px solid rgba(148, 163, 184, 0.45);
            background: rgba(255, 255, 255, 0.98);
            box-shadow: 0 18px 54px rgba(15, 23, 42, 0.24);
            padding: 16px;
            pointer-events: auto;
        }

        .route-profile-editor-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 16px;
        }

        .route-profile-editor-title {
            color: #172033;
            font: 700 17px/1.25 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
        }

        .route-profile-editor-subtitle {
            margin-top: 4px;
            color: #64748b;
            font: 12px/1.35 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
        }

        .route-profile-editor-close {
            border: 1px solid #cbd5e1;
            border-radius: 999px;
            background: #ffffff;
            color: #334155;
            font: 600 12px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
            padding: 8px 13px;
            cursor: pointer;
        }

        .route-profile-editor-label {
            color: #475569;
            font: 700 11px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
            text-transform: uppercase;
            letter-spacing: 0;
        }

        .route-profile-name-input,
        .route-profile-textarea {
            border: 1px solid #cbd5e1;
            border-radius: 8px;
            background: #ffffff;
            color: #172033;
            font: 13px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
            padding: 9px 10px;
        }

        .route-profile-name-input:focus,
        .route-profile-textarea:focus {
            outline: none;
            border-color: #6b93e5;
            box-shadow: 0 0 0 2px rgba(90, 127, 222, 0.16);
        }

        .route-profile-textarea {
            min-height: 300px;
            flex: 1 1 auto;
            resize: vertical;
            white-space: pre;
            overflow: auto;
        }

        .route-profile-editor-error {
            min-height: 16px;
            color: #b91c1c;
            font: 12px/1.35 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
        }

        .route-profile-editor-error.is-ok {
            color: #166534;
        }

        .route-profile-editor-actions {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .route-profile-editor-spacer {
            flex: 1 1 auto;
        }

        .map-locate-btn {
            position: absolute;
            z-index: 7;
            top: 126px;
            right: 10px;
            width: 31px;
            min-width: 31px;
            height: 31px;
            min-height: 31px;
            padding: 0;
            border-radius: 6px;
            box-shadow: 0 1px 4px rgba(15, 23, 42, 0.22);
        }

        .geocode-input {
            min-width: 0;
            width: 100%;
            height: 31px;
            border-radius: 7px;
            border: 1px solid #cfd6e2;
            background: #ffffff;
            color: #1f2937;
            font: 12px/1.2 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
            padding: 0 9px;
            box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
        }

        .geocode-input:focus {
            outline: none;
            border-color: #6b93e5;
            box-shadow: 0 0 0 2px rgba(90, 127, 222, 0.16);
        }

        .geocode-results {
            position: absolute;
            z-index: 7;
            top: 52px;
            left: 14px;
            width: min(340px, calc(100% - 28px));
            max-height: min(420px, calc(100% - 130px));
            overflow: auto;
            border: 1px solid rgba(203, 213, 225, 0.92);
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.96);
            box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18);
            padding: 6px;
        }

        .geocode-results[hidden] {
            display: none;
        }

        .geocode-results-header {
            position: sticky;
            top: -6px;
            z-index: 1;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            margin: -6px -6px 4px;
            padding: 6px 7px 5px 9px;
            border-bottom: 1px solid rgba(226, 232, 240, 0.92);
            background: rgba(255, 255, 255, 0.96);
            color: #64748b;
            font: 10px/1.2 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
        }

        .geocode-results-close {
            flex: 0 0 auto;
            width: 24px;
            height: 24px;
            border: 0;
            border-radius: 999px;
            background: transparent;
            color: #64748b;
            font: 18px/1 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
            cursor: pointer;
        }

        .geocode-results-close:hover,
        .geocode-results-close:focus {
            background: #e2e8f0;
            color: #334155;
            outline: none;
        }

        .geocode-result-row {
            width: 100%;
            border: 0;
            border-radius: 6px;
            background: transparent;
            color: #233044;
            cursor: pointer;
            display: grid;
            grid-template-columns: minmax(0, 1fr);
            gap: 2px;
            padding: 8px 9px;
            text-align: left;
        }

        .geocode-result-row.has-media {
            grid-template-columns: 34px minmax(0, 1fr);
            column-gap: 8px;
            align-items: center;
        }

        .geocode-result-media {
            width: 34px;
            height: 34px;
            border-radius: 6px;
            background: #e5e7eb;
            overflow: hidden;
        }

        .geocode-result-media img {
            width: 100%;
            height: 100%;
            display: block;
            object-fit: cover;
        }

        .geocode-result-text {
            min-width: 0;
        }

        .geocode-media-preview {
            position: fixed;
            inset: 0;
            z-index: 2000;
            display: none;
            pointer-events: none;
        }

        .geocode-media-preview.is-open {
            display: block;
        }

        .geocode-media-preview-backdrop {
            display: none;
        }

        .geocode-media-preview-panel {
            position: absolute;
            top: max(74px, calc(env(safe-area-inset-top) + 74px));
            right: max(18px, env(safe-area-inset-right));
            z-index: 1;
            width: min(420px, calc(100vw - 36px));
            max-height: calc(100dvh - 96px - env(safe-area-inset-bottom));
            display: grid;
            grid-template-columns: 1fr;
            gap: 0;
            border: 1px solid rgba(226, 232, 240, 0.9);
            border-radius: 14px;
            background: rgba(255, 255, 255, 0.96);
            box-shadow: 0 18px 46px rgba(15, 23, 42, 0.24);
            overflow: hidden;
            pointer-events: auto;
        }

        .geocode-media-preview-close {
            position: absolute;
            top: 10px;
            right: 10px;
            z-index: 2;
            min-height: 30px;
            padding: 4px 11px;
            border: 1px solid rgba(203, 213, 225, 0.9);
            border-radius: 999px;
            background: rgba(248, 250, 252, 0.92);
            color: #334155;
            font: 11px/1.2 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
            cursor: pointer;
            box-shadow: 0 8px 20px rgba(15, 23, 42, 0.16);
        }

        .geocode-media-preview-image-wrap {
            min-height: 170px;
            max-height: min(42dvh, 320px);
            background: #0f172a;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .geocode-media-preview-image {
            width: 100%;
            height: 100%;
            max-height: min(42dvh, 320px);
            object-fit: contain;
            display: block;
        }

        .geocode-media-preview-caption {
            min-width: 0;
            align-self: stretch;
            padding: 18px 18px 16px;
            color: #475569;
            font-size: 13px;
            line-height: 1.42;
            overflow: auto;
        }

        .geocode-media-preview-title {
            color: #1e293b;
            padding-right: 62px;
            font-weight: 700;
            font-size: 15px;
            line-height: 1.25;
        }

        .geocode-media-preview-description {
            margin-top: 8px;
        }

        .geocode-media-preview-hours {
            margin-top: 10px;
            padding: 7px 9px;
            border-radius: 8px;
            background: #f1f5f9;
            color: #334155;
            font-weight: 600;
        }

        .geocode-media-preview-source {
            margin-top: 10px;
            color: #64748b;
            font-size: 11px;
        }

        .geocode-result-row:hover,
        .geocode-result-row:focus {
            background: #eef4ff;
            outline: none;
        }

        .geocode-result-title {
            font-weight: 700;
            font-size: 12px;
            line-height: 1.25;
        }

        .geocode-result-meta {
            color: #64748b;
            font-size: 11px;
            line-height: 1.25;
        }

        #locBtn.is-located {
            border-color: #2f9d83;
            background: linear-gradient(180deg, #48c7a7, #2d9b82);
        }

        #locBtn.is-following {
            border-color: #1f7a66;
            background: linear-gradient(180deg, #24b591, #137762);
            box-shadow: 0 0 0 3px rgba(36, 181, 145, 0.20), 0 1px 2px rgba(15, 23, 42, 0.12);
        }

        .location-marker {
            position: relative;
            width: 18px;
            height: 18px;
            pointer-events: none;
        }

        .location-marker-accuracy {
            position: absolute;
            left: 50%;
            top: 50%;
            width: 48px;
            height: 48px;
            border-radius: 999px;
            background: rgba(37, 99, 235, 0.12);
            border: 1px solid rgba(37, 99, 235, 0.24);
            transform: translate(-50%, -50%);
        }

        .location-marker-dot {
            position: absolute;
            left: 50%;
            top: 50%;
            width: 14px;
            height: 14px;
            border-radius: 999px;
            background: #2563eb;
            border: 3px solid #ffffff;
            box-shadow: 0 2px 8px rgba(15, 23, 42, 0.28);
            transform: translate(-50%, -50%);
        }

        .location-marker.is-following .location-marker-dot {
            background: #16a085;
        }

        .location-marker-speed {
            position: absolute;
            left: 16px;
            top: -8px;
            display: none;
            align-items: center;
            height: 20px;
            padding: 0 7px;
            border-radius: 999px;
            background: rgba(15, 23, 42, 0.88);
            color: #ffffff;
            font-size: 11px;
            font-weight: 700;
            line-height: 1;
            white-space: nowrap;
            box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
        }

        .compact-toolbar-btn {
            width: 31px;
            min-width: 31px;
            padding: 0;
            justify-content: center;
            gap: 0;
        }

        .compact-toolbar-btn .btn-label {
            display: none;
        }

        .compact-toolbar-btn.toolbar-btn .btn-icon {
            width: 17px;
            height: 17px;
        }

        .compact-toggle {
            width: 31px;
            min-width: 31px;
            padding: 0;
            justify-content: center;
            gap: 0;
        }

        .compact-toggle .toggle-label {
            display: none;
        }

        .compact-toggle .toggle-icon {
            font-size: 13px;
            line-height: 1;
        }

        .toggle-chip.is-off {
            opacity: 0.68;
            background: #f6f7fa;
            border-color: #d8dde6;
        }

        .status-dot {
            flex: 0 0 auto;
            margin-left: auto;
            width: 14px;
            height: 14px;
            border-radius: 50%;
            border: 1px solid #000;
            background-color: red;
        }

        .user-name-overlay {
            position: fixed;
            inset: 0;
            z-index: 1000;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            background: rgba(20, 24, 31, 0.34);
            backdrop-filter: blur(6px);
        }

        .user-name-overlay.is-collapsed {
            display: none;
        }

        .user-name-card {
            width: min(440px, calc(100vw - 40px));
            display: grid;
            gap: 10px;
            padding: 18px;
            border-radius: 16px;
            border: 1px solid rgba(255,255,255,0.34);
            background: linear-gradient(180deg, rgba(251,252,248,0.88), rgba(244,247,238,0.82));
            box-shadow: 0 18px 42px rgba(15, 23, 42, 0.22);
            color: #374628;
        }

        .user-name-title {
            font-size: 18px;
            font-weight: 700;
            letter-spacing: -0.02em;
        }

        .user-name-subtitle {
            font-size: 13px;
            line-height: 1.45;
            color: #55624a;
        }

        .user-name-disclaimer {
            font-size: 12px;
            line-height: 1.45;
            color: #5f6b53;
            padding: 10px 12px;
            border-radius: 10px;
            background: rgba(255,255,255,0.48);
            border: 1px solid rgba(55, 70, 40, 0.10);
        }

        .user-name-disclaimer a {
            color: inherit;
            font-weight: 700;
        }

        .user-name-input {
            width: 100%;
            min-height: 40px;
            padding: 0 12px;
            border-radius: 10px;
            border: 1px solid rgba(55, 70, 40, 0.18);
            background: rgba(255,255,255,0.70);
            color: #374628;
            font-size: 14px;
            outline: none;
        }

        .user-name-input:focus {
            border-color: rgba(63, 95, 149, 0.42);
            box-shadow: 0 0 0 3px rgba(63, 95, 149, 0.12);
        }

        .user-name-error {
            min-height: 18px;
            font-size: 12px;
            color: #a33a2a;
        }

        .user-name-actions {
            display: flex;
            justify-content: flex-end;
            gap: 8px;
        }

        .status-dot.is-pending {
            background-color: #f59e0b !important;
            box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.55);
            animation: pending-pulse 1.2s ease-out infinite;
        }

        @keyframes pending-pulse {
            0% {
                box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.55);
            }
            100% {
                box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
            }
        }

        .field-label {
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: #666;
            margin-top: 4px;
        }

        .field-textarea {
            width: 100%;
            min-height: 80px;
            resize: vertical;
            border-radius: 4px;
            border: 1px solid #ccc;
            padding: 6px 8px;
            font-family: monospace;
            font-size: 12px;
            box-sizing: border-box;
        }

        .starter-panel {
            display: grid;
            gap: 8px;
            padding: 8px 9px 9px;
            border: 1px solid #dfe6ef;
            border-radius: 10px;
            background: linear-gradient(180deg, #fbfcfe 0%, #f5f8fc 100%);
        }

        .map-starter-panel {
            position: absolute;
            top: 14px;
            left: 14px;
            right: auto;
            width: min(380px, calc(100% - 28px));
            z-index: 19;
            padding: 10px 11px 11px;
            border-color: rgba(214, 224, 237, 0.88);
            background: linear-gradient(180deg, rgba(251, 252, 254, 0.92) 0%, rgba(244, 248, 252, 0.86) 100%);
            box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
        }

        .starter-panel.is-collapsed {
            display: none;
        }

        .starter-panel-header {
            display: flex;
            align-items: start;
            justify-content: space-between;
            gap: 10px;
        }

        .starter-panel-copy {
            display: grid;
            gap: 3px;
        }

        .starter-panel-title {
            color: #243246;
            font-size: 12px;
            font-weight: 700;
            letter-spacing: -0.01em;
        }

        .starter-panel-subtitle {
            color: #64748b;
            font-size: 10px;
            line-height: 1.35;
        }

        .starter-panel-close,
        .starter-panel-toggle {
            padding: 0;
            border: 0;
            background: transparent;
            color: #64748b;
            font-size: 11px;
            font-weight: 600;
            cursor: pointer;
            text-decoration: underline;
            text-underline-offset: 2px;
            white-space: nowrap;
        }

        .starter-panel-close:hover,
        .starter-panel-toggle:hover {
            color: #334155;
        }

        .starter-examples-list {
            display: grid;
            gap: 6px;
        }

        .starter-example-card {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            align-items: center;
            gap: 8px;
            padding: 7px 8px;
            border: 1px solid #dce5ef;
            border-radius: 8px;
            background: rgba(255,255,255,0.82);
        }

        .map-starter-panel .starter-example-card {
            background: rgba(255,255,255,0.74);
            border-color: rgba(216, 225, 236, 0.94);
        }

        .starter-example-copy {
            min-width: 0;
            display: grid;
            gap: 2px;
        }

        .starter-example-title {
            color: #1e293b;
            font-size: 11px;
            font-weight: 700;
        }

        .starter-example-description {
            color: #64748b;
            font-size: 10px;
            line-height: 1.3;
        }

        .starter-example-actions {
            display: flex;
            align-items: center;
            gap: 5px;
            flex-wrap: nowrap;
            justify-content: flex-end;
        }

        .starter-example-btn {
            min-height: 24px;
            padding: 3px 8px;
            border: 1px solid #d5deea;
            border-radius: 7px;
            background: #ffffff;
            color: #334155;
            font-size: 10px;
            font-weight: 600;
            cursor: pointer;
            white-space: nowrap;
        }

        .starter-example-btn.is-primary {
            background: #eef4fb;
            color: #1d4ed8;
            border-color: #cfe0f5;
        }

        .starter-example-btn:hover {
            background: #f8fafc;
            border-color: #c8d5e4;
        }

        .starter-example-btn.is-primary:hover {
            background: #e3eefb;
            border-color: #bdd4f3;
        }

        .starter-panel-footer {
            display: flex;
            align-items: center;
            justify-content: flex-start;
        }

        .map-starter-panel .starter-panel-footer {
            padding-top: 1px;
        }

        .editor-header-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            flex-wrap: wrap;
        }

        .editor-header-actions {
            display: inline-flex;
            align-items: center;
            justify-content: flex-end;
            gap: 6px;
            flex-wrap: wrap;
        }

        .editor-mode-select {
            min-height: 31px;
            padding: 5px 8px;
            border-radius: 7px;
            border: 1px solid #cfd6e2;
            background: linear-gradient(180deg, #ffffff, #f2f5f9);
            color: #526070;
            font-size: 11px;
            font-weight: 700;
            cursor: pointer;
        }

        .starter-guide-btn {
            padding: 0;
            border: 0;
            background: transparent;
            color: #64748b;
            font-size: 11px;
            font-weight: 600;
            cursor: pointer;
            text-decoration: underline;
            text-underline-offset: 2px;
        }

        .starter-guide-btn:hover {
            color: #334155;
        }

        .editor-wrap {
            position: relative;
            display: flex;
            flex: 1 1 auto;
            min-height: 120px;
        }

        #editor {
            min-height: 120px;
            flex: 1 1 auto;              /* grows/shrinks with sidebarTop */
            height: auto;
            resize: none;                /* let the splitter control height */
            padding-right: 34px;
            padding-bottom: 22px;         /* keep last line above the native horizontal scrollbar */
            position: relative;
            z-index: 1;
            line-height: 1.35;
        }

        .editor-syntax-highlight {
            position: absolute;
            inset: 0;
            margin: 0;
            min-height: 120px;
            border: 1px solid transparent;
            border-radius: 4px;
            padding: 6px 34px 22px 8px;
            box-sizing: border-box;
            overflow: auto;
            pointer-events: none;
            white-space: pre;
            font-family: monospace;
            font-size: 12px;
            line-height: 1.35;
            color: #243044;
            background: #fff;
            z-index: 0;
        }

        .editor-syntax-highlight::-webkit-scrollbar {
            display: none;
        }

        .editor-syntax-highlight {
            scrollbar-width: none;
        }

        .editor-wrap.syntax-active #editor {
            color: transparent;
            caret-color: #111827;
            background: transparent;
        }

        .editor-wrap.syntax-active #editor::selection {
            color: transparent;
            background: rgba(37, 99, 235, 0.22);
        }

        .editor-wrap.syntax-active #editor::placeholder {
            color: #8d96a8;
        }

        .editor-wrap:not(.syntax-active) .editor-syntax-highlight {
            display: none;
        }

        .syntax-comment { color: #7c8798; }
        .syntax-directive { color: #0b5cad; font-weight: 600; }
        .syntax-operator { color: #8a4baf; font-weight: 600; }
        .syntax-key { color: #a84512; }
        .syntax-value { color: #1f7a45; }
        .syntax-arrow { color: #b45309; font-weight: 600; }
        .syntax-number { color: #155e75; }
        .syntax-variable { color: #7c3aed; font-weight: 600; }

        .editor-style-gutter {
            position: absolute;
            top: 1px;
            right: 2px;
            bottom: 1px;
            width: 28px;
            pointer-events: none;
            overflow: hidden;
            z-index: 2;
            background: linear-gradient(90deg, rgba(255,255,255,0), #fff 42%);
        }

        .editor-style-swatch {
            position: absolute;
            right: 7px;
            width: 14px;
            height: 14px;
            border: 1px solid rgba(15, 23, 42, 0.35);
            border-radius: 4px;
            box-shadow: 0 1px 2px rgba(15, 23, 42, 0.18);
            cursor: pointer;
            pointer-events: auto;
            padding: 0;
        }

        .editor-style-swatch:hover {
            transform: scale(1.08);
            border-color: rgba(15, 23, 42, 0.65);
        }

        .natural-translate-details {
            margin-top: 6px;
            width: 100%;
            min-width: 0;
            box-sizing: border-box;
            display: flex;
            flex-direction: column;
            align-items: stretch;
            font-size: 12px;
            line-height: 1.35;
        }

        .natural-translate-details[hidden] {
            display: none;
        }

        .natural-translate-debug-btn {
            position: absolute;
            right: 8px;
            bottom: 8px;
            z-index: 4;
            min-height: 24px;
            padding: 0 8px;
            border: 1px solid #d8dee8;
            border-radius: 999px;
            background: rgba(248, 250, 252, 0.92);
            color: #64748b;
            font-size: 11px;
            font-weight: 700;
            cursor: pointer;
            box-shadow: 0 2px 8px rgba(15, 23, 42, 0.10);
            backdrop-filter: blur(6px);
        }

        .natural-translate-debug-btn:hover,
        .natural-translate-debug-btn.is-open {
            border-color: #b8c2d1;
            color: #334155;
            background: #eef3f8;
        }

        .natural-translate-debug-body {
            width: 100%;
            min-width: 0;
            box-sizing: border-box;
            margin-top: 6px;
            padding: 9px 10px;
            border: 1px solid #d8dee8;
            border-radius: 8px;
            background: #f8fafc;
            color: #334155;
        }

        .natural-translate-debug-body[hidden] {
            display: none;
        }

        .natural-translate-json {
            margin: 0;
            width: 100%;
            min-width: 0;
            box-sizing: border-box;
            max-height: 160px;
            overflow: auto;
            white-space: pre-wrap;
            word-break: break-word;
            color: #475569;
            font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
            font-size: 11px;
        }

        .natural-translate-json:not(:empty)::before {
            content: "JSON:\\A";
            color: #64748b;
            font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
            font-weight: 700;
            white-space: pre;
        }

        .mic-btn.is-recording {
            border-color: #c45555;
            background: #fff1f1;
            color: #7d2424;
        }

        .mic-btn.is-unavailable {
            border-style: dashed;
            color: #6b7280;
        }

        .map-speech-btn {
            position: absolute;
            right: 14px;
            bottom: 74px;
            z-index: 70;
            width: 46px;
            height: 46px;
            min-width: 46px;
            padding: 0;
            border-radius: 999px;
            align-items: center;
            justify-content: center;
            box-shadow: 0 10px 28px rgba(15, 23, 42, 0.22);
        }

        .map-speech-btn .btn-icon {
            font-size: 18px;
        }

        .speech-lang-select {
            min-height: 31px;
            padding: 5px 7px;
            border-radius: 7px;
            border: 1px solid #cfd6e2;
            background: linear-gradient(180deg, #ffffff, #f2f5f9);
            color: #3b4758;
            font-size: 11px;
            font-weight: 700;
            cursor: pointer;
        }

        .floating-sidebar-panel {
            position: absolute;
            top: 48px;
            left: 10px;
            right: 10px;
            z-index: 20;
            display: grid;
            gap: 8px;
            padding: 10px;
            border-radius: 10px;
            box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
            overflow: auto;
            max-height: min(58vh, 720px);
        }

        .floating-map-panel {
            position: absolute;
            top: 14px;
            left: 14px;
            width: min(420px, calc(100% - 28px));
            z-index: 20;
            display: grid;
            gap: 8px;
            padding: 10px;
            border-radius: 10px;
            box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
            overflow: auto;
            max-height: min(72vh, 820px);
            backdrop-filter: blur(8px);
        }

        .floating-sidebar-panel.is-collapsed {
            display: none;
        }

        .floating-map-panel.is-collapsed {
            display: none;
        }

        .floating-panel-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 10px;
        }

        .floating-panel-actions {
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }

        .floating-panel-title {
            font-size: 13px;
            font-weight: 700;
        }

        .floating-panel-subtitle {
            margin-top: 2px;
            font-size: 11px;
            line-height: 1.35;
            opacity: 0.85;
        }

        .floating-panel-close {
            border: 1px solid rgba(0,0,0,0.12);
            background: rgba(255,255,255,0.52);
            color: inherit;
            border-radius: 8px;
            font-size: 11px;
            padding: 5px 8px;
            cursor: pointer;
            white-space: nowrap;
        }

        .floating-panel-close:hover {
            background: rgba(255,255,255,0.74);
        }

        .help-panel {
            border: 1px solid #dfe6d5;
            background: linear-gradient(180deg, rgba(251,252,248,0.48), rgba(244,247,238,0.40));
            color: #374628;
        }

        .experimental-panel {
            left: auto;
            right: 14px;
            width: min(420px, calc(100% - 28px));
            border: 1px solid rgba(92, 110, 145, 0.22);
            background: linear-gradient(180deg, rgba(246,249,253,0.50), rgba(236,242,250,0.40));
            color: #30415f;
        }

        .experimental-panel .field-label {
            color: rgba(48, 65, 95, 0.82);
        }

        .experimental-panel .field-textarea {
            background: rgba(255,255,255,0.42);
            border-color: rgba(92, 110, 145, 0.22);
        }

        .experimental-panel .translate-model-info {
            color: rgba(48, 65, 95, 0.74);
        }

        .help-section {
            display: grid;
            gap: 8px;
        }

        .help-section-title {
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: #5f6b53;
        }

        .help-cheats {
            display: grid;
            gap: 6px;
            font-size: 12px;
            color: #45523b;
        }

        .help-cheats code,
        .help-nl-item code {
            padding: 1px 4px;
            border-radius: 4px;
            background: rgba(42, 52, 28, 0.05);
        }

        .help-nl-list {
            display: grid;
            gap: 8px;
        }

        .help-example-card {
            display: grid;
            gap: 6px;
            padding: 8px;
            border: 1px solid #d7dfd0;
            border-radius: 8px;
            background: rgba(255,255,255,0.45);
        }

        .help-example-title {
            font-size: 12px;
            font-weight: 600;
            color: #34402b;
        }

        .help-example-description {
            font-size: 12px;
            color: #607055;
            line-height: 1.35;
        }

        .help-example-actions {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
        }

        .help-nl-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            padding: 7px 8px;
            border: 1px solid #d7dfd0;
            border-radius: 8px;
            background: rgba(255,255,255,0.42);
        }

        .help-nl-item code {
            flex: 1 1 auto;
            white-space: normal;
            word-break: break-word;
            font-size: 12px;
            color: #374628;
        }

        .help-doc-details {
            display: grid;
            gap: 8px;
        }

        .help-doc-frame-wrap {
            border: 1px solid rgba(55, 70, 40, 0.14);
            border-radius: 10px;
            background: rgba(255,255,255,0.32);
            overflow: hidden;
            backdrop-filter: blur(4px);
        }

        .help-doc-frame {
            width: 100%;
            height: min(58vh, 640px);
            border: 0;
            display: block;
            background: rgba(255,255,255,0.18);
        }

        .parse-debug {
            display: none;
            gap: 6px;
            padding: 8px;
            border: 1px solid #e5c6c6;
            border-radius: 6px;
            background: #fff2f2;
            color: #7a2f2f;
            font-size: 12px;
        }

        .parse-debug.is-visible {
            display: grid;
        }

        .parse-debug-line {
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: #984848;
        }

        .parse-debug-source {
            margin: 0;
            white-space: pre-wrap;
            word-break: break-word;
            font-family: monospace;
            font-size: 12px;
            color: #612525;
        }

        .temporary-filter-banner {
            display: none;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            padding: 8px 9px;
            border: 1px solid #d7deea;
            border-radius: 9px;
            background: #f6f8fb;
            color: #475569;
            font-size: 12px;
        }

        .temporary-filter-banner.is-visible {
            display: flex;
        }

        .temporary-filter-text {
            min-width: 0;
            flex: 1 1 auto;
        }

        .temporary-filter-chip {
            display: inline-flex;
            align-items: center;
            max-width: 100%;
            padding: 4px 10px;
            border-radius: 999px;
            background: #dfe6f3;
            color: #33425c;
            font-family: monospace;
            font-size: 12px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .temporary-filter-close {
            flex: 0 0 auto;
            min-width: 58px;
            height: 28px;
            padding: 0 10px;
            border: 1px solid #cfd8e5;
            border-radius: 999px;
            background: #ffffff;
            color: #475569;
            cursor: pointer;
            line-height: 1;
            font-size: 11px;
            font-weight: 600;
            letter-spacing: 0.01em;
        }

        .temporary-filter-close:hover {
            background: #eef3f8;
            color: #1e293b;
        }

        #response {
            min-height: 36px;
            height: 36px;
            max-height: 56px;
            resize: none;
            flex: 0 0 auto;
            padding: 8px 10px;
            border-radius: 8px;
            border: 1px solid #d9e1ea;
            background: #f7f9fc;
            color: #334155;
            line-height: 1.35;
        }
        
        .field-textarea[readonly] {
            background: #f7f9fc;
        }

        .results-list {
            width: 100%;
            flex: 1 1 auto;
            overflow-y: auto;
            border-radius: 10px;
            border: 1px solid #d9e1ea;
            background: #fbfcfe;
            font-family: monospace;
            font-size: 12px;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
        }

        .results-pager {
            margin-top: 6px;
            font-size: 11px;
            color: #64748b;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
        }

        .results-pager button {
            padding: 4px 9px;
            font-size: 11px;
            border-radius: 7px;
            border: 1px solid #d4dbe5;
            background: #ffffff;
            color: #334155;
            cursor: pointer;
        }

        .results-pager button:disabled {
            opacity: 0.42;
            cursor: default;
        }

        .results-list-row {
            display: grid;
            grid-template-columns: 48px 120px minmax(0, 1fr);
            align-items: center;
            padding: 5px 8px;
            cursor: pointer;
            column-gap: 8px;
            font-variant-numeric: tabular-nums;
            position: relative;
            background: #fbfcfe;
            border-bottom: 1px solid #e8edf3;
            transition: background-color 0.14s ease, color 0.14s ease;
        }

        .results-list-row:hover {
            background: #f1f5f9 !important;
            color: #0f172a;
        }

        .results-list-row span.result-col-num {
            text-align: right;
            color: #94a3b8;
            border-right: 1px solid #e5eaf1;
            padding-right: 6px;
        }

        .results-list-row span.result-col-id {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            font-family: monospace;
            color: #0f172a;
            border-right: 1px solid #e5eaf1;
            padding: 0 6px;
        }

        .results-list-row span.result-col-id.is-object-link {
            color: #1d4ed8;
            font-weight: 600;
            cursor: pointer;
        }

        .results-list-row:hover span.result-col-id.is-object-link {
            color: #1e40af;
            text-decoration: underline;
        }

        .results-list-row span.result-meta {
            font-size: 11px;
            color: #64748b;
            white-space: nowrap;
        }

        .results-list-row:hover span.result-meta {
            color: #475569;
        }

        .result-link {
            color: #1d4ed8;
            text-decoration: none;
            font-weight: 500;
        }

        .results-list-row:hover .result-link {
            color: #1e40af;
            text-decoration: underline;
        }

        .count-result-row {
            position: relative;
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            align-items: center;
            gap: 8px;
            padding: 8px 10px;
            border-bottom: 1px solid #e4e8f0;
            background: #ffffff;
        }

        .count-result-row:nth-child(even) {
            background: #f7f9fc;
        }

        .count-result-main {
            min-width: 0;
        }

        .count-result-filter {
            display: block;
            font-family: monospace;
            color: #22314a;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .count-result-count {
            display: block;
            margin-top: 2px;
            font-size: 11px;
            color: #69758a;
        }

        .count-mode-help {
            padding: 8px 10px;
            font-size: 11px;
            color: #64748b;
            background: #f4f7fb;
            border-bottom: 1px solid #e2e8f0;
        }

        .editor-help {
            font-size: 11px;
            color: #64748b;
            margin-top: -2px;
        }

        .editor-shortcuts {
            color: #94a3b8;
            white-space: nowrap;
        }

        .results-help {
            font-size: 11px;
            color: #64748b;
            margin: -1px 0 6px;
        }

        .results-header-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
        }

        .results-download-btn {
            flex: 0 0 auto;
            min-height: 28px;
            padding: 4px 9px;
            font-size: 11px;
            border-radius: 7px;
        }

        .count-result-actions {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            flex-wrap: nowrap;
            justify-content: flex-end;
        }

        .count-result-btn {
            min-width: 0;
            padding: 5px 7px;
            border-radius: 6px;
            border: 1px solid #cbd5e1;
            background: #ffffff;
            color: #334155;
            font-size: 11px;
            cursor: pointer;
            white-space: nowrap;
        }

        .count-result-btn:hover {
            background: #eef2f7;
        }

        .count-result-btn.is-primary {
            border-color: #90aee8;
            background: #dfeaff;
            color: #22417c;
        }

        .count-result-btn.is-primary:hover {
            background: #d3e2ff;
        }

        .result-hover-tooltip {
            position: fixed;
            display: none;
            max-width: 360px;
            padding: 9px 11px;
            border-radius: 8px;
            border: 1px solid rgba(148, 163, 184, 0.45);
            background: rgba(15, 23, 42, 0.96);
            color: #f8fafc;
            font-size: 12px;
            line-height: 1.4;
            box-shadow: 0 12px 28px rgba(15, 23, 42, 0.26);
            z-index: 90;
            pointer-events: none;
        }

        .result-hover-tooltip.is-loading {
            color: #cbd5e1;
        }

        .result-hover-tooltip-title {
            display: block;
            margin-bottom: 5px;
            color: #93c5fd;
            font-size: 11px;
            font-weight: 600;
            letter-spacing: 0.01em;
        }

        .result-hover-tooltip-text {
            display: block;
        }

        .count-style-popover {
            position: fixed;
            display: none;
            gap: 8px;
            width: 210px;
            padding: 10px;
            border: 1px solid #d5dbe7;
            border-radius: 10px;
            background: #ffffff;
            box-shadow: 0 12px 30px rgba(15,23,42,0.14);
            z-index: 30;
        }

        .count-style-popover.is-visible {
            display: grid;
        }

        .count-style-row {
            display: grid;
            gap: 4px;
        }

        .count-style-title {
            font-size: 12px;
            font-weight: 600;
            color: #334155;
        }

        .count-style-row label {
            font-size: 11px;
            color: #475569;
        }

        .count-style-row input[type="text"] {
            width: 100%;
            min-width: 0;
            padding: 6px 8px;
            border: 1px solid #cbd5e1;
            border-radius: 6px;
            font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
            font-size: 12px;
            box-sizing: border-box;
        }

        .count-style-inline {
            display: grid;
            grid-template-columns: 40px 1fr auto;
            gap: 8px;
            align-items: center;
        }

        .count-style-inline input[type="color"] {
            width: 40px;
            height: 30px;
            padding: 0;
            border: 1px solid #cbd5e1;
            border-radius: 6px;
            background: #fff;
        }

        .count-style-inline input[type="range"] {
            width: 100%;
        }

        .count-style-value {
            width: 34px;
            text-align: right;
            font-size: 11px;
            color: #475569;
            font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
        }

        .count-style-actions {
            display: flex;
            justify-content: flex-end;
            gap: 6px;
            position: sticky;
            top: 0;
            z-index: 1;
            padding-bottom: 2px;
            background: #ffffff;
        }

        .col-resizer {
            position: absolute;
            top: 0;
            bottom: 0;
            width: 5px;
            cursor: col-resize;
            background: transparent;
            z-index: 20;
        }

        #suggestBox {
            position: absolute;
            z-index: 20;
            display: none;
            background: #ffffff;
            border: 1px solid #aaa;
            font-family: monospace;
            font-size: 12px;
            max-height: 200px;
            overflow-y: auto;
            box-shadow: 0 2px 6px rgba(0,0,0,0.2);
        }

        #suggestBox div {
            display: flex;
            align-items: baseline;
            gap: 10px;
            min-width: 220px;
            padding: 2px 6px;
            cursor: pointer;
        }

        #suggestBox .suggestion-main {
            flex: 1 1 auto;
            white-space: nowrap;
        }

        #suggestBox .suggestion-detail {
            flex: 0 0 auto;
            color: #6b7280;
            font-family: system-ui, sans-serif;
            font-size: 11px;
            white-space: nowrap;
        }

        #suggestBox div.highlight {
            background: #3874d9;
            color: #ffffff;
        }

        #suggestBox div.highlight .suggestion-detail {
            color: rgba(255,255,255,0.78);
        }

        #resultsSheetHeader {
            display: none;
        }

        #resultsSheetPeek {
            display: none;
        }

        .results-sheet-handle {
            width: 42px;
            height: 5px;
            border-radius: 999px;
            background: #cfd6e4;
            margin: 0 auto 8px;
        }

        .results-sheet-handle.flush {
            margin: 0;
        }

        #resultsSheetTitleRow {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
        }

        .field-label.tight {
            margin: 0;
        }

        #resultsSheetMeta {
            font-size: 12px;
            color: #667085;
        }

        .hidden-results-pane {
            display: none;
        }

        #zoomIndicator {
            position: absolute;
            bottom: 20px;
            left: 20px;
            padding: 6px 10px;
            background: rgba(0,0,0,0.6);
            color: white;
            border-radius: 4px;
            font-size: 12px;
            z-index: 100;
        }

        #routeMetrics {
            margin-top: 3px;
            white-space: nowrap;
        }

        #routeElevationProfile {
            position: absolute;
            left: 20px;
            bottom: 64px;
            width: min(360px, calc(100vw - 40px));
            height: 72px;
            padding: 0;
            border-radius: 8px;
            background: rgba(15, 23, 42, 0.72);
            box-shadow: 0 8px 24px rgba(15, 23, 42, 0.24);
            overflow: hidden;
            z-index: 100;
            pointer-events: none;
            backdrop-filter: blur(6px);
        }

        #routeElevationProfile svg {
            display: block;
            width: 100%;
            height: 100%;
        }

        .route-elevation-area {
            fill: rgba(56, 189, 248, 0.22);
        }

        .route-elevation-line {
            fill: none;
            stroke: rgba(125, 211, 252, 0.96);
            stroke-width: 2.2;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        .route-elevation-label {
            fill: rgba(255, 255, 255, 0.86);
            font-size: 10px;
            font-family: inherit;
        }

        .route-elevation-label-end {
            text-anchor: end;
        }

        .map-image-overlay-marker {
            display: block;
            padding: 0;
            border: 2px solid rgba(255,255,255,0.96);
            border-radius: 12px;
            overflow: hidden;
            background: #ffffff;
            box-shadow: 0 6px 18px rgba(15,23,42,0.22);
            cursor: pointer;
        }

        .map-image-overlay-marker img {
            display: block;
            width: 100%;
            height: 100%;
            object-fit: cover;
            background: #e5e7eb;
            opacity: 0.78;
        }

        #featureInfoPanel {
            position: absolute;
            top: 20px;
            right: 20px;
            width: min(360px, calc(100vw - 40px));
            min-width: 0;
            max-width: calc(100vw - 40px);
            padding: 12px 14px;
            background: rgba(255,255,255,0.965);
            border: 1px solid #dde4ee;
            border-radius: 12px;
            box-shadow: 0 10px 24px rgba(15,23,42,0.11);
            z-index: 120;
            display: none;
        }

        .feature-info-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            margin-bottom: 10px;
        }

        .feature-info-title {
            font-size: 12px;
            margin-bottom: 0;
            color: #475569;
            letter-spacing: 0.04em;
            text-transform: uppercase;
        }

        .feature-info-close {
            border: 1px solid #d6dfeb;
            background: #ffffff;
            color: #475569;
            border-radius: 999px;
            padding: 5px 10px;
            font-size: 11px;
            font-weight: 600;
            cursor: pointer;
            white-space: nowrap;
        }

        .feature-info-close:hover {
            background: #f8fafc;
            color: #1e293b;
        }

        .feature-info-meta {
            display: grid;
            gap: 5px;
            margin-bottom: 10px;
        }

        .feature-info-meta-row {
            display: grid;
            grid-template-columns: 52px minmax(0, 1fr);
            gap: 8px;
            align-items: start;
        }

        .feature-info-meta-label {
            color: #94a3b8;
            font-size: 10px;
            font-weight: 700;
            letter-spacing: 0.06em;
            text-transform: uppercase;
        }

        .feature-info-meta-value {
            color: #334155;
            font-size: 12px;
            font-weight: 500;
            font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
            word-break: break-word;
        }

        .feature-info-section-title {
            margin-bottom: 6px;
            color: #94a3b8;
            font-size: 10px;
            font-weight: 700;
            letter-spacing: 0.06em;
            text-transform: uppercase;
        }

        .feature-info-media {
            margin: 0 0 10px;
            border: 1px solid #e6ebf2;
            border-radius: 10px;
            overflow: hidden;
            background: #f8fafc;
            max-width: 100%;
        }

        .feature-info-media-loading {
            padding: 12px;
            color: #64748b;
            font-size: 11px;
        }

        .feature-info-media-link {
            display: block;
            background: #eef2f7;
        }

        .feature-info-media-image {
            display: block;
            width: 100%;
            max-height: 124px;
            object-fit: cover;
            background: #eef2f7;
        }

        .feature-info-media-caption {
            display: grid;
            gap: 2px;
            padding: 8px 10px;
            border-top: 1px solid #e6ebf2;
            background: rgba(255,255,255,0.94);
        }

        .feature-info-media-caption-title {
            color: #334155;
            font-size: 11px;
            font-weight: 600;
        }

        .feature-info-media-caption-meta {
            color: #94a3b8;
            font-size: 10px;
            font-weight: 700;
            letter-spacing: 0.04em;
            text-transform: uppercase;
        }

        .feature-info-table-wrap {
            border: 1px solid #e6ebf2;
            border-radius: 10px;
            overflow: hidden;
            background: #fbfcfd;
            max-height: 206px;
            overflow-y: auto;
        }

        .feature-info-table {
            width: 100%;
            border-collapse: collapse;
            table-layout: fixed;
        }

        .feature-info-table th,
        .feature-info-table td {
            padding: 6px 9px;
            border-bottom: 1px solid #e9eef5;
            vertical-align: top;
            text-align: left;
            font-size: 11px;
            font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
            word-break: break-word;
        }

        .feature-info-table tr:last-child th,
        .feature-info-table tr:last-child td {
            border-bottom: 0;
        }

        .feature-info-tag-row:hover th,
        .feature-info-tag-row:hover td {
            background: #f3f7fb;
        }

        .feature-info-tag-row {
            cursor: pointer;
        }

        .feature-info-table th {
            width: 34%;
            background: rgba(241, 245, 249, 0.92);
            color: #475569;
            font-weight: 600;
        }

        .feature-info-table td {
            color: #1e293b;
            background: rgba(255,255,255,0.92);
        }

        .feature-info-tag-value-cell {
            position: relative;
        }

        .feature-info-tag-value-text {
            display: block;
            min-width: 0;
        }

        .feature-info-tag-actions {
            position: absolute;
            top: 50%;
            right: 8px;
            display: inline-flex;
            align-items: center;
            justify-content: flex-end;
            gap: 6px;
            opacity: 0;
            transform: translateY(calc(-50% + 1px));
            transition: opacity 0.12s ease, transform 0.12s ease;
            pointer-events: none;
            padding-left: 12px;
            background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.92) 18%, rgba(255,255,255,0.98) 100%);
        }

        .feature-info-tag-row:hover .feature-info-tag-actions,
        .feature-info-tag-row:focus-within .feature-info-tag-actions {
            opacity: 1;
            transform: translateY(-50%);
            pointer-events: auto;
        }

        .feature-info-tag-action {
            min-height: 30px;
            min-width: 0;
            padding: 0 9px;
            border: 1px solid #d6dfeb;
            background: #ffffff;
            color: #475569;
            border-radius: 9px;
            font-size: 11px;
            font-weight: 600;
            line-height: 1;
            white-space: nowrap;
            font-family: inherit;
            cursor: pointer;
            box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset;
        }

        .feature-info-tag-action:hover {
            background: #eef4fb;
            color: #1e3a8a;
            border-color: #cbd9eb;
        }

        .feature-info-raw {
            color: #334155;
            font-size: 11px;
            line-height: 1.45;
            font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
            white-space: pre-wrap;
            word-break: break-word;
        }

        @media (max-width: 820px) {
            html, body {
                overflow: auto;
            }

            #app {
                flex-direction: column;
                height: auto;
                min-height: var(--app-height);
            }

            #sidebar {
                width: 100% !important;
                min-width: 0;
                max-width: none;
                border-right: 0;
                border-bottom: 1px solid #d0d0d0;
                box-shadow: 0 2px 10px rgba(0,0,0,0.08);
                padding:
                    max(8px, env(safe-area-inset-top))
                    max(8px, env(safe-area-inset-right))
                    8px
                    max(8px, env(safe-area-inset-left));
                gap: 8px;
                overflow: visible;
            }

            #sidebarTop {
                min-height: 0;
                flex-basis: auto !important;
            }

            body.mobile-query-collapsed #sidebarTop {
                display: none;
            }

            #sidebarBottom {
                display: none;
                min-height: 0;
                max-height: min(42dvh, 320px);
                background: rgba(255,255,255,0.98);
                border: 1px solid #d0d7e2;
                border-radius: 10px;
                box-shadow: 0 6px 18px rgba(15,23,42,0.12);
                padding: 10px 10px 12px;
                overflow: hidden;
            }

            body.results-sheet-open #sidebarBottom {
                display: flex;
            }

            #resultsSheetHeader {
                display: block;
                padding-bottom: 8px;
                border-bottom: 1px solid #e5e7eb;
                margin-bottom: 8px;
            }

            #resultsSheetPeek {
                display: none;
                align-items: center;
                justify-content: space-between;
                gap: 10px;
                min-height: 40px;
                cursor: pointer;
            }

            body.results-sheet-open #resultsSheetPeek {
                display: none;
            }

            #resultsSheetPeekText {
                font-size: 13px;
                font-weight: 600;
                color: #334155;
            }

            #resultsSheetCloseBtn {
                padding: 6px 10px;
                border-radius: 999px;
                border: 1px solid #cbd5e1;
                background: #f8fafc;
                color: #334155;
                font-size: 12px;
            }

            .results-help {
                display: none;
            }

            .results-sheet-handle {
                display: none;
            }

            #divider,
            #hDivider,
            .col-resizer {
                display: none !important;
            }

            #map {
                height: min(74dvh, 760px);
                min-height: 420px;
            }

            .map-speech-btn {
                right: 12px;
                bottom: calc(14px + env(safe-area-inset-bottom));
            }

            .mobile-toolbar-toggle {
                display: none;
                position: fixed;
                z-index: 130;
                top: max(8px, env(safe-area-inset-top));
                left: max(8px, env(safe-area-inset-left));
                width: 36px;
                height: 36px;
                min-width: 36px;
                min-height: 36px;
                padding: 0;
                align-items: center;
                justify-content: center;
                border: 1px solid rgba(203, 213, 225, 0.95);
                border-radius: 12px;
                background: rgba(255, 255, 255, 0.9);
                box-shadow: 0 8px 22px rgba(15, 23, 42, 0.16);
                backdrop-filter: blur(12px);
                -webkit-backdrop-filter: blur(12px);
                color: #334155;
                pointer-events: auto;
                touch-action: manipulation;
            }

            .top-row {
                display: flex;
                flex-wrap: nowrap;
                overflow-x: auto;
                gap: 6px;
                padding-bottom: 2px;
                margin-bottom: 0;
                scrollbar-width: none;
            }

            .top-row::-webkit-scrollbar {
                display: none;
            }

            .top-row > * {
                flex: 0 0 auto;
                min-width: 0;
            }

            #wsStatus {
                flex: 0 0 auto;
                align-self: center;
                margin-left: 2px;
            }

            .btn-primary,
            .btn-secondary,
            .toggle-chip {
                width: auto;
                min-height: 34px;
                padding: 6px 10px;
                font-size: 12px;
                white-space: nowrap;
            }

            .mobile-only {
                display: inline-flex;
            }

            #queryToggleBtn {
                width: 34px;
                min-width: 34px;
                padding: 0;
                justify-content: center;
            }

            #queryToggleBtn .btn-label {
                display: none;
            }

            .field-label {
                margin-top: 0;
            }

            .editor-header-row {
                gap: 6px;
            }

            .editor-header-actions {
                gap: 5px;
            }

            .editor-mode-select {
                max-width: 94px;
            }

            .field-textarea {
                font-size: 16px;
            }

            #editor {
                min-height: 132px;
                max-height: 34dvh;
            }

            .editor-syntax-highlight {
                min-height: 132px;
                max-height: 34dvh;
                font-size: 16px;
            }

            .editor-wrap {
                min-height: 132px;
                max-height: 34dvh;
            }

            .starter-example-actions {
                gap: 8px;
            }

            .starter-example-btn {
                min-height: 30px;
            }

            #response {
                min-height: 48px;
                height: 48px;
                max-height: 72px;
            }

            .results-list {
                min-height: 160px;
                max-height: min(22dvh, 180px);
            }

            .results-pager {
                gap: 10px;
                flex-wrap: wrap;
            }

            .results-pager button {
                min-height: 34px;
                padding: 6px 10px;
            }

            .results-list-row {
                grid-template-columns: 40px minmax(84px, 96px) minmax(0, 1fr);
                padding: 6px 8px;
            }

            .results-list-row span.result-col-id,
            .results-list-row span.result-meta {
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
            }

            #featureInfoPanel {
                top: auto !important;
                right: 10px !important;
                left: 10px !important;
                bottom: calc(8px + env(safe-area-inset-bottom)) !important;
                width: auto !important;
                min-width: 0 !important;
                max-width: none !important;
                max-height: min(44dvh, 360px) !important;
                font-size: 14px !important;
                padding: 10px 12px 12px !important;
                border-radius: 16px !important;
                overflow: auto !important;
                box-shadow: 0 18px 48px rgba(15,23,42,0.24) !important;
            }

            #featureInfoPanel .feature-info-meta-row {
                grid-template-columns: 48px minmax(0, 1fr);
            }

            #featureInfoPanel .feature-info-table th,
            #featureInfoPanel .feature-info-table td {
                font-size: 10px;
                padding: 5px 7px;
            }

            #featureInfoPanel .feature-info-table th {
                width: 42%;
            }

            #featureInfoPanel .feature-info-table-wrap {
                max-height: min(22dvh, 180px);
            }

            #featureInfoPanel .feature-info-media-image {
                max-height: 78px;
            }

            #featureInfoPanel .feature-info-tag-actions {
                display: none;
            }

            #featureInfoPanel .feature-info-tag-value-cell {
                padding-right: 0;
            }

        }

        @media (max-width: 820px) and (orientation: landscape), (max-width: 900px) and (max-height: 520px) {
            #sidebar {
                padding:
                    max(6px, env(safe-area-inset-top))
                    max(8px, env(safe-area-inset-right))
                    6px
                    max(8px, env(safe-area-inset-left));
                gap: 6px;
            }

            .top-row {
                display: flex;
                flex-wrap: nowrap;
                overflow-x: auto;
                gap: 6px;
                padding-bottom: 2px;
                scrollbar-width: none;
            }

            .top-row::-webkit-scrollbar {
                display: none;
            }

            .top-row > * {
                flex: 0 0 auto;
            }

            .btn-primary,
            .btn-secondary,
            .toggle-chip {
                width: auto;
                min-height: 30px;
                padding: 5px 9px;
                font-size: 11px;
                white-space: nowrap;
            }

            #wsStatus {
                flex: 0 0 auto;
                justify-self: auto;
            }

            body.mobile-query-collapsed #sidebar {
                padding-bottom: 2px;
            }

            #map {
                height: min(74dvh, 420px);
                min-height: 260px;
            }

            #editor {
                min-height: 88px;
                max-height: 24dvh;
            }

            .editor-wrap {
                min-height: 88px;
                max-height: 24dvh;
            }

            #response {
                min-height: 42px;
                height: 42px;
                max-height: 64px;
            }

            #sidebarBottom {
                max-height: min(52dvh, 260px);
            }

            .results-list {
                min-height: 110px;
                max-height: min(24dvh, 140px);
            }
        }

        @media (max-width: 480px) {
            #sidebar {
                padding:
                    max(8px, env(safe-area-inset-top))
                    max(8px, env(safe-area-inset-right))
                    8px
                    max(8px, env(safe-area-inset-left));
            }

            .top-row {
                gap: 5px;
            }

            .btn-primary,
            .btn-secondary,
            .toggle-chip {
                font-size: 12px;
                min-height: 32px;
                padding: 6px 9px;
            }

            #locBtn .btn-label,
            #queryToggleBtn .btn-label,
            #shareBtn .btn-label,
            #helpToggleBtn .btn-label,
            #toggleBaseBtn .toggle-label {
                display: none;
            }

            #map {
                height: min(76dvh, 780px);
                min-height: 440px;
            }

            .results-list-row {
                grid-template-columns: 32px minmax(72px, 88px) minmax(0, 1fr);
                column-gap: 6px;
            }

            .results-list-row span.result-col-num,
            .results-list-row span.result-meta {
                font-size: 10px;
            }

            .starter-panel {
                padding: 8px;
            }

            .map-starter-panel {
                top: 10px;
                left: 10px;
                width: auto;
                padding: 9px 10px 10px;
            }

            .map-geocode-bar {
                left: max(10px, env(safe-area-inset-left));
                right: max(54px, calc(env(safe-area-inset-right) + 46px));
                width: auto;
                max-width: none;
            }

            .route-profile-select {
                flex: 0 0 78px;
                height: 34px;
                font-size: 10px;
                padding: 0 4px;
            }

            .route-profile-edit-btn {
                flex: 0 0 34px;
                width: 34px;
                height: 34px;
                padding: 0;
                overflow: hidden;
                text-indent: -999px;
                position: relative;
            }

            .route-profile-edit-btn::after {
                content: "✎";
                position: absolute;
                inset: 0;
                display: flex;
                align-items: center;
                justify-content: center;
                text-indent: 0;
                font-size: 15px;
            }

            .route-profile-editor-overlay {
                top: 58px;
                left: max(10px, env(safe-area-inset-left));
                right: max(10px, env(safe-area-inset-right));
                width: auto;
            }

            .route-profile-editor-card {
                width: 100%;
                max-height: calc(100vh - 76px);
                padding: 14px;
                border-radius: 10px;
            }

            .route-profile-textarea {
                min-height: 260px;
                font-size: 12px;
            }

            .map-geocode-bar .geocode-input {
                height: 34px;
                font-size: 16px;
                line-height: 1.2;
                padding: 0 10px;
            }

            .map-locate-btn {
                top: calc(max(8px, env(safe-area-inset-top)) + 108px);
                right: max(10px, env(safe-area-inset-right));
                width: 34px;
                min-width: 34px;
                height: 34px;
                min-height: 34px;
            }

            .geocode-results {
                left: max(10px, env(safe-area-inset-left));
                right: max(10px, env(safe-area-inset-right));
                width: auto;
                max-height: min(50dvh, calc(100% - 118px));
            }

            #zoomIndicator {
                left: max(8px, env(safe-area-inset-left));
                bottom: max(8px, env(safe-area-inset-bottom));
                max-width: min(72vw, 320px);
                padding: 4px 7px;
                border-radius: 4px;
                font-size: 10px;
                line-height: 1.18;
            }

            #routeMetrics {
                max-width: min(72vw, 320px);
                margin-top: 2px;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
            }

            #routeElevationProfile {
                left: max(8px, env(safe-area-inset-left));
                bottom: calc(max(8px, env(safe-area-inset-bottom)) + 44px);
                width: min(78vw, 300px);
                height: 58px;
                border-radius: 7px;
            }

            .geocode-media-preview-panel {
                left: max(10px, env(safe-area-inset-left));
                right: max(10px, env(safe-area-inset-right));
                top: auto;
                bottom: max(10px, env(safe-area-inset-bottom));
                width: auto;
                max-height: min(58dvh, 500px);
                min-height: 0;
                border-radius: 16px;
                grid-template-columns: 1fr;
                grid-template-rows: minmax(160px, 0.95fr) auto;
            }

            .geocode-media-preview-image-wrap {
                min-height: 160px;
                max-height: 30dvh;
            }

            .geocode-media-preview-image {
                max-height: 30dvh;
                min-height: 0;
            }

            .geocode-media-preview-caption {
                max-height: 24dvh;
                padding: 14px 14px 13px;
            }

            .geocode-media-preview-title {
                padding-right: 64px;
            }

            .geocode-media-preview-close {
                min-height: 34px;
                padding: 6px 12px;
            }

            #featureInfoPanel {
                left: 8px !important;
                right: 8px !important;
                bottom: calc(6px + env(safe-area-inset-bottom)) !important;
                max-height: min(46dvh, 340px) !important;
                padding: 9px 10px 10px !important;
            }

            #featureInfoPanel .feature-info-title {
                font-size: 11px;
            }

            #featureInfoPanel .feature-info-close {
                padding: 4px 9px;
                font-size: 10px;
            }

            #featureInfoPanel .feature-info-table th {
                width: 46%;
            }

            .starter-example-card {
                grid-template-columns: 1fr;
                align-items: start;
                padding: 8px;
            }
        }

        @media (max-width: 820px) {
            html,
            body {
                overflow: hidden;
            }

            #app {
                height: var(--app-height);
                min-height: 0;
                overflow: hidden;
            }

            #sidebar {
                flex: 0 0 auto;
                max-height: calc(var(--app-height) - 220px);
                overflow: auto;
            }

            #map {
                flex: 1 1 auto;
                height: auto;
                min-height: 0;
            }

            .editor-help {
                display: none;
            }

            body.mobile-query-collapsed #app {
                position: relative;
                height: var(--app-height);
                min-height: 0;
                overflow: hidden;
            }

            body.mobile-query-collapsed #map {
                position: absolute;
                inset: 0;
                width: 100%;
                height: var(--app-height);
                min-height: 0;
            }

            body.mobile-query-collapsed #sidebar {
                position: absolute;
                top: 0;
                left: 0;
                right: 0;
                z-index: 20;
                width: 100% !important;
                max-height: none;
                overflow: visible;
                pointer-events: none;
                background: transparent;
                border: 0;
                box-shadow: none;
                padding:
                    max(8px, env(safe-area-inset-top))
                    max(8px, env(safe-area-inset-right))
                    0
                    max(8px, env(safe-area-inset-left));
            }

            body.mobile-query-collapsed .top-row {
                width: max-content;
                max-width: calc(100vw - max(8px, env(safe-area-inset-left)) - max(8px, env(safe-area-inset-right)));
                pointer-events: auto;
                background: rgba(255,255,255,0.86);
                border: 1px solid rgba(203,213,225,0.9);
                border-radius: 14px;
                box-shadow: 0 8px 24px rgba(15,23,42,0.14);
                backdrop-filter: blur(12px);
                -webkit-backdrop-filter: blur(12px);
                padding: 4px;
            }

            body.mobile-query-collapsed .mobile-toolbar-toggle {
                display: inline-flex;
            }

            body.mobile-query-collapsed:not(.mobile-toolbar-open) .top-row {
                display: none;
            }

            body.mobile-query-collapsed.mobile-toolbar-open .top-row {
                padding-left: 44px;
            }

            body.mobile-query-collapsed:not(.mobile-toolbar-open) .map-geocode-bar {
                top: max(8px, env(safe-area-inset-top));
                left: max(52px, calc(env(safe-area-inset-left) + 52px));
            }

            body.mobile-query-collapsed:not(.mobile-toolbar-open) .geocode-results {
                top: calc(max(8px, env(safe-area-inset-top)) + 42px);
            }

            body.mobile-query-collapsed.mobile-toolbar-open .map-geocode-bar {
                top: calc(max(8px, env(safe-area-inset-top)) + 52px);
                left: max(10px, env(safe-area-inset-left));
            }

            body.mobile-query-collapsed.mobile-toolbar-open .geocode-results {
                top: calc(max(8px, env(safe-area-inset-top)) + 92px);
                max-height: min(46dvh, calc(100% - 150px));
            }

            body.mobile-query-collapsed.results-sheet-open #sidebarBottom {
                position: fixed;
                left: max(8px, env(safe-area-inset-left));
                right: max(8px, env(safe-area-inset-right));
                bottom: max(8px, env(safe-area-inset-bottom));
                z-index: 21;
                max-height: min(52dvh, 360px);
                pointer-events: auto;
            }
        }
