agent-dag 1.23.3 → 1.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,160 @@
1
+ // Ensures `cswap` (claude-swap) is available, because the accounts panel is
2
+ // built entirely on the store it maintains.
3
+ //
4
+ // Unlike the ccusage install, this one lands in the user's GLOBAL tool path
5
+ // rather than a private prefix under ~/.agents-deck, and claude-swap handles
6
+ // Claude credentials. That makes it something the user should see happen: the
7
+ // caller prints what this returns, and AGENTS_DECK_NO_INSTALL=1 turns it off
8
+ // entirely. It is always best-effort — the deck's core function does not
9
+ // depend on it, so a failure is reported and then ignored.
10
+ import { execFile, spawn } from "node:child_process";
11
+ import { mkdirSync, statSync, writeFileSync } from "node:fs";
12
+ import { join } from "node:path";
13
+ import { homedir } from "node:os";
14
+
15
+ const INSTALL_TIMEOUT_MS = 180_000; // uv resolves + builds a Python env
16
+
17
+ // Same throttle the ccusage installer uses: check once a day, tracked by a
18
+ // marker file's mtime so the interval survives restarts.
19
+ const UPDATE_CHECK_MS = 24 * 3600_000;
20
+ const MARKER = join(homedir(), ".agents-deck", ".cswap-update-check");
21
+
22
+ function run(cmd, args, timeout = 10_000) {
23
+ return new Promise((resolve) => {
24
+ execFile(cmd, args, { timeout, shell: false, windowsHide: true }, (err, stdout, stderr) => {
25
+ resolve({ ok: !err, stdout: String(stdout ?? ""), stderr: String(stderr ?? "") });
26
+ });
27
+ });
28
+ }
29
+
30
+ /** Installed version string, or null when cswap isn't on PATH. */
31
+ export async function cswapVersion() {
32
+ const r = await run("cswap", ["--version"]);
33
+ if (!r.ok) return null;
34
+ // "claude-swap 0.25.0" → "0.25.0"
35
+ const m = (r.stdout || r.stderr).trim().match(/(\d+\.\d+\.\d+\S*)/);
36
+ return m ? m[1] : "installed";
37
+ }
38
+
39
+ /**
40
+ * Install claude-swap with whichever Python tool installer is present.
41
+ *
42
+ * `uv` first because it is what claude-swap documents and it is dramatically
43
+ * faster; `pipx` as the established alternative. Deliberately NOT falling back
44
+ * to bare `pip install --user`: that drops the package into the user's default
45
+ * Python environment where it can collide with their own dependencies, which
46
+ * is not a thing to do to someone without asking.
47
+ */
48
+ async function installCswap() {
49
+ for (const [cmd, args] of [
50
+ ["uv", ["tool", "install", "claude-swap"]],
51
+ ["pipx", ["install", "claude-swap"]],
52
+ ]) {
53
+ const probe = await run(cmd, ["--version"], 5_000);
54
+ if (!probe.ok) continue;
55
+ const r = await run(cmd, args, INSTALL_TIMEOUT_MS);
56
+ if (r.ok) return { ok: true, via: cmd };
57
+ return { ok: false, reason: "install_failed", via: cmd, detail: (r.stderr || r.stdout).trim().slice(0, 300) };
58
+ }
59
+ return { ok: false, reason: "no_installer" };
60
+ }
61
+
62
+ function updateCheckDue() {
63
+ try { return Date.now() - statSync(MARKER).mtimeMs > UPDATE_CHECK_MS; }
64
+ catch { return true; } // no marker yet
65
+ }
66
+ function touchMarker() {
67
+ try {
68
+ mkdirSync(join(homedir(), ".agents-deck"), { recursive: true });
69
+ writeFileSync(MARKER, String(Date.now()));
70
+ } catch { /* ignore */ }
71
+ }
72
+
73
+ /** Newest claude-swap on PyPI, or null if the check fails. */
74
+ async function latestOnPypi() {
75
+ try {
76
+ const res = await fetch("https://pypi.org/pypi/claude-swap/json", {
77
+ signal: AbortSignal.timeout(6_000),
78
+ });
79
+ if (!res.ok) return null;
80
+ const v = (await res.json())?.info?.version;
81
+ return typeof v === "string" ? v : null;
82
+ } catch {
83
+ return null;
84
+ }
85
+ }
86
+
87
+ /** Numeric-segment version compare; returns true when `a` is older than `b`. */
88
+ function isOlder(a, b) {
89
+ const seg = (v) => v.split(/[.\-+]/).map(n => parseInt(n, 10)).map(n => Number.isNaN(n) ? 0 : n);
90
+ const x = seg(a), y = seg(b);
91
+ for (let i = 0; i < Math.max(x.length, y.length); i++) {
92
+ const d = (x[i] ?? 0) - (y[i] ?? 0);
93
+ if (d !== 0) return d < 0;
94
+ }
95
+ return false;
96
+ }
97
+
98
+ /**
99
+ * Upgrade claude-swap in the background when a newer release exists.
100
+ *
101
+ * Detached and unawaited: an upgrade resolves a Python environment and can
102
+ * take tens of seconds, which is not a thing to put in front of the server
103
+ * starting. The running copy keeps working; the new one is there next launch.
104
+ */
105
+ function upgradeInBackground(via) {
106
+ const args = via === "uv" ? ["tool", "upgrade", "claude-swap"] : ["upgrade", "claude-swap"];
107
+ try {
108
+ const child = spawn(via, args, { stdio: "ignore", shell: false, windowsHide: true, detached: false });
109
+ child.on("error", () => {});
110
+ child.unref?.();
111
+ } catch { /* best-effort */ }
112
+ }
113
+
114
+ /** Whichever Python tool installer is available, or null. */
115
+ async function findInstaller() {
116
+ for (const cmd of ["uv", "pipx"]) {
117
+ if ((await run(cmd, ["--version"], 5_000)).ok) return cmd;
118
+ }
119
+ return null;
120
+ }
121
+
122
+ /**
123
+ * Make sure cswap exists and is reasonably current, installing it if missing.
124
+ *
125
+ * Returns a small status the CLI prints verbatim:
126
+ * { state: "present" | "installed" | "upgrading" | "skipped" | "unavailable", ... }
127
+ */
128
+ export async function ensureCswap() {
129
+ if (process.env.AGENTS_DECK_NO_INSTALL === "1") {
130
+ const version = await cswapVersion();
131
+ return version ? { state: "present", version } : { state: "skipped" };
132
+ }
133
+
134
+ const existing = await cswapVersion();
135
+ if (existing) {
136
+ // Installed — the only question left is whether it's stale. One PyPI
137
+ // request a day, and the upgrade itself never blocks startup.
138
+ if (!updateCheckDue()) return { state: "present", version: existing };
139
+ touchMarker();
140
+ const latest = await latestOnPypi();
141
+ if (latest && existing !== "installed" && isOlder(existing, latest)) {
142
+ const via = await findInstaller();
143
+ if (via) {
144
+ upgradeInBackground(via);
145
+ return { state: "upgrading", version: existing, latest, via };
146
+ }
147
+ }
148
+ return { state: "present", version: existing };
149
+ }
150
+
151
+ const result = await installCswap();
152
+ if (!result.ok) return { state: "unavailable", ...result };
153
+
154
+ // Freshly installed tools land in ~/.local/bin, which may not be on the PATH
155
+ // of the shell that launched us — so confirm rather than assume.
156
+ const version = await cswapVersion();
157
+ return version
158
+ ? { state: "installed", via: result.via, version }
159
+ : { state: "unavailable", reason: "not_on_path", via: result.via };
160
+ }
@@ -938,6 +938,20 @@ async function serveStatic(req, res, url) {
938
938
  }
939
939
  }
940
940
 
