@dcs-tech/tokens 0.0.0-stage → 0.16.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.
package/src/tokens.css ADDED
@@ -0,0 +1,921 @@
1
+ /* ============================================
2
+ @dcs-tech/tokens — Design Tokens
3
+ Single source of truth for every token, on every platform. Edited by hand;
4
+ tokens.ts and tokens.dart are generated from it (npm run generate).
5
+ ============================================ */
6
+
7
+ :root {
8
+ /* ========================================
9
+ BASE HUE VALUES - Change these to update entire theme!
10
+
11
+ Every semantic colour has its own hue axis. `secondary` and `info` used to
12
+ borrow --primary-hue, which made --info byte-identical to --accent-primary
13
+ and left `secondary` as nothing more than a lighter primary — so three of
14
+ the six semantic colours were indistinguishable on screen.
15
+
16
+ Hues are tuned to Material/MUI's palette so the set reads as one family.
17
+ Saturation and lightness are set per theme below, never here.
18
+ ======================================== */
19
+ --primary-hue: 211;
20
+ /* Blue — MUI primary #1976d2 */
21
+ --secondary-hue: 291;
22
+ /* Purple — MUI secondary #9c27b0 */
23
+ --success-hue: 123;
24
+ /* Green — MUI success #2e7d32 (was 142, a colder green) */
25
+ --warning-hue: 30;
26
+ /* Orange — MUI warning #ed6c02 (was 38, an amber that fails AA under white text) */
27
+ --error-hue: 0;
28
+ /* Red */
29
+ --info-hue: 201;
30
+ /* Cyan-blue — MUI info #0288d1, distinct from primary */
31
+ --neutral-hue: 0;
32
+ /* Gray (no color) */
33
+
34
+ /* ========================================
35
+ LIGHT THEME - YouTube-inspired calm palette
36
+ ======================================== */
37
+
38
+ /* Background Colors */
39
+ --bg-primary: hsl(var(--neutral-hue), 0%, 96%);
40
+ /* #f5f5f5 */
41
+ --bg-secondary: hsl(var(--neutral-hue), 0%, 100%);
42
+ /* #ffffff */
43
+ --bg-tertiary: hsl(var(--neutral-hue), 0%, 92%);
44
+ /* #ebebeb */
45
+ --bg-gradient: linear-gradient(180deg,
46
+ hsl(var(--neutral-hue), 0%, 98%) 0%,
47
+ hsl(var(--neutral-hue), 0%, 96%) 100%);
48
+
49
+ /* Text Colors */
50
+ --text-primary: hsl(var(--neutral-hue), 0%, 6%);
51
+ /* #0f0f0f */
52
+ --text-secondary: hsl(var(--neutral-hue), 0%, 38%);
53
+ /* #606060 */
54
+ --text-tertiary: hsl(var(--neutral-hue), 0%, 41%);
55
+ /* #696969 — was 45%, which measured 4.35:1 on --bg-primary and 3.98 on
56
+ --bg-tertiary: under AA for body text. 41% is the lightest grey that passes
57
+ on every light surface (lowest: 4.61 on --bg-tertiary). */
58
+
59
+ /* Border Colors */
60
+ --border-color: hsl(var(--neutral-hue), 0%, 90%);
61
+ /* #e5e5e5 */
62
+ --border-hover: hsl(var(--neutral-hue), 0%, 82%);
63
+ /* #d0d0d0 */
64
+ --border-focus: hsl(var(--primary-hue), 79%, 46%);
65
+
66
+ /* Shadows */
67
+ --shadow-sm: 0 1px 2px 0 hsla(var(--neutral-hue), 0%, 0%, 0.03);
68
+ --shadow-md: 0 1px 4px hsla(var(--neutral-hue), 0%, 0%, 0.08);
69
+ --shadow-lg: 0 2px 8px hsla(var(--neutral-hue), 0%, 0%, 0.1);
70
+ --shadow-xl: 0 4px 16px hsla(var(--neutral-hue), 0%, 0%, 0.12);
71
+ /* Knobs, slider thumbs and small round buttons that float on content. */
72
+ --shadow-control: 0 1px 3px hsla(var(--neutral-hue), 0%, 0%, 0.2);
73
+ /* Floating menus and popovers. */
74
+ --shadow-popover: 0 12px 32px hsla(var(--neutral-hue), 0%, 0%, 0.16);
75
+ /* Modal panels: dialogs, drawers, bottom sheets. The 1px ring edges the panel on a scrim. */
76
+ --shadow-dialog: 0 24px 48px -12px hsla(var(--neutral-hue), 0%, 0%, 0.18),
77
+ 0 0 0 1px hsla(var(--neutral-hue), 0%, 0%, 0.05);
78
+ /* The edge of a pinned column while content scrolls under it. Even on all sides:
79
+ clip it (clip-path) to the side that faces the scrolled content. */
80
+ --shadow-edge: 0 0 8px hsla(var(--neutral-hue), 0%, 0%, 0.2);
81
+
82
+ /* Scrims: the dimming layer behind a modal surface. */
83
+ --scrim: hsla(var(--neutral-hue), 0%, 0%, 0.45);
84
+ /* Lighter, for a drawer or action sheet that keeps the page behind it readable. */
85
+ --scrim-soft: hsla(var(--neutral-hue), 0%, 0%, 0.3);
86
+
87
+ /* Accent Colors — Primary + Secondary.
88
+ Saturation is deliberately below 100%: fully saturated colour vibrates on
89
+ screen and cannot carry white text at AA. `-hover` is a darker step of the
90
+ same hue, `-light` a pale tint used for halos and message backgrounds. */
91
+ --accent-primary: hsl(var(--primary-hue), 79%, 46%);
92
+ /* ≈ #1976d2 */
93
+ --accent-primary-hover: hsl(var(--primary-hue), 79%, 39%);
94
+ --accent-primary-light: hsl(var(--primary-hue), 79%, 92%);
95
+ --accent-secondary: hsl(var(--secondary-hue), 64%, 42%);
96
+ /* ≈ #9c27b0 — a genuinely different colour, not a tint of primary */
97
+ --accent-secondary-hover: hsl(var(--secondary-hue), 64%, 35%);
98
+ --accent-secondary-light: hsl(var(--secondary-hue), 64%, 93%);
99
+
100
+ /* Semantic Colors */
101
+ --success: hsl(var(--success-hue), 46%, 34%);
102
+ /* ≈ #2e7d32 */
103
+ --success-hover: hsl(var(--success-hue), 46%, 27%);
104
+ --success-light: hsl(var(--success-hue), 46%, 92%);
105
+ --warning: hsl(var(--warning-hue), 98%, 47%);
106
+ /* ≈ #ed6c02 — orange, not amber */
107
+ --warning-hover: hsl(var(--warning-hue), 98%, 40%);
108
+ --warning-light: hsl(var(--warning-hue), 98%, 92%);
109
+ --error: hsl(var(--error-hue), 65%, 51%);
110
+ /* ≈ #d32f2f — was #ff0000, fully saturated pure red */
111
+ --error-hover: hsl(var(--error-hue), 65%, 44%);
112
+ --error-light: hsl(var(--error-hue), 65%, 94%);
113
+ --info: hsl(var(--info-hue), 98%, 41%);
114
+ /* ≈ #0288d1 — was identical to --accent-primary */
115
+ /* LIGHTER on hover, unlike the other solids: info carries dark text (--on-info), and a
116
+ darker hover took that text down to 3.6:1. Hover moves away from the text colour. */
117
+ --info-hover: hsl(var(--info-hue), 98%, 47%);
118
+ --info-light: hsl(var(--info-hue), 98%, 92%);
119
+
120
+ /* Text colour to place ON each semantic colour — MUI calls this contrastText.
121
+ Not always white: measured against WCAG AA (4.5:1), white on warning is only
122
+ 2.88 and on info 3.90, so both need dark text. Without this a filled warning
123
+ button is unreadable. */
124
+ --on-primary: hsl(var(--neutral-hue), 0%, 100%);
125
+ --on-secondary: hsl(var(--neutral-hue), 0%, 100%);
126
+ --on-success: hsl(var(--neutral-hue), 0%, 100%);
127
+ --on-warning: hsl(var(--neutral-hue), 0%, 6%);
128
+ --on-error: hsl(var(--neutral-hue), 0%, 100%);
129
+ --on-info: hsl(var(--neutral-hue), 0%, 6%);
130
+
131
+ /* Card Styles */
132
+ --card-bg: hsl(var(--neutral-hue), 0%, 100%);
133
+ /* #ffffff */
134
+ --card-border: hsl(var(--neutral-hue), 0%, 90%);
135
+ /* #e5e5e5 */
136
+ --card-shadow: var(--shadow-md);
137
+
138
+ /* Layout & Animation */
139
+ --transition-speed: 0.2s;
140
+ --border-radius-xs: 4px;
141
+ --border-radius-sm: 8px;
142
+ --border-radius: 12px;
143
+ --border-radius-lg: 16px;
144
+ /* Pills and fully rounded ends. Any value past half the height gives the same shape. */
145
+ --border-radius-full: 999px;
146
+
147
+ /* ========================================
148
+ UI SCALE - Change this to scale the entire UI!
149
+ Default: 1 (100%). Range: 0.85 – 1.3
150
+ Set via useUIScale hook, persisted in localStorage.
151
+ ======================================== */
152
+ --ui-scale: 1;
153
+
154
+ /* ========================================
155
+ FORM FIELD SYSTEM
156
+ ======================================== */
157
+
158
+ /* Field Heights */
159
+ --field-height-xxs: calc(28px * var(--ui-scale));
160
+ --field-height-xs: calc(32px * var(--ui-scale));
161
+ --field-height-sm: calc(36px * var(--ui-scale));
162
+ --field-height-md: calc(42px * var(--ui-scale));
163
+ --field-height-lg: calc(52px * var(--ui-scale));
164
+ --field-height-xl: calc(60px * var(--ui-scale));
165
+
166
+ /* Field Padding Horizontal */
167
+ --field-padding-x-xxs: calc(6px * var(--ui-scale));
168
+ --field-padding-x-xs: calc(8px * var(--ui-scale));
169
+ --field-padding-x-sm: calc(10px * var(--ui-scale));
170
+ --field-padding-x-md: calc(12px * var(--ui-scale));
171
+ --field-padding-x-lg: calc(16px * var(--ui-scale));
172
+ --field-padding-x-xl: calc(20px * var(--ui-scale));
173
+
174
+ /* Field Padding Vertical
175
+ Every control (input box, select trigger, suggest input) must use these so
176
+ text sits on the same baseline at a given size. Previously each component
177
+ invented its own: Input used 0, Select hardcoded px, Suggest used --spacing-*. */
178
+ --field-padding-y-xxs: calc(3px * var(--ui-scale));
179
+ --field-padding-y-xs: calc(5px * var(--ui-scale));
180
+ --field-padding-y-sm: calc(7px * var(--ui-scale));
181
+ --field-padding-y-md: calc(9px * var(--ui-scale));
182
+ --field-padding-y-lg: calc(12px * var(--ui-scale));
183
+ --field-padding-y-xl: calc(15px * var(--ui-scale));
184
+
185
+ /* Border colour when hovering an UNFOCUSED field.
186
+ Deliberately not --border-hover: that is only 8 points of lightness away
187
+ from --border-color in light and 6 in dark, which on a 1px line is below
188
+ the perceptual threshold — the rule fired but nothing looked different.
189
+ This steps toward the text colour instead, the way MUI's outlined field
190
+ does, so hover is actually legible on a hairline border. */
191
+ --field-border-hover: hsl(var(--neutral-hue), 0%, 57%);
192
+
193
+ /* Focus indicators.
194
+ --focus-ring-* : outline-based ring used by the toggles, Button, Collapsible.
195
+ --focus-halo-* : soft halo behind the accent border on field surfaces
196
+ (Input/Select/Suggest) — a single ring, not an outline on
197
+ top of the border. */
198
+ --focus-ring-width: 2px;
199
+ --focus-ring-offset: 1px;
200
+ --focus-halo-width: 3px;
201
+
202
+ /* Width of the label column in a horizontal field layout, and the vertical
203
+ gap between stacked fields. Both were hardcoded px inside component CSS
204
+ (280px label, and three different root margins across Input/Select/Suggest). */
205
+ --field-label-width: calc(160px * var(--ui-scale));
206
+ /* How wide a CONTROL may get, in any layout.
207
+ Without it `.content { width: 100% }` fills whatever the container gives — a 1fr grid
208
+ column in horizontal, the full wrapper when stacked — so a 3-digit Days input rendered
209
+ ~500px wide on a 1200px page. Width was decided by the page, never by the field.
210
+ MUI's answer is the same shape: TextField is NOT full-width by default. This is that
211
+ default, as a token.
212
+ Override globally in an app, or for a whole area with
213
+ style={{ '--field-control-max-width': 'none' }}. For one field, use its `width` prop. */
214
+ --field-control-max-width: calc(320px * var(--ui-scale));
215
+
216
+ /* App shell. The bar and the sidebar HEADER must be the same height or the two sit a few
217
+ pixels out and the whole shell looks untidy — one token, so they cannot drift. 52px
218
+ matches the client's `--topbar-height` and `--sidebar-header-height`. */
219
+ --app-bar-height: 52px;
220
+ --sidebar-width: 240px;
221
+ --sidebar-width-collapsed: 56px;
222
+ --field-block-spacing: calc(16px * var(--ui-scale));
223
+
224
+ /* Control halo — the translucent circle behind a checkbox box, radio circle or
225
+ switch thumb on hover and focus (MUI's ripple affordance). Shared by all
226
+ three so the affordance is identical across them. Sized relative to the
227
+ control, so it follows --ui-scale. The neutral values double as the fallback
228
+ for browsers without color-mix(); a checked control tints them with its own
229
+ colour instead. Focus is deliberately ~2x the hover tint. */
230
+ --control-halo-size: 1.9;
231
+ --control-halo-hover: hsla(var(--neutral-hue), 0%, 50%, 0.10);
232
+ --control-halo-focus: hsla(var(--neutral-hue), 0%, 50%, 0.20);
233
+ --control-halo-pulse-duration: 2.5s;
234
+ /* Accent-tinted halo strength, shared by Switch / Radio / Checkbox.
235
+ These were hardcoded per component and drifted — focus was 24% on Switch and 26% on the
236
+ other two, which read as "the radio ring is darker". One definition now; changing the
237
+ toggle affordance app-wide is a change here. */
238
+ --control-halo-tint-hover: 14%;
239
+ --control-halo-tint-focus: 24%;
240
+
241
+ /* Toggle control sizes — the checkbox box, the radio circle and the switch
242
+ thumb. One scale so all three line up at a given FieldSize, and so they
243
+ respond to --ui-scale (they used to be hardcoded 16/20/24px, and only
244
+ small/medium/large existed at all). */
245
+ --control-size-xxs: calc(12px * var(--ui-scale));
246
+ --control-size-xs: calc(14px * var(--ui-scale));
247
+ --control-size-sm: calc(16px * var(--ui-scale));
248
+ --control-size-md: calc(20px * var(--ui-scale));
249
+ --control-size-lg: calc(24px * var(--ui-scale));
250
+ --control-size-xl: calc(28px * var(--ui-scale));
251
+
252
+ /* Space reserved on the trailing edge for in-field affixes (select arrow,
253
+ clear button, password toggle) so text never runs underneath them. */
254
+ --field-affix-space-xxs: calc(26px * var(--ui-scale));
255
+ --field-affix-space-xs: calc(28px * var(--ui-scale));
256
+ --field-affix-space-sm: calc(32px * var(--ui-scale));
257
+ --field-affix-space-md: calc(36px * var(--ui-scale));
258
+ --field-affix-space-lg: calc(40px * var(--ui-scale));
259
+ --field-affix-space-xl: calc(44px * var(--ui-scale));
260
+
261
+ /* Font families. --font-sans is the stack the reset always used, so nothing changes;
262
+ an app with a web font sets it once. --font-mono replaces four different monospace
263
+ stacks the components had each written out. */
264
+ --font-sans: 'PT Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
265
+ --font-mono: ui-monospace, 'SF Mono', SFMono-Regular, 'Cascadia Code', 'Fira Code', Menlo, Consolas, monospace;
266
+
267
+ /* Typography Scale — UI text */
268
+ --font-size-xxs: calc(11px * var(--ui-scale));
269
+ --font-size-xs: calc(12px * var(--ui-scale));
270
+ --font-size-sm: calc(13px * var(--ui-scale));
271
+ --font-size-md: calc(14px * var(--ui-scale));
272
+ --font-size-lg: calc(16px * var(--ui-scale));
273
+ --font-size-xl: calc(18px * var(--ui-scale));
274
+
275
+ /* The icon scale: Icon's `size` names, for an app that wants a fixed size. They follow
276
+ --ui-scale, so icons zoom with everything else. The library's own components do not use
277
+ them for icons: they use the slots below. */
278
+ --icon-size-3xs: calc(10px * var(--ui-scale));
279
+ --icon-size-xxs: calc(11px * var(--ui-scale));
280
+ --icon-size-xs: calc(12px * var(--ui-scale));
281
+ --icon-size-sm: calc(13px * var(--ui-scale));
282
+ --icon-size-md: calc(14px * var(--ui-scale));
283
+ --icon-size-lg: calc(16px * var(--ui-scale));
284
+ --icon-size-xl: calc(18px * var(--ui-scale));
285
+ --icon-size-2xl: calc(20px * var(--ui-scale));
286
+ --icon-size-3xl: calc(24px * var(--ui-scale));
287
+ --icon-size-4xl: calc(28px * var(--ui-scale));
288
+
289
+ /* The icon SLOTS (core/logic ICON_SLOT_SIZES carries the same numbers).
290
+ An icon's size comes from the place it sits in, never from the text around it: the
291
+ container sets --dcs-icon-size to its slot, as MUI's Button startIcon, ListItemIcon and
292
+ InputAdornment do. An icon in no slot is --icon-slot-default. Measured on the reference
293
+ app (built on MUI) at the same screen. */
294
+ /* An icon button (the 36px box), and the icon beside a small or medium Button's label. */
295
+ --icon-slot-button: calc(16px * var(--ui-scale));
296
+ /* An app bar's icon buttons, a large or xl Button. */
297
+ --icon-slot-prominent: calc(18px * var(--ui-scale));
298
+ /* A navigation row: Sidebar (its rail too), NavList, a menu item. */
299
+ --icon-slot-nav: calc(16px * var(--ui-scale));
300
+ /* A mark in a line: a select or expand chevron, a breadcrumb separator, a sort arrow, a header's ⋮. */
301
+ --icon-slot-inline: calc(14px * var(--ui-scale));
302
+ /* In a text field: an adornment, a field's own icon, its clear button. */
303
+ --icon-slot-field: calc(16px * var(--ui-scale));
304
+ /* Small and dense: a chip, an xs / xxs Button, a dense footer (pagination). */
305
+ --icon-slot-dense: calc(13px * var(--ui-scale));
306
+ /* An icon in no slot at all. */
307
+ --icon-slot-default: calc(16px * var(--ui-scale));
308
+
309
+ /* Icon's size="inherit": 1em of the text it sits in, rounded to a whole pixel — for an icon
310
+ inside running text (MUI's fontSize="inherit"). Also for a layout that must match such an
311
+ icon. --icon-text-ratio scales it (1). */
312
+ --icon-text-ratio: 1;
313
+ --icon-text-size: round(nearest, calc(1em * var(--icon-text-ratio)), 1px);
314
+ /* Kept for existing code (Icon's `size` names of the same name). */
315
+ --icon-size-action: calc(14px * var(--ui-scale));
316
+ --icon-size-marker: calc(13px * var(--ui-scale));
317
+ --icon-size-chip: calc(16px * var(--ui-scale));
318
+ --icon-size-status: calc(22px * var(--ui-scale));
319
+
320
+ /* The duotone icon style's second colour: the icon's own colour, softened. Set either one
321
+ (on :root, a section or one icon) to tint the insides of duotone icons differently. */
322
+ --icon-duotone-color: currentColor;
323
+ --icon-duotone-opacity: 0.16;
324
+
325
+ /* Headings. Fluid: each grows from its smaller size at a 400px viewport to its larger
326
+ one at 1000px, and both ends follow --ui-scale (the old vw-only clamps ignored it). */
327
+ --font-size-h1: clamp(calc(32px * var(--ui-scale)), calc(26.67px * var(--ui-scale) + 1.333vw), calc(40px * var(--ui-scale)));
328
+ --font-size-h2: clamp(calc(28px * var(--ui-scale)), calc(25.33px * var(--ui-scale) + 0.667vw), calc(32px * var(--ui-scale)));
329
+ --font-size-h3: clamp(calc(24px * var(--ui-scale)), calc(21.33px * var(--ui-scale) + 0.667vw), calc(28px * var(--ui-scale)));
330
+ --font-size-h4: clamp(calc(20px * var(--ui-scale)), calc(17.33px * var(--ui-scale) + 0.667vw), calc(24px * var(--ui-scale)));
331
+ --font-size-h5: clamp(calc(18px * var(--ui-scale)), calc(16.67px * var(--ui-scale) + 0.333vw), calc(20px * var(--ui-scale)));
332
+ --font-size-h6: clamp(calc(16px * var(--ui-scale)), calc(14.67px * var(--ui-scale) + 0.333vw), calc(18px * var(--ui-scale)));
333
+
334
+ /* Line heights, by what the text is (unitless, so they follow the font size):
335
+ tight headings and big numbers — large type needs less leading
336
+ snug UI text: labels, menu rows, table cells, captions
337
+ normal running text, the body default */
338
+ --line-height-tight: 1.2;
339
+ --line-height-snug: 1.4;
340
+ --line-height-normal: 1.5;
341
+
342
+ /* Font Weights */
343
+ --font-weight-regular: 400;
344
+ --font-weight-medium: 500;
345
+ --font-weight-semibold: 600;
346
+ --font-weight-bold: 700;
347
+
348
+ /* The case of the library's own UPPERCASE texts — group headings, column and section labels,
349
+ badges. Every such rule writes `text-transform: var(--ui-text-transform)`. UIProvider's
350
+ `textCase` sets it for its section and its portal container through `data-dcs-text-case`
351
+ (below); never set a value in a component. */
352
+ --ui-text-transform: uppercase;
353
+
354
+ /* Spacing Scale. Mostly a 4px grid; 2px is for hairline gaps (an icon and its count),
355
+ 6px sits between 4 and 8 because dense controls need it. */
356
+ --spacing-xxs: calc(2px * var(--ui-scale));
357
+ --spacing-xs: calc(4px * var(--ui-scale));
358
+ --spacing-sm: calc(6px * var(--ui-scale));
359
+ --spacing-md: calc(8px * var(--ui-scale));
360
+ --spacing-lg: calc(12px * var(--ui-scale));
361
+ --spacing-xl: calc(16px * var(--ui-scale));
362
+ --spacing-2xl: calc(24px * var(--ui-scale));
363
+ --spacing-3xl: calc(32px * var(--ui-scale));
364
+
365
+ /* Component Spacing — on the scale, so they follow --ui-scale like the rest. */
366
+ --label-spacing: var(--spacing-md);
367
+ --message-spacing: var(--spacing-sm);
368
+
369
+ /* Breakpoints */
370
+ --breakpoint-mobile: 600px;
371
+ --breakpoint-tablet: 960px;
372
+
373
+ /* ========================================
374
+ INTERACTIVE STATES
375
+ ======================================== */
376
+
377
+ /* Hover States */
378
+ --hover-overlay: hsla(var(--neutral-hue), 0%, 0%, 0.04);
379
+
380
+ /* Active/Selected States */
381
+ --active-overlay: hsla(var(--primary-hue), 79%, 46%, 0.08);
382
+ --selected-bg: var(--accent-primary-light);
383
+ --selected-border: var(--accent-primary);
384
+
385
+ /* Disabled States */
386
+ --disabled-bg: hsl(var(--neutral-hue), 0%, 95%);
387
+ --disabled-text: hsl(var(--neutral-hue), 0%, 48%);
388
+ --disabled-border: hsl(var(--neutral-hue), 0%, 88%);
389
+
390
+ /* ========================================
391
+ STATUS INDICATORS
392
+ ======================================== */
393
+
394
+ /* Stock Status Colors */
395
+ --status-in-stock: var(--success);
396
+ --status-in-stock-bg: var(--success-light);
397
+ --status-low-stock: var(--warning);
398
+ --status-low-stock-bg: var(--warning-light);
399
+ --status-out-stock: var(--error);
400
+ --status-out-stock-bg: var(--error-light);
401
+
402
+ /* Badge Colors */
403
+ --badge-bg: hsl(var(--neutral-hue), 0%, 92%);
404
+ --badge-text: var(--text-secondary);
405
+
406
+ /* Tooltip surface — an inverted surface, so it reads as an overlay rather
407
+ than as another panel. No existing token inverts, hence its own pair. */
408
+ --tooltip-bg: hsl(var(--neutral-hue), 0%, 20%);
409
+ --tooltip-text: hsl(var(--neutral-hue), 0%, 98%);
410
+
411
+ /* ========================================
412
+ ELEVATION & DEPTH
413
+ ======================================== */
414
+
415
+ /* Card Elevations */
416
+ --elevation-0: none;
417
+ --elevation-1: var(--shadow-sm);
418
+ --elevation-2: var(--shadow-md);
419
+ --elevation-3: var(--shadow-lg);
420
+ --elevation-4: var(--shadow-xl);
421
+
422
+ /* Card Hover Effect */
423
+ --card-hover-shadow: 0 4px 12px hsla(var(--neutral-hue), 0%, 0%, 0.15);
424
+ --card-hover-transform: translateY(-2px);
425
+
426
+ /* ========================================
427
+ GRID & LAYOUT
428
+ ======================================== */
429
+
430
+ /* Grid Gaps */
431
+ --grid-gap-sm: var(--spacing-md);
432
+ /* 8px */
433
+ --grid-gap-md: var(--spacing-lg);
434
+ /* 12px */
435
+ --grid-gap-lg: var(--spacing-xl);
436
+ /* 16px */
437
+
438
+ /* Grid Item Sizes */
439
+ --grid-item-min: 240px;
440
+ --grid-item-max: 320px;
441
+
442
+ /* ========================================
443
+ ANIMATION TIMINGS
444
+ ======================================== */
445
+
446
+ /* Durations are named by what moves, not by speed:
447
+ micro toggles, hover, press — feedback on the thing under the pointer
448
+ short small surfaces appearing: menus, popovers, list dropdowns, tooltips
449
+ medium expanding content, indicators travelling, toasts
450
+ long large surfaces: dialogs, drawers, the sidebar
451
+ Leaving is quicker than arriving: an exit uses the step below its enter
452
+ (a menu enters on short, exits on micro). Nobody waits to watch a thing go. */
453
+ /* A table cell's flash when its value changes (DataTable `flashColors`), by name. */
454
+ --flash-green: var(--success);
455
+ --flash-red: var(--error);
456
+ --flash-amber: hsl(45, 100%, 50%);
457
+ --flash-blue: var(--info);
458
+ --flash-purple: hsl(270, 57%, 58%);
459
+ --flash-teal: hsl(174, 100%, 29%);
460
+ --flash-orange: var(--warning);
461
+ --flash-pink: hsl(339, 82%, 52%);
462
+
463
+ /* Brand marks drawn in their own colours (an icon's coloured part: the UPI arrow, a logo's
464
+ colour look). The brands' official colours, the same in both themes — except the black
465
+ or navy marks (X, Apple, GitHub, Paytm's "pay", Visa, Google Pay's "Pay"), which are
466
+ white on a dark surface, as their own rules allow. */
467
+ --brand-upi-orange: #ea6405;
468
+ --brand-upi-green: #268150;
469
+ --brand-white: #ffffff;
470
+ --brand-whatsapp-green: #25d366;
471
+ --brand-facebook-blue: #0866ff;
472
+ --brand-instagram-yellow: #ffd600;
473
+ --brand-instagram-orange: #ff7a00;
474
+ --brand-instagram-pink: #ff0069;
475
+ --brand-instagram-purple: #d300c5;
476
+ --brand-instagram-violet: #7638fa;
477
+ --brand-x: #000000;
478
+ --brand-youtube-red: #ff0000;
479
+ --brand-telegram-blue: #26a5e4;
480
+ --brand-google-blue: #4285f4;
481
+ --brand-google-red: #ea4335;
482
+ --brand-google-yellow: #fbbc04;
483
+ --brand-google-green: #34a853;
484
+ --brand-google-maps-blue: #1a73e8;
485
+ --brand-app-store-blue: #0d96f6;
486
+ --brand-apple: #000000;
487
+ --brand-github: #181717;
488
+ --brand-google-pay-grey: #5f6368;
489
+ --brand-phonepe-purple: #5f259f;
490
+ --brand-paytm: #20336b;
491
+ --brand-paytm-cyan: #00baf2;
492
+ --brand-visa: #1a1f71;
493
+ --brand-mastercard-red: #eb001b;
494
+ --brand-mastercard-yellow: #f79e1b;
495
+ --brand-mastercard-orange: #ff5f00;
496
+ --brand-linkedin: #0a66c2;
497
+ --brand-microsoft-red: #f35325;
498
+ --brand-microsoft-green: #81bc06;
499
+ --brand-microsoft-blue: #05a6f0;
500
+ --brand-microsoft-yellow: #ffba08;
501
+ --brand-rupay: #1b3281;
502
+ --brand-rupay-orange: #f47920;
503
+ --brand-rupay-green: #008c44;
504
+ /* The "Sign in with Google" button (GoogleSignInButton), as Google's branding guidelines set
505
+ it: each theme's fill, 1px inside stroke and text, and the button's measures at Google's
506
+ 40px height (padding 12px before the G, 10px after it, 12px after the text; a 20px G; text
507
+ 14/20). Chosen by the button's `theme` prop, so they stay the same in the app's dark theme. */
508
+ --brand-google-button-light-fill: #ffffff;
509
+ --brand-google-button-light-stroke: #747775;
510
+ --brand-google-button-light-text: #1f1f1f;
511
+ --brand-google-button-dark-fill: #131314;
512
+ --brand-google-button-dark-stroke: #8e918f;
513
+ --brand-google-button-dark-text: #e3e3e3;
514
+ --brand-google-button-neutral-fill: #f2f2f2;
515
+ --brand-google-button-neutral-stroke: transparent;
516
+ --brand-google-button-neutral-text: #1f1f1f;
517
+ --brand-google-button-height: calc(40px * var(--ui-scale));
518
+ --brand-google-button-logo-size: calc(20px * var(--ui-scale));
519
+ --brand-google-button-padding-start: calc(12px * var(--ui-scale));
520
+ --brand-google-button-logo-gap: calc(10px * var(--ui-scale));
521
+ --brand-google-button-padding-end: calc(12px * var(--ui-scale));
522
+ --brand-google-button-radius: calc(4px * var(--ui-scale));
523
+ --brand-google-button-font-size: calc(14px * var(--ui-scale));
524
+ --brand-google-button-line-height: calc(20px * var(--ui-scale));
525
+ /* Disabled, as Google's own button: the fill and contents at 38%, the stroke a faint line of the text colour. */
526
+ --brand-google-button-disabled-opacity: 38%;
527
+ --brand-google-button-disabled-stroke-opacity: 12%;
528
+
529
+ --duration-micro: 100ms;
530
+ --duration-short: 150ms;
531
+ --duration-medium: 200ms;
532
+ --duration-long: 300ms;
533
+
534
+ /* Easing by purpose.
535
+ standard moves while staying on screen (indicator, reorder, resize)
536
+ enter arrives — starts fast, settles gently
537
+ exit leaves — starts gently, accelerates away
538
+ spring small physical moments (switch thumb, press release, indicator).
539
+ A sampled damped spring with ~4% overshoot; browsers without
540
+ linear() treat the declaration as invalid and fall back to `ease`. */
541
+ --ease-standard: cubic-bezier(0.2, 0, 0, 1);
542
+ --ease-enter: cubic-bezier(0.05, 0.7, 0.1, 1);
543
+ --ease-exit: cubic-bezier(0.3, 0, 0.8, 0.15);
544
+ /* constant turns at an even speed without end: a loading spinner. */
545
+ --ease-constant: linear;
546
+ --ease-spring: linear(0, 0.074, 0.239, 0.432, 0.614, 0.767, 0.882, 0.962, 1.011, 1.036, 1.045, 1.044, 1.038, 1.029, 1.021, 1.013, 1.007, 1.003, 1, 0.999, 1);
547
+
548
+ /* Reduced motion. 1 normally, 0 under prefers-reduced-motion (below). Every
549
+ distance a surface travels and every scale it grows from is multiplied by it,
550
+ so reduced motion removes MOVEMENT but keeps the short fade — the user still
551
+ sees that something opened or closed. */
552
+ --motion-scale: 1;
553
+ /* How far a surface travels as it enters, and the scale it grows from. Shared so
554
+ every floating surface arrives the same way. */
555
+ --motion-enter-offset: calc(4px * var(--motion-scale));
556
+ --motion-enter-scale: calc(1 - 0.04 * var(--motion-scale));
557
+
558
+ /* Press feedback — the shared engine in components/Press, used by anything pressable.
559
+ The state layer is the element's OWN text colour laid over its background, so one
560
+ rule works on every variant, colour and theme: faint on hover, stronger while
561
+ pressed. The press-down follows --motion-scale, so reduced motion keeps the layer
562
+ and drops the movement. */
563
+ --state-hover-opacity: 8%;
564
+ --state-press-opacity: 14%;
565
+ --press-scale: calc(1 - 0.03 * var(--motion-scale));
566
+ /* The ripple: how long a wave takes to spread, and how strong it is (of the text colour).
567
+ Longer than the UI durations on purpose — a wave has to be SEEN travelling. */
568
+ --ripple-duration: 550ms;
569
+ --ripple-opacity: 0.3;
570
+ --press-transition:
571
+ --state-layer-opacity var(--duration-short) var(--ease-standard),
572
+ scale var(--duration-short) var(--ease-spring);
573
+
574
+ /* Legacy names, kept for consumers; same values as before. New code uses
575
+ --duration-* and the purpose easings above. */
576
+ --transition-fast: var(--duration-short);
577
+ --transition-base: var(--duration-medium);
578
+ --transition-slow: var(--duration-long);
579
+ --transition-slower: 400ms;
580
+
581
+ --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
582
+ --ease-out: cubic-bezier(0, 0, 0.2, 1);
583
+ --ease-in: cubic-bezier(0.4, 0, 1, 1);
584
+
585
+ /* ========================================
586
+ Z-INDEX LAYERS
587
+ ======================================== */
588
+
589
+ /* Every stacked layer must use one of these — a literal z-index escapes the
590
+ scale and wins or loses fights by accident. Dialog and Tooltip render in the
591
+ browser's top layer and sit above all of this regardless.
592
+ --z-popover is above --z-modal so a menu opened from inside a (non-top-layer)
593
+ modal is not hidden behind it. */
594
+ --z-base: 0;
595
+ --z-dropdown: 100;
596
+ --z-sticky: 200;
597
+ --z-fixed: 300;
598
+ --z-appbar: var(--z-fixed);
599
+ --z-modal-backdrop: 400;
600
+ --z-modal: 500;
601
+ --z-command-palette: 550;
602
+ --z-popover: 560;
603
+ --z-toast: 600;
604
+ --z-tooltip: 700;
605
+ }
606
+
607
+ @media (prefers-reduced-motion: reduce) {
608
+ :root {
609
+ --motion-scale: 0;
610
+ }
611
+ }
612
+
613
+ /* UIProvider `textCase`: the nearest attribute wins, so a nested
614
+ provider sets the case for its section. */
615
+ [data-dcs-text-case='normal'] {
616
+ --ui-text-transform: none;
617
+ }
618
+
619
+ [data-dcs-text-case='uppercase'] {
620
+ --ui-text-transform: uppercase;
621
+ }
622
+
623
+ /* Registered so the state layer can FADE: an unregistered custom property flips in one step. */
624
+ @property --state-layer-opacity {
625
+ syntax: '<percentage>';
626
+ inherits: false;
627
+ initial-value: 0%;
628
+ }
629
+
630
+ /* ========================================
631
+ COLOUR SCALES
632
+ Twelve steps per colour, each step with one job (the Radix model):
633
+ 1 app background tint 7 border, interactive
634
+ 2 subtle background 8 strong border, focus
635
+ 3 component fill 9 SOLID — the colour itself
636
+ 4 component fill, hover 10 solid, hover
637
+ 5 component fill, selected 11 text — readable on steps 1-5 and the surfaces
638
+ 6 subtle border 12 high-contrast text
639
+ Step 9 and 10 ARE the existing semantic tokens, so nothing that already uses
640
+ them changes. Steps 1-8 mix step 9 into the panel surface; 11-12 mix it toward
641
+ the text colour. Both of those swap per theme, so this one definition yields a
642
+ light scale in light mode and a dark scale in dark mode — and changing a hue at
643
+ the top of this file still re-themes every step.
644
+ Declared on [data-theme] as well as :root so a themed SUBTREE recomputes them;
645
+ a value computed on :root alone would be inherited unchanged.
646
+ ======================================== */
647
+ :root,
648
+ [data-theme] {
649
+ /* primary */
650
+ --primary-1: color-mix(in oklab, var(--accent-primary) 3%, var(--bg-secondary));
651
+ --primary-2: color-mix(in oklab, var(--accent-primary) 6%, var(--bg-secondary));
652
+ --primary-3: color-mix(in oklab, var(--accent-primary) 11%, var(--bg-secondary));
653
+ --primary-4: color-mix(in oklab, var(--accent-primary) 16%, var(--bg-secondary));
654
+ --primary-5: color-mix(in oklab, var(--accent-primary) 22%, var(--bg-secondary));
655
+ --primary-6: color-mix(in oklab, var(--accent-primary) 30%, var(--bg-secondary));
656
+ --primary-7: color-mix(in oklab, var(--accent-primary) 42%, var(--bg-secondary));
657
+ --primary-8: color-mix(in oklab, var(--accent-primary) 60%, var(--bg-secondary));
658
+ --primary-9: var(--accent-primary);
659
+ --primary-10: var(--accent-primary-hover);
660
+ --primary-11: color-mix(in oklab, var(--accent-primary) 66%, var(--text-primary));
661
+ --primary-12: color-mix(in oklab, var(--accent-primary) 35%, var(--text-primary));
662
+
663
+ /* secondary */
664
+ --secondary-1: color-mix(in oklab, var(--accent-secondary) 3%, var(--bg-secondary));
665
+ --secondary-2: color-mix(in oklab, var(--accent-secondary) 6%, var(--bg-secondary));
666
+ --secondary-3: color-mix(in oklab, var(--accent-secondary) 11%, var(--bg-secondary));
667
+ --secondary-4: color-mix(in oklab, var(--accent-secondary) 16%, var(--bg-secondary));
668
+ --secondary-5: color-mix(in oklab, var(--accent-secondary) 22%, var(--bg-secondary));
669
+ --secondary-6: color-mix(in oklab, var(--accent-secondary) 30%, var(--bg-secondary));
670
+ --secondary-7: color-mix(in oklab, var(--accent-secondary) 42%, var(--bg-secondary));
671
+ --secondary-8: color-mix(in oklab, var(--accent-secondary) 60%, var(--bg-secondary));
672
+ --secondary-9: var(--accent-secondary);
673
+ --secondary-10: var(--accent-secondary-hover);
674
+ --secondary-11: color-mix(in oklab, var(--accent-secondary) 66%, var(--text-primary));
675
+ --secondary-12: color-mix(in oklab, var(--accent-secondary) 35%, var(--text-primary));
676
+
677
+ /* success */
678
+ --success-1: color-mix(in oklab, var(--success) 3%, var(--bg-secondary));
679
+ --success-2: color-mix(in oklab, var(--success) 6%, var(--bg-secondary));
680
+ --success-3: color-mix(in oklab, var(--success) 11%, var(--bg-secondary));
681
+ --success-4: color-mix(in oklab, var(--success) 16%, var(--bg-secondary));
682
+ --success-5: color-mix(in oklab, var(--success) 22%, var(--bg-secondary));
683
+ --success-6: color-mix(in oklab, var(--success) 30%, var(--bg-secondary));
684
+ --success-7: color-mix(in oklab, var(--success) 42%, var(--bg-secondary));
685
+ --success-8: color-mix(in oklab, var(--success) 60%, var(--bg-secondary));
686
+ --success-9: var(--success);
687
+ --success-10: var(--success-hover);
688
+ --success-11: color-mix(in oklab, var(--success) 66%, var(--text-primary));
689
+ --success-12: color-mix(in oklab, var(--success) 35%, var(--text-primary));
690
+
691
+ /* warning */
692
+ --warning-1: color-mix(in oklab, var(--warning) 3%, var(--bg-secondary));
693
+ --warning-2: color-mix(in oklab, var(--warning) 6%, var(--bg-secondary));
694
+ --warning-3: color-mix(in oklab, var(--warning) 11%, var(--bg-secondary));
695
+ --warning-4: color-mix(in oklab, var(--warning) 16%, var(--bg-secondary));
696
+ --warning-5: color-mix(in oklab, var(--warning) 22%, var(--bg-secondary));
697
+ --warning-6: color-mix(in oklab, var(--warning) 30%, var(--bg-secondary));
698
+ --warning-7: color-mix(in oklab, var(--warning) 42%, var(--bg-secondary));
699
+ --warning-8: color-mix(in oklab, var(--warning) 60%, var(--bg-secondary));
700
+ --warning-9: var(--warning);
701
+ --warning-10: var(--warning-hover);
702
+ --warning-11: color-mix(in oklab, var(--warning) 66%, var(--text-primary));
703
+ --warning-12: color-mix(in oklab, var(--warning) 35%, var(--text-primary));
704
+
705
+ /* error */
706
+ --error-1: color-mix(in oklab, var(--error) 3%, var(--bg-secondary));
707
+ --error-2: color-mix(in oklab, var(--error) 6%, var(--bg-secondary));
708
+ --error-3: color-mix(in oklab, var(--error) 11%, var(--bg-secondary));
709
+ --error-4: color-mix(in oklab, var(--error) 16%, var(--bg-secondary));
710
+ --error-5: color-mix(in oklab, var(--error) 22%, var(--bg-secondary));
711
+ --error-6: color-mix(in oklab, var(--error) 30%, var(--bg-secondary));
712
+ --error-7: color-mix(in oklab, var(--error) 42%, var(--bg-secondary));
713
+ --error-8: color-mix(in oklab, var(--error) 60%, var(--bg-secondary));
714
+ --error-9: var(--error);
715
+ --error-10: var(--error-hover);
716
+ --error-11: color-mix(in oklab, var(--error) 66%, var(--text-primary));
717
+ --error-12: color-mix(in oklab, var(--error) 35%, var(--text-primary));
718
+
719
+ /* info */
720
+ --info-1: color-mix(in oklab, var(--info) 3%, var(--bg-secondary));
721
+ --info-2: color-mix(in oklab, var(--info) 6%, var(--bg-secondary));
722
+ --info-3: color-mix(in oklab, var(--info) 11%, var(--bg-secondary));
723
+ --info-4: color-mix(in oklab, var(--info) 16%, var(--bg-secondary));
724
+ --info-5: color-mix(in oklab, var(--info) 22%, var(--bg-secondary));
725
+ --info-6: color-mix(in oklab, var(--info) 30%, var(--bg-secondary));
726
+ --info-7: color-mix(in oklab, var(--info) 42%, var(--bg-secondary));
727
+ --info-8: color-mix(in oklab, var(--info) 60%, var(--bg-secondary));
728
+ --info-9: var(--info);
729
+ --info-10: var(--info-hover);
730
+ --info-11: color-mix(in oklab, var(--info) 66%, var(--text-primary));
731
+ --info-12: color-mix(in oklab, var(--info) 35%, var(--text-primary));
732
+
733
+ /* neutral — the text colour mixed into the panel surface */
734
+ --neutral-1: color-mix(in oklab, var(--text-primary) 2%, var(--bg-secondary));
735
+ --neutral-2: color-mix(in oklab, var(--text-primary) 4%, var(--bg-secondary));
736
+ --neutral-3: color-mix(in oklab, var(--text-primary) 7%, var(--bg-secondary));
737
+ --neutral-4: color-mix(in oklab, var(--text-primary) 10%, var(--bg-secondary));
738
+ --neutral-5: color-mix(in oklab, var(--text-primary) 13%, var(--bg-secondary));
739
+ --neutral-6: color-mix(in oklab, var(--text-primary) 17%, var(--bg-secondary));
740
+ --neutral-7: color-mix(in oklab, var(--text-primary) 24%, var(--bg-secondary));
741
+ --neutral-8: color-mix(in oklab, var(--text-primary) 36%, var(--bg-secondary));
742
+ --neutral-9: color-mix(in oklab, var(--text-primary) 52%, var(--bg-secondary));
743
+ --neutral-10: color-mix(in oklab, var(--text-primary) 58%, var(--bg-secondary));
744
+ --neutral-11: color-mix(in oklab, var(--text-primary) 68%, var(--bg-secondary));
745
+ --neutral-12: color-mix(in oklab, var(--text-primary) 92%, var(--bg-secondary));
746
+
747
+ /* Role tokens on top of the scales.
748
+ -soft a TRANSLUCENT tint of the colour: a badge, a selected row, a message
749
+ background. Translucent so it reads the same on the page, a card or a
750
+ tinted panel — the opaque -light tints only match the surface they
751
+ were mixed against.
752
+ -text the colour as text, readable on the surfaces and on its own -soft.
753
+ The solid itself (step 9) is tuned to carry white text, not to BE text;
754
+ warning and info fail as text on a light surface. */
755
+ --accent-primary-soft: color-mix(in oklab, var(--accent-primary) 12%, transparent);
756
+ --accent-primary-text: var(--primary-11);
757
+ --accent-secondary-soft: color-mix(in oklab, var(--accent-secondary) 12%, transparent);
758
+ --accent-secondary-text: var(--secondary-11);
759
+ --success-soft: color-mix(in oklab, var(--success) 12%, transparent);
760
+ --success-text: var(--success-11);
761
+ --warning-soft: color-mix(in oklab, var(--warning) 12%, transparent);
762
+ --warning-text: var(--warning-11);
763
+ --error-soft: color-mix(in oklab, var(--error) 12%, transparent);
764
+ --error-text: var(--error-11);
765
+ --info-soft: color-mix(in oklab, var(--info) 12%, transparent);
766
+ --info-text: var(--info-11);
767
+ }
768
+
769
+ /* ========================================
770
+ DARK THEME
771
+ Activated via data-theme="dark" on <html>
772
+ ======================================== */
773
+ [data-theme="dark"] {
774
+ /* Native controls (scrollbars, date pickers, autofill) follow the theme too. */
775
+ color-scheme: dark;
776
+
777
+ /* The black and navy brand marks are white on a dark surface (every other brand colour is
778
+ the same in both themes). */
779
+ --brand-x: #ffffff;
780
+ --brand-apple: #ffffff;
781
+ --brand-github: #ffffff;
782
+ --brand-google-pay-grey: #ffffff;
783
+ --brand-paytm: #ffffff;
784
+ --brand-visa: #ffffff;
785
+ --brand-rupay: #ffffff;
786
+
787
+ /* A light line on a dark surface needs a little more fill to read as a tint. */
788
+ --icon-duotone-opacity: 0.22;
789
+
790
+ /* Background Colors */
791
+ --bg-primary: hsl(var(--neutral-hue), 0%, 6%);
792
+ --bg-secondary: hsl(var(--neutral-hue), 0%, 13%);
793
+ --bg-tertiary: hsl(var(--neutral-hue), 0%, 16%);
794
+ --bg-gradient: linear-gradient(180deg,
795
+ hsl(var(--neutral-hue), 0%, 6%) 0%,
796
+ hsl(var(--neutral-hue), 0%, 9%) 100%);
797
+
798
+ /* Text Colors */
799
+ --text-primary: hsl(var(--neutral-hue), 0%, 95%);
800
+ --text-secondary: hsl(var(--neutral-hue), 0%, 67%);
801
+ --text-tertiary: hsl(var(--neutral-hue), 0%, 58%);
802
+
803
+ /* Border Colors */
804
+ --border-color: hsl(var(--neutral-hue), 0%, 25%);
805
+ --border-hover: hsl(var(--neutral-hue), 0%, 31%);
806
+ --field-border-hover: hsl(var(--neutral-hue), 0%, 55%);
807
+ --control-halo-hover: hsla(var(--neutral-hue), 0%, 100%, 0.10);
808
+ --control-halo-focus: hsla(var(--neutral-hue), 0%, 100%, 0.20);
809
+ --border-focus: hsl(var(--primary-hue), 90%, 77%);
810
+
811
+ /* Shadows */
812
+ --shadow-sm: 0 1px 2px 0 hsla(var(--neutral-hue), 0%, 0%, 0.5);
813
+ --shadow-md: 0 1px 4px hsla(var(--neutral-hue), 0%, 0%, 0.6);
814
+ --shadow-lg: 0 2px 8px hsla(var(--neutral-hue), 0%, 0%, 0.7);
815
+ --shadow-xl: 0 4px 16px hsla(var(--neutral-hue), 0%, 0%, 0.8);
816
+ --shadow-control: 0 1px 3px hsla(var(--neutral-hue), 0%, 0%, 0.6);
817
+ --shadow-popover: 0 12px 32px hsla(var(--neutral-hue), 0%, 0%, 0.6);
818
+ --shadow-dialog: 0 24px 48px -12px hsla(var(--neutral-hue), 0%, 0%, 0.7),
819
+ 0 0 0 1px hsla(var(--neutral-hue), 0%, 0%, 0.4);
820
+ --shadow-edge: 0 0 8px hsla(var(--neutral-hue), 0%, 0%, 0.6);
821
+
822
+ /* Scrims: deeper, as the page under them is already dark. */
823
+ --scrim: hsla(var(--neutral-hue), 0%, 0%, 0.65);
824
+ --scrim-soft: hsla(var(--neutral-hue), 0%, 0%, 0.5);
825
+
826
+ /* Accent Colors */
827
+ /* Dark theme lightens every semantic colour. Previously only primary was
828
+ adjusted — success/warning/error kept their LIGHT-theme values, so a dark
829
+ green sat on a near-black surface with almost no contrast.
830
+ `-light` stays a DARK tint here: it backs halos and message panels. */
831
+ --accent-primary: hsl(var(--primary-hue), 90%, 77%);
832
+ --accent-primary-hover: hsl(var(--primary-hue), 90%, 84%);
833
+ --accent-primary-light: hsl(var(--primary-hue), 90%, 22%);
834
+ --accent-secondary: hsl(var(--secondary-hue), 47%, 71%);
835
+ --accent-secondary-hover: hsl(var(--secondary-hue), 47%, 79%);
836
+ --accent-secondary-light: hsl(var(--secondary-hue), 47%, 22%);
837
+
838
+ /* Semantic Colors */
839
+ --success: hsl(var(--success-hue), 38%, 57%);
840
+ /* ≈ #66bb6a */
841
+ --success-hover: hsl(var(--success-hue), 38%, 64%);
842
+ --success-light: hsl(var(--success-hue), 38%, 18%);
843
+ --warning: hsl(var(--warning-hue), 100%, 60%);
844
+ /* ≈ #ffa726 */
845
+ --warning-hover: hsl(var(--warning-hue), 100%, 67%);
846
+ --warning-light: hsl(var(--warning-hue), 100%, 18%);
847
+ --error: hsl(var(--error-hue), 85%, 62%);
848
+ /* ≈ #f44336 */
849
+ --error-hover: hsl(var(--error-hue), 85%, 69%);
850
+ --error-light: hsl(var(--error-hue), 85%, 18%);
851
+ --info: hsl(var(--info-hue), 92%, 56%);
852
+ /* ≈ #29b6f6 */
853
+ --info-hover: hsl(var(--info-hue), 92%, 63%);
854
+ --info-light: hsl(var(--info-hue), 92%, 18%);
855
+
856
+ /* Dark-theme semantics are light tints, so every one of them needs dark text
857
+ (white scores 1.86–3.59 against them — all failing). */
858
+ --on-primary: hsl(var(--neutral-hue), 0%, 6%);
859
+ --on-secondary: hsl(var(--neutral-hue), 0%, 6%);
860
+ --on-success: hsl(var(--neutral-hue), 0%, 6%);
861
+ --on-warning: hsl(var(--neutral-hue), 0%, 6%);
862
+ --on-error: hsl(var(--neutral-hue), 0%, 6%);
863
+ --on-info: hsl(var(--neutral-hue), 0%, 6%);
864
+
865
+ /* Card Styles */
866
+ --card-bg: hsl(var(--neutral-hue), 0%, 13%);
867
+ --card-border: hsl(var(--neutral-hue), 0%, 25%);
868
+ --card-shadow: var(--shadow-lg);
869
+
870
+ /* Interactive States - Dark Mode */
871
+ --hover-overlay: hsla(var(--neutral-hue), 0%, 100%, 0.08);
872
+ --disabled-bg: hsl(var(--neutral-hue), 0%, 18%);
873
+ --disabled-text: hsl(var(--neutral-hue), 0%, 56%);
874
+ --disabled-border: hsl(var(--neutral-hue), 0%, 28%);
875
+
876
+ /* Badge Colors - Dark Mode. Text stays --text-secondary as in light: the tertiary grey
877
+ measured 4.16:1 on this badge fill, under AA. */
878
+ --badge-bg: hsl(var(--neutral-hue), 0%, 20%);
879
+
880
+ /* Tooltip - Dark Mode: lighter than the page, still the inverted surface. */
881
+ --tooltip-bg: hsl(var(--neutral-hue), 0%, 30%);
882
+ --tooltip-text: hsl(var(--neutral-hue), 0%, 96%);
883
+
884
+ /* Card Hover - Dark Mode */
885
+ --card-hover-shadow: 0 4px 12px hsla(var(--neutral-hue), 0%, 0%, 0.4);
886
+ }
887
+
888
+ /* ═══ Scripts: a font stack and line heights per writing system ═══════════════════════════
889
+ Latin is the default above (--font-sans, --line-height-*). A page in Tamil or Hindi sets
890
+ <html lang="ta"> / lang="hi" (or lang on any section), and :lang() swaps the stack and the line
891
+ heights for everything inside it. Nothing else is needed from the app except to load the fonts:
892
+ the library names 'Noto Sans Tamil' and 'Noto Sans Devanagari' but does not load them, so
893
+ without them the system's own Tamil / Devanagari font is used (Nirmala UI, Latha, Mangal).
894
+ Each stack starts with the Latin font, so Latin letters and digits in the same text keep it,
895
+ and the script's font draws only that script's letters.
896
+ Tamil and Devanagari letters have tall marks above and below, so lines need more room.
897
+ An app with its own web font sets --font-sans-tamil / --font-sans-devanagari as well. */
898
+ :root {
899
+ --font-sans-tamil: 'PT Sans', 'Noto Sans Tamil', 'Nirmala UI', Latha, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
900
+ --font-sans-devanagari: 'PT Sans', 'Noto Sans Devanagari', 'Nirmala UI', Mangal, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
901
+ --line-height-tight-tamil: 1.35;
902
+ --line-height-snug-tamil: 1.6;
903
+ --line-height-normal-tamil: 1.7;
904
+ --line-height-tight-devanagari: 1.35;
905
+ --line-height-snug-devanagari: 1.55;
906
+ --line-height-normal-devanagari: 1.65;
907
+ }
908
+
909
+ :lang(ta) {
910
+ --font-sans: var(--font-sans-tamil);
911
+ --line-height-tight: var(--line-height-tight-tamil);
912
+ --line-height-snug: var(--line-height-snug-tamil);
913
+ --line-height-normal: var(--line-height-normal-tamil);
914
+ }
915
+
916
+ :lang(hi) {
917
+ --font-sans: var(--font-sans-devanagari);
918
+ --line-height-tight: var(--line-height-tight-devanagari);
919
+ --line-height-snug: var(--line-height-snug-devanagari);
920
+ --line-height-normal: var(--line-height-normal-devanagari);
921
+ }