/* preflight (vendored twcss) */
*,*::before,*::after{box-sizing:border-box}
html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
body{margin:0}
button,input,optgroup,select,textarea{font:inherit;color:inherit;margin:0}
button,select{text-transform:none}
button,[type=button],[type=submit]{-webkit-appearance:button}
textarea{resize:vertical}
table{border-collapse:collapse;border-color:inherit;text-indent:0}
svg{display:block}
[hidden]{display:none!important}

/* component rules (validated by vendored twcss) */
:root {
  color-scheme: dark;
  --gx-bg: #111827;
  --gx-bg-deep: #0b1220;
  --gx-panel: #172033;
  --gx-panel-2: #1d293d;
  --gx-panel-3: #243249;
  --gx-border: #324158;
  --gx-border-soft: #26354b;
  --gx-fg: #e7edf6;
  --gx-muted: #91a0b7;
  --gx-faint: #65748a;
  --gx-accent: #00b7a8;
  --gx-accent-strong: #14d5c5;
  --gx-accent-weak: rgba(0, 183, 168, .14);
  --gx-blue: #4aa9ff;
  --gx-danger: #ff6b74;
  --gx-shadow: rgba(0, 0, 0, .34);
  --gx-canvas-grid: rgba(135, 151, 174, .13);
}

html[data-theme="light"] {
  color-scheme: light;
  --gx-bg: #f5f7fa;
  --gx-bg-deep: #edf1f6;
  --gx-panel: #ffffff;
  --gx-panel-2: #f8fafc;
  --gx-panel-3: #edf2f7;
  --gx-border: #cbd5e1;
  --gx-border-soft: #dfe6ee;
  --gx-fg: #182336;
  --gx-muted: #637187;
  --gx-faint: #8a97aa;
  --gx-accent: #008f83;
  --gx-accent-strong: #007a70;
  --gx-accent-weak: rgba(0, 143, 131, .1);
  --gx-blue: #1677c8;
  --gx-danger: #cf3341;
  --gx-shadow: rgba(33, 47, 69, .16);
  --gx-canvas-grid: rgba(77, 93, 117, .13);
}

html, body { width: 100%; height: 100%; overflow: hidden; background: var(--gx-bg); color: var(--gx-fg); }
body { font-size: 14px; }
button, select, textarea, a { color: inherit; }
button { border: 0; background-color: transparent; background-image: none; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--gx-accent); outline-offset: 2px; }

.gx-app { display: grid; grid-template-columns: 48px 248px minmax(0, 1fr); grid-template-rows: 48px minmax(0, 1fr) 24px; width: 100%; height: 100%; background: var(--gx-bg); }
.gx-topbar { grid-column: 1 / -1; display: flex; align-items: center; min-width: 0; border-bottom: 1px solid var(--gx-border); background: var(--gx-bg-deep); z-index: 30; }
.gx-brand { height: 100%; width: 296px; flex-shrink: 0; display: flex; align-items: center; gap: 2px; padding: 0 13px; color: var(--gx-fg); text-decoration: none; border-right: 1px solid var(--gx-border); }
.gx-logo { display: block; width: 36px; height: 36px; flex: none; object-fit: contain; }
.gx-brand-name { font-size: 22px; font-weight: 700; letter-spacing: -1.1px; white-space: nowrap; line-height: 1; }
.gx-brand-name b { color: var(--gx-accent); font-weight: 400; }
.gx-brand-product { margin-left: 7px; color: var(--gx-muted); font-weight: 500; }
.gx-top-context { display: flex; align-items: center; min-width: 0; gap: 8px; padding: 0 16px; font-size: 13px; }
.gx-crumb-muted { color: var(--gx-muted); }
.gx-crumb-sep { color: var(--gx-faint); }
.gx-top-actions { margin-left: auto; display: flex; align-items: center; gap: 7px; padding: 0 10px; }
.gx-local-pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--gx-border); border-radius: 999px; padding: 3px 9px; color: var(--gx-muted); font-size: 11px; }
.gx-live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #32d583; box-shadow: 0 0 0 3px rgba(50, 213, 131, .12); font-size: 0; }
.gx-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 6px; color: var(--gx-muted); text-decoration: none; cursor: pointer; }
.gx-icon-btn:hover { color: var(--gx-fg); background: var(--gx-panel-3); }
.gx-session-form { display: flex; margin: 0; }
.gx-session-btn { height: 30px; padding: 0 9px; border: 1px solid var(--gx-border); border-radius: 6px; color: var(--gx-muted); cursor: pointer; font-size: 10px; }
.gx-session-btn:hover { color: var(--gx-fg); border-color: var(--gx-accent); background: var(--gx-accent-weak); }

.gx-rail { grid-column: 1; grid-row: 2; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 0; border-right: 1px solid var(--gx-border); background: var(--gx-bg-deep); }
.gx-rail-item { position: relative; display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 7px; color: var(--gx-muted); cursor: pointer; font-size: 18px; }
.gx-rail-item:hover { color: var(--gx-fg); background: var(--gx-panel-3); }
.gx-rail-active { color: var(--gx-accent-strong); background: var(--gx-accent-weak); }
.gx-rail-active::before { content: ""; position: absolute; left: -5px; width: 3px; height: 24px; border-radius: 0 4px 4px 0; background: var(--gx-accent); }
.gx-rail-spacer { flex: 1; }

