privacy-redact 0.1.0 → 1.0.2

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.
@@ -0,0 +1,96 @@
1
+ /**
2
+ * `privacy-redact-review` draws its screen in a shadow root. Host CSS, ids, and
3
+ * page-level paste or drop stay outside the element.
4
+ */
5
+ import { reviewTemplate } from './template.js';
6
+ import { attachController } from './controller.js';
7
+ import reviewCss from './review.css?inline';
8
+
9
+ export const REVIEW_TAG = 'privacy-redact-review';
10
+ const STYLES = ['blur', 'pixelate', 'blackout'];
11
+
12
+ /** Register the review element once. Importing this module also registers it. */
13
+ export function defineReviewElement() {
14
+ if (!customElements.get(REVIEW_TAG)) customElements.define(REVIEW_TAG, PiiRedactReview);
15
+ }
16
+
17
+ /** Drop-in review screen: scan, manual edits, and Save. */
18
+ class PiiRedactReview extends HTMLElement {
19
+ /** Open a file in this screen. A call before connect waits until the template is stamped. */
20
+ open(file) {
21
+ this._pendingFile = file;
22
+ return this._api ? this._api.open(file) : undefined;
23
+ }
24
+
25
+ /** Leave the open file and return to the drop screen. */
26
+ reset() {
27
+ this._pendingFile = null;
28
+ this._api?.reset();
29
+ }
30
+
31
+ /** Open or close the field picker. */
32
+ toggleSettings() {
33
+ this._api?.toggleSettings();
34
+ }
35
+
36
+ /** Header home: reset an open file, or leave settings. */
37
+ home() {
38
+ this._api?.home();
39
+ }
40
+
41
+ /** Redaction style. Named redactStyle because HTMLElement.style is the CSS declaration. */
42
+ get redactStyle() {
43
+ return this._api?.getStyle() ?? this._redactStyle ?? 'blur';
44
+ }
45
+
46
+ set redactStyle(value) {
47
+ if (!STYLES.includes(value)) return;
48
+ this._redactStyle = value;
49
+ this._api?.setStyle(value);
50
+ }
51
+
52
+ /** Strength from 0 to 1. The slider shows the same value. */
53
+ get strength() {
54
+ return this._api?.getStrength() ?? this._strength ?? 0.65;
55
+ }
56
+
57
+ set strength(value) {
58
+ const n = Number(value);
59
+ if (!Number.isFinite(n)) return;
60
+ this._strength = Math.min(1, Math.max(0, n));
61
+ this._api?.setStrength(this._strength);
62
+ }
63
+
64
+ /** A file assigned here opens in the review flow. */
65
+ get file() {
66
+ return this._pendingFile ?? null;
67
+ }
68
+
69
+ set file(value) {
70
+ this.open(value);
71
+ }
72
+
73
+ connectedCallback() {
74
+ if (this._api) return;
75
+ if (!this.shadowRoot) this.attachShadow({ mode: 'open' });
76
+ const style = document.createElement('style');
77
+ style.textContent = reviewCss;
78
+ const markup = document.createElement('template');
79
+ markup.innerHTML = reviewTemplate;
80
+ this.shadowRoot.replaceChildren(style, markup.content.cloneNode(true));
81
+ const strengthAttr = this.getAttribute('strength');
82
+ this._api = attachController(this, {
83
+ style: this._redactStyle || this.getAttribute('redact-style') || undefined,
84
+ strength: this._strength ?? (strengthAttr != null && strengthAttr !== '' ? Number(strengthAttr) : undefined),
85
+ });
86
+ if (this._pendingFile) this._api.open(this._pendingFile);
87
+ }
88
+
89
+ /** Drop page listeners when a host removes the element, including a React remount. */
90
+ disconnectedCallback() {
91
+ this._api?.dispose();
92
+ this._api = null;
93
+ }
94
+ }
95
+
96
+ defineReviewElement();
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Thin React mount of `privacy-redact-review`. The screen, its edits, and Save stay in the element.
3
+ */
4
+ import { createElement, useEffect, useRef } from 'react';
5
+ import './element.js';
6
+
7
+ /** Drop-in review screen. `onResult` runs when the person saves, and only then. */
8
+ export function PrivacyRedactReview({ file, style, strength, onResult }) {
9
+ const ref = useRef(null);
10
+
11
+ useEffect(() => {
12
+ const el = ref.current;
13
+ if (!el || !onResult) return undefined;
14
+ const handle = (event) => onResult(event.detail);
15
+ el.addEventListener('result', handle);
16
+ return () => el.removeEventListener('result', handle);
17
+ }, [onResult]);
18
+
19
+ useEffect(() => {
20
+ const el = ref.current;
21
+ if (!el || typeof style !== 'string') return;
22
+ el.redactStyle = style;
23
+ }, [style]);
24
+
25
+ useEffect(() => {
26
+ const el = ref.current;
27
+ if (!el || strength == null) return;
28
+ el.strength = strength;
29
+ }, [strength]);
30
+
31
+ useEffect(() => {
32
+ const el = ref.current;
33
+ if (!el || !file) return;
34
+ el.open(file);
35
+ }, [file]);
36
+
37
+ return createElement('privacy-redact-review', { ref });
38
+ }
@@ -0,0 +1,566 @@
1
+ /* Review screen styles. They live in the shadow root, under names the host page does not use. */
2
+ @font-face {
3
+ font-family: "Privacy Redact Display";
4
+ font-style: normal;
5
+ font-weight: 300;
6
+ font-display: swap;
7
+ src: url("../fonts/crimson-pro-300.woff2") format("woff2");
8
+ }
9
+ @font-face {
10
+ font-family: "Privacy Redact Sans";
11
+ font-style: normal;
12
+ font-weight: 300;
13
+ font-display: swap;
14
+ src: url("../fonts/ibm-plex-sans-300.woff2") format("woff2");
15
+ }
16
+ @font-face {
17
+ font-family: "Privacy Redact Sans";
18
+ font-style: normal;
19
+ font-weight: 400;
20
+ font-display: swap;
21
+ src: url("../fonts/ibm-plex-sans-400.woff2") format("woff2");
22
+ }
23
+
24
+ @keyframes privacy-redact-scan { to { top: 100%; } }
25
+ @keyframes privacy-redact-spin { to { transform: rotate(360deg); } }
26
+
27
+ :host {
28
+ --canvas: #fafaf9;
29
+ --surface: #f5f5f4;
30
+ --surface-raised: #ffffff;
31
+ --surface-sunken: #f0f0ef;
32
+ --on-surface: #292524;
33
+ --on-surface-muted: #78716c;
34
+ --on-surface-subtle: #a8a29e;
35
+ --accent: #57534e;
36
+ --accent-hover: #44403c;
37
+ --good: #3f6212;
38
+ --warn: #92400e;
39
+ --bad: #9f1239;
40
+ --shadow-sm: 0 1px 2px rgba(41, 37, 36, 0.06), 0 1px 3px rgba(41, 37, 36, 0.04);
41
+ --shadow-md: 0 8px 24px rgba(41, 37, 36, 0.06), 0 2px 6px rgba(41, 37, 36, 0.04);
42
+ --shadow-lg: 0 16px 40px rgba(41, 37, 36, 0.1);
43
+ --glow: 0 0 0 4px rgba(87, 83, 78, 0.16);
44
+ --ease: 0.4s cubic-bezier(0.22, 1, 0.36, 1);
45
+ --font-display: "Privacy Redact Display", "Iowan Old Style", Palatino, Georgia, serif;
46
+ --font-ui: "Privacy Redact Sans", "Segoe UI", sans-serif;
47
+ --radius-sm: 6px;
48
+ --radius-md: 8px;
49
+ --radius-lg: 12px;
50
+ display: block;
51
+ position: relative;
52
+ isolation: isolate;
53
+ min-width: 0;
54
+ max-width: 100%;
55
+ /* Measure this element. A host column can be narrow while the window stays wide. */
56
+ container: review / inline-size;
57
+ text-align: center;
58
+ color: var(--on-surface);
59
+ font-family: var(--font-ui);
60
+ font-size: 15px;
61
+ font-weight: 300;
62
+ line-height: 1.7;
63
+ -webkit-font-smoothing: antialiased;
64
+
65
+ @media (prefers-color-scheme: dark) {
66
+ color-scheme: dark;
67
+ --canvas: #1c1917;
68
+ --surface: #292524;
69
+ --surface-raised: #322f2c;
70
+ --surface-sunken: #1c1917;
71
+ --on-surface: #e7e5e4;
72
+ --on-surface-muted: #a8a29e;
73
+ --on-surface-subtle: #78716c;
74
+ --accent: #d6d3d1;
75
+ --accent-hover: #e7e5e4;
76
+ --good: #c5ddb8;
77
+ --warn: #f0d0a0;
78
+ --bad: #f3b4bc;
79
+ --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45);
80
+ --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.4);
81
+ --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.55);
82
+ --glow: 0 0 0 4px rgba(214, 211, 209, 0.22);
83
+ }
84
+
85
+ @media (prefers-reduced-motion: reduce) {
86
+ *, *::before, *::after { animation: none !important; transition: none !important; }
87
+ }
88
+
89
+ * { box-sizing: border-box; }
90
+ [hidden] { display: none !important; }
91
+ b, strong { font-weight: 400; }
92
+ button, input, select { font-family: inherit; margin: 0; }
93
+ kbd {
94
+ font-family: var(--font-ui);
95
+ font-size: 13px;
96
+ font-weight: 400;
97
+ line-height: 1.45;
98
+ padding: 2px 6px;
99
+ border: 0;
100
+ border-radius: var(--radius-sm);
101
+ background: var(--surface-sunken);
102
+ color: var(--on-surface);
103
+ box-shadow: var(--shadow-sm);
104
+ }
105
+
106
+ .btn {
107
+ font-family: var(--font-ui);
108
+ font-weight: 400;
109
+ font-size: 15px;
110
+ line-height: 1.5;
111
+ color: var(--on-surface);
112
+ background: var(--surface);
113
+ border: 0;
114
+ border-radius: var(--radius-md);
115
+ padding: 12px;
116
+ cursor: pointer;
117
+ box-shadow: var(--shadow-sm);
118
+ transition: background var(--ease), color var(--ease), transform var(--ease), box-shadow var(--ease);
119
+ }
120
+ .btn:hover { background: var(--surface-raised); transform: translateY(-1px); box-shadow: var(--shadow-md); }
121
+ .btn:active { transform: translateY(0); }
122
+ .btn.ghost { background: var(--surface); }
123
+ .btn.sm { padding: 8px 12px; font-size: 13px; line-height: 1.45; border-radius: var(--radius-sm); }
124
+ .btn.wide, .btn.big { width: 100%; }
125
+ .btn.primary { background: var(--accent); color: var(--surface-raised); }
126
+ .btn.primary:hover { background: var(--accent-hover); box-shadow: var(--shadow-lg); }
127
+ .btn:disabled { opacity: 0.5; cursor: progress; transform: none; }
128
+ .btn:focus-visible,
129
+ .dropzone:focus-visible,
130
+ .seg button:focus-visible,
131
+ .fmt select:focus-visible,
132
+ .slider input:focus-visible,
133
+ .transcript-toggle:focus-visible,
134
+ .transcript-redact:focus-visible,
135
+ .cat:focus-visible {
136
+ outline: none;
137
+ box-shadow: var(--glow);
138
+ }
139
+
140
+ .lede {
141
+ color: var(--on-surface-muted);
142
+ font-size: 15px;
143
+ font-weight: 300;
144
+ line-height: 1.7;
145
+ max-width: 38rem;
146
+ margin: 0 auto 2rem;
147
+ }
148
+ .dropzone {
149
+ display: block;
150
+ cursor: pointer;
151
+ border: 0;
152
+ border-radius: var(--radius-lg);
153
+ padding: 3rem 1.5rem;
154
+ background: var(--surface);
155
+ box-shadow: var(--shadow-sm);
156
+ transition: background var(--ease), transform var(--ease), box-shadow var(--ease);
157
+ }
158
+ .dropzone:hover, .dropzone.over {
159
+ background: var(--surface-raised);
160
+ transform: translateY(-2px);
161
+ box-shadow: var(--shadow-md);
162
+ }
163
+ .dz-icon {
164
+ width: 64px;
165
+ height: 64px;
166
+ margin: 0 auto 1rem;
167
+ display: grid;
168
+ place-items: center;
169
+ border-radius: var(--radius-lg);
170
+ color: var(--on-surface);
171
+ background: var(--surface-raised);
172
+ box-shadow: var(--shadow-sm);
173
+ }
174
+ .dz-title {
175
+ font-family: var(--font-display);
176
+ font-size: 1.25rem;
177
+ font-weight: 300;
178
+ line-height: 1.4;
179
+ letter-spacing: -0.02em;
180
+ }
181
+ .dz-sub { color: var(--on-surface-muted); margin-top: 0.5rem; font-size: 14px; line-height: 1.6; }
182
+ .dz-formats { color: var(--on-surface-muted); font-size: 13px; font-weight: 400; margin-top: 1rem; letter-spacing: 0.04em; }
183
+ .settings-cue { margin-top: 1rem; }
184
+ .error {
185
+ margin: 1rem auto 0;
186
+ max-width: 38rem;
187
+ color: var(--bad);
188
+ background: color-mix(in srgb, var(--bad) 10%, var(--surface));
189
+ padding: 12px;
190
+ border-radius: var(--radius-md);
191
+ font-size: 14px;
192
+ line-height: 1.6;
193
+ }
194
+
195
+ #settings { text-align: left; }
196
+ .settings-wrap { width: min(100%, 36rem); margin: 0 auto; display: grid; gap: 1.5rem; }
197
+ #settings h1 {
198
+ font-family: var(--font-display);
199
+ font-weight: 300;
200
+ font-size: 1.875rem;
201
+ line-height: 1.3;
202
+ letter-spacing: -0.02em;
203
+ margin: 0;
204
+ }
205
+ #settings .lede { margin: 0; max-width: none; text-align: left; }
206
+ #settings .card-head { align-items: flex-start; flex-wrap: wrap; }
207
+ .settings-presets { display: flex; gap: 0.5rem; flex-wrap: wrap; }
208
+ .prefs-group {
209
+ padding: 0.75rem 0.25rem 0.15rem;
210
+ font-size: 13px;
211
+ font-weight: 400;
212
+ line-height: 1.45;
213
+ color: var(--on-surface-muted);
214
+ }
215
+ .settings-note { text-align: left; margin-top: 1rem; }
216
+ .settings-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: flex-end; }
217
+ #scan-scope { text-align: left; margin: 0 0 0.75rem; }
218
+ #scan-card.done #scan-scope:not([hidden]) { margin-bottom: 0; }
219
+
220
+ #workspace:focus { outline: none; }
221
+ #workspace {
222
+ display: grid;
223
+ grid-template-columns: minmax(0, 1fr) 320px;
224
+ gap: 1.5rem;
225
+ align-items: start;
226
+ text-align: left;
227
+ }
228
+ .stage-col { position: sticky; top: 1rem; min-width: 0; }
229
+ .stage {
230
+ display: grid;
231
+ place-items: center;
232
+ background: repeating-conic-gradient(var(--surface) 0% 25%, var(--surface-sunken) 0% 50%) 50% / 24px 24px;
233
+ border-radius: var(--radius-lg);
234
+ padding: 1rem;
235
+ min-height: 240px;
236
+ overflow: hidden;
237
+ box-shadow: var(--shadow-sm);
238
+ }
239
+ .frame { position: relative; display: inline-block; line-height: 0; box-shadow: var(--shadow-md); border-radius: var(--radius-sm); overflow: hidden; }
240
+ #preview { display: block; max-width: 100%; max-height: min(70vh, 52rem); width: auto; height: auto; }
241
+ .overlay { position: absolute; inset: 0; cursor: crosshair; touch-action: none; }
242
+ .box { position: absolute; border-radius: var(--radius-sm); cursor: pointer; transition: background var(--ease), box-shadow var(--ease); }
243
+ .box.on { border: 2px solid #fafaf9; box-shadow: 0 0 0 1px #292524; }
244
+ .box.off { border: 2px dashed var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
245
+ .box.face { border-radius: 50%; }
246
+ .box:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
247
+ .box .tag {
248
+ position: absolute;
249
+ left: -2px;
250
+ top: -24px;
251
+ line-height: 1.45;
252
+ font-family: var(--font-ui);
253
+ font-size: 13px;
254
+ font-weight: 400;
255
+ padding: 4px 8px;
256
+ border-radius: var(--radius-sm);
257
+ background: var(--surface-raised);
258
+ color: var(--on-surface);
259
+ box-shadow: var(--shadow-sm);
260
+ white-space: nowrap;
261
+ opacity: 0;
262
+ pointer-events: none;
263
+ transition: opacity var(--ease);
264
+ }
265
+ .box:hover .tag { opacity: 1; }
266
+ .box.off .tag { color: var(--warn); }
267
+ .box .x {
268
+ position: absolute;
269
+ right: -9px;
270
+ top: -9px;
271
+ width: 20px;
272
+ height: 20px;
273
+ line-height: 18px;
274
+ text-align: center;
275
+ border-radius: 50%;
276
+ background: var(--bad);
277
+ color: var(--canvas);
278
+ font-size: 13px;
279
+ font-weight: 400;
280
+ opacity: 0;
281
+ }
282
+ .box.manual:hover .x { opacity: 1; }
283
+ .box.draft { border: 2px dashed var(--on-surface); background: color-mix(in srgb, var(--on-surface) 12%, transparent); pointer-events: none; }
284
+ .frame.peeking .overlay { opacity: 0; }
285
+
286
+ .scanfx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
287
+ .scanfx i {
288
+ position: absolute;
289
+ left: 0;
290
+ right: 0;
291
+ height: 90px;
292
+ top: -90px;
293
+ background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--accent) 28%, transparent));
294
+ animation: privacy-redact-scan 2.8s cubic-bezier(0.22, 1, 0.36, 1) infinite;
295
+ }
296
+ .stage-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem; padding: 0.75rem 0 0; }
297
+ .hint { flex: 1 1 14rem; min-width: min(100%, 14rem); color: var(--on-surface-muted); font-size: 14px; line-height: 1.6; }
298
+ .pagenav { display: flex; align-items: center; gap: 0.5rem; font-size: 14px; color: var(--on-surface-muted); }
299
+
300
+ .panel { display: flex; flex-direction: column; gap: 1.5rem; min-width: 0; }
301
+ .card {
302
+ background: var(--surface-raised);
303
+ border-radius: var(--radius-lg);
304
+ padding: 2rem;
305
+ box-shadow: var(--shadow-md);
306
+ min-width: 0;
307
+ }
308
+ .card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 1rem; gap: 0.75rem; min-width: 0; }
309
+ .card h2 {
310
+ margin: 0;
311
+ font-family: var(--font-display);
312
+ font-size: 1.25rem;
313
+ font-weight: 300;
314
+ line-height: 1.4;
315
+ letter-spacing: -0.02em;
316
+ color: var(--on-surface);
317
+ }
318
+ .count-badge {
319
+ font-size: 13px;
320
+ font-weight: 400;
321
+ line-height: 1.45;
322
+ color: var(--on-surface-muted);
323
+ background: var(--surface);
324
+ padding: 8px;
325
+ border-radius: var(--radius-sm);
326
+ }
327
+ .count-badge:empty { display: none; }
328
+ .tag {
329
+ font-size: 13px;
330
+ font-weight: 400;
331
+ line-height: 1.45;
332
+ padding: 8px;
333
+ border-radius: var(--radius-sm);
334
+ color: var(--on-surface-muted);
335
+ background: var(--surface);
336
+ }
337
+ .tag.ok { color: var(--good); background: color-mix(in srgb, var(--good) 12%, var(--surface)); }
338
+ .tag.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, var(--surface)); }
339
+
340
+ .scan-steps { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.5rem; font-size: 14px; line-height: 1.6; }
341
+ .scan-steps li { display: flex; align-items: center; gap: 0.75rem; color: var(--on-surface-muted); }
342
+ .scan-steps li .ic { width: 18px; height: 18px; display: grid; place-items: center; font-size: 13px; }
343
+ .scan-steps li.run { color: var(--on-surface); }
344
+ .scan-steps li.run .ic { border: 2px solid var(--surface-sunken); border-top-color: var(--accent); border-radius: 50%; animation: privacy-redact-spin 0.8s linear infinite; }
345
+ .scan-steps li.done { color: var(--on-surface); }
346
+ .scan-steps li.done .ic { color: var(--good); }
347
+ .scan-steps li .r { margin-left: auto; color: var(--on-surface-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
348
+ .bar { height: 4px; background: var(--surface-sunken); border-radius: 99px; overflow: hidden; }
349
+ .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width var(--ease); }
350
+ #scan-card.done .bar { display: none; }
351
+ #scan-card.done .scan-steps { margin-bottom: 0; }
352
+ #scan-card.done .scan-steps li:not(.done) { display: none; }
353
+
354
+ .transcript-head { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem; min-width: 0; max-width: 100%; }
355
+ .transcript-actions {
356
+ display: flex;
357
+ align-items: center;
358
+ flex-wrap: wrap;
359
+ gap: 0.5rem;
360
+ margin-left: auto;
361
+ min-width: 0;
362
+ max-width: 100%;
363
+ }
364
+ .transcript-actions > * { flex: none; max-width: 100%; }
365
+ .transcript-redact {
366
+ font-family: var(--font-ui);
367
+ font-size: 13px;
368
+ font-weight: 400;
369
+ line-height: 1.45;
370
+ color: var(--on-surface-muted);
371
+ background: var(--surface);
372
+ border: 0;
373
+ border-radius: var(--radius-sm);
374
+ padding: 8px 12px;
375
+ cursor: pointer;
376
+ box-shadow: var(--shadow-sm);
377
+ }
378
+ .transcript-redact.on { color: var(--on-surface); background: var(--surface-sunken); }
379
+ #transcript-empty:not([hidden]) + #transcript-text:not([hidden]) { margin-top: 0.75rem; }
380
+ .transcript-toggle {
381
+ flex: 1 1 auto;
382
+ display: flex;
383
+ align-items: center;
384
+ gap: 0.75rem;
385
+ min-width: 0;
386
+ max-width: 100%;
387
+ margin: 0;
388
+ padding: 0;
389
+ border: 0;
390
+ background: transparent;
391
+ box-shadow: none;
392
+ cursor: pointer;
393
+ text-align: left;
394
+ font-family: var(--font-display);
395
+ font-size: 1.25rem;
396
+ font-weight: 300;
397
+ line-height: 1.4;
398
+ letter-spacing: -0.02em;
399
+ color: var(--on-surface);
400
+ }
401
+ .transcript-toggle:hover { background: transparent; transform: none; box-shadow: none; }
402
+ .transcript-toggle #transcript-label { min-width: 0; overflow-wrap: anywhere; }
403
+ .twist {
404
+ width: 0.45rem;
405
+ height: 0.45rem;
406
+ border-right: 1.5px solid var(--on-surface-muted);
407
+ border-bottom: 1.5px solid var(--on-surface-muted);
408
+ transform: rotate(-45deg);
409
+ transition: transform var(--ease);
410
+ flex: none;
411
+ }
412
+ .transcript.open .twist { transform: rotate(45deg); }
413
+ #transcript-panel { margin-top: 1rem; }
414
+ #transcript-empty { text-align: left; }
415
+ #transcript-text {
416
+ margin: 0;
417
+ max-height: 16rem;
418
+ overflow: auto;
419
+ padding: 1rem;
420
+ background: var(--surface-sunken);
421
+ border-radius: var(--radius-md);
422
+ font-family: var(--font-ui);
423
+ font-size: 14px;
424
+ font-weight: 300;
425
+ line-height: 1.6;
426
+ white-space: pre-wrap;
427
+ overflow-wrap: anywhere;
428
+ user-select: text;
429
+ color: var(--on-surface);
430
+ }
431
+
432
+ .cats { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; }
433
+ .cat {
434
+ display: flex;
435
+ align-items: center;
436
+ gap: 0.75rem;
437
+ padding: 0.5rem 0.25rem;
438
+ border-radius: var(--radius-md);
439
+ cursor: pointer;
440
+ user-select: none;
441
+ transition: background var(--ease);
442
+ }
443
+ .cat:hover { background: var(--surface); }
444
+ .cat .ic { width: 24px; text-align: center; }
445
+ .cat .lbl { flex: 1; font-size: 15px; font-weight: 400; line-height: 1.5; }
446
+ .cat .n {
447
+ min-width: 22px;
448
+ text-align: center;
449
+ font-size: 13px;
450
+ font-weight: 400;
451
+ color: var(--on-surface-muted);
452
+ background: var(--surface);
453
+ border-radius: var(--radius-sm);
454
+ padding: 2px 8px;
455
+ }
456
+ .cat.has .n { color: var(--on-surface); background: var(--surface-sunken); }
457
+ .cat.none { opacity: 0.55; }
458
+ .switch { width: 34px; height: 20px; border-radius: 99px; background: var(--surface-sunken); position: relative; transition: background var(--ease); flex: none; }
459
+ .switch::after {
460
+ content: "";
461
+ position: absolute;
462
+ top: 2px;
463
+ left: 2px;
464
+ width: 16px;
465
+ height: 16px;
466
+ border-radius: 50%;
467
+ background: var(--surface-raised);
468
+ box-shadow: var(--shadow-sm);
469
+ transition: transform var(--ease);
470
+ }
471
+ .cat.enabled .switch { background: var(--accent); }
472
+ .cat.enabled .switch::after { transform: translateX(14px); }
473
+
474
+ .seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface-sunken); border-radius: var(--radius-md); padding: 4px; gap: 4px; }
475
+ .seg button {
476
+ font-family: var(--font-ui);
477
+ font-weight: 400;
478
+ font-size: 13px;
479
+ line-height: 1.45;
480
+ color: var(--on-surface-muted);
481
+ background: transparent;
482
+ border: 0;
483
+ padding: 8px;
484
+ border-radius: var(--radius-sm);
485
+ cursor: pointer;
486
+ transition: background var(--ease), color var(--ease), box-shadow var(--ease);
487
+ }
488
+ .seg button.on { background: var(--surface-raised); color: var(--on-surface); box-shadow: var(--shadow-sm); }
489
+ .slider { display: flex; align-items: center; gap: 0.75rem; margin-top: 1rem; font-size: 14px; line-height: 1.6; color: var(--on-surface-muted); }
490
+ .slider input { flex: 1; accent-color: var(--accent); }
491
+
492
+ .meta { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; font-size: 14px; line-height: 1.6; }
493
+ .meta li { display: flex; gap: 0.75rem; align-items: baseline; }
494
+ .meta .k { color: var(--on-surface-muted); flex: none; }
495
+ .meta .v { margin-left: auto; text-align: right; word-break: break-word; }
496
+ .meta .v.high { color: var(--bad); }
497
+ .meta .v.med { color: var(--warn); }
498
+ .meta .empty { color: var(--on-surface-muted); }
499
+
500
+ .export { position: sticky; bottom: 1rem; display: grid; gap: 0.75rem; }
501
+ .row { display: flex; gap: 0.75rem; }
502
+ .fmt { display: flex; align-items: center; gap: 0.75rem; color: var(--on-surface-muted); font-size: 15px; font-weight: 400; width: 100%; }
503
+ .fmt select {
504
+ flex: 1;
505
+ font-family: var(--font-ui);
506
+ font-size: 15px;
507
+ font-weight: 300;
508
+ line-height: 1.7;
509
+ color: var(--on-surface);
510
+ background: var(--surface);
511
+ border: 0;
512
+ border-radius: var(--radius-md);
513
+ padding: 12px;
514
+ box-shadow: var(--shadow-sm);
515
+ transition: background var(--ease), box-shadow var(--ease);
516
+ }
517
+ .fmt select:hover, .fmt select:focus { background: var(--surface-raised); }
518
+ .save-note {
519
+ font-size: 14px;
520
+ line-height: 1.6;
521
+ color: var(--good);
522
+ background: color-mix(in srgb, var(--good) 12%, var(--surface));
523
+ border-radius: var(--radius-md);
524
+ padding: 12px;
525
+ }
526
+ .save-note.bad { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, var(--surface)); }
527
+ .fine { margin: 0; color: var(--on-surface-muted); font-size: 14px; line-height: 1.6; text-align: center; }
528
+
529
+ .toast {
530
+ position: absolute;
531
+ left: 50%;
532
+ top: 1rem;
533
+ transform: translateX(-50%);
534
+ z-index: 20;
535
+ background: var(--surface-raised);
536
+ color: var(--on-surface);
537
+ padding: 12px 1rem;
538
+ border-radius: var(--radius-lg);
539
+ box-shadow: var(--shadow-lg);
540
+ font-size: 14px;
541
+ line-height: 1.6;
542
+ max-width: min(90vw, 28rem);
543
+ }
544
+ .dragveil {
545
+ position: absolute;
546
+ inset: 0;
547
+ z-index: 30;
548
+ display: grid;
549
+ place-items: center;
550
+ background: color-mix(in srgb, var(--canvas) 82%, transparent);
551
+ backdrop-filter: blur(8px);
552
+ font-family: var(--font-display);
553
+ font-size: 1.875rem;
554
+ font-weight: 300;
555
+ letter-spacing: -0.02em;
556
+ }
557
+ .dragveil > div { padding: 2rem 3rem; background: var(--surface-raised); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
558
+
559
+ /* After the base grid rules, so a narrow host column stacks instead of crushing the preview. */
560
+ @container review (max-width: 760px) {
561
+ #workspace { grid-template-columns: 1fr; }
562
+ .stage-col { position: static; }
563
+ #preview { max-height: 60vh; }
564
+ .export { position: static; }
565
+ }
566
+ }