File size: 27,494 Bytes
ef3708d
 
23f65ce
 
 
ef3708d
 
b9d34d8
ef3708d
 
 
b9d34d8
ef3708d
 
 
 
 
 
23f65ce
ef3708d
23f65ce
 
 
ef3708d
 
 
23f65ce
ef3708d
 
23f65ce
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ef3708d
 
 
23f65ce
ef3708d
23f65ce
 
ef3708d
 
 
b9d34d8
 
23f65ce
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b9d34d8
 
 
 
 
 
 
 
 
 
 
ef3708d
b9d34d8
 
 
 
 
 
 
ef3708d
 
b9d34d8
ef3708d
 
b9d34d8
 
ef3708d
 
 
 
b9d34d8
 
 
 
ef3708d
 
b9d34d8
ef3708d
 
 
b9d34d8
 
 
 
 
ef3708d
 
 
 
 
 
 
 
23f65ce
ef3708d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b9d34d8
23f65ce
 
 
b9d34d8
 
ef3708d
b9d34d8
 
ef3708d
 
 
b9d34d8
ef3708d
b9d34d8
 
 
 
ef3708d
b9d34d8
 
ef3708d
b9d34d8
ef3708d
 
 
23f65ce
 
ef3708d
 
23f65ce
 
b9d34d8
 
 
 
ef3708d
 
 
 
 
b9d34d8
23f65ce
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b9d34d8
 
ef3708d
b9d34d8
ef3708d
 
 
b9d34d8
 
23f65ce
 
 
ef3708d
b9d34d8
 
ef3708d
 
 
 
 
b9d34d8
 
23f65ce
 
 
ef3708d
b9d34d8
ef3708d
 
b9d34d8
 
ef3708d
b9d34d8
 
23f65ce
 
b9d34d8
 
ef3708d
23f65ce
ef3708d
 
 
23f65ce
b9d34d8
 
ef3708d
4306e95
 
 
 
 
 
b9d34d8
ef3708d
b9d34d8
 
 
23f65ce
ef3708d
23f65ce
 
 
ef3708d
b9d34d8
 
ef3708d
b9d34d8
23f65ce
 
ef3708d
b9d34d8
ef3708d
 
 
b9d34d8
ef3708d
23f65ce
b9d34d8
 
 
23f65ce
 
 
ef3708d
 
 
 
 
 
 
 
 
b9d34d8
ef3708d
 
b9d34d8
ef3708d
b9d34d8
 
23f65ce
 
 
 
ef3708d
 
23f65ce
 
 
 
 
 
 
 
ef3708d
b9d34d8
23f65ce
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b9d34d8
 
 
 
23f65ce
 
b9d34d8
 
 
ef3708d
b9d34d8
ef3708d
 
b9d34d8
ef3708d
b9d34d8
ef3708d
 
 
 
 
 
 
 
 
b9d34d8
 
 
23f65ce
 
b9d34d8
 
ef3708d
b9d34d8
 
 
23f65ce
 
b9d34d8
ef3708d
b9d34d8
 
ef3708d
 
 
 
23f65ce
 
ef3708d
 
 
b9d34d8
 
23f65ce
 
 
b9d34d8
 
ef3708d
 
b9d34d8
ef3708d
 
b9d34d8
 
 
ef3708d
b9d34d8
ef3708d
 
 
23f65ce
b9d34d8
 
ef3708d
 
b9d34d8
 
 
 
23f65ce
 
 
 
 
b9d34d8
 
 
23f65ce
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b9d34d8
 
 
23f65ce
b9d34d8
 
 
23f65ce
b9d34d8
 
 
 
 
23f65ce
b9d34d8
 
 
ef3708d
 
 
b9d34d8
 
23f65ce
ef3708d
b9d34d8
23f65ce
ef3708d
 
23f65ce
ef3708d
 
 
 
b9d34d8
23f65ce
ef3708d
b9d34d8
 
 
 
 
23f65ce
ef3708d
 
b9d34d8
0992cee
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ef3708d
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
/* ============================================================
   PDF Extractor - UI styles
   Two themes (light default, dark) driven by html[data-theme].
   Neutral surfaces + a violet accent. Component class names are
   unchanged so all JS hooks keep working; only the styling is new.
   ============================================================ */

