@arabold/docs-mcp-server 3.2.0 → 3.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.
Files changed (33) hide show
  1. package/README.md +67 -114
  2. package/db/migrations/017-add-library-display-name.sql +76 -0
  3. package/db/migrations/018-store-embeddings-as-blobs.sql +56 -0
  4. package/db/migrations/019-tune-indexes.sql +30 -0
  5. package/dist/{HtmlDefuddleMiddleware-Cm0vQDqD.js → HtmlDefuddleMiddleware-BNIv3ibo.js} +2 -4
  6. package/dist/HtmlDefuddleMiddleware-BNIv3ibo.js.map +1 -0
  7. package/{public/assets/index-BHI6XhAh.css → dist/assets/index-BG8UJbPA.css} +1 -1
  8. package/dist/assets/index-JESalFJu.js +70 -0
  9. package/dist/assets/index-JESalFJu.js.map +1 -0
  10. package/dist/index.html +3 -3
  11. package/dist/index.js +1 -1
  12. package/dist/{main-DEjtJruc.js → main-BoABX2b0.js} +17932 -15335
  13. package/dist/main-BoABX2b0.js.map +1 -0
  14. package/dist/manifest.json +7 -7
  15. package/dist/string-B3iUfzt2.js +44 -0
  16. package/dist/string-B3iUfzt2.js.map +1 -0
  17. package/dist/utils-CjF4IsxT.js +2 -0
  18. package/dist/{utils-uCqhR-rj.js → utils-DXo1A54z.js} +29 -512
  19. package/dist/utils-DXo1A54z.js.map +1 -0
  20. package/package.json +13 -6
  21. package/{dist/assets/index-BHI6XhAh.css → public/assets/index-BG8UJbPA.css} +1 -1
  22. package/public/assets/index-JESalFJu.js +70 -0
  23. package/public/assets/index-JESalFJu.js.map +1 -0
  24. package/public/index.html +3 -3
  25. package/public/manifest.json +7 -7
  26. package/dist/HtmlDefuddleMiddleware-Cm0vQDqD.js.map +0 -1
  27. package/dist/assets/index-RyFcFML1.js +0 -70
  28. package/dist/assets/index-RyFcFML1.js.map +0 -1
  29. package/dist/main-DEjtJruc.js.map +0 -1
  30. package/dist/utils-BP4qIXx8.js +0 -2
  31. package/dist/utils-uCqhR-rj.js.map +0 -1
  32. package/public/assets/index-RyFcFML1.js +0 -70
  33. package/public/assets/index-RyFcFML1.js.map +0 -1
package/README.md CHANGED
@@ -1,172 +1,125 @@
1
- # Grounded Docs: Your AI's Up-to-Date Documentation Expert
1
+ # Grounded Docs MCP Server
2
2
 
3
- **Docs MCP Server** solves the problem of AI hallucinations and outdated knowledge by providing a personal, always-current documentation index for your AI coding assistant. It fetches official docs from websites, GitHub, npm, PyPI, and local files, allowing your AI to query the exact version you are using.
3
+ Grounded Docs gives your AI coding assistant a documentation index that matches the library versions you use. It fetches documentation from websites, GitHub repositories, npm, PyPI and local folders, and serves search over the Model Context Protocol (MCP), a command line and a web UI. Your assistant answers from that documentation instead of from what it remembers.
4
4
 
5
- ![Docs MCP Server Web Interface](docs/docs-mcp-server.png)
5
+ It is an open-source alternative to Context7, Nia and Ref.Tools.
6
6
 
7
- ## ✨ Why Grounded Docs MCP Server?
7
+ ![Docs MCP Server web interface](docs/docs-mcp-server.png)
8
8
 
9
- The open-source alternative to **Context7**, **Nia**, and **Ref.Tools**.
9
+ ## Features
10
10
 
11
- - ✅ **Up-to-Date Context:** Fetches documentation directly from official sources on demand.
12
- - 🎯 **Version-Specific:** Queries target the exact library versions in your project.
13
- - 💡 **Reduces Hallucinations:** Grounds LLMs in real documentation.
14
- - 🔒 **Private & Local:** Runs entirely on your machine; your code never leaves your network.
15
- - 🧩 **Broad Compatibility:** Works with any MCP-compatible client (Claude, Cline, etc.).
16
- - 📁 **Multiple Sources:** Index websites, GitHub repositories, local folders, and zip archives.
17
- - 📄 **Rich File Support:** Processes HTML, Markdown, PDF, Office documents (Word, Excel, PowerPoint), OpenDocument, RTF, EPUB, Jupyter Notebooks, and [90+ source code languages](docs/concepts/supported-formats.md).
11
+ - Indexes websites, GitHub repositories, npm and PyPI packages, local folders and archives (ZIP, TAR).
12
+ - Reads HTML, Markdown, PDF, Office and OpenDocument files, EPUB, Jupyter notebooks, source code and more. See [Supported Formats](docs/concepts/supported-formats.md).
13
+ - Stores each library version separately, so a search targets the version your project uses.
14
+ - Combines full-text search with optional vector search through OpenAI, Ollama, Gemini, Vertex AI, AWS Bedrock, Azure OpenAI or any OpenAI-compatible server.
15
+ - Runs on your machine and keeps its index in a local SQLite database. Document text goes only to the embedding provider you configure; with a local one, such as Ollama, it stays on your machine. Usage telemetry is on by default; [Telemetry](docs/infrastructure/telemetry.md) lists what it sends and how to turn it off.
16
+ - Works with any MCP client, over stdio or Streamable HTTP.
18
17
 
19
- ---
18
+ ## Quick Start
20
19
 
21
- ## 📄 Supported Formats
20
+ You need Node.js 22 or later, or Docker. [Installation](docs/setup/installation.md) covers both in detail, along with Docker Compose and running the server inside your AI client.
22
21
 
23
- | Category | Formats |
24
- |----------|---------|
25
- | **Documents** | PDF, Word (.docx/.doc), Excel (.xlsx/.xls), PowerPoint (.pptx/.ppt), OpenDocument (.odt/.ods/.odp), RTF, EPUB, FictionBook, Jupyter Notebooks |
26
- | **Archives** | ZIP, TAR, gzipped TAR (contents are extracted and processed individually) |
27
- | **Web** | HTML, XHTML |
28
- | **Markup** | Markdown, MDX, reStructuredText, AsciiDoc, Org Mode, Textile, R Markdown |
29
- | **Source Code** | TypeScript, JavaScript, Python, Go, Rust, C/C++, Java, Kotlin, Ruby, PHP, Swift, C#, and [many more](docs/concepts/supported-formats.md#source-code) |
30
- | **Data** | JSON, YAML, TOML, CSV, XML, SQL, GraphQL, Protocol Buffers |
31
- | **Config** | Dockerfile, Makefile, Terraform/HCL, INI, dotenv, Bazel |
32
-
33
- See **[Supported Formats](docs/concepts/supported-formats.md)** for the complete reference including MIME types and processing details.
34
-
35
- ---
36
-
37
- ## 🚀 Quick Start
38
-
39
- ### CLI First
40
-
41
- For agents and scripts, the CLI is usually the simplest way to use Grounded Docs.
42
-
43
- **1. Index documentation** (requires Node.js 22+):
22
+ ### 1. Start the server
44
23
 
45
24
  ```bash
46
- npx @arabold/docs-mcp-server@latest scrape react https://react.dev/reference/react
25
+ npx @arabold/docs-mcp-server@latest
47
26
  ```
48
27
 
49
- For hash-routed SPA docs sites, enable hash preservation explicitly:
28
+ Or with Docker:
50
29
 
51
30
  ```bash
52
- npx @arabold/docs-mcp-server@latest scrape my-spa https://docs.example.com/#/guide --preserve-hashes
31
+ docker run --rm \
32
+ -v docs-mcp-data:/data \
33
+ -v docs-mcp-config:/config \
34
+ -p 6280:6280 \
35
+ ghcr.io/arabold/docs-mcp-server:latest
53
36
  ```
54
37
 
55
- **2. Query the index:**
38
+ ### 2. Turn on vector search (optional)
56
39
 
57
- ```bash
58
- npx @arabold/docs-mcp-server@latest search react "useEffect cleanup" --output yaml
59
- ```
60
-
61
- **3. Fetch a single page as Markdown:**
40
+ Without an embedding model, search uses full-text matching. Vector search also finds passages by meaning. To use OpenAI, start the server with `OPENAI_API_KEY` set:
62
41
 
63
42
  ```bash
64
- npx @arabold/docs-mcp-server@latest fetch-url https://react.dev/reference/react/useEffect
43
+ OPENAI_API_KEY="sk-proj-..." npx @arabold/docs-mcp-server@latest
65
44
  ```
66
45
 
67
- ### Output Behavior
68
-
69
- - Structured commands default to clean JSON on stdout in non-interactive runs.
70
- - Use `--output json|yaml|toon` to pick a structured format.
71
- - Plain-text commands such as `fetch-url` keep their text payload on stdout.
72
- - Diagnostics go through the shared logger and are kept off stdout in non-interactive runs.
73
- - Use `--quiet` to suppress non-error diagnostics or `--verbose` to enable debug output.
46
+ With Docker, add `-e OPENAI_API_KEY="sk-proj-..."`. [Embedding Models](docs/guides/embedding-models.md) covers Ollama, Gemini, Azure OpenAI and other providers.
74
47
 
75
- ### Agent Skills
48
+ Do this before you add documentation. Embeddings are computed when a page is indexed, so documentation indexed without a model gets no vectors until you scrape it again with `--replace`.
76
49
 
