@anmol-srv/sigil 0.18.2 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/README.md +37 -25
  2. package/dist/cli.js +1191 -790
  3. package/dist/daemon.js +664 -302
  4. package/dist/hooks/post-tool-use.js +1 -69
  5. package/dist/hooks/session-end.js +13 -236
  6. package/dist/hooks/stop.js +36 -246
  7. package/dist/hooks/user-prompt-submit.js +25 -288
  8. package/dist/mcp/worker-server.js +6 -0
  9. package/dist/npm-entry.js +10 -0
  10. package/dist/server.js +64 -56
  11. package/install.sh +207 -0
  12. package/integrations/hermes/README.md +30 -24
  13. package/integrations/hermes/plugin/README.md +1 -1
  14. package/integrations/hermes/plugin/__init__.py +68 -24
  15. package/knexfile.js +19 -22
  16. package/package.json +9 -28
  17. package/prompts/audm-decision.md +26 -1
  18. package/prompts/entity-extraction.md +32 -30
  19. package/prompts/graph-extraction.md +20 -2
  20. package/src/db/drivers/index.js +38 -15
  21. package/src/db/migrations/20260629120000_add-trace-event-attribution.cjs +29 -0
  22. package/src/db/migrations/20260629120001_add-llm-log-session-correlation.cjs +29 -0
  23. package/src/db/migrations/20260806120000_add-document-content.cjs +27 -0
  24. package/src/db/migrations/20260806120001_llm-log-model-nullable.cjs +36 -0
  25. package/src/db/migrations/20260811120000_add-relation-provenance.cjs +42 -0
  26. package/src/db/migrations/20260811130000_add-fact-visibility.cjs +67 -0
  27. package/src/db/migrations/20260813090000_rescore-defaulted-vital.cjs +57 -0
  28. package/src/db/migrations/20260814120000_create-ingestion-job.cjs +52 -0
  29. package/src/db/migrations/20260814120100_add-llm-log-queued-ms.cjs +8 -0
  30. package/src/db/migrations/20260814120200_add-active-fact-content-hash-index.cjs +16 -0
  31. package/src/db/migrations/20260814120300_create-relation-candidate-judgment.cjs +25 -0
  32. package/src/gui/web/app.css +851 -84
  33. package/src/gui/web/app.js +796 -383
  34. package/src/gui/web/cmdk.js +238 -0
  35. package/src/gui/web/components.js +64 -0
  36. package/src/gui/web/design/colors_and_type.css +6 -1
  37. package/src/gui/web/graph/GraphIsland.jsx +450 -0
  38. package/src/gui/web/graph/cluster.js +305 -0
  39. package/src/gui/web/graph/cluster.test.js +219 -0
  40. package/src/gui/web/health.js +117 -0
  41. package/src/gui/web/health.test.js +159 -0
  42. package/src/gui/web/icons.js +65 -0
  43. package/src/gui/web/index.html +310 -115
  44. package/src/gui/web/settings.js +386 -0
  45. package/src/gui/web/setup.js +2 -2
  46. package/src/gui/web/toast.js +6 -3
  47. package/src/gui/web/vendor/graph-island.js +52 -0
@@ -31,12 +31,14 @@
31
31
  --accent-2: var(--brand-deep);
32
32
  --accent-fg: #ffffff;
33
33
 
34
- /* entity-type palette — cohesive cool triad, used by the graph nodes,
35
- the graph legend, and the KB browser's type dots (one source of truth) */
36
- --etype-person: #4ea1ff;
37
- --etype-topic: #9a86ff;
38
- --etype-document: #43c9b0;
39
- --etype-fact: #5b5f67;
34
+ /* entity-type palette — brand-forward: topics carry the brand blue (they're
35
+ the most common entity, so the graph reads mostly-blue / on-brand), with
36
+ person/document as light-blue + teal accents. Used by the graph nodes, the
37
+ graph legend, and the KB browser's type dots (one source of truth) */
38
+ --etype-person: #9bd6ff;
39
+ --etype-topic: #2f81f7;
40
+ --etype-document: #36cfa6;
41
+ --etype-fact: #565a63;
40
42
 
41
43
  /* status: foreground --ok/--warn come from design tokens; backgrounds map
42
44
  to the design's restrained tints (used only as small dot/row washes) */
@@ -92,46 +94,46 @@ a { color: var(--accent); text-decoration: none; }
92
94
  a:hover { text-decoration: underline; text-underline-offset: 2px; }
93
95
  code, .mono { font-family: var(--font-mono); }
94
96
 
97
+ /* Reduced motion: collapse transitions/animations to near-instant. */
98
+ @media (prefers-reduced-motion: reduce) {
99
+ *, *::before, *::after {
100
+ animation-duration: 0.01ms !important;
101
+ animation-iteration-count: 1 !important;
102
+ transition-duration: 0.01ms !important;
103
+ scroll-behavior: auto !important;
104
+ }
105
+ }
106
+
95
107
  /* ════════════════════════════════════════════════════════════════════════
96
- Top nav
108
+ Sidebar (left rail) — two-tier grouped nav. See DESIGN.md › Information
109
+ Architecture. Fixed full-height; main/footer are offset by --sidebar.
97
110
  ════════════════════════════════════════════════════════════════════════ */