:root {
  --radius-lg: 18px;
  --radius: 13px;
  --radius-sm: 9px;
  --mono: "SFMono-Regular", "Consolas", "Liberation Mono", Menlo, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --t-fast: 0.14s ease;
  --t: 0.22s cubic-bezier(0.2, 0.6, 0.2, 1);
  --accent-contrast: #ffffff;
}

/* ---------------- LIGHT (default) ---------------- */
html[data-theme="light"] {
  --bg: #f3f3f7;
  --bg-glow-1: rgba(124, 58, 237, 0.08);
  --bg-glow-2: rgba(217, 70, 239, 0.05);

  --surface: #ffffff;
  --surface-2: #ffffff;
  --surface-3: #f2f2f6;
  --surface-raise: #ffffff;

  --border: #e5e5ec;
  --border-soft: #eeeef3;
  --border-strong: #d6d6df;

  --text: #1a1a24;
  --text-dim: #585866;
  --text-faint: #8a8a99;

  --accent: #7c3aed;
  --accent-strong: #6d28d9;
  --accent-2: #9333ea;
  --accent-soft: rgba(124, 58, 237, 0.1);
  --accent-ring: rgba(124, 58, 237, 0.3);

  --green: #0e9f6e;
  --green-soft: rgba(14, 159, 110, 0.12);
  --green-line: rgba(14, 159, 110, 0.32);
  --amber: #c2790f;
  --amber-soft: rgba(194, 121, 15, 0.12);
  --amber-line: rgba(194, 121, 15, 0.32);
  --red: #e0455c;
  --red-soft: rgba(224, 69, 92, 0.1);
  --red-line: rgba(224, 69, 92, 0.32);
  --teal: #0ea5b7;

  --shadow: 0 16px 40px -22px rgba(30, 25, 50, 0.26);
  --shadow-sm: 0 1px 2px rgba(30, 25, 50, 0.06), 0 2px 6px rgba(30, 25, 50, 0.05);
  --mark: #ffd84d;
  --mark-active: #ffc21f;
  --mark-text: #3a2c00;
}

/* ---------------- DARK ---------------- */
html[data-theme="dark"] {
  --bg: #0c0c11;
  --bg-glow-1: rgba(139, 92, 246, 0.14);
  --bg-glow-2: rgba(217, 70, 239, 0.07);

  --surface: #16161e;
  --surface-2: #20202b;
  --surface-3: #111117;
  --surface-raise: #24242f;

  --border: #2a2a36;
  --border-soft: #1f1f29;
  --border-strong: #3a3a48;

  --text: #ededf3;
  --text-dim: #a2a2b2;
  --text-faint: #6a6a79;

  --accent: #8b5cf6;
  --accent-strong: #7c3aed;
  --accent-2: #a855f7;
  --accent-soft: rgba(139, 92, 246, 0.18);
  --accent-ring: rgba(139, 92, 246, 0.45);

  --green: #34d399;
  --green-soft: rgba(52, 211, 153, 0.15);
  --green-line: rgba(52, 211, 153, 0.38);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.15);
  --amber-line: rgba(251, 191, 36, 0.4);
  --red: #fb7185;
  --red-soft: rgba(251, 113, 133, 0.14);
  --red-line: rgba(251, 113, 133, 0.4);
  --teal: #2dd4bf;

  --shadow: 0 18px 44px -20px rgba(0, 0, 0, 0.72);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --mark: #fbbf24;
  --mark-active: #ffd86b;
  --mark-text: #1a1205;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1100px 560px at 88% -12%, var(--bg-glow-1), transparent 60%),
    radial-gradient(820px 480px at -8% 112%, var(--bg-glow-2), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  transition: background-color var(--t), color var(--t);
}

h1, h2, h3 { margin: 0; font-weight: 680; letter-spacing: -0.015em; }
::selection { background: var(--accent-soft); }

