:root {
  font-family:Inter,Geist,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:#202f37;
  background:#e8edef;
  font-synthesis:none;
  --bg:#eef2f3;
  --surface:#fff;
  --surface2:#f7f9f9;
  --border:#dce4e6;
  --text:#202f37;
  --muted:#829196;
  --subtle:#63767d;
  --accent:#0e8c82;
  --accent-bg:#e0f3ef;
  --grid:#cbd6d8;
  --editor:#f7f9f9;
  --shadow:0 5px 18px #1e42400b
}
* {
  box-sizing:border-box
}
body {
  margin:0;
  min-width:320px
}
button,textarea {
  font:inherit
}
button {
  cursor:pointer
}
button:focus-visible,textarea:focus-visible,summary:focus-visible {
  outline:2px solid #16a89b;
  outline-offset:2px
}
button {
  color:inherit
}
.app {
  height:100vh;
  min-height:650px;
  display:flex;
  flex-direction:column
}
.topbar {
  height:64px;
  flex:none;
  display:flex;
  align-items:center;
  padding:0 27px;
  background:var(--surface);
  border-bottom:1px solid var(--border)
}
.brand {
  display:flex;
  align-items:center;
  gap:10px;
  color:var(--text);
  font-weight:800;
  letter-spacing:-1px;
  font-size:20px;
  text-decoration:none
}
.brand-light {
  font-weight:400
}
.brand-mark {
  position:relative;
  width:25px;
  height:25px;
  background:#103e3e;
  border-radius:7px;
  display:block
}
.brand-mark i {
  position:absolute;
  background:#a8e9dc;
  border-radius:50%;
  width:5px;
  height:5px
}
.brand-mark i:nth-child(1) {
  left:6px;
  top:7px
}
.brand-mark i:nth-child(2) {
  right:6px;
  top:7px
}
.brand-mark i:nth-child(3) {
  left:10px;
  bottom:6px
}
.brand-mark:after {
  content:'';
  position:absolute;
  left:8px;
  top:10px;
  width:9px;
  height:7px;
  border-left:1px solid #a8e9dc;
  border-right:1px solid #a8e9dc;
  transform:skew(-20deg)
}
.top-divider {
  height:22px;
  width:1px;
  background:var(--border);
  margin:0 23px
}
.top-caption,.eyebrow,.file-label,.node-kind,.detail-label,.detail-caption,.editor-footer,.inspector-footer,.map-footer,.graph-hint {
  font:700 9px/1.4 ui-monospace,SFMono-Regular,Consolas,monospace;
  letter-spacing:.08em
}
.top-caption {
  color:#829197
}
.top-caption span,.slash {
  color:#bcc9c9;
  margin:0 7px
}
.top-actions {
  margin-left:auto;
  display:flex;
  align-items:center;
  gap:20px
}
.local-badge {
  font-size:11px;
  color:var(--subtle)
}
.local-badge span,.status-pill span:first-child,.map-footer i {
  display:inline-block;
  width:6px;
  height:6px;
  border-radius:50%;
  background:#23ad94;
  margin-right:6px
}
.icon-button {
  background:var(--surface2);
  border:1px solid var(--border);
  width:32px;
  height:32px;
  border-radius:7px;
  font-size:17px
}
.workspace {
  display:grid;
  grid-template-columns:minmax(280px,340px) minmax(400px,1fr) minmax(260px,300px);
  min-height:0;
  flex:1
}
.editor-panel,.inspector {
  background:var(--surface);
  display:flex;
  flex-direction:column;
  min-height:0
}
.editor-panel {
  border-right:1px solid var(--border);
  padding:25px 20px 0
}
.panel-heading,.inspector-heading {
  display:flex;
  align-items:flex-start;
  justify-content:space-between
}
.eyebrow {
  color:#91a2a5
}
.tiny-dot {
  display:inline-block;
  width:6px;
  height:6px;
  background:#0f9d8d;
  border-radius:50%;
  margin-right:5px
}
.panel-heading h1,.inspector-heading h2,.map-header h2 {
  font-size:18px;
  letter-spacing:-.04em;
  margin:8px 0 0;
  font-weight:700
}
.file-label {
  color:#9aa9ac;
  background:var(--surface2);
  border:1px solid var(--border);
  border-radius:4px;
  padding:5px 7px
}
.panel-description,.map-header p {
  font-size:12px;
  color:var(--subtle);
  line-height:1.6;
  margin:9px 0 20px
}
.editor-shell {
  border:1px solid var(--border);
  border-radius:7px;
  background:var(--editor);
  display:flex;
  flex-direction:column;
  min-height:220px;
  flex:1;
  overflow:hidden
}
.editor-top,.editor-bottom {
  height:37px;
  flex:none;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:0 12px;
  color:#839397;
  font:10px ui-monospace,monospace
}
.editor-top {
  border-bottom:1px solid var(--border);
  background:var(--surface);
  color:var(--subtle)
}
.sql-icon {
  color:var(--accent);
  font-size:16px;
  margin-right:6px
}
.editor-bottom {
  border-top:1px solid var(--border);
  font-size:9px
}
.editor-wrap {
  display:flex;
  flex:1;
  min-height:0;
  overflow:hidden;
  padding:15px 0
}
.line-numbers,textarea {
  font:11px/1.8 ui-monospace,SFMono-Regular,Consolas,monospace;
  white-space:pre;
  tab-size:2
}
.line-numbers {
  color:#b3c0c1;
  text-align:right;
  padding:0 11px;
  overflow:hidden;
  user-select:none
}
textarea {
  color:var(--text);
  background:transparent;
  resize:none;
  border:0;
  outline:0;
  width:100%;
  height:100%;
  padding:0 12px 0 0;
  overflow:auto
}
textarea:focus-visible {
  outline:0
}
.editor-actions {
  margin-top:14px
}
.primary-button {
  width:100%;
  height:40px;
  background:#164d49;
  color:#fff;
  border:0;
  border-radius:6px;
  text-align:left;
  padding:0 13px;
  font-size:12px;
  font-weight:700
}
.primary-button:hover {
  background:#0e7066
}
.primary-button>span {
  font-size:10px;
  margin-right:8px;
  color:#a4e4d9
}
kbd {
  float:right;
  color:#b9d7d2;
  font:10px ui-monospace,monospace;
  border:1px solid #ffffff40;
  border-radius:3px;
  padding:3px 5px
}
.secondary-actions {
  display:flex;
  gap:17px;
  margin:13px 0
}
.text-button {
  border:0;
  background:transparent;
  color:var(--subtle);
  font-size:12px;
  padding:3px 0
}
.text-button:hover {
  color:var(--accent)
}
.text-button:first-child {
  font-size:16px
}
.text-button span {
  font-size:11px;
  margin-left:4px
}
.editor-help {
  display:flex;
  gap:9px;
  color:#829398;
  font-size:11px;
  line-height:1.5;
  margin:8px 0 17px
}
.help-icon {
  border:1px solid #a6b8b8;
  border-radius:50%;
  width:14px;
  height:14px;
  flex:none;
  text-align:center;
  font:10px/13px serif
}
.diagnostics {
  max-height:130px;
  overflow:auto
}
.diagnostic-title {
  font:700 9px ui-monospace,monospace;
  color:var(--muted);
  letter-spacing:.07em;
  margin:10px 0
}
.diagnostic-title span {
  float:right
}
.diagnostic {
  display:flex;
  gap:8px;
  color:var(--subtle);
  font-size:11px;
  line-height:1.5;
  padding:7px;
  background:var(--surface2);
  margin-bottom:4px
}
.diagnostic b {
  color:#bf813b
}
.diagnostic.error b {
  color:#c25b58
}
.diagnostic small {
  display:block
}
.editor-footer,.inspector-footer {
  margin-top:auto;
  border-top:1px solid var(--border);
  padding:16px 0;
  color:#a5b2b3;
  display:flex;
  justify-content:space-between;
  font-size:8px
}
.version {
  color:#c0cbcb
}
.map-panel {
  display:flex;
  flex-direction:column;
  min-width:0;
  min-height:0;
  background:var(--bg)
}
.map-header {
  height:112px;
  flex:none;
  padding:26px 30px 15px;
  display:flex;
  justify-content:space-between;
  gap:15px;
  border-bottom:1px solid var(--border)
}
.map-header h2 {
  font-size:20px
}
.map-header p {
  margin:5px 0
}
.count {
  display:inline-block;
  vertical-align:middle;
  margin-left:5px;
  padding:3px 6px;
  background:#dfe9e8;
  color:#66817f;
  border-radius:4px;
  font:10px ui-monospace,monospace
}
.map-header-right {
  display:flex;
  align-items:flex-start;
  gap:18px;
  padding-top:7px
}
.legend {
  color:var(--subtle);
  font-size:10px;
  white-space:nowrap
}
.legend i {
  display:inline-block;
  width:7px;
  height:7px;
  border-radius:2px;
  background:#6ca4ad;
  margin:0 4px 0 12px
}
.legend i:nth-child(2) {
  background:#b7a27c
}
.legend i:nth-child(3) {
  background:#35a998
}
.status-pill {
  border:1px solid #cce6dd;
  background:#f0faf6;
  color:#438470;
  border-radius:20px;
  padding:6px 9px;
  font:700 9px ui-monospace,monospace;
  white-space:nowrap
}
.status-pill span:first-child {
  width:5px;
  height:5px
}
.graph-viewport {
  position:relative;
  flex:1;
  overflow:auto;
  min-height:0
}
.graph-grid {
  position:absolute;
  inset:0;
  min-width:100%;
  min-height:100%;
  background-image:radial-gradient(var(--grid) .8px,transparent .8px);
  background-size:20px 20px;
  opacity:.65;
  pointer-events:none
}
.graph {
  position:relative;
  transform-origin:top left
}
.edges {
  position:absolute;
  inset:0;
  overflow:visible;
  pointer-events:none;
  fill:#9db6b5
}
.edge {
  fill:none;
  stroke:#9db6b5;
  stroke-width:1.4
}
.edge-active {
  stroke:#0fa18f;
  stroke-width:2.5
}
.edge-muted {
  opacity:.2
}
.node {
  position:absolute;
  width:240px;
  background:var(--surface);
  border:1px solid #d7e1e1;
  border-radius:7px;
  box-shadow:var(--shadow);
  overflow:hidden;
  transition:opacity .2s,border-color .2s
}
.node.selected {
  border-color:#67b9ad;
  box-shadow:0 0 0 2px #54b8a72a,0 5px 18px #1e42400b
}
.node.dimmed {
  opacity:.38
}
.node-head {
  display:flex;
  align-items:center;
  text-align:left;
  width:100%;
  border:0;
  background:transparent;
  padding:12px;
  gap:10px
}
.node-icon,.detail-icon {
  width:31px;
  height:31px;
  display:grid;
  place-items:center;
  border-radius:6px;
  background:#e5f1f2;
  color:#52858c;
  font-size:17px;
  flex:none
}
.transform .node-icon {
  background:#f4f0e7;
  color:#9b865b
}
.result .node-icon {
  background:#dff3ed;
  color:#168b77
}
.node-title {
  min-width:0;
  flex:1
}
.node-title strong {
  display:block;
  margin-top:3px;
  font-size:12px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap
}
.node-kind {
  color:#9aabaa;
  font-size:8px
}
.node-arrow {
  color:#b6c4c4
}
.node-columns {
  border-top:1px solid var(--border);
  padding:5px 0
}
.column {
  display:flex;
  align-items:center;
  gap:8px;
  background:transparent;
  border:0;
  width:100%;
  padding:7px 12px;
  text-align:left;
  color:var(--subtle);
  font:10px ui-monospace,monospace
}
.column:hover,.column-selected {
  background:var(--accent-bg);
  color:#087c70
}
.column-traced .column-symbol {
  color:#0b9b89
}
.column-arrow {
  margin-left:auto;
  opacity:0
}
.column:hover .column-arrow,.column-selected .column-arrow {
  opacity:1
}
.column-symbol {
  color:#afbfbe;
  font-weight:bold
}
.more-columns,.no-columns {
  padding:8px 12px;
  font-size:10px;
  color:var(--muted)
}
.graph-tools {
  position:sticky;
  bottom:20px;
  left:20px;
  width:max-content;
  display:flex;
  align-items:center;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:6px;
  box-shadow:0 4px 12px #243e3a12;
  z-index:2
}
.graph-tools button {
  border:0;
  background:transparent;
  width:33px;
  height:33px;
  font-size:16px;
  color:var(--subtle)
}
.graph-tools button:hover {
  color:var(--accent)
}
.graph-tools span {
  font:10px ui-monospace,monospace;
  color:var(--subtle)
}
.graph-tools .tool-divider {
  width:1px;
  height:16px;
  background:var(--border);
  margin:0 3px
}
.graph-hint {
  position:sticky;
  bottom:31px;
  left:250px;
  width:max-content;
  color:#a3b1b2;
  font-size:8px;
  pointer-events:none
}
.graph-hint span {
  color:#c4d0d0
}
.empty-state {
  position:absolute;
  left:50%;
  top:45%;
  transform:translate(-50%,-50%);
  text-align:center;
  color:var(--subtle);
  font-size:12px
}
.empty-state span {
  display:block;
  font-size:30px;
  color:#9ab2b0;
  margin-bottom:15px
}
.empty-state strong {
  color:var(--text)
}
.map-footer {
  height:42px;
  flex:none;
  border-top:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 22px;
  color:#93a4a5;
  font-size:8px
}
.map-footer b {
  color:var(--accent);
  font-size:13px
}
.inspector {
  border-left:1px solid var(--border);
  padding:25px 20px 0
}
.inspector-icon {
  color:#91a9a7;
  font-size:23px
}
.inspector-content {
  overflow:auto;
  padding-top:28px;
  min-height:0
}
.inspect-empty {
  margin:50px auto;
  text-align:center;
  max-width:200px;
  color:var(--muted)
}
.inspect-empty>span {
  display:grid;
  place-items:center;
  background:var(--surface2);
  border:1px solid var(--border);
  border-radius:9px;
  width:42px;
  height:42px;
  margin:auto;
  font-size:18px
}
.inspect-empty h3 {
  color:var(--text);
  font-size:13px;
  margin:17px 0 8px
}
.inspect-empty p {
  font-size:11px;
  line-height:1.6
}
.detail-type {
  display:flex;
  align-items:center;
  gap:9px;
  color:#7e9695;
  font:700 9px ui-monospace,monospace;
  letter-spacing:.08em
}
.detail-icon {
  background:var(--accent-bg);
  color:var(--accent)
}
.detail-name {
  font-size:17px;
  letter-spacing:-.03em;
  margin:15px 0 5px;
  overflow-wrap:anywhere
}
.detail-caption {
  color:#a2b1b1;
  font-size:8px;
  margin:0 0 23px
}
.detail-block {
  border-top:1px solid var(--border);
  padding:17px 0
}
.detail-label {
  color:#90a1a1;
  margin-bottom:12px
}
.detail-label span {
  float:right;
  color:#9aabaa
}
.detail-label.space {
  margin-top:16px
}
.detail-column {
  font:11px ui-monospace,monospace;
  color:var(--accent);
  background:var(--accent-bg);
  padding:11px;
  border-radius:5px;
  overflow-wrap:anywhere
}
.inspect-column,.source-link {
  border:0;
  background:none;
  padding:8px 0;
  width:100%;
  text-align:left;
  color:var(--text);
  font:11px ui-monospace,monospace;
  overflow-wrap:anywhere
}
.inspect-column:hover,.source-link:hover {
  color:var(--accent)
}
.inspect-column span,.source-link span {
  color:#9eafae;
  margin-right:9px
}
.inspect-column b {
  float:right;
  color:#a6b6b5
}
.source-link b {
  color:#b2bfbe
}
.detail-note {
  font-size:11px;
  line-height:1.6;
  color:var(--muted)
}
pre,.condition,.branch {
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  background:var(--surface2);
  border:1px solid var(--border);
  border-radius:5px;
  padding:10px;
  color:var(--subtle);
  font:10px/1.65 ui-monospace,monospace
}
.condition,.branch {
  margin-bottom:7px
}
.condition span,.branch span {
  display:block;
  color:var(--accent);
  font-weight:700;
  margin-bottom:3px
}
.branch code {
  display:block;
  margin-bottom:6px
}
.sql-detail {
  border-top:1px solid var(--border);
  padding:15px 0;
  font-size:11px;
  color:var(--subtle)
}
.dark {
  --bg:#172124;
  --surface:#1e2a2d;
  --surface2:#263437;
  --border:#344649;
  --text:#e2eceb;
  --muted:#819896;
  --subtle:#a3b6b4;
  --accent:#50c6b4;
  --accent-bg:#254a43;
  --grid:#405454;
  --editor:#1a2629;
  --shadow:0 5px 18px #0003
}
.dark .node {
  border-color:#415654
}
.dark .node.selected {
  border-color:#50bcae
}
.dark .status-pill {
  background:#213d35;
  border-color:#365d51;
  color:#92cbb8
}
.dark .count {
  background:#344746;
  color:#b7ccca
}
.dark .node-icon {
  background:#30474a
}
.dark .transform .node-icon {
  background:#4b4434
}
.dark .result .node-icon {
  background:#254b43
}
.dark .primary-button {
  background:#197a6c
}
@media(max-width:1200px) {
  .workspace {
  grid-template-columns:290px minmax(350px,1fr) 260px
}
.legend {
  display:none
}
.editor-panel,.inspector {
  padding-left:15px;
  padding-right:15px
}
.map-header {
  padding-left:20px;
  padding-right:20px
}
}
@media(max-width:850px) {
  .app {
  height:auto;
  min-height:100vh
}
.workspace {
  display:flex;
  flex-direction:column
}
.editor-panel {
  height:500px;
  border-right:0
}
.map-panel {
  height:650px
}
.inspector {
  min-height:300px;
  border-left:0
}
.inspector-content {
  max-height:500px
}
.editor-footer,.inspector-footer {
  margin-top:10px
}
.top-caption {
  display:none
}
.top-divider {
  display:none
}
.map-header-right {
  display:none
}
.graph-hint {
  display:none
}
}
@media(max-width:500px) {
  .topbar {
  padding:0 16px
}
.local-badge {
  font-size:10px
}
.map-header {
  height:105px
}
.map-footer span:last-child {
  display:none
}
}
.edge-label {
  fill:var(--subtle);
  font:10px ui-monospace,monospace;
  paint-order:stroke;
  stroke:var(--bg);
  stroke-width:5px;
  stroke-linejoin:round
}
.trace-list {
  border-left:1px solid #a3cfc7;
  margin-left:5px;
  padding-left:15px
}
.trace-step {
  position:relative;
  margin-bottom:16px
}
.trace-step:before {
  content:"";
  position:absolute;
  left:-19px;
  top:3px;
  width:7px;
  height:7px;
  border-radius:50%;
  background:var(--accent)
}
.trace-node {
  font-size:11px;
  font-weight:700;
  overflow-wrap:anywhere
}
.trace-node span {
  color:var(--accent);
  font-weight:500
}
.trace-step code {
  display:block;
  font:10px/1.55 ui-monospace,monospace;
  color:var(--subtle);
  overflow-wrap:anywhere;
  margin-top:5px
}
.trace-step code b {
  color:var(--accent)
}
.documents-bar { margin: 14px 0 0; }
.documents-heading { display:flex; justify-content:space-between; align-items:center; color:var(--muted); font:700 9px ui-monospace,monospace; letter-spacing:.07em; }
.documents-heading button { border:0; background:none; color:var(--accent); font:600 10px system-ui,sans-serif; padding:4px 0; }
.document-list { max-height:115px; overflow:auto; margin:7px 0; }
.document-row { display:flex; align-items:center; border:1px solid transparent; border-radius:5px; }
.document-row.active { border-color:var(--border); background:var(--surface2); }
.document-select { min-width:0; flex:1; display:flex; align-items:center; gap:7px; border:0; background:none; text-align:left; padding:7px; color:var(--subtle); font-size:11px; }
.document-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.document-glyph, .dirty-dot { color:var(--accent); }
.dirty-dot { font-size:8px; margin-left:auto; }
.document-type { color:var(--accent); font:700 8px ui-monospace,monospace; }
.document-remove { border:0; background:none; color:var(--muted); font-size:16px; padding:2px 8px; }
.upload-button { width:100%; border:1px solid #a7cfc7; border-radius:6px; background:var(--accent-bg); color:var(--accent); padding:9px; font-size:11px; font-weight:700; text-align:center; }
.upload-button:hover, .add-definition:hover { filter:brightness(.95); }
.definition-notice { background:var(--accent-bg); color:var(--subtle); border-radius:5px; padding:9px; margin-top:8px; font-size:11px; overflow-wrap:anywhere; }
.definition-notice strong { color:var(--accent); }
.definition-notice button { display:block; margin-top:6px; padding:0; border:0; background:none; color:var(--accent); text-decoration:underline; font-size:11px; }
.add-definition { display:block; width:calc(100% - 20px); margin:3px 10px 10px; padding:7px; border:1px solid #a7cfc7; background:var(--accent-bg); color:var(--accent); border-radius:4px; font-size:10px; font-weight:700; }
.editor-panel { overflow-y:auto; }
.editor-shell { flex:1 0 170px; }
@media(max-width:850px) { .editor-panel { height:auto; min-height:620px; } .editor-shell { min-height:240px; } }
.diagnostic-link { width:100%; border:0; text-align:left; font:inherit; cursor:pointer; }
.diagnostic-link:hover { background:var(--accent-bg); }
.diagnostic-link small { color:var(--accent); margin-top:3px; }
.language-button { border:1px solid var(--border); border-radius:6px; background:var(--surface2); color:var(--text); min-width:36px; height:32px; font:700 10px ui-monospace,monospace; }
.language-button:hover { color:var(--accent); }
