/* Stretchy console styles
 * Moved out of index.html unchanged. Edit it here; run `node scripts/sync-html.js` to embed it in the engine. */
        :root {
            --bg-base: #090D16;
            --bg-card: rgba(17, 24, 39, 0.75);
            --bg-card-hover: rgba(31, 41, 55, 0.85);
            --border: rgba(255, 255, 255, 0.08);
            --border-active: rgba(99, 102, 241, 0.5);
            --primary: #6265EF;
            --primary-gradient: linear-gradient(135deg, #6265EF 0%, #A855F7 50%, #EC4899 100%);
            --accent-cyan: #06B6D4;
            --accent-emerald: #10B981;
            --text-main: #F3F4F6;
            --text-muted: #9CA3AF;
            --text-dim: #7A808D;
            --radius-md: 10px;
            --radius-lg: 16px;
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        html, body {
            max-width: 100%;
            overflow-x: hidden;
            width: 100%;
            box-sizing: border-box;
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            background-color: var(--bg-base);
            color: var(--text-main);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            background-image: 
                radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
                radial-gradient(circle at 85% 25%, rgba(236, 72, 153, 0.08) 0%, transparent 45%);
            background-attachment: fixed;
        }

        /* Top Navigation */
        header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 0.75rem;
            padding: 1rem 2rem;
            border-bottom: 1px solid var(--border);
            backdrop-filter: blur(16px);
            background: rgba(9, 13, 22, 0.8);
            position: sticky;
            top: 0;
            z-index: 100;
            max-width: 100%;
            box-sizing: border-box;
        }

        .brand {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            text-decoration: none;
            color: inherit;
        }

        .logo-icon {
            width: 36px;
            height: 36px;
            border-radius: 10px;
            background: var(--primary-gradient);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.25rem;
            box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
        }

        .brand-text {
            font-size: 1.25rem;
            font-weight: 700;
            letter-spacing: -0.5px;
            background: linear-gradient(120deg, #FFFFFF, #CBD5E1);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .brand-sub {
            font-size: 0.75rem;
            color: var(--text-muted);
            margin-left: 0.25rem;
            padding: 2px 8px;
            border-radius: 9999px;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid var(--border);
        }

        .nav-controls {
            display: flex;
            align-items: center;
            gap: 0.55rem;
            flex-wrap: wrap;
            max-width: 100%;
        }

        /* A compact page header (it took about 190px: padding, a 36px logo, and the user chip wrapped onto a third row). */
        body.demo-mode #demo-mode-notice { display: block !important; }
        header { padding: 0.45rem 1.25rem; gap: 0.5rem; }
        header .logo-icon, header .brand img { width: 28px; height: 28px; border-radius: 8px; }
        header .brand { gap: 0.5rem; }
        header .brand-text { font-size: 1.05rem; }
        header .nav-controls { gap: 0.3rem; }
        header .btn, header #userProfileBtn { padding: 0.25rem 0.5rem !important; font-size: 0.77rem !important; gap: 0.3rem !important; }
        header .index-selector-wrap { padding: 0.2rem 0.45rem; max-width: 190px; }

        .index-selector-wrap {
            display: flex;
            align-items: center;
            gap: 0.4rem;
            background: rgba(255, 255, 255, 0.04);
            padding: 0.35rem 0.65rem;
            border-radius: var(--radius-md);
            border: 1px solid var(--border);
            max-width: 220px;
        }

        .index-selector-wrap select {
            max-width: 155px;
            text-overflow: ellipsis;
            white-space: nowrap;
            overflow: hidden;
        }

        .nav-more-dropdown {
            position: absolute;
            top: calc(100% + 8px);
            right: 0;
            width: 250px;
            background: rgba(10, 15, 29, 0.98);
            border: 1px solid rgba(255, 255, 255, 0.14);
            border-radius: 12px;
            padding: 6px;
            box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7), 0 0 20px rgba(99, 102, 241, 0.2);
            backdrop-filter: blur(20px);
            z-index: 250;
            display: flex;
            flex-direction: column;
            gap: 3px;
        }

        .nav-more-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 10px;
            border-radius: 8px;
            background: transparent;
            border: none;
            color: #E2E8F0;
            cursor: pointer;
            text-align: left;
            width: 100%;
            transition: all 0.15s ease;
        }

        .nav-more-item:hover {
            background: rgba(99, 102, 241, 0.18);
            color: #FFFFFF;
        }

        .nav-more-text {
            display: flex;
            flex-direction: column;
        }

        .nav-more-title {
            font-size: 12px;
            font-weight: 600;
            color: #F8FAFC;
        }

        .nav-more-desc {
            font-size: 10px;
            color: #94A3B8;
        }

        .index-selector-wrap label {
            font-size: 0.75rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        select, input, button, textarea {
            font-family: inherit;
            color: inherit;
        }

        select {
            background: transparent;
            border: none;
            color: #60A5FA;
            font-weight: 600;
            font-size: 0.9rem;
            outline: none;
            cursor: pointer;
        }

        select option {
            background: #111827;
            color: var(--text-main);
        }

        .btn {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem 1rem;
            font-size: 0.85rem;
            font-weight: 500;
            border-radius: var(--radius-md);
            border: 1px solid var(--border);
            cursor: pointer;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            background: rgba(255, 255, 255, 0.04);
            color: var(--text-main);
        }

        .btn:hover {
            background: rgba(255, 255, 255, 0.08);
            border-color: rgba(255, 255, 255, 0.2);
            transform: translateY(-1px);
        }

        .btn-primary {
            background: var(--primary-gradient);
            border: none;
            color: #FFFFFF;
            box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
        }

        .btn-primary:hover {
            box-shadow: 0 6px 20px rgba(99, 102, 241, 0.55);
            filter: brightness(1.08);
        }

        /* Hero Search Area */
        .hero {
            max-width: 900px;
            margin: 2.5rem auto 1.5rem auto;
            width: 100%;
            padding: 0 1.5rem;
            text-align: center;
        }

        /* Wide screens: the search box and the data slicer sit side by side and the stack is as wide as the workspace below it (it used to be one centered 960px column with empty space on both sides). The inline max-width on each block needs !important to override. */
        @media (min-width: 1100px) {
            .hero {
                max-width: 1760px;
                margin: 1.25rem auto 1rem auto;
                display: grid;
                grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
                gap: 0 1.25rem;
                align-items: start;
            }
            .hero > .search-box-container,
            .hero > #querySlicerBar {
                max-width: none !important;
                margin: 0 !important;
            }
            .hero > #queryBuilderChamber,
            .hero > #histogramChamber {
                grid-column: 1 / -1;
                max-width: none !important;
            }
            /* The slicer is a narrower box now: tighter padding, and the column chips use its full width (label above, buttons below) instead of sharing a row with the buttons. */
            .hero > #querySlicerBar {
                padding: 8px 14px !important;
            }
            .hero > #querySlicerBar #schemaColumnsList {
                max-height: 6.4rem;
                overflow-y: auto;
                width: 100%;
            }
            .hero > #querySlicerBar > div:nth-of-type(3) > div:first-child {
                flex: 1 1 100% !important;
                flex-direction: column !important;
                align-items: flex-start !important;
                gap: 4px !important;
            }
        }

        .search-box-container {
            position: relative;
            margin-top: 1.5rem;
        }

        .search-input-wrapper {
            position: relative;
            display: flex;
            align-items: center;
        }

        .search-icon {
            position: absolute;
            left: 1.25rem;
            width: 22px;
            height: 22px;
            color: var(--text-muted);
            pointer-events: none;
        }

        .search-input {
            width: 100%;
            padding: 1.15rem 6.25rem 1.15rem 3.25rem;
            font-size: 1.05rem;
            background: rgba(17, 24, 39, 0.7);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            outline: none;
            color: #FFFFFF;
            backdrop-filter: blur(12px);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
            transition: all 0.25s ease;
        }

        .search-input::placeholder {
            color: var(--text-dim);
            opacity: 0.85;
            text-overflow: ellipsis;
            white-space: nowrap;
            overflow: hidden;
        }

        .search-input:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.25), 0 12px 35px rgba(0, 0, 0, 0.5);
        }

        .search-actions {
            position: absolute;
            right: 0.85rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            pointer-events: none;
        }

        /* the container lets clicks through to the input beneath it; its buttons still take them (the shortcut badge stays click-through) */
        .search-actions button,
        .search-actions .btn {
            pointer-events: auto;
        }

        .shortcut-badge {
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid var(--border);
            padding: 0.25rem 0.55rem;
            font-size: 0.72rem;
            border-radius: 6px;
            color: var(--text-muted);
            font-family: 'JetBrains Mono', monospace;
            user-select: none;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
            backdrop-filter: blur(4px);
        }

        .search-mode-bar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-top: 0.85rem;
            padding: 0 0.5rem;
            font-size: 0.825rem;
            color: var(--text-muted);
        }

        .mode-toggle {
            display: flex;
            background: rgba(255, 255, 255, 0.04);
            padding: 3px;
            border-radius: 8px;
            border: 1px solid var(--border);
            flex-wrap: wrap;
            max-width: 100%;
        }

        .mode-btn {
            background: transparent;
            border: none;
            padding: 4px 10px;
            font-size: 0.75rem;
            border-radius: 6px;
            cursor: pointer;
            color: var(--text-muted);
            transition: all 0.15s ease;
        }

        .mode-btn.active {
            background: var(--primary);
            color: #FFFFFF !important;
            font-weight: 600;
        }

        /* App Layout */
        .layout {
            max-width: 1760px;
            margin: 0 auto;
            width: 100%;
            padding: 1.5rem;
            display: grid;
            grid-template-columns: 280px minmax(0, 1fr);
            gap: 1.5rem;
            flex: 1;
            min-width: 0;
            box-sizing: border-box;
        }

        /* Sidebar */
        aside {
            display: flex;
            flex-direction: column;
            gap: 1.25rem;
        }

        .card {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            padding: 1.25rem;
            backdrop-filter: blur(12px);
        }

        .card-title {
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .stat-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.75rem;
        }

        .stat-item {
            background: rgba(255, 255, 255, 0.02);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            padding: 0.75rem;
        }

        .stat-val {
            font-size: 1.35rem;
            font-weight: 700;
            color: #FFFFFF;
            font-family: 'JetBrains Mono', monospace;
        }

        .stat-lbl {
            font-size: 0.7rem;
            color: var(--text-dim);
            text-transform: uppercase;
            margin-top: 0.25rem;
        }

        .facet-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.5rem 0.75rem;
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.02);
            border: 1px solid transparent;
            margin-bottom: 0.4rem;
            cursor: pointer;
            font-size: 0.85rem;
            transition: all 0.15s ease;
        }

        .facet-item:hover, .facet-item.selected {
            background: rgba(99, 102, 241, 0.12);
            border-color: rgba(99, 102, 241, 0.4);
            color: #FFFFFF;
        }

        .facet-count {
            background: rgba(255, 255, 255, 0.08);
            padding: 2px 7px;
            border-radius: 9999px;
            font-size: 0.75rem;
            font-family: 'JetBrains Mono', monospace;
            color: var(--accent-cyan);
        }

        /* Results Area */
        main {
            display: flex;
            flex-direction: column;
            gap: 1rem;
            min-width: 0;
            max-width: 100%;
            width: 100%;
            box-sizing: border-box;
            overflow-x: hidden;
        }

        .results-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 0.75rem;
            padding-bottom: 0.5rem;
            font-size: 0.9rem;
            color: var(--text-muted);
            max-width: 100%;
            min-width: 0;
            box-sizing: border-box;
        }

        .metrics-badge {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.8rem;
            color: var(--accent-emerald);
            background: rgba(16, 185, 129, 0.1);
            padding: 0.25rem 0.75rem;
            border-radius: 9999px;
            border: 1px solid rgba(16, 185, 129, 0.2);
        }

        .result-card {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            padding: 1.25rem 1.5rem;
            backdrop-filter: blur(12px);
            transition: all 0.2s ease;
            position: relative;
        }

        .result-card:hover {
            border-color: var(--border-active);
            background: var(--bg-card-hover);
            transform: translateY(-2px);
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
        }

        .result-top {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 1rem;
            margin-bottom: 0.5rem;
        }

        .result-title {
            font-size: 1.15rem;
            font-weight: 600;
            color: #FFFFFF;
        }

        .score-pill {
            display: inline-flex;
            align-items: center;
            gap: 0.25rem;
            padding: 0.2rem 0.6rem;
            border-radius: 9999px;
            font-size: 0.75rem;
            font-family: 'JetBrains Mono', monospace;
            background: rgba(99, 102, 241, 0.15);
            border: 1px solid rgba(99, 102, 241, 0.3);
            color: #A5B4FC;
            white-space: nowrap;
        }

        .result-desc {
            color: var(--text-muted);
            font-size: 0.925rem;
            line-height: 1.55;
            margin-bottom: 0.85rem;
        }

        .result-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 0.4rem;
            align-items: center;
        }

        .tag {
            font-size: 0.75rem;
            padding: 0.2rem 0.6rem;
            border-radius: 6px;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid var(--border);
            color: var(--text-muted);
        }

        .tag-price {
            background: rgba(16, 185, 129, 0.15);
            border-color: rgba(16, 185, 129, 0.3);
            color: #6EE7B7;
            font-weight: 600;
        }

        .tag-category {
            background: rgba(6, 182, 212, 0.15);
            border-color: rgba(6, 182, 212, 0.3);
            color: #67E8F9;
        }

        .result-actions {
            display: flex;
            gap: 0.5rem;
            margin-top: 0.75rem;
            padding-top: 0.75rem;
            border-top: 1px solid rgba(255, 255, 255, 0.04);
            justify-content: flex-end;
        }

        .json-drawer {
            display: none;
            margin-top: 0.75rem;
            padding: 1rem;
            background: #060911;
            border-radius: 8px;
            border: 1px solid var(--border);
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.8rem;
            color: #A5B4FC;
            white-space: pre-wrap;
            overflow-x: auto;
            max-height: 250px;
        }

        /* Ingested Documents Table & Explorer */
        #docsTableFilterBar {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin-bottom: 0.5rem;
            align-items: center;
            width: 100%;
            max-width: 100%;
            min-width: 0;
            box-sizing: border-box;
        }

        #docsTableSearch {
            min-width: 0 !important;
            max-width: 100% !important;
        }

        .docs-table-container {
            width: 100%;
            max-width: 100%;
            min-width: 0;
            overflow-x: auto;
            border-radius: var(--radius-lg);
            border: 1px solid var(--border);
            background: var(--bg-card);
            box-shadow: 0 4px 20px rgba(0,0,0,0.25);
            box-sizing: border-box;
            -webkit-overflow-scrolling: touch;
        }

        .docs-table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0;
            text-align: left;
            font-size: 0.85rem;
        }

        .docs-table th {
            background: rgba(255, 255, 255, 0.03);
            color: var(--text-muted);
            font-size: 0.725rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            padding: 0.6rem 0.65rem;
            border-bottom: 1px solid var(--border);
            font-weight: 600;
            white-space: normal;      /* long field names wrap instead of widening the table */
            line-height: 1.25;
        }

        .docs-table td {
            padding: 0.6rem 0.65rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.04);
            vertical-align: middle;
            overflow-wrap: break-word;    /* long values wrap at word breaks; a column never shrinks to a sliver (an unbroken string may widen the table, which scrolls sideways inside its box) */
        }

        .docs-table .tag-price, .docs-table .status-pill, .docs-table .score-pill {
            white-space: nowrap;
        }

        .doc-schema-table td {
            overflow-wrap: anywhere;
        }

        .doc-row {
            cursor: pointer;
            transition: background 0.15s ease;
        }

        .doc-row:hover {
            background: rgba(99, 102, 241, 0.06);
        }

        .doc-chip {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 2px 7px;
            border-radius: 4px;
            font-size: 0.725rem;
            font-family: 'JetBrains Mono', monospace;
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.08);
            margin: 2px 3px 2px 0;
            white-space: nowrap;
        }

        .doc-chip-key {
            color: #94A3B8;
            font-weight: 500;
        }

        .doc-chip-val {
            color: #F1F5F9;
            font-weight: 600;
        }

        .doc-drawer-content {
            background: #060911;
            border: 1px solid rgba(99, 102, 241, 0.25);
            border-radius: 8px;
            padding: 1.25rem;
            margin: 0.5rem 0;
            box-shadow: inset 0 2px 8px rgba(0,0,0,0.5);
        }

        .doc-schema-table {
            width: 100%;
            border-collapse: collapse;
            margin-bottom: 1rem;
            font-size: 0.8rem;
        }

        .doc-schema-table th {
            padding: 6px 10px;
            background: rgba(255,255,255,0.03);
            border-bottom: 1px solid rgba(255,255,255,0.08);
            color: var(--text-muted);
            text-transform: uppercase;
            font-size: 0.7rem;
        }

        .doc-schema-table td {
            padding: 6px 10px;
            border-bottom: 1px solid rgba(255,255,255,0.04);
        }

        /* Settings Tabs */
        .settings-tab-btn {
            padding: 0.5rem 1rem;
            border-radius: 8px;
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            border: 1px solid transparent;
            background: transparent;
            color: var(--text-muted);
            transition: all 0.2s ease;
        }

        .settings-tab-btn:hover {
            color: #FFFFFF;
            background: rgba(255, 255, 255, 0.04);
        }

        .settings-tab-btn.active {
            background: rgba(99, 102, 241, 0.15);
            border-color: rgba(99, 102, 241, 0.4);
            color: #A5B4FC;
        }

        /* Empty State */
        .empty-state {
            text-align: center;
            padding: 4rem 2rem;
            color: var(--text-muted);
            border: 1px dashed var(--border);
            border-radius: var(--radius-lg);
        }

        .empty-icon {
            font-size: 3rem;
            margin-bottom: 1rem;
            opacity: 0.5;
        }

        body.demo-mode #vsBtnAddDoc,
        body.demo-mode #vsBtnTotals {
            display: none !important;
        }

        /* Modal */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.75);
            backdrop-filter: blur(8px);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 200;
            padding: 1rem;
        }

        .modal {
            background: #0D131F;
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            width: 100%;
            max-width: 650px;
            padding: 1.5rem;
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
        }

        .modal-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 1.25rem;
        }

        .modal-title {
            font-size: 1.15rem;
            font-weight: 600;
        }

        .modal-close {
            background: transparent;
            border: none;
            color: var(--text-muted);
            font-size: 1.5rem;
            cursor: pointer;
        }

        .json-textarea {
            width: 100%;
            height: 280px;
            background: #060911;
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 1rem;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.85rem;
            color: #E2E8F0;
            resize: vertical;
            outline: none;
        }

        .json-textarea:focus {
            border-color: var(--primary);
        }

        .modal-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-top: 1.25rem;
        }

        /* Visual Data Studio & Tabular Results (Vector BI) */
        .vs-modal-container {
            width: 95vw !important;
            max-width: 1380px !important;
            height: 92vh !important;
            padding: 0 !important;
            border-radius: 16px !important;
            background: #090e1a !important;
            border: 1px solid rgba(255, 255, 255, 0.1) !important;
            display: flex !important;
            flex-direction: column !important;
            overflow: hidden !important;
            box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8) !important;
        }

        .vs-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 0.75rem;
            padding: 1rem 1.5rem;
            background: #070B14;
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
            max-width: 100%;
            box-sizing: border-box;
        }

        .vs-header-left {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .vs-icon-badge {
            width: 38px;
            height: 38px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .vs-title {
            font-size: 1.15rem;
            font-weight: 700;
            color: #FFFFFF;
            letter-spacing: -0.3px;
        }

        .vs-badge {
            font-size: 11px;
            font-weight: 600;
            background: rgba(139, 92, 246, 0.18);
            border: 1px solid rgba(139, 92, 246, 0.4);
            color: #C4B5FD;
            padding: 2px 8px;
            border-radius: 9999px;
        }

        .vs-subtitle {
            font-size: 12px;
            color: #94A3B8;
            margin-top: 2px;
        }

        .vs-header-right {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            flex-wrap: wrap;
        }

        .vs-view-switcher {
            display: flex;
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 8px;
            padding: 3px;
            gap: 2px;
        }

        .vs-switcher-btn {
            background: transparent;
            border: none;
            color: #94A3B8;
            padding: 6px 14px;
            font-size: 12px;
            font-weight: 600;
            border-radius: 6px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 6px;
            transition: all 0.15s ease;
        }

        .vs-switcher-btn:hover {
            color: #FFFFFF;
        }

        .vs-switcher-btn.active {
            background: #06B6D4;
            color: #000000;
            font-weight: 700;
            box-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
        }

        .vs-presets-ribbon {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 0.65rem 1.25rem;
            background: rgba(15, 23, 42, 0.75);
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
            overflow-x: auto;
            max-width: 100%;
            width: 100%;
            min-width: 0;
            box-sizing: border-box;
            white-space: nowrap;
            scrollbar-width: thin;
            -webkit-overflow-scrolling: touch;
        }

        .vs-presets-ribbon::-webkit-scrollbar {
            height: 4px;
        }

        .vs-presets-ribbon::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.2);
            border-radius: 4px;
        }

        .vs-presets-title {
            font-size: 11px;
            font-weight: 700;
            color: #38BDF8;
            letter-spacing: 0.5px;
            text-transform: uppercase;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .vs-presets-scroll {
            display: flex;
            align-items: center;
            gap: 8px;
            overflow-x: auto;
            max-width: 100%;
            min-width: 0;
            flex: 1 1 auto;
            box-sizing: border-box;
            -webkit-overflow-scrolling: touch;
        }

        .vs-preset-pill {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.12);
            color: #CBD5E1;
            padding: 4px 10px;
            font-size: 11px;
            font-weight: 600;
            border-radius: 9999px;
            cursor: pointer;
            transition: all 0.15s ease;
            white-space: nowrap;
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }

        .vs-preset-pill:hover {
            background: rgba(56, 189, 248, 0.15);
            border-color: rgba(56, 189, 248, 0.4);
            color: #38BDF8;
            transform: translateY(-1px);
            box-shadow: 0 2px 8px rgba(56, 189, 248, 0.2);
        }

        .vs-preset-pill:active {
            transform: translateY(0);
        }

        .vs-body {
            display: flex;
            flex: 1;
            overflow: hidden;
        }

        .vs-sidebar {
            width: 330px;
            min-width: 330px;
            background: #060A14;
            border-right: 1px solid rgba(255, 255, 255, 0.08);
            padding: 1.25rem;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 0.9rem;
        }

        .vs-label {
            display: block;
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: #94A3B8;
            margin-bottom: 5px;
        }

        .vs-select, .vs-input {
            width: 100%;
            background: #0D1424;
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            color: #F8FAFC;
            padding: 7px 10px;
            font-size: 12.5px;
            outline: none;
            transition: border-color 0.2s;
        }

        .vs-select:focus, .vs-input:focus {
            border-color: #06B6D4;
        }

        .vs-chart-cards-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 6px;
        }

        .vs-chart-card {
            background: #0D1424;
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 8px;
            padding: 8px 4px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 5px;
            cursor: pointer;
            font-size: 11px;
            font-weight: 500;
            color: #94A3B8;
            transition: all 0.2s ease;
            font-family: inherit;
            line-height: normal;
        }

        .vs-chart-card:hover {
            border-color: rgba(6, 182, 212, 0.4);
            color: #FFF;
        }

        .vs-chart-card.active {
            background: rgba(6, 182, 212, 0.12);
            border-color: #06B6D4;
            color: #06B6D4;
            box-shadow: 0 0 12px rgba(6, 182, 212, 0.25);
        }

        .vs-range {
            width: 100%;
            accent-color: #06B6D4;
            cursor: pointer;
        }

        .vs-checkbox-label {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 12px;
            color: #CBD5E1;
            cursor: pointer;
            user-select: none;
        }

        .vs-checkbox-label input {
            accent-color: #06B6D4;
            cursor: pointer;
        }

        /* The studio's plain buttons (Dashboards, Sidebar, the 3D chart options). The classes had no rule at all, so they showed as the browser's pale grey buttons with washed-out text on the dark page. */
        .vs-btn, .vs-btn-secondary {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-family: inherit;
            font-size: 12px;
            font-weight: 600;
            line-height: 1.2;
            padding: 6px 12px;
            border-radius: 8px;
            cursor: pointer;
            color: #E2E8F0;
            background: rgba(255, 255, 255, 0.07);
            border: 1px solid rgba(255, 255, 255, 0.16);
            transition: background 0.15s ease, border-color 0.15s ease;
        }
        .vs-btn:hover, .vs-btn-secondary:hover {
            background: rgba(255, 255, 255, 0.14);
            border-color: rgba(255, 255, 255, 0.3);
        }
        .vs-btn.svu-open {
            color: #FFFFFF;
            background: linear-gradient(135deg, #6366F1, #A855F7);
            border-color: transparent;
            box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
        }
        .vs-btn.svu-open:hover {
            filter: brightness(1.12);
        }

        .vs-btn-embed {
            width: 100%;
            background: #06B6D4;
            color: #000000;
            font-weight: 700;
            font-size: 13px;
            border-radius: 8px;
            padding: 10px;
            border: none;
            cursor: pointer;
            box-shadow: 0 4px 14px rgba(6, 182, 212, 0.4);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            transition: all 0.2s ease;
        }

        .vs-btn-embed:hover {
            filter: brightness(1.1);
            transform: translateY(-1px);
        }

        .vs-main-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            background: #090E1A;
            overflow-y: auto;
            overflow-x: hidden;
            min-height: 0;
            height: 100%;
        }

        .vs-chart-section {
            flex: 1 1 50%;
            min-height: 320px;
            display: flex;
            flex-direction: column;
            padding: 0.75rem 1.25rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
            overflow: hidden;
            position: relative;
        }

        .vs-chart-header {
            flex-shrink: 0;
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            margin-bottom: 0.4rem;
        }

        .vs-metric-pill {
            font-size: 11px;
            font-family: 'JetBrains Mono', monospace;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.12);
            color: #94A3B8;
            padding: 4px 10px;
            border-radius: 6px;
        }

        .vs-chart-body {
            flex: 1 1 auto;
            position: relative;
            min-height: 240px;
            height: 100%;
            overflow: hidden;
            width: 100%;
            display: flex;
            flex-direction: column;
            box-sizing: border-box;
        }

        .vs-panel-splitter {
            height: 6px;
            background: rgba(255, 255, 255, 0.06);
            border-top: 1px solid rgba(255, 255, 255, 0.08);
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
            cursor: row-resize;
            flex-shrink: 0;
            transition: background 0.15s;
            user-select: none;
        }
        .vs-panel-splitter:hover, .vs-panel-splitter.dragging {
            background: #6366F1;
        }

        .vs-sidebar.collapsed {
            width: 0 !important;
            min-width: 0 !important;
            padding: 0 !important;
            border-right: none !important;
            overflow: hidden !important;
        }

        .vs-table-section {
            flex: 1 1 50%;
            min-height: 240px;
            display: flex;
            flex-direction: column;
            padding: 0.75rem 1.25rem;
            overflow: hidden;
        }

        /* Dark mode custom scrollbars for Visual Studio */
        .vs-sidebar::-webkit-scrollbar,
        .vs-main-content::-webkit-scrollbar,
        .vs-chart-section::-webkit-scrollbar,
        .vs-chart-body::-webkit-scrollbar,
        .vs-table-wrapper::-webkit-scrollbar,
        .vs-stats-ribbon::-webkit-scrollbar {
            width: 6px;
            height: 6px;
        }
        .vs-sidebar::-webkit-scrollbar-track,
        .vs-main-content::-webkit-scrollbar-track,
        .vs-chart-section::-webkit-scrollbar-track,
        .vs-chart-body::-webkit-scrollbar-track,
        .vs-table-wrapper::-webkit-scrollbar-track,
        .vs-stats-ribbon::-webkit-scrollbar-track {
            background: rgba(0, 0, 0, 0.25);
            border-radius: 4px;
        }
        .vs-sidebar::-webkit-scrollbar-thumb,
        .vs-main-content::-webkit-scrollbar-thumb,
        .vs-chart-section::-webkit-scrollbar-thumb,
        .vs-chart-body::-webkit-scrollbar-thumb,
        .vs-table-wrapper::-webkit-scrollbar-thumb,
        .vs-stats-ribbon::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.16);
            border-radius: 4px;
        }
        .vs-sidebar::-webkit-scrollbar-thumb:hover,
        .vs-main-content::-webkit-scrollbar-thumb:hover,
        .vs-chart-section::-webkit-scrollbar-thumb:hover,
        .vs-chart-body::-webkit-scrollbar-thumb:hover,
        .vs-table-wrapper::-webkit-scrollbar-thumb:hover,
        .vs-stats-ribbon::-webkit-scrollbar-thumb:hover {
            background: rgba(6, 182, 212, 0.5);
        }

        .vs-table-toolbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 0.5rem;
            flex-wrap: wrap;
            gap: 0.5rem;
            max-width: 100%;
            box-sizing: border-box;
        }

        .vs-table-filter-input {
            background: #0D1424;
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 6px;
            color: #FFF;
            padding: 4px 10px;
            font-size: 12px;
            outline: none;
            width: 180px;
        }

        .vs-btn-small {
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 6px;
            color: #E2E8F0;
            padding: 4px 10px;
            font-size: 12px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.15s;
        }

        .vs-btn-small:hover {
            background: rgba(255, 255, 255, 0.1);
            border-color: rgba(255, 255, 255, 0.2);
        }

        .vs-btn-small.active {
            background: rgba(6, 182, 212, 0.2);
            border-color: #06B6D4;
            color: #38BDF8;
            font-weight: 600;
            box-shadow: 0 0 8px rgba(6, 182, 212, 0.3);
        }

        @keyframes vsGeoPulse {
            0% { transform: scale(1); opacity: 0.8; }
            50% { transform: scale(1.6); opacity: 0.2; }
            100% { transform: scale(1); opacity: 0.8; }
        }
        .vs-geo-pulse {
            transform-box: fill-box;
            transform-origin: center;
            animation: vsGeoPulse 2s ease-in-out infinite;
        }

        @keyframes vsArcFlow {
            from { stroke-dashoffset: 28; }
            to { stroke-dashoffset: 0; }
        }
        .vs-arc-flow {
            stroke-dasharray: 6 4;
            animation: vsArcFlow 1.2s linear infinite;
        }

        /* Query Slicer & Dynamic Schema Styling */
        .query-slicer-chamber {
            animation: slicerFadeIn 0.25s ease-out;
        }
        @keyframes slicerFadeIn {
            from { opacity: 0; transform: translateY(-4px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .autocomplete-dropdown {
            position: absolute;
            top: calc(100% + 6px);
            left: 0;
            right: 0;
            background: rgba(10, 15, 29, 0.96);
            border: 1px solid rgba(56, 189, 248, 0.3);
            border-radius: 10px;
            box-shadow: 0 16px 36px -4px rgba(0,0,0,0.7), 0 0 20px rgba(56, 189, 248, 0.1);
            backdrop-filter: blur(16px);
            z-index: 9999;
            max-height: 280px;
            overflow-y: auto;
            padding: 6px;
        }
        .autocomplete-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 7px 12px;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.15s ease;
            font-size: 12px;
            color: #E2E8F0;
        }
        .autocomplete-item:hover, .autocomplete-item.active {
            background: rgba(56, 189, 248, 0.14);
            color: #38BDF8;
        }
        .query-chip {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 3px 10px;
            border-radius: 9999px;
            font-size: 11px;
            background: rgba(56, 189, 248, 0.1);
            border: 1px solid rgba(56, 189, 248, 0.3);
            color: #7DD3FC;
            transition: all 0.2s ease;
            box-shadow: 0 2px 6px rgba(0,0,0,0.2);
        }
        .query-chip:hover {
            border-color: rgba(56, 189, 248, 0.6);
            background: rgba(56, 189, 248, 0.18);
        }
        .query-chip-remove {
            cursor: pointer;
            color: #94A3B8;
            font-weight: bold;
            font-size: 12px;
            margin-left: 2px;
            line-height: 1;
        }
        .query-chip-remove:hover {
            color: #F43F5E;
        }
        .column-pill {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 3px 9px;
            border-radius: 6px;
            font-size: 11px;
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.12);
            color: #E2E8F0;
            cursor: pointer;
            transition: all 0.15s ease;
            user-select: none;
        }
        .column-pill:hover, .column-pill.active {
            background: rgba(56, 189, 248, 0.15);
            border-color: rgba(56, 189, 248, 0.4);
            color: #38BDF8;
        }
        .column-pill.query-targeted {
            border-color: #A855F7;
            background: rgba(168, 85, 247, 0.18);
            color: #E9D5FF;
        }
        .value-pill {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 3px 8px;
            border-radius: 4px;
            font-size: 11px;
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.1);
            color: #CBD5E1;
            cursor: pointer;
            transition: all 0.15s ease;
        }
        .value-pill:hover {
            background: rgba(16, 185, 129, 0.15);
            border-color: rgba(16, 185, 129, 0.4);
            color: #34D399;
        }
        .query-hit {
            background: rgba(250, 204, 21, 0.25);
            color: #FEF08A;
            border-radius: 2px;
            padding: 0 2px;
            font-weight: 600;
        }

        /* Visual Query Builder Styling */
        .query-builder-chamber {
            animation: qbFadeIn 0.25s ease-out;
        }
        @keyframes qbFadeIn {
            from { opacity: 0; transform: translateY(-6px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .qb-rule-row {
            display: flex;
            align-items: center;
            gap: 8px;
            background: rgba(255, 255, 255, 0.025);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 8px;
            padding: 8px 12px;
            transition: all 0.2s ease;
            flex-wrap: wrap;
        }
        .qb-rule-row:hover {
            background: rgba(255, 255, 255, 0.05);
            border-color: rgba(139, 92, 246, 0.3);
        }
        .qb-conj-badge {
            font-size: 10px;
            font-weight: 800;
            font-family: 'JetBrains Mono', monospace;
            padding: 3px 6px;
            border-radius: 4px;
            background: rgba(139, 92, 246, 0.2);
            color: #C4B5FD;
            border: 1px solid rgba(139, 92, 246, 0.35);
            user-select: none;
            min-width: 44px;
            text-align: center;
        }
        .qb-select {
            background: #090e1a;
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 6px;
            color: #F8FAFC;
            font-size: 12px;
            padding: 5px 10px;
            outline: none;
            cursor: pointer;
            transition: border-color 0.2s;
        }
        .qb-select:focus {
            border-color: #8B5CF6;
        }
        .qb-input {
            background: #050811;
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 6px;
            color: #F8FAFC;
            font-family: 'JetBrains Mono', monospace;
            font-size: 12px;
            padding: 5px 10px;
            outline: none;
            flex: 1;
            min-width: 140px;
            transition: border-color 0.2s, box-shadow 0.2s;
        }
        .qb-input:focus {
            border-color: #8B5CF6;
            box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.25);
        }
        .qb-btn-remove {
            background: transparent;
            border: 1px solid rgba(239, 68, 68, 0.3);
            border-radius: 6px;
            color: #FCA5A5;
            width: 28px;
            height: 28px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 14px;
            transition: all 0.15s ease;
        }
        .qb-btn-remove:hover {
            background: rgba(239, 68, 68, 0.2);
            color: #FFF;
        }

        /* jsVectorMap Spiralum Theme Styling */
        .jvm-tooltip {
            background: rgba(15, 23, 42, 0.95) !important;
            backdrop-filter: blur(12px) !important;
            border: 1px solid rgba(255, 255, 255, 0.15) !important;
            box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6) !important;
            color: #F8FAFC !important;
            font-family: 'Inter', -apple-system, sans-serif !important;
            font-size: 11.5px !important;
            padding: 6px 12px !important;
            border-radius: 8px !important;
            pointer-events: none;
            z-index: 9999 !important;
            line-height: 1.45 !important;
        }
        .jvm-zoom-btn {
            background-color: rgba(30, 41, 59, 0.85) !important;
            color: #F8FAFC !important;
            border: 1px solid rgba(255, 255, 255, 0.15) !important;
            border-radius: 6px !important;
            width: 24px !important;
            height: 24px !important;
            line-height: 22px !important;
            font-size: 14px !important;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3) !important;
            transition: all 0.2s ease !important;
        }
        .jvm-zoom-btn:hover {
            background-color: var(--primary) !important;
            border-color: rgba(255, 255, 255, 0.3) !important;
            transform: scale(1.05);
        }
        .jvm-container {
            width: 100% !important;
            height: 100% !important;
        }

        .vs-sql-ribbon {
            background: #060911;
            border: 1px solid rgba(255, 255, 255, 0.06);
            border-radius: 6px;
            padding: 6px 10px;
            font-family: 'JetBrains Mono', monospace;
            font-size: 11px;
            color: #94A3B8;
            margin-bottom: 0.65rem;
            display: flex;
            align-items: center;
            white-space: nowrap;
            overflow-x: auto;
        }

        /* Live Statistical Inspector Ribbon */
        .vs-stats-ribbon {
            display: flex;
            align-items: center;
            gap: 6px;
            overflow-x: auto;
            padding: 6px 10px;
            background: rgba(13, 20, 36, 0.85);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 8px;
            margin-bottom: 0.5rem;
            scrollbar-width: thin;
        }
        /* No sideways scrollbars in the studio: the demo buttons and the statistics chips wrap onto more lines instead */
        .vs-presets-ribbon { overflow: visible; white-space: normal; flex-wrap: wrap; }
        .vs-presets-scroll { overflow: visible; flex-wrap: wrap; }
        .vs-stats-ribbon { overflow: visible; flex-wrap: wrap; }
        .vs-stat-chip {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 3px 8px;
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.07);
            border-radius: 6px;
            font-size: 11px;
            white-space: nowrap;
        }
        .vs-stat-chip-label {
            color: #94A3B8;
            font-weight: 500;
        }
        .vs-stat-chip-val {
            font-family: 'JetBrains Mono', monospace;
            font-weight: 700;
            color: #38BDF8;
        }
        .vs-stat-chip.highlight {
            background: rgba(168, 85, 247, 0.12);
            border-color: rgba(168, 85, 247, 0.4);
        }
        .vs-stat-chip.highlight .vs-stat-chip-val {
            color: #F472B6;
        }
        .vs-stat-chip.green {
            background: rgba(16, 185, 129, 0.1);
            border-color: rgba(16, 185, 129, 0.3);
        }
        .vs-stat-chip.green .vs-stat-chip-val {
            color: #34D399;
        }

        /* Spiralum Query Pipe Bar */
        .vs-pipe-bar {
            flex-shrink: 0;
            position: relative;
            z-index: 10;
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 8px;
            background: #060913;
            border: 1px solid rgba(139, 92, 246, 0.35);
            border-radius: 6px;
            padding: 5px 10px;
            margin-bottom: 0.5rem;
            max-width: 100%;
            box-sizing: border-box;
        }
        .vs-pipe-status { color: #FCD34D; font-size: 11px; padding: 0 12px; }
        .vs-pipe-status:empty { display: none; }
        .vs-pipe-bar-icon {
            font-family: 'JetBrains Mono', monospace;
            font-size: 13px;
            font-weight: 800;
            color: #A855F7;
        }
        .vs-pipe-input {
            flex: 1;
            background: transparent;
            border: none;
            outline: none;
            color: #F1F5F9;
            font-family: 'JetBrains Mono', monospace;
            font-size: 11.5px;
        }
        .vs-pipe-btn {
            background: #8558EC;
            color: #FFF;
            border: none;
            border-radius: 4px;
            padding: 3px 10px;
            font-size: 11px;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.15s;
        }
        .vs-pipe-btn:hover {
            background: #7C3AED;
        }

        .vs-table-wrapper {
            flex: 1;
            min-height: 200px;
            overflow-x: auto;
            overflow-y: auto;
            max-width: 100%;
            width: 100%;
            min-width: 0;
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 8px;
            background: #070B14;
            box-sizing: border-box;
            -webkit-overflow-scrolling: touch;
        }

        .vs-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 12.5px;
            text-align: left;
        }

        .vs-table th {
            position: sticky;
            top: 0;
            background: #0D1424;
            padding: 8px 12px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            color: #94A3B8;
            font-weight: 600;
            font-size: 11.5px;
            z-index: 2;
        }

        .vs-table td {
            padding: 8px 12px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.04);
            color: #E2E8F0;
        }

        .vs-table tr:hover td {
            background: rgba(255, 255, 255, 0.03);
        }

        .vs-type-badge {
            font-size: 9.5px;
            font-weight: 700;
            font-family: 'JetBrains Mono', monospace;
            padding: 1px 5px;
            border-radius: 4px;
        }

        .vs-type-badge.text {
            background: rgba(100, 116, 139, 0.25);
            color: #94A3B8;
            border: 1px solid rgba(100, 116, 139, 0.35);
        }

        .vs-type-badge.num {
            background: rgba(139, 92, 246, 0.2);
            color: #C4B5FD;
            border: 1px solid rgba(139, 92, 246, 0.35);
        }

        .vs-status-pill {
            display: inline-block;
            padding: 2px 8px;
            border-radius: 9999px;
            font-size: 11px;
            font-weight: 600;
            background: rgba(99, 102, 241, 0.15);
            color: #A5B4FC;
            border: 1px solid rgba(99, 102, 241, 0.3);
        }

        /* Indexed Fields Panel (Elasticsearch / Splunk Discover Style) */
        .field-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 4px 6px;
            border-radius: 5px;
            cursor: pointer;
            transition: background 0.15s ease, border-color 0.15s ease;
            font-size: 0.76rem;
            user-select: none;
            gap: 6px;
        }
        .field-row:hover {
            background: rgba(255, 255, 255, 0.05);
        }
        .field-row.active {
            background: rgba(56, 189, 248, 0.1);
        }
        .field-type-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 17px;
            height: 17px;
            border-radius: 3px;
            font-size: 0.65rem;
            font-weight: 800;
            font-family: 'JetBrains Mono', monospace;
            flex-shrink: 0;
        }
        .field-type-icon.num { background: rgba(16, 185, 129, 0.2); color: #34D399; border: 1px solid rgba(16, 185, 129, 0.35); }
        .field-type-icon.str { background: rgba(59, 130, 246, 0.2); color: #60A5FA; border: 1px solid rgba(59, 130, 246, 0.35); }
        .field-type-icon.kw  { background: rgba(168, 85, 247, 0.2); color: #C084FC; border: 1px solid rgba(168, 85, 247, 0.35); }
        .field-type-icon.date { background: rgba(245, 158, 11, 0.2); color: #FBBF24; border: 1px solid rgba(245, 158, 11, 0.35); }
        .field-type-icon.bool { background: rgba(236, 72, 153, 0.2); color: #F472B6; border: 1px solid rgba(236, 72, 153, 0.35); }
        .field-type-icon.ip   { background: rgba(6, 182, 212, 0.2); color: #22D3EE; border: 1px solid rgba(6, 182, 212, 0.35); }
        .field-type-icon.arr  { background: rgba(99, 102, 241, 0.2); color: #818CF8; border: 1px solid rgba(99, 102, 241, 0.35); }
        .field-type-icon.obj  { background: rgba(249, 115, 22, 0.2); color: #FB923C; border: 1px solid rgba(249, 115, 22, 0.35); }
        .field-action-btn {
            background: transparent;
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 4px;
            color: #94A3B8;
            font-size: 0.72rem;
            cursor: pointer;
            width: 18px;
            height: 18px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            transition: all 0.15s ease;
        }
        .field-action-btn:hover {
            background: rgba(56, 189, 248, 0.2);
            border-color: #38BDF8;
            color: #FFF;
        }
        .field-popover-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-size: 0.72rem;
            padding: 3px 6px;
            border-radius: 4px;
            background: rgba(255, 255, 255, 0.02);
            gap: 6px;
        }
        .field-popover-item:hover {
            background: rgba(255, 255, 255, 0.06);
        }

        @media (max-width: 900px) {
            .layout {
                grid-template-columns: minmax(0, 1fr) !important;
                padding: 0.75rem !important;
                gap: 1rem !important;
                width: 100% !important;
            }
            aside {
                width: 100% !important;
                min-width: 0 !important;
            }
        }

        @media (max-width: 768px) {
            header {
                padding: 0.75rem 1rem !important;
            }
            .hero {
                padding: 0 0.75rem !important;
                margin: 1.5rem auto 1rem auto !important;
            }
            .vs-modal-container {
                width: 100vw !important;
                height: 100vh !important;
                max-width: 100vw !important;
                border-radius: 0 !important;
                margin: 0 !important;
                overflow: hidden !important;
            }
            .vs-header {
                padding: 0.75rem 1rem !important;
            }
            .vs-body {
                position: relative !important;
                display: flex !important;
                flex-direction: column !important;
                overflow: hidden !important;
                width: 100% !important;
                max-width: 100vw !important;
            }
            .vs-sidebar {
                position: absolute !important;
                top: 0 !important;
                left: 0 !important;
                bottom: 0 !important;
                width: 290px !important;
                min-width: 0 !important;
                max-width: 85vw !important;
                height: 100% !important;
                max-height: 100% !important;
                z-index: 350 !important;
                background: #060A14 !important;
                border-right: 1px solid rgba(255, 255, 255, 0.15) !important;
                box-shadow: 4px 0 24px rgba(0, 0, 0, 0.85) !important;
                transform: translateX(-100%) !important;
                transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
                overflow-y: auto !important;
            }
            .vs-sidebar.drawer-open {
                transform: translateX(0) !important;
            }
            .vs-sidebar.collapsed {
                transform: translateX(-100%) !important;
                width: 290px !important;
            }
            .vs-sidebar-backdrop {
                display: none;
                position: absolute;
                inset: 0;
                background: rgba(0, 0, 0, 0.65);
                backdrop-filter: blur(2px);
                z-index: 340;
            }
            .vs-sidebar-backdrop.active {
                display: block !important;
            }
            .vs-main-content {
                width: 100% !important;
                max-width: 100% !important;
                overflow-x: hidden !important;
                overflow-y: auto !important;
                display: flex !important;
                flex-direction: column !important;
                height: 100% !important;
                flex: 1 1 auto !important;
                -webkit-overflow-scrolling: touch;
            }
            .vs-chart-section {
                padding: 0.5rem 0.75rem !important;
                min-height: 60vh !important;
                height: auto !important;
                flex: 0 0 auto !important;
                display: flex !important;
                flex-direction: column !important;
                border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
            }
            .vs-chart-body {
                min-height: calc(60vh - 120px) !important;
                flex: 1 1 auto !important;
            }
            .vs-panel-splitter {
                display: none !important;
            }
            .vs-table-section {
                padding: 0.75rem !important;
                min-height: 280px !important;
                flex: 0 0 auto !important;
                display: flex !important;
                flex-direction: column !important;
                overflow: visible !important;
            }
            .vs-table-wrapper {
                max-height: 45vh !important;
                overflow: auto !important;
                -webkit-overflow-scrolling: touch !important;
            }
            .vs-pipe-bar {
                flex-wrap: wrap !important;
            }
        }
        @media (max-width: 480px) {
            .vs-chart-section {
                min-height: 60vh !important;
            }
            .vs-chart-body {
                min-height: calc(60vh - 120px) !important;
            }
            .modal-overlay {
                padding: 0.5rem !important;
            }
            .modal {
                padding: 1rem !important;
            }
        }
    
    /* Text for screen readers only: present in the page, not drawn (the live regions in index.html use it). */
    .sr-only {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    /* Skip links: the first Tab stops, off-screen until focused, then drawn at the top left. */
    .skip-link {
        position: absolute;
        left: 8px;
        top: -120px;
        z-index: 1000000;
        padding: 0.6rem 1rem;
        background: #FFFFFF;
        color: #0B1020;
        font-weight: 700;
        font-size: 0.9rem;
        border-radius: 6px;
        text-decoration: none;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    }
    .skip-link:focus {
        top: 8px;
        outline: 3px solid #6366F1;
        outline-offset: 2px;
    }
    /* Where a skip link lands is a region, not a control: no ring around the whole region. */
    #search-region:focus, #main-content:focus { outline: none; }

    /* A visible ring wherever keyboard focus is. Several controls say "outline: none" (on their class or inline) and show nothing else in its place, so this
       wins over them. :focus-visible shows it for the keyboard and for text fields, not after a mouse click on a button. Things focused by script rather than
       by Tab (dialog boxes, the places the skip links land) have tabindex="-1" and are left alone. */
    a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible,
    [tabindex]:not([tabindex="-1"]):focus-visible {
        outline: 2px solid #818CF8 !important;
        outline-offset: 2px !important;
    }

    /* Chips that are real buttons: take the page font, no browser button margin, and look as the divs they replace did. */
    button.column-pill, button.value-pill { font-family: inherit; margin: 0; }
    button.facet-item { width: 100%; font-family: inherit; color: inherit; text-align: left; }
    /* The name part of an Indexed Fields row: a button that fills the row (the add and remove button stays beside it). */
    .field-open {
        display: flex;
        align-items: center;
        gap: 6px;
        min-width: 0;
        flex: 1;
        margin: 0;
        padding: 0;
        background: none;
        border: 0;
        font: inherit;
        color: inherit;
        text-align: left;
        cursor: pointer;
    }

/* The "Spiralum for your own data" window: the default link blue is too dark on the dark window (2026-10-08) */
#cloudModal a:not(.btn) { color: #7dd3fc; text-decoration: underline; }