/* ---------------- Header ---------------- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 26px;
  border-bottom: 1px solid var(--border-soft);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  color: var(--accent-contrast);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px -6px var(--accent-ring), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-text h1 { font-size: 19px; line-height: 1.1; }
.tagline { margin: 3px 0 0; font-size: 12.5px; color: var(--text-dim); }

.header-actions { display: flex; align-items: center; gap: 10px; }

/* theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
  cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
  box-shadow: var(--shadow-sm);
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.theme-toggle:active { transform: translateY(0); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .icon-sun, .theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="light"] .theme-toggle .icon-moon { display: block; }

.offline-pill {
  font-size: 12px; font-weight: 600; color: var(--green);
  background: var(--green-soft); border: 1px solid var(--green-line);
  padding: 5px 12px; border-radius: 999px;
}

/* ---------------- Layout ---------------- */
.layout {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 26px;
  padding: 26px;
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

/* ---------------- Sidebar ---------------- */
.sidebar { display: flex; flex-direction: column; gap: 18px; }
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 90px;
}
.panel-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-dim); margin-bottom: 16px;
}

.setting { margin-bottom: 18px; }
.setting:last-child { margin-bottom: 0; }
.setting-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.setting-row > div { min-width: 0; }
.setting-label { display: block; font-size: 13.5px; font-weight: 650; margin-bottom: 8px; color: var(--text); }
.setting-row .setting-label { margin-bottom: 3px; }
.hint { margin: 5px 0 0; font-size: 11.5px; color: var(--text-faint); line-height: 1.5; }

/* accordions (native <details>) */
.accordion { border-top: 1px solid var(--border-soft); }
.accordion + .accordion { margin-top: 0; }
.accordion-summary {
  list-style: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 15px 2px;
  font-size: 13px; font-weight: 650; color: var(--text);
  user-select: none;
}
.accordion-summary::-webkit-details-marker { display: none; }
.accordion-summary:hover { color: var(--accent); }
.accordion-chevron { color: var(--text-faint); transition: transform var(--t); flex: none; }
.accordion[open] > .accordion-summary .accordion-chevron { transform: rotate(180deg); }
.accordion-body { padding: 2px 0 8px; }
.accordion-body .setting:last-child { margin-bottom: 0; }

.segmented {
  display: flex;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 4px;
  gap: 4px;
}
.seg {
  flex: 1; border: none; background: transparent; color: var(--text-dim);
  font: inherit; font-size: 13px; font-weight: 650; padding: 8px;
  border-radius: 8px; cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}
.seg:hover { color: var(--text); }
.seg.active {
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  color: var(--accent-contrast);
  box-shadow: 0 4px 12px -3px var(--accent-ring);
}

.select {
  width: 100%; background: var(--surface-3); border: 1px solid var(--border);
  color: var(--text); font: inherit; font-size: 14px; padding: 10px 12px;
  border-radius: var(--radius-sm); cursor: pointer;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.select:hover { border-color: var(--border-strong); }
.select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* switch */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; cursor: pointer; background: var(--border);
  border-radius: 999px; transition: background var(--t); border: 1px solid var(--border-strong);
}
.slider::before {
  content: ""; position: absolute; height: 20px; width: 20px; left: 2px; top: 2px;
  background: #fff; border-radius: 50%; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  transition: transform var(--t);
}
.switch input:checked + .slider {
  background: linear-gradient(145deg, var(--accent), var(--accent-strong)); border-color: transparent;
}
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 3px var(--accent-ring); }
.switch input:disabled + .slider { opacity: 0.45; cursor: not-allowed; }

/* a feature that isn't available in this build */
.setting-row.is-unavailable .setting-label { color: var(--text-dim); }
.hw-note { color: var(--accent); }
.hw-note strong { color: var(--accent); font-weight: 700; }

/* ---------------- Work area ---------------- */
.work { min-width: 0; display: flex; flex-direction: column; gap: 18px; }

.toolbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; position: sticky; top: 86px; z-index: 10;
  box-shadow: var(--shadow);
}
.search-wrap { position: relative; flex: 1; min-width: 220px; display: flex; align-items: center; }
.search-icon { position: absolute; left: 12px; color: var(--text-faint); pointer-events: none; }
.search-input {
  width: 100%; background: var(--surface-3); border: 1px solid var(--border); color: var(--text);
  font: inherit; font-size: 14px; padding: 10px 12px 10px 36px; border-radius: var(--radius-sm);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.search-input::placeholder { color: var(--text-faint); }
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-count { position: absolute; right: 12px; font-size: 12px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.toolbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.export-group { display: flex; gap: 3px; background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; }
.add-more { display: inline-flex; align-items: center; }

/* buttons */
.btn {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 13px; font-weight: 650; padding: 9px 14px;
  border-radius: var(--radius-sm); cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), opacity var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  box-shadow: var(--shadow-sm);
}
.btn:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-dim); box-shadow: none; }
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent); border-color: transparent; transform: none; }
.export-group .btn-ghost { border: none; }
.btn-danger { color: var(--red); border-color: var(--red-line); background: transparent; box-shadow: none; }
.btn-danger:hover { background: var(--red-soft); border-color: var(--red); transform: none; }

/* The HTML `hidden` attribute must always win over display rules below. */
[hidden] { display: none !important; }

/* empty state == centred dropzone hero + auto-detect */
.empty-state { display: flex; flex-direction: column; gap: 18px; }

.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 60px 28px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--t), background var(--t), transform var(--t-fast), box-shadow var(--t);
  color: var(--text-dim);
  background:
    radial-gradient(130% 130% at 50% -10%, var(--accent-soft), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow);
}
.dropzone:hover { border-color: var(--accent); }
.dropzone:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.008); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.dz-icon-wrap {
  width: 66px; height: 66px; margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 20px; color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-ring);
}
.dz-primary { margin: 0; font-weight: 680; color: var(--text); font-size: 18px; letter-spacing: -0.01em; }
.dz-secondary { margin: 7px 0 0; font-size: 13.5px; color: var(--text-dim); }
.dz-link { color: var(--accent); font-weight: 650; }

.dz-extra { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.dz-extra-hint { max-width: 480px; text-align: center; margin: 0; }
#suggestResult { width: 100%; max-width: 520px; margin: 4px auto 0; text-align: left; }

/* files */
.files-container { display: flex; flex-direction: column; gap: 18px; }
.file-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow);
}
.file-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 18px; border-bottom: 1px solid var(--border-soft);
}
.file-meta { display: flex; align-items: center; gap: 11px; min-width: 0; }
.file-name { font-size: 15px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-head-right { display: flex; align-items: center; gap: 12px; flex: none; }
.status-text { font-size: 12.5px; color: var(--text-dim); font-weight: 550; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-faint); flex: none; }
.status-dot.processing { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); animation: pulse 1.2s infinite; }
.status-dot.done { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.status-dot.error { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.status-dot.cancelled { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.progress-row { display: flex; align-items: center; gap: 13px; padding: 13px 18px; }
.progress-track { flex: 1; height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12); }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent-strong), var(--accent)); border-radius: 999px; transition: width 0.3s ease; }
.progress-label { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; flex: none; }

.file-error {
  margin: 0 18px 15px; padding: 11px 13px; background: var(--red-soft);
  border: 1px solid var(--red-line); border-radius: var(--radius-sm); color: var(--red); font-size: 13px;
}

.pages { display: flex; flex-direction: column; gap: 13px; padding: 5px 18px 18px; }

/* page card */
.page-card {
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  background: var(--surface-3); overflow: hidden;
}
.page-head { display: flex; align-items: center; gap: 10px; padding: 10px 13px; border-bottom: 1px solid var(--border-soft); }
.page-num { font-size: 13px; font-weight: 700; color: var(--text-dim); }
.page-spacer { flex: 1; }
.badge { font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em; }
.badge.text { color: var(--green); background: var(--green-soft); border: 1px solid var(--green-line); }
.badge.ocr { color: var(--amber); background: var(--amber-soft); border: 1px solid var(--amber-line); }
.badge.ocr.lowconf { color: var(--red); background: var(--red-soft); border-color: var(--red-line); }
.badge.handwriting { color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-ring); }
.badge.online { color: var(--teal); background: color-mix(in srgb, var(--teal) 15%, transparent); border: 1px solid color-mix(in srgb, var(--teal) 40%, transparent); }
.beta-tag { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); background: var(--accent-soft); padding: 1px 5px; border-radius: 999px; vertical-align: middle; }
.badge.error { color: var(--red); background: var(--red-soft); border: 1px solid var(--red-line); }
.badge.pending { color: var(--text-faint); background: var(--surface-2); border: 1px solid var(--border); }