98
- header {
99
- height: var(--header-h);
100
- flex-shrink: 0;
101
- border-bottom: 1px solid var(--border);
102
- background: var(--bg-surface);
103
- position: sticky;
104
- top: 0;
105
- z-index: 20;
106
- }
107
- .header-inner {
108
- height: 100%;
111
+ /* Scoped to the top-level element on purpose: as a bare `header` selector this
112
+ claimed every <header> in the app, so a panel header inside a view inherited
113
+ `position: fixed` and flew to the top-left corner over the sidebar. */
114
+ body > header {
115
+ position: fixed;
116
+ top: 0; left: 0; bottom: 0;
117
+ width: var(--sidebar);
118
+ background: var(--bg-0);
119
+ border-right: 1px solid var(--border);
109
120
  display: flex;
110
- align-items: center;
111
- padding: 0 var(--s-5);
112
- max-width: var(--container);
113
- margin: 0 auto;
114
- width: 100%;
121
+ flex-direction: column;
122
+ overflow-y: auto;
123
+ z-index: 20;
115
124
  }
116
125
  .brand {
117
126
  display: flex;
118
127
  align-items: center;
119
- gap: var(--s-3);
120
- padding-right: var(--s-5);
121
- margin-right: var(--s-5);
122
- border-right: 1px solid var(--border);
123
- height: 100%;
124
- }
125
- .brand-mark {
126
- width: 20px;
127
- height: 20px;
128
- display: block;
129
- flex-shrink: 0;
128
+ gap: var(--s-2);
129
+ padding: var(--s-4) var(--s-4) var(--s-3);
130
130
  }
131
+ .brand-mark { width: 22px; height: 22px; display: block; flex-shrink: 0; }
131
132
  .brand-name {
132
- font-weight: 600;
133
- font-size: var(--t-md);
134
- letter-spacing: -0.005em;
133
+ font-weight: 700;
134
+ font-size: var(--t-lg);
135
+ letter-spacing: -0.01em;
136
+ color: var(--fg);
135
137
  }
136
138
  .brand-badge {
137
139
  font-family: var(--font-mono);
@@ -143,56 +145,79 @@ header {
143
145
  border: 1px solid var(--border);
144
146
  text-transform: lowercase;
145
147
  letter-spacing: 0.04em;
148
+ margin-left: auto;
149
+ }
150
+
151
+ /* status pill — replaces PID/uptime as the at-a-glance health signal */
152
+ .side-status { padding: 0 var(--s-3) var(--s-4); }
153
+ .conn-status {
154
+ display: inline-flex;
155
+ align-items: center;
156
+ gap: var(--s-2);
157
+ width: 100%;
158
+ font-size: var(--t-xs);
159
+ color: var(--fg-2);
160
+ background: var(--bg-surface);
161
+ border: 1px solid var(--border);
162
+ padding: var(--s-2) var(--s-3);
163
+ }
164
+ .conn-status::before {
165
+ content: "";
166
+ width: 7px; height: 7px;
167
+ border-radius: 50%;
168
+ background: var(--fg-4);
169
+ flex-shrink: 0;
146
170
  }
171
+ .conn-status.ok { color: var(--fg-2); }
172
+ .conn-status.ok::before { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
173
+ .conn-status.err { color: var(--err); }
174
+ .conn-status.err::before { background: var(--err); box-shadow: 0 0 0 3px var(--err-bg); }
147
175
 
148
- nav { display: flex; flex: 1; height: 100%; }
176
+ nav { display: flex; flex-direction: column; gap: var(--s-4); padding: 0 var(--s-3); }
177
+ .navgroup { display: flex; flex-direction: column; gap: 1px; }
178
+ .navgroup-label {
179
+ font-size: var(--t-xs);
180
+ font-weight: 600;
181
+ text-transform: uppercase;
182
+ letter-spacing: 0.12em;
183
+ color: var(--fg-3);
184
+ padding: 0 var(--s-2) var(--s-2);
185
+ }
149
186
  nav a {
150
187
  display: flex;
151
188
  align-items: center;
152
- height: 100%;
153
- padding: 0 var(--s-3);
154
- color: var(--fg-3);
189
+ gap: var(--s-2);
190
+ padding: var(--s-2);
191
+ color: var(--fg-2);
155
192
  text-decoration: none;
156
- font-size: var(--t-base);
193
+ font-size: var(--t-md);
157
194
  font-weight: 500;
158
- border-bottom: 2px solid transparent;
159
- margin-bottom: -1px; /* overlap header border */
195
+ border-left: 2px solid transparent;
196
+ transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
160
197
  }
161
- nav a:hover { color: var(--fg); text-decoration: none; }
198
+ nav a:hover { color: var(--fg); background: var(--bg-surface-2); text-decoration: none; }
162
199
  nav a.active {
163
200
  color: var(--fg);
164
- border-bottom-color: var(--accent);
201
+ background: var(--info-bg);
202
+ border-left-color: var(--accent);
165
203
  }
166
204
 
167
- .conn-status {
168
- display: inline-flex;
169
- align-items: center;
170
- gap: var(--s-2);
171
- font-size: var(--t-sm);
172
- color: var(--fg-3);
173
- margin-left: auto;
174
- }
175
- .conn-status::before {
176
- content: "";
177
- width: 6px;
178
- height: 6px;
179
- background: var(--fg-4);
180
- display: inline-block;
205
+ .side-foot {
206
+ margin-top: auto;
207
+ padding: var(--s-3) var(--s-4);
208
+ border-top: 1px solid var(--border);
209
+ font-size: var(--t-xs);
210
+ color: var(--fg-3); /* informational — AA, not the faint fg-4 */
181
211
  }
182
- .conn-status.ok { color: var(--ok); }
183
- .conn-status.ok::before { background: var(--ok); }
184
- .conn-status.err { color: var(--err); }
185
- .conn-status.err::before { background: var(--err); }
186
212
 
187
213
  /* ════════════════════════════════════════════════════════════════════════
188
214
  Main layout
189
215
  ════════════════════════════════════════════════════════════════════════ */
190
216
  main {
191
217
  flex: 1;
192
- padding: var(--s-6) var(--s-5) var(--s-8);
193
- max-width: var(--container);
194
- margin: 0 auto;
195
- width: 100%;
218
+ margin-left: var(--sidebar);
219
+ padding: var(--s-6) var(--s-6) var(--s-8);
220
+ width: auto;
196
221
  }
197
222
  .view { display: none; }
198
223
  .view.active { display: block; }
@@ -325,6 +350,127 @@ h3.section-sub {
325
350
  }
326
351
  .stat .sub { color: var(--fg-3); font-size: var(--t-sm); }
327
352
 
353
+ /* ════════════════════════════════════════════════════════════════════════
354
+ Home — memory at a glance. See DESIGN.md › Home / stat strip.
355
+ ════════════════════════════════════════════════════════════════════════ */
356
+ .hm-dot {
357
+ display: inline-block;
358
+ width: 7px; height: 7px;
359
+ border-radius: 50%;
360
+ background: var(--fg-4);
361
+ margin-right: 6px;
362
+ vertical-align: middle;
363
+ }
364
+ .hm-dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
365
+ .hm-dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }
366
+ .hm-dot.err { background: var(--err); box-shadow: 0 0 0 3px var(--err-bg); }
367
+
368
+ .home-cols {
369
+ display: grid;
370
+ grid-template-columns: 1.4fr 1fr;
371
+ gap: var(--s-4);
372
+ margin-top: var(--s-5);
373
+ }
374
+ /* Grid items default to min-width:auto, so one long unbreakable child inside a
375
+ panel blows the track past the viewport and the whole page scrolls sideways
376
+ on narrow screens. Both panels ellipsize internally already — let them. */
377
+ .home-cols > * { min-width: 0; }
378
+ .home-h {
379
+ margin: 0;
380
+ font-size: var(--t-md);
381
+ font-weight: 600;
382
+ color: var(--fg);
383
+ }
384
+ .home-link {
385
+ float: right;
386
+ font-size: var(--t-sm);
387
+ font-weight: 500;
388
+ color: var(--accent);
389
+ }
390
+ .home-link:hover { text-decoration: underline; text-underline-offset: 2px; }
391
+
392
+ .home-recall {
393
+ display: grid;
394
+ grid-template-columns: repeat(2, 1fr);
395
+ gap: var(--s-4);
396
+ }
397
+ .hm-metric { display: flex; flex-direction: column; gap: 2px; }
398
+ .hm-metric .hmv {
399
+ font-family: var(--font-mono);
400
+ font-size: var(--t-xl);
401
+ font-weight: 600;
402
+ letter-spacing: -0.02em;
403
+ color: var(--fg);
404
+ }
405
+ .hm-metric .hmk { font-size: var(--t-xs); color: var(--fg-3); }
406
+ .hm-bar {
407
+ height: 4px;
408
+ background: var(--bg-surface-3);
409
+ margin-top: var(--s-1);
410
+ overflow: hidden;
411
+ }
412
+ /* transform (not width) so the fill animation stays off the layout path */
413
+ .hm-bar > i {
414
+ display: block;
415
+ height: 100%;
416
+ width: 100%;
417
+ background: var(--ok);
418
+ transform: scaleX(0);
419
+ transform-origin: left;
420
+ transition: transform var(--dur-2) var(--ease);
421
+ }
422
+
423
+ .home-feed { list-style: none; margin: var(--s-1) 0 0; padding: 0; }
424
+ .home-feed-row {
425
+ display: flex;
426
+ align-items: center;
427
+ gap: var(--s-2);
428
+ padding: var(--s-2) 0;
429
+ border-top: 1px solid var(--border);
430
+ font-size: var(--t-sm);
431
+ }
432
+ .home-feed-row:first-child { border-top: none; }
433
+ .home-feed-summary {
434
+ color: var(--fg-2);
435
+ white-space: nowrap;
436
+ overflow: hidden;
437
+ text-overflow: ellipsis;
438
+ min-width: 0;
439
+ flex: 1;
440
+ }
441
+ .home-feed-time {
442
+ margin-left: auto;
443
+ flex-shrink: 0;
444
+ font-family: var(--font-mono);
445
+ font-size: var(--t-xs);
446
+ color: var(--fg-3); /* real info (timestamp) — AA, not the faint fg-4 */
447
+ }
448
+
449
+ .home-diag { margin-top: var(--s-5); }
450
+ .home-diag > summary {
451
+ cursor: pointer;
452
+ padding: var(--s-3) var(--s-4);
453
+ font-size: var(--t-sm);
454
+ font-weight: 500;
455
+ color: var(--fg-3);
456
+ user-select: none;
457
+ }
458
+ .home-diag > summary:hover { color: var(--fg); }
459
+ .home-diag[open] > summary { border-bottom: 1px solid var(--border); }
460
+ .home-diag .kv { border: none; }
461
+
462
+ @media (max-width: 768px) {
463
+ .home-cols { grid-template-columns: 1fr; }
464
+ }
465
+
466
+ /* Agents — activity-by-agent table: right-align the numeric columns */
467
+ #agents-activity th.num,
468
+ #agents-activity td.num {
469
+ text-align: right;
470
+ font-family: var(--font-mono);
471
+ white-space: nowrap;
472
+ }
473
+
328
474
  /* ════════════════════════════════════════════════════════════════════════
329
475
  Key-value rows (replaces dl)
330
476
  ════════════════════════════════════════════════════════════════════════ */
@@ -341,6 +487,11 @@ h3.section-sub {
341
487
  align-items: baseline;
342
488
  }
343
489
  .kv .row:last-child { border-bottom: none; }
490
+ /* A .kv sitting INSIDE an already-bordered panel: drop the outer chrome so we
491
+ don't draw a box inside a box, and pull the padding back to the panel's own
492
+ gutter. Structure here is carried by the row hairlines alone. */
493
+ .kv-flush { border: 0; background: none; }
494
+ .kv-flush .row { padding-left: 0; padding-right: 0; }
344
495
  .kv .row .k { color: var(--fg-3); font-size: var(--t-sm); }
345
496
  .kv .row .v { font-family: var(--font-mono); font-size: var(--t-base); overflow-wrap: anywhere; }
346
497
 
@@ -419,6 +570,13 @@ form select,
419
570
  form textarea,
420
571
  .onboarding-content input:not([type="radio"]):not([type="checkbox"]),
421
572
  .onboarding-content select,
573
+ /* `.field` is the wrapper both the wizard AND Settings' provider switcher use.
574
+ Styling was previously scoped to `form` / `.onboarding-content`, so the
575
+ switcher — which is neither — rendered browser-default controls: a white
576
+ select on a near-black panel. Keying off `.field` makes a control look the
577
+ same wherever it appears, which is the whole point of the class. */
578
+ .field input:not([type="radio"]):not([type="checkbox"]),
579
+ .field select,
422
580
  .input {
423
581
  width: 100%;
424
582
  height: 36px;
@@ -431,9 +589,11 @@ form textarea,
431
589
  }
432
590
  form textarea { padding: var(--s-2) var(--s-3); height: auto; min-height: 80px; resize: vertical; }
433
591
  form select,
592
+ .field select,
434
593
  .onboarding-content select { padding-right: var(--s-5); }
435
594
  form input:focus, form select:focus, form textarea:focus,
436
595
  .onboarding-content input:focus, .onboarding-content select:focus,
596
+ .field input:focus, .field select:focus,
437
597
  .input:focus { outline: none; border-color: var(--accent); }
438
598
  ::placeholder { color: var(--fg-3); opacity: 1; }
439
599
 
@@ -448,7 +608,11 @@ form .actions { display: flex; gap: var(--s-2); margin-top: var(--s-2); }
448
608
  .onboarding-content #ob-db-url,
449
609
  .onboarding-content #ob-db-fields,
450
610
  .onboarding-content #ob-llm-fields,
451
- .onboarding-content #ob-emb-fields { max-width: 560px; }
611
+ .onboarding-content #ob-emb-fields,
612
+ /* Settings' provider switcher obeys the same measure. A model picker stretched
613
+ across a 900px panel reads as a text field you're meant to fill in, not a
614
+ short list you pick from. */
615
+ #cfg-switch-fields { max-width: 560px; }
452
616
 
453
617
  /* Shared box treatment for both pre (code output) and div (confirm prompts) */
454
618
  .result {
@@ -485,6 +649,7 @@ pre.result {
485
649
  .badge.warn { background: var(--warn-bg); color: var(--warn); border-color: rgba(232,169,74,0.30); }
486
650
  .badge.err { background: var(--err-bg); color: var(--err); border-color: rgba(226,100,100,0.30); }
487
651
  .badge.info { background: var(--info-bg); color: var(--accent); border-color: rgba(94,140,255,0.30); }
652
+ .badge.accent { background: rgba(154,134,255,0.12); color: #9a86ff; border-color: rgba(154,134,255,0.30); }
488
653
 
489
654
  .pill {
490
655
  display: inline-flex;
@@ -508,11 +673,14 @@ pre.result {
508
673
  .pill.warn::before { background: var(--warn); }
509
674
  .pill.err { background: var(--err-bg); color: var(--err); border-color: rgba(226,100,100,0.30); }
510
675
  .pill.err::before { background: var(--err); }
676
+ .pill.info { background: var(--info-bg); color: var(--accent); border-color: rgba(94,140,255,0.30); }
677
+ .pill.info::before { background: var(--accent); }
511
678
 
512
679
  /* ════════════════════════════════════════════════════════════════════════
513
680
  Activity — causal trace log
514
681
  ════════════════════════════════════════════════════════════════════════ */
515
- .trace-filters { display: flex; gap: var(--s-2); margin-bottom: var(--s-4); }
682
+ .trace-filters { display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-4); flex-wrap: wrap; }
683
+ .filter-lbl { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-3); margin-right: var(--s-1); }
516
684
  .chip {
517
685
  height: 28px;
518
686
  padding: 0 var(--s-3);
@@ -553,6 +721,7 @@ pre.result {
553
721
  .trace-summary { flex: 1; min-width: 0; font-size: var(--t-base); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
554
722
  .trace-ns { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--fg-3); background: var(--bg-surface-2); padding: 1px 6px; border: 1px solid var(--border); flex-shrink: 0; }
555
723
  .trace-dur { color: var(--fg-3); font-family: var(--font-mono); font-size: var(--t-xs); flex-shrink: 0; min-width: 44px; text-align: right; }
724
+ .trace-sess { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--fg-3); background: var(--bg-surface-2); padding: 1px 6px; border: 1px solid var(--border); flex-shrink: 0; }
556
725
 
557
726
  .trace-detail { padding: var(--s-2) var(--s-4) var(--s-4); border-top: 1px solid var(--border); background: var(--bg-canvas); }
558
727
  .trace-block { margin-top: var(--s-4); }
@@ -659,6 +828,20 @@ table.trace-table td.audm-cell { font-size: var(--t-xs); color: var(--fg-2); whi
659
828
  }
660
829
  .modal-content form { background: transparent; border: none; padding: 0; }
661
830
 
831
+ /* Confirm dialog — native <dialog>, reusing the .modal-* internals so it reads
832
+ as the same object as every other modal in the app. */
833
+ .confirm-dlg {
834
+ border: none;
835
+ padding: 0;
836
+ background: transparent;
837
+ max-width: 440px;
838
+ width: calc(100% - var(--s-6));
839
+ margin: auto;
840
+ }
841
+ .confirm-dlg::backdrop { background: var(--bg-overlay); }
842
+ .confirm-dlg .modal-body { animation: modal-pop 120ms ease-out; }
843
+ .confirm-msg { margin: 0; color: var(--fg-2); line-height: 1.55; }
844
+
662
845
  /* Code result inside modal */
663
846
  .code-card {
664
847
  background: var(--bg-canvas);
@@ -830,7 +1013,11 @@ table.trace-table td.audm-cell { font-size: var(--t-xs); color: var(--fg-2); whi
830
1013
 
831
1014
  .provider-card-grid {
832
1015
  display: grid;
833
- grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
1016
+ /* auto-fit, not auto-fill: with six providers on a wide panel, auto-fill left
1017
+ a ragged 5 + 1 row with the last card stranded. auto-fit collapses the empty
1018
+ tracks so the cards share the row evenly. */
1019
+ grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
1020
+ align-items: stretch;
834
1021
  gap: var(--s-3);
835
1022
  }
836
1023
  .provider-card {
@@ -868,6 +1055,7 @@ table.trace-table td.audm-cell { font-size: var(--t-xs); color: var(--fg-2); whi
868
1055
  footer {
869
1056
  padding: var(--s-3) 0;
870
1057
  flex-shrink: 0;
1058
+ margin-left: var(--sidebar);
871
1059
  border-top: 1px solid var(--border);
872
1060
  background: var(--bg-surface);
873
1061
  color: var(--fg-3);
@@ -887,7 +1075,19 @@ footer .footer-inner {
887
1075
  ════════════════════════════════════════════════════════════════════════ */
888
1076
  .muted { color: var(--fg-3); }
889
1077
  .spacer { flex: 1; }
890
- .flex-row { display: flex; align-items: center; gap: var(--s-3); }
1078
+ /* visually-hidden but available to screen readers (per-route h1, skip targets) */
1079
+ .sr-only {
1080
+ position: absolute;
1081
+ width: 1px; height: 1px;
1082
+ padding: 0; margin: -1px;
1083
+ overflow: hidden;
1084
+ clip: rect(0, 0, 0, 0);
1085
+ white-space: nowrap;
1086
+ border: 0;
1087
+ }
1088
+ /* Wraps: a row of three actions (Change LLM / embedding / database) pushed
1089
+ past the viewport on a phone and scrolled the whole page sideways. */
1090
+ .flex-row { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
891
1091
  .text-sm { font-size: var(--t-sm); }
892
1092
  .text-xs { font-size: var(--t-xs); }
893
1093
 
@@ -1081,16 +1281,46 @@ footer .footer-inner {
1081
1281
  /* ── ≤ 768px — tablet / landscape phone ───────────────────────────────────── */
1082
1282
  @media (max-width: 768px) {
1083
1283
 
1084
- /* Nav: scroll horizontally instead of wrapping to a second line */
1284
+ /* Sidebar collapses back to a horizontal top bar; nav scrolls sideways */
1285
+ body > header {
1286
+ position: static;
1287
+ width: 100%;
1288
+ height: var(--header-h);
1289
+ flex-direction: row;
1290
+ align-items: center;
1291
+ gap: var(--s-2);
1292
+ padding: 0 var(--s-3);
1293
+ border-right: none;
1294
+ border-bottom: 1px solid var(--border);
1295
+ overflow: visible;
1296
+ }
1297
+ .brand { padding: 0; }
1298
+ .side-status, .side-foot { display: none; }
1085
1299
  nav {
1300
+ flex-direction: row;
1301
+ gap: var(--s-1);
1302
+ padding: 0;
1303
+ flex: 1;
1304
+ min-width: 0;
1086
1305
  overflow-x: auto;
1087
1306
  -webkit-overflow-scrolling: touch;
1088
1307
  scrollbar-width: none;
1089
- flex-shrink: 1;
1090
- min-width: 0;
1091
1308
  }
1092
1309
  nav::-webkit-scrollbar { display: none; }
1093
- nav a { white-space: nowrap; flex-shrink: 0; }
1310
+ .navgroup { flex-direction: row; gap: var(--s-1); }
1311
+ .navgroup-label { display: none; }
1312
+ nav a {
1313
+ white-space: nowrap;
1314
+ flex-shrink: 0;
1315
+ min-height: 44px; /* comfortable touch target on the collapsed top bar */
1316
+ border-left: none;
1317
+ border-bottom: 2px solid transparent;
1318
+ padding: var(--s-2) var(--s-3);
1319
+ }
1320
+ nav a.active { background: transparent; border-left: none; border-bottom-color: var(--accent); }
1321
+
1322
+ /* Sidebar offset removed when stacked */
1323
+ main, footer { margin-left: 0; }
1094
1324
 
1095
1325
  /* Reduce page horizontal padding */
1096
1326
  main { padding: var(--s-5) var(--s-4) var(--s-7); }
@@ -1166,8 +1396,9 @@ footer .footer-inner {
1166
1396
  /* Stat grid: single column */
1167
1397
  .stat-grid { grid-template-columns: 1fr; }
1168
1398
 
1169
- /* Activity list: hide namespace and duration to give summary more room */
1399
+ /* Activity list: hide namespace, session and duration to give summary more room */
1170
1400
  .trace-ns { display: none; }
1401
+ .trace-sess { display: none; }
1171
1402
  .trace-dur { display: none; }
1172
1403
 
1173
1404
  /* Wizard actions: stack Continue above Back, both full-width */
@@ -1225,8 +1456,10 @@ footer .footer-inner {
1225
1456
  .kb-stat-err { padding: var(--s-3) var(--s-4); color: var(--warn); background: var(--bg-surface); font-size: var(--t-sm); }
1226
1457
 
1227
1458
  /* sub-nav (segmented) */
1228
- .kb-subnav { display: flex; gap: var(--s-1); border-bottom: 1px solid var(--border); margin-bottom: var(--s-4); }
1229
- .kb-tab {
1459
+ /* Segmented sub-nav — Knowledge Base sections and Settings categories are the
1460
+ same control, so they are one rule set under a neutral name. */
1461
+ .kb-subnav, .subnav { display: flex; gap: var(--s-1); border-bottom: 1px solid var(--border); margin-bottom: var(--s-4); flex-wrap: wrap; }
1462
+ .kb-tab, .subtab {
1230
1463
  appearance: none;
1231
1464
  background: none;
1232
1465
  border: none;
@@ -1238,8 +1471,8 @@ footer .footer-inner {
1238
1471
  cursor: pointer;
1239
1472
  transition: color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
1240
1473
  }
1241
- .kb-tab:hover { color: var(--fg-2); }
1242
- .kb-tab.active { color: var(--fg-1); border-bottom-color: var(--accent); }
1474
+ .kb-tab:hover, .subtab:hover { color: var(--fg-2); }
1475
+ .kb-tab.active, .subtab.active { color: var(--fg-1); border-bottom-color: var(--accent); }
1243
1476
 
1244
1477
  /* master-detail layout */
1245
1478
  .kb-browser {
@@ -1449,9 +1682,14 @@ footer .footer-inner {
1449
1682
  var(--bg-canvas);
1450
1683
  overflow: hidden;
1451
1684
  }
1452
- #graph-canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
1453
- #graph-canvas:focus-visible { outline: none; box-shadow: inset var(--focus-ring); }
1454
- #graph-canvas:active { cursor: grabbing; }
1685
+ /* The React island mounts here and renders its own <canvas>. The wrapper must
1686
+ be positioned and filled: it measures itself with a ResizeObserver to size
1687
+ the canvas, and a static auto-height div inside an absolutely-positioned
1688
+ parent collapses to 0 — which renders a correctly-built graph invisibly. */
1689
+ #graph-canvas { position: absolute; inset: 0; }
1690
+ .graph-react-wrap { position: absolute; inset: 0; }
1691
+ #graph-canvas canvas { display: block; cursor: grab; touch-action: none; }
1692
+ #graph-canvas canvas:active { cursor: grabbing; }
1455
1693
 
1456
1694
  .graph-legend {
1457
1695
  position: absolute; left: var(--s-3); bottom: var(--s-3);
@@ -1467,6 +1705,14 @@ footer .footer-inner {
1467
1705
  .gl-dot.entity.topic { background: var(--etype-topic); }
1468
1706
  .gl-dot.entity.document { background: var(--etype-document); }
1469
1707
  .gl-dot.fact { background: var(--etype-fact); width: 7px; height: 7px; }
1708
+ /* Graph legend now names clusters; --fg-4 is the neutral every uncoloured
1709
+ cluster is painted in, so the "other" swatch has to match it exactly. */
1710
+ .gl-dot.other { background: var(--fg-4); }
1711
+ .gl-n { color: var(--fg-4); font-family: var(--font-mono); font-size: var(--t-xs); }
1712
+ .gl-k { color: var(--fg-3); }
1713
+ /* Swatches sit flush as one bar when several share a meaning. */
1714
+ .gl-item .gl-dot + .gl-dot { margin-left: -1px; }
1715
+ .gl-item .gl-dot:not(:last-of-type) { border-radius: 0; }
1470
1716
 
1471
1717
  .graph-zoom {
1472
1718
  position: absolute; right: var(--s-3); bottom: var(--s-3);
@@ -1497,3 +1743,524 @@ footer .footer-inner {
1497
1743
  @media (max-width: 920px) {
1498
1744
  .graph-stage { height: calc(100vh - var(--header-h) - 260px); }
1499
1745
  }
1746
+
1747
+ /* ════════════════════════════════════════════════════════════════════════
1748
+ Icons — one 16px monoline family (icons.js). Wayfinding, never decoration:
1749
+ sidebar, action buttons, ⌘K groups. Colour comes from the parent, so an
1750
+ icon is always the same weight as the label beside it.
1751
+ ════════════════════════════════════════════════════════════════════════ */
1752
+ .ic { width: 16px; height: 16px; flex: none; display: block; }
1753
+
1754
+ nav a .ic { color: var(--fg-4); transition: color var(--dur-1) var(--ease); }
1755
+ nav a:hover .ic { color: var(--fg-2); }
1756
+ nav a.active .ic { color: var(--accent); }
1757
+
1758
+ .btn .ic { color: var(--fg-3); transition: color var(--dur-1) var(--ease); }
1759
+ .btn:hover .ic { color: var(--fg-2); }
1760
+ .btn.primary .ic, .btn.danger .ic { color: currentColor; }
1761
+ .btn:disabled .ic { color: var(--fg-4); }
1762
+
1763
+ kbd {
1764
+ font: 500 var(--t-xs)/1 var(--font-mono);
1765
+ color: var(--fg-3);
1766
+ background: var(--bg-surface-2);
1767
+ border: 1px solid var(--border-2);
1768
+ border-radius: var(--radius-1);
1769
+ padding: 3px 5px;
1770
+ }
1771
+
1772
+ /* ════════════════════════════════════════════════════════════════════════
1773
+ ⌘K trigger (sidebar) — the bar is the product, so it gets a permanent
1774
+ control, not just a hidden shortcut.
1775
+ ════════════════════════════════════════════════════════════════════════ */
1776
+ .cmdk-trigger {
1777
+ display: flex;
1778
+ align-items: center;
1779
+ gap: var(--s-2);
1780
+ margin: 0 var(--s-3) var(--s-3);
1781
+ padding: 0 var(--s-2) 0 var(--s-3);
1782
+ height: 32px;
1783
+ background: var(--bg-canvas);
1784
+ border: 1px solid var(--border-2);
1785
+ color: var(--fg-3);
1786
+ font: 500 var(--t-base) var(--font-ui);
1787
+ text-align: left;
1788
+ cursor: pointer;
1789
+ transition: border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
1790
+ }
1791
+ .cmdk-trigger:hover { border-color: var(--border-strong); color: var(--fg-2); }
1792
+ .cmdk-trigger .ic { color: var(--fg-4); }
1793
+ .cmdk-trigger:hover .ic { color: var(--fg-2); }
1794
+ .cmdk-trigger-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1795
+
1796
+ /* ════════════════════════════════════════════════════════════════════════
1797
+ System banner — the loud channel. Only rendered for a state the user has
1798
+ to act on; every banner carries the reason AND the button that fixes it.
1799
+ ════════════════════════════════════════════════════════════════════════ */
1800
+ .sysbanner {
1801
+ display: flex;
1802
+ align-items: flex-start;
1803
+ gap: var(--s-3);
1804
+ padding: var(--s-3) var(--s-4);
1805
+ margin-bottom: var(--s-5);
1806
+ border: 1px solid var(--border-2);
1807
+ background: var(--bg-surface);
1808
+ font-size: var(--t-base);
1809
+ }
1810
+ .sysbanner.err { border-color: rgba(255, 90, 82, 0.35); background: var(--err-bg); }
1811
+ .sysbanner.warn { border-color: rgba(245, 181, 68, 0.35); background: var(--warn-bg); }
1812
+ .sysbanner-ic { flex: none; margin-top: 2px; }
1813
+ .sysbanner.err .sysbanner-ic { color: var(--err); }
1814
+ .sysbanner.warn .sysbanner-ic { color: var(--warn); }
1815
+ .sysbanner-text { flex: 1; min-width: 0; max-width: 88ch; color: var(--fg-2); line-height: 1.5; }
1816
+ .sysbanner-text strong { color: var(--fg-1); font-weight: 600; margin-right: 4px; }
1817
+ .sysbanner .btn { flex: none; margin-top: -2px; }
1818
+
1819
+ /* ════════════════════════════════════════════════════════════════════════
1820
+ System readout — four live probes, docked under the stat strip so the
1821
+ counts and the reason they might be wrong read as one instrument.
1822
+ ════════════════════════════════════════════════════════════════════════ */
1823
+ .sysrow {
1824
+ display: grid;
1825
+ grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
1826
+ gap: 1px;
1827
+ background: var(--border);
1828
+ border: 1px solid var(--border);
1829
+ border-top: none;
1830
+ }
1831
+ .sysrow:empty { display: none; }
1832
+ .syscell {
1833
+ background: var(--bg-surface);
1834
+ padding: var(--s-3) var(--s-5);
1835
+ display: flex;
1836
+ flex-direction: column;
1837
+ gap: 3px;
1838
+ min-width: 0;
1839
+ }
1840
+ .syscell-k { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-3); font-weight: 500; }
1841
+ .syscell-v {
1842
+ display: flex; align-items: center; gap: var(--s-2); min-width: 0;
1843
+ font: 500 var(--t-md) var(--font-mono); color: var(--fg-2);
1844
+ overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
1845
+ }
1846
+ .syscell-v .sq { width: 7px; height: 7px; flex: none; background: var(--fg-4); }
1847
+ .syscell-v.ok { color: var(--fg-1); } .syscell-v.ok .sq { background: var(--ok); }
1848
+ .syscell-v.warn { color: var(--warn); } .syscell-v.warn .sq { background: var(--warn); }
1849
+ .syscell-v.err { color: var(--err); } .syscell-v.err .sq { background: var(--err); }
1850
+ .syscell-sub { font-size: var(--t-xs); color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1851
+
1852
+ /* ════════════════════════════════════════════════════════════════════════
1853
+ Most recalled — the honest answer to "is memory storing the right things?"
1854
+ ════════════════════════════════════════════════════════════════════════ */
1855
+ .home-hot { margin-top: var(--s-4); }
1856
+ .home-h-ic { display: inline-flex; vertical-align: -3px; margin-right: 6px; color: var(--fg-3); }
1857
+ .hotlist { list-style: none; margin: 0; padding: 0; }
1858
+ .hotrow { border-top: 1px solid var(--border); }
1859
+ .hotrow:first-child { border-top: none; }
1860
+ .hotrow-btn {
1861
+ display: flex;
1862
+ align-items: center;
1863
+ gap: var(--s-3);
1864
+ width: 100%;
1865
+ padding: var(--s-2) var(--s-2) var(--s-2) 0;
1866
+ background: none;
1867
+ border: none;
1868
+ text-align: left;
1869
+ color: inherit;
1870
+ font: inherit;
1871
+ cursor: pointer;
1872
+ transition: background var(--dur-1) var(--ease);
1873
+ }
1874
+ .hotrow-btn:hover { background: var(--bg-surface-2); }
1875
+ .hotrow-btn:hover .hotrow-text { color: var(--fg-1); }
1876
+ .hotrow-text { flex: 1; min-width: 0; color: var(--fg-2); font-size: var(--t-base); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1877
+ .hotrow-n { flex: none; font: 500 var(--t-sm) var(--font-mono); color: var(--fg-3); }
1878
+
1879
+ /* ════════════════════════════════════════════════════════════════════════
1880
+ ⌘K command bar — native <dialog>, so focus trap / backdrop / Escape are
1881
+ the platform's job. Three implicit modes; see DESIGN.md › Global ⌘K.
1882
+ ════════════════════════════════════════════════════════════════════════ */
1883
+ .cmdk {
1884
+ padding: 0;
1885
+ border: none;
1886
+ background: none;
1887
+ width: min(640px, calc(100vw - 2 * var(--s-4)));
1888
+ max-width: none;
1889
+ margin: 12vh auto auto;
1890
+ color: var(--fg-1);
1891
+ }
1892
+ .cmdk::backdrop { background: rgba(8, 9, 11, 0.72); }
1893
+ .cmdk-panel {
1894
+ display: flex;
1895
+ flex-direction: column;
1896
+ max-height: 62vh;
1897
+ background: var(--surface-1);
1898
+ border: 1px solid var(--border-strong);
1899
+ box-shadow: var(--shadow-pop);
1900
+ }
1901
+ .cmdk[open] .cmdk-panel { animation: cmdk-in var(--dur-2) var(--ease); }
1902
+ @keyframes cmdk-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
1903
+
1904
+ .cmdk-inputrow {
1905
+ display: flex; align-items: center; gap: var(--s-3);
1906
+ padding: var(--s-3) var(--s-4);
1907
+ border-bottom: 1px solid var(--border);
1908
+ }
1909
+ .cmdk-inputic { display: flex; color: var(--fg-3); }
1910
+ .cmdk.composing .cmdk-inputic { color: var(--accent); }
1911
+ .cmdk-inputrow input {
1912
+ flex: 1; min-width: 0; height: 28px;
1913
+ background: none; border: none; outline: none; box-shadow: none;
1914
+ color: var(--fg-1);
1915
+ font: var(--t-lg) var(--font-ui);
1916
+ }
1917
+ .cmdk-inputrow input::placeholder { color: var(--fg-3); }
1918
+ .cmdk-inputrow input:focus { outline: none; box-shadow: none; }
1919
+
1920
+ .cmdk-list { list-style: none; margin: 0; padding: var(--s-1) 0 var(--s-2); overflow-y: auto; flex: 1; }
1921
+ .cmdk-group {
1922
+ padding: var(--s-3) var(--s-4) var(--s-1);
1923
+ font: 600 var(--t-xs) var(--font-ui);
1924
+ text-transform: uppercase; letter-spacing: 0.1em;
1925
+ color: var(--fg-3);
1926
+ }
1927
+ .cmdk-row {
1928
+ display: flex; align-items: center; gap: var(--s-3);
1929
+ padding: var(--s-2) var(--s-4);
1930
+ color: var(--fg-2);
1931
+ cursor: pointer;
1932
+ }
1933
+ .cmdk-row.on { background: var(--brand-tint); color: var(--fg-1); box-shadow: inset 2px 0 0 var(--accent); }
1934
+ .cmdk-ic { display: flex; flex: none; color: var(--fg-4); }
1935
+ .cmdk-row.on .cmdk-ic { color: var(--accent); }
1936
+ .cmdk-label { flex: 1; min-width: 0; font-size: var(--t-md); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1937
+ .cmdk-hint { flex: none; max-width: 38%; font-size: var(--t-sm); color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1938
+ .cmdk-meta { flex: none; font: var(--t-xs) var(--font-mono); color: var(--fg-3); }
1939
+ .cmdk-note {
1940
+ display: flex; align-items: flex-start; gap: var(--s-3);
1941
+ padding: var(--s-4);
1942
+ color: var(--fg-3); font-size: var(--t-base); line-height: 1.55;
1943
+ }
1944
+ .cmdk-note .ic { color: var(--fg-4); margin-top: 3px; }
1945
+ .cmdk-note > span { min-width: 0; }
1946
+ .cmdk-note strong { color: var(--fg-2); }
1947
+ .cmdk-foot {
1948
+ display: flex; align-items: center; gap: var(--s-4);
1949
+ padding: var(--s-2) var(--s-4);
1950
+ border-top: 1px solid var(--border);
1951
+ background: var(--bg-surface-2);
1952
+ font-size: var(--t-xs); color: var(--fg-3);
1953
+ }
1954
+ .cmdk-foot kbd { margin-right: 3px; }
1955
+ .cmdk-status { margin-left: auto; font-family: var(--font-mono); text-align: right; }
1956
+ /* Composing a fact: ↑/↓/↵ mean something else, so don't advertise them. */
1957
+ .cmdk.composing .cmdk-keyhint { display: none; }
1958
+
1959
+ /* ════════════════════════════════════════════════════════════════════════
1960
+ Knowledge Base — documents tab + tab icons
1961
+ ════════════════════════════════════════════════════════════════════════ */
1962
+ .kb-tab, .subtab { display: inline-flex; align-items: center; gap: 6px; }
1963
+ .kb-tab .ic, .subtab .ic { color: var(--fg-4); transition: color var(--dur-1) var(--ease); }
1964
+ .kb-tab:hover .ic, .subtab:hover .ic { color: var(--fg-3); }
1965
+ .kb-tab.active .ic, .subtab.active .ic { color: var(--accent); }
1966
+ .kb-entity-title .ic { color: var(--fg-3); }
1967
+
1968
+ .kb-doc-body {
1969
+ margin: 0;
1970
+ max-height: 420px;
1971
+ overflow: auto;
1972
+ padding: var(--s-3);
1973
+ background: var(--bg-canvas);
1974
+ border: 1px solid var(--border);
1975
+ font: var(--t-sm)/1.6 var(--font-mono);
1976
+ color: var(--fg-2);
1977
+ white-space: pre-wrap;
1978
+ word-break: break-word;
1979
+ }
1980
+
1981
+ /* ── responsive ─────────────────────────────────────────────────────────── */
1982
+ @media (max-width: 768px) {
1983
+ /* Sidebar becomes a top bar: the trigger collapses to its icon. */
1984
+ .cmdk-trigger { margin: 0; width: 34px; flex: none; justify-content: center; padding: 0; }
1985
+ .cmdk-trigger .cmdk-trigger-label, .cmdk-trigger kbd { display: none; }
1986
+ .cmdk { margin-top: var(--s-6); }
1987
+ .cmdk-panel { max-height: 76vh; }
1988
+ .cmdk-hint { display: none; }
1989
+ .sysbanner { flex-wrap: wrap; }
1990
+ .sysbanner .btn { margin-left: calc(16px + var(--s-3)); }
1991
+ }
1992
+
1993
+ /* ════════════════════════════════════════════════════════════════════════
1994
+ Bounded lists + calmer detail panes
1995
+ Long lists were growing the PAGE instead of scrolling themselves: Activity
1996
+ reached 2614px inside a 950px viewport, so the header, filters and the
1997
+ detail pane all scrolled away while you read. Each list now owns its own
1998
+ scroll and the page stays put.
1999
+ ════════════════════════════════════════════════════════════════════════ */
2000
+ .trace-list {
2001
+ max-height: calc(100vh - 340px);
2002
+ min-height: 240px;
2003
+ overflow-y: auto;
2004
+ }
2005
+
2006
+ /* Detail pane scrolls independently and tops out level with the list beside
2007
+ it, so selecting a long fact can't push the layout around. */
2008
+ .kb-detail {
2009
+ max-height: 560px;
2010
+ overflow-y: auto;
2011
+ }
2012
+
2013
+ /* The fact IS the page — it was rendering at the same weight as its own
2014
+ metadata. Give it the room to read as the subject. */
2015
+ .kb-fact-body {
2016
+ font-size: var(--t-lg);
2017
+ line-height: 1.55;
2018
+ color: var(--fg-1);
2019
+ margin-bottom: var(--s-5);
2020
+ }
2021
+
2022
+ /* A document title can be a 64-char content hash (`thought:<sha256>`), which
2023
+ ran the full width and pushed the action button off the edge. Clamp it and
2024
+ keep the full value in the Provenance block below. */
2025
+ .kb-entity-title {
2026
+ min-width: 0;
2027
+ overflow: hidden;
2028
+ text-overflow: ellipsis;
2029
+ white-space: nowrap;
2030
+ }
2031
+ .kb-detail-head > div:first-child { min-width: 0; flex: 1; }
2032
+ .kb-detail-head .btn { flex: none; }
2033
+
2034
+ /* Machine values (uids, hashes, paths) break anywhere rather than forcing the
2035
+ column wider than the pane. */
2036
+ .kb-kv .row .v { overflow-wrap: anywhere; word-break: break-word; }
2037
+
2038
+ /* Provenance is context, not the headline — quieter than the fact above it. */
2039
+ .kb-block .trace-block-h { color: var(--fg-3); }
2040
+ .kb-kv { background: transparent; }
2041
+ .kb-kv .row { padding: var(--s-2) var(--s-3); }
2042
+
2043
+ /* Forget destroys a memory; it should read that way rather than as a link.
2044
+ Needs to out-specify `.btn.ghost`, which sets the muted colour. */
2045
+ .btn.ghost.kb-forget { color: var(--err); }
2046
+ .btn.ghost.kb-forget:hover { background: var(--err-bg); border-color: rgba(255, 90, 82, 0.35); color: var(--err); }
2047
+
2048
+ @media (max-width: 920px) {
2049
+ .kb-detail { max-height: none; }
2050
+ .trace-list { max-height: none; min-height: 0; }
2051
+ }
2052
+
2053
+ /* ── Button busy state ────────────────────────────────────────────────────
2054
+ Refresh fired silently: a fast reload looked like nothing happened and a
2055
+ slow one gave no sign it was working, so people clicked again. Spin the
2056
+ button's own icon rather than adding a separate spinner. */
2057
+ .btn.is-busy { pointer-events: none; color: var(--fg-3); }
2058
+ .btn.is-busy .ic { animation: btn-spin 700ms linear infinite; transform-origin: 50% 50%; }
2059
+ @keyframes btn-spin { to { transform: rotate(360deg); } }
2060
+
2061
+ /* Reduced motion still needs to SAY something — the global rule collapses the
2062
+ animation to nothing, which would leave no feedback at all. */
2063
+ @media (prefers-reduced-motion: reduce) {
2064
+ .btn.is-busy { opacity: 0.55; }
2065
+ .btn.is-busy .ic { animation: none; }
2066
+ }
2067
+
2068
+ /* ════════════════════════════════════════════════════════════════════════
2069
+ Settings — rendered from the daemon's schema (settings.js)
2070
+ A rail of categories beside a panel of rows. Nine categories outgrow
2071
+ horizontal tabs; a vertical list has room for a label per row and keeps
2072
+ working as the schema grows. Advanced is folded until asked for.
2073
+ ════════════════════════════════════════════════════════════════════════ */
2074
+ .set-shell {
2075
+ display: grid;
2076
+ grid-template-columns: 208px minmax(0, 1fr);
2077
+ gap: var(--s-6);
2078
+ align-items: start;
2079
+ border-top: 1px solid var(--border);
2080
+ padding-top: var(--s-5);
2081
+ }
2082
+
2083
+ /* The rail sits inside a page that already has an app sidebar, so it stays
2084
+ unfilled — a column of type, not a second slab of chrome competing with it. */
2085
+ .set-nav {
2086
+ position: sticky;
2087
+ top: var(--s-4);
2088
+ display: flex;
2089
+ flex-direction: column;
2090
+ gap: var(--s-1);
2091
+ min-width: 0;
2092
+ }
2093
+ .set-search { position: relative; display: flex; align-items: center; margin-bottom: var(--s-3); }
2094
+ .set-search .ic { position: absolute; left: var(--s-3); color: var(--fg-4); pointer-events: none; }
2095
+ .set-search input {
2096
+ width: 100%; height: 32px; padding: 0 var(--s-3) 0 calc(var(--s-3) + 22px);
2097
+ background: var(--bg-canvas); border: 1px solid var(--border-2); color: var(--fg-1);
2098
+ font: var(--t-base) var(--font-ui);
2099
+ }
2100
+ .set-search input:focus { outline: none; border-color: var(--accent); }
2101
+
2102
+ /* Groups separate the two halves; nothing is folded away, so every category
2103
+ stays one click from anywhere. */
2104
+ .set-nav-section { display: flex; flex-direction: column; gap: 1px; }
2105
+ .set-nav-section + .set-nav-section { margin-top: var(--s-4); }
2106
+ .set-nav-group {
2107
+ display: flex; align-items: center; gap: 6px;
2108
+ padding: var(--s-2) var(--s-2) var(--s-1);
2109
+ font-size: var(--t-xs); font-weight: 600;
2110
+ text-transform: uppercase; letter-spacing: 0.12em;
2111
+ color: var(--fg-3);
2112
+ }
2113
+
2114
+ .set-nav-item {
2115
+ display: flex; align-items: center; gap: var(--s-2);
2116
+ width: 100%; padding: var(--s-2);
2117
+ background: none; border: none; border-left: 2px solid transparent;
2118
+ color: var(--fg-2); font: 500 var(--t-base) var(--font-ui);
2119
+ text-align: left; cursor: pointer;
2120
+ transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
2121
+ }
2122
+ .set-nav-item span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
2123
+ .set-nav-item .ic { color: var(--fg-4); flex: none; }
2124
+ .set-nav-item:hover { background: var(--bg-surface-2); color: var(--fg-1); }
2125
+ .set-nav-item.active { background: var(--brand-tint); border-left-color: var(--accent); color: var(--fg-1); }
2126
+ .set-nav-item.active .ic { color: var(--accent); }
2127
+ .set-nav-item.dim { opacity: 0.4; }
2128
+ .set-nav-count { flex: none; font: 500 var(--t-xs) var(--font-mono); color: var(--fg-4); }
2129
+
2130
+ .set-panel { min-width: 0; }
2131
+ .set-panel-head { margin-bottom: var(--s-4); }
2132
+ .set-panel-head h3 { margin: 0; font-size: var(--t-xl); font-weight: 600; letter-spacing: -0.015em; color: var(--fg-1); }
2133
+ .set-panel-head p { margin: var(--s-2) 0 0; color: var(--fg-3); font-size: var(--t-sm); line-height: 1.55; max-width: 76ch; }
2134
+ .set-body { padding-bottom: var(--s-7); }
2135
+
2136
+ /* An extra category's body is hand-written markup rather than generated rows,
2137
+ so it gets the vertical rhythm .set-row would otherwise have supplied. */
2138
+ .set-extra-head {
2139
+ margin: 0 0 var(--s-1);
2140
+ font-size: var(--t-md);
2141
+ font-weight: 600;
2142
+ letter-spacing: -0.01em;
2143
+ color: var(--fg-1);
2144
+ }
2145
+ * + .set-extra-head { margin-top: var(--s-6); }
2146
+ .set-body-extra .table-wrap,
2147
+ .set-body-extra .methods-grid { margin-top: var(--s-3); }
2148
+ .danger-panel { border-color: var(--err); }
2149
+
2150
+ /* Checkbox beside its label. `.field` is display:block, so the pattern this
2151
+ replaces stacked the box above the text no matter what flex it asked for. */
2152
+ .check-row { display: flex; align-items: center; gap: var(--s-2); cursor: pointer; }
2153
+ .check-row > span { color: var(--fg-2); font-size: var(--t-sm); }
2154
+
2155
+ /* A settings row: what it is on the left, the control on the right. */
2156
+ .set-row {
2157
+ display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
2158
+ gap: var(--s-5); align-items: center;
2159
+ padding: var(--s-4) 0; border-top: 1px solid var(--border);
2160
+ }
2161
+ .set-row:first-child { border-top: none; }
2162
+ .set-row.invalid { background: var(--err-bg); box-shadow: inset 2px 0 0 var(--err); }
2163
+ .set-row-text { min-width: 0; }
2164
+ .set-row-label { display: block; color: var(--fg-1); font-size: var(--t-md); font-weight: 500; }
2165
+ .set-row-help { margin: var(--s-1) 0 0; color: var(--fg-3); font-size: var(--t-sm); line-height: 1.55; max-width: 70ch; }
2166
+ .set-row-error { color: var(--err); font-size: var(--t-sm); margin-top: var(--s-2); }
2167
+ .set-row-error:empty { display: none; }
2168
+ .set-row-control { display: flex; justify-content: flex-end; align-items: center; min-width: 0; }
2169
+ .set-row-control > * { width: 100%; }
2170
+
2171
+ .set-restart {
2172
+ margin-left: var(--s-2);
2173
+ font: 500 var(--t-xs)/1 var(--font-mono);
2174
+ color: var(--warn); background: var(--warn-bg);
2175
+ border: 1px solid rgba(245, 181, 68, 0.35);
2176
+ padding: 2px 5px; vertical-align: middle;
2177
+ }
2178
+
2179
+ /* Switch — a state you flip. Sharp, like everything else here. */
2180
+ .set-switch { appearance: none; background: none; border: none; padding: 0; cursor: pointer; width: auto !important; }
2181
+ .set-switch-track {
2182
+ display: block; width: 38px; height: 20px; position: relative;
2183
+ background: var(--bg-surface-3); border: 1px solid var(--border-2);
2184
+ transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
2185
+ }
2186
+ .set-switch-thumb {
2187
+ position: absolute; top: 2px; left: 2px; width: 14px; height: 14px;
2188
+ background: var(--fg-3);
2189
+ transition: transform var(--dur-2) var(--ease), background var(--dur-1) var(--ease);
2190
+ }
2191
+ .set-switch[aria-checked="true"] .set-switch-track { background: var(--brand-tint); border-color: var(--accent); }
2192
+ .set-switch[aria-checked="true"] .set-switch-thumb { transform: translateX(18px); background: var(--accent); }
2193
+ .set-switch:focus-visible { outline: none; }
2194
+ .set-switch:focus-visible .set-switch-track { box-shadow: var(--focus-ring); }
2195
+
2196
+ /* Segmented enum — the options are visible without opening anything. */
2197
+ .set-segmented { display: inline-flex; border: 1px solid var(--border-2); background: var(--bg-canvas); width: auto !important; }
2198
+ .set-seg {
2199
+ appearance: none; background: none; border: none; cursor: pointer;
2200
+ padding: 0 var(--s-3); height: 30px;
2201
+ color: var(--fg-3); font: 500 var(--t-sm) var(--font-ui);
2202
+ transition: color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
2203
+ }
2204
+ .set-seg + .set-seg { border-left: 1px solid var(--border-2); }
2205
+ .set-seg:hover { color: var(--fg-2); }
2206
+ .set-seg.on { background: var(--brand-tint); color: var(--fg-1); }
2207
+
2208
+ /* Range — a threshold is a position, so show where it sits AND its value. */
2209
+ .set-range { display: flex; align-items: center; gap: var(--s-3); }
2210
+ .set-range input[type="range"] {
2211
+ flex: 1; min-width: 0; height: 20px; padding: 0; appearance: none;
2212
+ background: none; border: none; cursor: pointer;
2213
+ }
2214
+ .set-range input[type="range"]::-webkit-slider-runnable-track { height: 3px; background: var(--bg-surface-3); border: none; }
2215
+ .set-range input[type="range"]::-webkit-slider-thumb {
2216
+ appearance: none; margin-top: -5px;
2217
+ width: 13px; height: 13px; background: var(--accent); border: none;
2218
+ transition: transform var(--dur-1) var(--ease);
2219
+ }
2220
+ .set-range input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.15); }
2221
+ .set-range input[type="range"]::-moz-range-track { height: 3px; background: var(--bg-surface-3); border: none; }
2222
+ .set-range input[type="range"]::-moz-range-thumb { width: 13px; height: 13px; background: var(--accent); border: none; border-radius: 0; }
2223
+ .set-range input[type="range"]:focus-visible { outline: none; box-shadow: var(--focus-ring); }
2224
+ .set-range-out {
2225
+ flex: none; min-width: 52px; text-align: right;
2226
+ font: 500 var(--t-sm) var(--font-mono); color: var(--fg-1);
2227
+ font-feature-settings: 'zero' on;
2228
+ }
2229
+
2230
+ .set-input { text-align: right; font-family: var(--font-mono); }
2231
+
2232
+ /* Save bar — one, and only once there is something to save. */
2233
+ .set-bar {
2234
+ position: sticky; bottom: 0; z-index: 5;
2235
+ display: flex; align-items: center; gap: var(--s-2);
2236
+ padding: var(--s-3) var(--s-4);
2237
+ background: var(--bg-surface); border: 1px solid var(--border-2);
2238
+ box-shadow: var(--shadow-2);
2239
+ transform: translateY(calc(100% + var(--s-5)));
2240
+ opacity: 0; pointer-events: none;
2241
+ transition: transform var(--dur-2) var(--ease), opacity var(--dur-2) var(--ease);
2242
+ }
2243
+ .set-bar.on { transform: translateY(0); opacity: 1; pointer-events: auto; }
2244
+ .set-bar-count { margin-right: auto; font-size: var(--t-sm); color: var(--fg-2); }
2245
+
2246
+ @media (prefers-reduced-motion: reduce) {
2247
+ .set-bar { transition: opacity 0.01ms; transform: none; }
2248
+ .set-switch-thumb { transition: none; }
2249
+ }
2250
+
2251
+ /* Below the split, the rail becomes a scrolling strip above the panel rather
2252
+ than a second column squeezing the controls. */
2253
+ @media (max-width: 900px) {
2254
+ .set-shell { grid-template-columns: 1fr; gap: var(--s-4); }
2255
+ .set-nav { position: static; }
2256
+ .set-nav-section { flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--s-1); }
2257
+ .set-nav-section + .set-nav-section { margin-top: var(--s-2); }
2258
+ .set-nav-group { padding: 0 var(--s-2) 0 0; }
2259
+ .set-nav-item { width: auto; border-left: none; border-bottom: 2px solid transparent; }
2260
+ .set-nav-item.active { border-left: none; border-bottom-color: var(--accent); }
2261
+ }
2262
+ @media (max-width: 720px) {
2263
+ .set-row { grid-template-columns: 1fr; gap: var(--s-3); align-items: start; }
2264
+ .set-row-control { justify-content: flex-start; }
2265
+ .set-row-control > * { width: auto; min-width: 200px; }
2266
+ }