pyocr-toolkit 0.3.0__py3-none-any.whl

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 (57) hide show
  1. pyocr_toolkit/__init__.py +3 -0
  2. pyocr_toolkit/__main__.py +3 -0
  3. pyocr_toolkit/api.py +603 -0
  4. pyocr_toolkit/cli.py +315 -0
  5. pyocr_toolkit/compare.py +142 -0
  6. pyocr_toolkit/config.py +86 -0
  7. pyocr_toolkit/credentials.py +108 -0
  8. pyocr_toolkit/documents.py +326 -0
  9. pyocr_toolkit/env.example +48 -0
  10. pyocr_toolkit/jobs.py +205 -0
  11. pyocr_toolkit/llm/__init__.py +44 -0
  12. pyocr_toolkit/llm/anthropic_provider.py +188 -0
  13. pyocr_toolkit/llm/base.py +126 -0
  14. pyocr_toolkit/llm/catalog.py +337 -0
  15. pyocr_toolkit/llm/gemini_provider.py +98 -0
  16. pyocr_toolkit/llm/openai_provider.py +183 -0
  17. pyocr_toolkit/llm/prompts.py +61 -0
  18. pyocr_toolkit/search.py +88 -0
  19. pyocr_toolkit/service.py +269 -0
  20. pyocr_toolkit/static/common.js +538 -0
  21. pyocr_toolkit/static/compare.js +157 -0
  22. pyocr_toolkit/static/document.js +89 -0
  23. pyocr_toolkit/static/jobs.js +13 -0
  24. pyocr_toolkit/static/library.js +28 -0
  25. pyocr_toolkit/static/models.js +98 -0
  26. pyocr_toolkit/static/providers.js +44 -0
  27. pyocr_toolkit/static/reader.js +78 -0
  28. pyocr_toolkit/static/search.js +34 -0
  29. pyocr_toolkit/static/styles.css +819 -0
  30. pyocr_toolkit/static/workspace.js +420 -0
  31. pyocr_toolkit/static/workspaces.js +81 -0
  32. pyocr_toolkit/templates/_doc_card.html +30 -0
  33. pyocr_toolkit/templates/_doctabs.html +14 -0
  34. pyocr_toolkit/templates/_icons.html +55 -0
  35. pyocr_toolkit/templates/_llm_picker.html +12 -0
  36. pyocr_toolkit/templates/base.html +97 -0
  37. pyocr_toolkit/templates/compare.html +84 -0
  38. pyocr_toolkit/templates/document.html +80 -0
  39. pyocr_toolkit/templates/error.html +11 -0
  40. pyocr_toolkit/templates/help.html +244 -0
  41. pyocr_toolkit/templates/home.html +90 -0
  42. pyocr_toolkit/templates/jobs.html +15 -0
  43. pyocr_toolkit/templates/library.html +44 -0
  44. pyocr_toolkit/templates/models.html +67 -0
  45. pyocr_toolkit/templates/providers.html +104 -0
  46. pyocr_toolkit/templates/reader.html +28 -0
  47. pyocr_toolkit/templates/search.html +22 -0
  48. pyocr_toolkit/templates/workspace.html +109 -0
  49. pyocr_toolkit/templates/workspace_detail.html +42 -0
  50. pyocr_toolkit/templates/workspaces.html +42 -0
  51. pyocr_toolkit/web.py +186 -0
  52. pyocr_toolkit/workspaces.py +330 -0
  53. pyocr_toolkit-0.3.0.dist-info/METADATA +483 -0
  54. pyocr_toolkit-0.3.0.dist-info/RECORD +57 -0
  55. pyocr_toolkit-0.3.0.dist-info/WHEEL +4 -0
  56. pyocr_toolkit-0.3.0.dist-info/entry_points.txt +3 -0
  57. pyocr_toolkit-0.3.0.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,819 @@
