@tacoshell/shell 0.0.0-stage → 0.1.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 (52) hide show
  1. package/LICENSE +28 -0
  2. package/README.md +6 -2
  3. package/package.json +40 -4
  4. package/src/background.ts +41 -0
  5. package/src/core/bus.ts +186 -0
  6. package/src/core/cards.ts +33 -0
  7. package/src/core/cron.ts +63 -0
  8. package/src/core/cronfriendly.ts +70 -0
  9. package/src/core/csv.ts +36 -0
  10. package/src/core/datasets.ts +276 -0
  11. package/src/core/domshot.ts +81 -0
  12. package/src/core/guards.ts +36 -0
  13. package/src/core/hosts.ts +15 -0
  14. package/src/core/hotkeys.ts +44 -0
  15. package/src/core/localdata.ts +88 -0
  16. package/src/core/log.ts +91 -0
  17. package/src/core/markdown.ts +57 -0
  18. package/src/core/nav.ts +102 -0
  19. package/src/core/notifyrules.ts +31 -0
  20. package/src/core/page.ts +81 -0
  21. package/src/core/prefs.ts +114 -0
  22. package/src/core/router.ts +78 -0
  23. package/src/core/search.ts +65 -0
  24. package/src/core/services.ts +161 -0
  25. package/src/core/sessions.ts +72 -0
  26. package/src/core/startpage.ts +28 -0
  27. package/src/core/storage.ts +54 -0
  28. package/src/core/systemtools.ts +85 -0
  29. package/src/core/tabfit.ts +30 -0
  30. package/src/core/templates.ts +48 -0
  31. package/src/core/toasts.ts +13 -0
  32. package/src/core/vault.ts +208 -0
  33. package/src/env.d.ts +2 -0
  34. package/src/index.ts +56 -0
  35. package/src/styles.css +288 -0
  36. package/src/types.ts +113 -0
  37. package/src/ui/App.tsx +229 -0
  38. package/src/ui/ClearableInput.tsx +23 -0
  39. package/src/ui/Icon.tsx +8 -0
  40. package/src/ui/Markdown.tsx +24 -0
  41. package/src/ui/Rail.tsx +89 -0
  42. package/src/ui/Search.tsx +111 -0
  43. package/src/ui/Sessions.tsx +72 -0
  44. package/src/ui/SidePanel.tsx +148 -0
  45. package/src/ui/TabBar.tsx +56 -0
  46. package/src/ui/ViewHost.tsx +122 -0
  47. package/src/ui/hooks.ts +21 -0
  48. package/src/ui/settings/Datasets.tsx +162 -0
  49. package/src/ui/settings/ReleaseNotes.tsx +19 -0
  50. package/src/ui/settings/ScheduleEditor.tsx +57 -0
  51. package/src/ui/settings/Settings.tsx +328 -0
  52. package/src/ui/settings/Templates.tsx +52 -0