.gx-sidebar { grid-column: 2; grid-row: 2; min-width: 0; display: flex; flex-direction: column; overflow: hidden; border-right: 1px solid var(--gx-border); background: var(--gx-panel); }
.gx-side-title { height: 40px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 10px 0 13px; color: var(--gx-muted); letter-spacing: .08em; font-size: 11px; border-bottom: 1px solid var(--gx-border-soft); }
.gx-mini-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 5px; color: var(--gx-muted); cursor: pointer; }
.gx-mini-btn:hover { color: var(--gx-fg); background: var(--gx-panel-3); }
.gx-side-section { flex: none; padding: 7px 6px; border-bottom: 1px solid var(--gx-border-soft); }
.gx-snippets-section { flex: 0 1 210px; min-height: 98px; display: flex; flex-direction: column; }
.gx-history-section { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.gx-section-row { display: flex; align-items: center; }
.gx-section-tools { display: inline-flex; align-items: center; gap: 2px; }
.gx-section-title { display: block; flex: 1; padding: 5px 7px; text-align: left; color: var(--gx-muted); font-size: 10px; font-weight: 700; letter-spacing: .07em; cursor: pointer; }
.gx-db-list { display: flex; flex-direction: column; gap: 2px; }
.gx-db { width: 100%; display: grid; grid-template-columns: 24px minmax(0, 1fr) 10px; align-items: center; gap: 7px; padding: 7px 8px; border: 1px solid transparent; border-radius: 6px; text-align: left; cursor: pointer; }
.gx-db:hover { background: var(--gx-panel-3); }
.gx-db:disabled { opacity: .55; cursor: default; }
.gx-db-active { border-color: rgba(0, 183, 168, .24); background: var(--gx-accent-weak); }
.gx-db-icon { color: var(--gx-accent); font-size: 19px; line-height: 1; }
.gx-db-copy { display: flex; flex-direction: column; min-width: 0; }
.gx-db-copy strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; font-weight: 600; }
.gx-db-copy small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--gx-muted); font-size: 10px; }
.gx-db-state { width: 7px; height: 7px; border-radius: 50%; background: #32d583; }
.gx-db-state[data-online="false"] { background: var(--gx-faint); }
.gx-db-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--gx-border-soft); }
.gx-import-formats { margin: 8px 0 0; font-size: 10px; line-height: 1.6; color: var(--gx-muted); }
.gx-db-action { height: 28px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--gx-border); border-radius: 5px; color: var(--gx-muted); cursor: pointer; font-size: 10px; font-weight: 600; }
.gx-db-action span { color: var(--gx-accent-strong); font-size: 14px; line-height: 1; }
.gx-db-action:hover { border-color: var(--gx-accent); background: var(--gx-accent-weak); color: var(--gx-fg); }
.gx-db-action:disabled { opacity: .5; cursor: wait; }
.gx-history { flex: 1 1 auto; overflow: auto; padding: 0 3px; }
.gx-history-item { display: block; width: 100%; padding: 7px 8px; border-radius: 5px; text-align: left; color: var(--gx-muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; line-height: 1.35; cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.gx-history-item:hover { color: var(--gx-fg); background: var(--gx-panel-3); }
.gx-history-star { color: #f5b82e; }
.gx-snippets { min-height: 0; overflow: auto; padding: 0 3px; }
.gx-snippets-empty { margin: 2px 4px; padding: 10px 8px; border: 1px dashed var(--gx-border); border-radius: 5px; color: var(--gx-muted); font-size: 9px; line-height: 1.45; text-align: center; }
.gx-snippet-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border-radius: 5px; }
.gx-snippet-item:hover, .gx-snippet-item:focus-within { background: var(--gx-panel-3); }
.gx-snippet-load { min-width: 0; padding: 6px 5px; text-align: left; cursor: pointer; }
.gx-snippet-load strong, .gx-snippet-load small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gx-snippet-load strong { color: var(--gx-fg); font-size: 10px; }
.gx-snippet-load small { margin-top: 2px; color: var(--gx-muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 8px; }
.gx-snippet-tools { display: inline-flex; padding-right: 3px; opacity: .38; }
.gx-snippet-item:hover .gx-snippet-tools, .gx-snippet-item:focus-within .gx-snippet-tools { opacity: 1; }
.gx-snippet-tool { width: 22px; height: 22px; border-radius: 4px; color: var(--gx-muted); cursor: pointer; font-size: 11px; }
.gx-snippet-tool:hover { background: var(--gx-bg-deep); color: var(--gx-accent-strong); }
.gx-snippet-delete:hover { color: var(--gx-danger); }
.gx-muted { color: var(--gx-muted); font-size: 11px; }

.gx-transfer-dialog { width: min(430px, calc(100vw - 32px)); padding: 0; overflow: hidden; border: 1px solid var(--gx-border); border-radius: 10px; background: var(--gx-panel); color: var(--gx-fg); box-shadow: 0 22px 60px rgba(0, 0, 0, .48); }
.gx-transfer-dialog::backdrop { background: rgba(3, 10, 20, .72); backdrop-filter: blur(2px); }
.gx-transfer-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px; border-bottom: 1px solid var(--gx-border-soft); background: var(--gx-panel-2); }
.gx-transfer-head h2 { margin: 0 0 4px; font-size: 16px; }
.gx-transfer-head p { margin: 0; color: var(--gx-muted); font-size: 11px; line-height: 1.5; }
.gx-transfer-icon { width: 34px; height: 34px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 1px solid color-mix(in srgb, var(--gx-accent) 36%, var(--gx-border)); border-radius: 8px; background: var(--gx-accent-weak); color: var(--gx-accent-strong); font-size: 20px; }
.gx-transfer-file, .gx-transfer-target { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; gap: 8px; margin: 16px 20px 0; }
.gx-transfer-file > span, .gx-transfer-target > span { color: var(--gx-muted); font-size: 10px; }
.gx-transfer-file strong, .gx-transfer-target strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.gx-transfer-file small { grid-column: 2; margin-top: -5px; color: var(--gx-muted); font-size: 9px; }
.gx-create-field { display: grid; gap: 7px; margin: 18px 20px; }
.gx-create-field > span { color: var(--gx-muted); font-size: 10px; font-weight: 700; }
.gx-create-field input { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--gx-border); border-radius: 5px; background: var(--gx-bg-deep); color: var(--gx-fg); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; outline: none; }
.gx-create-field input:focus { border-color: var(--gx-accent); box-shadow: 0 0 0 2px var(--gx-accent-weak); }
.gx-create-field small { color: var(--gx-muted); font-size: 9px; }
.gx-snippet-dialog { width: min(560px, calc(100vw - 32px)); }
.gx-snippet-fields { padding-bottom: 17px; }
.gx-snippet-fields .gx-create-field { margin: 14px 20px 0; }
.gx-snippet-fields select, .gx-snippet-fields textarea { width: 100%; padding: 7px 10px; border: 1px solid var(--gx-border); border-radius: 5px; background: var(--gx-bg-deep); color: var(--gx-fg); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; outline: none; }
.gx-snippet-fields select { height: 36px; padding-top: 0; padding-bottom: 0; }
.gx-snippet-fields textarea { min-height: 138px; resize: vertical; line-height: 1.5; }
.gx-snippet-fields select:focus, .gx-snippet-fields textarea:focus { border-color: var(--gx-accent); box-shadow: 0 0 0 2px var(--gx-accent-weak); }
.gx-snippet-error { margin: 12px 20px 0; padding: 7px 9px; border: 1px solid color-mix(in srgb, var(--gx-danger) 42%, var(--gx-border)); border-radius: 5px; background: color-mix(in srgb, var(--gx-danger) 8%, transparent); color: var(--gx-danger); font-size: 9px; line-height: 1.4; }
.gx-snippet-error[hidden] { display: none; }
.gx-transfer-warning { margin: 17px 20px; padding: 11px 12px; border: 1px solid color-mix(in srgb, var(--gx-danger) 42%, var(--gx-border)); border-radius: 6px; background: color-mix(in srgb, var(--gx-danger) 9%, transparent); color: var(--gx-muted); font-size: 10px; line-height: 1.5; }
.gx-transfer-warning strong { color: var(--gx-danger); }
.gx-transfer-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 20px; border-top: 1px solid var(--gx-border-soft); background: var(--gx-panel-2); }
.gx-dialog-secondary, .gx-dialog-primary, .gx-dialog-danger { height: 31px; padding: 0 12px; border-radius: 5px; cursor: pointer; font-size: 10px; font-weight: 700; }
.gx-dialog-secondary { border: 1px solid var(--gx-border); color: var(--gx-muted); }
.gx-dialog-secondary:hover { color: var(--gx-fg); background: var(--gx-panel-3); }
.gx-dialog-primary { background: var(--gx-accent); color: #04211e; }
.gx-dialog-primary:hover { filter: brightness(1.08); }
.gx-dialog-primary:disabled { opacity: .58; cursor: wait; }
.gx-dialog-danger { background: var(--gx-danger); color: #fff; }
.gx-dialog-danger:hover { filter: brightness(1.08); }
.gx-dialog-danger:disabled { opacity: .58; cursor: wait; }

.gx-workbench { grid-column: 3; grid-row: 2; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.gx-tabsbar { height: 36px; flex: none; display: flex; align-items: end; padding-left: 8px; overflow: hidden; background: var(--gx-bg-deep); border-bottom: 1px solid var(--gx-border); }
.gx-tabs-list { min-width: 0; display: flex; align-items: end; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.gx-worktab { height: 32px; width: 148px; min-width: 112px; max-width: 180px; display: flex; align-items: center; gap: 7px; padding: 0 7px 0 10px; border: 1px solid var(--gx-border); border-bottom-color: var(--gx-panel); border-radius: 6px 6px 0 0; background: var(--gx-panel); color: var(--gx-fg); text-align: left; font-size: 11px; cursor: pointer; }
.gx-worktab[aria-selected="false"] { border-bottom-color: var(--gx-border); background: var(--gx-bg-deep); color: var(--gx-muted); }
.gx-worktab[aria-selected="false"] .gx-tab-dot { background: var(--gx-faint); }
.gx-worktab:focus-visible { position: relative; outline: 2px solid var(--gx-accent); outline-offset: -2px; }
.gx-tab-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gx-accent); }
.gx-tab-title { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gx-tab-close { width: 20px; height: 20px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; color: var(--gx-muted); cursor: pointer; }
.gx-tab-close:hover { background: var(--gx-panel-3); color: var(--gx-fg); }
.gx-tab-running .gx-tab-dot { animation: gx-tab-pulse 1s ease-in-out infinite alternate; }
.gx-new-tab { width: 30px; height: 28px; flex: none; color: var(--gx-muted); cursor: pointer; }
.gx-new-tab:hover { color: var(--gx-fg); }
@keyframes gx-tab-pulse { to { opacity: .28; transform: scale(.72); } }

.gx-editor { position: relative; flex: none; background: var(--gx-panel); border-bottom: 1px solid var(--gx-border); }
.gx-editor-head { height: 33px; display: flex; align-items: center; gap: 7px; padding: 0 11px; border-bottom: 1px solid var(--gx-border-soft); color: var(--gx-muted); font-size: 10px; }
.gx-editor-head select { height: 23px; min-width: 105px; padding: 0 23px 0 7px; border: 1px solid var(--gx-border); border-radius: 4px; background: var(--gx-panel-2); color: var(--gx-fg); font-size: 10px; }
.gx-editor-spacer { flex: 1; }
.gx-editor-tool { height: 23px; padding: 0 7px; border-radius: 4px; color: var(--gx-muted); cursor: pointer; font-size: 10px; }
.gx-editor-tool:hover { color: var(--gx-fg); background: var(--gx-panel-3); }
.gx-save-snippet { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--gx-border-soft); }
.gx-save-snippet span { color: var(--gx-accent-strong); font-size: 13px; line-height: 1; }
.gx-editor-body { min-height: 84px; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: stretch; }
.gx-line-number { padding-top: 13px; text-align: right; padding-right: 9px; color: var(--gx-faint); background: var(--gx-panel-2); border-right: 1px solid var(--gx-border-soft); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; user-select: none; }
.gx-editor textarea { width: 100%; min-height: 84px; padding: 11px 13px; border: 0; outline: 0; resize: none; background: var(--gx-panel); color: var(--gx-fg); caret-color: var(--gx-accent-strong); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.6; }
.gx-editor textarea::placeholder { color: var(--gx-faint); }
.gx-run { align-self: center; display: flex; align-items: center; gap: 7px; height: 31px; margin: 0 12px; padding: 0 13px; border-radius: 5px; background: var(--gx-accent); color: #031f1c; font-weight: 700; font-size: 11px; cursor: pointer; }
.gx-run:hover { background: var(--gx-accent-strong); }
.gx-run:disabled { opacity: .55; cursor: default; }
.gx-editor-foot { height: 23px; display: flex; justify-content: space-between; align-items: center; padding: 0 11px 0 44px; border-top: 1px solid var(--gx-border-soft); color: var(--gx-faint); font-size: 9px; }
.gx-editor-resizer { position: absolute; right: 0; bottom: -5px; left: 0; z-index: 20; height: 10px; cursor: ns-resize; touch-action: none; outline: none; }
.gx-editor-resizer::after { content: ""; position: absolute; right: 0; top: 5px; left: 0; height: 1px; background: var(--gx-border); transition: height .12s, background .12s; }
.gx-editor-resizer:hover::after, .gx-editor-resizer:focus-visible::after, .gx-resizing-editor .gx-editor-resizer::after { height: 2px; background: var(--gx-accent); }
.gx-resizing-editor, .gx-resizing-editor * { cursor: ns-resize !important; user-select: none !important; }

.gx-main { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 236px; }
.gx-results { min-width: 0; min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--gx-border); background: var(--gx-bg); }
.gx-result-head { height: 36px; flex: none; display: flex; align-items: center; padding: 0 9px; border-bottom: 1px solid var(--gx-border); background: var(--gx-panel); }
.gx-view-tabs { align-self: stretch; display: flex; }
.gx-view-tab { position: relative; min-width: 66px; padding: 0 10px; color: var(--gx-muted); font-size: 11px; cursor: pointer; }
.gx-view-tab:hover { color: var(--gx-fg); }
.gx-view-tab[aria-selected="true"] { color: var(--gx-fg); }
.gx-view-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 0; height: 2px; background: var(--gx-accent); }
.gx-status { margin-left: auto; color: var(--gx-muted); font-size: 10px; }
.gx-status[data-kind="ok"] { color: var(--gx-accent-strong); }
.gx-status[data-kind="error"] { color: var(--gx-danger); }
.gx-dimension-toggle { height: 23px; display: inline-flex; margin-left: 9px; overflow: hidden; border: 1px solid var(--gx-border); border-radius: 4px; }
.gx-dimension-toggle button { min-width: 29px; padding: 0 6px; color: var(--gx-muted); cursor: pointer; font-size: 9px; font-weight: 700; }
.gx-dimension-toggle button + button { border-left: 1px solid var(--gx-border); }
.gx-dimension-toggle button:hover { color: var(--gx-fg); background: var(--gx-panel-3); }
.gx-dimension-toggle button[aria-pressed="true"] { background: var(--gx-accent-weak); color: var(--gx-accent-strong); }
.gx-depth-control { height: 23px; display: inline-flex; align-items: center; gap: 5px; margin-left: 9px; padding: 0 6px; border: 1px solid var(--gx-border); border-radius: 4px; color: var(--gx-muted); font-size: 9px; font-weight: 600; }
.gx-depth-control[hidden] { display: none; }
.gx-depth-control input { width: 66px; height: 14px; margin: 0; cursor: ew-resize; accent-color: var(--gx-accent); }
.gx-depth-control output { width: 31px; color: var(--gx-accent-strong); font-variant-numeric: tabular-nums; text-align: right; }
.gx-result-tool { margin-left: 9px; height: 23px; padding: 0 8px; border: 1px solid var(--gx-border); border-radius: 4px; color: var(--gx-muted); font-size: 10px; cursor: pointer; }
.gx-result-tool:hover { color: var(--gx-fg); border-color: var(--gx-muted); }
.gx-schema-graph { display: inline-flex; align-items: center; gap: 5px; }
.gx-schema-graph > span:first-child { color: var(--gx-accent-strong); font-size: 13px; }
.gx-views { flex: 1 1 auto; min-height: 0; position: relative; overflow: hidden; }
.gx-view { position: absolute; inset: 0; min-width: 0; min-height: 0; }
.gx-canvas { width: 100%; height: 100%; min-height: 300px; cursor: grab; touch-action: none; background-color: var(--gx-bg); background-image: radial-gradient(var(--gx-canvas-grid) 1px, transparent 1px); background-size: 18px 18px; }
.gx-canvas:active { cursor: grabbing; }
.gx-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: var(--gx-muted); pointer-events: none; text-align: center; }
.gx-empty[hidden] { display: none; }
.gx-empty strong { color: var(--gx-fg); font-size: 13px; }
.gx-empty span { font-size: 11px; }
.gx-empty-icon { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border: 1px solid var(--gx-border); border-radius: 50%; color: var(--gx-accent); font-size: 25px; background: var(--gx-panel); }
.gx-hint { position: absolute; left: 50%; bottom: 9px; transform: translateX(-50%); max-width: calc(100% - 28px); padding: 3px 10px; border: 1px solid var(--gx-border); border-radius: 999px; background: color-mix(in srgb, var(--gx-panel) 88%, transparent); color: var(--gx-muted); font-size: 9px; text-align: center; pointer-events: none; white-space: nowrap; }
.gx-legend { position: absolute; top: 9px; left: 9px; display: flex; flex-wrap: wrap; gap: 5px; max-width: 68%; }
.gx-legend-item { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 2px 7px; border: 1px solid var(--gx-border); border-radius: 5px; background: var(--gx-panel); box-shadow: 0 2px 8px var(--gx-shadow); font-size: 9px; }
.gx-swatch { width: 13px; height: 13px; flex: none; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; -webkit-appearance: none; appearance: none; }
.gx-swatch::-webkit-color-swatch-wrapper { padding: 0; }
.gx-swatch::-webkit-color-swatch { border: 1px solid rgba(0,0,0,.3); border-radius: 50%; }
.gx-caption-select { max-width: 92px; height: 18px; padding: 0 2px; border: 1px solid var(--gx-border); border-radius: 3px; background: var(--gx-panel-2); color: var(--gx-muted); font-size: 8px; }