.page-text {
  margin: 0; padding: 15px 17px; white-space: pre-wrap; word-break: break-word;
  font-family: var(--mono); font-size: 13px; line-height: 1.65; color: var(--text);
  max-height: 460px; overflow: auto;
}
.page-text:empty::before { content: "(no text on this page)"; color: var(--text-faint); font-style: italic; }
.page-text mark { background: var(--mark); color: var(--mark-text); border-radius: 3px; padding: 0 2px; }
.page-text mark.active { background: var(--mark-active); outline: 1.5px solid var(--amber); }

.lc-line { background: var(--amber-soft); border-bottom: 1px dashed var(--amber-line); border-radius: 3px; }
.to-check { font-size: 11px; font-weight: 600; color: var(--amber); background: var(--amber-soft); border: 1px solid var(--amber-line); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }

.page-edit {
  width: 100%; box-sizing: border-box; margin: 0;
  padding: 15px 17px; min-height: 180px; max-height: 460px; resize: vertical;
  white-space: pre-wrap; word-break: break-word;
  font-family: var(--mono); font-size: 13px; line-height: 1.65;
  color: var(--text); background: var(--surface-3);
  border: 1px solid var(--accent); border-radius: 0 0 var(--radius) var(--radius);
  outline: none; box-shadow: inset 0 0 0 3px var(--accent-soft);
}

.page-image-wrap { padding: 13px 17px; border-top: 1px solid var(--border-soft); background: var(--surface); }
.page-image-wrap img { max-width: 100%; border-radius: 8px; border: 1px solid var(--border); display: block; }
.page-image-wrap .img-loading { color: var(--text-faint); font-size: 13px; }

/* toast */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(12px);
  background: var(--surface-raise); border: 1px solid var(--border); color: var(--text);
  padding: 12px 20px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow); opacity: 0; transition: opacity var(--t), transform var(--t);
  z-index: 50; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* footer tips */
.app-footer { max-width: 1440px; width: 100%; margin: 0 auto; padding: 4px 26px 28px; }
.footer-tips {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-sm); padding: 2px 16px;
}
.footer-tips > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 8px;
  padding: 13px 2px; font-size: 13px; font-weight: 650; color: var(--text-dim);
}
.footer-tips > summary::-webkit-details-marker { display: none; }
.footer-tips > summary svg { color: var(--accent); flex: none; }
.footer-tips > summary:hover { color: var(--text); }
.footer-tips-list { margin: 0 0 14px; padding-left: 22px; }
.footer-tips-list li { font-size: 12.5px; color: var(--text-faint); margin-bottom: 6px; line-height: 1.55; }
.footer-tips-list li::marker { color: var(--accent); }

/* responsive */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; padding: 16px; gap: 18px; }
  .panel { position: static; }
  .toolbar { position: static; }
  .sidebar { order: 2; }
  .work { order: 1; }
  .app-footer { padding: 4px 16px 22px; }
}
@media (max-width: 520px) {
  .app-header { padding: 12px 16px; }
  .brand-text h1 { font-size: 17px; }
  .toolbar-actions { width: 100%; justify-content: space-between; }
  .dropzone { padding: 44px 20px; }
}

/* scrollbars */
.page-text::-webkit-scrollbar { width: 11px; height: 11px; }
.page-text::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 3px solid var(--surface-3); }
.page-text::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }
.page-text::-webkit-scrollbar-track { background: transparent; }

/* online (Gemini) sub-setting */
.setting-sub { margin-left: 4px; padding-left: 13px; border-left: 2px solid var(--accent-soft); }