1
+ /* ==========================================================================
2
+ pyocr toolkit: design tokens
3
+ --------------------------------------------------------------------------
4
+ Every colour in this file comes from a variable below. The light palette is
5
+ the default; [data-theme="dark"] on <html> swaps in the dark one. A tiny
6
+ script in base.html sets that attribute before the first paint, from the
7
+ user's saved choice or, failing that, the OS preference.
8
+ ========================================================================== */
9
+ :root {
10
+ color-scheme: light;
11
+ --bg: #f7f7f9; /* page background */
12
+ --bg-sunken: #eff0f3; /* recessed areas: page viewer, code, inputs at rest */
13
+ --surface: #ffffff; /* cards, bars, panels */
14
+ --surface-2: #f4f5f7; /* hover / secondary fills inside a surface */
15
+ --border: #e8e9ee; /* hairlines */
16
+ --border-strong: #d7d9e0; /* control outlines */
17
+ --text: #17181c;
18
+ --muted: #646b78;
19
+ --subtle: #9aa0ab;
20
+ --accent: #4f46e5;
21
+ --accent-hover: #4338ca;
22
+ --accent-text: #ffffff;
23
+ --accent-soft: #eef0ff;
24
+ --accent-ring: rgba(79, 70, 229, .22);
25
+ --good: #15803d; --good-soft: #e8f6ed;
26
+ --warn: #b45309; --warn-soft: #fdf3e3;
27
+ --bad: #dc2626; --bad-soft: #fdecec;
28
+ --del-bg: #fde2e2;
29
+ --ins-bg: #d9f3e1;
30
+ --hl: rgba(255, 196, 0, .42);
31
+ --hl-ocr: rgba(80, 160, 255, .32);
32
+ --chart-good: #3b82f6; --chart-warn: #f59e0b; --chart-bad: #b91c1c;
33
+ --info: #1d4ed8; --info-soft: #e8f0fe;
34
+ --src-native: #94a3b8; --src-ocr: #f59e0b; --src-llm: var(--accent);
35
+ --paper-filter: none; /* applied to rendered page images */
36
+ --shadow-sm: 0 1px 2px rgba(16, 18, 27, .04), 0 1px 3px rgba(16, 18, 27, .04);
37
+ --shadow-md: 0 4px 12px rgba(16, 18, 27, .06), 0 1px 3px rgba(16, 18, 27, .05);
38
+ --shadow-lg: 0 12px 32px rgba(16, 18, 27, .12), 0 2px 6px rgba(16, 18, 27, .06);
39
+ --topbar-bg: rgba(255, 255, 255, .82);
40
+
41
+ --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
42
+ --mono: ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, Consolas, monospace;
43
+ --radius-sm: 6px;
44
+ --radius: 10px;
45
+ --radius-lg: 14px;
46
+ --topbar-h: 56px;
47
+ }
48
+
49
+ :root[data-theme="dark"] {
50
+ color-scheme: dark;
51
+ --bg: #0e1014;
52
+ --bg-sunken: #0a0b0e;
53
+ --surface: #16191f;
54
+ --surface-2: #1d2128;
55
+ --border: #252a32;
56
+ --border-strong: #323843;
57
+ --text: #e7e9ed;
58
+ --muted: #99a1ad;
59
+ --subtle: #6c7480;
60
+ --accent: #8b8ff8;
61
+ --accent-hover: #a3a6fa;
62
+ --accent-text: #0e1014;
63
+ --accent-soft: rgba(139, 143, 248, .14);
64
+ --accent-ring: rgba(139, 143, 248, .3);
65
+ --good: #4ade80; --good-soft: rgba(74, 222, 128, .12);
66
+ --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .12);
67
+ --bad: #f87171; --bad-soft: rgba(248, 113, 113, .13);
68
+ --del-bg: rgba(248, 113, 113, .22);
69
+ --ins-bg: rgba(74, 222, 128, .2);
70
+ --hl: rgba(250, 204, 21, .35);
71
+ --hl-ocr: rgba(96, 165, 250, .35);
72
+ --chart-good: #60a5fa; --chart-warn: #fbbf24; --chart-bad: #f87171;
73
+ --info: #93c5fd; --info-soft: rgba(96, 165, 250, .14);
74
+ --src-native: #64748b; --src-ocr: #fbbf24;
75
+ --paper-filter: brightness(.9) contrast(1.02);
76
+ --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
77
+ --shadow-md: 0 4px 14px rgba(0, 0, 0, .35);
78
+ --shadow-lg: 0 14px 36px rgba(0, 0, 0, .5);
79
+ --topbar-bg: rgba(14, 16, 20, .8);
80
+ }
81
+
82
+ /* ==========================================================================
83
+ Base
84
+ ========================================================================== */
85
+ * { box-sizing: border-box; }
86
+ html, body { margin: 0; }
87
+ html { -webkit-text-size-adjust: 100%; }
88
+ body {
89
+ font: 14px/1.55 var(--sans); background: var(--bg); color: var(--text);
90
+ -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
91
+ font-feature-settings: "cv11", "ss01";
92
+ }
93
+ /* Smooth colour change when the theme is toggled (class added briefly by JS). */
94
+ html.theme-switching * { transition: background-color .2s ease, border-color .2s ease, color .2s ease !important; }
95
+ [hidden] { display: none !important; }
96
+ ::selection { background: var(--accent-ring); }
97
+ a { color: var(--accent); text-decoration: none; }
98
+ a:hover { color: var(--accent-hover); }
99
+ h1, h2, h3 { letter-spacing: -.015em; line-height: 1.25; font-weight: 650; }
100
+ h1 { font-size: 24px; margin: 4px 0 14px; }
101
+ h2 { font-size: 17px; margin: 28px 0 12px; }
102
+ h3 { font-size: 14px; margin: 18px 0 8px; }
103
+ p { margin: 0 0 12px; }
104
+ code, kbd {
105
+ font-family: var(--mono); font-size: .86em; background: var(--surface-2);
106
+ border-radius: 5px; padding: 1px 5px; color: var(--text);
107
+ }
108
+ kbd { border: 1px solid var(--border-strong); border-bottom-width: 2px; padding: 0 5px; font-size: 11px; }
109
+ .small { font-size: 12.5px; }
110
+ .muted { color: var(--muted); }
111
+ .mono { font-family: var(--mono); }
112
+ .good { color: var(--good); } .warn { color: var(--warn); } .bad, .err { color: var(--bad); }
113
+ .spacer { flex: 1; }
114
+ .grow { flex: 1; }
115
+ .nowrap { white-space: nowrap; }
116
+ .lead { font-size: 15px; color: var(--muted); max-width: 720px; }
117
+ .hint { font-size: 12.5px; color: var(--muted); margin: -4px 0 16px; }
118
+ .icon { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
119
+
120
+ /* scrollbars that follow the theme */
121
+ * { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
122
+ ::-webkit-scrollbar { width: 10px; height: 10px; }
123
+ ::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
124
+ ::-webkit-scrollbar-track { background: transparent; }
125
+
126
+ /* ==========================================================================
127
+ Controls
128
+ ========================================================================== */
129
+ select, input[type=search], input:not([type]), input[list], input[type=text], input[type=password], textarea {
130
+ font: inherit; font-size: 13.5px; color: var(--text); background: var(--surface);
131
+ border: 1px solid var(--border-strong); border-radius: 8px; padding: 6px 10px; min-width: 0; height: 34px;
132
+ transition: border-color .15s, box-shadow .15s;
133
+ }
134
+ textarea { width: 100%; height: auto; font-family: var(--mono); font-size: 12px; line-height: 1.5; }
135
+ select { padding-right: 28px; appearance: none; cursor: pointer;
136
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
137
+ background-repeat: no-repeat; background-position: right 9px center; }
138
+ select:hover, input:hover, textarea:hover { border-color: var(--subtle); }
139
+ select:focus, input:focus, textarea:focus, .btn:focus-visible, a:focus-visible, button:focus-visible, summary:focus-visible {
140
+ outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring);
141
+ }
142
+ ::placeholder { color: var(--subtle); }
143
+ input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
144
+
145
+ .btn {
146
+ display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 13.5px; font-weight: 500;
147
+ cursor: pointer; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
148
+ border-radius: 8px; padding: 0 14px; height: 34px; white-space: nowrap; text-decoration: none !important;
149
+ box-shadow: var(--shadow-sm); transition: background .15s, border-color .15s, color .15s, box-shadow .15s; vertical-align: middle;
150
+ }
151
+ .btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
152
+ .btn:disabled { opacity: .45; cursor: not-allowed; }
153
+ .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
154
+ .btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-text); }
155
+ .btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
156
+ .btn.ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
157
+ .btn.danger { color: var(--bad); }
158
+ .btn.danger:hover:not(:disabled) { background: var(--bad-soft); color: var(--bad); }
159
+ .btn.small { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
160
+ .btn.icon-only { width: 34px; padding: 0; }
161
+ .btn.small.icon-only { width: 28px; }
162
+ .link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font: inherit; }
163
+ .link:hover { color: var(--accent-hover); text-decoration: underline; }
164
+ label.check, .form > label.check { display: inline-flex; flex-direction: row; gap: 7px; align-items: center; cursor: pointer; font-size: 13px; color: var(--muted); }
165
+ label.check:hover { color: var(--text); }
166
+
167
+ /* progress bars: thin rounded tracks instead of the native widget */
168
+ progress { appearance: none; -webkit-appearance: none; height: 6px; border: 0; border-radius: 99px; background: var(--surface-2); overflow: hidden; vertical-align: middle; }
169
+ progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 99px; }
170
+ progress::-webkit-progress-value { background: var(--accent); border-radius: 99px; transition: width .3s; }
171
+ progress::-moz-progress-bar { background: var(--accent); border-radius: 99px; }
172
+
173
+ /* segmented control built from radio labels */
174
+ .seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: 9px; align-self: flex-start; }
175
+ .seg label { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--muted); transition: background .15s, color .15s; }
176
+ .seg label:hover { color: var(--text); }
177
+ .seg input { position: absolute; opacity: 0; pointer-events: none; }
178
+ .seg label:has(input:checked) { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
179
+ .seg label:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--accent-ring); }
180
+
181
+ /* ==========================================================================
182
+ Top bar
183
+ ========================================================================== */
184
+ .topbar {
185
+ display: flex; align-items: center; gap: 12px; padding: 0 20px; height: var(--topbar-h);
186
+ position: sticky; top: 0; z-index: 20; background: var(--topbar-bg);
187
+ backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
188
+ border-bottom: 1px solid var(--border);
189
+ }
190
+ .brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; color: var(--text); margin-right: 12px; letter-spacing: -.01em; }
191
+ .brand:hover { color: var(--text); }
192
+ .brand .logo { width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg, var(--accent), #8b5cf6); display: grid; place-items: center; color: #fff; }
193
+ .brand .logo .icon { width: 15px; height: 15px; stroke-width: 2.2; }
194
+ .brand span { color: var(--subtle); font-weight: 500; }
195
+ .mainnav { display: flex; gap: 2px; }
196
+ .mainnav a { color: var(--muted); padding: 6px 11px; border-radius: 7px; font-size: 13.5px; font-weight: 500; transition: color .15s, background .15s; }
197
+ .mainnav a:hover { color: var(--text); background: var(--surface-2); }
198
+ .mainnav a.active { color: var(--text); background: var(--surface-2); }
199
+ .quicksearch { position: relative; }
200
+ .quicksearch .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--subtle); pointer-events: none; width: 15px; height: 15px; }
201
+ .quicksearch input { width: 240px; padding-left: 32px; background: var(--surface-2); border-color: transparent; }
202
+ .quicksearch input:focus { background: var(--surface); }
203
+ .theme-toggle .icon { width: 17px; height: 17px; }
204
+ .theme-toggle [data-icon] { display: none; }
205
+ .theme-toggle [data-icon] .icon { display: block; }
206
+ :root[data-theme-pref="light"] .theme-toggle [data-icon="light"],
207
+ :root[data-theme-pref="dark"] .theme-toggle [data-icon="dark"],
208
+ :root[data-theme-pref="system"] .theme-toggle [data-icon="system"] { display: flex; }
209
+
210
+ /* ==========================================================================
211
+ Document header / tabs
212
+ ========================================================================== */
213
+ .doc-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 14px 20px 0; }
214
+ .doc-title { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 14px; }
215
+ .doc-title b { max-width: 50vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
216
+ .doc-title .muted { font-size: 12.5px; margin-left: 4px; }
217
+ .doc-title .sep { color: var(--subtle); }
218
+ .crumb { color: var(--muted); }
219
+ .crumb:hover { color: var(--text); }
220
+ .doc-tabs { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
221
+ .doc-tabs a { padding: 8px 4px; margin-right: 14px; color: var(--muted); font-size: 13.5px; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s; }
222
+ .doc-tabs a:hover { color: var(--text); }
223
+ .doc-tabs a.active { color: var(--text); border-bottom-color: var(--accent); }
224
+
225
+ /* ==========================================================================
226
+ Site pages
227
+ ========================================================================== */
228
+ .container { max-width: 1180px; margin: 0 auto; padding: 32px 24px 48px; }
229
+ .footer { text-align: center; color: var(--subtle); font-size: 12px; padding: 24px; }
230
+ .footer a { color: var(--muted); }
231
+ .footer a:hover { color: var(--text); }
232
+ .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
233
+ .card h2:first-child, .card h3:first-child { margin-top: 0; }
234
+ .card > h2:first-child { font-size: 15px; margin-bottom: 4px; }
235
+ .section-head { display: flex; align-items: baseline; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
236
+ .section-head h1, .section-head h2, .section-head h3 { margin-bottom: 12px; }
237
+ .page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
238
+ .page-head h1 { margin: 0 0 4px; }
239
+ .page-head p { margin: 0; color: var(--muted); font-size: 13.5px; max-width: 680px; }
240
+ .grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
241
+ .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
242
+ .toolbar { display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap; margin: 4px 0 14px; }
243
+ .toolbar > label:not(.check) { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
244
+ .toolbar.sticky { position: sticky; top: var(--topbar-h); background: var(--bg); padding: 12px 0; z-index: 5; border-bottom: 1px solid var(--border); }
245
+ .callout { border: 1px solid transparent; background: var(--accent-soft); color: var(--text); padding: 11px 14px; border-radius: var(--radius); margin: 14px 0; font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; }
246
+ .callout.warn { background: var(--warn-soft); }
247
+ .callout .icon { margin-top: 2px; color: var(--accent); }
248
+ .callout.warn .icon { color: var(--warn); }
249
+ .empty { max-width: 460px; margin: 12vh auto; text-align: center; color: var(--muted); }
250
+ .empty h1, .empty h2 { color: var(--text); margin-top: 12px; }
251
+ .empty .empty-icon { width: 52px; height: 52px; margin: 0 auto; border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
252
+ .empty .empty-icon .icon { width: 24px; height: 24px; }
253
+ pre.code { background: var(--bg-sunken); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; overflow: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; }
254
+
255
+ /* ---- home ---- */
256
+ .hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: center; margin: 12px 0 32px; }
257
+ .hero h1 { font-size: 34px; line-height: 1.15; letter-spacing: -.03em; font-weight: 700; margin-bottom: 14px; }
258
+ .hero h1 em { font-style: normal; color: var(--accent); }
259
+ .hero .lead b { color: var(--text); font-weight: 600; }
260
+ .dropzone {
261
+ display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center;
262
+ min-height: 210px; border: 1.5px dashed var(--border-strong); border-radius: 18px; background: var(--surface);
263
+ cursor: pointer; padding: 24px; transition: border-color .15s, background .15s;
264
+ }
265
+ .dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
266
+ .dropzone b { font-weight: 600; font-size: 14.5px; }
267
+ .dropzone .small { color: var(--muted); }
268
+ .dz-icon { width: 46px; height: 46px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 8px; }
269
+ .dz-icon .icon { width: 22px; height: 22px; }
270
+ .status-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 8px; }
271
+ .stat { color: var(--text); margin: 0; display: flex; align-items: center; gap: 14px; padding: 16px 18px; transition: border-color .15s, box-shadow .15s; }
272
+ .stat:hover { color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
273
+ .stat .stat-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); flex: none; }
274
+ .stat .v { font-size: 20px; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; }
275
+ .stat .k { color: var(--muted); font-size: 12.5px; }
276
+ .steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
277
+ .steps li { display: flex; flex-direction: column; gap: 4px; }
278
+ .steps b { font-weight: 600; }
279
+ .steps span { color: var(--muted); font-size: 13px; }
280
+ .doc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
281
+ .doc-card { display: flex; gap: 14px; color: var(--text); margin: 0; padding: 14px; transition: border-color .15s, box-shadow .15s; }
282
+ .doc-card:hover { color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
283
+ .doc-card > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
284
+ .doc-card img { width: 56px; height: 74px; object-fit: cover; object-position: top; border-radius: 5px; border: 1px solid var(--border); background: #fff; filter: var(--paper-filter); flex: none; }
285
+ .doc-card b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
286
+ .doc-card .small { color: var(--muted); }
287
+
288
+ /* ---- tables ---- */
289
+ .table { width: 100%; border-collapse: collapse; }
290
+ .table th { text-align: left; font-size: 11.5px; color: var(--subtle); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding-top: 0; }
291
+ .table th, .table td { border-bottom: 1px solid var(--border); padding: 10px 10px; vertical-align: middle; }
292
+ .table tr:last-child td { border-bottom: 0; }
293
+ .table.compact td, .table.compact th { padding: 8px 8px; }
294
+ .table td.actions { white-space: nowrap; text-align: right; }
295
+ .table td.actions > * { margin-left: 2px; }
296
+ .table tbody tr { transition: background .12s; }
297
+ .table tr.clickable { cursor: pointer; }
298
+ .table tr.clickable:hover td, .table.hover tbody tr:hover td { background: var(--surface-2); }
299
+ .table .thumb { width: 34px; height: 44px; object-fit: cover; object-position: top; border-radius: 4px; border: 1px solid var(--border); background: #fff; filter: var(--paper-filter); display: block; }
300
+ .table .file-name { color: var(--text); font-weight: 600; }
301
+ .table .file-name:hover { color: var(--accent); }
302
+ .table .meter { display: inline-flex; align-items: center; gap: 8px; }
303
+ .table progress { width: 64px; }
304
+ .table-card { padding: 6px 8px; }
305
+ .table-card:has(> table[hidden]) { display: none; }
306
+ .table-card .table th { padding-top: 12px; }
307
+ .diff-row td { background: var(--bg-sunken); }
308
+ .diff-row pre { max-height: 50vh; }
309
+
310
+ /* ---- dropdown menus built from <details> ---- */
311
+ details.menu { position: relative; display: inline-block; }
312
+ details.menu > summary { list-style: none; }
313
+ details.menu > summary::-webkit-details-marker { display: none; }
314
+ details.menu > div { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 5px; min-width: 200px; display: flex; flex-direction: column; text-align: left; }
315
+ details.menu > div a { padding: 7px 10px; border-radius: 6px; color: var(--text); font-size: 13px; }
316
+ details.menu > div a:hover { background: var(--surface-2); color: var(--text); }
317
+ details.meta { margin-top: 16px; font-size: 12.5px; }
318
+ details.meta summary { cursor: pointer; color: var(--muted); }
319
+ details.meta summary:hover { color: var(--text); }
320
+ details.meta dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 10px 0 0; }
321
+ details.meta dt { color: var(--muted); }
322
+ details.meta dd { margin: 0; word-break: break-word; }
323
+
324
+ /* ---- forms ---- */
325
+ .form { display: flex; flex-direction: column; gap: 14px; }
326
+ .form > label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
327
+ .form > label > input, .form > label > select { color: var(--text); font-weight: 400; }
328
+ .llm-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
329
+ .llm-picker label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
330
+ .llm-picker label:last-of-type { grid-column: 1 / -1; }
331
+ .llm-picker select, .llm-picker input { color: var(--text); font-weight: 400; width: 100%; }
332
+ .llm-picker .custom-prompt, .llm-picker .picker-status { grid-column: 1 / -1; }
333
+ .llm-picker .picker-status:empty { display: none; }
334
+ .llm-picker .custom-prompt summary { cursor: pointer; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
335
+
336
+ /* ---- badges: soft fills, no outlines ---- */
337
+ .badges { display: flex; flex-wrap: wrap; gap: 4px; }
338
+ .badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 500; line-height: 1; padding: 4px 7px; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
339
+ .badge.scan { color: var(--warn); background: var(--warn-soft); }
340
+ .badge.ok { color: var(--good); background: var(--good-soft); }
341
+ .badge.run { color: var(--accent); background: var(--accent-soft); }
342
+ /* model ratings (llm/catalog.py) */
343
+ .badge.excellent { color: var(--surface); background: var(--good); }
344
+ .badge.fair { color: var(--info); background: var(--info-soft); }
345
+ .badge.bad { color: var(--bad); background: var(--bad-soft); }
346
+ .badge.hit { color: var(--text); background: var(--hl); }
347
+ .badge.info { color: var(--info); background: var(--info-soft); }
348
+ .badge.bad { color: var(--bad); background: var(--bad-soft); }
349
+
350
+ /* ---- page grid ---- */
351
+ .page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }
352
+ .page-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; color: var(--text); display: flex; flex-direction: column; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s; }
353
+ .page-tile:hover { color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }
354
+ .page-tile img { width: 100%; aspect-ratio: .75; object-fit: cover; object-position: top; background: #fff; filter: var(--paper-filter); border-bottom: 1px solid var(--border); }
355
+ .tile-foot { display: flex; gap: 4px; align-items: center; padding: 7px 9px; flex-wrap: wrap; }
356
+ .tile-foot b { font-size: 12.5px; margin-right: auto; font-weight: 600; }
357
+ .legend-inline { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
358
+ .legend-inline > span { display: inline-flex; gap: 6px; align-items: center; }
359
+
360
+ /* ---- jobs ---- */
361
+ .job-list { display: flex; flex-direction: column; gap: 10px; }
362
+ .job { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: var(--surface); }
363
+ .job-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; font-size: 13.5px; }
364
+ /* Job bar: successful pages in the accent colour, failed pages in red after them. */
365
+ .jobbar { display: flex; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
366
+ .jobbar > span { height: 100%; transition: width .3s; }
367
+ .jobbar-ok { background: var(--accent); }
368
+ .jobbar-fail { background: var(--bad); }
369
+ .cost { cursor: help; border-bottom: 1px dotted var(--subtle); }
370
+ .job > .small { color: var(--muted); margin-top: 6px; }
371
+
372
+ /* ---- metrics / compare ---- */
373
+ .metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 12px 0; }
374
+ .metrics:empty { display: none; }
375
+ .metric { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; background: var(--surface); }
376
+ .metric .v { font-size: 20px; font-weight: 650; letter-spacing: -.02em; }
377
+ .metric .k { font-size: 11px; color: var(--subtle); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
378
+ .v.good { color: var(--good); } .v.warn { color: var(--warn); } .v.bad { color: var(--bad); }
379
+ .bar-chart { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
380
+ .bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; margin-top: 14px; }
381
+ .bar { flex: 1; min-width: 3px; max-width: 32px; background: var(--subtle); border: 0; padding: 0; border-radius: 4px 4px 0 0; opacity: .8; transition: opacity .15s, transform .15s; cursor: pointer; }
382
+ .bar:hover { opacity: 1; }
383
+ .bar.selected { opacity: 1; outline: 2px solid var(--text); outline-offset: 2px; }
384
+ .bar.good { background: var(--chart-good); } .bar.warn { background: var(--chart-warn); } .bar.bad { background: var(--chart-bad); }
385
+ .bar.missing { background: repeating-linear-gradient(45deg, var(--border-strong), var(--border-strong) 2px, transparent 2px, transparent 5px); height: 100%; opacity: .5; }
386
+ .legend { display: flex; gap: 12px; font-size: 12px; flex-wrap: wrap; align-items: center; }
387
+ .legend span, .diff span { border-radius: 3px; padding: 0 2px; }
388
+ .del { background: var(--del-bg); text-decoration: line-through; text-decoration-color: var(--bad); }
389
+ .ins { background: var(--ins-bg); }
390
+ .rep s { background: var(--del-bg); text-decoration-color: var(--bad); }
391
+ .rep ins { background: var(--ins-bg); text-decoration: none; }
392
+ .hl-native { background: var(--hl); padding: 0 3px; }
393
+ .hl-ocr { background: var(--hl-ocr); padding: 0 3px; }
394
+
395
+ pre.text {
396
+ margin: 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); overflow: auto;
397
+ background: var(--bg-sunken); font-family: var(--mono); font-size: 12.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word;
398
+ }
399
+ pre.text mark, .sr-hit mark { background: var(--hl); color: inherit; border-radius: 2px; }
400
+ pre.text:empty::before { content: attr(data-empty); color: var(--subtle); font-family: var(--sans); }
401
+
402
+ /* ---- reader ---- */
403
+ .reader-pages { display: flex; flex-direction: column; gap: 16px; margin-top: 12px; }
404
+ .reader-page { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 22px 20px; box-shadow: var(--shadow-sm); scroll-margin-top: calc(var(--topbar-h) + 70px); }
405
+ .reader-page-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
406
+ .reader-page-head a { color: var(--text); }
407
+ .reader-page-head a:hover { color: var(--accent); }
408
+ .reader-page-body { display: grid; grid-template-columns: 1fr; gap: 18px; }
409
+ .reader-page.with-image .reader-page-body { grid-template-columns: minmax(200px, 38%) 1fr; }
410
+ .reader-page img { width: 100%; max-height: 75vh; object-fit: contain; object-position: top; border: 1px solid var(--border); border-radius: 6px; background: #fff; filter: var(--paper-filter); }
411
+ .reader-page pre.text { background: transparent; border: 0; padding: 0; font-size: 13px; }
412
+ #reader-summary { color: var(--muted); }
413
+ .missing { color: var(--muted); font-style: italic; }
414
+
415
+ /* ---- search page ---- */
416
+ .search-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
417
+ .search-bar input[type=search] { height: 42px; font-size: 15px; padding-left: 14px; flex: 1; min-width: 260px; border-radius: 10px; }
418
+ .search-bar .btn { height: 42px; padding: 0 18px; border-radius: 10px; }
419
+ .chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
420
+ .chips label { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--border-strong); color: var(--muted); cursor: pointer; user-select: none; transition: all .15s; }
421
+ .chips label:hover { color: var(--text); }
422
+ .chips label input { position: absolute; opacity: 0; pointer-events: none; }
423
+ .chips label:has(input:checked) { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
424
+ .chips label:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--accent-ring); }
425
+ .chips .count { opacity: .65; font-variant-numeric: tabular-nums; }
426
+
427
+ /* ---- diff studio (document compare) ---- */
428
+ .src-pick { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; margin-bottom: 18px; }
429
+ .src-card { flex: 1 1 300px; display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 16px; box-shadow: var(--shadow-sm); cursor: pointer; }
430
+ .src-card:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
431
+ .src-letter { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; flex: none; }
432
+ .src-letter.a { background: var(--accent-soft); color: var(--accent); }
433
+ .src-letter.b { background: var(--warn-soft); color: var(--warn); }
434
+ .src-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
435
+ .src-k { font-size: 11px; color: var(--subtle); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
436
+ .src-card select { border: 0; background-color: transparent; padding: 0 28px 0 0; height: 28px; line-height: 28px; font-weight: 600; font-size: 14px; box-shadow: none; width: 100%; }
437
+ .chart-note { margin: 10px 0 0; font-size: 13px; color: var(--good); }
438
+ .swap-btn { height: auto; width: 44px; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; }
439
+ .run-btn { height: auto; min-height: 44px; padding: 0 22px; border-radius: 12px; }
440
+ .stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
441
+ .stat-grid:empty { display: none; }
442
+ .stat-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow-sm); }
443
+ .stat-tile .k { font-size: 11px; color: var(--subtle); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
444
+ .stat-tile .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.3; }
445
+ .stat-tile .v small { font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
446
+ .stat-tile .v .link { font: inherit; color: inherit; }
447
+ .chart-card .section-head h3 { margin: 0; }
448
+ .swatch { display: inline-block; width: 9px; height: 9px; border-radius: 2px; }
449
+ .swatch.good { background: var(--chart-good); } .swatch.warn { background: var(--chart-warn); } .swatch.bad { background: var(--chart-bad); }
450
+ .swatch.missing { background: repeating-linear-gradient(45deg, var(--border-strong), var(--border-strong) 2px, transparent 2px, transparent 4px); }
451
+ .diff-card { padding: 0; overflow: hidden; }
452
+ .diff-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
453
+ .diff-head b { font-weight: 600; min-width: 64px; text-align: center; }
454
+ .diff-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
455
+ .diff-cols > div { padding: 14px 18px 18px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
456
+ .diff-cols > div + div { border-left: 1px solid var(--border); }
457
+ .diff-cols pre.text { background: transparent; border: 0; padding: 0; max-height: 62vh; font-size: 12.5px; line-height: 1.75; }
458
+ .del-mark { background: var(--del-bg); border-radius: 3px; padding: 0 2px; }
459
+ .ins-mark { background: var(--ins-bg); border-radius: 3px; padding: 0 2px; }
460
+ .table-details { padding: 0; }
461
+ .table-details > summary { padding: 14px 18px; cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--muted); }
462
+ .table-details > summary:hover { color: var(--text); }
463
+ .table-details[open] > summary { border-bottom: 1px solid var(--border); }
464
+ .table-details .table { margin: 0; }
465
+ .table-details .table th:first-child, .table-details .table td:first-child { padding-left: 18px; }
466
+
467
+ /* ---- library cards ---- */
468
+ .lib-chips { margin: -4px 0 18px; }
469
+ .lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
470
+ .lib-card { margin: 0; padding: 0; overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s, box-shadow .15s; }
471
+ .lib-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
472
+ .lib-thumb { position: relative; height: 136px; background: var(--bg-sunken); display: flex; justify-content: center; align-items: flex-end; padding-top: 18px; overflow: hidden; }
473
+ .lib-thumb img { width: 124px; height: 100%; object-fit: cover; object-position: top; border-radius: 3px 3px 0 0; box-shadow: var(--shadow-md); background: #fff; filter: var(--paper-filter); transition: transform .2s; }
474
+ .lib-card:hover .lib-thumb img { transform: translateY(-3px); }
475
+ .lib-thumb .badge { position: absolute; top: 10px; left: 10px; }
476
+ .lib-body { padding: 14px 16px 10px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
477
+ .lib-body .file-name { font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
478
+ .lib-body .file-name:hover { color: var(--accent); }
479
+ .coverage { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 6px; }
480
+ .cov { display: grid; grid-template-columns: 1fr auto; gap: 4px 6px; font-size: 11.5px; }
481
+ .cov-k { color: var(--muted); font-weight: 500; }
482
+ .cov-v { color: var(--muted); font-variant-numeric: tabular-nums; }
483
+ .cov-bar { grid-column: 1 / -1; height: 5px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
484
+ .cov-bar i { display: block; height: 100%; border-radius: 99px; }
485
+ .cov.native .cov-bar i { background: var(--src-native); }
486
+ .cov.ocr .cov-bar i { background: var(--src-ocr); }
487
+ .cov.llm .cov-bar i { background: var(--src-llm); }
488
+ .lib-actions { display: flex; gap: 2px; align-items: center; margin: 6px -6px 0; padding-top: 8px; border-top: 1px solid var(--border); }
489
+ .search-doc { padding: 0; overflow: hidden; }
490
+ .search-doc .section-head { padding: 14px 18px; }
491
+ .search-doc .section-head b { font-weight: 600; }
492
+ .search-doc .section-head h1, .search-doc .section-head h2 { margin: 0; }
493
+ .search-doc .sr-page { display: block; color: var(--text); border-top: 1px solid var(--border); padding: 10px 18px; }
494
+ .search-doc .sr-page:hover { color: var(--text); background: var(--surface-2); }
495
+
496
+ /* ---- providers ---- */
497
+ .provider-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(460px, 100%), 1fr)); gap: 0 18px; }
498
+ /* Providers: in-browser settings form */
499
+ .cred-edit { margin: 4px 0 12px; }
500
+ .cred-edit > summary { cursor: pointer; font-size: 13px; color: var(--accent); }
501
+ .cred-edit form { display: grid; gap: 10px; margin-top: 10px; padding: 12px; border-radius: var(--radius-sm);
502
+ background: var(--bg-sunken); border: 1px solid var(--border); }
503
+ .cred-field { display: grid; gap: 4px; }
504
+ .cred-field > label { font-size: 12.5px; }
505
+ .cred-field input[type=text], .cred-field input[type=password] { width: 100%; }
506
+ .cred-reset { display: flex; align-items: center; gap: 6px; color: var(--muted); }
507
+ .model-verdict, .picker-verdict { margin-top: 6px; line-height: 1.6; }
508
+ .picker-verdict:empty, .model-verdict:empty { display: none; }
509
+ /* Models page */
510
+ .model-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
511
+ .model-filters input[type=search] { min-width: min(320px, 100%); }
512
+ .models-table td { vertical-align: top; }
513
+ .table-wrap { overflow-x: auto; }
514
+ .provider { display: flex; flex-direction: column; }
515
+ .provider h3 { margin: 0 0 8px; font-size: 14.5px; }
516
+ .provider .env { margin-bottom: auto; }
517
+ .provider .env td { font-size: 12.5px; }
518
+ .provider .env td:first-child { white-space: nowrap; }
519
+ .provider .env td:last-child { color: var(--muted); overflow-wrap: anywhere; }
520
+ .provider .row { padding-top: 14px; border-top: 1px solid var(--border); }
521
+ .provider [data-test-result]:not(:empty) { margin-top: 8px; }
522
+
523
+ /* ---- help ---- */
524
+ .help { display: grid; grid-template-columns: 200px 1fr; gap: 40px; }
525
+ .toc { position: sticky; top: calc(var(--topbar-h) + 24px); align-self: start; display: flex; flex-direction: column; gap: 1px; font-size: 13px; }
526
+ .toc b { margin-bottom: 8px; font-size: 11.5px; color: var(--subtle); text-transform: uppercase; letter-spacing: .05em; }
527
+ .toc a { color: var(--muted); padding: 4px 10px; border-radius: 6px; border-left: 2px solid transparent; }
528
+ .toc a:hover { color: var(--text); background: var(--surface-2); }
529
+ .help article { max-width: 780px; line-height: 1.7; }
530
+ .help article h2 { border-top: 1px solid var(--border); padding-top: 26px; margin-top: 34px; font-size: 19px; }
531
+ .help article li { margin-bottom: 4px; }
532
+ .help h2[id], .help h3 { scroll-margin-top: calc(var(--topbar-h) + 16px); }
533
+ .defs dt { font-weight: 600; margin-top: 10px; }
534
+ .defs dd { margin: 2px 0 0 0; color: var(--muted); }
535
+
536
+ /* ==========================================================================
537
+ Page inspector (full-height app)
538
+ ========================================================================== */
539
+ body.app { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
540
+ body.app .topbar { position: static; }
541
+ #workspace { flex: 1; display: grid; grid-template-columns: 230px minmax(300px, 1fr) minmax(380px, 1fr); min-height: 0; }
542
+ #workspace.side { grid-template-columns: 200px minmax(260px, .7fr) minmax(620px, 1.8fr); }
543
+ #workspace.side #page-badges, #workspace.side .badges-sep { display: none; }
544
+ #workspace.side .viewer-toolbar { flex-wrap: nowrap; overflow: hidden; }
545
+ .side-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
546
+ .side-col { display: flex; flex-direction: column; gap: 6px; min-height: 0; min-width: 0; }
547
+ .side-head { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; padding: 0 2px; }
548
+ .side-head b { font-weight: 600; }
549
+ .side-head span { color: var(--subtle); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
550
+ .side-col pre.text { flex: 1; min-height: 120px; font-size: 12px; padding: 12px; }
551
+ .sidebar { border-right: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
552
+ .viewer { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg-sunken); }
553
+ .panel { border-left: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; min-width: 0; min-height: 0; }
554
+ .search { padding: 12px; border-bottom: 1px solid var(--border); }
555
+ .search input[type=search] { width: 100%; }
556
+ .search-sources { display: flex; gap: 4px; margin-top: 8px; }
557
+ .search-sources label { flex: 1; justify-content: center; padding: 3px 0; font-size: 11.5px; }
558
+ #search-results { max-height: 45%; overflow: auto; border-bottom: 1px solid var(--border); font-size: 12px; }
559
+ .sr-summary { padding: 8px 12px; color: var(--muted); }
560
+ .sr-page { padding: 8px 12px; border-top: 1px solid var(--border); cursor: pointer; }
561
+ .sr-page:hover { background: var(--surface-2); }
562
+ .sr-hit { margin-top: 4px; font-size: 12px; color: var(--muted); }
563
+ .sr-hit > div { color: var(--text); }
564
+ .sr-hit .src { font-size: 10px; text-transform: uppercase; color: var(--subtle); letter-spacing: .05em; font-weight: 600; }
565
+ .pages { list-style: none; margin: 0; padding: 8px; overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 2px; }
566
+ .pages li { display: flex; gap: 10px; align-items: center; padding: 6px; border-radius: 8px; cursor: pointer; transition: background .12s; }
567
+ .pages li:hover { background: var(--surface-2); }
568
+ .pages li.active { background: var(--accent-soft); }
569
+ .pages li.active b { color: var(--accent); }
570
+ .pages img { width: 46px; border-radius: 4px; border: 1px solid var(--border); background: #fff; filter: var(--paper-filter); }
571
+ .pages .pinfo { font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
572
+ .pages .pinfo b { font-weight: 600; }
573
+ .viewer-toolbar { display: flex; align-items: center; gap: 4px; padding: 0 10px; height: 46px; border-bottom: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
574
+ .viewer-toolbar .btn { box-shadow: none; }
575
+ .viewer-toolbar .sep { width: 1px; height: 18px; background: var(--border); margin: 0 6px; }
576
+ #page-label, #zoom-label { font-size: 12.5px; min-width: 52px; text-align: center; font-variant-numeric: tabular-nums; color: var(--muted); }
577
+ #page-badges { display: inline-flex; gap: 4px; }
578
+ .page-scroll { flex: 1; overflow: auto; padding: 24px; }
579
+ .page-frame { position: relative; margin: 0 auto; box-shadow: var(--shadow-lg); background: #fff; border-radius: 2px; }
580
+ .page-frame img { display: block; width: 100%; height: auto; filter: var(--paper-filter); }
581
+ #highlight-layer { position: absolute; inset: 0; pointer-events: none; }
582
+ #highlight-layer div { position: absolute; background: var(--hl); outline: 1px solid rgba(230, 150, 0, .9); border-radius: 2px; }
583
+ #highlight-layer div.ocr { background: var(--hl-ocr); outline-color: rgba(40, 110, 230, .9); }
584
+ .tabs { display: flex; gap: 2px; padding: 7px 10px; height: 46px; align-items: center; border-bottom: 1px solid var(--border); }
585
+ .tabs button { flex: 1; border: 0; background: none; color: var(--muted); padding: 6px 4px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 500; border-radius: 7px; transition: background .15s, color .15s; }
586
+ .tabs button:hover { color: var(--text); background: var(--surface-2); }
587
+ .tabs button.active { color: var(--text); background: var(--surface-2); }
588
+ .tab-body { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 14px; gap: 10px; overflow: auto; }
589
+ .tab-body > pre.text { flex: 1; min-height: 120px; }
590
+ .tab-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; }
591
+ .tab-meta label.grow { display: flex; gap: 8px; align-items: center; }
592
+ .tab-meta select { flex: 1; font-size: 12.5px; min-width: 0; height: 30px; }
593
+ .compare-controls { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; font-size: 12.5px; color: var(--muted); }
594
+ .compare-controls > label { display: inline-flex; align-items: center; gap: 6px; }
595
+ .compare-controls select { max-width: 220px; height: 30px; font-size: 12.5px; }
596
+
597
+ #drop-overlay { position: fixed; inset: 0; background: color-mix(in srgb, var(--accent) 14%, transparent); backdrop-filter: blur(3px); border: 2px dashed var(--accent); border-radius: 16px; margin: 10px; z-index: 50; display: grid; place-items: center; font-size: 20px; font-weight: 600; color: var(--accent); }
598
+ #toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px; z-index: 60; max-width: 80vw; font-size: 13.5px; box-shadow: var(--shadow-lg); animation: toast-in .2s ease; }
599
+ #toast.error { background: var(--bad); color: #fff; }
600
+ @keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }
601
+
602
+ /* ==========================================================================
603
+ Motion
604
+ --------------------------------------------------------------------------
605
+ Small, quick animations that explain what changed: content settles in,
606
+ controls respond to presses, and anything waiting on a model "breathes"
607
+ until the answer arrives. Everything here is switched off by the
608
+ prefers-reduced-motion rule at the bottom of the file.
609
+ ========================================================================== */
610
+ :root {
611
+ --ease-out: cubic-bezier(.2, .8, .3, 1); /* fast start, soft landing */
612
+ --ai-grad: linear-gradient(110deg, var(--accent), #a855f7, #06b6d4, var(--accent));
613
+ }
614
+ :root[data-theme="dark"] { --ai-grad: linear-gradient(110deg, var(--accent), #c084fc, #22d3ee, var(--accent)); }
615
+
616
+ @keyframes rise { from { opacity: 0; transform: translateY(6px); } }
617
+ @keyframes fade { from { opacity: 0; } }
618
+ @keyframes spin { to { transform: rotate(360deg); } }
619
+ @keyframes pulse-dot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
620
+ @keyframes flow { to { background-position: 200% 0; } }
621
+ @keyframes shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }
622
+ @keyframes scan { from { background-position: 0 -40%; } to { background-position: 0 140%; } }
623
+ @keyframes glow { 0%, 100% { box-shadow: var(--shadow-lg), 0 0 0 1px var(--accent-ring); } 50% { box-shadow: var(--shadow-lg), 0 0 0 4px var(--accent-ring); } }
624
+ @keyframes materialize { from { opacity: 0; filter: blur(3px); transform: translateY(4px); } }
625
+
626
+ /* Page content settles in on load (not the workspace: it is an app shell). */
627
+ main.container { animation: rise .35s var(--ease-out) backwards; }
628
+ .empty { animation: rise .45s var(--ease-out) backwards; }
629
+
630
+ /* Card grids cascade in, ~30 ms apart, capped so long lists don't drag. */
631
+ .stat, .doc-card, .lib-card, .page-tile, .provider-grid > * { animation: rise .4s var(--ease-out) backwards; animation-delay: calc(var(--i, 10) * 30ms); }
632
+ :is(.stat, .doc-card, .lib-card, .page-tile, .provider-grid > *):nth-child(1) { --i: 0; }
633
+ :is(.stat, .doc-card, .lib-card, .page-tile, .provider-grid > *):nth-child(2) { --i: 1; }
634
+ :is(.stat, .doc-card, .lib-card, .page-tile, .provider-grid > *):nth-child(3) { --i: 2; }
635
+ :is(.stat, .doc-card, .lib-card, .page-tile, .provider-grid > *):nth-child(4) { --i: 3; }
636
+ :is(.stat, .doc-card, .lib-card, .page-tile, .provider-grid > *):nth-child(5) { --i: 4; }
637
+ :is(.stat, .doc-card, .lib-card, .page-tile, .provider-grid > *):nth-child(6) { --i: 5; }
638
+ :is(.stat, .doc-card, .lib-card, .page-tile, .provider-grid > *):nth-child(7) { --i: 6; }
639
+ :is(.stat, .doc-card, .lib-card, .page-tile, .provider-grid > *):nth-child(8) { --i: 7; }
640
+ :is(.stat, .doc-card, .lib-card, .page-tile, .provider-grid > *):nth-child(9) { --i: 8; }
641
+
642
+ /* Hover lift on clickable cards. */
643
+ .lib-card, .doc-card, .stat { transition: border-color .15s, box-shadow .2s, transform .2s var(--ease-out); }
644
+ .lib-card:hover, a.doc-card:hover, a.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
645
+
646
+ /* Buttons give a little under the cursor. */
647
+ .btn { transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .08s; }
648
+ .btn:active:not(:disabled) { transform: scale(.97); }
649
+
650
+ /* Tab panels and freshly rendered results fade in. */
651
+ .tab-body:not([hidden]) { animation: fade .2s ease backwards; }
652
+ #search-results:not([hidden]), .metrics > *, #cmp-diff:not(:empty), #cmp-overall > * { animation: rise .25s var(--ease-out) backwards; }
653
+ #drop-overlay:not([hidden]) { animation: fade .15s ease backwards; }
654
+ #toast.leaving { opacity: 0; transform: translate(-50%, 6px); transition: opacity .18s ease, transform .18s ease; }
655
+
656
+ /* Page image cross-fades while the next page renders. */
657
+ .page-frame img { transition: opacity .2s ease; }
658
+ .page-frame img.loading { opacity: .4; }
659
+
660
+ /* ---- busy / "AI is working" states ------------------------------------- */
661
+ /* Any button doing work: small spinner, full opacity so it doesn't look broken. */
662
+ .btn.is-busy, .btn.is-busy:disabled { opacity: 1; cursor: progress; }
663
+ .btn.is-busy::before {
664
+ content: ""; width: 12px; height: 12px; border-radius: 50%; flex: none;
665
+ border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
666
+ }
667
+ /* The model button gets a slowly flowing gradient while it waits. */
668
+ .btn.primary.is-busy { background: var(--ai-grad); background-size: 200% 100%; border-color: transparent; animation: flow 2.4s linear infinite; }
669
+
670
+ /* The page being read: a soft scan line sweeps down it and the frame breathes. */
671
+ .page-frame.is-reading { animation: glow 1.8s ease-in-out infinite; }
672
+ .page-frame.is-reading::after {
673
+ content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
674
+ background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--accent) 22%, transparent) 45%,
675
+ color-mix(in srgb, var(--accent) 45%, transparent) 50%, transparent 52%) no-repeat;
676
+ background-size: 100% 30%; animation: scan 1.8s ease-in-out infinite alternate;
677
+ }
678
+
679
+ /* The text box that will receive the answer shimmers like a placeholder. */
680
+ pre.text.is-thinking {
681
+ color: var(--subtle);
682
+ background-image: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--accent) 10%, transparent) 50%, transparent 70%);
683
+ background-size: 200% 100%; animation: shimmer 1.6s ease-in-out infinite;
684
+ }
685
+ /* ...and the answer materialises out of a slight blur when it lands. */
686
+ pre.text.reveal { animation: materialize .45s var(--ease-out) backwards; }
687
+
688
+ /* Running jobs: a pulsing dot in the badge and a light sweep over the bar.
689
+ Polling re-renders the markup, so JS passes a negative delay (--phase)
690
+ that keeps the animation in step instead of restarting every second. */
691
+ .badge.run::before { content: ""; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: currentColor; animation: pulse-dot 1.4s ease-in-out infinite; animation-delay: var(--phase, 0s); }
692
+ .job.is-active .jobbar-ok {
693
+ background: var(--ai-grad); background-size: 200% 100%; animation: flow 2.8s linear infinite; animation-delay: var(--phase, 0s);
694
+ }
695
+
696
+ /* ==========================================================================
697
+ Responsive
698
+ ========================================================================== */
699
+ /* Icons next to labels: nav, tabs, headings, badges, step tiles. */
700
+ .mainnav a, .doc-tabs a, .crumb, .footer a, .h-icon, .tabs button, .side-head b, .cov-k, .badge, label.check, .menu summary, details > summary, .good {
701
+ display: inline-flex; align-items: center; gap: 6px;
702
+ }
703
+ .tabs button { justify-content: center; gap: 5px; }
704
+ .mainnav a .icon, .doc-tabs a .icon, .tabs button .icon { width: 15px; height: 15px; opacity: .8; }
705
+ .mainnav a.active .icon, .doc-tabs a.active .icon, .tabs button.active .icon { color: var(--accent); opacity: 1; }
706
+ .h-icon .icon { width: 18px; height: 18px; color: var(--accent); }
707
+ h3.h-icon .icon { width: 16px; height: 16px; }
708
+ .section-head .h-icon, .h-icon { display: flex; }
709
+ .footer a { gap: 4px; }
710
+ .footer .icon, .crumb .icon { width: 13px; height: 13px; }
711
+ .badge .icon, .cov-k .icon, .good .icon { width: 12px; height: 12px; stroke-width: 2.2; }
712
+ .badge { gap: 4px; }
713
+ .cov-k { gap: 4px; }
714
+ .side-head b .icon { width: 14px; height: 14px; color: var(--accent); }
715
+ .seg label .icon, .chips label .icon, label.check .icon { width: 14px; height: 14px; }
716
+ .step-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 6px; }
717
+ .step-icon .icon { width: 18px; height: 18px; }
718
+ /* Emojis only in large decorative tiles (steps, stats, empty states); controls keep the line icons. */
719
+ .emoji { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; line-height: 1; font-style: normal; }
720
+ .step-icon .emoji, .stat-icon .emoji { font-size: 20px; }
721
+ .dz-icon .emoji { font-size: 24px; }
722
+ .empty-icon .emoji { font-size: 28px; }
723
+ #drop-overlay .emoji { font-size: 40px; }
724
+ #drop-overlay > div { display: flex; flex-direction: column; align-items: center; gap: 10px; }
725
+ #drop-overlay .icon { width: 32px; height: 32px; }
726
+
727
+ /* Eight nav links (with Workspaces and Models): narrow the search box before the Upload button runs off-screen. */
728
+ @media (max-width: 1400px) {
729
+ .quicksearch input { width: 150px; }
730
+ .mainnav a { padding: 6px 8px; }
731
+ }
732
+ @media (max-width: 1240px) { .quicksearch { display: none; } } /* the Search page is still in the nav */
733
+ @media (max-width: 1060px) { .mainnav a span { display: none; } } /* icons only (titles still name them) */
734
+ @media (max-width: 1100px) {
735
+ #workspace, #workspace.side { grid-template-columns: 190px 1fr; grid-template-rows: 1fr 1fr; }
736
+ .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
737
+ .panel { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--border); }
738
+ .grid-2, .hero { grid-template-columns: 1fr; }
739
+ .steps { grid-template-columns: 1fr 1fr; }
740
+ .help { grid-template-columns: 1fr; }
741
+ .toc { position: static; }
742
+ .quicksearch { display: none; }
743
+ }
744
+ @media (max-width: 760px) {
745
+ .topbar { padding: 0 12px; gap: 6px; overflow-x: auto; }
746
+ .brand span { display: none; }
747
+ .mainnav a { padding: 6px 8px; }
748
+ .mainnav a span { display: none; }
749
+ .upload-label { display: none; }
750
+ }
751
+ @media (max-width: 640px) {
752
+ .status-row, .steps { grid-template-columns: 1fr; }
753
+ .provider-grid { grid-template-columns: 1fr; }
754
+ body.app { height: auto; overflow: auto; }
755
+ #workspace { display: flex; flex-direction: column; }
756
+ .side-cols, .diff-cols { grid-template-columns: 1fr; }
757
+ .diff-cols > div + div { border-left: 0; border-top: 1px solid var(--border); }
758
+ .container { padding: 20px 14px 40px; }
759
+ .hero h1 { font-size: 26px; }
760
+ }
761
+ @media (prefers-reduced-motion: reduce) {
762
+ *, *::before, *::after { transition: none !important; animation: none !important; }
763
+ }
764
+
765
+ /* ==========================================================================
766
+ Workspaces + upload dialog
767
+ ========================================================================== */
768
+ .lib-filters { display: flex; gap: 8px; flex-wrap: wrap; }
769
+ .ws-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 4px; }
770
+ .ws-tags .badge .icon, .ws-tags .badge svg { width: 11px; height: 11px; margin-right: 4px; }
771
+ .ws-tags .badge:hover { filter: brightness(1.05); text-decoration: none; }
772
+ .ws-card { margin: 0; padding: 0; overflow: hidden; display: flex; flex-direction: column; color: var(--text);
773
+ transition: border-color .15s, box-shadow .15s, transform .15s; }
774
+ .ws-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); color: var(--text); transform: translateY(-2px); }
775
+ .ws-thumbs { height: 140px; background: var(--bg-sunken); display: flex; justify-content: center; align-items: flex-end; gap: 0; padding-top: 16px; overflow: hidden; }
776
+ .ws-thumbs img { width: 92px; height: 124px; object-fit: cover; object-position: top; border-radius: 6px 6px 0 0;
777
+ box-shadow: var(--shadow-md); filter: var(--paper-filter); background: #fff; margin: 0 -14px; }
778
+ .ws-thumbs img:nth-child(1) { transform: rotate(-5deg) translateY(6px); z-index: 1; }
779
+ .ws-thumbs img:nth-child(2) { z-index: 3; }
780
+ .ws-thumbs img:nth-child(3) { transform: rotate(5deg) translateY(6px); z-index: 2; }
781
+ .ws-thumbs img:only-child { transform: none; }
782
+ .ws-thumbs-empty { display: grid; place-items: center; width: 100%; height: 100%; color: var(--subtle); }
783
+ .ws-thumbs-empty .icon { width: 32px; height: 32px; }
784
+ .doc-card .ws-thumbs-empty { width: 52px; height: 68px; border-radius: 6px; background: var(--bg-sunken); flex: none; }
785
+ .doc-card .ws-thumbs-empty .icon { width: 22px; height: 22px; }
786
+ .ws-card .lib-body { display: flex; flex-direction: column; gap: 6px; }
787
+ .ws-title { min-width: 0; }
788
+ .ws-title .crumb { color: var(--muted); }
789
+ .ws-name-row { display: flex; align-items: center; gap: 6px; }
790
+ .ws-name-row h1 { overflow-wrap: anywhere; }
791
+ .ws-rename-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 8px; }
792
+ .ws-rename-form input { width: min(360px, 100%); }
793
+ .ws-rename-form .ws-suggest { flex-basis: 100%; }
794
+ .ws-actions { display: flex; gap: 8px; flex-wrap: wrap; }
795
+ .ws-suggest { gap: 6px; }
796
+ .ws-suggest button { font: inherit; font-size: 12.5px; font-weight: 500; font-family: var(--mono); padding: 3px 10px; border-radius: 99px;
797
+ border: 1px dashed var(--border-strong); background: transparent; color: var(--muted); cursor: pointer; transition: all .15s; }
798
+ .ws-suggest button:hover, .ws-suggest button[aria-pressed=true] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); border-style: solid; }
799
+ .ws-suggest-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
800
+ .ws-suggest-row .ws-suggest { flex: 1; }
801
+
802
+ .dialog { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text);
803
+ box-shadow: var(--shadow-lg); padding: 22px; width: min(520px, calc(100vw - 32px)); }
804
+ .dialog::backdrop { background: rgba(10, 12, 18, .45); backdrop-filter: blur(2px); }
805
+ .dialog[open] { animation: dialog-in .18s ease-out; }
806
+ @keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
807
+ .dialog h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 17px; }
808
+ .dialog h2 .icon { color: var(--accent); }
809
+ .dialog form { display: flex; flex-direction: column; gap: 12px; }
810
+ .dialog .field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
811
+ .dialog .field input, .dialog .field select { width: 100%; color: var(--text); font-weight: 400; }
812
+ .upload-files { list-style: none; margin: 0; padding: 8px 10px; max-height: 150px; overflow: auto; background: var(--bg-sunken);
813
+ border-radius: var(--radius-sm); color: var(--muted); }
814
+ .upload-files li { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
815
+ .upload-files li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
816
+ .upload-files li.ok span:last-child { color: var(--good); }
817
+ .upload-files li.err span:last-child { color: var(--bad); }
818
+ .dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
819
+ @media (prefers-reduced-motion: reduce) { .dialog[open], .ws-card { animation: none; transition: none; } }