:root {
  color-scheme: light;
  color: #202421;
  background: #eef1ef;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
  --border: #d4d9d5;
  --border-strong: #aab3ac;
  --muted: #667069;
  --text: #28302b;
  --text-strong: #202421;
  --surface: #fff;
  --surface-soft: #f7f9f7;
  --surface-subtle: #fafbfa;
  --panel: #fff;
  --canvas: #f5f6f4;
  --grid: #cbd1cc;
  --edge: #87918a;
  --accent: #08785d;
  --accent-soft: #e3f2ec;
  --amber: #a76508;
  --amber-soft: #fff1d3;
  --blue: #356a9b;
  --danger: #a43b32;
  --shadow: 0 10px 28px rgb(18 27 21 / 18%);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  color: #e7ece8;
  background: #111513;
  --border: #39423d;
  --border-strong: #59665f;
  --muted: #a1ada6;
  --text: #dce4df;
  --text-strong: #f2f5f3;
  --surface: #1a201d;
  --surface-soft: #222a26;
  --surface-subtle: #171c19;
  --panel: #171c19;
  --canvas: #101512;
  --grid: #303a34;
  --edge: #8e9b94;
  --accent: #42b993;
  --accent-soft: #173d31;
  --amber: #dda13e;
  --amber-soft: #3d3018;
  --blue: #79aee0;
  --danger: #ee8177;
  --shadow: 0 12px 34px rgb(0 0 0 / 45%);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { color: var(--text-strong); background: var(--surface); }
button, input, select { font: inherit; letter-spacing: 0; }
button, input, select { color: var(--text); }
button { min-height: 32px; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 0 10px; cursor: pointer; }
button:hover { border-color: var(--border-strong); background: var(--surface-soft); }
button:disabled { opacity: 0.38; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid #14866a; outline-offset: 1px; }

.topbar { height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { font-size: 15px; font-weight: 720; white-space: nowrap; }
.uri-form { height: 32px; flex: 1 1 340px; max-width: 560px; min-width: 160px; display: flex; align-items: center; gap: 7px; padding: 0 9px; border: 1px solid var(--border); background: var(--surface-soft); }
.uri-form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.uri-form span { color: var(--muted); }
.uri-form input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font: 12px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; }
.mode-tabs { height: 100%; display: flex; min-width: 0; }
.mode { height: 100%; border: 0; border-bottom: 3px solid transparent; background: transparent; padding: 0 10px; white-space: nowrap; }
.mode.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 680; }
.toolbar-actions { margin-left: auto; display: flex; align-items: center; gap: 5px; }
.icon-button { width: 34px; min-width: 34px; height: 32px; padding: 0; display: inline-grid; place-items: center; font-size: 16px; line-height: 1; text-decoration: none; border: 1px solid var(--border); color: var(--text); background: var(--surface); }
.icon-button.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.count-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 6px; border-radius: 9px; background: #e7ebe8; color: #4e5852; font-size: 11px; }
.mobile-only { display: none; }

.workspace { height: calc(100% - 52px); display: grid; grid-template-columns: 292px minmax(460px, 1fr) minmax(360px, 430px); }
.sidebar, .inspector { min-width: 0; overflow: hidden; background: var(--panel); }
.sidebar { border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.navigator-tabs { height: 38px; flex: 0 0 38px; display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--border); }
.navigator-tab, .inspector-tab { min-width: 0; border: 0; border-bottom: 2px solid transparent; background: var(--surface); padding: 0 5px; font-size: 12px; }
.navigator-tab.active, .inspector-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 650; }
.navigator-panel { display: none; min-height: 0; flex: 1; }
.navigator-panel.active { display: flex; flex-direction: column; }
.sidebar-head { padding: 10px; border-bottom: 1px solid var(--border); display: grid; gap: 8px; }
.search, .tree-search { height: 34px; display: flex; align-items: center; gap: 7px; padding: 0 8px; border: 1px solid var(--border); background: var(--surface); }
.tree-search { margin: 9px; flex: 0 0 34px; }
.search input, .tree-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); }
.filter-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 6px; }
select { width: 100%; height: 32px; min-width: 0; border: 1px solid var(--border); background: var(--surface); padding: 0 7px; }
.model-list { position: relative; flex: 1; overflow-y: auto; contain: strict; }
.model-list-inner { position: relative; width: 100%; }
.model-item { position: absolute; left: 0; right: 0; height: 62px; display: grid; grid-template-columns: minmax(0, 1fr) 34px; border-bottom: 1px solid var(--border); background: var(--surface); }
.model-item.active { background: var(--amber-soft); box-shadow: inset 3px 0 var(--amber); }
.model-open { min-width: 0; height: 100%; border: 0; background: transparent; padding: 7px 6px 7px 12px; text-align: left; display: grid; gap: 3px; }
.model-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 660; }
.model-warning-badge { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 6px; border: 1px solid #b36b18; border-radius: 50%; color: #8a4b00; font-size: 10px; vertical-align: text-bottom; }
.model-meta { color: var(--muted); font-size: 11px; display: flex; gap: 7px; overflow: hidden; }
.model-meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compare-check { display: grid; place-items: center; cursor: pointer; }
.compare-check input { width: 16px; height: 16px; accent-color: var(--accent); }
.sidebar-footer { height: 34px; flex: 0 0 34px; padding: 8px 12px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }

.tree-view { min-height: 0; flex: 1; overflow: auto; padding: 4px 0 12px; font-size: 12px; }
.tree-row { --tree-color: #7a8580; position: relative; width: 100%; min-height: 30px; border: 0; border-left: 3px solid transparent; padding: 3px 8px 3px calc(8px + var(--depth, 0) * 15px); display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; text-align: left; background: var(--surface); }
.tree-row:hover { background: var(--surface-soft); }
.tree-row.active { border-left-color: var(--tree-color); background: color-mix(in srgb, var(--tree-color) 16%, var(--surface)); }
.tree-disclosure { color: #6e7771; text-align: center; }
.tree-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-class { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; font-size: 10px; }
.source-tree .tree-row { grid-template-columns: 18px minmax(0, 1fr); }

.graph-region { min-width: 0; display: flex; flex-direction: column; background: var(--canvas); }
.canvas-toolbar { height: 42px; flex: 0 0 42px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 10px; border-bottom: 1px solid var(--border); background: var(--surface-subtle); }
.breadcrumbs { display: flex; align-items: center; min-width: 0; overflow: hidden; color: #4c5650; }
.breadcrumb { min-width: 0; height: 30px; border: 0; background: transparent; padding: 0 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumb + .breadcrumb::before { content: "/"; margin-right: 8px; color: #9aa19c; }
.breadcrumb.current { color: var(--text-strong); font-weight: 640; }
.zoom-controls { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.graph-search { width: min(230px, 24vw); height: 30px; display: flex; align-items: center; gap: 5px; padding: 0 7px; border: 1px solid var(--border); background: var(--surface); }
.graph-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 11px; }
.path-controls { display: flex; flex: 0 0 auto; }
.path-control { height: 30px; min-height: 30px; padding: 0 7px; font-size: 10px; }
.path-control.active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.zoom-controls output { width: 48px; text-align: center; color: var(--muted); font-size: 12px; }
.graph-viewport { position: relative; flex: 1; overflow: hidden; cursor: grab; touch-action: none; user-select: none; background-color: var(--canvas); background-image: radial-gradient(var(--grid) 1px, transparent 1px); background-size: 18px 18px; }
.graph-viewport.panning { cursor: grabbing; }
.graph-canvas { position: absolute; width: 1200px; height: 800px; transform-origin: 0 0; }
.layer-groups, .edges, #nodes { position: absolute; inset: 0; }
.layer-groups { z-index: 0; }
.edges { z-index: 1; width: 100%; height: 100%; overflow: visible; }
#nodes { z-index: 2; }
.layer-boundary { --layer-color: #567d70; position: absolute; border: 1px dashed var(--layer-color); background: color-mix(in srgb, var(--layer-color) 7%, transparent); pointer-events: none; }
.layer-boundary-label { position: absolute; left: 8px; top: -20px; height: 20px; padding: 2px 7px; color: #fff; background: var(--layer-color); font-size: 10px; font-weight: 650; }
.edges path { fill: none; stroke: var(--edge); stroke-width: 1.5; vector-effect: non-scaling-stroke; marker-end: url(#edge-arrow); }
.edges path[data-confidence="lineage"] { stroke: #4f6f87; }
.edges path[data-confidence="inferred"] { stroke-dasharray: 5 4; stroke: var(--blue); }
.edges path[data-confidence="ambiguous"] { stroke-dasharray: 8 3 2 3; stroke: #a76508; }
.edges path[data-confidence="unresolved"] { stroke-dasharray: 2 5; stroke: var(--danger); }
.edges path.active { stroke: var(--amber); stroke-width: 2.5; }
.graph-node { --layer-color: var(--accent); position: absolute; box-sizing: border-box; width: 248px; height: 168px; display: grid; grid-template-rows: minmax(44px, 1fr) auto minmax(44px, 1fr); border: 1px solid var(--border-strong); border-top: 4px solid var(--layer-color); border-radius: 4px; background: var(--surface); box-shadow: 0 1px 4px rgb(10 20 14 / 18%); user-select: none; overflow: hidden; }
.graph-node.dragging, .graph-node.resizing { z-index: 3; box-shadow: 0 5px 16px rgb(10 20 14 / 25%); }
.graph-node[data-kind="graph_input"], .graph-node[data-kind="scope_input"] { --layer-color: var(--blue); }
.graph-node[data-kind="graph_output"], .graph-node[data-kind="scope_output"] { --layer-color: var(--amber); }
.graph-node[data-kind="parameter"], .graph-node[data-kind="buffer"] { --layer-color: #777f79; }
.graph-node.selected { border-color: var(--amber); border-top-color: var(--amber); background: var(--amber-soft); box-shadow: 0 0 0 2px rgb(173 107 5 / 18%); }
.graph-node.multi-selected { box-shadow: 0 0 0 2px rgb(8 120 93 / 24%); }
.graph-node.path-active { box-shadow: 0 0 0 2px rgb(53 106 155 / 35%); }
.graph-node.path-muted { opacity: 0.3; }
.graph-node.search-match { box-shadow: 0 0 0 3px rgb(53 106 155 / 38%); }
.node-ports { min-width: 0; min-height: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(68px, 1fr); overflow: auto; scrollbar-width: thin; background: var(--surface-soft); }
.node-ports.inputs { border-bottom: 1px solid var(--border); }
.node-ports.outputs { border-top: 1px solid var(--border); }
.node-port { min-width: 68px; padding: 3px 5px; overflow: hidden; border-right: 1px solid var(--border); font: 9px/1.25 ui-monospace, SFMono-Regular, Menlo, monospace; }
.node-port:last-child { border-right: 0; }
.node-port { cursor: pointer; }
.node-port:hover, .node-port.selected { background: var(--accent-soft); color: var(--accent); }
.port-name, .port-shape, .port-meta { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.port-name { color: var(--text); font-weight: 650; }
.port-shape { color: var(--muted); }
.port-meta { color: #77827b; font-size: 8px; }
.node-core { min-width: 0; min-height: 60px; padding: 5px 7px; display: grid; align-content: center; gap: 2px; overflow: hidden; }
.node-heading { min-width: 0; display: flex; align-items: center; gap: 5px; cursor: move; }
.node-title { font-size: 11px; line-height: 1.2; font-weight: 680; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-heading .node-title { min-width: 0; flex: 1; }
.node-shape { color: var(--muted); font: 9px/1.15 ui-monospace, SFMono-Regular, Menlo, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-layer { color: var(--layer-color); font-size: 9px; line-height: 1.15; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-actions { flex: 0 0 auto; display: flex; gap: 2px; }
.node-action { width: 22px; min-width: 22px; min-height: 22px; height: 22px; padding: 0; display: grid; place-items: center; font-size: 11px; line-height: 1; }
.node-resize-handle { position: absolute; z-index: 2; right: 0; bottom: 0; width: 18px; min-width: 18px; height: 18px; min-height: 18px; padding: 0; border: 0; background: transparent; color: var(--muted); cursor: nwse-resize; font-size: 14px; line-height: 1; }
.node-resize-handle::after { content: "⌟"; }
.node-resize-handle:hover { color: var(--accent); background: var(--surface-soft); }
.graph-viewport[data-zoom-level="low"] .node-shape { display: none; }
.graph-viewport[data-zoom-level="low"] .node-title { font-size: 15px; }
.graph-viewport[data-zoom-level="low"] .node-layer { font-size: 11px; }
.graph-viewport[data-zoom-level="medium"] .node-title { font-size: 13px; }
.graph-viewport[data-zoom-level="medium"] .node-shape { font-size: 10px; }
.graph-viewport[data-zoom-level="medium"] .port-meta, .graph-viewport[data-zoom-level="low"] .port-meta { display: none; }
.minimap { position: absolute; z-index: 4; right: 12px; bottom: 12px; width: 136px; height: 88px; border: 1px solid var(--border-strong); background: var(--surface); cursor: crosshair; }
.graph-legend { position: absolute; z-index: 4; left: 12px; bottom: 12px; width: 154px; padding: 7px 8px; border: 1px solid var(--border-strong); background: color-mix(in srgb, var(--surface) 94%, transparent); color: var(--muted); font-size: 9px; line-height: 1.65; pointer-events: none; }
.legend-title { color: var(--text-strong); font-size: 10px; font-weight: 700; }
.legend-node { display: inline-block; width: 13px; height: 8px; margin-right: 5px; border: 1px solid var(--border-strong); border-top: 3px solid var(--accent); background: var(--surface); vertical-align: middle; }
.legend-node.input { border-top-color: var(--blue); }
.legend-node.output { border-top-color: var(--amber); }
.legend-edge { display: inline-block; width: 17px; margin-right: 5px; border-top: 2px solid #87918a; vertical-align: middle; }
.legend-edge.inferred { border-top-style: dashed; border-color: var(--blue); }
.legend-edge.ambiguous { border-top-style: dotted; border-color: var(--amber); }
.legend-layer, .legend-selection { display: inline-block; width: 13px; height: 8px; margin-right: 5px; background: #8a4f79; vertical-align: middle; }
.legend-selection { border: 2px solid var(--amber); background: var(--amber-soft); }
.continuations { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.continuation-marker { position: absolute; max-width: 180px; padding: 3px 6px; border: 1px solid var(--border-strong); background: color-mix(in srgb, var(--surface) 96%, transparent); color: var(--text); font-size: 9px; box-shadow: 0 1px 3px rgb(0 0 0 / 18%); }
.empty-state, .graph-status { position: absolute; z-index: 5; inset: 0; display: grid; place-items: center; color: var(--muted); pointer-events: none; }
.graph-status { inset: 12px auto auto 12px; padding: 7px 10px; border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--text); }

.inspector { border-left: 1px solid var(--border); display: flex; flex-direction: column; }
.panel-head { min-height: 46px; padding: 0 10px 0 13px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel-head h2 { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.panel-actions { display: flex; gap: 5px; }
.inspector-tabs { height: 38px; display: grid; grid-template-columns: repeat(5, 1fr); border-bottom: 1px solid var(--border); }
.inspector-panel { display: none; min-height: 0; flex: 1; overflow: auto; }
.inspector-panel.active { display: block; }
.metadata { padding: 12px 14px; }
.model-warning { padding: 8px 10px; border-left: 3px solid #b36b18; border-bottom: 1px solid #edcf9f; background: #fff2d9; color: #6f4005; font-size: 11px; line-height: 1.4; }
.structural-summary { padding: 10px 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; border-bottom: 1px solid var(--border); background: var(--surface-subtle); }
.summary-metric { min-width: 0; padding: 5px 6px; }
.summary-value { display: block; color: var(--text-strong); font: 12px/1.25 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.summary-label { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.metadata dl { margin: 0; display: grid; grid-template-columns: minmax(92px, 42%) 1fr; gap: 8px 10px; }
.metadata dt { color: var(--muted); }
.metadata dd { margin: 0; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.shape-list { padding: 10px 12px; display: grid; gap: 8px; }
.shape-record { border-bottom: 1px solid var(--border); padding: 0 2px 8px; }
.shape-role { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.shape-value { margin-top: 3px; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.shape-meta { color: var(--muted); font-size: 11px; }
.source-panel.active { display: flex; flex-direction: column; overflow: hidden; }
.source-toolbar { min-height: 44px; display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--border); }
.source-reference { min-width: 0; flex: 1; padding: 7px 10px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.source-actions { display: flex; gap: 4px; padding-right: 7px; }
.source-editor { min-height: 0; flex: 1; overflow: auto; background: var(--surface-subtle); }
.source-lines { min-width: max-content; padding: 6px 0 18px; font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; tab-size: 4; }
.source-code-line { min-width: 100%; min-height: 17px; display: grid; grid-template-columns: 54px minmax(max-content, 1fr); border: 0; padding: 0; text-align: left; background: transparent; white-space: pre; }
.source-code-line:hover { background: var(--surface-soft); }
.source-code-line.executed { box-shadow: inset 3px 0 #84a899; }
.source-code-line.active { background: var(--amber-soft); box-shadow: inset 3px 0 var(--amber); }
.line-number { color: #87908a; text-align: right; padding: 0 10px 0 4px; user-select: none; }
.line-code { padding-right: 18px; color: var(--text); }
.line-variables {
  display: block;
  margin-top: 2px;
  color: #6a7275;
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.syntax-keyword { color: #7a3f92; font-weight: 650; }
.syntax-string { color: #8a4b22; }
.syntax-comment { color: #748079; font-style: italic; }
.syntax-number { color: #26678b; }
.runtime-view, .config-view { padding: 10px 12px; color: var(--muted); }
.config-panel.active { display: flex; flex-direction: column; overflow: hidden; }
.config-toolbar { min-height: 42px; padding: 5px 7px; display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--border); }
.config-modes { min-width: 0; flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); }
.config-mode { min-width: 0; height: 30px; padding: 0 5px; font-size: 11px; }
.config-mode.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.config-view { min-height: 0; overflow: auto; }
.config-provenance { padding: 8px 10px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 11px; }
.config-row.changed { background: var(--amber-soft); }
.runtime-section { margin-bottom: 18px; }
.runtime-section h3 { margin: 0 0 7px; color: var(--text-strong); font-size: 12px; }
.runtime-row, .config-row { display: grid; grid-template-columns: minmax(120px, 44%) 1fr; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 11px; }
.runtime-key, .config-key { color: var(--muted); overflow-wrap: anywhere; }
.runtime-value, .config-value { color: var(--text-strong); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; white-space: pre-wrap; }

.compare-pane { position: fixed; z-index: 30; left: 50%; top: 50%; width: min(920px, calc(100% - 40px)); max-height: min(760px, calc(100% - 70px)); transform: translate(-50%, -50%); overflow: hidden; border: 1px solid var(--border-strong); background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.compare-content { min-height: 0; overflow: auto; padding: 12px 14px 18px; }
.compare-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.compare-table th, .compare-table td { border-bottom: 1px solid var(--border); padding: 8px; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.compare-table th { color: var(--muted); font-weight: 600; font-size: 12px; }
.compare-table th:first-child, .compare-table td:first-child { width: 155px; }
.compare-delta { color: var(--muted); }
.config-diff { margin-top: 16px; }
.config-diff h3 { margin: 0 0 8px; font-size: 13px; }
.compare-empty { padding: 28px; text-align: center; color: var(--muted); }
.scrim { position: fixed; inset: 52px 0 0; z-index: 20; background: rgb(13 19 15 / 32%); }

:root[data-theme="dark"] .count-badge { background: var(--surface-soft); color: var(--muted); }
:root[data-theme="dark"] .model-warning { border-color: #9b6b29; background: #3b2c18; color: #f0c982; }
:root[data-theme="dark"] .syntax-keyword { color: #d29be8; }
:root[data-theme="dark"] .syntax-string { color: #e7a67e; }
:root[data-theme="dark"] .syntax-comment { color: #8d9b93; }
:root[data-theme="dark"] .syntax-number { color: #83bde0; }

body.focus-canvas .workspace { grid-template-columns: 1fr; }
body.focus-canvas .sidebar, body.focus-canvas .inspector { display: none; }

@media (max-width: 1250px) {
  .workspace { grid-template-columns: 260px minmax(430px, 1fr) 370px; }
  .brand { display: none; }
}

@media (max-width: 980px) {
  .workspace { grid-template-columns: 250px minmax(420px, 1fr); }
  .inspector { position: fixed; z-index: 16; right: 0; top: 52px; bottom: 0; width: min(520px, 86vw); transform: translateX(100%); transition: transform 160ms ease; box-shadow: -6px 0 20px rgb(0 0 0 / 15%); }
  .inspector.open { transform: translateX(0); }
  .inspector .mobile-only { display: block; }
  .uri-form { max-width: none; }
}

@media (max-width: 720px) {
  .mobile-only { display: block; }
  .topbar { gap: 5px; padding: 0 6px; }
  .uri-form { flex-basis: 90px; min-width: 80px; }
  .mode-tabs { overflow-x: auto; }
  .mode { padding: 0 4px; font-size: 12px; }
  .toolbar-actions { gap: 3px; }
  .toolbar-actions #density-button, .toolbar-actions #focus-button, .toolbar-actions #reset-button { display: none; }
  .toolbar-actions #compare-button { display: none; }
  .workspace { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 16; left: 0; top: 52px; bottom: 0; width: min(340px, 90vw); transform: translateX(-100%); transition: transform 160ms ease; box-shadow: 6px 0 20px rgb(0 0 0 / 15%); }
  .sidebar.open { transform: translateX(0); }
  .inspector { top: auto; left: 0; width: 100%; max-width: none; height: min(76vh, 680px); transform: translateY(100%); border-left: 0; border-top: 1px solid var(--border); }
  .inspector.open { transform: translateY(0); }
  .minimap { display: none; }
  .graph-legend { left: 8px; bottom: 8px; width: 138px; padding: 5px 6px; font-size: 8px; line-height: 1.45; }
  .graph-search { width: 120px; }
  .path-controls { display: none; }
  .compare-pane { inset: auto 0 0; width: 100%; max-height: 78vh; transform: none; border-left: 0; border-right: 0; border-bottom: 0; }
  .compare-table th:first-child, .compare-table td:first-child { width: 105px; }
}