941
+ /** Collect a request body as a string, capped so a bad client can't fill memory. */
942
+ function readBody(req, limit = 64_000) {
943
+ return new Promise((resolve, reject) => {
944
+ let body = "";
945
+ req.setEncoding("utf8");
946
+ req.on("data", c => {
947
+ body += c;
948
+ if (body.length > limit) { req.destroy(); reject(new Error("body too large")); }
949
+ });
950
+ req.on("end", () => resolve(body));
951
+ req.on("error", reject);
952
+ });
953
+ }
954
+
941
955
  function handleEventIngest(req, res) {
942
956
  let body = "";
943
957
  req.setEncoding("utf8");
@@ -1035,6 +1049,31 @@ async function handleCcusage(req, res) {
1035
1049
  send(res, 200, data);
1036
1050
  }
1037
1051
 
1052
+ async function handleClaudeAccounts(req, res) {
1053
+ const { fetchClaudeAccounts } = await import(
1054
+ pathToFileURL(join(PKG_ROOT, "src/server/claude-accounts.mjs")).href
1055
+ );
1056
+ const url = new URL(req.url, "http://localhost");
1057
+ const force = url.searchParams.get("refresh") === "1";
1058
+ send(res, 200, await fetchClaudeAccounts({ force }));
1059
+ }
1060
+
1061
+ async function handleClaudeAccountSwitch(req, res) {
1062
+ const { switchClaudeAccount, invalidateClaudeAccountsCache } = await import(
1063
+ pathToFileURL(join(PKG_ROOT, "src/server/claude-accounts.mjs")).href
1064
+ );
1065
+ const body = await readBody(req).catch(() => null);
1066
+ let parsed = null;
1067
+ try { parsed = JSON.parse(body ?? ""); } catch { /* handled below */ }
1068
+ if (!parsed || typeof parsed !== "object") return send(res, 400, { ok: false, reason: "bad_request" });
1069
+
1070
+ const result = await switchClaudeAccount(parsed.account);
1071
+ // The active account just moved; the next poll should see it immediately
1072
+ // rather than serving the pre-switch roster for another few seconds.
1073
+ invalidateClaudeAccountsCache();
1074
+ send(res, result.ok ? 200 : 400, result);
1075
+ }
1076
+
1038
1077
  function handleHealth(_req, res) {
1039
1078
  send(res, 200, {
1040
1079
  ok: true,
@@ -1095,16 +1134,28 @@ export async function startServer({ port = 4317, host = "127.0.0.1", persist = n
1095
1134
  // already. Just keep the buffer + seq counter primed.
1096
1135
  }
1097
1136
  }
1137
+ // The async handlers below are dispatched as floating promises. Node's
1138
+ // default for an unhandled rejection is to kill the process, which would
1139
+ // take the whole deck down — SSE stream, hook ingest and all — because one
1140
+ // background quota poll hit a network error. Answer the request instead.
1141
+ const guard = (p, res) => Promise.resolve(p).catch(err => {
1142
+ console.error("agents-deck: request handler failed:", err?.message ?? err);
1143
+ if (!res.headersSent) send(res, 500, { error: "internal error" });
1144
+ else res.end();
1145
+ });
1146
+
1098
1147
  const server = createServer((req, res) => {
1099
1148
  const url = new URL(req.url ?? "/", `http://${req.headers.host ?? host}`);
1100
1149
 
1101
- if (req.method === "POST" && url.pathname === "/api/event") return handleEventIngest(req, res);
1150
+ if (req.method === "POST" && url.pathname === "/api/event") return guard(handleEventIngest(req, res), res);
1102
1151
  if (req.method === "GET" && url.pathname === "/api/health") return handleHealth(req, res);
1103
1152
  if (req.method === "GET" && url.pathname === "/events") return handleSse(req, res);
1104
- if (req.method === "GET" && url.pathname === "/api/quota") return handleQuota(req, res);
1105
- if (req.method === "GET" && url.pathname === "/api/codex-usage") return handleCodexUsage(req, res);
1106
- if (req.method === "GET" && url.pathname === "/api/codex-quota") return handleCodexQuota(req, res);
1107
- if (req.method === "GET" && url.pathname === "/api/ccusage") return handleCcusage(req, res);
1153
+ if (req.method === "GET" && url.pathname === "/api/quota") return guard(handleQuota(req, res), res);
1154
+ if (req.method === "GET" && url.pathname === "/api/codex-usage") return guard(handleCodexUsage(req, res), res);
1155
+ if (req.method === "GET" && url.pathname === "/api/codex-quota") return guard(handleCodexQuota(req, res), res);
1156
+ if (req.method === "GET" && url.pathname === "/api/ccusage") return guard(handleCcusage(req, res), res);
1157
+ if (req.method === "GET" && url.pathname === "/api/claude-accounts") return guard(handleClaudeAccounts(req, res), res);
1158
+ if (req.method === "POST" && url.pathname === "/api/claude-accounts/switch") return guard(handleClaudeAccountSwitch(req, res), res);
1108
1159
 
1109
1160
  if (req.method === "GET" && url.pathname === "/api/events") {
1110
1161
  const since = Number(url.searchParams.get("since") ?? 0);
@@ -1 +0,0 @@
1
- .react-flow{direction:ltr}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;cursor:-webkit-grab;cursor:grab}.react-flow__pane.selection{cursor:pointer}.react-flow__pane.dragging{cursor:-webkit-grabbing;cursor:grabbing}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow .react-flow__edges{pointer-events:none;overflow:visible}.react-flow__edge-path,.react-flow__connection-path{stroke:#b1b1b7;stroke-width:1;fill:none}.react-flow__edge{pointer-events:visibleStroke;cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;-webkit-animation:dashdraw .5s linear infinite;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;-webkit-animation:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge:focus .react-flow__edge-path,.react-flow__edge:focus-visible .react-flow__edge-path{stroke:#555}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge-textbg{fill:#fff}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;-webkit-animation:dashdraw .5s linear infinite;animation:dashdraw .5s linear infinite}.react-flow__connectionline{z-index:1001}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:-webkit-grab;cursor:grab}.react-flow__node.dragging{cursor:-webkit-grabbing;cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:-webkit-grab;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background:#1a192b;border:1px solid white;border-radius:100%}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:-4px;transform:translate(-50%)}.react-flow__handle-top{left:50%;top:-4px;transform:translate(-50%)}.react-flow__handle-left{top:50%;left:-4px;transform:translateY(-50%)}.react-flow__handle-right{right:-4px;top:50%;transform:translateY(-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.center{left:50%;transform:translate(-50%)}.react-flow__attribution{font-size:10px;background:#ffffff80;padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@-webkit-keyframes dashdraw{0%{stroke-dashoffset:10}}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-default,.react-flow__node-input,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:3px;width:150px;font-size:12px;color:#222;text-align:center;border-width:1px;border-style:solid;border-color:#1a192b;background-color:#fff}.react-flow__node-default.selectable:hover,.react-flow__node-input.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:0 1px 4px 1px #00000014}.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:0 0 0 .5px #1a192b}.react-flow__node-group{background-color:#f0f0f040}.react-flow__nodesselection-rect,.react-flow__selection{background:#0059dc14;border:1px dotted rgba(0,89,220,.8)}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls{box-shadow:0 0 2px 1px #00000014}.react-flow__controls-button{border:none;background:#fefefe;border-bottom:1px solid #eee;box-sizing:content-box;display:flex;justify-content:center;align-items:center;width:16px;height:16px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;padding:5px}.react-flow__controls-button:hover{background:#f4f4f4}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__minimap{background-color:#fff}.react-flow__minimap svg{display:block}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:4px;height:4px;border:1px solid #fff;border-radius:1px;background-color:#3367d9;transform:translate(-50%,-50%)}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:#3367d9;border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}:root,:root[data-theme=dark]{--bg: #0b0c10;--bg-soft: #0f1116;--panel: #14161b;--line: #1f2229;--line-soft: #1a1c22;--text: #d8dae0;--muted: #7e828c;--muted-dim: #50535b;--accent: #7dd3fc;--accent-dim: #38bdf850;--ok: #86efac;--warn: #fcd34d;--err: #fca5a5;--inflight: #f0abfc;--shadow-1: 0 6px 18px rgba(0,0,0,.25);--shadow-2: 0 10px 24px rgba(0,0,0,.32);--node-grad: linear-gradient(180deg, var(--panel), var(--bg-soft));--topbar-grad: linear-gradient(to bottom, var(--panel), var(--bg-soft));--bg-grid-1: rgba(125,211,252,.06);--bg-grid-2: rgba(240,171,252,.05);--grid-line: #1a1d24;--minimap-mask: rgba(11,12,16,.85);color-scheme:dark}:root[data-theme=light]{--bg: #eef1f6;--bg-soft: #ffffff;--panel: #ffffff;--line: #c8cdd6;--line-soft: #dde1e8;--text: #0d1117;--muted: #4a5260;--muted-dim: #7c8493;--accent: #0369a1;--accent-dim: rgba(3,105,161,.22);--ok: #15803d;--warn: #b45309;--err: #b91c1c;--inflight: #7e22ce;--shadow-1: 0 4px 14px rgba(15,23,42,.1);--shadow-2: 0 10px 28px rgba(15,23,42,.16);--node-grad: linear-gradient(180deg, #ffffff, #f2f5fa);--topbar-grad: linear-gradient(to bottom, #ffffff, #eef1f6);--bg-grid-1: rgba(3,105,161,.1);--bg-grid-2: rgba(126,34,206,.08);--grid-line: #d0d5dd;--minimap-mask: rgba(238,241,246,.85);color-scheme:light}*{box-sizing:border-box}html,body,#root{margin:0;height:100%;background:var(--bg);color:var(--text);font:13px/1.45 -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;-webkit-font-smoothing:antialiased;overscroll-behavior:none}*::-webkit-scrollbar{width:10px;height:10px}*::-webkit-scrollbar-track{background:transparent}*::-webkit-scrollbar-thumb{background:var(--line);border:2px solid var(--bg);border-radius:999px}*::-webkit-scrollbar-thumb:hover{background:var(--muted-dim)}*{scrollbar-color:var(--line) transparent;scrollbar-width:thin}:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:4px}button:focus-visible,.search input:focus-visible{outline-offset:1px}.app{display:grid;grid-template-columns:1fr 360px;grid-template-rows:52px auto 1fr;height:100vh}.app:has(.session-list){grid-template-columns:240px 1fr 360px}.app:has(.session-list) .canvas-wrap{grid-column:2}.app:has(.session-list) .conn-banner{grid-column:2}.canvas-wrap{grid-column:1;grid-row:3}.detail{grid-column:2;grid-row:2 / -1}.app:has(.session-list) .detail{grid-column:3}.topbar{grid-column:1 / -1;display:flex;align-items:center;justify-content:space-between;padding:0 18px;background:var(--topbar-grad);border-bottom:1px solid var(--line);-webkit-user-select:none;user-select:none}.topbar .brand{font-weight:600;letter-spacing:.02em;color:var(--text);display:flex;align-items:center;gap:10px;font-size:14px}.topbar .brand .logo{width:14px;height:14px;border-radius:4px;background:conic-gradient(from 220deg,#7dd3fc,#f0abfc,#86efac,#7dd3fc);box-shadow:0 0 12px #7dd3fc73}.topbar .brand .v{color:var(--muted);font-weight:400;font-size:11px;margin-left:2px}.topbar .actions{display:flex;gap:8px;align-items:center}.selected-ribbon{display:inline-flex;align-items:center;gap:8px;padding:4px 6px 4px 10px;margin:0 12px 0 4px;background:var(--bg-soft);border:1px solid var(--line);border-radius:999px;color:var(--text);font:inherit;font-size:12px;cursor:pointer;max-width:380px;min-width:0;transition:border-color .12s,background .12s}.selected-ribbon:hover{border-color:var(--accent-dim);background:var(--bg)}.selected-ribbon:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.selected-ribbon .selected-label{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;flex:0 1 auto}.selected-ribbon .selected-cost{color:var(--ok);font-variant-numeric:tabular-nums;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11.5px}.selected-ribbon .selected-rate{color:var(--muted);font-size:10.5px}.selected-ribbon .selected-extra{display:inline-flex;align-items:center;padding:1px 6px;border-radius:999px;background:var(--accent-dim);color:var(--text);font-size:10.5px;font-weight:600;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.selected-ribbon .selected-close{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:999px;color:var(--muted);font-size:14px;line-height:1;cursor:pointer;transition:background .12s,color .12s}.selected-ribbon .selected-close:hover{background:var(--line);color:var(--text)}.topbar .status{color:var(--muted);font-size:12px;margin-right:6px;display:inline-flex;align-items:center;gap:14px}.topbar .status .stat{display:inline-flex;align-items:baseline;gap:4px;font-variant-numeric:tabular-nums}.topbar .status .stat .lbl{color:var(--muted)}.topbar .status .stat+.stat:before{content:"";display:inline-block;width:1px;height:12px;background:var(--line);margin-right:10px;position:relative;top:1px}.topbar .status .pill{display:inline-flex;align-items:center;gap:6px;padding:3px 8px;border-radius:999px;background:var(--bg-soft);border:1px solid var(--line);font-size:11px}.topbar .status .pill.live{color:var(--ok);border-color:#86efac40}.topbar .status .pill.live:before{content:"";display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--ok);box-shadow:0 0 6px var(--ok);animation:pulse 1.6s ease-in-out infinite}.topbar .status .pill.dead{color:var(--err);border-color:#fca5a559;background:#fca5a50f}.topbar .status .pill.dead:before{content:"";display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--err);box-shadow:0 0 6px var(--err)}.topbar .status .count{color:var(--text);font-variant-numeric:tabular-nums}.topbar .status .mcp-legend{display:inline-flex;align-items:center;gap:3px;cursor:default}.topbar .status .mcp-legend .mcp-dot{display:inline-block;width:8px;height:8px;border-radius:50%;border:1px solid rgba(0,0,0,.35);box-shadow:0 0 4px #00000040}.topbar .status .mcp-legend .mcp-more{font-size:9.5px;color:var(--muted);margin-left:1px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}@keyframes pulse{0%,to{opacity:1}50%{opacity:.35}}button.btn{background:transparent;color:var(--text);border:1px solid var(--line);padding:6px 12px;border-radius:6px;cursor:pointer;font:inherit;font-size:12px;transition:border-color .12s,color .12s,background .12s}button.btn:hover{border-color:var(--accent-dim);color:var(--accent)}button.btn:active{transform:translateY(1px)}button.btn.primary{background:var(--accent-dim);color:var(--text);border-color:var(--accent-dim)}button.btn.warn{border-color:#fcd34d80;color:var(--warn)}button.btn.warn:hover{border-color:var(--warn);color:var(--warn)}button.btn.icon-btn{width:30px;height:30px;padding:0;display:inline-flex;align-items:center;justify-content:center;font-size:14px;line-height:1}.search{position:relative;display:inline-flex;align-items:center;margin-right:4px}.search-icon{position:absolute;left:8px;color:var(--muted);font-size:14px;pointer-events:none}.search input{background:var(--bg-soft);color:var(--text);border:1px solid var(--line);padding:6px 26px 6px 24px;border-radius:6px;font:inherit;font-size:12px;min-width:220px;outline:none;transition:border-color .12s,box-shadow .12s}.search input::placeholder{color:var(--muted)}.search input:focus{border-color:var(--accent);box-shadow:0 0 0 2px var(--accent-dim)}.search-clear{position:absolute;right:4px;background:transparent;border:none;color:var(--muted);cursor:pointer;font-size:16px;padding:0 6px;line-height:1}.search-clear:hover{color:var(--text)}.search-kbd{position:absolute;right:6px;pointer-events:none;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:10px;font-weight:600;color:var(--muted);background:var(--bg);border:1px solid var(--line);border-radius:4px;padding:0 5px;line-height:16px;height:16px}.search input:focus~.search-kbd{opacity:0}.conn-banner{grid-column:1;grid-row:2;display:flex;align-items:center;gap:10px;padding:8px 18px;background:linear-gradient(90deg,rgba(252,165,165,.12),transparent);border-bottom:1px solid rgba(252,165,165,.3);color:var(--err);font-size:12.5px;font-weight:500;animation:fadeIn .2s ease}.conn-banner .conn-dot{width:7px;height:7px;border-radius:50%;background:var(--err);box-shadow:0 0 8px var(--err);animation:pulse 1.2s infinite}.react-flow__node.rf-dim{opacity:.22;filter:saturate(.4)}.react-flow__node.rf-dim:hover{opacity:.6}.react-flow__node.rf-spotlit-out{opacity:.16;filter:saturate(.3) blur(.3px);transition:opacity .2s ease,filter .2s ease}.react-flow__node.rf-spotlit-out:hover{opacity:.55;filter:saturate(.7)}.react-flow__edge.rf-edge-selected .react-flow__edge-path{stroke-dasharray:6 3;animation:dashflow .8s linear infinite;filter:drop-shadow(0 0 4px var(--accent-dim))}.react-flow__node.rf-exiting{pointer-events:none}.react-flow__node.rf-exiting .agent-node{animation:nodeExit .6s cubic-bezier(.55,0,.55,1) forwards}@keyframes nodeExit{0%{opacity:1;filter:blur(0) saturate(1);transform:scale(1)}60%{opacity:.4;filter:blur(2px) saturate(.4)}to{opacity:0;filter:blur(6px) saturate(0);transform:scale(.85)}}.react-flow__edge.rf-edge-exiting .react-flow__edge-path{animation:edgeExit .6s ease forwards}@keyframes edgeExit{to{opacity:0;stroke-dashoffset:40}}.canvas-wrap{position:relative;background:radial-gradient(1200px 600px at 60% -10%,var(--bg-grid-1),transparent 60%),radial-gradient(1000px 500px at 10% 110%,var(--bg-grid-2),transparent 60%),var(--bg);overflow:hidden}.cat-filter-bar{position:absolute;top:14px;left:14px;z-index:6;display:flex;gap:4px;padding:4px;background:#14161bc7;border:1px solid var(--line);border-radius:999px;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);box-shadow:0 6px 18px #0000004d}:root[data-theme=light] .cat-filter-bar{background:#ffffffc7;box-shadow:0 6px 18px #0f172a1a}.cat-filter{display:inline-flex;align-items:center;gap:5px;padding:4px 10px 4px 8px;border-radius:999px;border:1px solid transparent;background:transparent;color:var(--text);font:inherit;font-size:11px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.02em;cursor:pointer;transition:background .12s,color .12s,opacity .12s}.cat-filter .cat-emoji{font-size:13px;line-height:1}.cat-filter .cat-name{text-transform:lowercase}.cat-filter:hover{background:var(--bg-soft)}.cat-filter:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.cat-filter.off{opacity:.38;color:var(--muted)}.cat-filter.off .cat-emoji{filter:grayscale(.7)}.cat-filter.off:hover{opacity:.8}.detail{position:relative;background:var(--panel);border-left:1px solid var(--line);padding:18px;overflow:auto;display:flex;flex-direction:column;gap:12px}.detail-close{position:absolute;top:10px;right:12px;width:24px;height:24px;display:grid;place-items:center;font-size:18px;line-height:1;color:var(--muted);background:transparent;border:1px solid transparent;border-radius:6px;cursor:pointer;z-index:2;transition:background .12s ease,color .12s ease,border-color .12s ease}.detail-close:hover{color:var(--text);background:var(--bg-soft, rgba(127,127,127,.12));border-color:var(--line)}.app:has(.detail-reopen){grid-template-columns:1fr}.app:has(.session-list):has(.detail-reopen){grid-template-columns:240px 1fr}.detail-reopen{position:fixed;top:64px;right:0;width:22px;height:44px;display:grid;place-items:center;font-size:16px;line-height:1;color:var(--muted);background:var(--panel);border:1px solid var(--line);border-right:none;border-radius:8px 0 0 8px;cursor:pointer;z-index:10;box-shadow:-2px 2px 8px #0003;transition:color .12s ease,background .12s ease}.detail-reopen:hover{color:var(--text)}.detail h3{margin:0;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);font-weight:600}.detail .empty{color:var(--muted);font-style:italic}.detail .hint{border:1px dashed var(--line);border-radius:8px;padding:12px;color:var(--muted);font-size:12px;line-height:1.55;background:var(--bg-soft)}.detail .hint code{background:var(--bg);border:1px solid var(--line);padding:1px 6px;border-radius:4px;font-size:11.5px;color:var(--text)}.detail .row{display:flex;justify-content:space-between;align-items:baseline;padding:5px 0;border-bottom:1px solid var(--line-soft);font-size:12px;gap:12px}.detail .row:last-child{border-bottom:none}.detail .row .k{color:var(--muted)}.detail .row .v{color:var(--text);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11.5px;overflow:hidden;text-overflow:ellipsis;max-width:220px;white-space:nowrap}.detail .tool{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;padding:5px 0;color:var(--text);display:flex;justify-content:space-between;gap:8px;border-bottom:1px solid var(--line-soft)}.detail .tool:last-child{border-bottom:none}.detail .tool .name{display:inline-flex;align-items:center;gap:8px}.detail .tool .name .status-dot{display:inline-block;width:6px;height:6px;border-radius:50%}.detail .tool .name .status-dot.inflight{background:var(--inflight);animation:pulse 1.2s infinite}.detail .tool .name .status-dot.done{background:var(--ok)}.detail .tool .name .status-dot.err{background:var(--err)}.react-flow__renderer{background:transparent}.react-flow__node{transition:transform .32s cubic-bezier(.22,1,.36,1);animation:nodeSpawn .36s cubic-bezier(.22,1,.36,1) both}@keyframes nodeSpawn{0%{opacity:0;filter:blur(2px)}to{opacity:1;filter:blur(0)}}.react-flow__node.dragging,.react-flow__node:active{transition:none}.react-flow__edge-path{stroke:var(--accent-dim);stroke-width:1.5;transition:stroke .2s ease}.react-flow__edge.animated .react-flow__edge-path{stroke:var(--inflight);stroke-dasharray:5;animation:dashflow .8s linear infinite}@keyframes dashflow{to{stroke-dashoffset:-10}}.react-flow__attribution{display:none}.react-flow__controls{background:var(--panel);border:1px solid var(--line);border-radius:8px;box-shadow:none;overflow:hidden}.react-flow__controls-button{background:var(--panel);color:var(--text);border-bottom:1px solid var(--line);fill:var(--text)}.react-flow__controls-button:hover{background:var(--bg-soft)}.agent-node{position:relative;min-width:220px;max-width:260px;padding:10px 12px 10px 16px;background:var(--node-grad);border:1px solid var(--line);border-radius:10px;color:var(--text);font-size:12px;box-shadow:var(--shadow-1);transition:border-color .2s ease,box-shadow .2s ease;overflow:hidden;will-change:transform}.agent-node:hover{box-shadow:var(--shadow-2)}.agent-node.selected{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent-dim),0 10px 24px #0006}.agent-node.state-active{border-color:var(--inflight);box-shadow:0 0 0 1px #f0abfc73,0 8px 22px #f0abfc2e}.agent-node.state-done{border-color:#86efac80}.agent-node.state-err{border-color:#fca5a599}.agent-node .accent-stripe{position:absolute;left:0;top:0;bottom:0;width:4px;background:var(--accent);opacity:.7}.agent-node .head{display:flex;align-items:center;justify-content:space-between;gap:8px}.agent-node .head-right{display:flex;align-items:center;gap:6px}.ctx-donut{background:transparent;border:none;padding:0;cursor:pointer;line-height:0;border-radius:50%;transition:filter .12s ease,transform .12s ease}.ctx-donut:hover{filter:brightness(1.2);transform:scale(1.08)}.ctx-donut:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.ctx-modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#0000008c;display:flex;align-items:center;justify-content:center;z-index:100;padding:24px}.ctx-modal{background:var(--panel);border:1px solid var(--line);border-radius:12px;box-shadow:0 20px 50px #00000080;width:min(560px,100%);max-height:80vh;overflow:auto;padding:18px 20px 22px;color:var(--text)}.ctx-modal-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}.ctx-modal-title{font-size:15px;font-weight:600}.ctx-modal-sub{font-size:11px;color:var(--muted);margin-top:3px}.ctx-modal-close{background:transparent;border:1px solid var(--line);color:var(--text);border-radius:6px;width:28px;height:28px;font-size:18px;line-height:1;cursor:pointer}.ctx-modal-close:hover{background:var(--bg-soft)}.ctx-window-row{margin-bottom:16px}.ctx-window-bar{position:relative;height:10px;border-radius:999px;background:var(--bg-soft);border:1px solid var(--line);overflow:hidden}.ctx-window-fill{height:100%;background:linear-gradient(90deg,var(--accent),var(--inflight));transition:width .4s ease}.ctx-window-meta{display:flex;justify-content:space-between;font-size:11px;margin-top:6px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;color:var(--muted)}.ctx-window-pct{color:var(--text);font-weight:600}.ctx-section-title{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);margin:18px 0 8px;font-weight:600}.ctx-grid{display:grid;grid-template-columns:1fr 1fr;gap:4px 16px}.ctx-row{display:flex;justify-content:space-between;padding:4px 0;font-size:12px;border-bottom:1px dashed var(--line)}.ctx-row.accent .ctx-row-val{color:var(--accent);font-weight:600}.ctx-row-label{color:var(--muted)}.ctx-row-val{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-variant-numeric:tabular-nums}.ctx-empty{font-size:12px;color:var(--muted);padding:8px 0}.ctx-md-list{list-style:none;padding:0;margin:0}.ctx-md-list li{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:6px 0;border-bottom:1px dashed var(--line);font-size:12px}.ctx-md-path{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;direction:rtl;text-align:left}.ctx-md-size{color:var(--muted);font-variant-numeric:tabular-nums;flex-shrink:0}.agent-node .title{display:flex;align-items:center;gap:8px;min-width:0}.agent-node .title .label{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:160px}.agent-node .time{font-variant-numeric:tabular-nums;font-size:11px;color:var(--muted);font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.state-pill{display:inline-flex;align-items:center;padding:1px 7px;font-size:10px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;border-radius:999px;border:1px solid transparent}.state-pill.state-active{color:var(--inflight);border-color:#f0abfc66;background:#f0abfc14}.state-pill.state-active:before{content:"";width:5px;height:5px;border-radius:50%;background:var(--inflight);box-shadow:0 0 6px var(--inflight);margin-right:5px;animation:pulse 1.2s infinite}.state-pill.state-done{color:var(--ok);border-color:#86efac59;background:#86efac14}.state-pill.state-err{color:var(--err);border-color:#fca5a566;background:#fca5a514}.agent-node .sub{color:var(--muted);font-size:11px;margin-top:3px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agent-node .chips{display:flex;flex-wrap:wrap;gap:4px;margin-top:8px;min-height:18px;align-items:center}.tool-chip{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:10.5px;padding:2px 6px;border-radius:4px;border:1px solid var(--line);background:var(--bg);color:var(--text);white-space:nowrap;max-width:110px;overflow:hidden;text-overflow:ellipsis}.tool-chip.inflight{border-color:#f0abfc80;color:var(--inflight);background:#f0abfc0f;animation:pulse 1.4s infinite}.tool-chip.done{border-color:#86efac40;color:var(--ok)}.tool-chip.err{border-color:#fca5a566;color:var(--err);background:#fca5a50f}.chips-empty{color:var(--muted-dim);font-size:11px;font-style:italic}.chips-more{color:var(--muted);font-size:10.5px;padding:2px 4px}.tool-spark-row{display:flex;align-items:center;gap:8px;margin-top:6px;height:14px}.tool-spark{flex:0 0 auto;overflow:visible}.tool-spark-bar{fill:var(--muted-dim);transition:fill .2s}.tool-spark-bar.active{fill:var(--accent);opacity:.72}.tool-spark-bar.latest{fill:var(--inflight);opacity:1;filter:drop-shadow(0 0 3px rgba(240,171,252,.55))}.tool-spark-label{color:var(--muted);font-size:9.5px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.04em;text-transform:uppercase}:root[data-theme=light] .tool-spark-bar.active{fill:var(--accent);opacity:.85}:root[data-theme=light] .tool-spark-bar.latest{fill:var(--inflight);filter:drop-shadow(0 0 3px rgba(126,34,206,.45))}.agent-node .meta{color:var(--muted);font-size:11px;margin-top:8px;display:flex;gap:12px}.agent-node .meta b{color:var(--text);font-weight:600}.agent-node .meta .inflight-meta,.agent-node .meta .inflight-meta b{color:var(--inflight)}.agent-node .meta .tokens-meta{color:var(--accent);margin-left:auto}.agent-node .meta .tokens-meta b{color:var(--accent)}.agent-node .meta .cost-meta{color:var(--ok);display:inline-flex;align-items:baseline;gap:4px}.agent-node .meta .cost-meta b{color:var(--ok)}.agent-node .meta .cost-meta .cost-rate{color:var(--muted);font-size:9.5px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.02em}.tokens-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px 12px;padding:8px 10px;background:var(--bg-soft);border:1px solid var(--line);border-radius:8px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}.tokens-grid>div{display:flex;justify-content:space-between;align-items:baseline}.tokens-grid .k{color:var(--muted);font-size:10.5px;text-transform:uppercase;letter-spacing:.06em}.tokens-grid b{color:var(--text);font-weight:600;font-variant-numeric:tabular-nums}.agent-node.synthetic{border-style:dashed;opacity:.92}.agent-node .synth-tag{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;border-radius:50%;border:1px solid var(--muted);color:var(--muted);font-size:10px;font-weight:700;margin-left:4px}.spawn-badge{display:inline-flex;align-items:center;padding:1px 6px;margin-left:6px;border-radius:999px;border:1px solid var(--line);color:var(--accent);background:var(--bg-soft);font-size:10.5px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-weight:600}.model-chip{display:inline-flex;align-items:center;padding:1px 7px;margin-left:6px;border-radius:999px;border:1px solid var(--line);color:var(--text);background:var(--bg-soft);font-size:10px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-weight:600;letter-spacing:.02em}.model-chip[title*=opus]{color:#f0abfc;border-color:#f0abfc66;background:#f0abfc0f}.model-chip[title*=sonnet]{color:#7dd3fc;border-color:#7dd3fc66;background:#7dd3fc0f}.model-chip[title*=haiku]{color:#86efac;border-color:#86efac66;background:#86efac0f}.model-chip[title*=fable]{color:#fcd34d;border-color:#fcd34d66;background:#fcd34d0f}:root[data-theme=light] .model-chip[title*=opus]{color:#6b21a8;border-color:#7e22ce8c;background:#7e22ce24}:root[data-theme=light] .model-chip[title*=sonnet]{color:#075985;border-color:#0369a18c;background:#0369a124}:root[data-theme=light] .model-chip[title*=haiku]{color:#166534;border-color:#15803d8c;background:#15803d24}:root[data-theme=light] .model-chip[title*=fable]{color:#92400e;border-color:#b453098c;background:#b4530924}.now-running{margin-top:8px;padding:5px 8px;border-radius:6px;background:linear-gradient(90deg,#f0abfc1a,#7dd3fc14);border:1px solid rgba(240,171,252,.3);display:flex;align-items:center;gap:8px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;color:var(--text)}:root[data-theme=light] .now-running{background:linear-gradient(90deg,#a21caf12,#0284c70f);border-color:#a21caf4d}.now-running .now-dot{width:6px;height:6px;border-radius:50%;background:var(--inflight);box-shadow:0 0 8px var(--inflight);animation:pulse 1.1s infinite}.now-running .now-label{text-transform:uppercase;letter-spacing:.08em;color:var(--inflight);font-size:9.5px;font-weight:700}.now-running .now-tool{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--text);font-weight:600}.now-running .now-time{color:var(--muted);font-variant-numeric:tabular-nums;font-size:10.5px}.react-flow__edge-textbg{fill:var(--bg-soft);fill-opacity:.9}.react-flow__edge-text{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:10px;fill:var(--text)}.session-clusters{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;z-index:0}.cluster-card{position:absolute;border-radius:16px;border:1px solid transparent;transition:opacity .2s ease,left .32s cubic-bezier(.22,1,.36,1),top .32s cubic-bezier(.22,1,.36,1),width .32s cubic-bezier(.22,1,.36,1),height .32s cubic-bezier(.22,1,.36,1);overflow:visible;pointer-events:auto;cursor:grab}.cluster-card.dragging{transition:opacity .2s ease;cursor:grabbing}.cluster-label{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:10.5px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;padding:3px 10px;border-radius:999px;background:var(--bg);border:1px solid var(--line);box-shadow:0 2px 6px #00000040;white-space:nowrap;line-height:1;cursor:grab;pointer-events:auto;touch-action:none;-webkit-user-select:none;user-select:none;transition:box-shadow .12s ease,filter .12s ease}.cluster-label:hover{filter:brightness(1.25);box-shadow:0 4px 14px #00000073,0 0 0 1px currentColor}.cluster-label.dragging{cursor:grabbing;filter:brightness(1.3);box-shadow:0 6px 18px #00000080,0 0 0 1px currentColor}.session-group-handle{cursor:grab;background:transparent}.react-flow__node-sessionGroup{cursor:grab}.react-flow__node-sessionGroup.dragging,.react-flow__node-sessionGroup:active{cursor:grabbing}.react-flow__node-sessionGroup.selected{box-shadow:none}:root[data-theme=light] .cluster-label{background:var(--bg-soft);box-shadow:0 1px 4px #0f172a14}.tool-bursts-layer{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;z-index:5;overflow:visible}.tool-bursts-svg{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;pointer-events:none;overflow:visible}.tool-conn{fill:none;stroke-width:1.4;stroke-dasharray:5 4;stroke-linecap:round;transition:opacity .3s ease}.tool-conn.status-inflight{stroke:var(--inflight);animation:dashflow .7s linear infinite;filter:drop-shadow(0 0 4px rgba(240,171,252,.45))}.tool-conn.status-done{stroke:#86efacd9}.tool-conn.status-err{stroke:#fca5a5d9}.tool-conn.fading{stroke-dasharray:4 6}.tool-burst-wrap{position:absolute;pointer-events:none;will-change:transform,left,top;transition:top .22s cubic-bezier(.22,1,.36,1)}.tool-burst{display:inline-flex;align-items:center;gap:6px;padding:5px 11px 5px 9px;border-radius:999px;background:var(--panel);border:1px solid var(--line);font-size:11px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;box-shadow:0 4px 14px #00000059,0 0 0 1px #00000040;white-space:nowrap;color:var(--text);animation:bubble-spawn .46s cubic-bezier(.34,1.56,.64,1) both}.tool-burst .tb-emoji{font-size:13px;line-height:1;filter:saturate(1.2);display:inline-block}.tool-burst .tb-name{font-weight:600;letter-spacing:.01em}.tool-burst .tb-spin{width:8px;height:8px;border-radius:50%;background:radial-gradient(circle at 30% 30%,var(--inflight),transparent 70%);box-shadow:0 0 8px var(--inflight);animation:pulse 1.1s ease-in-out infinite}.tool-burst .tb-mark{font-weight:700;font-size:12px;line-height:1;margin-left:2px;animation:mark-pop .26s cubic-bezier(.34,1.56,.64,1) both}.tool-burst .tb-mark.done{color:var(--ok);text-shadow:0 0 6px rgba(134,239,172,.55)}.tool-burst .tb-mark.err{color:var(--err);text-shadow:0 0 6px rgba(252,165,165,.55)}.tool-burst.status-inflight{border-color:#f0abfc8c;background:linear-gradient(180deg,#f0abfc1a,#7dd3fc0d),var(--panel);box-shadow:0 0 0 1px #f0abfc4d,0 6px 18px #f0abfc40}.tool-burst.status-inflight .tb-emoji{animation:emoji-wobble 1.6s ease-in-out infinite}.tool-burst.status-done{border-color:#86efac8c;background:linear-gradient(180deg,rgba(134,239,172,.1),transparent),var(--panel);box-shadow:0 0 0 1px #86efac38,0 4px 14px #86efac26;animation:bubble-spawn .46s cubic-bezier(.34,1.56,.64,1) both,bubble-done-flash .52s .46s ease-out}.tool-burst.status-err{border-color:#fca5a599;background:linear-gradient(180deg,rgba(252,165,165,.1),transparent),var(--panel);box-shadow:0 0 0 1px #fca5a559,0 4px 12px #fca5a52e;animation:bubble-spawn .46s cubic-bezier(.34,1.56,.64,1) both,bubble-err-shake .38s .46s ease-in-out}.tool-burst.fading{animation:bubble-fade .6s ease-in forwards}.tool-burst{position:relative}.tool-burst:before{content:"";position:absolute;left:4px;top:6px;bottom:6px;width:3px;border-radius:2px;background:var(--cat-accent, transparent);opacity:.85}.tool-burst.cat-file{--cat-accent: #7dd3fc}.tool-burst.cat-shell{--cat-accent: #fcd34d}.tool-burst.cat-web{--cat-accent: #67e8f9}.tool-burst.cat-agent{--cat-accent: #f0abfc}.tool-burst.cat-task{--cat-accent: #86efac}.tool-burst.cat-plan{--cat-accent: #c4b5fd}.tool-burst.cat-mcp{--cat-accent: #5eead4}.tool-burst.cat-other{--cat-accent: #94a3b8}.tool-burst.dim{opacity:.22;filter:saturate(.4);transition:opacity .18s ease,filter .18s ease}.tool-burst.dim:hover{opacity:.6}.tool-burst.sub{font-size:10.5px;padding:4px 10px 4px 8px;opacity:.94;animation:bubble-spawn .46s .22s cubic-bezier(.34,1.56,.64,1) both}.tool-burst.sub .tb-emoji{font-size:12px}.tool-burst.sub.status-done{animation:bubble-spawn .46s .22s cubic-bezier(.34,1.56,.64,1) both,bubble-done-flash .52s .68s ease-out}.tool-burst.sub.status-err{animation:bubble-spawn .46s .22s cubic-bezier(.34,1.56,.64,1) both,bubble-err-shake .38s .68s ease-in-out}.tool-burst.sub.fading{animation:bubble-fade .6s ease-in forwards}.tool-burst.clickable{pointer-events:auto;cursor:pointer}.tool-burst.clickable:hover{transform:translateY(-1px);box-shadow:0 6px 18px #00000073,0 0 0 1px var(--cat-accent, rgba(255,255,255,.15))}.tool-burst.clickable:focus-visible{outline:2px solid var(--accent);outline-offset:2px}@keyframes bubble-spawn{0%{opacity:0;transform:translate(var(--spawn-dx, -28px),var(--spawn-dy, 0)) scale(.35);filter:blur(3px) brightness(1.4)}55%{opacity:1;transform:translate(0) scale(1.12);filter:blur(0) brightness(1.15)}to{opacity:1;transform:translate(0) scale(1);filter:blur(0) brightness(1)}}@keyframes bubble-done-flash{0%{transform:scale(1);box-shadow:0 0 0 1px #86efac38,0 4px 14px #86efac26}40%{transform:scale(1.14);box-shadow:0 0 0 2px #86efac8c,0 0 22px #86efac8c}to{transform:scale(1);box-shadow:0 0 0 1px #86efac38,0 4px 14px #86efac26}}@keyframes bubble-err-shake{0%,to{transform:translate(0)}15%{transform:translate(-4px)}35%{transform:translate(4px)}55%{transform:translate(-3px)}75%{transform:translate(2px)}}@keyframes bubble-fade{0%{opacity:1;transform:scale(1) translate(0);filter:blur(0)}to{opacity:0;transform:scale(.82) translate(18px,-4px);filter:blur(1.5px)}}@keyframes emoji-wobble{0%,to{transform:rotate(-6deg) scale(1)}50%{transform:rotate(6deg) scale(1.08)}}@keyframes mark-pop{0%{opacity:0;transform:scale(.3) rotate(-30deg)}to{opacity:1;transform:scale(1) rotate(0)}}:root[data-theme=light] .tool-burst{box-shadow:0 2px 8px #0f172a1a,0 0 0 1px #0f172a0a}:root[data-theme=light] .tool-burst.status-inflight{border-color:#7e22ce8c;background:linear-gradient(180deg,rgba(126,34,206,.06),transparent),var(--panel);box-shadow:0 0 0 1px #7e22ce33,0 6px 14px #7e22ce2e}:root[data-theme=light] .tool-burst.status-done{border-color:#15803d80}:root[data-theme=light] .tool-burst.status-err{border-color:#b91c1c8c}:root[data-theme=light] .tool-conn.status-inflight{stroke:#7e22ced9;filter:drop-shadow(0 0 3px rgba(126,34,206,.35))}:root[data-theme=light] .tool-conn.status-done{stroke:#15803dd9}:root[data-theme=light] .tool-conn.status-err{stroke:#b91c1cd9}.cat-file{--cat-color: #7dd3fc}.cat-shell{--cat-color: #fcd34d}.cat-web{--cat-color: #67e8f9}.cat-agent{--cat-color: #f0abfc}.cat-task{--cat-color: #86efac}.cat-plan{--cat-color: #c4b5fd}.cat-mcp{--cat-color: #5eead4}.cat-other{--cat-color: #94a3b8}.session-list{grid-column:1;grid-row:2 / -1;background:var(--panel);border-right:1px solid var(--line);display:flex;flex-direction:column;min-height:0;overflow:hidden}.session-list .sl-header{display:flex;align-items:center;gap:8px;padding:12px 12px 10px 14px;border-bottom:1px solid var(--line)}.session-list .sl-header h3{margin:0;flex:1;display:inline-flex;align-items:center;gap:8px}.session-list .sl-count{display:inline-flex;align-items:center;padding:1px 7px;border-radius:999px;background:var(--bg-soft);border:1px solid var(--line);color:var(--text);font-size:10px;font-weight:600;text-transform:none;letter-spacing:0;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.session-list .sl-live-count{font-size:10.5px;letter-spacing:.06em;text-transform:uppercase;color:var(--inflight);font-weight:600}.session-list .sl-close{width:26px;height:26px;font-size:15px}.session-list .sl-rows{flex:1;overflow-y:auto;padding:6px;display:flex;flex-direction:column;gap:4px}.session-list .sl-empty{padding:16px 12px;color:var(--muted);font-size:12px;font-style:italic}.session-list .sl-row{display:flex;align-items:flex-start;gap:9px;padding:9px 10px;background:transparent;border:1px solid transparent;border-radius:8px;cursor:pointer;text-align:left;color:var(--text);font:inherit;transition:background .12s,border-color .12s;min-width:0}.session-list .sl-row:hover{background:var(--bg-soft)}.session-list .sl-row.selected{background:var(--bg-soft);border-color:var(--accent-dim)}.session-list .sl-row:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.session-list .sl-dot{display:inline-block;width:8px;height:8px;margin-top:6px;flex:0 0 8px;border-radius:50%;background:var(--muted-dim)}.session-list .sl-dot.state-active{background:var(--inflight);box-shadow:0 0 8px var(--inflight);animation:pulse 1.4s ease-in-out infinite}.session-list .sl-dot.state-done{background:var(--ok)}.session-list .sl-dot.state-err{background:var(--err)}.session-list .sl-row-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}.session-list .sl-row-head{display:flex;align-items:center;gap:6px;min-width:0}.session-list .sl-label{font-weight:600;font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;flex:1}.session-list .sl-row-meta{display:flex;flex-wrap:wrap;gap:8px;font-size:11px;color:var(--muted);font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.session-list .sl-row-meta b{color:var(--text);font-weight:600;font-variant-numeric:tabular-nums}.session-list .sl-cost b{color:var(--ok)}.session-list .sl-elapsed{margin-left:auto}.detail-hero{display:flex;flex-direction:column;gap:8px;padding:4px 0 14px;border-bottom:1px solid var(--line)}.detail-hero .hero-line{display:flex;align-items:center;gap:10px;min-width:0}.detail-hero .hero-title{margin:0;font-size:17px;font-weight:600;letter-spacing:.01em;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}.detail-hero .hero-meta{display:flex;align-items:center;gap:8px;font-size:11.5px;color:var(--muted);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;flex-wrap:wrap}.detail-hero .hero-meta-item{letter-spacing:.03em}.detail-hero .hero-sep{color:var(--muted-dim)}.detail-hero .hero-cost{margin-top:8px;padding:10px 12px;background:var(--bg-soft);border:1px solid var(--line);border-radius:10px}.detail-hero .hero-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}.detail-hero .hero-action-btn{padding:5px 12px;font-size:11px}.detail-hero .hero-cost-headline{display:flex;align-items:baseline;gap:6px;margin-bottom:8px}.detail-hero .hero-cost-value{font-size:22px;font-weight:700;color:var(--ok);font-variant-numeric:tabular-nums;letter-spacing:-.01em}.detail-hero .hero-cost-label{font-size:10.5px;text-transform:uppercase;letter-spacing:.1em;color:var(--muted)}.cost-bar{display:flex;height:8px;width:100%;border-radius:4px;overflow:hidden;background:var(--line);gap:1px}.cost-bar .cb-seg{height:100%;display:block;transition:filter .12s ease}.cost-bar .cb-seg:hover{filter:brightness(1.3)}.cost-bar .cb-input{background:#5e9fed}.cost-bar .cb-output{background:#c679ec}.cost-bar .cb-cache-r{background:#5cd699}.cost-bar .cb-cache-w{background:#f2b25a}.detail-section{display:flex;flex-direction:column;gap:8px;padding-top:4px}.detail-section h3{display:flex;align-items:center;gap:8px}.detail-section h3 .section-count{display:inline-flex;align-items:center;padding:1px 7px;border-radius:999px;background:var(--bg-soft);border:1px solid var(--line);color:var(--text);font-size:10px;font-weight:600;text-transform:none;letter-spacing:0;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.activity-row{display:flex;flex-direction:column;gap:8px}.activity-counters{display:flex;gap:12px;font-size:12px;color:var(--muted)}.activity-counters .ac-item b{color:var(--text);font-weight:600;font-variant-numeric:tabular-nums}.activity-counters .ac-live,.activity-counters .ac-live b{color:var(--inflight)}.activity-counters .ac-err,.activity-counters .ac-err b{color:var(--err)}.cat-strip{display:flex;flex-wrap:wrap;gap:5px}.cat-chip{display:inline-flex;align-items:center;gap:5px;padding:3px 9px 3px 7px;border-radius:999px;border:1px solid var(--line);background:var(--bg-soft);font-size:11px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.cat-chip .cat-emoji{font-size:12px;line-height:1}.cat-chip .cat-count{color:var(--text);font-weight:600;font-variant-numeric:tabular-nums}.cat-chip.cat-file{border-color:#7dd3fc66}.cat-chip.cat-shell{border-color:#fcd34d66}.cat-chip.cat-web{border-color:#67e8f966}.cat-chip.cat-agent{border-color:#f0abfc66}.cat-chip.cat-task{border-color:#86efac66}.cat-chip.cat-plan{border-color:#c4b5fd66}.cat-chip.cat-mcp{border-color:#5eead466}.prompts{display:flex;flex-direction:column;gap:8px}.prompt-entry{border:1px solid var(--line);border-radius:8px;padding:8px 10px;background:var(--bg-soft)}.prompt-time{color:var(--muted);font-size:10.5px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.04em;text-transform:uppercase;margin-bottom:4px}.prompt-text{font-size:12.5px;line-height:1.5;color:var(--text);white-space:pre-wrap;word-break:break-word}button.tool.clickable{width:100%;background:transparent;border:none;border-bottom:1px solid var(--line-soft);text-align:left;cursor:pointer;color:var(--text);font:inherit;padding:6px 0;display:flex;align-items:center;gap:8px;justify-content:space-between;border-radius:4px;transition:background .12s}button.tool.clickable{padding-left:6px;padding-right:6px}button.tool.clickable:hover{background:var(--bg-soft)}button.tool.clickable:last-child{border-bottom:none}.shortcuts{display:grid;grid-template-columns:auto 1fr;gap:6px 12px;align-items:center}.shortcuts .sc{display:contents}.shortcuts .sc kbd{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:10.5px;font-weight:600;color:var(--text);background:var(--bg-soft);border:1px solid var(--line);border-bottom-width:2px;border-radius:4px;padding:2px 7px;text-align:center;min-width:38px}.shortcuts .sc span{color:var(--muted);font-size:12px}.empty-hero .hint-row{margin-top:14px;font-size:12px;opacity:.75}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#0506098c;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;z-index:100;animation:fadeIn .14s ease-out}:root[data-theme=light] .modal-backdrop{background:#0f172a4d}.modal{width:min(820px,92vw);max-height:82vh;display:flex;flex-direction:column;background:var(--panel);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow-2),0 0 0 1px #7dd3fc1a;overflow:hidden;animation:popIn .18s cubic-bezier(.22,1,.36,1)}.modal-head{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid var(--line);background:var(--bg-soft)}.modal-title{display:flex;align-items:center;gap:10px;min-width:0}.modal-title .status-dot{display:inline-block;width:8px;height:8px;border-radius:50%}.modal-title .status-dot.inflight{background:var(--inflight);animation:pulse 1.2s infinite}.modal-title .status-dot.done{background:var(--ok)}.modal-title .status-dot.err{background:var(--err)}.modal-tool-name{font-weight:600;font-size:14px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.modal-tool-id{color:var(--muted);font-size:11px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.modal-actions{display:flex;align-items:center;gap:8px}.modal-dur{color:var(--muted);font-size:12px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.modal-body{padding:16px;overflow:auto;display:flex;flex-direction:column;gap:16px}.modal-section h4{margin:0 0 6px;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);font-weight:600;display:flex;align-items:center;gap:8px}.modal-section .err-tag{font-size:9.5px;font-weight:700;padding:1px 6px;border-radius:4px;color:var(--err);background:#fca5a51a;border:1px solid rgba(252,165,165,.3)}.modal-section pre{margin:0;padding:12px;background:var(--bg);border:1px solid var(--line);border-radius:8px;color:var(--text);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.5;white-space:pre-wrap;word-break:break-word;max-height:320px;overflow:auto}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes popIn{0%{opacity:0;transform:translateY(4px) scale(.985)}to{opacity:1;transform:none}}.session-summary{width:min(720px,92vw)}.session-summary .ss-hero{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.6fr);gap:22px;padding:18px 18px 20px;background:linear-gradient(180deg,rgba(134,239,172,.05),transparent);border-bottom:1px solid var(--line)}.session-summary .ss-hero-left{display:flex;flex-direction:column;gap:8px;min-width:0}.session-summary .ss-cost-label{font-size:10.5px;letter-spacing:.1em;text-transform:uppercase;color:var(--muted)}.session-summary .ss-cost{font-size:34px;font-weight:700;color:var(--ok);font-variant-numeric:tabular-nums;letter-spacing:-.02em;line-height:1}.session-summary .ss-models{display:flex;gap:6px;flex-wrap:wrap}.session-summary .ss-hero-right{display:flex;flex-direction:column;justify-content:center;gap:10px;min-width:0}.cost-bar.cost-bar-lg{height:14px;border-radius:7px}.session-summary .ss-cost-legend{display:grid;grid-template-columns:1fr 1fr;gap:6px 16px;font-size:11.5px;color:var(--muted);font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.session-summary .ssl{display:inline-flex;align-items:baseline;gap:5px}.session-summary .ssl b{color:var(--text);font-weight:600;font-variant-numeric:tabular-nums}.session-summary .ssl:before{content:"";display:inline-block;width:8px;height:8px;border-radius:2px;margin-right:1px}.session-summary .ssl-in:before{background:#5e9fed}.session-summary .ssl-out:before{background:#c679ec}.session-summary .ssl-cr:before{background:#5cd699}.session-summary .ssl-cw:before{background:#f2b25a}.session-summary .ss-stats{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:6px;padding:14px 18px;border-bottom:1px solid var(--line)}.session-summary .ss-stat{display:flex;flex-direction:column;gap:2px;padding:8px 10px;background:var(--bg-soft);border:1px solid var(--line);border-radius:8px}.session-summary .ss-stat-value{font-size:18px;font-weight:600;color:var(--text);font-variant-numeric:tabular-nums;letter-spacing:-.01em;line-height:1.1}.session-summary .ss-stat-label{font-size:10px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}.session-summary .ss-stat.tone-err .ss-stat-value{color:var(--err)}@media(max-width:640px){.session-summary .ss-hero{grid-template-columns:1fr}.session-summary .ss-stats{grid-template-columns:repeat(3,minmax(0,1fr))}}.session-summary .ss-top-tools{display:flex;flex-direction:column;gap:6px}.session-summary .ss-tt{display:grid;grid-template-columns:130px 1fr 36px;gap:10px;align-items:center}.session-summary .ss-tt-name{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.session-summary .ss-tt-bar{height:6px;background:var(--line);border-radius:3px;overflow:hidden}.session-summary .ss-tt-bar-fill{display:block;height:100%;background:linear-gradient(90deg,var(--accent),var(--inflight));border-radius:3px}.session-summary .ss-tt-count{text-align:right;font-variant-numeric:tabular-nums;font-size:11.5px;color:var(--muted)}.session-summary .ss-prompt{font-size:12.5px;line-height:1.55;color:var(--text);padding:10px 12px;background:var(--bg-soft);border:1px solid var(--line);border-left:3px solid var(--accent);border-radius:4px;white-space:pre-wrap;word-break:break-word;max-height:200px;overflow:auto}.empty-hero{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);text-align:center;pointer-events:none;color:var(--muted);-webkit-user-select:none;user-select:none;max-width:520px}.empty-hero .orbit-stack{position:relative;width:260px;height:260px;margin:0 auto 28px}.empty-hero .orbit{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:50%;border:1px dashed rgba(125,211,252,.18)}.empty-hero .orbit.r1{top:0;right:0;bottom:0;left:0;animation:spin 22s linear infinite}.empty-hero .orbit.r2{top:30px;right:30px;bottom:30px;left:30px;animation:spin 14s linear infinite reverse;border-color:#f0abfc33}.empty-hero .orbit.r3{top:60px;right:60px;bottom:60px;left:60px;animation:spin 9s linear infinite;border-color:#86efac38}.empty-hero .orbit .dot{position:absolute;width:14px;height:14px;border-radius:50%;top:-7px;left:50%;margin-left:-7px}.empty-hero .orbit.r1 .dot{background:var(--accent);box-shadow:0 0 22px var(--accent)}.empty-hero .orbit.r2 .dot{background:var(--inflight);box-shadow:0 0 22px var(--inflight);width:12px;height:12px;margin-left:-6px;top:-6px}.empty-hero .orbit.r3 .dot{background:var(--ok);box-shadow:0 0 22px var(--ok);width:10px;height:10px;margin-left:-5px;top:-5px}.empty-hero .orbit .dot.b{top:auto;bottom:-7px}.empty-hero .orbit.r2 .dot.b{bottom:-6px}.empty-hero .orbit.r3 .dot.b{bottom:-5px}.empty-hero .core{position:absolute;top:50%;left:50%;width:56px;height:56px;margin:-28px 0 0 -28px;border-radius:50%;background:radial-gradient(circle at 30% 30%,#f0abfc,#7dd3fc 55%,#14161b);box-shadow:0 0 28px #f0abfc8c,0 0 64px #7dd3fc59;animation:corepulse 2.6s ease-in-out infinite}.empty-hero .core:after{content:"";position:absolute;top:-14px;right:-14px;bottom:-14px;left:-14px;border-radius:50%;border:1px solid rgba(255,255,255,.06);animation:corewave 2.6s ease-out infinite}@keyframes corepulse{0%,to{transform:scale(1);filter:brightness(1)}50%{transform:scale(1.08);filter:brightness(1.15)}}@keyframes corewave{0%{transform:scale(.85);opacity:.6}to{transform:scale(1.6);opacity:0}}.empty-hero h2{color:var(--text);font-size:18px;font-weight:600;margin:0 0 8px;letter-spacing:.01em}.empty-hero p{margin:0;font-size:13px;line-height:1.65}.empty-hero code{background:var(--bg-soft);border:1px solid var(--line);padding:2px 7px;border-radius:5px;color:var(--text);font-size:12.5px}@keyframes spin{to{transform:rotate(360deg)}}:root[data-theme=light] .topbar .status .pill.live{border-color:#15803d73;background:#15803d1a}:root[data-theme=light] .topbar .status .pill.dead{border-color:#b91c1c80;background:#b91c1c1a}:root[data-theme=light] .agent-node.state-active{border-color:#7e22cea6;box-shadow:0 0 0 1px #7e22ce4d,0 8px 22px #7e22ce2e}:root[data-theme=light] .agent-node.state-done{border-color:#15803d8c}:root[data-theme=light] .agent-node.state-err{border-color:#b91c1c99}:root[data-theme=light] .state-pill.state-active{border-color:#7e22ce73;background:#7e22ce1a}:root[data-theme=light] .state-pill.state-active:before{box-shadow:0 0 5px #7e22ce8c}:root[data-theme=light] .state-pill.state-done{border-color:#15803d73;background:#15803d1a}:root[data-theme=light] .state-pill.state-err{border-color:#b91c1c80;background:#b91c1c1a}:root[data-theme=light] .tool-chip{background:#f4f6fa}:root[data-theme=light] .tool-chip.inflight{border-color:#7e22cea6;background:#7e22ce29;color:#6b21a8}:root[data-theme=light] .tool-chip.done{border-color:#15803d8c;background:#15803d1f;color:#166534}:root[data-theme=light] .tool-chip.err{border-color:#b91c1ca6;background:#b91c1c29;color:#991b1b}:root[data-theme=light] .modal-section .err-tag{background:#b91c1c1a;border-color:#b91c1c73}:root[data-theme=light] .now-running .now-dot{box-shadow:0 0 6px #7e22ce99}:root[data-theme=light] .empty-hero .orbit{border-color:#0369a14d}:root[data-theme=light] .empty-hero .orbit.r2{border-color:#7e22ce4d}:root[data-theme=light] .empty-hero .orbit.r3{border-color:#15803d52}:root[data-theme=light] .empty-hero .core{background:radial-gradient(circle at 30% 30%,#c084fc,#0ea5e9 55%,#1e293b);box-shadow:0 0 28px #7e22ce66,0 0 64px #0369a140}:root[data-theme=light] .conn-banner{background:linear-gradient(90deg,rgba(185,28,28,.14),transparent);border-bottom-color:#b91c1c73}:root[data-theme=light] button.btn.warn{border-color:#b453098c;color:var(--warn)}:root[data-theme=light] .search-clear{color:var(--muted)}:root[data-theme=light] .react-flow__edge-path{stroke:#0369a166}:root[data-theme=light] .react-flow__minimap-node{stroke:#0f172a40}.usage-panel{position:fixed;top:60px;right:368px;width:280px;max-height:calc(100vh - 76px);overflow-y:auto;background:var(--panel);border:1px solid var(--line);border-radius:10px;box-shadow:var(--shadow-2);z-index:20;padding:0 0 12px}.up-header{display:flex;align-items:center;gap:8px;padding:10px 14px 8px;border-bottom:1px solid var(--line-soft);position:sticky;top:0;background:var(--panel);z-index:1}.up-header h3{margin:0;font-size:13px;font-weight:600;flex:1}.up-header-right{display:flex;align-items:center;gap:4px}.up-last-updated{font-size:10px;color:var(--muted-dim);white-space:nowrap}.up-rate{font-size:11px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-variant-numeric:tabular-nums;color:var(--inflight);padding:2px 6px;border-radius:999px;background:#f0abfc1f}.up-close{font-size:16px;line-height:1;padding:2px 6px;color:var(--muted)}.up-total{display:flex;align-items:baseline;gap:8px;padding:14px 14px 6px}.up-total-value{font-size:26px;font-weight:700;font-variant-numeric:tabular-nums;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;color:var(--ok);line-height:1}.up-total-label{font-size:11px;color:var(--muted)}.usage-panel .cost-bar{margin:4px 14px 10px;border-radius:3px}.up-tokens-row{display:flex;flex-wrap:wrap;gap:10px 16px;padding:6px 14px 10px}.up-tok{display:flex;align-items:baseline;gap:5px;font-size:12px;font-variant-numeric:tabular-nums;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.up-k{font-size:10px;color:var(--muted);font-family:inherit}.up-section{padding:0 14px;margin-top:4px;border-top:1px solid var(--line-soft)}.up-section-title{margin:8px 0 6px;font-size:11px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}.up-table{width:100%;border-collapse:collapse;font-size:12px}.up-table th{text-align:left;color:var(--muted);font-weight:500;font-size:10px;padding:0 0 4px;border-bottom:1px solid var(--line-soft)}.up-table th:not(:first-child){text-align:right}.up-table td{padding:4px 0;vertical-align:middle}.up-model-name{color:var(--text);font-weight:500;max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.up-num{text-align:right;font-variant-numeric:tabular-nums;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;color:var(--muted);font-size:11px}.up-cost-val{color:var(--ok)}.up-sessions{display:flex;flex-direction:column;gap:4px}.up-session-row{display:flex;align-items:center;gap:7px;font-size:12px;padding:3px 0}.up-session-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text)}.up-session-tokens{font-variant-numeric:tabular-nums;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;color:var(--muted)}.up-session-cost{font-variant-numeric:tabular-nums;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;color:var(--ok);min-width:36px;text-align:right}.up-hint{padding:8px 14px 4px;font-size:11px;color:var(--muted);line-height:1.5}.up-empty{padding:20px 14px;font-size:12px;color:var(--muted);text-align:center;line-height:1.6}.app:not(:has(.detail)) .usage-panel{right:8px}.up-quota-section{padding-top:10px;border-top:none}.up-quota-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.up-refresh-btn{font-size:14px;padding:1px 7px;color:var(--muted);line-height:1.4}.up-quota-bars{display:flex;flex-direction:column;gap:10px}.qb-row{display:flex;flex-direction:column;gap:3px}.qb-meta{display:flex;justify-content:space-between;align-items:baseline;font-size:11px}.qb-label{color:var(--muted)}.qb-pct{font-variant-numeric:tabular-nums;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;font-weight:600}.qb-track{position:relative;height:6px;border-radius:3px;background:var(--line);overflow:hidden}.qb-fill{height:100%;border-radius:3px;transition:width .4s ease}.qb-pace-marker{position:absolute;top:0;bottom:0;width:2px;margin-left:-1px;border-radius:1px;box-shadow:0 0 2px #00000080;transition:left .4s ease;z-index:2}.qb-reset-row{display:flex;justify-content:space-between;align-items:baseline;gap:4px;min-height:14px}.qb-reset{font-size:10px;color:var(--muted-dim)}.qb-pace{font-size:10px;font-weight:500;text-align:right;flex-shrink:0}.qb-limit-badge{margin-left:4px;font-size:10px}.up-credits{color:var(--accent)}.up-quota-na{display:flex;flex-direction:column;gap:3px;font-size:11px;color:var(--muted)}.up-quota-hint{color:var(--muted-dim)}.up-quota-hint code{background:var(--line);padding:0 3px;border-radius:3px;font-size:10.5px}.up-quota-loading{font-size:11px;color:var(--muted-dim)}.up-quota-sub{font-size:10px;color:var(--muted-dim);margin-top:4px}:root[data-theme=light] .up-rate{background:#7e22ce1a}.uh-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#0000008c;display:flex;align-items:center;justify-content:center;z-index:100;padding:24px}.uh-modal{background:var(--panel);border:1px solid var(--line);border-radius:12px;box-shadow:0 20px 50px #00000080;width:min(760px,100%);max-height:84vh;overflow:auto;padding:16px 18px 20px;color:var(--text)}.uh-head{display:flex;align-items:center;gap:12px;margin-bottom:14px}.uh-titlewrap{display:flex;flex-direction:column;gap:2px;margin-right:auto}.uh-title{font-size:14px;font-weight:600}.uh-sub{font-size:10.5px;color:var(--muted-dim);font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.uh-range{display:inline-flex;gap:2px;background:var(--bg-soft);border:1px solid var(--line);border-radius:999px;padding:2px}.uh-range-btn{font:inherit;font-size:10.5px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;padding:2px 9px;border:none;border-radius:999px;color:var(--muted);background:transparent;cursor:pointer;transition:background .12s,color .12s}.uh-range-btn:hover{color:var(--text)}.uh-range-btn.on{background:var(--accent-dim);color:var(--text)}.uh-reload{width:24px;height:24px;font-size:13px;padding:0}.uh-close{width:24px;height:24px;font-size:16px;line-height:1;border:none;background:transparent;color:var(--muted);cursor:pointer;border-radius:6px}.uh-close:hover{color:var(--text);background:var(--bg-soft)}.uh-status{padding:40px 0;text-align:center;color:var(--muted);font-size:12px}.uh-status.uh-err{color:var(--err)}.uh-totals{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-bottom:14px}.uh-stat{display:flex;flex-direction:column;gap:2px;padding:8px 10px;background:var(--bg-soft);border:1px solid var(--line-soft);border-radius:8px}.uh-stat-val{font-size:14px;font-weight:600;font-variant-numeric:tabular-nums}.uh-stat-val.accent{color:var(--ok)}.uh-stat-label{font-size:9.5px;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}.uh-chart{display:flex;align-items:flex-end;gap:1px;height:168px;margin-bottom:10px;padding-bottom:16px;border-bottom:1px solid var(--line-soft)}.uh-bar-col{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%;position:relative;background:none;border:none;padding:0;cursor:pointer;min-width:0}.uh-bar-col:hover .uh-bar{filter:brightness(1.15)}.uh-bar-col.sel .uh-bar{outline:1px solid var(--accent);outline-offset:1px}.uh-bar{width:78%;min-height:1px;display:flex;flex-direction:column;border-radius:2px 2px 0 0;overflow:hidden;transition:height .3s ease}.uh-bar-seg{width:100%}.uh-bar-label{position:absolute;bottom:-15px;font-size:8px;color:var(--muted-dim);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;white-space:nowrap;transform:rotate(0);overflow:hidden;max-width:100%;text-overflow:ellipsis}.uh-legend{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:12px;font-size:11px;color:var(--muted)}.uh-legend-item{display:inline-flex;align-items:center;gap:5px}.uh-legend-dot{width:8px;height:8px;border-radius:2px;display:inline-block;flex-shrink:0}.uh-legend-cost{color:var(--text);font-variant-numeric:tabular-nums}.uh-detail{background:var(--bg-soft);border:1px solid var(--line-soft);border-radius:10px;padding:12px 14px}.uh-detail-head{display:flex;align-items:baseline;gap:10px;margin-bottom:10px}.uh-detail-date{font-size:12px;font-weight:600}.uh-detail-cost{font-size:12px;color:var(--ok);font-variant-numeric:tabular-nums}.uh-detail-agents{margin-left:auto;font-size:10px;color:var(--muted-dim);font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.uh-detail-mini{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin-bottom:12px}.uh-ministat{display:flex;flex-direction:column;gap:1px}.uh-ministat-val{font-size:12px;font-variant-numeric:tabular-nums}.uh-ministat-label{font-size:9px;color:var(--muted);text-transform:uppercase;letter-spacing:.05em}.uh-detail-models{display:flex;flex-direction:column;gap:5px}.uh-model-row{display:grid;grid-template-columns:130px 1fr auto;align-items:center;gap:8px}.uh-model-name{display:inline-flex;align-items:center;gap:5px;font-size:11px}.uh-model-bar{height:6px;border-radius:3px;background:var(--line);overflow:hidden}.uh-model-bar-fill{display:block;height:100%;border-radius:3px}.uh-model-cost{font-size:11px;color:var(--text);font-variant-numeric:tabular-nums}:root[data-theme=light] .uh-backdrop{background:#0f172a4d}