.gx-node { cursor: pointer; }
.gx-node circle { stroke-width: 2.5px; }
.gx-node:hover circle { stroke: var(--gx-accent-strong); stroke-width: 3.5px; }
.gx-node-label { fill: var(--gx-fg); font-size: 10px; text-anchor: middle; paint-order: stroke; stroke: var(--gx-bg); stroke-width: 3px; pointer-events: none; }
.gx-node-pinned circle { stroke: var(--gx-accent-strong); stroke-dasharray: 3 2; }
.gx-node-loading circle { opacity: .5; }
.gx-node-expanded circle { stroke-width: 4px; }
.gx-node-dragging { cursor: grabbing; }
.gx-edge { stroke: var(--gx-muted); stroke-opacity: .56; stroke-width: 1.4; cursor: pointer; }
.gx-edge:hover { stroke: var(--gx-accent-strong); stroke-opacity: 1; stroke-width: 2.3; }
.gx-edge.gx-edge-hover { stroke: var(--gx-accent-strong); stroke-opacity: 1; stroke-width: 2.3; }
/* Invisible wide hit target over each edge: the visible line is 1.4px, which is
   nearly unclickable. Non-scaling stroke keeps the target ~13 screen px at any zoom. */
.gx-edge-hit { stroke: transparent; fill: none; stroke-width: 13; cursor: pointer; vector-effect: non-scaling-stroke; }
.gx-edge-label { fill: var(--gx-muted); font-size: 8px; text-anchor: middle; paint-order: stroke; stroke: var(--gx-bg); stroke-width: 3px; cursor: pointer; }
.gx-arrow { fill: var(--gx-muted); fill-opacity: .72; }
.gx-depth-grid { pointer-events: none; }
.gx-depth-grid line { stroke: var(--gx-canvas-grid); stroke-width: 1; vector-effect: non-scaling-stroke; }
.gx-canvas-3d { background-image: radial-gradient(color-mix(in srgb, var(--gx-canvas-grid) 55%, transparent) 1px, transparent 1px); background-size: 24px 24px; }
.gx-inspect { position: absolute; top: 9px; right: 9px; width: 270px; max-height: calc(100% - 45px); overflow: auto; padding: 10px; border: 1px solid var(--gx-border); border-radius: 7px; background: var(--gx-panel); box-shadow: 0 12px 32px var(--gx-shadow); font-size: 10px; }
.gx-inspect-editing { width: min(430px, calc(100% - 18px)); }
.gx-inspect-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.gx-inspect-kind { padding: 2px 5px; border-radius: 3px; background: var(--gx-accent-weak); color: var(--gx-accent-strong); text-transform: uppercase; letter-spacing: .05em; font-size: 8px; }
.gx-inspect-title { min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.gx-inspect-close { margin-left: auto; color: var(--gx-muted); cursor: pointer; font-size: 16px; }
.gx-inspect-actions { display: flex; gap: 5px; margin-bottom: 8px; }
.gx-inspect-btn { padding: 3px 8px; border: 1px solid var(--gx-border); border-radius: 4px; background: var(--gx-panel-2); color: var(--gx-muted); cursor: pointer; font-size: 9px; }
.gx-inspect-btn:hover { color: var(--gx-accent-strong); border-color: var(--gx-accent); }
.gx-inspect-btn:disabled { opacity: .55; cursor: wait; }
.gx-inspect-save { border-color: color-mix(in srgb, var(--gx-accent) 65%, var(--gx-border)); background: var(--gx-accent-weak); color: var(--gx-accent-strong); }
.gx-inspect-help { margin: 0 0 9px; color: var(--gx-muted); font-size: 8px; line-height: 1.45; }
.gx-property-editor { display: grid; gap: 7px; }
.gx-property-edit-row { display: grid; grid-template-columns: minmax(90px, 1fr) 120px 25px; gap: 5px; padding-bottom: 7px; border-bottom: 1px solid var(--gx-border-soft); }
.gx-property-key, .gx-property-type, .gx-property-value { min-width: 0; border: 1px solid var(--gx-border); border-radius: 4px; background: var(--gx-bg-deep); color: var(--gx-fg); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 9px; outline: none; }
.gx-property-key, .gx-property-type { height: 27px; padding: 0 6px; }
.gx-property-value { grid-column: 1 / -1; min-height: 44px; padding: 6px; resize: vertical; line-height: 1.4; }
.gx-property-value:disabled { min-height: 27px; opacity: .55; resize: none; }
.gx-property-key:focus, .gx-property-type:focus, .gx-property-value:focus { border-color: var(--gx-accent); box-shadow: 0 0 0 2px var(--gx-accent-weak); }
.gx-property-remove { width: 25px; height: 27px; border: 1px solid var(--gx-border); border-radius: 4px; color: var(--gx-muted); cursor: pointer; }
.gx-property-remove:hover { border-color: var(--gx-danger); color: var(--gx-danger); }
.gx-property-add { margin-top: 8px; }
.gx-property-error { margin-top: 8px; padding: 6px 8px; border: 1px solid color-mix(in srgb, var(--gx-danger) 42%, var(--gx-border)); border-radius: 4px; background: color-mix(in srgb, var(--gx-danger) 8%, transparent); color: var(--gx-danger); font-size: 8px; line-height: 1.4; }
.gx-property-error[hidden] { display: none; }
.gx-prop-table { width: 100%; }
.gx-prop-table th { width: 36%; padding: 3px 7px 3px 0; color: var(--gx-muted); text-align: left; vertical-align: top; font-weight: 500; }
.gx-prop-table td { padding: 3px 0; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.gx-table-wrap { position: absolute; inset: 0; overflow: auto; }
.gx-data-table { width: 100%; font-size: 11px; }
.gx-data-table th { position: sticky; top: 0; z-index: 1; padding: 8px 10px; border-bottom: 1px solid var(--gx-border); background: var(--gx-panel); color: var(--gx-muted); text-align: left; font-weight: 600; }
.gx-data-table td { max-width: 420px; padding: 7px 10px; border-bottom: 1px solid var(--gx-border-soft); vertical-align: top; overflow-wrap: anywhere; }
.gx-data-table tr:hover td { background: var(--gx-accent-weak); }
.gx-chip { display: inline-flex; align-items: center; max-width: 330px; overflow: hidden; padding: 1px 7px; border: 1px solid var(--gx-border); border-radius: 999px; background: var(--gx-panel); text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.gx-chip-node { border-left-width: 3px; }
.gx-chip-rel { color: var(--gx-accent-strong); }
.gx-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; }
.gx-json { position: absolute; inset: 0; margin: 0; overflow: auto; padding: 12px; color: var(--gx-fg); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; line-height: 1.55; white-space: pre; }

.gx-schema { min-width: 0; display: flex; flex-direction: column; background: var(--gx-panel); }
.gx-schema-head { min-height: 45px; display: flex; align-items: center; gap: 7px; padding: 7px 10px; border-bottom: 1px solid var(--gx-border); }
.gx-schema-head > div { display: flex; flex-direction: column; min-width: 0; }
.gx-schema-head strong { font-size: 10px; }
.gx-schema-head span { overflow: hidden; color: var(--gx-muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.gx-schema-head .gx-schema-tools { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; overflow: visible; }
.gx-schema-visualize { gap: 4px; padding: 0 7px; border: 1px solid var(--gx-border-soft); font-size: 9px; }
.gx-schema-visualize span { color: var(--gx-accent-strong); font-size: 12px; }
.gx-schema-scroll { flex: 1 1 auto; overflow: auto; padding: 4px 10px 15px; }
.gx-schema-group { padding: 10px 0; border-bottom: 1px solid var(--gx-border-soft); }
.gx-schema-group h2 { margin: 0 0 7px; color: var(--gx-muted); text-transform: uppercase; letter-spacing: .06em; font-size: 9px; }
.gx-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.gx-schema-chip { max-width: 100%; overflow: hidden; padding: 3px 7px; border: 1px solid var(--gx-border); border-radius: 4px; background: var(--gx-panel-2); color: var(--gx-fg); cursor: pointer; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 9px; }
.gx-schema-chip:hover { color: var(--gx-accent-strong); border-color: var(--gx-accent); }
.gx-schema-colored { font-weight: 700; }
.gx-schema-mode .gx-editor { display: none; }
.gx-schema-mode .gx-main { grid-template-columns: minmax(0, 1fr); }
.gx-schema-mode .gx-results { display: none; }
.gx-schema-mode .gx-schema { display: flex; border-left: 0; }

/* Remote instance login --------------------------------------------------- */
.gx-login-page { position: fixed; inset: 0; display: grid; grid-template-columns: 236px minmax(0, 1fr); overflow: hidden; background: var(--gx-bg); }
.gx-login-sidebar { min-height: 0; display: flex; flex-direction: column; padding: 0 12px 14px; border-right: 1px solid #263448; background: #111b2a; color: #e8eef6; }
.gx-login-brand { height: 64px; display: flex; align-items: center; gap: 2px; padding: 0 4px; border-bottom: 1px solid #263448; }
.gx-login-brand > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gx-login-brand strong { font-size: 22px; letter-spacing: -1.1px; }
.gx-login-brand .gx-brand-name b { color: #b69ae7; }
.gx-login-brand span { color: #8392a8; font-size: 9px; }
.gx-login-nav { flex: 1; padding: 18px 0; }
.gx-login-nav-label { margin: 14px 10px 7px; color: #687990; font-size: 8px; font-weight: 800; letter-spacing: .13em; }
.gx-login-nav-item { position: relative; width: 100%; min-height: 48px; display: grid; grid-template-columns: 30px minmax(0, 1fr); grid-template-rows: 20px 15px; align-items: center; padding: 6px 9px; border-radius: 6px; color: #91a0b4; text-align: left; }
.gx-login-nav-item > span { grid-row: 1 / 3; color: #718299; text-align: center; font-size: 16px; }
.gx-login-nav-item strong { color: inherit; font-size: 10px; font-weight: 600; }
.gx-login-nav-item small { color: #687990; font-size: 8px; }
.gx-login-nav-item:disabled { opacity: .62; }
.gx-login-nav-active { background: #203047; color: #f4f7fb; box-shadow: inset 3px 0 #13b8a6; }
.gx-login-nav-active > span { color: #22cbbb; }
.gx-login-nav-active small { color: #96a6b9; }
.gx-login-sidebar-foot { display: flex; align-items: center; gap: 9px; margin: 0 5px; padding: 11px; border: 1px solid #2a3a50; border-radius: 7px; background: #172438; }
.gx-login-sidebar-foot > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gx-login-sidebar-foot strong { font-size: 9px; }
.gx-login-sidebar-foot span { color: #8292a7; font-size: 8px; }
.gx-shield { width: 20px; height: 20px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 1px solid color-mix(in srgb, var(--gx-accent) 45%, var(--gx-border)); border-radius: 50%; background: var(--gx-accent-weak); color: var(--gx-accent-strong) !important; font-size: 9px !important; font-weight: 800; }
.gx-login-workspace { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--gx-bg); }
.gx-login-topbar { height: 54px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 20px; border-bottom: 1px solid var(--gx-border); background: var(--gx-panel); }
.gx-login-breadcrumb { min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 10px; }
.gx-login-breadcrumb span, .gx-login-breadcrumb b { color: var(--gx-muted); font-weight: 500; }
.gx-login-breadcrumb strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gx-bolt-badge { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px; border: 1px solid var(--gx-border); border-radius: 999px; color: var(--gx-muted); font-size: 9px; }
.gx-login-content { width: min(100%, 1260px); flex: 1 1 auto; min-height: 0; overflow: auto; margin: 0 auto; padding: 30px 38px 38px; }
.gx-login-heading { display: flex; align-items: flex-end; gap: 24px; margin-bottom: 24px; }
.gx-login-heading-copy { min-width: 0; flex: 1; }
.gx-login-eyebrow { margin: 0 0 7px; color: var(--gx-accent-strong); letter-spacing: .14em; font-size: 8px; font-weight: 800; }
.gx-login-heading h1 { margin: 0; letter-spacing: -.025em; font-size: clamp(24px, 3vw, 34px); line-height: 1.12; }
.gx-login-heading-copy > p:last-child { margin: 8px 0 0; color: var(--gx-muted); font-size: 11px; }
.gx-login-heading-status { display: flex; align-items: center; gap: 9px; padding: 8px 11px; border: 1px solid var(--gx-border); border-radius: 7px; background: var(--gx-panel); }
.gx-login-heading-status .gx-logo { width: 28px; height: 28px; }
.gx-login-heading-status strong { white-space: nowrap; font-size: 9px; }
.gx-login-grid { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(430px, 520px); align-items: stretch; gap: 20px; }
.gx-login-card, .gx-saved { min-width: 0; border: 1px solid var(--gx-border); border-radius: 8px; background: var(--gx-panel); box-shadow: 0 8px 26px color-mix(in srgb, var(--gx-shadow) 52%, transparent); }
.gx-login-card { padding: 24px 26px; }
.gx-login-card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.gx-login-card-head > div { flex: 1; }
.gx-login-card-kicker { display: block; margin-bottom: 4px; color: var(--gx-accent-strong); font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.gx-login-card-head h2, .gx-saved-head h2 { margin: 0; font-size: 15px; }
.gx-login-card-head p, .gx-saved-head p { margin: 5px 0 0; color: var(--gx-muted); font-size: 9px; line-height: 1.45; }
.gx-connection-icon { width: 35px; height: 35px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid color-mix(in srgb, var(--gx-accent) 35%, var(--gx-border)); border-radius: 8px; background: var(--gx-accent-weak); color: var(--gx-accent-strong); font-size: 17px; }
.gx-login-error { margin: -4px 0 16px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--gx-danger) 55%, var(--gx-border)); border-radius: 5px; background: color-mix(in srgb, var(--gx-danger) 9%, transparent); color: var(--gx-danger); font-size: 10px; line-height: 1.5; }
.gx-login-form { display: grid; gap: 14px; }
.gx-field { min-width: 0; display: grid; gap: 6px; }
.gx-field > span { display: flex; align-items: center; color: var(--gx-fg); font-size: 9px; font-weight: 700; }
.gx-field > span b { margin-left: auto; color: var(--gx-faint); text-transform: uppercase; letter-spacing: .06em; font-size: 7px; font-weight: 600; }
.gx-field input { width: 100%; height: 40px; padding: 0 11px; border: 1px solid var(--gx-border); border-radius: 5px; outline: none; background: var(--gx-panel-2); color: var(--gx-fg); font: 11px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; transition: border-color .14s, box-shadow .14s; }
.gx-field input::placeholder { color: var(--gx-faint); }
.gx-field input:focus { border-color: var(--gx-accent); box-shadow: 0 0 0 3px var(--gx-accent-weak); }
.gx-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gx-login-divider { position: relative; height: 17px; display: flex; align-items: center; }
.gx-login-divider::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--gx-border-soft); }
.gx-login-divider span { position: relative; padding-right: 9px; background: var(--gx-panel); color: var(--gx-faint); text-transform: uppercase; letter-spacing: .08em; font-size: 7px; font-weight: 700; }
.gx-login-submit-row { display: flex; align-items: flex-end; gap: 18px; padding-top: 2px; }
.gx-login-options { min-width: 0; flex: 1; display: grid; gap: 9px; }
.gx-login-options .gx-remember { flex: none; }
.gx-remember { min-width: 0; flex: 1; display: flex; align-items: center; gap: 8px; color: var(--gx-fg); cursor: pointer; font-size: 9px; }
.gx-remember input { width: 14px; height: 14px; accent-color: var(--gx-accent); }
.gx-remember span { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gx-remember small { color: var(--gx-muted); font-size: 7px; }
.gx-save-password small { color: color-mix(in srgb, #f5b82e 82%, var(--gx-muted)); }
.gx-save-password:has(input:disabled) { opacity: .48; cursor: default; }
.gx-connect-btn { min-width: 122px; height: 40px; display: flex; align-items: center; justify-content: center; gap: 10px; border-radius: 5px; background: var(--gx-accent); color: #04211e; cursor: pointer; box-shadow: 0 3px 9px var(--gx-accent-weak); font-size: 10px; font-weight: 800; }
.gx-connect-btn:hover { filter: brightness(1.08); }
.gx-connect-btn span { font-size: 15px; }
.gx-login-security { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 5px; background: var(--gx-bg-deep); }
.gx-login-security p { margin: 0; color: var(--gx-muted); font-size: 8px; line-height: 1.45; }
.gx-saved { min-height: 100%; display: flex; flex-direction: column; padding: 22px; }
.gx-saved-head { display: flex; align-items: flex-start; gap: 12px; padding-bottom: 17px; border-bottom: 1px solid var(--gx-border-soft); }
.gx-saved-head > div { min-width: 0; flex: 1; }
.gx-saved-head span { padding: 3px 6px; border-radius: 4px; background: var(--gx-bg-deep); color: var(--gx-muted); text-transform: uppercase; letter-spacing: .07em; font-size: 7px; }
.gx-saved-list { flex: 1; display: grid; align-content: start; gap: 8px; padding: 15px 0; }
.gx-saved-empty { margin: 0; padding: 62px 22px; border: 1px dashed var(--gx-border); border-radius: 6px; background: var(--gx-bg-deep); color: var(--gx-muted); text-align: center; font-size: 9px; line-height: 1.5; }
.gx-saved-empty::before { content: "+"; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; margin: 0 auto 11px; border: 1px solid var(--gx-border); border-radius: 8px; background: var(--gx-panel); color: var(--gx-accent-strong); font-size: 17px; }
.gx-saved-card { position: relative; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--gx-border-soft); border-radius: 6px; background: var(--gx-panel-2); cursor: pointer; transition: border-color .14s, background .14s, transform .14s; }
.gx-saved-card:hover, .gx-saved-card:focus-visible { border-color: var(--gx-accent); background: var(--gx-accent-weak); outline: none; }
.gx-saved-card:hover { transform: translateY(-1px); }
.gx-saved-icon { width: 33px; height: 33px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 1px solid color-mix(in srgb, var(--gx-accent) 30%, var(--gx-border)); border-radius: 7px; background: var(--gx-accent-weak); color: var(--gx-accent-strong); font-size: 9px; font-weight: 900; }
.gx-saved-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; gap: 3px; }
.gx-saved-copy strong, .gx-saved-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gx-saved-copy strong { font-size: 9px; }
.gx-saved-copy small { color: var(--gx-muted); font-size: 7px; }
.gx-saved-remove { width: 24px; height: 24px; flex: none; border-radius: 4px; color: var(--gx-muted); cursor: pointer; }
.gx-saved-remove:hover { background: color-mix(in srgb, var(--gx-danger) 12%, transparent); color: var(--gx-danger); }
.gx-saved-foot { display: flex; align-items: flex-start; gap: 8px; padding-top: 13px; border-top: 1px solid var(--gx-border-soft); }
.gx-saved-foot > span { width: 16px; height: 16px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--gx-border); border-radius: 50%; color: var(--gx-muted); font-size: 8px; font-weight: 700; }
.gx-saved-foot p { margin: 0; color: var(--gx-muted); font-size: 8px; line-height: 1.45; }

.gx-footer { grid-column: 1 / -1; grid-row: 3; display: flex; align-items: center; padding: 0 8px; border-top: 1px solid var(--gx-border); background: var(--gx-accent); color: #04211e; font-size: 9px; font-weight: 600; z-index: 30; }
.gx-footer-spacer { flex: 1; }
.gx-app.gx-sidebar-collapsed { grid-template-columns: 48px 0 minmax(0, 1fr); }
.gx-sidebar-collapsed .gx-sidebar { visibility: hidden; }

@media (max-width: 980px) {
  .gx-app { grid-template-columns: 48px 210px minmax(0, 1fr); }
  .gx-brand { width: 258px; }
  .gx-main { grid-template-columns: minmax(0, 1fr); }
  .gx-schema { display: none; }
  .gx-login-page { grid-template-columns: 210px minmax(0, 1fr); }
  .gx-login-content { padding: 26px; }
  .gx-login-grid { grid-template-columns: 1fr; }
  .gx-login-card { order: -1; }
}

@media (max-width: 720px) {
  .gx-app { grid-template-columns: 42px minmax(0, 1fr); }
  .gx-app.gx-sidebar-collapsed { grid-template-columns: 42px minmax(0, 1fr); }
  .gx-brand { width: auto; border-right: 0; }
  .gx-brand-product, .gx-top-context, .gx-local-pill { display: none; }
  .gx-rail { grid-column: 1; }
  .gx-sidebar { display: none; }
  .gx-workbench { grid-column: 2; }
  .gx-editor-body { grid-template-columns: 28px minmax(0, 1fr); }
  .gx-run { grid-column: 1 / -1; justify-self: end; margin: 5px 9px 8px; }
  .gx-schema-graph .gx-action-label { display: none; }
  .gx-hint { display: none; }
  .gx-session-btn { padding: 0 6px; font-size: 9px; }
  .gx-login-page { grid-template-columns: 1fr; }
  .gx-login-sidebar { display: none; }
  .gx-login-content { padding: 23px 16px 30px; }
  .gx-login-heading { align-items: flex-start; }
  .gx-login-heading-status { display: none; }
  .gx-field-row { grid-template-columns: 1fr; }
  .gx-login-submit-row { align-items: stretch; flex-direction: column; }
  .gx-connect-btn { width: 100%; }
}

/* Shared Galactus website identity, with a readable light-theme wordmark. */
.gx-wordmark { display: block; flex: none; width: 204px; line-height: 0; }
.gx-wordmark img { display: block; width: 100%; height: auto; }
.gx-wordmark .gx-wordmark-light { display: none; }
html[data-theme="light"] .gx-wordmark-dark { display: none; }
html[data-theme="light"] .gx-wordmark-light { display: block; }
.gx-login-brand { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; }
.gx-login-brand .gx-wordmark { width: 198px; }
/* The login sidebar stays dark in both themes; override the page theme. */
html[data-theme] .gx-login-brand .gx-wordmark-dark { display: block; }
html[data-theme] .gx-login-brand .gx-wordmark-light { display: none; }
.gx-login-brand .gx-login-product { margin-left: 38px; font-size: 10px; letter-spacing: .08em; }
.gx-mobile-brand { display: none; }
.gx-brand-product { font-size: 12px; margin-left: 6px; }
@media (min-width:721px) and (max-width:980px) {
 .gx-brand .gx-wordmark { width: 171px; }
 .gx-login-brand .gx-wordmark { width: 175px; }
}

/* Spatial view shares the workbench palette and keeps all rendering local. */
.gx-spatial { position: absolute; inset: 0; display: flex; flex-direction: column; min-height: 0; }
.gx-spatial-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding: 8px 10px; border-bottom: 1px solid var(--gx-border-soft); font-size: 11px; }
.gx-spatial-toolbar label { display: flex; align-items: center; gap: 7px; }
.gx-spatial-toolbar select { max-width: 260px; padding: 5px; border: 1px solid var(--gx-border); border-radius: 5px; background: var(--gx-panel); }
.gx-spatial-count { margin-left: auto; color: var(--gx-muted); }
.gx-spatial-body { display: flex; flex: 1; min-height: 0; }
.gx-spatial-stage { flex: 1; min-width: 0; position: relative; overflow: hidden; background-image: radial-gradient(var(--gx-canvas-grid) 1px, transparent 1px); background-size: 20px 20px; }
.gx-spatial-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.gx-spatial-canvas:active { cursor: grabbing; }
.gx-spatial-canvas [data-feature] { cursor: pointer; }
.gx-spatial-selected > path, .gx-spatial-selected > circle { stroke-width: 3.5; }
.gx-spatial-details { width: 225px; flex: none; display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--gx-border); background: var(--gx-panel); font-size: 11px; }
.gx-spatial-list { flex: 1; min-height: 60px; overflow: auto; padding: 7px; border-bottom: 1px solid var(--gx-border-soft); }
.gx-spatial-item { display: block; width: 100%; text-align: left; overflow-wrap: anywhere; border-left: 3px solid; border-radius: 3px; padding: 8px; margin-bottom: 5px; background: var(--gx-panel-2); cursor: pointer; }
.gx-spatial-item:hover, .gx-spatial-item[aria-pressed="true"] { background: var(--gx-accent-weak); }
.gx-spatial-selection { flex: 1; overflow: auto; min-height: 60px; padding: 10px; overflow-wrap: anywhere; }
.gx-spatial-selection p { color: var(--gx-muted); margin: 7px 0; }
.gx-spatial-selection pre { font-size: 10px; white-space: pre-wrap; }
.gx-spatial-notice { flex: none; max-height: 90px; overflow: auto; padding: 8px 10px; color: var(--gx-danger); border-top: 1px solid var(--gx-border); font-size: 11px; }
.gx-spatial-stage .gx-hint { max-width: calc(100% - 20px); white-space: normal; text-align: center; pointer-events: none; }
.gx-spatial-stage .gx-empty { padding: 20px; text-align: center; }
.gx-dimension-toggle[hidden] { display: none; }
@media (max-width: 900px) {
  .gx-spatial-details { width: 175px; }
  .gx-spatial-toolbar select { max-width: 205px; }
}
@media (max-width: 600px) {
  .gx-spatial-body { flex-direction: column; }
  .gx-spatial-stage { min-height: 160px; }
  .gx-spatial-details { width: auto; height: 120px; flex-direction: row; border-left: 0; border-top: 1px solid var(--gx-border); }
  .gx-spatial-list, .gx-spatial-selection { width: 50%; }
}
@media (max-width:720px) {
 .gx-brand { padding-inline: 8px; }
 .gx-brand .gx-wordmark { width: 180px; }
 .gx-mobile-brand { display: block; }
 .gx-mobile-brand .gx-wordmark { width: 170px; }
 .gx-login-breadcrumb { display: none; }
}
@media (max-width:360px) { .gx-brand .gx-wordmark { width: 140px; } }