77
- The [`skills/`](skills/) directory contains [Agent Skills](https://agentskills.io) that teach AI coding assistants how to use the CLI — covering documentation search, index management, and URL fetching.
50
+ ### 3. Add documentation
78
51
 
79
- ### MCP Server
52
+ Open the web UI at [http://localhost:6280](http://localhost:6280) and choose **Add library**.
80
53
 
81
- If you want a long-running MCP endpoint for Claude, Cline, Copilot, Gemini CLI, or other MCP clients:
54
+ ### 4. Connect your AI client
82
55
 
83
- **1. Start the server:**
84
-
85
- ```bash
86
- npx @arabold/docs-mcp-server@latest
87
- ```
88
-
89
- **2. Open the Web UI** at **[http://localhost:6280](http://localhost:6280)** to add documentation.
90
-
91
- **3. Connect your AI client** by adding this to your MCP settings (e.g., `claude_desktop_config.json`):
56
+ Add the server's MCP endpoint, `http://localhost:6280/mcp`, to your client. Most clients accept an entry like this:
92
57
 
93
58
  ```json
94
59
  {
95
60
  "mcpServers": {
96
61
  "docs-mcp-server": {
97
- "type": "sse",
98
- "url": "http://localhost:6280/sse"
62
+ "url": "http://localhost:6280/mcp"
99
63
  }
100
64
  }
101
65
  }
102
66
  ```
103
67
 
104
- See **[Connecting Clients](docs/guides/mcp-clients.md)** for VS Code (Cline, Roo) and other setup options.
68
+ [Connecting MCP Clients](docs/guides/mcp-clients.md) has the exact settings for Claude Code, Claude Desktop, Zed and other clients, how a client can start the server itself over stdio, and the list of MCP tools.
105
69
 
106
- `scrape_docs` also accepts `preserveHashes: true` for documentation sites that use hash-based client-side routing.
107
- Use it only for hash-routed SPAs; normal sites typically use hash fragments for in-page anchors.
70
+ ## Command Line
108
71
 
109
- <details>
110
- <summary>Alternative: Run with Docker</summary>
72
+ The CLI indexes and searches without a running server, which suits scripts and coding agents. It shares its database with a server on the same machine.
111
73
 
112
74
  ```bash
113
- docker run --rm \
114
- -v docs-mcp-data:/data \
115
- -v docs-mcp-config:/config \
116
- -p 6280:6280 \
117
- ghcr.io/arabold/docs-mcp-server:latest \
118
- --protocol http --host 0.0.0.0 --port 6280
119
- ```
75
+ # Index documentation
76
+ npx @arabold/docs-mcp-server@latest scrape react https://react.dev/reference/react
120
77
 
121
- </details>
78
+ # Search it
79
+ npx @arabold/docs-mcp-server@latest search react "useEffect cleanup" --output yaml
122
80
 
123
- ### 🧠 Configure Embedding Model (Recommended)
81
+ # Fetch one page as Markdown without indexing it
82
+ npx @arabold/docs-mcp-server@latest fetch-url https://react.dev/reference/react/useEffect
83
+ ```
124
84
 
125
- Using an embedding model is **optional** but dramatically improves search quality by enabling semantic vector search.
85
+ `scrape` refuses a library version that already exists. Pass `--replace` to rebuild it, or run `refresh` to update it in place. The [`skills/`](skills/) directory has Agent Skills that teach coding agents these commands. [Basic Usage](docs/guides/basic-usage.md) covers every command, output formats and local files.
126
86
 
127
- **Example: Enable OpenAI Embeddings**
87
+ ## Web Scraping
128
88
 
129
- ```bash
130
- OPENAI_API_KEY="sk-proj-..." npx @arabold/docs-mcp-server@latest
131
- ```
89
+ - Before it crawls a website, a scrape or refresh looks for an `llms.txt` file in the start URL's directory and at the site root. The links listed there become extra starting points, and for those pages the scraper first tries the Markdown version of the URL, such as `/guide/index.html.md` or `/page.html.md`.
90
+ - Requests ask for Markdown first (`Accept: text/markdown, text/html;q=0.9, */*;q=0.8`), so a server that supports content negotiation can return Markdown instead of HTML. A custom `Accept` header replaces this one.
91
+ - For documentation sites that route with hash URLs, such as `https://docs.example.com/#/guide`, turn on hash routes for the scrape. See [Hash Route Behavior](docs/setup/configuration.md#hash-route-behavior).
92
+
93
+ ## Documentation
132
94
 
133
- See **[Embedding Models](docs/guides/embedding-models.md)** for configuring **Ollama**, **Gemini**, **Azure**, and others.
95
+ Setup:
134
96
 
135
- ---
97
+ - [Installation](docs/setup/installation.md): npx, Docker, Docker Compose and the embedded server.
98
+ - [Configuration](docs/setup/configuration.md): config file, environment variables and every setting.
99
+ - [Embedding Models](docs/guides/embedding-models.md): providers, models and changing the model.
136
100
 
137
- ## 📚 Documentation
101
+ Usage:
138
102
 
139
- ### Getting Started
140
- - **[Installation](docs/setup/installation.md)**: Detailed setup guides for Docker, Node.js (npx), and Embedded mode.
141
- - **[Connecting Clients](docs/guides/mcp-clients.md)**: How to connect Claude, VS Code (Cline/Roo), and other MCP clients.
142
- - **[Basic Usage](docs/guides/basic-usage.md)**: Using the Web UI, CLI, and scraping local files.
143
- - **[Configuration](docs/setup/configuration.md)**: Full reference for config files and environment variables.
144
- - **[Supported Formats](docs/concepts/supported-formats.md)**: Complete file format and MIME type reference.
145
- - **[Embedding Models](docs/guides/embedding-models.md)**: Configure OpenAI, Ollama, Gemini, and other providers.
146
- - **[Search Quality Benchmark](docs/guides/benchmarking.md)**: Measure retrieval quality with IR metrics + LLM-judged scores; prerequisites, how to run, how to interpret results.
103
+ - [Basic Usage](docs/guides/basic-usage.md): the web UI, the CLI and local files.
104
+ - [Connecting MCP Clients](docs/guides/mcp-clients.md): client settings and MCP tools.
105
+ - [Supported Formats](docs/concepts/supported-formats.md): file formats and how each is processed.
106
+ - [Search Quality Benchmark](docs/guides/benchmarking.md): measure retrieval quality.
147
107
 
148
- ### Hash-Routed SPAs
149
- - Use `--preserve-hashes`, MCP `preserveHashes`, or the Web UI "Preserve Hash Routes" checkbox only for docs sites that route with URLs like `#/guide`.
150
- - When enabled with `scrapeMode=fetch`, the scraper automatically upgrades the job to Playwright because plain fetch cannot evaluate client-side hash routes.
151
- - Refresh reuses the stored `preserveHashes` setting by default, and CLI/Web refresh entrypoints can override it explicitly.
108
+ Deployment:
152
109
 
153
- ### Markdown-Optimized Web Scraping
154
- - Web scrapes and refreshes automatically probe for `llms.txt` at the documentation subpath and site root before normal crawling. When found, the curated links become additional crawl seeds, and pages discovered this way prefer `.md` URL variants such as `/guide/index.html.md` or `/page.html.md` before falling back to the original page.
155
- - Web requests send `Accept: text/markdown, text/html;q=0.9, */*;q=0.8` by default. Servers that support Markdown content negotiation, including Cloudflare Markdown for Agents, can return Markdown directly so the scraper bypasses HTML-to-Markdown conversion for cleaner output.
156
- - This behavior is automatic and requires no configuration. Custom `Accept` headers are preserved when provided.
110
+ - [Deployment Modes](docs/infrastructure/deployment-modes.md): one process, or a worker with separate MCP and web services.
111
+ - [Reverse Proxy Deployment](docs/infrastructure/reverse-proxy.md): serve the server under a path such as `https://example.com/docs`.
112
+ - [Authentication](docs/infrastructure/authentication.md): protect the MCP endpoint with OAuth2/OIDC.
113
+ - [Security](docs/infrastructure/security.md): trust boundaries and limits on what the scraper may reach.
114
+ - [Telemetry](docs/infrastructure/telemetry.md): the usage events the server sends, and how to turn them off.
157
115
 
158
- ### Key Concepts & Architecture
159
- - **[Deployment Modes](docs/infrastructure/deployment-modes.md)**: Standalone vs. Distributed (Docker Compose).
160
- - **[Authentication](docs/infrastructure/authentication.md)**: Securing your server with OAuth2/OIDC.
161
- - **[Security](docs/infrastructure/security.md)**: Trust boundaries, deployment hardening, and outbound access controls.
162
- - **[Telemetry](docs/infrastructure/telemetry.md)**: Privacy-first usage data collection.
163
- - **[Architecture](ARCHITECTURE.md)**: Deep dive into the system design.
116
+ Internals:
164
117
 
165
- ---
118
+ - [Architecture](ARCHITECTURE.md): system design for contributors.
166
119
 
167
- ## 🤝 Contributing
120
+ ## Contributing
168
121
 
169
- We welcome contributions! Please see **[CONTRIBUTING.md](CONTRIBUTING.md)** for development guidelines and setup instructions.
122
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines.
170
123
 
171
124
  ## License
172
125
 
@@ -0,0 +1,76 @@
1
+ -- Migration: add a required, case-preserving display name to libraries
2
+ -- `name` stays the lookup key (trimmed, lowercased). `display_name` is filled here for every row and is
3
+ -- NOT NULL, so no reader ever falls back to `name`. SQLite cannot ADD COLUMN ... NOT NULL without a
4
+ -- default, so the table is rebuilt. Foreign keys are enabled on this connection, and `versions`
5
+ -- references `libraries(id)`, so the parent rows are re-inserted after the DROP under deferred
6
+ -- foreign-key checks; renaming a pre-filled copy into place would fail at commit.
7
+
8
+ -- @migration-step rebuild libraries
9
+ -- Library records without versions are never listed and hold no documentation, but their name would
10
+ -- still block creating that library. Nothing references them.
11
+ DELETE FROM libraries WHERE id NOT IN (SELECT library_id FROM versions);
12
+
13
+ -- The characters JavaScript's String.prototype.trim() removes, which the lookup key trims: tab, LF, VT,
14
+ -- FF, CR, space, NBSP, U+1680, U+2000-U+200A, U+2028, U+2029, U+202F, U+205F, U+3000 and the BOM.
15
+ DROP TABLE IF EXISTS _libraries_017_whitespace;
16
+ CREATE TEMP TABLE _libraries_017_whitespace AS SELECT char(
17
+ 9, 10, 11, 12, 13, 32, 160, 5760, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202,
18
+ 8232, 8233, 8239, 8287, 12288, 65279
19
+ ) AS chars;
20
+
21
+ -- Older releases stored names untrimmed, so a padded key such as ' react ' is unreachable by the trimmed
22
+ -- lookup key. Re-key it unless another row already has the trimmed key. When several padded rows trim to
23
+ -- the same free key, only the oldest (lowest id) takes it and the others are left as they are. Per key,
24
+ -- only that oldest row changes, and neither condition depends on it, so the result does not depend on the
25
+ -- order in which rows are updated.
26
+ UPDATE libraries
27
+ SET name = trim(name, (SELECT chars FROM _libraries_017_whitespace))
28
+ WHERE name <> trim(name, (SELECT chars FROM _libraries_017_whitespace))
29
+ AND NOT EXISTS (
30
+ SELECT 1 FROM libraries AS other
31
+ WHERE other.name = trim(libraries.name, (SELECT chars FROM _libraries_017_whitespace))
32
+ )
33
+ AND id = (
34
+ SELECT MIN(other.id) FROM libraries AS other
35
+ WHERE trim(other.name, (SELECT chars FROM _libraries_017_whitespace))
36
+ = trim(libraries.name, (SELECT chars FROM _libraries_017_whitespace))
37
+ );
38
+
39
+ PRAGMA defer_foreign_keys = ON;
40
+
41
+ DROP TABLE IF EXISTS _libraries_017_rows;
42
+ DROP TABLE IF EXISTS _libraries_017_sequence;
43
+ CREATE TEMP TABLE _libraries_017_rows AS SELECT id, name, created_at FROM libraries;
44
+ CREATE TEMP TABLE _libraries_017_sequence AS
45
+ SELECT seq FROM sqlite_sequence WHERE name = 'libraries';
46
+
47
+ DROP TABLE libraries;
48
+
49
+ CREATE TABLE libraries (
50
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
51
+ name TEXT NOT NULL UNIQUE,
52
+ display_name TEXT NOT NULL,
53
+ created_at DATETIME DEFAULT CURRENT_TIMESTAMP
54
+ );
55
+
56
+ -- Re-keyed names are already trimmed. A padded name that collided keeps its name as its display name, so
57
+ -- it stays a separate entry in listings rather than sharing a display name with the library it collides
58
+ -- with.
59
+ INSERT INTO libraries (id, name, display_name, created_at)
60
+ SELECT id, name, name, created_at FROM _libraries_017_rows;
61
+
62
+ -- Dropping the table reset its AUTOINCREMENT counter to MAX(id); restore it so the ids of deleted
63
+ -- libraries are never reused.
64
+ DELETE FROM sqlite_sequence WHERE name = 'libraries';
65
+ INSERT INTO sqlite_sequence (name, seq) SELECT 'libraries', seq FROM _libraries_017_sequence;
66
+
67
+ -- @migration-step recreate index
68
+ CREATE UNIQUE INDEX idx_libraries_lower_name ON libraries(LOWER(name));
69
+
70
+ DROP TABLE _libraries_017_rows;
71
+ DROP TABLE _libraries_017_sequence;
72
+ DROP TABLE _libraries_017_whitespace;
73
+
74
+ -- The runner applies every pending migration in one transaction; later migrations must check foreign
75
+ -- keys immediately again.
76
+ PRAGMA defer_foreign_keys = OFF;
@@ -0,0 +1,56 @@
1
+ -- Stores document embeddings as float32 blobs instead of JSON text.
2
+ --
3
+ -- JSON text took 3-5x the space of the binary vector (about 20-32 KB per chunk
4
+ -- at 1536 dimensions versus 6 KB), on top of the binary copy in documents_vec.
5
+ -- sqlite-vec accepts both forms, so the vector triggers pass the blob through.
6
+ --
7
+ -- The full-text update trigger is narrowed first: it fired on every column,
8
+ -- so converting embeddings would have rewritten the whole full-text index.
9
+
10
+ -- @migration-step scope full-text update trigger
11
+ -- Only content, metadata (path) and page_id (title, url) feed documents_fts.
12
+ DROP TRIGGER IF EXISTS documents_fts_after_update;
13
+
14
+ CREATE TRIGGER documents_fts_after_update
15
+ AFTER UPDATE OF content, metadata, page_id ON documents
16
+ BEGIN
17
+ DELETE FROM documents_fts WHERE rowid = old.id;
18
+ INSERT INTO documents_fts(rowid, content, title, url, path)
19
+ SELECT new.id, new.content, p.title, p.url, json_extract(new.metadata, '$.path')
20
+ FROM pages p WHERE p.id = new.page_id;
21
+ END;
22
+
23
+ -- @migration-step convert embeddings to float32 blobs
24
+ -- The vector triggers are dropped so the conversion does not rewrite
25
+ -- documents_vec, which already holds the same vectors in binary form.
26
+ -- Every stored value already went through sqlite-vec's parser when it was
27
+ -- written (the triggers below, and the backfill in 011), so vec_f32 accepts it.
28
+ DROP TRIGGER IF EXISTS documents_vec_after_insert;
29
+ DROP TRIGGER IF EXISTS documents_vec_after_update;
30
+
31
+ UPDATE documents
32
+ SET embedding = vec_f32(embedding)
33
+ WHERE typeof(embedding) = 'text';
34
+
35
+ -- @migration-step recreate vector triggers
36
+ CREATE TRIGGER documents_vec_after_insert
37
+ AFTER INSERT ON documents
38
+ WHEN NEW.embedding IS NOT NULL
39
+ BEGIN
40
+ INSERT OR REPLACE INTO documents_vec (rowid, library_id, version_id, embedding)
41
+ SELECT NEW.id, v.library_id, v.id, NEW.embedding
42
+ FROM pages p
43
+ JOIN versions v ON p.version_id = v.id
44
+ WHERE p.id = NEW.page_id;
45
+ END;
46
+
47
+ CREATE TRIGGER documents_vec_after_update
48
+ AFTER UPDATE OF embedding, page_id ON documents
49
+ BEGIN
50
+ DELETE FROM documents_vec WHERE rowid = OLD.id;
51
+ INSERT OR REPLACE INTO documents_vec (rowid, library_id, version_id, embedding)
52
+ SELECT NEW.id, v.library_id, v.id, NEW.embedding
53
+ FROM pages p
54
+ JOIN versions v ON p.version_id = v.id
55
+ WHERE p.id = NEW.page_id AND NEW.embedding IS NOT NULL;
56
+ END;
@@ -0,0 +1,30 @@
1
+ -- Adds the index the dashboard's activity chart needs and drops indexes that
2
+ -- only cost space and write time.
3
+ --
4
+ -- The chart counts pages created in a trailing window, and the chunks of those
5
+ -- pages through idx_documents_sort_order. Without an index on created_at, each
6
+ -- request read every row of pages and documents, which on a large store blocks
7
+ -- the worker for minutes.
8
+ --
9
+ -- Every index dropped here is either the leading column of a wider index on
10
+ -- the same table, which SQLite uses in its place, or one no query filters or
11
+ -- sorts on. Each insert into documents, the largest and most written table,
12
+ -- updates one index fewer.
13
+
14
+ -- @migration-step index pages.created_at
15
+ CREATE INDEX IF NOT EXISTS idx_pages_created_at ON pages(created_at);
16
+
17
+ -- @migration-step drop indexes a wider index covers
18
+ -- idx_documents_sort_order is (page_id, sort_order).
19
+ DROP INDEX IF EXISTS idx_documents_page_id;
20
+ -- UNIQUE(version_id, url) on pages.
21
+ DROP INDEX IF EXISTS idx_pages_version_id;
22
+ -- UNIQUE(library_id, name) on versions.
23
+ DROP INDEX IF EXISTS idx_versions_library_id;
24
+
25
+ -- @migration-step drop indexes no query uses
26
+ DROP INDEX IF EXISTS idx_pages_url;
27
+ DROP INDEX IF EXISTS idx_pages_etag;
28
+ DROP INDEX IF EXISTS idx_versions_library_status;
29
+ DROP INDEX IF EXISTS idx_versions_started_at;
30
+ DROP INDEX IF EXISTS idx_versions_scraper_options_scope;
@@ -1,4 +1,5 @@
1
1
  import { r as logger } from "./logger-BBxstTD7.js";
2
+ import { t as escapeHtml } from "./string-B3iUfzt2.js";
2
3
  import * as cheerio from "cheerio";
3
4
  import { Defuddle } from "defuddle/node";
4
5
  import { parseHTML } from "linkedom";
@@ -139,10 +140,7 @@ function detectLanguageFromClass(className) {
139
140
  if (lang === "text" || lang === "highlighted" || lang === "wrap") return "";
140
141
  return lang;
141
142
  }
142
- function escapeHtml(value) {
143
- return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
144
- }
145
143
  //#endregion
146
144
  export { HtmlDefuddleMiddleware };
147
145
 
148
- //# sourceMappingURL=HtmlDefuddleMiddleware-Cm0vQDqD.js.map
146
+ //# sourceMappingURL=HtmlDefuddleMiddleware-BNIv3ibo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HtmlDefuddleMiddleware-BNIv3ibo.js","names":[],"sources":["../src/scraper/middleware/HtmlDefuddleMiddleware.ts"],"sourcesContent":["import * as cheerio from \"cheerio\";\nimport { Defuddle } from \"defuddle/node\";\nimport { parseHTML } from \"linkedom\";\nimport { logger } from \"../../utils/logger\";\nimport { escapeHtml } from \"../../utils/string\";\nimport type { ContentProcessorMiddleware, MiddlewareContext } from \"./types\";\n\n/**\n * Options for HtmlDefuddleMiddleware.\n */\nexport interface HtmlDefuddleOptions {\n /**\n * If Defuddle's extracted content drops below this fraction of the original\n * *visible* text length (script/style/noscript excluded), fall back to the\n * pre-extraction DOM. Set very low by default — Defuddle is intentionally\n * aggressive, and the more useful safety net is the empty-output check\n * below. The ratio is here mainly to catch catastrophic mis-extraction\n * (Defuddle latches onto a tiny element on a content-rich page).\n */\n minTextRetentionRatio?: number;\n}\n\nconst DEFAULT_MIN_RETENTION = 0.01;\n\n/**\n * Middleware that runs Defuddle as a drop-in replacement for\n * {@link HtmlSanitizerMiddleware}. It extracts the main article content,\n * removing navigation, footers, ads, and other boilerplate using Defuddle's\n * heuristics rather than a hand-maintained selector list.\n *\n * Pipeline contract:\n * - Reads HTML from `context.dom` (populated by HtmlCheerioParserMiddleware).\n * - Runs Defuddle via linkedom and replaces `context.dom` with a fresh Cheerio\n * DOM containing only the cleaned content (wrapped in `<html><body>…`).\n * - Honours `context.options.excludeSelectors` by stripping them from the\n * *source* DOM before Defuddle runs. Defuddle's standardise step unwraps\n * class/id hooks, so post-extraction selector matching is unreliable;\n * filtering on the source DOM matches the Cheerio sanitiser's behaviour\n * and the user's mental model.\n * - Updates `context.title` if Defuddle found a non-empty title and the\n * previous extractor left it empty.\n * - Falls back to the original DOM if Defuddle returns empty output or removes\n * substantially all text (see {@link minTextRetentionRatio}).\n */\nexport class HtmlDefuddleMiddleware implements ContentProcessorMiddleware {\n private readonly minTextRetentionRatio: number;\n\n constructor(options: HtmlDefuddleOptions = {}) {\n this.minTextRetentionRatio = options.minTextRetentionRatio ?? DEFAULT_MIN_RETENTION;\n }\n\n async process(context: MiddlewareContext, next: () => Promise<void>): Promise<void> {\n const $ = context.dom;\n if (!$) {\n logger.warn(\n `⏭️ Skipping ${this.constructor.name}: context.dom is missing. Ensure HtmlCheerioParserMiddleware runs before this.`,\n );\n await next();\n return;\n }\n\n try {\n const originalHtml = $.html();\n // Measure *visible* text, excluding script/style content. SPA pages\n // (Next.js, Nuxt, etc.) embed huge hydration payloads inside <script>\n // tags whose textContent inflates the body text length by orders of\n // magnitude, which would otherwise trip the retention-ratio fallback.\n const $bodyClone = cheerio.load(`<body>${$(\"body\").html() ?? \"\"}</body>`);\n $bodyClone(\"script, style, noscript, template\").remove();\n const textLengthBefore = $bodyClone(\"body\").text().trim().length;\n\n const { document } = parseHTML(originalHtml);\n\n // Apply user-supplied excludeSelectors *before* Defuddle. Defuddle\n // standardises markup (e.g. unwrapping divs into <p>), which strips the\n // class/id hooks the user supplied — so post-extraction removal often\n // misses. Filtering on the source DOM matches the user's mental model\n // (same as the Cheerio sanitiser path).\n this.applyExcludePreDefuddle(document, context);\n\n // Defuddle's `standardize` step unwraps the language-bearing ancestor\n // divs that highlighters like Pygments/Sphinx and GitHub use (e.g.\n // `<div class=\"highlight-python3\"><pre>...</pre></div>`). Push the\n // detected language onto the inner `<code>` as `class=\"language-X\"` so\n // Defuddle preserves it and our Turndown rule can recover the fenced\n // code-block language.\n this.propagateLanguageHints(document);\n\n const result = await Defuddle(document, context.source, {\n // We do markdown conversion downstream (HtmlToMarkdownMiddleware), so\n // ask Defuddle for cleaned HTML, not markdown.\n markdown: false,\n });\n\n const cleanedContent = typeof result?.content === \"string\" ? result.content : \"\";\n\n // Build the cleaned Cheerio DOM *first*, then measure retention on the\n // post-sanitisation text. Doing the regex-strip-then-measure dance in\n // the other order let `<script>` *contents* (e.g. Next.js `__next_f`\n // hydration payloads) inflate the \"kept\" character count so the ratio\n // check passed, after which removing the script tags emptied the page.\n //\n // Note on H1 handling: Defuddle's standardize step deliberately drops\n // the first H1/H2 when it matches the extracted title (and converts\n // remaining H1s to H2s). The dropped headline text is preserved on\n // `context.title`, which the indexer attaches to every chunk as\n // metadata — so it's still searchable, just not duplicated inside the\n // chunk body. Defuddle exposes no granular flag to opt out of this\n // single behaviour (only the coarse `standardize: false` which would\n // also disable code-block / footnote standardisation).\n const wrappedHtml = `<!doctype html><html><head><title>${escapeHtml(result.title || context.title || \"\")}</title></head><body>${cleanedContent}</body></html>`;\n const cleaned$ = cheerio.load(wrappedHtml);\n\n // Strip dangerous / non-content tags. Defuddle can leak these (Next.js\n // hydration payloads being the worst offender) and they're never useful\n // in indexed markdown.\n cleaned$(\"script, style, noscript, iframe, svg, link, meta\").remove();\n\n // Measure retention on the post-strip text so the ratio reflects what\n // actually survives into the chunked output.\n const cleanedText = cleaned$(\"body\").text().trim();\n const ratio = textLengthBefore > 0 ? cleanedText.length / textLengthBefore : 0;\n\n if (!cleanedText || ratio < this.minTextRetentionRatio) {\n logger.warn(\n `⚠️ Defuddle retained ${cleanedText.length}/${textLengthBefore} chars (${(ratio * 100).toFixed(1)}%) for ${context.source}; falling back to original DOM with minimal sanitisation.`,\n );\n // Strip script/style/iframe defensively even on fallback — without\n // these the markdown converter renders hydration payloads (e.g.\n // Next.js __next_f) as multi-hundred-KB blobs.\n $(\"script, style, noscript, iframe, svg, link, meta\").remove();\n await next();\n return;\n }\n\n context.dom = cleaned$;\n if (!context.title && result.title) {\n context.title = result.title;\n }\n\n logger.debug(\n `Defuddle reduced body text from ${textLengthBefore} to ${cleanedText.length} chars (${(ratio * 100).toFixed(1)}%) for ${context.source}`,\n );\n } catch (error) {\n logger.error(`❌ Defuddle extraction failed for ${context.source}: ${error}`);\n context.errors.push(\n error instanceof Error\n ? error\n : new Error(`Defuddle extraction failed: ${String(error)}`),\n );\n }\n\n await next();\n }\n\n /**\n * Normalise each `<pre>` so Defuddle preserves its language hint.\n *\n * Defuddle's standardise step strips `class=\"language-X\"` unless `X` is one\n * of its allow-listed canonical language names (so `language-python3`,\n * `language-py`, etc. get dropped). It also unwraps highlighter ancestors\n * like `<div class=\"highlight-python3\">`, losing that context entirely.\n *\n * However, Defuddle preserves `data-language` (and `data-lang`) verbatim and\n * promotes them to `class=\"language-X\"` on the inner `<code>`. So this\n * pre-pass collects the language hint from `<pre>`, `<code>`, or nearby\n * ancestor classes and writes it back as `data-language` on `<pre>`. Our\n * Turndown rule in HtmlToMarkdownMiddleware then reads it off and emits a\n * fenced code block with the correct language.\n */\n private propagateLanguageHints(document: Document): void {\n const pres = document.querySelectorAll(\"pre\");\n for (const pre of Array.from(pres)) {\n const existingCode = pre.querySelector(\"code\");\n\n // Already set explicitly — leave alone.\n if (pre.getAttribute(\"data-language\")) continue;\n\n let lang =\n detectLanguageFromClass(pre.getAttribute(\"class\")) ||\n detectLanguageFromClass(existingCode?.getAttribute(\"class\") ?? null);\n\n if (!lang) {\n let ancestor: Element | null = pre.parentElement;\n let depth = 0;\n while (ancestor && depth < 5) {\n const found = detectLanguageFromClass(ancestor.getAttribute(\"class\"));\n if (found) {\n lang = found;\n break;\n }\n ancestor = ancestor.parentElement;\n depth++;\n }\n }\n\n if (!lang) continue;\n\n pre.setAttribute(\"data-language\", lang);\n\n // Unwrap any highlighter wrapper divs around this <pre>. Defuddle's\n // standardise step rewrites the `<pre>` (stripping its attributes,\n // including our data-language) when it sees this wrapped structure.\n // Replacing the wrapper with the bare <pre> sidesteps that path.\n let wrapper: Element | null = pre.parentElement;\n let depth = 0;\n while (wrapper && depth < 5) {\n const cls = wrapper.getAttribute(\"class\") ?? \"\";\n const isHighlightWrapper =\n /(?:^|\\s)(?:highlight|highlight-source-[A-Za-z0-9_+-]+|highlight-[A-Za-z0-9_+-]+)(?:\\s|$)/.test(\n cls,\n );\n if (\n isHighlightWrapper &&\n wrapper.children.length === 1 &&\n wrapper.parentElement\n ) {\n wrapper.parentElement.replaceChild(pre, wrapper);\n wrapper = pre.parentElement;\n } else {\n break;\n }\n depth++;\n }\n }\n }\n\n private applyExcludePreDefuddle(document: Document, context: MiddlewareContext): void {\n const selectors = context.options.excludeSelectors ?? [];\n if (selectors.length === 0) return;\n\n for (const selector of selectors) {\n try {\n const matches = document.querySelectorAll(selector);\n for (const node of Array.from(matches)) {\n const tag = node.tagName?.toLowerCase();\n if (tag === \"html\" || tag === \"body\") continue;\n node.remove();\n }\n } catch (selectorError) {\n logger.warn(\n `⚠️ Invalid excludeSelector \"${selector}\" before Defuddle: ${selectorError}`,\n );\n context.errors.push(\n new Error(`Invalid selector \"${selector}\": ${selectorError}`),\n );\n }\n }\n }\n}\n\nconst LANGUAGE_CLASS_RE =\n /(?:^|\\s)(?:highlight-source-|highlight-|language-)([A-Za-z0-9_+-]+)/;\n\nfunction detectLanguageFromClass(className: string | null | undefined): string {\n if (!className) return \"\";\n const match = LANGUAGE_CLASS_RE.exec(className);\n if (!match) return \"\";\n const lang = match[1].toLowerCase();\n // Skip generic non-language tokens that show up under `highlight-` prefix.\n if (lang === \"text\" || lang === \"highlighted\" || lang === \"wrap\") return \"\";\n return lang;\n}\n"],"mappings":";;;;;;AAsBA,IAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;AAsB9B,IAAa,yBAAb,MAA0E;CACxE;CAEA,YAAY,UAA+B,CAAC,GAAG;EAC7C,KAAK,wBAAwB,QAAQ,yBAAyB;CAChE;CAEA,MAAM,QAAQ,SAA4B,MAA0C;EAClF,MAAM,IAAI,QAAQ;EAClB,IAAI,CAAC,GAAG;GACN,OAAO,KACL,eAAe,KAAK,YAAY,KAAK,+EACvC;GACA,MAAM,KAAK;GACX;EACF;EAEA,IAAI;GACF,MAAM,eAAe,EAAE,KAAK;GAK5B,MAAM,aAAa,QAAQ,KAAK,SAAS,EAAE,MAAM,CAAC,CAAC,KAAK,KAAK,GAAG,QAAQ;GACxE,WAAW,mCAAmC,CAAC,CAAC,OAAO;GACvD,MAAM,mBAAmB,WAAW,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC;GAE1D,MAAM,EAAE,aAAa,UAAU,YAAY;GAO3C,KAAK,wBAAwB,UAAU,OAAO;GAQ9C,KAAK,uBAAuB,QAAQ;GAEpC,MAAM,SAAS,MAAM,SAAS,UAAU,QAAQ,QAAQ,EAGtD,UAAU,MACZ,CAAC;GAED,MAAM,iBAAiB,OAAO,QAAQ,YAAY,WAAW,OAAO,UAAU;GAgB9E,MAAM,cAAc,qCAAqC,WAAW,OAAO,SAAS,QAAQ,SAAS,EAAE,EAAE,uBAAuB,eAAe;GAC/I,MAAM,WAAW,QAAQ,KAAK,WAAW;GAKzC,SAAS,kDAAkD,CAAC,CAAC,OAAO;GAIpE,MAAM,cAAc,SAAS,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK;GACjD,MAAM,QAAQ,mBAAmB,IAAI,YAAY,SAAS,mBAAmB;GAE7E,IAAI,CAAC,eAAe,QAAQ,KAAK,uBAAuB;IACtD,OAAO,KACL,yBAAyB,YAAY,OAAO,GAAG,iBAAiB,WAAW,QAAQ,IAAA,CAAK,QAAQ,CAAC,EAAE,SAAS,QAAQ,OAAO,0DAC7H;IAIA,EAAE,kDAAkD,CAAC,CAAC,OAAO;IAC7D,MAAM,KAAK;IACX;GACF;GAEA,QAAQ,MAAM;GACd,IAAI,CAAC,QAAQ,SAAS,OAAO,OAC3B,QAAQ,QAAQ,OAAO;GAGzB,OAAO,MACL,mCAAmC,iBAAiB,MAAM,YAAY,OAAO,WAAW,QAAQ,IAAA,CAAK,QAAQ,CAAC,EAAE,SAAS,QAAQ,QACnI;EACF,SAAS,OAAO;GACd,OAAO,MAAM,oCAAoC,QAAQ,OAAO,IAAI,OAAO;GAC3E,QAAQ,OAAO,KACb,iBAAiB,QACb,wBACA,IAAI,MAAM,+BAA+B,OAAO,KAAK,GAAG,CAC9D;EACF;EAEA,MAAM,KAAK;CACb;;;;;;;;;;;;;;;;CAiBA,uBAA+B,UAA0B;EACvD,MAAM,OAAO,SAAS,iBAAiB,KAAK;EAC5C,KAAK,MAAM,OAAO,MAAM,KAAK,IAAI,GAAG;GAClC,MAAM,eAAe,IAAI,cAAc,MAAM;GAG7C,IAAI,IAAI,aAAa,eAAe,GAAG;GAEvC,IAAI,OACF,wBAAwB,IAAI,aAAa,OAAO,CAAC,KACjD,wBAAwB,cAAc,aAAa,OAAO,KAAK,IAAI;GAErE,IAAI,CAAC,MAAM;IACT,IAAI,WAA2B,IAAI;IACnC,IAAI,QAAQ;IACZ,OAAO,YAAY,QAAQ,GAAG;KAC5B,MAAM,QAAQ,wBAAwB,SAAS,aAAa,OAAO,CAAC;KACpE,IAAI,OAAO;MACT,OAAO;MACP;KACF;KACA,WAAW,SAAS;KACpB;IACF;GACF;GAEA,IAAI,CAAC,MAAM;GAEX,IAAI,aAAa,iBAAiB,IAAI;GAMtC,IAAI,UAA0B,IAAI;GAClC,IAAI,QAAQ;GACZ,OAAO,WAAW,QAAQ,GAAG;IAC3B,MAAM,MAAM,QAAQ,aAAa,OAAO,KAAK;IAK7C,IAHE,2FAA2F,KACzF,GAGF,KACA,QAAQ,SAAS,WAAW,KAC5B,QAAQ,eACR;KACA,QAAQ,cAAc,aAAa,KAAK,OAAO;KAC/C,UAAU,IAAI;IAChB,OACE;IAEF;GACF;EACF;CACF;CAEA,wBAAgC,UAAoB,SAAkC;EACpF,MAAM,YAAY,QAAQ,QAAQ,oBAAoB,CAAC;EACvD,IAAI,UAAU,WAAW,GAAG;EAE5B,KAAK,MAAM,YAAY,WACrB,IAAI;GACF,MAAM,UAAU,SAAS,iBAAiB,QAAQ;GAClD,KAAK,MAAM,QAAQ,MAAM,KAAK,OAAO,GAAG;IACtC,MAAM,MAAM,KAAK,SAAS,YAAY;IACtC,IAAI,QAAQ,UAAU,QAAQ,QAAQ;IACtC,KAAK,OAAO;GACd;EACF,SAAS,eAAe;GACtB,OAAO,KACL,gCAAgC,SAAS,qBAAqB,eAChE;GACA,QAAQ,OAAO,qBACb,IAAI,MAAM,qBAAqB,SAAS,KAAK,eAAe,CAC9D;EACF;CAEJ;AACF;AAEA,IAAM,oBACJ;AAEF,SAAS,wBAAwB,WAA8C;CAC7E,IAAI,CAAC,WAAW,OAAO;CACvB,MAAM,QAAQ,kBAAkB,KAAK,SAAS;CAC9C,IAAI,CAAC,OAAO,OAAO;CACnB,MAAM,OAAO,MAAM,EAAE,CAAC,YAAY;CAElC,IAAI,SAAS,UAAU,SAAS,iBAAiB,SAAS,QAAQ,OAAO;CACzE,OAAO;AACT"}
@@ -1 +1 @@
1
- :root{--mono:ui-monospace, "JetBrains Mono", "SF Mono", "SFMono-Regular", Menlo, Consolas, monospace;--sans:"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;--canvas:#f4f6f8;--surface:#fff;--surface-2:#f8fafb;--surface-3:#eef1f4;--border:#e3e7ec;--border-strong:#c8d0d9;--text:#171b21;--text-muted:#5b636e;--text-faint:#97a0ab;--primary:#1976c2;--primary-hover:#145d99;--primary-ink:#fff;--primary-soft:#e8f2fb;--accent:#f59e0b;--ok:#16a34a;--ok-soft:#ecfdf3;--run:#1976c2;--run-soft:#e8f2fb;--queued:#c2760a;--queued-soft:#fdf4e5;--err:#dc2626;--err-soft:#fef2f2;--idle:#5b636e;--idle-soft:#eef1f4;--shadow-sm:0 1px 2px #0f172a0a, 0 1px 3px #0f172a0f;--shadow-md:0 4px 12px #0f172a0f, 0 2px 4px #0f172a0a;--shadow-lg:0 24px 48px -12px #0f172a2e;--r-card:12px;--r-ctl:8px;--sidebar-w:244px;--topbar-h:60px}@media (prefers-color-scheme:dark){:root{--canvas:#12151b;--surface:#171b21;--surface-2:#1c212a;--surface-3:#242b35;--border:#2a313c;--border-strong:#3a4350;--text:#e0e0e0;--text-muted:#a3a3a3;--text-faint:#6f7681;--primary:#4a9eea;--primary-hover:#6fb2ef;--primary-ink:#0a0e14;--primary-soft:#4a9eea24;--accent:#fa0;--ok:#4ade80;--ok-soft:#4ade8021;--run:#4a9eea;--run-soft:#4a9eea24;--queued:#fbbf24;--queued-soft:#fbbf2421;--err:#f87171;--err-soft:#f8717121;--idle:#a3a3a3;--idle-soft:#a3a3a31f;--shadow-sm:0 1px 2px #0000004d;--shadow-md:0 4px 14px #0006;--shadow-lg:0 24px 48px -12px #0009}}:root[data-theme=light]{--canvas:#f4f6f8;--surface:#fff;--surface-2:#f8fafb;--surface-3:#eef1f4;--border:#e3e7ec;--border-strong:#c8d0d9;--text:#171b21;--text-muted:#5b636e;--text-faint:#97a0ab;--primary:#1976c2;--primary-hover:#145d99;--primary-ink:#fff;--primary-soft:#e8f2fb;--accent:#f59e0b;--ok:#16a34a;--ok-soft:#ecfdf3;--run:#1976c2;--run-soft:#e8f2fb;--queued:#c2760a;--queued-soft:#fdf4e5;--err:#dc2626;--err-soft:#fef2f2;--idle:#5b636e;--idle-soft:#eef1f4;--shadow-sm:0 1px 2px #0f172a0a, 0 1px 3px #0f172a0f;--shadow-md:0 4px 12px #0f172a0f, 0 2px 4px #0f172a0a;--shadow-lg:0 24px 48px -12px #0f172a2e}:root[data-theme=dark]{--canvas:#12151b;--surface:#171b21;--surface-2:#1c212a;--surface-3:#242b35;--border:#2a313c;--border-strong:#3a4350;--text:#e0e0e0;--text-muted:#a3a3a3;--text-faint:#6f7681;--primary:#4a9eea;--primary-hover:#6fb2ef;--primary-ink:#0a0e14;--primary-soft:#4a9eea24;--accent:#fa0;--ok:#4ade80;--ok-soft:#4ade8021;--run:#4a9eea;--run-soft:#4a9eea24;--queued:#fbbf24;--queued-soft:#fbbf2421;--err:#f87171;--err-soft:#f8717121;--idle:#a3a3a3;--idle-soft:#a3a3a31f;--shadow-sm:0 1px 2px #0000004d;--shadow-md:0 4px 14px #0006;--shadow-lg:0 24px 48px -12px #0009}*{box-sizing:border-box}html,body{height:100%}body{font-family:var(--sans);background:var(--canvas);color:var(--text);-webkit-font-smoothing:antialiased;margin:0;font-size:14px;line-height:1.5}#root{height:100%}.icon{stroke:currentColor;stroke-width:1.6px;fill:none;stroke-linecap:round;stroke-linejoin:round;flex:none;width:20px;height:20px}.icon-sm{width:16px;height:16px}.icon-xs{width:14px;height:14px}@keyframes pulse{0%,to{opacity:1;box-shadow:0 0 0 0 color-mix(in srgb, var(--run) 45%, transparent)}50%{opacity:.75;box-shadow:0 0 0 4px #0000}}@keyframes fade{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}@keyframes spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}.app{grid-template-columns:var(--sidebar-w) 1fr;min-height:100%;display:grid}.sidebar{background:var(--surface);border-right:1px solid var(--border);flex-direction:column;gap:4px;height:100vh;padding:16px 12px;display:flex;position:sticky;top:0}.brand{align-items:center;gap:10px;padding:6px 8px 14px;display:flex}.brand__mark{background:linear-gradient(145deg, var(--primary), var(--primary-hover));color:#fff;width:30px;height:30px;box-shadow:var(--shadow-sm);border-radius:8px;flex:none;place-items:center;display:grid}.brand__mark svg{stroke:#fff;stroke-width:2px;width:17px;height:17px}.brand__name{font-family:var(--mono);letter-spacing:-.02em;font-size:13px;font-weight:600;line-height:1.15}.brand__name b{color:var(--primary);font-weight:700}.brand__name .dot{color:var(--accent)}.brand__sub{font-family:var(--mono);color:var(--text-faint);letter-spacing:.04em;margin-top:1px;font-size:10px;display:block}.nav-label{font-family:var(--mono);letter-spacing:.12em;text-transform:uppercase;color:var(--text-faint);padding:14px 10px 6px;font-size:10px}.nav-item{text-align:left;border-radius:var(--r-ctl);width:100%;color:var(--text-muted);cursor:pointer;font-size:13.5px;font-weight:500;font-family:var(--sans);background:0 0;border:none;align-items:center;gap:11px;padding:8px 10px;text-decoration:none;transition:background .12s,color .12s;display:flex;position:relative}.nav-item:hover{background:var(--surface-3);color:var(--text)}.nav-item.is-active{background:var(--primary-soft);color:var(--primary);font-weight:600}.nav-item.is-active:before{content:"";background:var(--primary);border-radius:0 3px 3px 0;width:3px;position:absolute;top:8px;bottom:8px;left:-12px}.nav-item .count{box-sizing:border-box;min-width:20px;height:18px;font-family:var(--mono);font-variant-numeric:tabular-nums;background:var(--surface-3);color:var(--text-muted);border-radius:999px;justify-content:center;align-items:center;margin-left:auto;padding:0 6px;font-size:11px;font-weight:600;line-height:1;display:inline-flex}.nav-item.is-active .count{background:var(--primary);color:var(--primary-ink)}.nav-item .count.count--live{background:var(--run-soft);color:var(--run)}.sidebar__spacer{flex:1}.side-card{border:1px solid var(--border);border-radius:var(--r-ctl);background:var(--surface-2);flex-direction:column;gap:8px;padding:10px 11px;font-size:12px;display:flex}.side-row{color:var(--text-muted);align-items:center;gap:8px;display:flex}.side-row .k{color:var(--text-faint)}.side-row .v{font-family:var(--mono);color:var(--text);text-align:right;margin-left:auto;font-size:11.5px}.update-pill{border-radius:var(--r-ctl);background:var(--queued-soft);color:var(--queued);border:1px solid color-mix(in srgb, var(--queued) 30%, transparent);cursor:pointer;align-items:center;gap:8px;margin-top:4px;padding:8px 10px;font-size:12px;font-weight:600;text-decoration:none;display:flex}.dot-sq{background:var(--idle);border-radius:2.5px;flex:none;width:8px;height:8px}.dot-sq.ok{background:var(--ok)}.dot-sq.run{background:var(--run)}.dot-sq.err{background:var(--err)}.dot-sq.queued{background:var(--queued)}.live .dot-sq.run,.dot-sq.run.pulse{animation:1.8s ease-in-out infinite pulse}.main{flex-direction:column;min-width:0;display:flex}.topbar{z-index:30;height:var(--topbar-h);background:color-mix(in srgb, var(--canvas) 82%, transparent);backdrop-filter:blur(10px);border-bottom:1px solid var(--border);flex:none;align-items:center;gap:14px;padding:0 24px;display:flex;position:sticky;top:0}.topbar__title{letter-spacing:-.01em;white-space:nowrap;font-size:15px;font-weight:600}.topbar__crumb{color:var(--text-faint);font-family:var(--mono);font-size:12px}.topbar>.btn{margin-left:auto}.icon-btn{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-ctl);width:36px;height:36px;color:var(--text-muted);cursor:pointer;box-shadow:var(--shadow-sm);flex:none;place-items:center;transition:color .12s,border-color .12s;display:grid}.icon-btn:hover{color:var(--text);border-color:var(--border-strong)}.btn{border-radius:var(--r-ctl);cursor:pointer;font-size:13px;font-weight:600;font-family:var(--sans);white-space:nowrap;border:1px solid #0000;align-items:center;gap:7px;padding:8px 13px;transition:background .12s,border-color .12s,color .12s;display:inline-flex}.btn:disabled{opacity:.5;cursor:default}.btn--primary{background:var(--primary);color:var(--primary-ink);box-shadow:var(--shadow-sm)}.btn--primary:hover:not(:disabled){background:var(--primary-hover)}.btn--ghost{background:var(--surface);color:var(--text);border-color:var(--border);box-shadow:var(--shadow-sm)}.btn--ghost:hover:not(:disabled){border-color:var(--border-strong)}.btn--danger{color:#fff;box-shadow:var(--shadow-sm);background:#dc2626}.btn--danger:hover:not(:disabled){background:#b91c1c}.btn--sm{padding:5px 10px;font-size:12px}.content{width:100%;max-width:1360px;padding:24px}.view{animation:.22s ease-out fade}.eyebrow{font-family:var(--mono);letter-spacing:.12em;text-transform:uppercase;color:var(--text-faint);font-size:10.5px}.section-head{justify-content:space-between;align-items:flex-end;gap:16px;margin:26px 0 12px;display:flex}.section-head h2{letter-spacing:-.01em;margin:2px 0 0;font-size:15px;font-weight:650}.section-head p{color:var(--text-muted);margin:0;font-size:12.5px}.link{color:var(--primary);cursor:pointer;font-size:12.5px;font-weight:600;font-family:var(--sans);background:0 0;border:none;align-items:center;gap:4px;padding:0;text-decoration:none;display:inline-flex}.link:hover{text-decoration:underline}.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-card);box-shadow:var(--shadow-sm)}.kpis{grid-template-columns:repeat(4,1fr);gap:14px;display:grid}.kpi{flex-direction:column;gap:3px;padding:15px 16px 13px;display:flex;position:relative;overflow:hidden}.kpi__label{color:var(--text-muted);align-items:center;gap:7px;font-size:12px;font-weight:500;display:flex}.kpi__label .icon{width:15px;height:15px;color:var(--text-faint)}.kpi__val{font-family:var(--mono);letter-spacing:-.02em;font-variant-numeric:tabular-nums;margin-top:2px;font-size:27px;font-weight:600;line-height:1.15}.kpi__val small{color:var(--text-muted);font-size:14px;font-weight:500}.kpi__foot{color:var(--text-muted);align-items:center;gap:6px;margin-top:3px;font-size:11.5px;display:flex}.delta{font-family:var(--mono);align-items:center;gap:2px;font-size:11.5px;font-weight:600;display:inline-flex}.delta.up{color:var(--ok)}.delta.down{color:var(--err)}.delta.flat{color:var(--text-faint)}.spark{width:76px;height:26px;color:var(--primary);opacity:.9;position:absolute;top:14px;right:12px}.spark.accent{color:var(--accent)}.grid-2{grid-template-columns:1.9fr 1fr;align-items:stretch;gap:14px;display:grid}.panel{padding:16px 18px}.panel__head{justify-content:space-between;align-items:center;margin-bottom:4px;display:flex}.panel__head h3{margin:0;font-size:13.5px;font-weight:650}.chart-wrap{position:relative}.chart{width:100%;height:auto;display:block}.chart-legend{color:var(--text-muted);gap:16px;margin-top:8px;font-size:11.5px;display:flex}.chart-legend b{color:var(--text);font-family:var(--mono)}.seg{background:var(--surface-3);border:0;border-radius:7px;gap:2px;min-inline-size:0;margin:0;padding:2px;display:inline-flex}.seg button{font-family:var(--mono);color:var(--text-muted);cursor:pointer;background:0 0;border:none;border-radius:5px;padding:3px 9px;font-size:11px;font-weight:600}.seg button.is-active{background:var(--surface);color:var(--text);box-shadow:var(--shadow-sm)}.health{flex-direction:column;gap:0;display:flex}.health__row{border-bottom:1px solid var(--border);align-items:center;gap:10px;padding:11px 0;display:flex}.health__row:last-child{border-bottom:none}.health__row .name{font-size:13px;font-weight:500}.health__row .meta{font-family:var(--mono);color:var(--text-muted);text-align:right;margin-left:auto;font-size:11.5px}.pill{font-family:var(--mono);letter-spacing:.01em;background:var(--idle-soft);color:var(--idle);border:1px solid color-mix(in srgb, var(--idle) 22%, transparent);text-transform:capitalize;border-radius:999px;align-items:center;gap:6px;padding:3px 9px 3px 8px;font-size:11px;font-weight:600;display:inline-flex}.pill .dot-sq{background:currentColor;border-radius:2px;width:6px;height:6px}.pill--ok{background:var(--ok-soft);color:var(--ok);border-color:color-mix(in srgb, var(--ok) 26%, transparent)}.pill--run{background:var(--run-soft);color:var(--run);border-color:color-mix(in srgb, var(--run) 26%, transparent)}.pill--queued{background:var(--queued-soft);color:var(--queued);border-color:color-mix(in srgb, var(--queued) 30%, transparent)}.pill--err{background:var(--err-soft);color:var(--err);border-color:color-mix(in srgb, var(--err) 26%, transparent)}.chip{font-family:var(--mono);color:var(--text-muted);background:var(--surface-3);border:1px solid var(--border);border-radius:6px;padding:1px 7px;font-size:11.5px;display:inline-block}.table-wrap{overflow-x:auto}table.tbl{border-collapse:collapse;width:100%;font-size:13px}.tbl thead th{text-align:left;font-family:var(--mono);letter-spacing:.08em;text-transform:uppercase;color:var(--text-faint);border-bottom:1px solid var(--border);white-space:nowrap;background:var(--surface);padding:10px 14px;font-size:10.5px;font-weight:600}.tbl thead th.num,.tbl td.num{text-align:right;font-variant-numeric:tabular-nums;font-family:var(--mono)}.tbl tbody td{border-bottom:1px solid var(--border);vertical-align:middle;padding:12px 14px}.tbl tbody tr:last-child td{border-bottom:none}.tbl tbody tr{transition:background .1s}.tbl tbody tr:hover{background:var(--surface-2)}.lib-cell{color:inherit;cursor:pointer;align-items:center;gap:11px;text-decoration:none;display:flex}.lib-ico{width:30px;height:30px;font-family:var(--mono);color:var(--primary);background:var(--primary-soft);border:1px solid color-mix(in srgb, var(--primary) 18%, transparent);border-radius:7px;flex:none;place-items:center;font-size:13px;font-weight:700;display:grid;position:relative;overflow:hidden}.lib-ico--fav{background:var(--surface-2);border-color:var(--border)}.lib-ico img{border-radius:4px;width:19px;height:19px;display:block}.lib-name{font-size:13.5px;font-weight:600}.lib-url{font-family:var(--mono);color:var(--text-faint);text-overflow:ellipsis;white-space:nowrap;max-width:260px;font-size:11px;overflow:hidden}.ver-list{flex-wrap:wrap;gap:4px;display:flex}.row-actions{justify-content:flex-end;gap:4px;display:flex}.act{width:28px;height:28px;color:var(--text-faint);cursor:pointer;background:0 0;border:1px solid #0000;border-radius:6px;place-items:center;display:grid}.act:hover{background:var(--surface-3);color:var(--text)}.act.danger:hover{color:var(--err);background:var(--err-soft)}.bar{background:var(--surface-3);border-radius:999px;width:100%;height:6px;overflow:hidden}.bar__fill{background:var(--run);border-radius:999px;height:100%;transition:width .2s ease-out}.bar__fill.ok{background:var(--ok)}.bar__fill.queued{background:var(--queued)}.bar__fill.err{background:var(--err)}.job{border-bottom:1px solid var(--border);grid-template-columns:1fr auto;gap:4px 16px;padding:15px 18px;display:grid}.job:last-child{border-bottom:none}.job__top{align-items:center;gap:10px;display:flex}.job__title{font-size:13.5px;font-weight:600}.job__id{font-family:var(--mono);color:var(--text-faint);font-size:11px}.job__meta{color:var(--text-muted);grid-column:1/-1;align-items:center;gap:14px;margin-top:8px;font-size:12px;display:flex}.job__meta .m{font-family:var(--mono);align-items:center;gap:5px;font-size:11.5px;display:inline-flex}.job__prog{grid-column:1/-1;align-items:center;gap:12px;margin-top:9px;display:flex}.job__prog .pct{font-family:var(--mono);color:var(--text-muted);text-align:right;font-variant-numeric:tabular-nums;min-width:34px;font-size:11.5px}.job__actions{align-self:start;gap:6px;display:flex}.qstats{grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:4px;display:grid}.qstat{padding:13px 15px}.qstat .l{color:var(--text-muted);align-items:center;gap:7px;font-size:12px;display:flex}.qstat .l .icon{width:15px;height:15px;color:var(--text-faint)}.qstat .n{font-family:var(--mono);font-variant-numeric:tabular-nums;letter-spacing:-.02em;margin-top:5px;font-size:23px;font-weight:600}.qstat .n.run{color:var(--run)}.qstat .n.err{color:var(--err)}.qstat .n.ok{color:var(--ok)}.qstat .sub{color:var(--text-faint);margin-top:2px;font-size:11px}.jobc{border-bottom:1px solid var(--border);padding:15px 18px}.jobc:last-child{border-bottom:none}.jobc__head{flex-wrap:wrap;align-items:center;gap:10px;display:flex}.jobc__head .lib-ico{border-radius:6px;width:26px;height:26px;font-size:11px}.jobc__head .lib-ico img{width:16px;height:16px}.jobc__title{font-size:13.5px;font-weight:650}.jobc__right{align-items:center;gap:8px;margin-left:auto;display:flex}.jobc__elapsed{font-family:var(--mono);color:var(--text-muted);white-space:nowrap;align-items:center;gap:5px;font-size:11.5px;display:inline-flex}.jobc__url{color:var(--text-muted);align-items:center;gap:6px;min-width:0;margin-top:10px;font-size:12px;display:flex}.jobc__url .u{font-family:var(--mono);color:var(--text);text-overflow:ellipsis;white-space:nowrap;font-size:11.5px;overflow:hidden}.jobc__prog{align-items:center;gap:12px;margin-top:10px;display:flex}.jobc__prog .pct{font-family:var(--mono);color:var(--text-muted);text-align:right;font-variant-numeric:tabular-nums;min-width:36px;font-size:11.5px}.jobc__stats{font-family:var(--mono);color:var(--text-faint);flex-wrap:wrap;gap:5px 14px;margin-top:10px;font-size:11px;display:flex}.jobc__stats b{color:var(--text-muted);font-weight:600}.jobc__error{border-radius:var(--r-ctl);background:var(--err-soft);border:1px solid color-mix(in srgb, var(--err) 26%, transparent);color:var(--text);margin-top:11px;padding:10px 12px;font-size:12px;line-height:1.55}.jobc__error .t{font-family:var(--mono);color:var(--err);font-weight:700}.jobc__error .m{font-family:var(--mono);color:var(--text-muted);margin-top:5px;font-size:11px;display:block}.qpos{font-family:var(--mono);color:var(--text-muted);background:var(--surface-3);border:1px solid var(--border);border-radius:5px;padding:1px 7px;font-size:11px;font-weight:700}.search-lg{align-items:center;gap:10px;display:flex}.field{flex:1;position:relative}.field .icon{color:var(--text-faint);pointer-events:none;position:absolute;top:50%;left:12px;transform:translateY(-50%)}.input{width:100%;font-family:var(--sans);color:var(--text);background:var(--surface);border:1px solid var(--border);border-radius:var(--r-ctl);outline:none;padding:11px 13px;font-size:14px;transition:border-color .12s,box-shadow .12s}.input.has-icon{padding-left:40px}.input:focus{border-color:var(--primary);box-shadow:0 0 0 3px var(--primary-soft)}.input:disabled{opacity:.6;cursor:not-allowed}select.input{appearance:none;cursor:pointer}.result{border-bottom:1px solid var(--border);padding:15px 18px}.result:last-child{border-bottom:none}.result__head{flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:6px;display:flex}.result__title{color:var(--primary);font-size:13.5px;font-weight:600}.result__url{font-family:var(--mono);color:var(--text-faint);font-size:11px}.result__score{font-family:var(--mono);color:var(--text-muted);margin-left:auto;font-size:11px}.result__snippet{color:var(--text-muted);font-size:12.5px;line-height:1.6}.result__snippet mark{background:color-mix(in srgb, var(--accent) 26%, transparent);color:var(--text);border-radius:3px;padding:0 2px}.set-grid{grid-template-columns:220px 1fr;gap:6px 28px;padding:4px 2px;display:grid}.set-grid .k{border-bottom:1px solid var(--border);padding:13px 0}.set-grid .k b{font-size:13px;display:block}.set-grid .k span{color:var(--text-muted);font-size:12px}.set-grid .v{border-bottom:1px solid var(--border);flex-wrap:wrap;align-items:center;gap:9px;padding:13px 0;display:flex}.set-grid>div:nth-last-child(-n+2){border-bottom:none}.toggle{background:var(--primary);cursor:pointer;border:none;border-radius:999px;flex:none;width:38px;height:22px;padding:0;position:relative}.toggle.off{background:var(--surface-3);border:1px solid var(--border)}.toggle:after{content:"";width:16px;height:16px;box-shadow:var(--shadow-sm);background:#fff;border-radius:50%;position:absolute;top:3px;right:3px}.toggle.off:after{left:3px;right:auto}.mono{font-family:var(--mono)}.muted{color:var(--text-muted)}.text-faint{color:var(--text-faint)}.results-meta{border-bottom:1px solid var(--border);color:var(--text-muted);flex-wrap:wrap;align-items:center;gap:10px;padding:11px 18px;font-size:12px;display:flex}.results-meta b{color:var(--text);font-family:var(--mono);font-variant-numeric:tabular-nums}.doc-result{border-bottom:1px solid var(--border);padding:16px 18px}.doc-result:last-child{border-bottom:none}.doc-head{align-items:center;gap:8px;min-width:0;margin-bottom:12px;display:flex}.doc-head a{color:var(--primary);font-family:var(--mono);text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:11.5px;text-decoration:none;overflow:hidden}.doc-head a:hover{text-decoration:underline}.doc-badge{font-family:var(--mono);color:var(--text-muted);background:var(--surface-3);border:1px solid var(--border);border-radius:5px;flex:none;margin-left:auto;padding:1px 6px;font-size:10px}.doc-score{font-family:var(--mono);color:var(--ok);background:var(--ok-soft);border:1px solid color-mix(in srgb, var(--ok) 26%, transparent);border-radius:5px;flex:none;padding:1px 6px;font-size:10px}.md{color:var(--text);font-size:13px;line-height:1.65}.md>*+*{margin-top:11px}.md h2{letter-spacing:-.01em;margin:4px 0 0;font-size:14.5px;font-weight:650}.md h3{margin:4px 0 0;font-size:13px;font-weight:650}.md p{margin:0}.md ul{margin:0;padding-left:20px}.md li{margin:3px 0}.md li::marker{color:var(--text-faint)}.md a{color:var(--primary);text-decoration:none}.md code{font-family:var(--mono);background:var(--surface-3);border-radius:5px;padding:1px 5px;font-size:12px}.md pre{background:var(--surface-2);border:1px solid var(--border);border-radius:8px;margin:0;padding:13px 15px;overflow-x:auto}.md pre code{color:var(--text);white-space:pre;background:0 0;padding:0;font-size:12px;line-height:1.6;display:block}.md img{border-radius:6px;max-width:100%;height:auto;max-height:60vh;display:block}.clip{max-height:300px;position:relative;overflow:hidden}.clip.is-open{max-height:none}.clip:after{content:"";background:linear-gradient(to bottom, transparent, var(--surface));pointer-events:none;height:76px;position:absolute;inset:auto 0 0}.clip.is-open:after{display:none}.show-more{margin-top:10px}details.adv{border:1px solid var(--border);border-radius:var(--r-ctl);background:var(--surface-2)}details.adv>summary{cursor:pointer;color:var(--text);align-items:center;gap:8px;padding:11px 13px;font-size:12.5px;font-weight:600;list-style:none;display:flex}details.adv>summary::-webkit-details-marker{display:none}details.adv>summary .chev{color:var(--text-faint);margin-right:-2px;transition:transform .18s}details.adv[open]>summary .chev{transform:rotate(90deg)}details.adv>summary .tag{font-family:var(--mono);color:var(--text-faint);margin-left:auto;font-size:10.5px;font-weight:500}.adv__body{border-top:1px solid var(--border);flex-direction:column;gap:15px;padding:6px 13px 15px;display:flex}textarea.input{resize:vertical;min-height:54px;line-height:1.5}.check{align-items:flex-start;gap:9px;display:flex}.check input{width:16px;height:16px;accent-color:var(--primary);flex:none;margin-top:2px}.check .lbl{font-size:13px;font-weight:500}.check .hint{color:var(--text-faint);margin-top:1px;font-size:11.5px;font-weight:400;display:block}.hdr-row{grid-template-columns:1fr 1fr auto;align-items:center;gap:8px;margin-bottom:8px;display:grid}.hdr-row .x{border:1px solid var(--border);background:var(--surface);width:32px;height:32px;color:var(--text-faint);cursor:pointer;border-radius:6px;place-items:center;display:grid}.hdr-row .x:hover{color:var(--err);border-color:color-mix(in srgb, var(--err) 40%, transparent)}.linkbtn{color:var(--primary);cursor:pointer;font-size:12.5px;font-weight:600;font-family:var(--sans);background:0 0;border:none;align-self:flex-start;align-items:center;gap:5px;padding:2px 0 0;display:inline-flex}.note{border-radius:var(--r-ctl);background:var(--run-soft);color:var(--run);border:1px solid color-mix(in srgb, var(--run) 24%, transparent);gap:8px;padding:9px 11px;font-size:11.5px;line-height:1.45;display:flex}.note .icon{flex:none;margin-top:1px}.note--warn{background:var(--queued-soft);color:var(--queued);border-color:color-mix(in srgb, var(--queued) 32%, transparent)}.back{cursor:pointer;background:0 0;border:none;align-items:center;gap:5px;margin:0 0 14px;padding:0;display:inline-flex}.detail-head{align-items:center;gap:16px;display:flex}.lib-ico.big{border-radius:11px;width:46px;height:46px;font-size:17px}.lib-ico.big img{border-radius:6px;width:27px;height:27px}.detail-head h2{letter-spacing:-.02em;margin:0;font-size:19px}.detail-head .lib-url{margin-top:2px;display:block}.detail-head .chips{flex-wrap:wrap;gap:7px;margin-top:9px;display:flex}.detail-actions{align-self:flex-start;gap:8px;margin-left:auto;display:flex}.ver-tabs{flex-wrap:wrap;gap:6px;margin:18px 0 14px;display:flex}.ver-tab{border:1px solid var(--border);background:var(--surface);color:var(--text-muted);font-family:var(--mono);cursor:pointer;box-shadow:var(--shadow-sm);border-radius:8px;align-items:center;gap:7px;padding:7px 13px;font-size:12.5px;font-weight:600;display:inline-flex}.ver-tab.is-active{border-color:var(--primary);color:var(--primary);background:var(--primary-soft)}.detail-grid{grid-template-columns:322px minmax(0,1fr);align-items:start;gap:14px;display:grid}.set-grid.tight{grid-template-columns:92px 1fr;gap:0 14px}.set-grid.tight .k{border-bottom:1px solid var(--border);padding:8px 0}.set-grid.tight .v{border-bottom:1px solid var(--border);font-family:var(--mono);padding:8px 0;font-size:12px}.set-grid.tight .k b{font-size:12px;font-weight:600}.set-grid.tight>div:nth-last-child(-n+2){border-bottom:none}.cfg-actions{flex-direction:column;gap:8px;margin-top:15px;display:flex}.cfg-actions .btn{justify-content:center;width:100%}.explorer-head{border-bottom:1px solid var(--border);justify-content:space-between;align-items:center;gap:12px;padding:14px 16px;display:flex}.explorer-head h3{margin:0;font-size:13.5px;font-weight:650}.explorer-search{border-bottom:1px solid var(--border);padding:12px 16px}.explorer-stats{border-bottom:1px solid var(--border);font-family:var(--mono);color:var(--text-muted);background:var(--surface-2);flex-wrap:wrap;gap:6px 16px;padding:9px 16px;font-size:11px;display:flex}.detail-col{flex-direction:column;gap:14px;min-width:0;display:flex}.scrape-error{border-radius:var(--r-ctl);background:var(--err-soft);border:1px solid color-mix(in srgb, var(--err) 26%, transparent);color:var(--text);word-break:break-word;padding:10px 12px;font-size:12px;line-height:1.55}.scrape-error .t{font-family:var(--mono);color:var(--err);font-weight:700}.comp-list{margin-top:8px}.comp-bar-row{align-items:center;gap:10px;margin:5px 0;display:flex}.comp-name{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-family:var(--mono);color:var(--text-muted);flex:0 0 42%;font-size:11.5px;overflow:hidden}.comp-bar-track{background:var(--surface-2);border-radius:4px;flex:auto;height:8px;overflow:hidden}.comp-bar-fill{background:var(--primary);border-radius:4px;height:100%;display:block}.comp-bar-count{text-align:right;min-width:2.5em;font-family:var(--mono);color:var(--text);flex:none;font-size:11.5px}details.chunk{border-bottom:1px solid var(--border)}details.chunk:last-child{border-bottom:none}details.chunk>summary{cursor:pointer;align-items:flex-start;gap:12px;padding:12px 16px;list-style:none;display:flex}details.chunk>summary::-webkit-details-marker{display:none}details.chunk[open]>summary{background:var(--surface-2)}.chunk__ix{font-family:var(--mono);color:var(--primary);background:var(--primary-soft);border-radius:5px;flex:none;padding:2px 7px;font-size:11px;font-weight:700}.chunk__main{flex:1;min-width:0}.chunk__path{font-family:var(--mono);color:var(--text-muted);text-overflow:ellipsis;white-space:nowrap;font-size:11.5px;overflow:hidden}.chunk__prev{color:var(--text-muted);text-overflow:ellipsis;white-space:nowrap;margin-top:3px;font-size:12.5px;overflow:hidden}.chunk__tok{font-family:var(--mono);color:var(--text-faint);flex:none;font-size:11px}.chunk__body{padding:6px 16px 16px 44px}.chunk__meta{flex-wrap:wrap;gap:6px;display:flex}.meta-chip{font-family:var(--mono);color:var(--text-muted);background:var(--surface-3);border:1px solid var(--border);border-radius:5px;padding:1px 7px;font-size:10.5px}.meta-chip.ok{color:var(--ok);background:var(--ok-soft);border-color:color-mix(in srgb, var(--ok) 26%, transparent)}.scrim{backdrop-filter:blur(2px);opacity:0;pointer-events:none;z-index:60;background:#02061780;transition:opacity .2s;position:fixed;inset:0}.scrim.open{opacity:1;pointer-events:auto}.drawer{background:var(--surface);border-left:1px solid var(--border);width:min(460px,94vw);height:100%;box-shadow:var(--shadow-lg);z-index:61;flex-direction:column;transition:transform .24s cubic-bezier(.22,.61,.36,1);display:flex;position:fixed;top:0;right:0;transform:translate(100%)}.drawer.open{transform:none}.drawer__head{border-bottom:1px solid var(--border);align-items:center;gap:10px;padding:18px 20px;display:flex}.drawer__head h3{margin:0;font-size:15px;font-weight:650}.drawer__body{flex-direction:column;gap:16px;padding:18px 20px;display:flex;overflow-y:auto}.drawer__foot{border-top:1px solid var(--border);justify-content:flex-end;gap:10px;margin-top:auto;padding:14px 20px;display:flex}.form-row{flex-direction:column;gap:6px;display:flex}.form-row>label,.form-row>.form-label{font-size:12.5px;font-weight:600}.form-row .hint{color:var(--text-faint);font-size:11.5px}.form-2{grid-template-columns:1fr 1fr;gap:12px;display:grid}.seg-full{background:var(--surface-3);border-radius:var(--r-ctl);border:0;grid-auto-columns:1fr;grid-auto-flow:column;gap:3px;min-inline-size:0;margin:0;padding:3px;display:grid}.seg-full button{font-family:var(--mono);color:var(--text-muted);cursor:pointer;background:0 0;border:none;border-radius:6px;padding:7px;font-size:12px;font-weight:600}.seg-full button.is-active{background:var(--surface);color:var(--primary);box-shadow:var(--shadow-sm)}.modal-scrim{backdrop-filter:blur(2px);opacity:0;pointer-events:none;z-index:70;background:#03070c8c;place-items:center;padding:20px;transition:opacity .16s;display:grid;position:fixed;inset:0}.modal-scrim.open{opacity:1;pointer-events:auto}.modal{background:var(--surface);border:1px solid var(--border);width:min(420px,100%);box-shadow:var(--shadow-lg);border-radius:14px;padding:20px;transition:transform .16s;transform:translateY(8px)scale(.98)}.modal-scrim.open .modal{transform:none}.modal__icon{background:var(--err-soft);width:40px;height:40px;color:var(--err);border-radius:10px;place-items:center;margin-bottom:13px;display:grid}.modal h3{letter-spacing:-.01em;margin:0 0 6px;font-size:16px;font-weight:650}.modal p{color:var(--text-muted);margin:0;font-size:13px;line-height:1.55}.modal p b{color:var(--text);font-weight:600}.modal__actions{justify-content:flex-end;gap:10px;margin-top:18px;display:flex}.toast-viewport{z-index:80;flex-direction:column;gap:10px;width:min(360px,100vw - 40px);display:flex;position:fixed;bottom:20px;right:20px}.toast{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-ctl);box-shadow:var(--shadow-lg);align-items:flex-start;gap:10px;padding:12px 14px;font-size:13px;animation:.18s ease-out fade;display:flex}.toast__icon{border-radius:6px;flex:none;place-items:center;width:20px;height:20px;margin-top:1px;display:grid}.toast--success .toast__icon{color:var(--ok);background:var(--ok-soft)}.toast--error .toast__icon{color:var(--err);background:var(--err-soft)}.toast--info .toast__icon{color:var(--run);background:var(--run-soft)}.toast__body{min-width:0;color:var(--text);flex:1;line-height:1.4}.toast__close{color:var(--text-faint);cursor:pointer;background:0 0;border:none;border-radius:4px;flex:none;place-items:center;padding:2px;display:grid}.toast__close:hover{color:var(--text);background:var(--surface-3)}.empty-state{text-align:center;color:var(--text-muted);flex-direction:column;align-items:center;gap:6px;padding:48px 24px;display:flex}.empty-state__icon{background:var(--surface-3);width:40px;height:40px;color:var(--text-faint);border-radius:10px;place-items:center;margin-bottom:6px;display:grid}.empty-state__title{color:var(--text);font-size:13.5px;font-weight:650}.empty-state__desc{max-width:40ch;font-size:12.5px}.empty-state__action{margin-top:10px}.spinner{border:2px solid var(--border);border-top-color:var(--primary);border-radius:50%;flex:none;animation:.7s linear infinite spin;display:inline-block}.mobile-note{display:none}@media (width<=1080px){.kpis,.qstats{grid-template-columns:repeat(2,1fr)}.grid-2{grid-template-columns:1fr}.detail-grid{grid-template-columns:minmax(0,1fr)}}@media (width<=860px){:root{--sidebar-w:0px}.sidebar{display:none}.app,.set-grid{grid-template-columns:1fr}}
1
+ :root{--mono:ui-monospace, "JetBrains Mono", "SF Mono", "SFMono-Regular", Menlo, Consolas, monospace;--sans:"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;--canvas:#f4f6f8;--surface:#fff;--surface-2:#f8fafb;--surface-3:#eef1f4;--border:#e3e7ec;--border-strong:#c8d0d9;--text:#171b21;--text-muted:#5b636e;--text-faint:#97a0ab;--primary:#1976c2;--primary-hover:#145d99;--primary-ink:#fff;--primary-soft:#e8f2fb;--accent:#f59e0b;--ok:#16a34a;--ok-soft:#ecfdf3;--run:#1976c2;--run-soft:#e8f2fb;--queued:#c2760a;--queued-soft:#fdf4e5;--err:#dc2626;--err-soft:#fef2f2;--idle:#5b636e;--idle-soft:#eef1f4;--shadow-sm:0 1px 2px #0f172a0a, 0 1px 3px #0f172a0f;--shadow-md:0 4px 12px #0f172a0f, 0 2px 4px #0f172a0a;--shadow-lg:0 24px 48px -12px #0f172a2e;--r-card:12px;--r-ctl:8px;--sidebar-w:244px;--topbar-h:60px}@media (prefers-color-scheme:dark){:root{--canvas:#12151b;--surface:#171b21;--surface-2:#1c212a;--surface-3:#242b35;--border:#2a313c;--border-strong:#3a4350;--text:#e0e0e0;--text-muted:#a3a3a3;--text-faint:#6f7681;--primary:#4a9eea;--primary-hover:#6fb2ef;--primary-ink:#0a0e14;--primary-soft:#4a9eea24;--accent:#fa0;--ok:#4ade80;--ok-soft:#4ade8021;--run:#4a9eea;--run-soft:#4a9eea24;--queued:#fbbf24;--queued-soft:#fbbf2421;--err:#f87171;--err-soft:#f8717121;--idle:#a3a3a3;--idle-soft:#a3a3a31f;--shadow-sm:0 1px 2px #0000004d;--shadow-md:0 4px 14px #0006;--shadow-lg:0 24px 48px -12px #0009}}:root[data-theme=light]{--canvas:#f4f6f8;--surface:#fff;--surface-2:#f8fafb;--surface-3:#eef1f4;--border:#e3e7ec;--border-strong:#c8d0d9;--text:#171b21;--text-muted:#5b636e;--text-faint:#97a0ab;--primary:#1976c2;--primary-hover:#145d99;--primary-ink:#fff;--primary-soft:#e8f2fb;--accent:#f59e0b;--ok:#16a34a;--ok-soft:#ecfdf3;--run:#1976c2;--run-soft:#e8f2fb;--queued:#c2760a;--queued-soft:#fdf4e5;--err:#dc2626;--err-soft:#fef2f2;--idle:#5b636e;--idle-soft:#eef1f4;--shadow-sm:0 1px 2px #0f172a0a, 0 1px 3px #0f172a0f;--shadow-md:0 4px 12px #0f172a0f, 0 2px 4px #0f172a0a;--shadow-lg:0 24px 48px -12px #0f172a2e}:root[data-theme=dark]{--canvas:#12151b;--surface:#171b21;--surface-2:#1c212a;--surface-3:#242b35;--border:#2a313c;--border-strong:#3a4350;--text:#e0e0e0;--text-muted:#a3a3a3;--text-faint:#6f7681;--primary:#4a9eea;--primary-hover:#6fb2ef;--primary-ink:#0a0e14;--primary-soft:#4a9eea24;--accent:#fa0;--ok:#4ade80;--ok-soft:#4ade8021;--run:#4a9eea;--run-soft:#4a9eea24;--queued:#fbbf24;--queued-soft:#fbbf2421;--err:#f87171;--err-soft:#f8717121;--idle:#a3a3a3;--idle-soft:#a3a3a31f;--shadow-sm:0 1px 2px #0000004d;--shadow-md:0 4px 14px #0006;--shadow-lg:0 24px 48px -12px #0009}*{box-sizing:border-box}html,body{height:100%}body{font-family:var(--sans);background:var(--canvas);color:var(--text);-webkit-font-smoothing:antialiased;margin:0;font-size:14px;line-height:1.5}#root{height:100%}.icon{stroke:currentColor;stroke-width:1.6px;fill:none;stroke-linecap:round;stroke-linejoin:round;flex:none;width:20px;height:20px}.icon-sm{width:16px;height:16px}.icon-xs{width:14px;height:14px}@keyframes pulse{0%,to{opacity:1;box-shadow:0 0 0 0 color-mix(in srgb, var(--run) 45%, transparent)}50%{opacity:.75;box-shadow:0 0 0 4px #0000}}@keyframes fade{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}@keyframes spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}.app{grid-template-columns:var(--sidebar-w) 1fr;min-height:100%;display:grid}.sidebar{background:var(--surface);border-right:1px solid var(--border);flex-direction:column;gap:4px;height:100vh;padding:16px 12px;display:flex;position:sticky;top:0}.brand{align-items:center;gap:10px;padding:6px 8px 14px;display:flex}.brand__mark{background:linear-gradient(145deg, var(--primary), var(--primary-hover));color:#fff;width:30px;height:30px;box-shadow:var(--shadow-sm);border-radius:8px;flex:none;place-items:center;display:grid}.brand__mark svg{stroke:#fff;stroke-width:2px;width:17px;height:17px}.brand__name{font-family:var(--mono);letter-spacing:-.02em;font-size:13px;font-weight:600;line-height:1.15}.brand__name b{color:var(--primary);font-weight:700}.brand__name .dot{color:var(--accent)}.brand__sub{font-family:var(--mono);color:var(--text-faint);letter-spacing:.04em;margin-top:1px;font-size:10px;display:block}.nav-label{font-family:var(--mono);letter-spacing:.12em;text-transform:uppercase;color:var(--text-faint);padding:14px 10px 6px;font-size:10px}.nav-item{text-align:left;border-radius:var(--r-ctl);width:100%;color:var(--text-muted);cursor:pointer;font-size:13.5px;font-weight:500;font-family:var(--sans);background:0 0;border:none;align-items:center;gap:11px;padding:8px 10px;text-decoration:none;transition:background .12s,color .12s;display:flex;position:relative}.nav-item:hover{background:var(--surface-3);color:var(--text)}.nav-item.is-active{background:var(--primary-soft);color:var(--primary);font-weight:600}.nav-item.is-active:before{content:"";background:var(--primary);border-radius:0 3px 3px 0;width:3px;position:absolute;top:8px;bottom:8px;left:-12px}.nav-item .count{box-sizing:border-box;min-width:20px;height:18px;font-family:var(--mono);font-variant-numeric:tabular-nums;background:var(--surface-3);color:var(--text-muted);border-radius:999px;justify-content:center;align-items:center;margin-left:auto;padding:0 6px;font-size:11px;font-weight:600;line-height:1;display:inline-flex}.nav-item.is-active .count{background:var(--primary);color:var(--primary-ink)}.nav-item .count.count--live{background:var(--run-soft);color:var(--run)}.sidebar__spacer{flex:1}.side-card{border:1px solid var(--border);border-radius:var(--r-ctl);background:var(--surface-2);flex-direction:column;gap:8px;padding:10px 11px;font-size:12px;display:flex}.side-row{color:var(--text-muted);align-items:center;gap:8px;display:flex}.side-row .k{color:var(--text-faint)}.side-row .v{font-family:var(--mono);color:var(--text);text-align:right;margin-left:auto;font-size:11.5px}.update-pill{border-radius:var(--r-ctl);background:var(--queued-soft);color:var(--queued);border:1px solid color-mix(in srgb, var(--queued) 30%, transparent);cursor:pointer;align-items:center;gap:8px;margin-top:4px;padding:8px 10px;font-size:12px;font-weight:600;text-decoration:none;display:flex}.dot-sq{background:var(--idle);border-radius:2.5px;flex:none;width:8px;height:8px}.dot-sq.ok{background:var(--ok)}.dot-sq.run{background:var(--run)}.dot-sq.err{background:var(--err)}.dot-sq.queued{background:var(--queued)}.live .dot-sq.run,.dot-sq.run.pulse{animation:1.8s ease-in-out infinite pulse}.main{flex-direction:column;min-width:0;display:flex}.topbar{z-index:30;height:var(--topbar-h);background:color-mix(in srgb, var(--canvas) 82%, transparent);backdrop-filter:blur(10px);border-bottom:1px solid var(--border);flex:none;align-items:center;gap:14px;padding:0 24px;display:flex;position:sticky;top:0}.topbar__title{letter-spacing:-.01em;white-space:nowrap;font-size:15px;font-weight:600}.topbar__crumb{color:var(--text-faint);font-family:var(--mono);font-size:12px}.topbar>.btn{margin-left:auto}.icon-btn{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-ctl);width:36px;height:36px;color:var(--text-muted);cursor:pointer;box-shadow:var(--shadow-sm);flex:none;place-items:center;transition:color .12s,border-color .12s;display:grid}.icon-btn:hover{color:var(--text);border-color:var(--border-strong)}.btn{border-radius:var(--r-ctl);cursor:pointer;font-size:13px;font-weight:600;font-family:var(--sans);white-space:nowrap;border:1px solid #0000;align-items:center;gap:7px;padding:8px 13px;transition:background .12s,border-color .12s,color .12s;display:inline-flex}.btn:disabled{opacity:.5;cursor:default}.btn--primary{background:var(--primary);color:var(--primary-ink);box-shadow:var(--shadow-sm)}.btn--primary:hover:not(:disabled){background:var(--primary-hover)}.btn--ghost{background:var(--surface);color:var(--text);border-color:var(--border);box-shadow:var(--shadow-sm)}.btn--ghost:hover:not(:disabled){border-color:var(--border-strong)}.btn--danger{color:#fff;box-shadow:var(--shadow-sm);background:#dc2626}.btn--danger:hover:not(:disabled){background:#b91c1c}.btn--sm{padding:5px 10px;font-size:12px}.content{width:100%;max-width:1360px;padding:24px}.view{animation:.22s ease-out fade}.eyebrow{font-family:var(--mono);letter-spacing:.12em;text-transform:uppercase;color:var(--text-faint);font-size:10.5px}.section-head{justify-content:space-between;align-items:flex-end;gap:16px;margin:26px 0 12px;display:flex}.section-head h2{letter-spacing:-.01em;margin:2px 0 0;font-size:15px;font-weight:650}.section-head p{color:var(--text-muted);margin:0;font-size:12.5px}.link{color:var(--primary);cursor:pointer;font-size:12.5px;font-weight:600;font-family:var(--sans);background:0 0;border:none;align-items:center;gap:4px;padding:0;text-decoration:none;display:inline-flex}.link:hover{text-decoration:underline}.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-card);box-shadow:var(--shadow-sm)}.kpis{grid-template-columns:repeat(4,1fr);gap:14px;display:grid}.kpi{flex-direction:column;gap:3px;padding:15px 16px 13px;display:flex;position:relative;overflow:hidden}.kpi__label{color:var(--text-muted);align-items:center;gap:7px;font-size:12px;font-weight:500;display:flex}.kpi__label .icon{width:15px;height:15px;color:var(--text-faint)}.kpi__val{font-family:var(--mono);letter-spacing:-.02em;font-variant-numeric:tabular-nums;margin-top:2px;font-size:27px;font-weight:600;line-height:1.15}.kpi__val small{color:var(--text-muted);font-size:14px;font-weight:500}.kpi__foot{color:var(--text-muted);align-items:center;gap:6px;margin-top:3px;font-size:11.5px;display:flex}.delta{font-family:var(--mono);align-items:center;gap:2px;font-size:11.5px;font-weight:600;display:inline-flex}.delta.up{color:var(--ok)}.delta.down{color:var(--err)}.delta.flat{color:var(--text-faint)}.spark{width:76px;height:26px;color:var(--primary);opacity:.9;position:absolute;top:14px;right:12px}.spark.accent{color:var(--accent)}.grid-2{grid-template-columns:1.9fr 1fr;align-items:stretch;gap:14px;display:grid}.panel{padding:16px 18px}.panel__head{justify-content:space-between;align-items:center;margin-bottom:4px;display:flex}.panel__head h3{margin:0;font-size:13.5px;font-weight:650}.chart-wrap{position:relative}.chart{width:100%;height:auto;display:block}.chart-legend{color:var(--text-muted);gap:16px;margin-top:8px;font-size:11.5px;display:flex}.chart-legend b{color:var(--text);font-family:var(--mono)}.seg{background:var(--surface-3);border:0;border-radius:7px;gap:2px;min-inline-size:0;margin:0;padding:2px;display:inline-flex}.seg button{font-family:var(--mono);color:var(--text-muted);cursor:pointer;background:0 0;border:none;border-radius:5px;padding:3px 9px;font-size:11px;font-weight:600}.seg button.is-active{background:var(--surface);color:var(--text);box-shadow:var(--shadow-sm)}.health{flex-direction:column;gap:0;display:flex}.health__row{border-bottom:1px solid var(--border);align-items:center;gap:10px;padding:11px 0;display:flex}.health__row:last-child{border-bottom:none}.health__row .name{font-size:13px;font-weight:500}.health__row .meta{font-family:var(--mono);color:var(--text-muted);text-align:right;margin-left:auto;font-size:11.5px}.pill{font-family:var(--mono);letter-spacing:.01em;background:var(--idle-soft);color:var(--idle);border:1px solid color-mix(in srgb, var(--idle) 22%, transparent);text-transform:capitalize;border-radius:999px;align-items:center;gap:6px;padding:3px 9px 3px 8px;font-size:11px;font-weight:600;display:inline-flex}.pill .dot-sq{background:currentColor;border-radius:2px;width:6px;height:6px}.pill--ok{background:var(--ok-soft);color:var(--ok);border-color:color-mix(in srgb, var(--ok) 26%, transparent)}.pill--run{background:var(--run-soft);color:var(--run);border-color:color-mix(in srgb, var(--run) 26%, transparent)}.pill--queued{background:var(--queued-soft);color:var(--queued);border-color:color-mix(in srgb, var(--queued) 30%, transparent)}.pill--err{background:var(--err-soft);color:var(--err);border-color:color-mix(in srgb, var(--err) 26%, transparent)}.chip{font-family:var(--mono);color:var(--text-muted);background:var(--surface-3);border:1px solid var(--border);border-radius:6px;padding:1px 7px;font-size:11.5px;display:inline-block}.table-wrap{overflow-x:auto}table.tbl{border-collapse:collapse;width:100%;font-size:13px}.tbl thead th{text-align:left;font-family:var(--mono);letter-spacing:.08em;text-transform:uppercase;color:var(--text-faint);border-bottom:1px solid var(--border);white-space:nowrap;background:var(--surface);padding:10px 14px;font-size:10.5px;font-weight:600}.tbl thead th.num,.tbl td.num{text-align:right;font-variant-numeric:tabular-nums;font-family:var(--mono)}.tbl tbody td{border-bottom:1px solid var(--border);vertical-align:middle;padding:12px 14px}.tbl tbody tr:last-child td{border-bottom:none}.tbl tbody tr{transition:background .1s}.tbl tbody tr:hover{background:var(--surface-2)}.lib-cell{color:inherit;cursor:pointer;align-items:center;gap:11px;text-decoration:none;display:flex}.lib-ico{width:30px;height:30px;font-family:var(--mono);color:var(--primary);background:var(--primary-soft);border:1px solid color-mix(in srgb, var(--primary) 18%, transparent);border-radius:7px;flex:none;place-items:center;font-size:13px;font-weight:700;display:grid;position:relative;overflow:hidden}.lib-ico--fav{background:var(--surface-2);border-color:var(--border)}.lib-ico img{border-radius:4px;width:19px;height:19px;display:block}.lib-name{font-size:13.5px;font-weight:600}.lib-url{font-family:var(--mono);color:var(--text-faint);text-overflow:ellipsis;white-space:nowrap;max-width:260px;font-size:11px;overflow:hidden}.ver-list{flex-wrap:wrap;gap:4px;display:flex}.row-actions{justify-content:flex-end;gap:4px;display:flex}.act{width:28px;height:28px;color:var(--text-faint);cursor:pointer;background:0 0;border:1px solid #0000;border-radius:6px;place-items:center;display:grid}.act:hover{background:var(--surface-3);color:var(--text)}.act.danger:hover{color:var(--err);background:var(--err-soft)}.bar{background:var(--surface-3);border-radius:999px;width:100%;height:6px;overflow:hidden}.bar__fill{background:var(--run);border-radius:999px;height:100%;transition:width .2s ease-out}.bar__fill.ok{background:var(--ok)}.bar__fill.queued{background:var(--queued)}.bar__fill.err{background:var(--err)}.job{border-bottom:1px solid var(--border);grid-template-columns:1fr auto;gap:4px 16px;padding:15px 18px;display:grid}.job:last-child{border-bottom:none}.job__top{align-items:center;gap:10px;display:flex}.job__title{font-size:13.5px;font-weight:600}.job__id{font-family:var(--mono);color:var(--text-faint);font-size:11px}.job__meta{color:var(--text-muted);grid-column:1/-1;align-items:center;gap:14px;margin-top:8px;font-size:12px;display:flex}.job__meta .m{font-family:var(--mono);align-items:center;gap:5px;font-size:11.5px;display:inline-flex}.job__prog{grid-column:1/-1;align-items:center;gap:12px;margin-top:9px;display:flex}.job__prog .pct{font-family:var(--mono);color:var(--text-muted);text-align:right;font-variant-numeric:tabular-nums;min-width:34px;font-size:11.5px}.job__actions{align-self:start;gap:6px;display:flex}.qstats{grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:4px;display:grid}.qstat{padding:13px 15px}.qstat .l{color:var(--text-muted);align-items:center;gap:7px;font-size:12px;display:flex}.qstat .l .icon{width:15px;height:15px;color:var(--text-faint)}.qstat .n{font-family:var(--mono);font-variant-numeric:tabular-nums;letter-spacing:-.02em;margin-top:5px;font-size:23px;font-weight:600}.qstat .n.run{color:var(--run)}.qstat .n.err{color:var(--err)}.qstat .n.ok{color:var(--ok)}.qstat .sub{color:var(--text-faint);margin-top:2px;font-size:11px}.jobc{border-bottom:1px solid var(--border);padding:15px 18px}.jobc:last-child{border-bottom:none}.jobc__head{flex-wrap:wrap;align-items:center;gap:10px;display:flex}.jobc__head .lib-ico{border-radius:6px;width:26px;height:26px;font-size:11px}.jobc__head .lib-ico img{width:16px;height:16px}.jobc__title{font-size:13.5px;font-weight:650}.jobc__right{align-items:center;gap:8px;margin-left:auto;display:flex}.jobc__elapsed{font-family:var(--mono);color:var(--text-muted);white-space:nowrap;align-items:center;gap:5px;font-size:11.5px;display:inline-flex}.jobc__url{color:var(--text-muted);align-items:center;gap:6px;min-width:0;margin-top:10px;font-size:12px;display:flex}.jobc__url .u{font-family:var(--mono);color:var(--text);text-overflow:ellipsis;white-space:nowrap;font-size:11.5px;overflow:hidden}.jobc__prog{align-items:center;gap:12px;margin-top:10px;display:flex}.jobc__prog .pct{font-family:var(--mono);color:var(--text-muted);text-align:right;font-variant-numeric:tabular-nums;min-width:36px;font-size:11.5px}.jobc__stats{font-family:var(--mono);color:var(--text-faint);flex-wrap:wrap;gap:5px 14px;margin-top:10px;font-size:11px;display:flex}.jobc__stats b{color:var(--text-muted);font-weight:600}.jobc__error{border-radius:var(--r-ctl);background:var(--err-soft);border:1px solid color-mix(in srgb, var(--err) 26%, transparent);color:var(--text);margin-top:11px;padding:10px 12px;font-size:12px;line-height:1.55}.jobc__error .t{font-family:var(--mono);color:var(--err);font-weight:700}.jobc__error .m{font-family:var(--mono);color:var(--text-muted);margin-top:5px;font-size:11px;display:block}.qpos{font-family:var(--mono);color:var(--text-muted);background:var(--surface-3);border:1px solid var(--border);border-radius:5px;padding:1px 7px;font-size:11px;font-weight:700}.search-lg{align-items:center;gap:10px;display:flex}.field{flex:1;position:relative}.field .icon{color:var(--text-faint);pointer-events:none;position:absolute;top:50%;left:12px;transform:translateY(-50%)}.input{width:100%;font-family:var(--sans);color:var(--text);background:var(--surface);border:1px solid var(--border);border-radius:var(--r-ctl);outline:none;padding:11px 13px;font-size:14px;transition:border-color .12s,box-shadow .12s}.input.has-icon{padding-left:40px}.input:focus{border-color:var(--primary);box-shadow:0 0 0 3px var(--primary-soft)}.input:disabled{opacity:.6;cursor:not-allowed}select.input{appearance:none;cursor:pointer}.result{border-bottom:1px solid var(--border);padding:15px 18px}.result:last-child{border-bottom:none}.result__head{flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:6px;display:flex}.result__title{color:var(--primary);font-size:13.5px;font-weight:600}.result__url{font-family:var(--mono);color:var(--text-faint);font-size:11px}.result__score{font-family:var(--mono);color:var(--text-muted);margin-left:auto;font-size:11px}.result__snippet{color:var(--text-muted);font-size:12.5px;line-height:1.6}.result__snippet mark{background:color-mix(in srgb, var(--accent) 26%, transparent);color:var(--text);border-radius:3px;padding:0 2px}.set-grid{grid-template-columns:220px 1fr;gap:6px 28px;padding:4px 2px;display:grid}.set-grid .k{border-bottom:1px solid var(--border);padding:13px 0}.set-grid .k b{font-size:13px;display:block}.set-grid .k span{color:var(--text-muted);font-size:12px}.set-grid .v{border-bottom:1px solid var(--border);flex-wrap:wrap;align-items:center;gap:9px;padding:13px 0;display:flex}.set-grid>div:nth-last-child(-n+2){border-bottom:none}.toggle{background:var(--primary);cursor:pointer;border:none;border-radius:999px;flex:none;width:38px;height:22px;padding:0;position:relative}.toggle.off{background:var(--surface-3);border:1px solid var(--border)}.toggle:after{content:"";width:16px;height:16px;box-shadow:var(--shadow-sm);background:#fff;border-radius:50%;position:absolute;top:3px;right:3px}.toggle.off:after{left:3px;right:auto}.mono{font-family:var(--mono)}.muted{color:var(--text-muted)}.text-faint{color:var(--text-faint)}.results-meta{border-bottom:1px solid var(--border);color:var(--text-muted);flex-wrap:wrap;align-items:center;gap:10px;padding:11px 18px;font-size:12px;display:flex}.results-meta b{color:var(--text);font-family:var(--mono);font-variant-numeric:tabular-nums}.doc-result{border-bottom:1px solid var(--border);padding:16px 18px}.doc-result:last-child{border-bottom:none}.doc-head{align-items:center;gap:8px;min-width:0;margin-bottom:12px;display:flex}.doc-head a{color:var(--primary);font-family:var(--mono);text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:11.5px;text-decoration:none;overflow:hidden}.doc-head a:hover{text-decoration:underline}.doc-badge{font-family:var(--mono);color:var(--text-muted);background:var(--surface-3);border:1px solid var(--border);border-radius:5px;flex:none;margin-left:auto;padding:1px 6px;font-size:10px}.doc-score{font-family:var(--mono);color:var(--ok);background:var(--ok-soft);border:1px solid color-mix(in srgb, var(--ok) 26%, transparent);border-radius:5px;flex:none;padding:1px 6px;font-size:10px}.md{color:var(--text);font-size:13px;line-height:1.65}.md>*+*{margin-top:11px}.md h2{letter-spacing:-.01em;margin:4px 0 0;font-size:14.5px;font-weight:650}.md h3{margin:4px 0 0;font-size:13px;font-weight:650}.md p{margin:0}.md ul{margin:0;padding-left:20px}.md li{margin:3px 0}.md li::marker{color:var(--text-faint)}.md a{color:var(--primary);text-decoration:none}.md code{font-family:var(--mono);background:var(--surface-3);border-radius:5px;padding:1px 5px;font-size:12px}.md pre{background:var(--surface-2);border:1px solid var(--border);border-radius:8px;margin:0;padding:13px 15px;overflow-x:auto}.md pre code{color:var(--text);white-space:pre;background:0 0;padding:0;font-size:12px;line-height:1.6;display:block}.md img{border-radius:6px;max-width:100%;height:auto;max-height:60vh;display:block}.clip{max-height:300px;position:relative;overflow:hidden}.clip.is-open{max-height:none}.clip:after{content:"";background:linear-gradient(to bottom, transparent, var(--surface));pointer-events:none;height:76px;position:absolute;inset:auto 0 0}.clip.is-open:after{display:none}.show-more{margin-top:10px}details.adv{border:1px solid var(--border);border-radius:var(--r-ctl);background:var(--surface-2)}details.adv>summary{cursor:pointer;color:var(--text);align-items:center;gap:8px;padding:11px 13px;font-size:12.5px;font-weight:600;list-style:none;display:flex}details.adv>summary::-webkit-details-marker{display:none}details.adv>summary .chev{color:var(--text-faint);margin-right:-2px;transition:transform .18s}details.adv[open]>summary .chev{transform:rotate(90deg)}details.adv>summary .tag{font-family:var(--mono);color:var(--text-faint);margin-left:auto;font-size:10.5px;font-weight:500}.adv__body{border-top:1px solid var(--border);flex-direction:column;gap:15px;padding:6px 13px 15px;display:flex}textarea.input{resize:vertical;min-height:54px;line-height:1.5}.check{align-items:flex-start;gap:9px;display:flex}.check input{width:16px;height:16px;accent-color:var(--primary);flex:none;margin-top:2px}.check .lbl{font-size:13px;font-weight:500}.check .hint{color:var(--text-faint);margin-top:1px;font-size:11.5px;font-weight:400;display:block}.hdr-row{grid-template-columns:1fr 1fr auto;align-items:center;gap:8px;margin-bottom:8px;display:grid}.hdr-row .x{border:1px solid var(--border);background:var(--surface);width:32px;height:32px;color:var(--text-faint);cursor:pointer;border-radius:6px;place-items:center;display:grid}.hdr-row .x:hover{color:var(--err);border-color:color-mix(in srgb, var(--err) 40%, transparent)}.linkbtn{color:var(--primary);cursor:pointer;font-size:12.5px;font-weight:600;font-family:var(--sans);background:0 0;border:none;align-self:flex-start;align-items:center;gap:5px;padding:2px 0 0;display:inline-flex}.note{border-radius:var(--r-ctl);background:var(--run-soft);color:var(--run);border:1px solid color-mix(in srgb, var(--run) 24%, transparent);gap:8px;padding:9px 11px;font-size:11.5px;line-height:1.45;display:flex}.note .icon{flex:none;margin-top:1px}.note--warn{background:var(--queued-soft);color:var(--queued);border-color:color-mix(in srgb, var(--queued) 32%, transparent)}.note--err{background:var(--err-soft);color:var(--err);border-color:color-mix(in srgb, var(--err) 26%, transparent)}.note a{color:inherit;font-weight:600}.back{cursor:pointer;background:0 0;border:none;align-items:center;gap:5px;margin:0 0 14px;padding:0;display:inline-flex}.detail-head{align-items:center;gap:16px;display:flex}.lib-ico.big{border-radius:11px;width:46px;height:46px;font-size:17px}.lib-ico.big img{border-radius:6px;width:27px;height:27px}.detail-head h2{letter-spacing:-.02em;margin:0;font-size:19px}.detail-head .lib-url{margin-top:2px;display:block}.detail-head .chips{flex-wrap:wrap;gap:7px;margin-top:9px;display:flex}.detail-actions{align-self:flex-start;gap:8px;margin-left:auto;display:flex}.ver-tabs{flex-wrap:wrap;gap:6px;margin:18px 0 14px;display:flex}.ver-tab{border:1px solid var(--border);background:var(--surface);color:var(--text-muted);font-family:var(--mono);cursor:pointer;box-shadow:var(--shadow-sm);border-radius:8px;align-items:center;gap:7px;padding:7px 13px;font-size:12.5px;font-weight:600;display:inline-flex}.ver-tab.is-active{border-color:var(--primary);color:var(--primary);background:var(--primary-soft)}.detail-grid{grid-template-columns:322px minmax(0,1fr);align-items:start;gap:14px;display:grid}.set-grid.tight{grid-template-columns:92px 1fr;gap:0 14px}.set-grid.tight .k{border-bottom:1px solid var(--border);padding:8px 0}.set-grid.tight .v{border-bottom:1px solid var(--border);font-family:var(--mono);padding:8px 0;font-size:12px}.set-grid.tight .k b{font-size:12px;font-weight:600}.set-grid.tight>div:nth-last-child(-n+2){border-bottom:none}.cfg-actions{flex-direction:column;gap:8px;margin-top:15px;display:flex}.cfg-actions .btn{justify-content:center;width:100%}.explorer-head{border-bottom:1px solid var(--border);justify-content:space-between;align-items:center;gap:12px;padding:14px 16px;display:flex}.explorer-head h3{margin:0;font-size:13.5px;font-weight:650}.explorer-search{border-bottom:1px solid var(--border);padding:12px 16px}.explorer-stats{border-bottom:1px solid var(--border);font-family:var(--mono);color:var(--text-muted);background:var(--surface-2);flex-wrap:wrap;gap:6px 16px;padding:9px 16px;font-size:11px;display:flex}.detail-col{flex-direction:column;gap:14px;min-width:0;display:flex}.scrape-error{border-radius:var(--r-ctl);background:var(--err-soft);border:1px solid color-mix(in srgb, var(--err) 26%, transparent);color:var(--text);word-break:break-word;padding:10px 12px;font-size:12px;line-height:1.55}.scrape-error .t{font-family:var(--mono);color:var(--err);font-weight:700}.comp-list{margin-top:8px}.comp-bar-row{align-items:center;gap:10px;margin:5px 0;display:flex}.comp-name{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-family:var(--mono);color:var(--text-muted);flex:0 0 42%;font-size:11.5px;overflow:hidden}.comp-bar-track{background:var(--surface-2);border-radius:4px;flex:auto;height:8px;overflow:hidden}.comp-bar-fill{background:var(--primary);border-radius:4px;height:100%;display:block}.comp-bar-count{text-align:right;min-width:2.5em;font-family:var(--mono);color:var(--text);flex:none;font-size:11.5px}details.chunk{border-bottom:1px solid var(--border)}details.chunk:last-child{border-bottom:none}details.chunk>summary{cursor:pointer;align-items:flex-start;gap:12px;padding:12px 16px;list-style:none;display:flex}details.chunk>summary::-webkit-details-marker{display:none}details.chunk[open]>summary{background:var(--surface-2)}.chunk__ix{font-family:var(--mono);color:var(--primary);background:var(--primary-soft);border-radius:5px;flex:none;padding:2px 7px;font-size:11px;font-weight:700}.chunk__main{flex:1;min-width:0}.chunk__path{font-family:var(--mono);color:var(--text-muted);text-overflow:ellipsis;white-space:nowrap;font-size:11.5px;overflow:hidden}.chunk__prev{color:var(--text-muted);text-overflow:ellipsis;white-space:nowrap;margin-top:3px;font-size:12.5px;overflow:hidden}.chunk__tok{font-family:var(--mono);color:var(--text-faint);flex:none;font-size:11px}.chunk__body{padding:6px 16px 16px 44px}.chunk__meta{flex-wrap:wrap;gap:6px;display:flex}.meta-chip{font-family:var(--mono);color:var(--text-muted);background:var(--surface-3);border:1px solid var(--border);border-radius:5px;padding:1px 7px;font-size:10.5px}.meta-chip.ok{color:var(--ok);background:var(--ok-soft);border-color:color-mix(in srgb, var(--ok) 26%, transparent)}.scrim{backdrop-filter:blur(2px);opacity:0;pointer-events:none;z-index:60;background:#02061780;transition:opacity .2s;position:fixed;inset:0}.scrim.open{opacity:1;pointer-events:auto}.drawer{background:var(--surface);border-left:1px solid var(--border);width:min(460px,94vw);height:100%;box-shadow:var(--shadow-lg);z-index:61;flex-direction:column;transition:transform .24s cubic-bezier(.22,.61,.36,1);display:flex;position:fixed;top:0;right:0;transform:translate(100%)}.drawer.open{transform:none}.drawer__head{border-bottom:1px solid var(--border);align-items:center;gap:10px;padding:18px 20px;display:flex}.drawer__head h3{margin:0;font-size:15px;font-weight:650}.drawer__body{flex-direction:column;gap:16px;padding:18px 20px;display:flex;overflow-y:auto}.drawer__foot{border-top:1px solid var(--border);justify-content:flex-end;gap:10px;margin-top:auto;padding:14px 20px;display:flex}.form-row{flex-direction:column;gap:6px;display:flex}.form-row>label,.form-row>.form-label{font-size:12.5px;font-weight:600}.form-row .hint{color:var(--text-faint);font-size:11.5px}.form-2{grid-template-columns:1fr 1fr;gap:12px;display:grid}.seg-full{background:var(--surface-3);border-radius:var(--r-ctl);border:0;grid-auto-columns:1fr;grid-auto-flow:column;gap:3px;min-inline-size:0;margin:0;padding:3px;display:grid}.seg-full button{font-family:var(--mono);color:var(--text-muted);cursor:pointer;background:0 0;border:none;border-radius:6px;padding:7px;font-size:12px;font-weight:600}.seg-full button.is-active{background:var(--surface);color:var(--primary);box-shadow:var(--shadow-sm)}.modal-scrim{backdrop-filter:blur(2px);opacity:0;pointer-events:none;z-index:70;background:#03070c8c;place-items:center;padding:20px;transition:opacity .16s;display:grid;position:fixed;inset:0}.modal-scrim.open{opacity:1;pointer-events:auto}.modal{background:var(--surface);border:1px solid var(--border);width:min(420px,100%);box-shadow:var(--shadow-lg);border-radius:14px;padding:20px;transition:transform .16s;transform:translateY(8px)scale(.98)}.modal-scrim.open .modal{transform:none}.modal__icon{background:var(--err-soft);width:40px;height:40px;color:var(--err);border-radius:10px;place-items:center;margin-bottom:13px;display:grid}.modal h3{letter-spacing:-.01em;margin:0 0 6px;font-size:16px;font-weight:650}.modal p{color:var(--text-muted);margin:0;font-size:13px;line-height:1.55}.modal p b{color:var(--text);font-weight:600}.modal__actions{justify-content:flex-end;gap:10px;margin-top:18px;display:flex}.toast-viewport{z-index:80;flex-direction:column;gap:10px;width:min(360px,100vw - 40px);display:flex;position:fixed;bottom:20px;right:20px}.toast{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-ctl);box-shadow:var(--shadow-lg);align-items:flex-start;gap:10px;padding:12px 14px;font-size:13px;animation:.18s ease-out fade;display:flex}.toast__icon{border-radius:6px;flex:none;place-items:center;width:20px;height:20px;margin-top:1px;display:grid}.toast--success .toast__icon{color:var(--ok);background:var(--ok-soft)}.toast--error .toast__icon{color:var(--err);background:var(--err-soft)}.toast--info .toast__icon{color:var(--run);background:var(--run-soft)}.toast__body{min-width:0;color:var(--text);flex:1;line-height:1.4}.toast__close{color:var(--text-faint);cursor:pointer;background:0 0;border:none;border-radius:4px;flex:none;place-items:center;padding:2px;display:grid}.toast__close:hover{color:var(--text);background:var(--surface-3)}.empty-state{text-align:center;color:var(--text-muted);flex-direction:column;align-items:center;gap:6px;padding:48px 24px;display:flex}.empty-state__icon{background:var(--surface-3);width:40px;height:40px;color:var(--text-faint);border-radius:10px;place-items:center;margin-bottom:6px;display:grid}.empty-state__title{color:var(--text);font-size:13.5px;font-weight:650}.empty-state__desc{max-width:40ch;font-size:12.5px}.empty-state__action{margin-top:10px}.spinner{border:2px solid var(--border);border-top-color:var(--primary);border-radius:50%;flex:none;animation:.7s linear infinite spin;display:inline-block}.mobile-note{display:none}@media (width<=1080px){.kpis,.qstats{grid-template-columns:repeat(2,1fr)}.grid-2{grid-template-columns:1fr}.detail-grid{grid-template-columns:minmax(0,1fr)}}@media (width<=860px){:root{--sidebar-w:0px}.sidebar{display:none}.app,.set-grid{grid-template-columns:1fr}}