@@ -0,0 +1,208 @@
1
+ // The vault (CommunityOS SECURITY.md crypto parameters; ADR-031, ADR-042).
2
+ // PBKDF2-SHA256 → AES-GCM-256, a fresh 12-byte IV per item, a verifier to check the passphrase.
3
+ // The unlocked key lives only in chrome.storage.session (memory, cleared when the browser closes); the idle lock removes it.
4
+ // While locked, reads and writes WAIT for the unlock prompt instead of failing, so a bulk run pauses and resumes.
5
+
6
+ import * as store from './storage.ts';
7
+
8
+ const FILE = 'taco.vault';
9
+ const SESSION_KEY = 'taco.vaultKey';
10
+ export const LOCK_REASON = 'taco.lockReason';
11
+ const VERIFIER = 'taco-vault-verifier-v1';
12
+ const enc = new TextEncoder();
13
+ const dec = new TextDecoder();
14
+
15
+ interface Sealed { iv: string; ct: string }
16
+ interface VaultFile { v: 1; salt: string; iterations: number; verifier: Sealed; items: Record<string, Sealed> }
17
+ export type VaultStatus = 'uninitialized' | 'locked' | 'unlocked';
18
+
19
+ function b64(bytes: Uint8Array): string {
20
+ let s = '';
21
+ for (let i = 0; i < bytes.length; i += 0x8000) s += String.fromCharCode(...bytes.subarray(i, i + 0x8000));
22
+ return btoa(s);
23
+ }
24
+ const unb64 = (s: string) => Uint8Array.from(atob(s), (ch) => ch.charCodeAt(0));
25
+
26
+ async function derive(passphrase: string, salt: Uint8Array, iterations: number): Promise<CryptoKey> {
27
+ const base = await crypto.subtle.importKey('raw', enc.encode(passphrase), 'PBKDF2', false, ['deriveKey']);
28
+ return crypto.subtle.deriveKey({ name: 'PBKDF2', hash: 'SHA-256', salt: salt as BufferSource, iterations }, base, { name: 'AES-GCM', length: 256 }, true, ['encrypt', 'decrypt']);
29
+ }
30
+ async function seal(key: CryptoKey, text: string): Promise<Sealed> {
31
+ const iv = crypto.getRandomValues(new Uint8Array(12));
32
+ const ct = new Uint8Array(await crypto.subtle.encrypt({ name: 'AES-GCM', iv }, key, enc.encode(text)));
33
+ return { iv: b64(iv), ct: b64(ct) };
34
+ }
35
+ async function open(key: CryptoKey, s: Sealed): Promise<string> {
36
+ return dec.decode(await crypto.subtle.decrypt({ name: 'AES-GCM', iv: unb64(s.iv) as BufferSource }, key, unb64(s.ct) as BufferSource));
37
+ }
38
+
39
+ let file: VaultFile | undefined;
40
+ let key: CryptoKey | null = null;
41
+ let loaded = false;
42
+ const listeners = new Set<(s: VaultStatus) => void>();
43
+ let waiters: (() => void)[] = [];
44
+ /** Set by the UI: shows the one shared unlock prompt when something waits on a locked vault. */
45
+ let unlockPrompt: (() => void) | undefined;
46
+
47
+ const emit = () => { const s = status(); for (const fn of listeners) fn(s); };
48
+
49
+ export function status(): VaultStatus {
50
+ if (!file) return 'uninitialized';
51
+ return key ? 'unlocked' : 'locked';
52
+ }
53
+
54
+ /** Loads the vault and picks up a key unlocked in another tab of this browser session. Safe to call twice. */
55
+ export async function init() {
56
+ if (loaded) return;
57
+ loaded = true;
58
+ file = await store.get<VaultFile>('local', FILE);
59
+ const raw = await store.get<string>('session', SESSION_KEY);
60
+ if (file && raw) key = await crypto.subtle.importKey('raw', unb64(raw) as BufferSource, 'AES-GCM', true, ['encrypt', 'decrypt']);
61
+ // The idle lock (service worker) or another tab removes the session key: lock here too.
62
+ store.onChange('session', SESSION_KEY, (v) => { if (!v && key) { key = null; emit(); } });
63
+ emit();
64
+ }
65
+
66
+ export const subscribe = (fn: (s: VaultStatus) => void) => { listeners.add(fn); return () => listeners.delete(fn); };
67
+ export const setUnlockPrompt = (fn: () => void) => { unlockPrompt = fn; };
68
+
69
+ async function remember(k: CryptoKey) {
70
+ key = k;
71
+ await store.set('session', SESSION_KEY, b64(new Uint8Array(await crypto.subtle.exportKey('raw', k))));
72
+ await store.remove('session', LOCK_REASON);
73
+ const ready = waiters;
74
+ waiters = [];
75
+ ready.forEach((fn) => fn());
76
+ emit();
77
+ }
78
+
79
+ export async function create(passphrase: string, { minLength = 4, iterations = 600000 } = {}) {
80
+ if (file) throw new Error('A vault already exists.');
81
+ if (passphrase.length < minLength) throw new Error(`Use at least ${minLength} characters.`);
82
+ const salt = crypto.getRandomValues(new Uint8Array(16));
83
+ const k = await derive(passphrase, salt, iterations);
84
+ file = { v: 1, salt: b64(salt), iterations, verifier: await seal(k, VERIFIER), items: {} };
85
+ await store.set('local', FILE, file);
86
+ await remember(k);
87
+ }
88
+
89
+ /** Returns false for a wrong passphrase. */
90
+ export async function unlock(passphrase: string): Promise<boolean> {
91
+ if (!file) throw new Error('No vault yet.');
92
+ const k = await derive(passphrase, unb64(file.salt), file.iterations);
93
+ try {
94
+ if ((await open(k, file.verifier)) !== VERIFIER) return false;
95
+ } catch {
96
+ return false;
97
+ }
98
+ await remember(k);
99
+ return true;
100
+ }
101
+
102
+ // ── Large data (datasets, ADR-028): one gzip + AES-GCM blob per id in its own storage key, so a big dataset doesn't rewrite the vault file ──
103
+ const DATA_PREFIX = 'taco.data.';
104
+ const DATA_INDEX = 'taco.dataIndex';
105
+ async function pipeBytes(bytes: Uint8Array, stream: CompressionStream | DecompressionStream): Promise<Uint8Array> {
106
+ return new Uint8Array(await new Response(new Blob([bytes as BlobPart]).stream().pipeThrough(stream)).arrayBuffer());
107
+ }
108
+ async function sealBytes(k: CryptoKey, bytes: Uint8Array): Promise<Sealed> {
109
+ const iv = crypto.getRandomValues(new Uint8Array(12));
110
+ return { iv: b64(iv), ct: b64(new Uint8Array(await crypto.subtle.encrypt({ name: 'AES-GCM', iv }, k, bytes as BufferSource))) };
111
+ }
112
+ const openBytes = async (k: CryptoKey, s: Sealed) => new Uint8Array(await crypto.subtle.decrypt({ name: 'AES-GCM', iv: unb64(s.iv) as BufferSource }, k, unb64(s.ct) as BufferSource));
113
+ const dataIndex = async () => (await store.get<string[]>('local', DATA_INDEX)) ?? [];
114
+
115
+ export async function putData(id: string, text: string) {
116
+ await whenUnlocked();
117
+ await store.set('local', DATA_PREFIX + id, await sealBytes(key!, await pipeBytes(enc.encode(text), new CompressionStream('gzip'))));
118
+ const idx = await dataIndex();
119
+ if (!idx.includes(id)) await store.set('local', DATA_INDEX, [...idx, id]);
120
+ }
121
+ export async function getData(id: string): Promise<string | undefined> {
122
+ await whenUnlocked();
123
+ const sealed = await store.get<Sealed>('local', DATA_PREFIX + id);
124
+ return sealed ? dec.decode(await pipeBytes(await openBytes(key!, sealed), new DecompressionStream('gzip'))) : undefined;
125
+ }
126
+ export async function removeData(id: string) {
127
+ await store.remove('local', DATA_PREFIX + id);
128
+ await store.set('local', DATA_INDEX, (await dataIndex()).filter((x) => x !== id));
129
+ }
130
+
131
+ /** Re-encrypts every item with a key from the new passphrase and a new salt (v2 FR-VAULT-5). False if `current` is wrong. */
132
+ export async function changePassphrase(current: string, next: string, { minLength = 4 } = {}): Promise<boolean> {
133
+ if (!file) throw new Error('No vault yet.');
134
+ if (next.length < minLength) throw new Error(`Use at least ${minLength} characters.`);
135
+ const old = await derive(current, unb64(file.salt), file.iterations);
136
+ try { if ((await open(old, file.verifier)) !== VERIFIER) return false; } catch { return false; }
137
+ const salt = crypto.getRandomValues(new Uint8Array(16));
138
+ const k = await derive(next, salt, file.iterations);
139
+ const items: Record<string, Sealed> = {};
140
+ for (const [id, sealed] of Object.entries(file.items)) items[id] = await seal(k, await open(old, sealed));
141
+ for (const id of await dataIndex()) {
142
+ const blob = await store.get<Sealed>('local', DATA_PREFIX + id);
143
+ if (blob) await store.set('local', DATA_PREFIX + id, await sealBytes(k, await openBytes(old, blob)));
144
+ }
145
+ file = { ...file, salt: b64(salt), verifier: await seal(k, VERIFIER), items };
146
+ await store.set('local', FILE, file);
147
+ await remember(k);
148
+ return true;
149
+ }
150
+
151
+ /** Deletes the vault and everything in it (secrets, module storage). There is no undo. */
152
+ export async function destroy() {
153
+ file = undefined;
154
+ key = null;
155
+ await store.remove('local', FILE);
156
+ await store.remove('session', SESSION_KEY);
157
+ for (const id of await dataIndex()) await store.remove('local', DATA_PREFIX + id);
158
+ await store.remove('local', DATA_INDEX);
159
+ emit();
160
+ }
161
+
162
+ /** Item ids grouped by kind, for Settings (no values are decrypted). */
163
+ export function inventory() {
164
+ const ids = Object.keys(file?.items ?? {});
165
+ return { secrets: ids.filter((i) => !i.startsWith('module/')), moduleData: ids.filter((i) => i.startsWith('module/')) };
166
+ }
167
+
168
+ export async function lock(reason = 'manual') {
169
+ key = null;
170
+ await store.remove('session', SESSION_KEY);
171
+ await store.set('session', LOCK_REASON, reason);
172
+ emit();
173
+ }
174
+
175
+ /** Resolves once the vault is unlocked; shows the shared unlock prompt (ADR-042). */
176
+ export function whenUnlocked(): Promise<void> {
177
+ if (key) return Promise.resolve();
178
+ if (!file) return Promise.reject(new Error('Create the vault first (Settings → Getting Started).'));
179
+ return new Promise((resolve) => { waiters.push(resolve); unlockPrompt?.(); });
180
+ }
181
+
182
+ /** True if an item exists. Works while locked (presence only, nothing is decrypted). */
183
+ export const has = (id: string) => !!file?.items[id];
184
+
185
+ export async function get(id: string): Promise<string | undefined> {
186
+ await whenUnlocked();
187
+ const item = file!.items[id];
188
+ return item ? open(key!, item) : undefined;
189
+ }
190
+
191
+ export async function put(id: string, value: string) {
192
+ await whenUnlocked();
193
+ file!.items[id] = await seal(key!, value);
194
+ await store.set('local', FILE, file);
195
+ emit();
196
+ }
197
+
198
+ export async function remove(id: string) {
199
+ if (!file?.items[id]) return;
200
+ delete file.items[id];
201
+ await store.set('local', FILE, file);
202
+ emit();
203
+ }
204
+
205
+ /** Test helper. */
206
+ export function resetForTests() {
207
+ file = undefined; key = null; loaded = false; waiters = []; listeners.clear(); unlockPrompt = undefined;
208
+ }
package/src/env.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ // Vite handles CSS imports; this tells TypeScript they exist.
2
+ declare module '*.css';
package/src/index.ts ADDED
@@ -0,0 +1,56 @@
1
+ // @tacoshell/shell entry: the generated app entry calls boot() with the registry and the bundled module code.
2
+ import { createElement } from 'react';
3
+ import { createRoot } from 'react-dom/client';
4
+ import type { ViewRef } from '@tacoshell/sdk';
5
+ import { createFramework, navigate, setRegistry } from './core/bus.ts';
6
+ import * as log from './core/log.ts';
7
+ import { initSettings } from './core/prefs.ts';
8
+ import * as router from './core/router.ts';
9
+ import * as services from './core/services.ts';
10
+ import * as datasets from './core/datasets.ts';
11
+ import * as store from './core/storage.ts';
12
+ import * as vault from './core/vault.ts';
13
+ import { App } from './ui/App.tsx';
14
+ import { ShellContext, type ShellInput } from './ui/hooks.ts';
15
+ // Font Awesome Free (user-approved dependency): bundled with the app, so it's packaged code, not remote code (MV3).
16
+ // Modules use it too: <i className="fa-solid fa-wand-magic-sparkles" />.
17
+ import '@fortawesome/fontawesome-free/css/all.min.css';
18
+ import './styles.css';
19
+
20
+ export type { ShellInput } from './ui/hooks.ts';
21
+ export type { Registry } from './types.ts';
22
+
23
+ /** Records app input so the service worker's idle lock knows the app is in use (ADR-042). Throttled to one write per 15 s. */
24
+ function trackActivity() {
25
+ let last = 0;
26
+ const mark = () => {
27
+ const now = Date.now();
28
+ if (now - last < 15_000) return;
29
+ last = now;
30
+ void store.set('session', 'taco.lastActivity', now);
31
+ };
32
+ for (const ev of ['keydown', 'pointerdown', 'wheel', 'touchstart']) addEventListener(ev, mark, { passive: true });
33
+ mark();
34
+ }
35
+
36
+ export async function boot(input: ShellInput) {
37
+ document.title = input.registry.app.displayName;
38
+ setRegistry(input.registry);
39
+ await Promise.all([log.init(), vault.init(), services.init(input.registry, input.services), datasets.init(input.registry, input.routines ?? {})]);
40
+ await initSettings({ idleLockMinutes: input.registry.settings.vault.idleLockMinutes, visibleLevels: input.registry.settings.activityLog.visibleLevels });
41
+ trackActivity();
42
+ datasets.startScheduler((module) => createFramework(module));
43
+ router.start();
44
+ log.add('debug', `Started ${input.registry.app.displayName} ${input.registry.app.version} (${input.registry.modules.length} module(s))`, undefined, 'framework');
45
+ const root = document.getElementById('root')!;
46
+ createRoot(root).render(createElement(ShellContext.Provider, { value: input }, createElement(App)));
47
+ // A notification click handed over by the service worker, now or while the app was closed (ADR-041).
48
+ const openFromNotification = async (open: unknown) => {
49
+ const o = open as { view?: ViewRef; context?: Record<string, unknown> | null } | undefined;
50
+ if (!o?.view) return;
51
+ await store.remove('session', 'taco.notifyOpen');
52
+ await navigate(o.view, o.context ?? undefined);
53
+ };
54
+ void store.get('session', 'taco.notifyOpen').then(openFromNotification);
55
+ store.onChange('session', 'taco.notifyOpen', (v) => void openFromNotification(v));
56
+ }
package/src/styles.css ADDED
@@ -0,0 +1,288 @@
1
+ /* Framework default theme (ADR-022): every value is a token a Theme component can override in its tokens.css. Palette after CommunityOS (ADR-013). */
2
+ :root {
3
+ --taco-bg: #1e1f22; --taco-surface: #26272b; --taco-surface-2: #2f3035; --taco-surface-3: #383940; --taco-border: #3a3b41;
4
+ --taco-text: #e7e7ea; --taco-text-muted: #9b9ca3; --taco-text-faint: #6c6d74;
5
+ --taco-accent: #f0533f; --taco-primary: #006bff; --taco-primary-hover: #2a85ff;
6
+ --taco-success: #2fbf71; --taco-warning: #d9a03f; --taco-danger: #e5484d;
7
+ --taco-log-trace: #6c6d74; --taco-log-debug: #8a8b92; --taco-log-info: #9b9ca3; --taco-log-warn: #d9b43f; --taco-log-error: #f0801f; --taco-log-fatal: #e5484d;
8
+ --taco-radius-sm: 6px; --taco-radius-md: 8px; --taco-radius-lg: 12px;
9
+ --taco-font: "DM Sans", system-ui, sans-serif; --taco-font-mono: "JetBrains Mono", ui-monospace, monospace;
10
+ --taco-header-size: 22px; --taco-helper-text-color: var(--taco-text-muted); --taco-description-size: 13px;
11
+ --taco-field-height: 34px; --taco-rail-width: 248px;
12
+ color-scheme: dark;
13
+ }
14
+ /* Light theme (from CommunityOS v2's tokens.css). :where() keeps its specificity equal to :root, so an app Theme's tokens (theme.css, loaded later)
15
+ still win in both modes; a theme can add its own :root[data-theme="light"] block for light-only values. */
16
+ :root:where([data-theme="light"]) {
17
+ --taco-bg: #ffffff; --taco-surface: #f6f8fa; --taco-surface-2: #eef1f4; --taco-surface-3: #e2e7ec; --taco-border: #d0d7de;
18
+ --taco-text: #1f2328; --taco-text-muted: #59636e; --taco-text-faint: #818b98;
19
+ --taco-primary: #1a6fdb; --taco-primary-hover: #1559b3;
20
+ --taco-success: #1a7f37; --taco-warning: #9a6700; --taco-danger: #cf222e;
21
+ --taco-log-trace: #818b98; --taco-log-debug: #6e7781; --taco-log-info: #59636e; --taco-log-warn: #bf8700; --taco-log-error: #d4580a; --taco-log-fatal: #cf222e;
22
+ color-scheme: light;
23
+ }
24
+ * { box-sizing: border-box; }
25
+ html, body, #root { height: 100%; margin: 0; }
26
+ body { font: 14px/1.45 var(--taco-font); background: var(--taco-bg); color: var(--taco-text); }
27
+ a { color: var(--taco-primary-hover); text-decoration: none; }
28
+ a:hover { text-decoration: underline; }
29
+ code, pre, kbd { font-family: var(--taco-font-mono); font-size: 12px; }
30
+ h1 { font-size: var(--taco-header-size); font-weight: 600; margin: 0 0 8px; }
31
+ h2 { font-size: 15px; margin: 18px 0 8px; }
32
+ .muted { color: var(--taco-helper-text-color); }
33
+ .small { font-size: 12px; }
34
+ .error { color: var(--taco-danger); }
35
+
36
+ button { height: var(--taco-field-height); padding: 0 12px; border-radius: var(--taco-radius-sm); border: 1px solid var(--taco-border); background: var(--taco-surface-2); color: var(--taco-text); font: 500 13px var(--taco-font); cursor: pointer; }
37
+ button:hover:not(:disabled) { background: var(--taco-surface-3); }
38
+ button:disabled { opacity: .4; cursor: default; }
39
+ button.primary { background: var(--taco-primary); border-color: var(--taco-primary); color: #fff; }
40
+ button.primary:hover:not(:disabled) { background: var(--taco-primary-hover); }
41
+ input, select { height: var(--taco-field-height); padding: 0 10px; border-radius: var(--taco-radius-sm); border: 1px solid var(--taco-border); background: var(--taco-surface-2); color: var(--taco-text); font: inherit; }
42
+ input[type=checkbox] { height: auto; }
43
+ input:focus, select:focus, button:focus-visible { outline: 2px solid var(--taco-primary); outline-offset: 1px; }
44
+
45
+ .app { display: flex; flex-direction: column; height: 100%; }
46
+ .top { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 16px; border-top: 4px solid var(--taco-accent); background: var(--taco-surface); border-bottom: 1px solid var(--taco-border); }
47
+ .app-name { font-size: 16px; }
48
+ .sections { display: flex; align-self: stretch; gap: 4px; margin-left: 16px; }
49
+ /* Underlined selector: the current section is bold with a bar along the bottom of the header. */
50
+ .sections a { display: flex; align-items: center; padding: 0 14px; margin-bottom: -1px; border-bottom: 3px solid transparent; color: var(--taco-text-muted); font-weight: 500; }
51
+ .sections a:hover { color: var(--taco-text); text-decoration: none; }
52
+ .sections a.on { border-bottom-color: var(--taco-primary); color: var(--taco-text); font-weight: 700; }
53
+ .top-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
54
+ .pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--taco-border); color: var(--taco-text-muted); vertical-align: middle; }
55
+ .pill.ok { border-color: var(--taco-success); color: var(--taco-success); }
56
+ .pill.warn { border-color: var(--taco-warning); color: var(--taco-warning); }
57
+ .pill.bad { background: var(--taco-danger); border-color: var(--taco-danger); color: #fff; }
58
+
59
+ .layout { flex: 1; display: flex; min-height: 0; }
60
+ .rail { width: var(--taco-rail-width); flex: none; overflow: auto; padding: 12px 10px; background: var(--taco-surface); border-right: 1px solid var(--taco-border); }
61
+ .rail-label { margin: 14px 8px 4px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--taco-text-faint); }
62
+ .rail-link { display: block; padding: 5px 10px; border-radius: var(--taco-radius-sm); color: var(--taco-text); }
63
+ .rail-link:hover { background: var(--taco-surface-2); text-decoration: none; }
64
+ .rail-link.active { background: var(--taco-primary); color: #fff; }
65
+ .rail-group-head { width: 100%; text-align: left; height: 28px; border: 0; background: none; color: var(--taco-accent); font-weight: 600; padding: 0 8px; }
66
+ .rail-group .rail-link { padding-left: 22px; }
67
+ .rail-filter { width: 100%; margin: 12px 0 4px; }
68
+ .rail-filter input { width: 100%; }
69
+ .content { flex: 1; min-width: 0; overflow: auto; }
70
+ .page { padding: 8px 24px 32px; max-width: 1100px; }
71
+ .crumbs { margin: 4px 0; font-size: 12px; color: var(--taco-text-muted); }
72
+
73
+ .subbar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 6px 16px; background: var(--taco-bg); border-bottom: 1px solid var(--taco-border); min-height: 44px; }
74
+ .subbar-tabs { display: flex; gap: 4px; flex: 1; }
75
+ .tab { padding: 5px 12px; border-radius: var(--taco-radius-sm); color: var(--taco-text-muted); }
76
+ .tab.active { background: var(--taco-surface-2); color: var(--taco-text); }
77
+ .subbar-actions { display: flex; gap: 6px; }
78
+ .bar-btn { height: 28px; padding: 0 10px; font-size: 12px; }
79
+ .bar-btn.on { border-color: var(--taco-primary); }
80
+ /* ADR-027: the Log button shows the highest severity since the log was last viewed. */
81
+ .bar-btn.sev-info { background: var(--taco-log-info); color: #111; }
82
+ .bar-btn.sev-warn { background: var(--taco-log-warn); color: #111; }
83
+ .bar-btn.sev-error { background: var(--taco-log-error); color: #111; }
84
+ .bar-btn.sev-fatal { background: var(--taco-log-fatal); color: #fff; }
85
+
86
+ .side { position: relative; flex: none; display: flex; flex-direction: column; border-left: 1px solid var(--taco-border); background: var(--taco-surface); min-width: 240px; max-width: 800px; }
87
+ .side-grip { position: absolute; left: -3px; top: 0; bottom: 0; width: 6px; cursor: col-resize; }
88
+ .panel-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--taco-border); }
89
+ .panel-head strong { margin-right: auto; }
90
+ .help-body { padding: 4px 16px; overflow: auto; }
91
+ .log-list { list-style: none; margin: 0; padding: 0 12px; overflow: auto; font-size: 12px; }
92
+ .log-list li { padding: 6px 0; border-bottom: 1px solid var(--taco-border); }
93
+ .log-head { display: flex; align-items: baseline; gap: 8px; }
94
+ .log-list time { flex: none; font-family: var(--taco-font-mono); color: var(--taco-text-faint); }
95
+ .log-list .src { margin-left: auto; color: var(--taco-text-faint); text-align: right; }
96
+ .log-list .lvl { margin-right: 0; }
97
+ /* The message is a block on its own line, indented under the level. */
98
+ .log-list .msg { margin: 3px 0 0 12px; padding-left: 8px; border-left: 2px solid var(--taco-border); white-space: pre-wrap; overflow-wrap: anywhere; }
99
+ .log-list .data { margin: 4px 0 0 12px; padding: 6px; background: var(--taco-surface-2); border-radius: var(--taco-radius-sm); white-space: pre-wrap; max-height: 160px; overflow: auto; }
100
+ .lvl { font-weight: 700; text-transform: uppercase; font-size: 11px; margin-right: 6px; }
101
+ .lvl-trace { color: var(--taco-log-trace); } .lvl-debug { color: var(--taco-log-debug); } .lvl-info { color: var(--taco-log-info); }
102
+ .lvl-warn { color: var(--taco-log-warn); } .lvl-error { color: var(--taco-log-error); } .lvl-fatal { color: var(--taco-log-fatal); }
103
+ .tag { font-size: 11px; color: var(--taco-primary-hover); margin-right: 6px; }
104
+ .filter, .favmenu { position: relative; }
105
+ .filter-menu, .favmenu-list { position: absolute; right: 0; top: 32px; z-index: 5; min-width: 200px; display: grid; gap: 4px; padding: 10px; background: var(--taco-surface-2); border: 1px solid var(--taco-border); border-radius: var(--taco-radius-md); }
106
+ .favmenu-list { right: auto; left: 0; min-width: 240px; }
107
+ .filter-row { display: flex; gap: 6px; }
108
+ .filter-row button { flex: 1; }
109
+ .filter-row button { height: 26px; font-size: 12px; }
110
+ .filter-menu .sep { border-top: 1px solid var(--taco-border); padding-top: 6px; }
111
+ .favmenu-row { display: flex; align-items: center; gap: 4px; }
112
+ .favmenu-row a { flex: 1; }
113
+ .favmenu-row button { height: 24px; padding: 0 6px; }
114
+
115
+ .card { background: var(--taco-surface); border: 1px solid var(--taco-border); border-radius: var(--taco-radius-lg); padding: 14px 18px; margin: 12px 0; }
116
+ .card.danger { border-color: var(--taco-danger); }
117
+ .card h2 { margin-top: 0; }
118
+ .tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
119
+ .tile { position: relative; display: grid; gap: 4px; padding: 14px 16px; background: var(--taco-surface); border: 1px solid var(--taco-border); border-radius: var(--taco-radius-lg); color: var(--taco-text); }
120
+ .tile:hover { border-color: var(--taco-primary); text-decoration: none; }
121
+ .tile .pill { justify-self: start; }
122
+ .unstar { position: absolute; top: 8px; right: 8px; height: 24px; padding: 0 6px; background: none; border: 0; color: var(--taco-warning); }
123
+ .form-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
124
+ .form-row label { width: 180px; color: var(--taco-text-muted); }
125
+ .form-row input:not([type=checkbox]) { flex: 1; max-width: 420px; }
126
+ .segmented { display: inline-flex; border: 1px solid var(--taco-border); border-radius: 999px; overflow: hidden; }
127
+ .segmented button { border: 0; border-radius: 0; height: 30px; }
128
+ .segmented button.on { background: var(--taco-primary); color: #fff; }
129
+ .actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
130
+ .copy { user-select: all; padding: 4px 8px; background: var(--taco-surface-2); border-radius: var(--taco-radius-sm); }
131
+ .keys td { padding: 3px 12px 3px 0; }
132
+ kbd { padding: 1px 6px; border: 1px solid var(--taco-border); border-radius: 4px; background: var(--taco-surface-2); }
133
+ .md pre { padding: 10px; background: var(--taco-surface-2); border-radius: var(--taco-radius-md); overflow: auto; }
134
+ .md p, .md li { color: var(--taco-text); }
135
+
136
+ .backdrop { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; background: rgba(0, 0, 0, .6); }
137
+ .modal { position: relative; width: min(520px, 92vw); padding: 20px 22px; background: var(--taco-surface); border: 1px solid var(--taco-border); border-radius: var(--taco-radius-lg); }
138
+ .modal input { width: 100%; }
139
+ .modal .actions { justify-content: flex-end; }
140
+ .close { position: absolute; top: 10px; right: 10px; height: 28px; width: 28px; padding: 0; background: none; border: 0; font-size: 18px; color: var(--taco-text-muted); }
141
+ .toasts { position: fixed; right: 16px; bottom: 16px; z-index: 20; display: grid; gap: 8px; width: 340px; }
142
+ .toast { padding: 10px 14px; border-radius: var(--taco-radius-md); background: var(--taco-surface-3); border: 1px solid var(--taco-border); cursor: pointer; }
143
+ .toast.error { border-color: var(--taco-danger); }
144
+ .menu-item { text-align: left; height: 30px; background: none; border: 0; }
145
+ .menu-item:hover { background: var(--taco-surface-3); }
146
+ .slot { display: grid; gap: 12px; }
147
+ /* Copy Chart pick mode (ADR-054) */
148
+ .taco-pick-frame { position: fixed; z-index: 9998; pointer-events: none; display: none; border: 2px solid var(--taco-primary); background: color-mix(in srgb, var(--taco-primary) 12%, transparent); border-radius: 6px; }
149
+ .taco-pick-banner { position: fixed; z-index: 9999; top: 12px; left: 50%; transform: translateX(-50%); padding: 6px 16px; border-radius: 999px; font-size: 13px; background: var(--taco-surface-3); color: var(--taco-text); border: 1px solid var(--taco-primary); box-shadow: 0 4px 14px rgba(0, 0, 0, .4); }
150
+ .bar-btn i { margin-right: 4px; }
151
+ .bar-btn.icon-only i { margin-right: 0; }
152
+ .fav-on i { color: var(--taco-warning); }
153
+ .top .version { margin-left: 4px; }
154
+ .menu-item i { width: 18px; margin-right: 6px; }
155
+ button.danger { border-color: var(--taco-danger); color: var(--taco-danger); }
156
+ button.danger:hover:not(:disabled) { background: var(--taco-danger); color: #fff; }
157
+ .rail-icon { width: 18px; margin-right: 8px; opacity: .8; }
158
+ .hotkey-rec { width: 200px; }
159
+ .card h3 { font-size: 13px; margin: 16px 0 6px; }
160
+ .dataset-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
161
+ .dataset-stats { text-align: right; }
162
+ .grid-wrap { overflow: auto; margin-top: 10px; }
163
+ table.grid { border-collapse: collapse; margin-top: 10px; font-size: 12px; }
164
+ table.grid th { position: sticky; top: 0; background: var(--taco-surface-2); text-align: left; }
165
+ table.grid th, table.grid td { padding: 5px 10px; border-bottom: 1px solid var(--taco-border); white-space: nowrap; }
166
+ label.inline { display: inline-flex; align-items: center; gap: 6px; color: var(--taco-text-muted); }
167
+
168
+ /* Header: vault state, search (⌘K), arrow-key selection in the rail */
169
+ /* Header status colors: success (green), warning (yellow), danger (red) */
170
+ .bar-btn.st-ok { background: color-mix(in srgb, var(--taco-success) 18%, transparent); border-color: var(--taco-success); color: var(--taco-success); }
171
+ .bar-btn.st-ok:hover:not(:disabled) { background: color-mix(in srgb, var(--taco-success) 30%, transparent); }
172
+ .bar-btn.st-warn { background: color-mix(in srgb, var(--taco-warning) 20%, transparent); border-color: var(--taco-warning); color: var(--taco-warning); }
173
+ .bar-btn.st-warn:hover:not(:disabled) { background: color-mix(in srgb, var(--taco-warning) 32%, transparent); }
174
+ .bar-btn.st-bad { background: color-mix(in srgb, var(--taco-danger) 18%, transparent); border-color: var(--taco-danger); color: var(--taco-danger); }
175
+ .bar-btn.st-bad:hover:not(:disabled) { background: color-mix(in srgb, var(--taco-danger) 30%, transparent); }
176
+ .top .bar-btn:disabled { opacity: .7; }
177
+ .top .bar-btn { height: 32px; }
178
+ .top .bar-btn.icon-only { width: 34px; padding: 0; }
179
+ .search { position: relative; flex: 1; max-width: 460px; margin-left: 16px; }
180
+ .search-input { width: 100%; height: 34px; padding-left: 34px; border-radius: 999px; }
181
+ .search-icon { position: absolute; left: 13px; top: 11px; font-size: 13px; color: var(--taco-text-muted); pointer-events: none; }
182
+ .search-panel { position: absolute; left: 0; right: 0; top: 40px; z-index: 8; display: grid; gap: 6px; padding: 10px; background: var(--taco-surface-2); border: 1px solid var(--taco-border); border-radius: var(--taco-radius-md); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
183
+ .search-panel p { margin: 0; }
184
+ .search-head { display: flex; align-items: center; gap: 8px; color: var(--taco-text-muted); font-size: 12px; }
185
+ .search-head .pill { margin-left: auto; }
186
+ .search-back { height: 24px; width: 26px; padding: 0; }
187
+ .search-row { display: flex; align-items: center; gap: 6px; width: 100%; height: auto; min-height: 34px; padding: 6px 10px; text-align: left; background: none; border-color: transparent; }
188
+ .search-row .pill { margin-left: auto; }
189
+ .search-row.sel, .search-tile.sel, .search-row:hover, .search-tile:hover { background: var(--taco-surface-3); border-color: var(--taco-primary); }
190
+ .search-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
191
+ .search-tile { display: grid; justify-items: start; gap: 2px; height: auto; padding: 10px 12px; text-align: left; border-radius: var(--taco-radius-md); }
192
+ .search-tile i, .search-tile > span:first-child { color: var(--taco-primary-hover); }
193
+ .rail-link.kbd-sel { background: var(--taco-surface-3); outline: 2px solid var(--taco-primary); outline-offset: -2px; }
194
+ .rail-link.kbd-sel.active { background: var(--taco-primary); }
195
+
196
+ /* Datasets schedule */
197
+ .schedule-line { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 8px 0 0; }
198
+ .sched-ok { color: var(--taco-success); } .sched-warn { color: var(--taco-warning); }
199
+ button.link { height: auto; padding: 0; border: 0; background: none; color: var(--taco-primary-hover); font-size: inherit; }
200
+ button.link:hover:not(:disabled) { background: none; text-decoration: underline; }
201
+ .modal.schedule { width: min(560px, 94vw); }
202
+ .modal.schedule .form-row label { width: 120px; }
203
+ .modal.schedule select, .modal.schedule input:not([type=checkbox]) { flex: 0 1 260px; }
204
+ .days { display: flex; flex-wrap: wrap; gap: 10px; }
205
+ .mono { font-family: var(--taco-font-mono); }
206
+
207
+ /* Feature icons (rail, 3rd-level bar, top nav, tiles): a Font Awesome glyph or a bundled image, drawn at the text size */
208
+ .nav-icon { margin-right: 8px; opacity: .85; }
209
+ .nav-img { width: 16px; height: 16px; vertical-align: -3px; object-fit: contain; }
210
+ .tab .nav-icon { margin-right: 6px; }
211
+ .sections a .nav-icon { margin-right: 6px; }
212
+
213
+ /* Sessions (header) */
214
+ .sessions { position: relative; }
215
+ .sessions-list { position: absolute; right: 0; top: 38px; z-index: 8; min-width: 300px; display: grid; gap: 2px; padding: 10px; background: var(--taco-surface-2); border: 1px solid var(--taco-border); border-radius: var(--taco-radius-md); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
216
+ .sessions-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
217
+ .session-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--taco-radius-sm); color: var(--taco-text); }
218
+ .session-row:hover { background: var(--taco-surface-3); text-decoration: none; }
219
+ .session-name { flex: 1; }
220
+ .sess-ok { color: var(--taco-success); } .sess-warn { color: var(--taco-warning); } .sess-bad { color: var(--taco-danger); }
221
+ .session-row .nav-icon { margin-right: 0; }
222
+
223
+ /* Templates, release notes */
224
+ details.template > summary { cursor: pointer; display: flex; gap: 8px; align-items: center; }
225
+ .template textarea { width: 100%; font: 13px var(--taco-font-mono); padding: 8px; border-radius: var(--taco-radius-sm); border: 1px solid var(--taco-border); background: var(--taco-surface-2); color: var(--taco-text); }
226
+ code.token { margin-right: 6px; }
227
+ .release-notes h3, .release-notes h2 { margin: 18px 0 4px; }
228
+ .release-notes h2:first-child, .release-notes h3:first-child { margin-top: 0; }
229
+
230
+ /* Filter boxes with a × on the right (Activity Log, rail, header search) */
231
+ .clearable { position: relative; display: flex; align-items: center; min-width: 0; }
232
+ .clearable input { width: 100%; padding-right: 30px; }
233
+ .clear-x { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; height: 22px; width: 22px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--taco-text-muted); font-size: 13px; }
234
+ .clear-x:hover:not(:disabled) { background: var(--taco-surface-3); color: var(--taco-text); }
235
+ .search .clear-x { right: 10px; }
236
+ .search-input { padding-right: 34px; }
237
+ .panel-head .log-filter { flex: 1; }
238
+ .panel-head .log-filter input { height: 30px; }
239
+
240
+ /* Dataset import confirmation */
241
+ .modal.import-confirm { width: min(720px, 94vw); max-height: 90vh; overflow: auto; }
242
+ .import-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
243
+ .import-confirm h3 { margin: 12px 0 4px; }
244
+ .import-confirm .keys td:first-child { white-space: nowrap; }
245
+
246
+ /* Cards (ADR-062): module sub-features shown under a page when its context has what they are wired to */
247
+ .cards-region { max-width: 1100px; margin: 0 24px 32px; padding-top: 12px; border-top: 1px solid var(--taco-border); }
248
+ .cards-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--taco-text-muted); }
249
+ .cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; align-items: start; }
250
+ .card-host { background: var(--taco-surface); border: 1px solid var(--taco-border); border-radius: var(--taco-radius-lg); overflow: hidden; }
251
+ .card-head { display: flex; align-items: center; gap: 8px; width: 100%; height: 38px; padding: 0 12px; border: 0; border-radius: 0; background: none; text-align: left; }
252
+ .card-head .muted { margin-left: auto; }
253
+ .card-chev { font-size: 11px; color: var(--taco-text-muted); width: 10px; }
254
+ .card-body { padding: 4px 14px 14px; }
255
+
256
+ /* 3rd-level bar: tabs anchored left with a 64 px gutter before the buttons; overflow goes to "More" */
257
+ .subbar-tabs { position: relative; display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; overflow: visible; }
258
+ .tabs-measure { position: absolute; left: 0; top: 0; display: flex; gap: 4px; visibility: hidden; pointer-events: none; white-space: nowrap; height: 0; overflow: hidden; }
259
+ .tab { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: var(--taco-radius-sm); border: 0; background: none; color: var(--taco-text-muted); font: 500 13px var(--taco-font); white-space: nowrap; cursor: pointer; }
260
+ .tab:hover { color: var(--taco-text); text-decoration: none; background: var(--taco-surface-2); }
261
+ .tab.active { background: var(--taco-surface-2); color: var(--taco-text); }
262
+ .tab .fa-chevron-down { margin-left: 6px; font-size: 10px; }
263
+ .tab-more { position: relative; }
264
+ .tab-more-menu { position: absolute; left: 0; top: 36px; z-index: 6; min-width: 200px; display: grid; gap: 2px; padding: 6px; background: var(--taco-surface-2); border: 1px solid var(--taco-border); border-radius: var(--taco-radius-md); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
265
+ .menu-link { display: flex; align-items: center; padding: 6px 10px; border-radius: var(--taco-radius-sm); color: var(--taco-text); white-space: nowrap; }
266
+ .menu-link:hover { background: var(--taco-surface-3); text-decoration: none; }
267
+ .menu-link.active { background: var(--taco-primary); color: #fff; }
268
+ .subbar-actions { flex: none; align-items: center; }
269
+ .subbar-actions .bar-btn.icon-only { width: 32px; padding: 0; }
270
+
271
+ /* The framework writes the page title: "Level 2 · Level 3". A leading <h1> in a view's own body is hidden so older views don't repeat it. */
272
+ .page-title { display: flex; align-items: center; gap: 12px; margin: 0; padding: 16px 24px 4px; font-size: var(--taco-header-size); }
273
+ .page-title .nav-icon { width: 28px; height: 28px; margin: 0; font-size: 24px; opacity: 1; }
274
+ .view-body > .page > h1:first-child { display: none; }
275
+ .tab-more { max-width: 100%; min-width: 0; }
276
+ .tab-more > .tab { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
277
+
278
+ /* 3rd-level tabs: the selected one is underlined like the top-level nav (3 px primary bar on the bar's bottom edge, bold text, no pill) */
279
+ .subbar { padding: 0 16px; min-height: 46px; }
280
+ .subbar-tabs { align-self: stretch; align-items: stretch; }
281
+ .tab { height: auto; align-items: center; border-radius: 0; margin-bottom: -1px; border-bottom: 3px solid transparent; font-weight: 500; }
282
+ .tab:hover { background: none; color: var(--taco-text); }
283
+ .tab.active { background: none; color: var(--taco-text); font-weight: 700; border-bottom-color: var(--taco-primary); }
284
+ .tab-more { display: flex; align-self: stretch; }
285
+ .tab-more > .tab { height: 100%; }
286
+ .tab-more-menu { top: 100%; margin-top: 2px; }
287
+ .tabs-measure .tab { font-weight: 700; } /* measure at the bold width so the selected tab never overflows */
288
+ .subbar-actions { padding: 6px 0; }