/* "Auto-detect best settings" recommendation panel */
.btn-primary { background: linear-gradient(145deg, var(--accent), var(--accent-strong)); color: var(--accent-contrast); border-color: transparent; box-shadow: 0 6px 16px -6px var(--accent-ring); }
.btn-primary:hover { filter: brightness(1.06); border-color: transparent; }
.suggest-card { margin-top: 6px; padding: 13px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-3); }
.suggest-rationale { font-size: 12px; line-height: 1.5; margin: 0 0 8px; color: var(--text-dim); }
.suggest-evidence { font-size: 11px; font-family: var(--mono); margin-bottom: 8px; }
.ev-row { display: grid; grid-template-columns: 1.5fr 1fr 0.9fr 0.9fr; gap: 6px; padding: 2px 0; opacity: 0.72; }
.ev-row.best { opacity: 1; font-weight: 650; color: var(--text); }

/* online (Gemini) settings */
.online-input { width: 100%; margin-bottom: 6px; font-family: var(--mono); font-size: 12px; }
.online-key-actions { display: flex; align-items: center; gap: 8px; }
.online-status { font-size: 11px; }
.online-status.good { color: var(--green); }
.online-status.bad { color: var(--red); }

/* remove (x) button on a file card */
.btn-remove { color: var(--text-dim); font-size: 18px; line-height: 1; padding: 3px 9px; font-weight: 700; box-shadow: none; border-color: transparent; background: transparent; }
.btn-remove:hover { color: var(--red); background: var(--red-soft); transform: none; }

/* ---------------- Knowledge graph panel (per file card) ---------------- */
.kg-panel { margin: 0 18px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-3); overflow: hidden; }
.kg-summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 9px;
  padding: 12px 14px; font-size: 13px; font-weight: 650; color: var(--text);
}
.kg-summary::-webkit-details-marker { display: none; }
.kg-summary:hover { color: var(--accent); }
.kg-summary-icon { color: var(--accent); flex: none; }
.kg-chevron { color: var(--text-faint); margin-left: 2px; transition: transform var(--t); }
.kg-panel[open] > .kg-summary .kg-chevron { transform: rotate(180deg); }
.kg-summary-status { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--text-faint); }
.kg-summary-status.good { color: var(--green); }
.kg-summary-status.bad { color: var(--red); }
.kg-summary-status.busy { color: var(--accent); }

.kg-body { padding: 4px 14px 14px; border-top: 1px solid var(--border-soft); }
.kg-intro { margin: 10px 0 12px; }
.kg-intro strong { color: var(--accent); }
.kg-build-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.kg-build-note { margin: 0; flex: 1; min-width: 180px; }

.kg-query-wrap { margin-top: 12px; }
.kg-ask { display: flex; gap: 8px; }
.kg-query-input {
  flex: 1; background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font: inherit; font-size: 14px; padding: 9px 12px; border-radius: var(--radius-sm);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.kg-query-input::placeholder { color: var(--text-faint); }
.kg-query-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.kg-results { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.kg-empty { margin: 4px 0; font-size: 12.5px; color: var(--text-faint); }
.kg-resultmeta { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); font-weight: 700; }

.kg-answer { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); padding: 11px 13px; box-shadow: var(--shadow-sm); }
.kg-answer-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kg-type-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.kg-entity { font-size: 14px; font-weight: 700; color: var(--text); }
.kg-type-chip { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; border: 1px solid currentColor; border-radius: 999px; padding: 1px 7px; opacity: 0.9; }
.kg-pages { font-size: 11px; font-weight: 650; color: var(--text-dim); background: var(--surface-3); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; font-variant-numeric: tabular-nums; }

.kg-facts { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.kg-triple { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; line-height: 1.5; }
.kg-subj { font-weight: 650; color: var(--text); }
.kg-pred { color: var(--accent); font-style: italic; }
.kg-obj { font-weight: 650; color: var(--text); }
.kg-arrow { color: var(--text-faint); }
.kg-triple-page { margin-left: 2px; }

.kg-linkpath { margin-top: 9px; padding-top: 8px; border-top: 1px dashed var(--border); display: flex; flex-direction: column; gap: 4px; }
.kg-link-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); font-weight: 700; }

.kg-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.kg-viz-wrap { margin-top: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); padding: 8px; }
.kg-canvas { width: 100%; display: block; border-radius: var(--radius-sm); background: var(--surface-3); }
.kg-viz-note { margin: 8px 2px 2px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}