specpilot 2.2.4 → 2.3.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,259 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.MAX_EVENT_STREAMS = void 0;
37
+ exports.isAllowedHost = isAllowedHost;
38
+ exports.readBranch = readBranch;
39
+ exports.buildSpecsPayload = buildSpecsPayload;
40
+ exports.createSpecServer = createSpecServer;
41
+ exports.startSpecServer = startSpecServer;
42
+ const http_1 = require("http");
43
+ const fs_1 = require("fs");
44
+ const path_1 = require("path");
45
+ const yaml = __importStar(require("js-yaml"));
46
+ const specReader_1 = require("./specReader");
47
+ const specPaths_1 = require("./specPaths");
48
+ const specPoller_1 = require("./specPoller");
49
+ // Read-only local server behind `specpilot serve` (BL-051, ARCH-004.33, SEC-004.8).
50
+ // Every request re-reads disk; nothing is cached and nothing is written.
51
+ /** Resolved from this module's own location, never from cwd: dist/utils → <package>/ui. */
52
+ const UI_DIR = (0, path_1.join)(__dirname, '..', '..', 'ui');
53
+ const UI_ROUTES = {
54
+ '/': ['index.html', 'text/html; charset=utf-8'],
55
+ '/assets/app.css': ['app.css', 'text/css; charset=utf-8'],
56
+ '/assets/md.js': ['md.js', 'text/javascript; charset=utf-8'],
57
+ '/assets/route.js': ['route.js', 'text/javascript; charset=utf-8'],
58
+ '/assets/app.js': ['app.js', 'text/javascript; charset=utf-8'],
59
+ '/assets/favicon.svg': ['favicon.svg', 'image/svg+xml'],
60
+ };
61
+ /** DNS-rebinding guard: only the loopback names this server was reached on. */
62
+ function isAllowedHost(host, port) {
63
+ const h = (host ?? '').toLowerCase();
64
+ return h === `127.0.0.1:${port}` || h === `localhost:${port}`;
65
+ }
66
+ /** Current branch from .git/HEAD (worktree `.git` files and detached HEADs included), or null. */
67
+ function readBranch(root) {
68
+ try {
69
+ let gitDir = (0, path_1.join)(root, '.git');
70
+ if ((0, fs_1.statSync)(gitDir).isFile()) {
71
+ const m = /^gitdir:\s*(.+)$/m.exec((0, fs_1.readFileSync)(gitDir, 'utf-8'));
72
+ if (!m)
73
+ return null;
74
+ gitDir = (0, path_1.resolve)(root, m[1].trim());
75
+ }
76
+ const head = (0, fs_1.readFileSync)((0, path_1.join)(gitDir, 'HEAD'), 'utf-8').trim();
77
+ const ref = /^ref: refs\/heads\/(\S+)$/.exec(head);
78
+ if (ref)
79
+ return ref[1];
80
+ return /^[0-9a-f]{40}([0-9a-f]{24})?$/.test(head) ? head : null;
81
+ }
82
+ catch {
83
+ return null;
84
+ }
85
+ }
86
+ /** `key: value` lines of a leading `---` block, values as written; null when there is none. */
87
+ function frontMatter(text) {
88
+ const lines = text.split('\n');
89
+ if (lines[0]?.trim() !== '---')
90
+ return null;
91
+ const close = lines.findIndex((l, i) => i > 0 && l.trim() === '---');
92
+ if (close === -1)
93
+ return null;
94
+ const fm = {};
95
+ for (const l of lines.slice(1, close)) {
96
+ const m = /^([\w-]+):\s*(.*)$/.exec(l);
97
+ if (m)
98
+ fm[m[1]] = m[2].trim();
99
+ }
100
+ return fm;
101
+ }
102
+ /** The files under one allowlisted folder, with their front matter. */
103
+ function navFiles(root, scanned, dir, keep) {
104
+ return scanned
105
+ .filter(p => p.startsWith(dir + '/') && keep(p))
106
+ .flatMap(path => {
107
+ const real = (0, specPaths_1.resolveAllowedPath)(root, path);
108
+ return real ? [{ path, frontMatter: frontMatter((0, fs_1.readFileSync)(real, 'utf-8')) }] : [];
109
+ });
110
+ }
111
+ function projectName(yamlText) {
112
+ if (yamlText === undefined)
113
+ return null;
114
+ try {
115
+ const doc = yaml.load(yamlText);
116
+ return doc && typeof doc.name === 'string' ? doc.name : null;
117
+ }
118
+ catch {
119
+ return null;
120
+ }
121
+ }
122
+ /** tasks.md text between its front matter and its first `## ` heading, verbatim. */
123
+ function tasksIntro(text) {
124
+ const lines = text.split('\n');
125
+ let start = 0;
126
+ if (lines[0]?.trim() === '---')
127
+ start = lines.findIndex((l, i) => i > 0 && l.trim() === '---') + 1;
128
+ const end = lines.findIndex((l, i) => i >= start && /^## /.test(l.trim()));
129
+ return lines.slice(start, end === -1 ? lines.length : end).join('\n');
130
+ }
131
+ /** Everything `GET /api/specs` returns: project metadata, readSpecs() output, the nav tree. */
132
+ function buildSpecsPayload(root, specpilotVersion) {
133
+ const scanned = (0, specPaths_1.listAllowedFiles)(root).files;
134
+ const contents = {};
135
+ for (const p of scanned.filter(f => f.startsWith('.specs/'))) {
136
+ const real = (0, specPaths_1.resolveAllowedPath)(root, p);
137
+ if (real)
138
+ contents[p.slice('.specs/'.length)] = (0, fs_1.readFileSync)(real, 'utf-8');
139
+ }
140
+ const { files, tasks } = (0, specReader_1.readSpecs)(contents);
141
+ return {
142
+ project: {
143
+ name: projectName(contents['project/project.yaml']),
144
+ root,
145
+ branch: readBranch(root),
146
+ specpilotVersion,
147
+ },
148
+ files,
149
+ tasks: tasks ? { ...tasks, intro: tasksIntro(contents['planning/tasks.md']) } : null,
150
+ nav: {
151
+ specs: Object.keys(contents),
152
+ instructions: specPaths_1.ALLOWED_FILES.map(path => {
153
+ const real = (0, specPaths_1.resolveAllowedPath)(root, path);
154
+ return { path, exists: real !== null, bytes: real ? (0, fs_1.statSync)(real).size : 0 };
155
+ }),
156
+ commands: navFiles(root, scanned, '.claude/commands', p => p.endsWith('.md')),
157
+ skills: navFiles(root, scanned, '.claude/skills', p => p.endsWith('/SKILL.md')),
158
+ prompts: navFiles(root, scanned, '.github/prompts', p => p.endsWith('.md')),
159
+ },
160
+ };
161
+ }
162
+ const SECURITY_HEADERS = {
163
+ 'Content-Security-Policy': "default-src 'self'",
164
+ 'X-Content-Type-Options': 'nosniff',
165
+ 'Cache-Control': 'no-store',
166
+ };
167
+ function send(res, status, type, body) {
168
+ res.writeHead(status, { 'Content-Type': type, ...SECURITY_HEADERS });
169
+ res.end(body);
170
+ }
171
+ const TEXT = 'text/plain; charset=utf-8';
172
+ /** Most `/api/events` streams open at once; the next one gets 503 (SEC-004.9). */
173
+ exports.MAX_EVENT_STREAMS = 8;
174
+ function createSpecServer(root, specpilotVersion, opts = {}) {
175
+ // ---- live reload (BL-052): streams, heartbeat, and a poller that runs only while a stream is open
176
+ const streams = new Set();
177
+ let heartbeat = null;
178
+ const broadcast = (chunk) => streams.forEach(res => res.write(chunk));
179
+ const poller = (0, specPoller_1.createPoller)(root, {
180
+ intervalMs: opts.pollMs ?? 1000,
181
+ settleMs: opts.settleMs,
182
+ log: opts.log,
183
+ onChange: paths => broadcast(`event: change\ndata: ${JSON.stringify({ paths })}\n\n`),
184
+ });
185
+ const drop = (res) => {
186
+ if (!streams.delete(res) || streams.size)
187
+ return;
188
+ poller.stop();
189
+ if (heartbeat)
190
+ clearInterval(heartbeat);
191
+ heartbeat = null;
192
+ };
193
+ const openStream = (req, res) => {
194
+ if (streams.size >= exports.MAX_EVENT_STREAMS)
195
+ return send(res, 503, TEXT, 'Too many open event streams\n');
196
+ res.writeHead(200, { 'Content-Type': 'text/event-stream; charset=utf-8', Connection: 'keep-alive', ...SECURITY_HEADERS });
197
+ res.write('retry: 2000\n\n');
198
+ streams.add(res);
199
+ req.on('close', () => drop(res));
200
+ if (streams.size === 1) {
201
+ poller.start();
202
+ heartbeat = setInterval(() => broadcast(': heartbeat\n\n'), opts.heartbeatMs ?? 25000);
203
+ }
204
+ };
205
+ const server = (0, http_1.createServer)((req, res) => {
206
+ try {
207
+ const { port } = server.address();
208
+ if (!isAllowedHost(req.headers.host, port))
209
+ return send(res, 403, TEXT, 'Forbidden: unexpected Host header\n');
210
+ if (req.method !== 'GET') {
211
+ res.setHeader('Allow', 'GET');
212
+ return send(res, 405, TEXT, 'Method Not Allowed\n');
213
+ }
214
+ const url = new URL(req.url ?? '/', 'http://127.0.0.1');
215
+ const ui = UI_ROUTES[url.pathname];
216
+ if (ui)
217
+ return send(res, 200, ui[1], (0, fs_1.readFileSync)((0, path_1.join)(UI_DIR, ui[0])));
218
+ if (url.pathname === '/api/specs') {
219
+ return send(res, 200, 'application/json; charset=utf-8', JSON.stringify(buildSpecsPayload(root, specpilotVersion)));
220
+ }
221
+ if (url.pathname === '/api/file') {
222
+ const file = (0, specPaths_1.resolveAllowedPath)(root, url.searchParams.get('p') ?? '');
223
+ return file ? send(res, 200, TEXT, (0, fs_1.readFileSync)(file)) : send(res, 404, TEXT, 'Not Found\n');
224
+ }
225
+ if (url.pathname === '/api/events')
226
+ return openStream(req, res);
227
+ send(res, 404, TEXT, 'Not Found\n');
228
+ }
229
+ catch {
230
+ if (!res.headersSent)
231
+ send(res, 500, TEXT, 'Internal Server Error\n');
232
+ }
233
+ });
234
+ return {
235
+ server,
236
+ streams: () => streams.size,
237
+ close: () => new Promise(resolveClose => {
238
+ [...streams].forEach(res => {
239
+ res.end();
240
+ drop(res);
241
+ });
242
+ poller.stop();
243
+ server.close(() => resolveClose());
244
+ server.closeIdleConnections?.();
245
+ }),
246
+ };
247
+ }
248
+ /** Listen on 127.0.0.1 only. Rejects with the listen error (e.g. EADDRINUSE). */
249
+ function startSpecServer(root, port, specpilotVersion, opts = {}) {
250
+ const handle = createSpecServer(root, specpilotVersion, opts);
251
+ return new Promise((resolvePromise, reject) => {
252
+ handle.server.once('error', reject);
253
+ handle.server.listen(port, '127.0.0.1', () => {
254
+ handle.server.off('error', reject);
255
+ resolvePromise(handle);
256
+ });
257
+ });
258
+ }
259
+ //# sourceMappingURL=specServer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"specServer.js","sourceRoot":"","sources":["../../src/utils/specServer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,sCAGC;AAGD,gCAeC;AAmDD,8CA4BC;AAqCD,4CAoEC;AAGD,0CASC;AAlPD,+BAA6E;AAE7E,2BAA4C;AAC5C,+BAAqC;AACrC,8CAAgC;AAChC,6CAAyC;AACzC,2CAAkF;AAClF,6CAA4C;AAE5C,oFAAoF;AACpF,yEAAyE;AAEzE,2FAA2F;AAC3F,MAAM,MAAM,GAAG,IAAA,WAAI,EAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAEjD,MAAM,SAAS,GAAiD;IAC9D,GAAG,EAAE,CAAC,YAAY,EAAE,0BAA0B,CAAC;IAC/C,iBAAiB,EAAE,CAAC,SAAS,EAAE,yBAAyB,CAAC;IACzD,eAAe,EAAE,CAAC,OAAO,EAAE,gCAAgC,CAAC;IAC5D,kBAAkB,EAAE,CAAC,UAAU,EAAE,gCAAgC,CAAC;IAClE,gBAAgB,EAAE,CAAC,QAAQ,EAAE,gCAAgC,CAAC;IAC9D,qBAAqB,EAAE,CAAC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E,CAAC,CAAC;YACnC,MAAM,CAAC,oBAAoB,EAAE,EAAE,CAAC;QAClC,CAAC,CAAC;KACL,CAAC;AACJ,CAAC;AAED,iFAAiF;AACjF,SAAgB,eAAe,CAAC,IAAY,EAAE,IAAY,EAAE,gBAAwB,EAAE,OAA0B,EAAE;IAChH,MAAM,MAAM,GAAG,gBAAgB,CAAC,IAAI,EAAE,gBAAgB,EAAE,IAAI,CAAC,CAAC;IAC9D,OAAO,IAAI,OAAO,CAAC,CAAC,cAAc,EAAE,MAAM,EAAE,EAAE;QAC5C,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACpC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE;YAC3C,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YACnC,cAAc,CAAC,MAAM,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specpilot",
3
- "version": "2.2.4",
3
+ "version": "2.3.0",
4
4
  "description": "A CLI tool for initializing specification-driven development projects with flexible, production-ready structures.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -50,6 +50,7 @@
50
50
  "type": "commonjs",
51
51
  "files": [
52
52
  "dist/**/*",
53
+ "ui/**/*",
53
54
  "cli.js",
54
55
  "README.md",
55
56
  "LICENSE"
@@ -61,14 +62,12 @@
61
62
  "dependencies": {
62
63
  "chalk": "^4.1.2",
63
64
  "commander": "^14.0.1",
64
- "fs-extra": "^11.3.2",
65
65
  "handlebars": "^4.7.8",
66
66
  "inquirer": "^12.9.6",
67
67
  "js-yaml": "^4.1.0"
68
68
  },
69
69
  "devDependencies": {
70
70
  "@eslint/js": "^10.0.1",
71
- "@types/fs-extra": "^11.0.4",
72
71
  "@types/inquirer": "^9.0.9",
73
72
  "@types/jest": "^30.0.0",
74
73
  "@types/js-yaml": "^4.0.9",
package/ui/app.css ADDED
@@ -0,0 +1,299 @@
1
+ /* Design system: SpecPilot Local · Developer Tool / IDE · Dark Mode + Minimalism & Swiss (design-system/specpilot-local/MASTER.md) */
2
+ :root{
3
+ --ground:#0f172a;--group:#1b2336;--side:#0b1222;--muted:#272f42;
4
+ --sep:rgba(148,163,184,.16);--sep-2:#475569;
5
+ --label:#f8fafc;--label-2:#cbd5e1;--label-3:#94a3b8;
6
+ --accent:#22c55e;--accent-fill:#22c55e;--accent-soft:rgba(34,197,94,.14);--on-accent:#0f172a;
7
+ --focus:#60a5fa;
8
+ --green:#22c55e;--green-soft:rgba(34,197,94,.14);--green-ink:#4ade80;
9
+ --orange:#f59e0b;--orange-soft:rgba(245,158,11,.14);--orange-ink:#fbbf24;
10
+ --red:#ef4444;--red-soft:rgba(239,68,68,.14);--red-ink:#f87171;
11
+ --violet:#8b5cf6;--violet-soft:rgba(139,92,246,.16);--violet-ink:#c4b5fd;
12
+ --blue:#3b82f6;--blue-soft:rgba(59,130,246,.16);--blue-ink:#93c5fd;
13
+ --hover:rgba(148,163,184,.08);--press:rgba(148,163,184,.14);--sel:rgba(96,165,250,.14);--sel-line:#60a5fa;
14
+ --shadow:none;
15
+ --sans:"IBM Plex Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
16
+ --mono:"JetBrains Mono",ui-monospace,"SF Mono",Menlo,Consolas,monospace;
17
+ --r:4px;--rs:3px;
18
+ --t:200ms;
19
+ color-scheme:dark;
20
+ }
21
+ :root[data-theme="light"]{
22
+ --ground:#f8fafc;--group:#ffffff;--side:#f1f5f9;--muted:#e2e8f0;
23
+ --sep:rgba(15,23,42,.12);--sep-2:#cbd5e1;
24
+ --label:#0f172a;--label-2:#334155;--label-3:#64748b;
25
+ --accent:#15803d;--accent-fill:#15803d;--accent-soft:rgba(21,128,61,.12);--on-accent:#ffffff;
26
+ --focus:#2563eb;
27
+ --green:#16a34a;--green-soft:rgba(22,163,74,.12);--green-ink:#15803d;
28
+ --orange:#d97706;--orange-soft:rgba(217,119,6,.12);--orange-ink:#b45309;
29
+ --red:#dc2626;--red-soft:rgba(220,38,38,.12);--red-ink:#b91c1c;
30
+ --violet:#7c3aed;--violet-soft:rgba(124,58,237,.12);--violet-ink:#6d28d9;
31
+ --blue:#2563eb;--blue-soft:rgba(37,99,235,.12);--blue-ink:#1d4ed8;
32
+ --hover:rgba(15,23,42,.05);--press:rgba(15,23,42,.09);--sel:rgba(37,99,235,.12);--sel-line:#2563eb;
33
+ color-scheme:light;
34
+ }
35
+ *{box-sizing:border-box}
36
+ [hidden]{display:none!important}
37
+ html,body{height:100%}
38
+ body{margin:0;background:var(--ground);color:var(--label);font:14px/1.5 var(--sans);-webkit-font-smoothing:antialiased;overflow:hidden}
39
+ button,input,select{font:inherit;color:inherit}
40
+ button{cursor:pointer;background:none;border:0;padding:0;text-align:left;touch-action:manipulation;-webkit-tap-highlight-color:transparent;transition:background-color var(--t),color var(--t),border-color var(--t)}
41
+ a,.row,.opt{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
42
+ .skip{position:absolute;left:8px;top:-40px;z-index:100;background:var(--accent-fill);color:var(--on-accent);padding:6px 10px;border-radius:var(--r);font-weight:600}
43
+ .skip:focus{top:8px}
44
+ a{color:var(--accent);text-decoration:none}
45
+ ::selection{background:var(--sel)}
46
+ :focus-visible{outline:2px solid var(--focus);outline-offset:2px;border-radius:var(--rs)}
47
+ *{scrollbar-width:thin;scrollbar-color:var(--sep-2) transparent}
48
+ *::-webkit-scrollbar{width:8px;height:8px}*::-webkit-scrollbar-thumb{background:var(--sep-2);border-radius:8px}*::-webkit-scrollbar-track{background:transparent}
49
+ .mono{font-family:var(--mono);font-size:12.5px;letter-spacing:0}
50
+ .num{font-variant-numeric:tabular-nums}
51
+ .ico{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round;flex:none}
52
+ @media (prefers-reduced-motion: reduce){*{animation:none!important;transition:none!important}}
53
+
54
+
55
+ /* ---------- window ---------- */
56
+ .win{display:grid;grid-template-columns:60px 252px minmax(0,1fr);height:100%}
57
+ /* ---------- project rail ---------- */
58
+ .rail{background:var(--side);border-right:1px solid var(--sep);display:flex;flex-direction:column;align-items:center;gap:6px;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:none;padding:calc(10px + env(safe-area-inset-top,0px)) 8px calc(10px + env(safe-area-inset-bottom,0px)) calc(8px + env(safe-area-inset-left,0px))}
59
+ .rail::-webkit-scrollbar{display:none}
60
+ .rail .logo{width:26px;height:26px;border-radius:var(--r);flex:none;margin-bottom:2px}
61
+ .rlist{display:flex;flex-direction:column;align-items:center;gap:6px;width:100%}
62
+ .rsep{width:22px;height:1px;background:var(--sep);flex:none;margin:2px 0}
63
+ .rfoot{margin-top:auto;display:flex;flex-direction:column;align-items:center;gap:6px;width:100%;padding-top:8px}
64
+ .tile{position:relative;width:44px;height:44px;flex:none;border-radius:var(--r);display:grid;place-items:center;background:var(--muted);color:var(--label-2);font-size:13.5px;font-weight:600;font-family:var(--sans);transition:background var(--t),color var(--t)}
65
+ .tile:hover{background:var(--press);color:var(--label)}
66
+ .tile.blue{color:var(--blue-ink)}.tile.green{color:var(--green-ink)}.tile.orange{color:var(--orange-ink)}.tile.violet{color:var(--violet-ink)}
67
+ .tile.cur{background:var(--press);color:var(--label)}
68
+ .tile.cur::before{content:"";position:absolute;left:-8px;top:50%;transform:translateY(-50%);width:3px;height:26px;background:var(--accent);border-radius:0 var(--rs) var(--rs) 0}
69
+ .tile.ghost{background:transparent;color:var(--label-3)}
70
+ .tile.ghost:hover{background:var(--hover);color:var(--label-2)}
71
+ .tile.ghost svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:1.8}
72
+ .tip{position:fixed;z-index:90;background:var(--group);border:1px solid var(--sep-2);border-radius:var(--r);padding:6px 9px;color:var(--label);font-size:12.5px;line-height:1.35;pointer-events:none;opacity:0;transform:translateX(-4px);transition:opacity 140ms ease-out,transform 140ms ease-out;white-space:nowrap;max-width:300px}
73
+ .tip.on{opacity:1;transform:none}
74
+ .tip .k{color:var(--label-3);font-family:var(--mono);font-size:11px;margin-left:8px}
75
+ .tip .p{display:block;color:var(--label-3);font-family:var(--mono);font-size:11px;margin-top:3px;max-width:280px;overflow:hidden;text-overflow:ellipsis}
76
+ .scrim{display:none;position:fixed;inset:0;background:rgba(2,6,23,.55);z-index:29;opacity:0;transition:opacity .22s}
77
+ .src{background:var(--side);border-right:1px solid var(--sep);display:flex;flex-direction:column;min-height:0;padding:calc(10px + env(safe-area-inset-top,0px)) 8px calc(10px + env(safe-area-inset-bottom,0px)) calc(8px + env(safe-area-inset-left,0px));overscroll-behavior:contain}
78
+ .src .top{display:flex;align-items:center;gap:9px;min-width:0;margin:2px 0 12px;padding:9px 11px;border:1px solid var(--sep);border-radius:var(--r);background:var(--group)}
79
+ .src .top b{font-size:14.5px;font-weight:600;letter-spacing:-.01em;color:var(--label);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
80
+ .src .top .br{margin-left:auto;font-family:var(--mono);font-size:11.5px;color:var(--label-3);flex:none;max-width:88px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
81
+ .logo{width:22px;height:22px;border-radius:6px;flex:none}
82
+ .search{display:flex;align-items:center;gap:6px;background:var(--muted);border:1px solid transparent;border-radius:var(--r);padding:6px 9px;color:var(--label-3);margin:0 0 4px;width:100%}
83
+ .search:hover{border-color:var(--sep)}
84
+ .search kbd{margin-left:auto;font-family:var(--mono);font-size:11px;color:var(--label-3)}
85
+ .snav{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:none}
86
+ .snav::-webkit-scrollbar{display:none}
87
+ .grp{margin:13px 0 3px;padding:0 10px;font-size:11.5px;font-weight:600;color:var(--label-3);letter-spacing:.08em;text-transform:uppercase}
88
+ .srow{display:flex;align-items:center;gap:10px;padding:0 10px;min-height:34px;border-radius:var(--r);color:var(--label-2);width:100%;font-size:14px}
89
+ .srow:hover{background:var(--hover);color:var(--label)}
90
+ .srow:hover>svg{stroke:var(--label-2)}
91
+ .srow.on{background:var(--accent-fill);color:var(--on-accent);font-weight:500}
92
+ .srow.on>svg{stroke:var(--on-accent)}
93
+ .srow>svg{width:16px;height:16px;stroke:var(--label-3);fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none;transition:stroke var(--t)}
94
+ .srow .t{flex:none;white-space:nowrap}
95
+ .srow .meta{flex:1 1 0;min-width:0;padding-left:10px;text-align:right;font-family:var(--mono);font-size:11.5px;color:var(--label-3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-variant-numeric:tabular-nums}
96
+ .srow.on .meta{color:var(--on-accent);opacity:.7}
97
+
98
+ .src .foot{margin-top:auto;padding:10px 11px 2px;border-top:1px solid var(--sep);display:flex;align-items:center;gap:7px;color:var(--label-3);font-size:11.5px;font-family:var(--mono);flex:none}
99
+ .src .foot .v{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
100
+
101
+ .pane{display:flex;flex-direction:column;min-width:0;min-height:0;position:relative;overflow:hidden}
102
+ .tb{display:flex;align-items:center;gap:10px;padding:14px 22px 8px;flex:none}
103
+ .tb h1{font-size:22px;font-weight:600;margin:0;letter-spacing:-.01em;line-height:1.2}
104
+ .tb .sub{color:var(--label-2);font-size:13px;display:flex;gap:8px;align-items:center;flex-wrap:wrap}
105
+ .tb .sub .mono{color:var(--label-3)}
106
+ .tb .right{margin-left:auto;display:flex;gap:8px;align-items:center}
107
+ .seg{display:inline-flex;background:var(--muted);border-radius:var(--r);padding:2px}
108
+ .seg button{padding:4px 12px;border-radius:var(--rs);color:var(--label-2);font-weight:500;font-size:13px}
109
+ .seg button:hover{color:var(--label)}
110
+ .seg button.on{background:var(--group);color:var(--label);box-shadow:inset 0 0 0 1px var(--sep-2)}
111
+ .ib{width:30px;height:30px;border-radius:var(--r);display:grid;place-items:center;color:var(--label-2)}
112
+ .ib:hover{background:var(--hover);color:var(--label)}
113
+ .content{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:6px calc(22px + env(safe-area-inset-right,0px)) calc(40px + env(safe-area-inset-bottom,0px)) 22px}
114
+ .content>.view{display:none;flex-direction:column;gap:18px;max-width:880px}
115
+ #v-file{max-width:1060px}
116
+ .content>.view.on{display:flex}
117
+ #specBody{display:flex;flex-direction:column;gap:18px}
118
+
119
+ /* ---------- grouped list ---------- */
120
+ .gl{display:flex;flex-direction:column;gap:6px;min-width:0}
121
+ .gl .gh{display:flex;align-items:center;gap:8px;padding:0 2px;color:var(--label-3);font-size:11.5px;font-weight:600;letter-spacing:.08em;text-transform:uppercase}
122
+ .gl .gh .cnt{color:var(--label-3);font-weight:500;font-variant-numeric:tabular-nums;text-transform:none;letter-spacing:0}
123
+ .gl .gh .more{margin-left:auto;color:var(--green-ink);font-weight:500;font-size:12.5px;text-transform:none;letter-spacing:0}
124
+ .gl .gh .more:hover{text-decoration:underline}
125
+ .gl .gh .disc{width:20px;height:20px;display:grid;place-items:center;color:var(--label-3);transition:transform .18s;transform-origin:center}
126
+ .gl.closed .gh .disc{transform:rotate(-90deg)}
127
+ .gl.closed .box{display:none}
128
+ .box{background:var(--group);border-radius:var(--r);border:1px solid var(--sep-2);overflow:hidden}
129
+ .row{display:flex;align-items:center;gap:12px;padding:0 14px;min-height:48px;border-top:1px solid var(--sep);width:100%;color:var(--label);position:relative;transition:background-color var(--t)}
130
+ .row:first-child{border-top:0}
131
+ .row.act{cursor:pointer}
132
+ .row.act:hover{background:var(--hover)}
133
+ .row.act:active{background:var(--press)}
134
+ .row.sel{background:var(--sel)}
135
+ .row .lead{flex:none;width:18px;height:18px;display:grid;place-items:center}
136
+ button.row{font:inherit;text-align:left}
137
+ body.dragging{user-select:none;-webkit-user-select:none}
138
+ .row .st{width:9px;height:9px;border-radius:50%;flex:none}
139
+ .st.blue{background:var(--accent)}.st.green{background:var(--green)}.st.orange{background:var(--orange)}.st.red{background:var(--red)}.st.violet{background:var(--violet)}.st.gray{background:var(--label-3)}.st.hollow{background:transparent;box-shadow:inset 0 0 0 1.5px var(--label-3)}
140
+ .row .body{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px;padding:8px 0}
141
+ .row .ttl{font-size:14px;font-weight:500;line-height:1.35;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
142
+ .row .ttl .id{font-family:var(--mono);font-size:12.5px;color:var(--label-3);margin-right:8px;font-weight:400}
143
+ .row .det{font-size:13px;color:var(--label-3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
144
+ .row .trail{margin-left:auto;display:flex;align-items:center;gap:8px;flex:none}
145
+ .row .chev{color:var(--label-3);width:14px;height:14px}
146
+ .pill{display:inline-flex;align-items:center;gap:5px;padding:2px 8px;border-radius:var(--rs);font-size:12px;font-weight:600;white-space:nowrap;background:var(--muted)}
147
+ .pill.blue{color:var(--blue-ink)}.pill.green{color:var(--green-ink)}.pill.orange{color:var(--orange-ink)}.pill.red{color:var(--red-ink)}.pill.violet{color:var(--violet-ink)}.pill.gray{color:var(--label-2)}
148
+ .pill i{width:6px;height:6px;border-radius:50%;background:currentColor}
149
+ .pill.green i{background:var(--green)}.pill.orange i{background:var(--orange)}.pill.red i{background:var(--red)}.pill.blue i{background:var(--accent)}
150
+ .btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:6px 12px;border-radius:var(--r);background:var(--muted);color:var(--label);font-weight:500;font-size:13px;border:1px solid transparent;white-space:nowrap;min-height:32px}
151
+ .btn:hover{background:var(--press)}
152
+ .btn.pri{background:var(--accent-fill);color:var(--on-accent)}
153
+ .btn.pri:hover{filter:brightness(1.06)}
154
+ .btn.tint{background:var(--blue-soft);color:var(--blue-ink)}
155
+ .btn.tint:hover{filter:brightness(.97)}
156
+ .btn.line{background:transparent;border-color:var(--sep-2);color:var(--label-2)}
157
+ .btn.line:hover{color:var(--label);background:var(--hover)}
158
+ .btn.quiet{background:transparent;color:var(--label-2)}
159
+ .btn.quiet:hover{background:var(--hover);color:var(--label)}
160
+ .btn.sm{padding:4px 10px;font-size:12.5px;min-height:28px}
161
+ .btn svg{width:13px;height:13px}
162
+ .kv .row .body{flex-direction:row;align-items:center;gap:12px}
163
+ .kv .row .k{color:var(--label);min-width:150px;font-size:14px}
164
+ .kv .row .v{color:var(--label-2);font-size:14px;flex:1;min-width:0}
165
+ .kv .row .v.mono{color:var(--label-3)}
166
+ .note{color:var(--label-3);font-size:13px;line-height:1.5;padding:0 2px}
167
+ .err{color:var(--red-ink);font-size:12px;padding:2px 4px 0}
168
+ input.txt{width:100%}
169
+ .empty{padding:26px 14px;text-align:center;color:var(--label-3);font-size:13.5px}
170
+ .bar{height:6px;border-radius:var(--rs);background:var(--muted);overflow:hidden;min-width:70px}
171
+ .bar i{display:block;height:100%;background:var(--green);border-radius:var(--rs)}
172
+ .bar i.orange{background:var(--orange)}.bar i.blue{background:var(--accent)}
173
+
174
+
175
+ .opt-rb{width:18px;height:18px;border-radius:50%;border:1.5px solid var(--sep-2);display:grid;place-items:center}
176
+ .opt-rb.on{background:var(--accent-fill);border-color:var(--accent-fill)}
177
+ .opt-rb.on::after{content:"";width:6px;height:6px;border-radius:50%;background:var(--on-accent)}
178
+ .md{color:var(--label-2);font-size:14px;line-height:1.6;min-width:0}
179
+ .md.doc{background:var(--group);border:1px solid var(--sep-2);border-radius:var(--r);padding:18px 20px}
180
+ .md>:first-child{margin-top:0}.md>:last-child{margin-bottom:0}
181
+ .md h2{font-size:18px;font-weight:600;color:var(--label);margin:26px 0 8px;letter-spacing:-.01em;line-height:1.3}
182
+ .md h3{font-size:15px;font-weight:600;color:var(--label);margin:20px 0 6px}
183
+ .md h4{font-size:14px;font-weight:600;color:var(--label);margin:16px 0 4px}
184
+ .md h5,.md h6{font-size:13px;font-weight:600;color:var(--label-2);margin:14px 0 4px}
185
+ .md p{margin:8px 0}
186
+ .md ul,.md ol{margin:8px 0;padding-left:20px}
187
+ .md li{margin:4px 0}
188
+ .md li::marker{color:var(--label-3)}
189
+ .md li.cb{list-style:none;margin-left:-20px;padding-left:24px;position:relative}
190
+ .md li.cb::before{content:"";position:absolute;left:0;top:.35em;width:13px;height:13px;border-radius:var(--rs);border:1.5px solid var(--sep-2)}
191
+ .md li.cb.on::before{background:var(--green);border-color:var(--green)}
192
+ .md li.cb.on::after{content:"";position:absolute;left:3px;top:calc(.35em + 3px);width:7px;height:3.5px;border-left:1.5px solid var(--ground);border-bottom:1.5px solid var(--ground);transform:rotate(-45deg)}
193
+ .md code{font-family:var(--mono);font-size:12.5px;background:var(--muted);padding:1px 5px;border-radius:var(--rs);color:var(--green-ink);white-space:nowrap}
194
+ .md pre{font-family:var(--mono);font-size:12.5px;line-height:1.6;background:var(--side);border:1px solid var(--sep-2);border-radius:var(--r);padding:12px 14px;overflow:auto;color:var(--label-2);margin:10px 0;white-space:pre}
195
+ .md blockquote{margin:10px 0;padding:2px 0 2px 14px;border-left:1px solid var(--sep-2);color:var(--label-3)}
196
+ .md blockquote p{margin:4px 0}
197
+ .md hr{border:0;border-top:1px solid var(--sep);margin:20px 0}
198
+ .md strong{color:var(--label);font-weight:600}
199
+ .md .ref{font-family:var(--mono);font-size:12px;color:var(--label-3);white-space:nowrap}
200
+ .md .lk{color:var(--green-ink)}
201
+ .md .tw{overflow-x:auto;margin:10px 0;border:1px solid var(--sep-2);border-radius:var(--r)}
202
+ .md table{border-collapse:collapse;font-size:13px;width:100%;min-width:420px}
203
+ .md td,.md th{padding:7px 10px;border-top:1px solid var(--sep);text-align:left;vertical-align:top;line-height:1.5}
204
+ .md thead th{color:var(--label-3);font-weight:600;font-size:11.5px;letter-spacing:.06em;text-transform:uppercase;border-top:0;background:var(--muted)}
205
+ .md tbody tr:first-child td{border-top:0}
206
+ .desc.md{padding:12px 14px}
207
+ .desc.md code{white-space:normal}
208
+
209
+ /* board mode */
210
+ .board{display:grid;grid-template-columns:repeat(3,minmax(220px,1fr));gap:14px;align-items:start}
211
+ .board .gl{min-width:0}
212
+ .board .row{min-height:0;padding:10px 12px;align-items:flex-start}
213
+ .board .row .ttl{white-space:normal}
214
+ .board .row .det{white-space:normal}
215
+ .board .row{flex-wrap:wrap;row-gap:0}
216
+ .board .row .body{flex:1 1 calc(100% - 60px);padding-bottom:4px}
217
+ .board .row .trail{width:100%;margin-left:21px;padding-bottom:10px;justify-content:flex-start}
218
+ .board .row .chev{margin-left:auto}
219
+ @media (prefers-reduced-motion:reduce){.row.moved{animation:none;background:var(--accent-soft)}}
220
+
221
+ /* ---------- inspector ---------- */
222
+ .insp{position:absolute;top:0;right:0;bottom:0;width:min(400px,100%);background:var(--ground);border-left:1px solid var(--sep);border-left:1px solid var(--sep-2);transform:translateX(102%);visibility:hidden;transition:transform .26s cubic-bezier(.2,.8,.2,1),visibility .26s;display:flex;flex-direction:column;z-index:20}
223
+ .insp.open{visibility:visible}
224
+ .insp.open{transform:none}
225
+ .insp .ih{display:flex;align-items:center;gap:8px;padding:12px 14px;border-bottom:1px solid var(--sep);background:var(--group)}
226
+ .insp .ih .id{font-family:var(--mono);font-size:12px;color:var(--label-3)}
227
+ .insp .ih .x{margin-left:auto}
228
+ .insp .ib2{overflow:auto;overscroll-behavior:contain;padding:14px;display:flex;flex-direction:column;gap:16px}
229
+ .insp h2{font-size:17px;font-weight:600;margin:0;line-height:1.35;text-wrap:balance;padding:0 2px}
230
+ .insp .gl .gh{font-size:12px}
231
+ .insp .row{min-height:40px;padding:0 12px}
232
+ .insp .row .k{min-width:96px;color:var(--label-2)}
233
+ .insp .row .v{color:var(--label)}
234
+ .insp .desc{padding:10px 12px;color:var(--label-2);line-height:1.55;font-size:14px}
235
+ .insp .actions{display:flex;gap:8px;flex-wrap:wrap;padding:2px}
236
+ .report li{display:flex;gap:10px;padding:9px 12px;border-top:1px solid var(--sep);font-size:13px;line-height:1.45}
237
+ .report li:first-child{border-top:0}
238
+ .report .f{font-family:var(--mono);font-size:12px;color:var(--green-ink);flex:none;min-width:150px;padding-top:2px}
239
+ .report .w{color:var(--label-2)}
240
+ .chk{display:flex;align-items:center;gap:10px;padding:0 12px;min-height:40px;border-top:1px solid var(--sep);font-size:14px;color:var(--label)}
241
+ .chk:first-child{border-top:0}
242
+ .chk .m{width:18px;height:18px;border-radius:50%;display:grid;place-items:center;flex:none;font-size:11px;font-weight:700}
243
+ .chk.ok .m{background:var(--green-soft);color:var(--green-ink)}.chk.no .m{background:var(--red-soft);color:var(--red-ink)}
244
+ .chk .m svg{width:11px;height:11px;stroke-width:2.4}
245
+ .skip{background:var(--accent-fill);color:var(--on-accent)}.chk.na .m{background:var(--hover);color:var(--label-3)}
246
+ .chk .ev{margin-left:auto;font-family:var(--mono);font-size:12px;color:var(--label-3)}
247
+ .term{background:var(--side);color:var(--label-2);border:1px solid var(--sep-2);border-radius:var(--r);padding:10px 12px;font-family:var(--mono);font-size:12.5px;line-height:1.6;white-space:pre-wrap;max-height:200px;overflow:auto}
248
+ .term .g{color:var(--green-ink)}.term .r{color:var(--red-ink)}.term .y{color:var(--orange-ink)}.term .b{color:var(--blue-ink)}.term .d{color:var(--label-3)}
249
+
250
+ .veil{position:fixed;inset:0;background:rgba(2,6,23,.6);display:none;align-items:flex-start;justify-content:center;padding:8vh 16px 16px;z-index:40;overflow:auto}
251
+ .veil.open{display:flex}
252
+
253
+
254
+ /* palette */
255
+ .pal{width:min(560px,100%);background:var(--group);border:1px solid var(--sep-2);border-radius:6px;overflow:hidden}
256
+ .pal input{width:100%;padding:13px 16px;background:transparent;border:0;border-bottom:1px solid var(--sep);font-size:16px;outline:none}
257
+ .pal ul{list-style:none;margin:0;padding:6px;max-height:320px;overflow:auto;overscroll-behavior:contain}
258
+ .pal li{padding:8px 10px;border-radius:var(--rs);display:flex;gap:10px;align-items:center;cursor:pointer;color:var(--label);min-width:0}
259
+ .pal li .lbl{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
260
+ .pal li:hover,.pal li.on{background:var(--sel)}
261
+ .pal li .k{font-family:var(--mono);font-size:11.5px;color:var(--label-3);margin-left:auto;flex:none}
262
+
263
+ .toast{position:fixed;bottom:calc(18px + env(safe-area-inset-bottom,0px));left:50%;transform:translate(-50%,16px);background:var(--label);color:var(--ground);padding:9px 14px;border-radius:var(--r);border:1px solid var(--sep-2);opacity:0;transition:opacity .22s,transform .22s;pointer-events:none;z-index:60;font-size:12.5px;font-weight:500}
264
+ .toast.show{opacity:1;transform:translate(-50%,0)}
265
+ .menu{display:none}
266
+
267
+ @media (max-width:900px){
268
+ .win{grid-template-columns:1fr}
269
+ .rail{position:fixed;left:0;top:0;bottom:0;width:60px;transform:translateX(-312px);transition:transform .24s ease-out;z-index:31;border-right:1px solid var(--sep)}
270
+ .src{position:fixed;left:60px;top:0;bottom:0;width:252px;transform:translateX(-312px);transition:transform .24s ease-out;z-index:30;border-right:1px solid var(--sep-2)}
271
+ .win.nav .rail,.win.nav .src{transform:none}
272
+ .win.nav .scrim{display:block;opacity:1}
273
+ .menu{display:grid}
274
+ .board{grid-template-columns:1fr}
275
+ .tb{padding:12px 16px 6px;flex-wrap:wrap}
276
+ .content{padding:6px 16px 40px}
277
+ .kv .row .body{flex-direction:column;align-items:flex-start;gap:2px}
278
+ .kv .row .k{min-width:0}
279
+ .row .ttl{white-space:normal}
280
+ .tb .sub .mono{display:none}
281
+ .content>.view{gap:16px}
282
+ }
283
+
284
+ /* ---------- specpilot serve ---------- */
285
+ /* The CSP (default-src 'self') forbids inline style attributes; these replace the mockup's. */
286
+ .sprite{position:absolute;width:0;height:0}
287
+ .ico-13{width:13px;height:13px}
288
+ .mt18{margin-top:18px}
289
+ .mb18{margin-bottom:18px}
290
+ .doc-gap{margin:6px 0 22px}
291
+ .pal-veil{padding-top:14vh}
292
+ .ml-auto{margin-left:auto}
293
+ /* Task rows show the whole description, clamped by CSS; the inspector shows it unclamped. */
294
+ .row .ttl.clamp{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical}
295
+ .row .ttl .num{font-family:var(--mono);font-size:12.5px;color:var(--label-3);margin-right:8px;font-weight:400}
296
+ .raw{font-family:var(--mono);font-size:12.5px;white-space:pre-wrap;word-break:break-word;color:var(--label-2);padding:10px 14px;margin:0}
297
+ /* Group headers in the content and inspector carry file text (section headings, paths):
298
+ show it as written instead of uppercasing it. Sidebar group labels stay uppercase. */
299
+ .content .gl .gh,.insp .gl .gh{text-transform:none;letter-spacing:.02em}