@nextlyhq/ui 0.0.2-alpha.8 → 0.0.2-alpha.81

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/dist/theme.css ADDED
@@ -0,0 +1,1425 @@
1
+ /**
2
+ * Nextly design-system theme.
3
+ *
4
+ * Single source of truth for tokens, the Tailwind `@theme inline` mappings, the
5
+ * dark variant, and the animation keyframes. It does NOT include a base reset —
6
+ * that lives in `index.css` and ships in the pre-compiled `styles.css` bundle.
7
+ * Consumed two ways:
8
+ * - Source: `@import "@nextlyhq/ui/theme.css"` after `@import "tailwindcss"`
9
+ * to compile against the token contract (admin, power-user plugins).
10
+ * - Pre-compiled: `@nextlyhq/ui/styles.css` bundles this behind a Tailwind
11
+ * build so plugins get styled components with zero setup.
12
+ *
13
+ * Selectors are unscoped (`:root` / `.dark`); a consumer that embeds the UI in a
14
+ * host page scopes them at build time (admin rewrites to `.nextly-admin`).
15
+ */
16
+
17
+ /**
18
+ * Activate `dark:` utilities from the `.dark` class rather than the OS
19
+ * `prefers-color-scheme`, so an explicit light choice wins over system dark.
20
+ */
21
+ @custom-variant dark (&:where(.dark, .dark *));
22
+
23
+ @theme inline {
24
+ /* ============================================
25
+ * ANIMATIONS (Tailwind v4.1)
26
+ * ============================================ */
27
+ --animate-accordion-down: accordion-down 0.3s cubic-bezier(0.87, 0, 0.13, 1);
28
+ --animate-accordion-up: accordion-up 0.3s cubic-bezier(0.87, 0, 0.13, 1);
29
+ --animate-fade-in: fade-in 0.2s ease-out;
30
+ --animate-fade-out: fade-out 0.2s ease-in;
31
+ --animate-zoom-in-95: zoom-in-95 0.1s ease-out;
32
+ --animate-zoom-out-95: zoom-out-95 0.1s ease-in;
33
+ --animate-slide-in-from-top-2: slide-in-from-top-2 0.2s ease-out;
34
+ --animate-slide-in-from-bottom-2: slide-in-from-bottom-2 0.2s ease-out;
35
+ --animate-slide-in-from-left-2: slide-in-from-left-2 0.2s ease-out;
36
+ --animate-slide-in-from-right-2: slide-in-from-right-2 0.2s ease-out;
37
+ --animate-brand-orbit: brand-orbit 2.4s linear infinite;
38
+ --animate-brand-pulse: brand-pulse 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
39
+ /* The thin line under the admin's bar while a screen's data is on its way:
40
+ a short segment crossing the full width, then again. */
41
+ --animate-loading-line: loading-line 1.4s ease-in-out infinite;
42
+
43
+ /* ============================================
44
+ * COLOR PALETTE (Tailwind v4.1)
45
+ * Monochrome design system, WCAG 2.2 AA compliant.
46
+ *
47
+ * Color Format Strategy:
48
+ * - Reference scales (blue/slate/etc.): HEX, kept for utility classes.
49
+ * - Semantic tokens: OKLCH full-color values defined in `:root` / `.dark`,
50
+ * mapped here via `@theme inline` with bare `var()` so scoped/dark
51
+ * overrides resolve at the consuming element.
52
+ * ============================================ */
53
+
54
+ /* Blue Scale - Primary Brand Color */
55
+ --color-blue-50: #eff6ff;
56
+ --color-blue-100: #dbeafe;
57
+ --color-blue-200: #bfdbfe;
58
+ --color-blue-300: #93c5fd;
59
+ --color-blue-400: #60a5fa;
60
+ --color-blue-500: #3b82f6;
61
+ --color-blue-600: #2563eb;
62
+ --color-blue-700: #1d4ed8;
63
+ --color-blue-800: #1e40af;
64
+ --color-blue-900: #1e3a8a;
65
+ --color-blue-950: #172554;
66
+
67
+ /* Cyan Scale - Accent Color */
68
+ --color-cyan-50: #ecfeff;
69
+ --color-cyan-100: #cffafe;
70
+ --color-cyan-200: #a5f3fc;
71
+ --color-cyan-300: #67e8f9;
72
+ --color-cyan-400: #22d3ee;
73
+ --color-cyan-500: #06b6d4;
74
+ --color-cyan-600: #0891b2;
75
+ --color-cyan-700: #0e7490;
76
+ --color-cyan-800: #155e75;
77
+ --color-cyan-900: #164e63;
78
+ --color-cyan-950: #083344;
79
+
80
+ /* Green Scale - Success Color */
81
+ --color-green-50: #f0fdf4;
82
+ --color-green-100: #dcfce7;
83
+ --color-green-200: #bbf7d0;
84
+ --color-green-300: #86efac;
85
+ --color-green-400: #4ade80;
86
+ --color-green-500: #22c55e;
87
+ --color-green-600: #16a34a;
88
+ --color-green-700: #15803d;
89
+ --color-green-800: #166534;
90
+ --color-green-900: #14532d;
91
+ --color-green-950: #052e16;
92
+
93
+ /* Amber Scale - Warning Color */
94
+ --color-amber-50: #fffbeb;
95
+ --color-amber-100: #fef3c7;
96
+ --color-amber-200: #fde68a;
97
+ --color-amber-300: #fcd34d;
98
+ --color-amber-400: #fbbf24;
99
+ --color-amber-500: #f59e0b;
100
+ --color-amber-600: #d97706;
101
+ --color-amber-700: #b45309;
102
+ --color-amber-800: #92400e;
103
+ --color-amber-900: #78350f;
104
+ --color-amber-950: #451a03;
105
+
106
+ /* Red Scale - Error/Destructive Color */
107
+ --color-red-50: #fef2f2;
108
+ --color-red-100: #fee2e2;
109
+ --color-red-200: #fecaca;
110
+ --color-red-300: #fca5a5;
111
+ --color-red-400: #f87171;
112
+ --color-red-500: #ef4444;
113
+ --color-red-600: #dc2626;
114
+ --color-red-700: #b91c1c;
115
+ --color-red-800: #991b1b;
116
+ --color-red-900: #7f1d1d;
117
+ --color-red-950: #450a0a;
118
+
119
+ /* Slate Scale - Neutral Colors */
120
+ --color-slate-50: #f8fafc;
121
+ --color-slate-100: #f1f5f9;
122
+ --color-slate-200: #e2e8f0;
123
+ --color-slate-300: #cbd5e1;
124
+ --color-slate-400: #94a3b8;
125
+ --color-slate-500: #64748b;
126
+ --color-slate-600: #475569;
127
+ --color-slate-700: #334155;
128
+ --color-slate-800: #1e293b;
129
+ --color-slate-900: #0f172a;
130
+ --color-slate-950: #020617;
131
+
132
+ /* ============================================
133
+ * SEMANTIC COLOR TOKENS (Tailwind v4.1)
134
+ * Reference color scales defined above
135
+ * ============================================ */
136
+
137
+ /* shadcn/ui semantic colors - reference CSS variables defined below */
138
+ --color-overlay: var(--nx-overlay);
139
+ --color-overlay-soft: var(--nx-overlay-soft);
140
+ --color-overlay-strong: var(--nx-overlay-strong);
141
+ --color-border: var(--nx-border);
142
+ --color-border-subtle: var(--nx-border-subtle);
143
+ --color-border-strong: var(--nx-border-strong);
144
+ --color-input: var(--nx-input);
145
+ --color-control-border: var(--nx-control-border);
146
+ --color-ring: var(--nx-ring);
147
+ --color-background: var(--nx-background);
148
+ --color-foreground: var(--nx-foreground);
149
+
150
+ --color-primary: var(--nx-primary);
151
+ --color-primary-50: color-mix(in srgb, var(--nx-primary), white 95%);
152
+ --color-primary-100: color-mix(in srgb, var(--nx-primary), white 90%);
153
+ --color-primary-200: color-mix(in srgb, var(--nx-primary), white 70%);
154
+ --color-primary-300: color-mix(in srgb, var(--nx-primary), white 50%);
155
+ --color-primary-400: color-mix(in srgb, var(--nx-primary), white 30%);
156
+ --color-primary-500: var(--nx-primary);
157
+ --color-primary-600: color-mix(in srgb, var(--nx-primary), black 10%);
158
+ --color-primary-700: color-mix(in srgb, var(--nx-primary), black 30%);
159
+ --color-primary-800: color-mix(in srgb, var(--nx-primary), black 50%);
160
+ --color-primary-900: color-mix(in srgb, var(--nx-primary), black 70%);
161
+ --color-primary-950: color-mix(in srgb, var(--nx-primary), black 85%);
162
+ --color-primary-foreground: var(--nx-primary-foreground);
163
+
164
+ --color-secondary: var(--nx-secondary);
165
+ --color-secondary-foreground: var(--nx-secondary-foreground);
166
+
167
+ /* Status scales, derived the same way as the primary scale above.
168
+ *
169
+ * A status role is one token; the scale is mixed from it, so retheming
170
+ * `--nx-success` moves every shade with it and they cannot drift apart. The
171
+ * shades exist because a status needs more than its solid colour: a tinted
172
+ * surface, a border on that surface, and text dark enough to read on it.
173
+ * Mixing toward white and black keeps 50 pale and 900 deep in both modes,
174
+ * which is what a `dark:` pair at the call site already assumes.
175
+ *
176
+ * Deprecated for status colour: the status tokens below (`-surface`,
177
+ * `-border`, `-text`, `-solid`) replace these shades wherever a status is
178
+ * drawn. The shades stay so existing callers and plugins keep building,
179
+ * and are removed in a later minor release. */
180
+ --color-destructive: var(--nx-destructive);
181
+ --color-destructive-50: color-mix(in srgb, var(--nx-destructive), white 95%);
182
+ --color-destructive-100: color-mix(in srgb, var(--nx-destructive), white 90%);
183
+ --color-destructive-200: color-mix(in srgb, var(--nx-destructive), white 70%);
184
+ --color-destructive-300: color-mix(in srgb, var(--nx-destructive), white 50%);
185
+ --color-destructive-400: color-mix(in srgb, var(--nx-destructive), white 30%);
186
+ --color-destructive-500: var(--nx-destructive);
187
+ --color-destructive-600: color-mix(in srgb, var(--nx-destructive), black 10%);
188
+ --color-destructive-700: color-mix(in srgb, var(--nx-destructive), black 30%);
189
+ --color-destructive-800: color-mix(in srgb, var(--nx-destructive), black 50%);
190
+ --color-destructive-900: color-mix(in srgb, var(--nx-destructive), black 70%);
191
+ --color-destructive-950: color-mix(in srgb, var(--nx-destructive), black 85%);
192
+ /* Saturated fill for solid buttons, kept separate from the text-tuned base
193
+ * so each can be solved for its own job. The ink that lands on it is
194
+ * `-foreground`, which is white in light mode and black in dark. */
195
+ --color-destructive-solid: var(--nx-destructive-solid);
196
+ /* The solid button's hover, set per mode beside its fill. Named, so no
197
+ * caller draws it from a numbered shade. */
198
+ --color-destructive-hover: var(--nx-destructive-hover);
199
+ --color-destructive-foreground: var(--nx-destructive-foreground);
200
+
201
+ --color-success: var(--nx-success);
202
+ --color-success-50: color-mix(in srgb, var(--nx-success), white 95%);
203
+ --color-success-100: color-mix(in srgb, var(--nx-success), white 90%);
204
+ --color-success-200: color-mix(in srgb, var(--nx-success), white 70%);
205
+ --color-success-300: color-mix(in srgb, var(--nx-success), white 50%);
206
+ --color-success-400: color-mix(in srgb, var(--nx-success), white 30%);
207
+ --color-success-500: var(--nx-success);
208
+ --color-success-600: color-mix(in srgb, var(--nx-success), black 10%);
209
+ --color-success-700: color-mix(in srgb, var(--nx-success), black 30%);
210
+ --color-success-800: color-mix(in srgb, var(--nx-success), black 50%);
211
+ --color-success-900: color-mix(in srgb, var(--nx-success), black 70%);
212
+ --color-success-950: color-mix(in srgb, var(--nx-success), black 85%);
213
+ /* Saturated fill for solid usage; distinct from the text-tuned base. */
214
+ --color-success-solid: var(--nx-success-solid);
215
+ --color-success-foreground: var(--nx-success-foreground);
216
+
217
+ --color-warning: var(--nx-warning);
218
+ --color-warning-50: color-mix(in srgb, var(--nx-warning), white 95%);
219
+ --color-warning-100: color-mix(in srgb, var(--nx-warning), white 90%);
220
+ --color-warning-200: color-mix(in srgb, var(--nx-warning), white 70%);
221
+ --color-warning-300: color-mix(in srgb, var(--nx-warning), white 50%);
222
+ --color-warning-400: color-mix(in srgb, var(--nx-warning), white 30%);
223
+ --color-warning-500: var(--nx-warning);
224
+ --color-warning-600: color-mix(in srgb, var(--nx-warning), black 10%);
225
+ --color-warning-700: color-mix(in srgb, var(--nx-warning), black 30%);
226
+ --color-warning-800: color-mix(in srgb, var(--nx-warning), black 50%);
227
+ --color-warning-900: color-mix(in srgb, var(--nx-warning), black 70%);
228
+ --color-warning-950: color-mix(in srgb, var(--nx-warning), black 85%);
229
+ --color-warning-foreground: var(--nx-warning-foreground);
230
+
231
+ /* Status tokens: surface, border, text and solid per status (theme.css
232
+ * :root explains each). The numbered shades above stay for existing callers
233
+ * and are deprecated; new code uses these. */
234
+ --color-success-surface: var(--nx-success-surface);
235
+ --color-success-border: var(--nx-success-border);
236
+ --color-success-text: var(--nx-success-text);
237
+ --color-warning-surface: var(--nx-warning-surface);
238
+ --color-warning-border: var(--nx-warning-border);
239
+ --color-warning-text: var(--nx-warning-text);
240
+ --color-warning-solid: var(--nx-warning-solid);
241
+ --color-danger-surface: var(--nx-danger-surface);
242
+ --color-danger-border: var(--nx-danger-border);
243
+ --color-danger-text: var(--nx-danger-text);
244
+ --color-danger-solid: var(--nx-danger-solid);
245
+ --color-info-surface: var(--nx-info-surface);
246
+ --color-info-border: var(--nx-info-border);
247
+ --color-info-text: var(--nx-info-text);
248
+ --color-info-solid: var(--nx-info-solid);
249
+
250
+ /* The editor's highlight mark. A token rather than a literal because it
251
+ * styles authored content, which an integrator restyles to their own site
252
+ * and which has to stay readable on a dark page. */
253
+ --color-highlight: var(--nx-highlight);
254
+ --color-highlight-foreground: var(--nx-highlight-foreground);
255
+
256
+ /* Syntax colors, so code tokens are styled the same way as everything else
257
+ * (text-code-keyword, bg-code-bg) instead of through bespoke CSS. */
258
+ --color-code-bg: var(--nx-code-bg);
259
+ --color-code-fg: var(--nx-code-fg);
260
+ --color-code-comment: var(--nx-code-comment);
261
+ --color-code-keyword: var(--nx-code-keyword);
262
+ --color-code-string: var(--nx-code-string);
263
+ --color-code-number: var(--nx-code-number);
264
+ --color-code-function: var(--nx-code-function);
265
+ --color-code-operator: var(--nx-code-operator);
266
+ --color-code-punctuation: var(--nx-code-punctuation);
267
+ --color-code-variable: var(--nx-code-variable);
268
+ --color-code-tag: var(--nx-code-tag);
269
+ --color-code-deleted: var(--nx-code-deleted);
270
+ --color-code-inserted: var(--nx-code-inserted);
271
+
272
+ --color-muted: var(--nx-muted);
273
+ --color-muted-foreground: var(--nx-muted-foreground);
274
+
275
+ --color-accent: var(--nx-accent);
276
+ --color-accent-50: color-mix(in srgb, var(--nx-accent), white 95%);
277
+ --color-accent-100: color-mix(in srgb, var(--nx-accent), white 90%);
278
+ --color-accent-200: color-mix(in srgb, var(--nx-accent), white 70%);
279
+ --color-accent-300: color-mix(in srgb, var(--nx-accent), white 50%);
280
+ --color-accent-400: color-mix(in srgb, var(--nx-accent), white 30%);
281
+ --color-accent-500: var(--nx-accent);
282
+ --color-accent-600: color-mix(in srgb, var(--nx-accent), black 10%);
283
+ --color-accent-700: color-mix(in srgb, var(--nx-accent), black 30%);
284
+ --color-accent-800: color-mix(in srgb, var(--nx-accent), black 50%);
285
+ --color-accent-900: color-mix(in srgb, var(--nx-accent), black 70%);
286
+ --color-accent-950: color-mix(in srgb, var(--nx-accent), black 85%);
287
+ --color-accent-foreground: var(--nx-accent-foreground);
288
+
289
+ --color-card: var(--nx-card);
290
+ --color-card-foreground: var(--nx-card-foreground);
291
+
292
+ --color-popover: var(--nx-popover);
293
+ --color-popover-foreground: var(--nx-popover-foreground);
294
+
295
+ /* Sidebar semantic tokens */
296
+ --color-sidebar: var(--nx-sidebar-background);
297
+ --color-sidebar-background: var(--nx-sidebar-background);
298
+ --color-sidebar-foreground: var(--nx-sidebar-foreground);
299
+ --color-sidebar-primary: var(--nx-sidebar-primary);
300
+ --color-sidebar-primary-foreground: var(--nx-sidebar-primary-foreground);
301
+ --color-sidebar-accent: var(--nx-sidebar-accent);
302
+ --color-sidebar-accent-background: var(--nx-sidebar-accent);
303
+ --color-sidebar-accent-foreground: var(--nx-sidebar-accent-foreground);
304
+ --color-sidebar-border: var(--nx-sidebar-border);
305
+ --color-sidebar-ring: var(--nx-sidebar-ring);
306
+
307
+ /* ============================================
308
+ * TYPOGRAPHY (Tailwind v4.1)
309
+ * Perfect Fourth Scale (1.333 ratio) - WCAG 2.2 AA Compliant
310
+ * ============================================ */
311
+
312
+ /* Font families, the type scale and the spacing scale live in the
313
+ * non-inline @theme blocks below. */
314
+
315
+ /* Line Heights (Leading) */
316
+ --leading-none: 1;
317
+ /* Large display text */
318
+ --leading-tight: 1.25;
319
+ /* Headings */
320
+ --leading-snug: 1.375;
321
+ /* Tight UI elements */
322
+ --leading-normal: 1.5;
323
+ /* Default for UI text */
324
+ --leading-relaxed: 1.625;
325
+ /* Long-form content */
326
+ --leading-loose: 2;
327
+ /* Very spacious text */
328
+
329
+ /* Letter Spacing (Tracking) */
330
+ --tracking-tighter: -0.05em;
331
+ /* -0.8px at 16px */
332
+ --tracking-tight: -0.025em;
333
+ /* -0.4px at 16px - for large headings */
334
+ --tracking-normal: 0em;
335
+ /* Default */
336
+ --tracking-wide: 0.025em;
337
+ /* +0.4px at 16px - for small text */
338
+ --tracking-wider: 0.05em;
339
+ /* +0.8px at 16px - for uppercase */
340
+ --tracking-widest: 0.1em;
341
+ /* +1.6px at 16px */
342
+
343
+ /* ============================================
344
+ * BORDER RADIUS (Tailwind v4.1)
345
+ *
346
+ * The contract is three steps — sm, md, lg — all derived from the single
347
+ * --radius knob (shadcn pattern), so the whole admin re-rounds from one
348
+ * declaration. Those three are also exactly what `tailwind-preset.ts` exports,
349
+ * so a plugin built against the published preset gets the same scale.
350
+ *
351
+ * That only holds if components pick a TIER BY ELEMENT CATEGORY instead of
352
+ * naming a length. A component that hardcodes a corner value — `rounded-none`
353
+ * as much as `rounded-[6px]` — pins itself at that value and silently opts
354
+ * out of the knob. The tiers, and what the shipped components put in each:
355
+ *
356
+ * rounded-lg (--radius-lg, the knob itself)
357
+ * Floating and grouping containers: cards, dialogs, alert dialogs,
358
+ * popovers, tooltips, dropdown / select / command panels, empty-state
359
+ * panels.
360
+ *
361
+ * rounded-md (--radius-md, one step tighter)
362
+ * Controls and the inline surfaces that sit among them: buttons, inputs,
363
+ * textareas, select triggers, icon buttons, alerts, table wrappers and
364
+ * image frames. A control nested in a container reads as inset when its
365
+ * corner is tighter than the surface holding it.
366
+ *
367
+ * rounded-sm (--radius-sm, tighter again)
368
+ * Small controls and adornments: menu and list items, badges, chips,
369
+ * tags, checkboxes, toolbar affordances — anything already inside a
370
+ * control or a dense row.
371
+ *
372
+ * Circles sit deliberately outside the scale: avatars, status dots, spinners,
373
+ * progress tracks and switch tracks and thumbs use `rounded-full`, which is
374
+ * 9999px and not a --radius step. They are round because of their shape, not
375
+ * because of the theme, so a retheme must not flatten them.
376
+ *
377
+ * rounded-xl / rounded-2xl are NOT tiers of this knob. `tailwind-preset.ts`
378
+ * exports only lg/md/sm, so a plugin using the preset gets Tailwind's fixed
379
+ * 0.75rem / 1rem for them, detached from --radius; and the definitions below
380
+ * ADD to the knob rather than subtracting, so they always sit rounder than
381
+ * the container tier and drift further as the knob grows. Nothing in the repo
382
+ * uses them. Treat them as off-contract and pick from sm/md/lg.
383
+ *
384
+ * At the shipped 0.5rem the three tiers are 4px, 6px and 8px. All positive,
385
+ * which matters: `sm` and `md` SUBTRACT from the knob, so a knob under 4px
386
+ * makes them negative. They still render square, because border-radius clamps
387
+ * a negative length to 0 at used-value time — but the token keeps its
388
+ * negative value, so reading `--radius-sm` for a padding, an inset, or
389
+ * through getComputedStyle yields -4px rather than 0. Anything consuming a
390
+ * step as a LENGTH rather than as a corner must clamp it itself, and that
391
+ * obligation returns the moment someone dials the knob back down.
392
+ *
393
+ * A site that genuinely must stay square keeps `rounded-none` WITH an inline
394
+ * comment saying why — overlapped-border strips, full-bleed fills inside an
395
+ * already-rounded parent, underline tabs (which is why Tabs is square, not a
396
+ * `rounded-sm` adornment). Square with a stated reason is a decision; square
397
+ * without one is an element that was never wired to the knob. Sheet is the
398
+ * standing example of the latter: it is anchored to the viewport edge and
399
+ * carries no radius class at all.
400
+ *
401
+ * Corollary for containers: a rounded box whose child paints a background to
402
+ * its edge must either clip that child (`overflow-hidden`) or give the child
403
+ * a matching corner (`rounded-b-[inherit]` and friends). Otherwise the child's
404
+ * fill paints square across the parent's curve at any nonzero --radius.
405
+ * ============================================ */
406
+ --radius-sm: calc(var(--radius) - 4px);
407
+ --radius-md: calc(var(--radius) - 2px);
408
+ --radius-lg: var(--radius);
409
+ --radius-xl: calc(var(--radius) + 4px);
410
+ --radius-2xl: calc(var(--radius) + 8px);
411
+
412
+ /* ============================================
413
+ * BOX SHADOWS (Tailwind v4.1)
414
+ * The ramp's colour comes from --nx-shadow-color, mixed down to each step's
415
+ * alpha. `@theme inline` copies a declaration's value into the generated
416
+ * utility, so a literal rgba() would be frozen at build time while this
417
+ * var() stays live and re-resolves per mode / per scope at the element.
418
+ * ============================================ */
419
+ --shadow-sm: 0 1px 2px 0
420
+ color-mix(in srgb, var(--nx-shadow-color) 5%, transparent);
421
+ --shadow-md:
422
+ 0 4px 6px -1px color-mix(in srgb, var(--nx-shadow-color) 10%, transparent),
423
+ 0 2px 4px -1px color-mix(in srgb, var(--nx-shadow-color) 6%, transparent);
424
+ --shadow-lg:
425
+ 0 10px 15px -3px color-mix(in srgb, var(--nx-shadow-color) 10%, transparent),
426
+ 0 4px 6px -2px color-mix(in srgb, var(--nx-shadow-color) 5%, transparent);
427
+ --shadow-xl:
428
+ 0 20px 25px -5px color-mix(in srgb, var(--nx-shadow-color) 10%, transparent),
429
+ 0 10px 10px -5px color-mix(in srgb, var(--nx-shadow-color) 4%, transparent);
430
+
431
+ /* Custom Functional Shadows (Fixes build warnings from arbitrary values) */
432
+ --shadow-inner-subtle: 0 -4px 6px -1px
433
+ color-mix(in srgb, var(--nx-shadow-color) 5%, transparent);
434
+ --shadow-glow-success: 0 0 10px
435
+ color-mix(in srgb, var(--nx-success) 10%, transparent);
436
+ --shadow-glow-primary: 0 0 15px
437
+ color-mix(in srgb, var(--nx-primary) 50%, transparent);
438
+ --shadow-elevation-primary: 0 8px 20px -8px
439
+ color-mix(in srgb, var(--nx-primary) 40%, transparent);
440
+ --shadow-soft-primary: 0 8px 30px
441
+ color-mix(in srgb, var(--nx-primary) 6%, transparent);
442
+ --shadow-neo: 4px 4px 0px 0px
443
+ color-mix(in srgb, var(--nx-shadow-color) 10%, transparent);
444
+
445
+ /* ============================================
446
+ * FLUID TYPOGRAPHY (Tailwind v4.1)
447
+ * Fixes build warnings from arbitrary values
448
+ * ============================================ */
449
+ --text-fluid-2xs: clamp(0.6rem, 0.55rem + 0.1vw, 0.65rem);
450
+ --text-fluid-xs: clamp(0.65rem, 0.6rem + 0.1vw, 0.7rem);
451
+ --text-fluid-sm: clamp(0.7rem, 0.65rem + 0.1vw, 0.75rem);
452
+ --text-fluid-base: clamp(0.875rem, 0.8rem + 0.2vw, 1rem);
453
+ --text-fluid-lg: clamp(1rem, 2vw, 1.125rem);
454
+ --text-fluid-xl: clamp(1.25rem, 3vw, 1.5rem);
455
+ --text-fluid-2xl: clamp(1.5rem, 5vw, 2.25rem);
456
+ --text-fluid-3xl: clamp(1.5rem, 5vw, 2.5rem);
457
+ --text-fluid-4xl: clamp(1.75rem, 5vw, 2.5rem);
458
+
459
+ /* Custom Transitions */
460
+ --ease-premium: cubic-bezier(0.2, 0.8, 0.2, 1);
461
+ }
462
+
463
+ /* ============================================
464
+ * FONT FAMILIES & WEIGHTS (Tailwind v4.1)
465
+ *
466
+ * Deliberately a non-inline `@theme`. `@theme inline` copies a declaration's
467
+ * value into whatever consumes it, which froze these stacks into
468
+ * `--default-font-family` / `--default-mono-font-family` and into the
469
+ * `font-mono` utility at build time, so the variables existed but nothing read
470
+ * them and re-declaring one on a scope changed nothing. A plain `@theme`
471
+ * emits each token as a real custom property and makes its consumers
472
+ * reference it with `var()`, so the base rule and the `font-*` utilities
473
+ * re-resolve wherever the token is redeclared. The weights sit here for the
474
+ * same reason, and to match the weights Tailwind ships (`--font-weight-black`
475
+ * and friends), which the `font-*` utilities also reach through `var()`.
476
+ *
477
+ * `--font-*` is the font-FAMILY namespace and `--font-weight-*` is the weight
478
+ * one, so a weight declared as `--font-bold` registers a family literally named
479
+ * "bold": `font-bold` then compiles to `font-family: 700`, which browsers drop,
480
+ * and it shadows the real weight utility rather than adding to it.
481
+ * ============================================ */
482
+ @theme {
483
+ /* The host app supplies the face through the variable; the family name is the
484
+ * var()'s own FALLBACK ARGUMENT, covering a host that installed the font
485
+ * without `next/font`, and the generic stack after it covers a host that did
486
+ * neither. Naming only the family would resolve to nothing under `next/font`,
487
+ * which self-hosts the face and exposes it ONLY as a variable -- a bare
488
+ * "Geist" there silently falls through to the system sans.
489
+ *
490
+ * The fallback has to sit INSIDE the parentheses. A family listed after the
491
+ * closing `)` is not reached when the variable is undefined: an unresolved
492
+ * `var()` with no fallback makes the whole declaration invalid at
493
+ * computed-value time, which for an inherited property like font-family means
494
+ * the element inherits its parent's face and the entire stack is discarded.
495
+ * The comma list looks like a fallback chain and is not one, so a host that
496
+ * skipped the variable rendered in whatever the page already used rather than
497
+ * in the generic sans this stack names.
498
+ *
499
+ * These are declared in a non-inline `@theme`, so they are emitted into
500
+ * `:root` and substitution happens THERE, not on the consuming element. A
501
+ * host must expose the variable at or above that scope -- `next/font`'s
502
+ * generated class belongs on `<html>`. On `<body>` the variable is invisible
503
+ * to this declaration no matter how it is spelled. */
504
+ --font-sans:
505
+ var(--font-geist, Geist), ui-sans-serif, system-ui, -apple-system,
506
+ "Segoe UI", sans-serif;
507
+ --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
508
+ --font-mono:
509
+ var(--font-geist-mono, "Geist Mono"), ui-monospace, SFMono-Regular, Menlo,
510
+ Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
511
+
512
+ /* Body text, captions */
513
+ --font-weight-normal: 400;
514
+ /* Subheadings, emphasis */
515
+ --font-weight-medium: 500;
516
+ /* Headings, buttons */
517
+ --font-weight-semibold: 600;
518
+ /* Strong emphasis (rarely used) */
519
+ --font-weight-bold: 700;
520
+ }
521
+
522
+ /* ============================================
523
+ * TYPE SCALE & SPACING SCALE (Tailwind v4.1)
524
+ *
525
+ * Deliberately a STATIC, non-inline `@theme`: every token here is emitted as a
526
+ * real custom property on `:root` whether or not a Tailwind utility uses it.
527
+ * Stylesheets that are not compiled against this theme read these through
528
+ * `var()` -- the page-builder editor's (`@nextlyhq/builder/styles.css`, pulled
529
+ * in by `@nextlyhq/plugin-page-builder/styles/editor.css`) does, for
530
+ * `--text-xs`, `--text-sm`, `--text-lg` and `--space-*` -- and a `var()` in
531
+ * such a sheet makes Tailwind emit nothing. Under `@theme inline` a token is
532
+ * emitted only where CSS Tailwind compiles reads it with `var()`, and a plain
533
+ * `@theme` drops the ones no utility uses, so either way the admin's build
534
+ * left these out and the editor's text fell back to the browser's 16px and its
535
+ * spacing to nothing. `static` keeps them all.
536
+ *
537
+ * Non-inline also makes the `text-*` utilities read `var(--text-*)` rather
538
+ * than a copied value, so they follow a token redeclared on a scope, as the
539
+ * font utilities above do. `--space-*` is not a Tailwind namespace (spacing
540
+ * utilities use `--spacing`), so it adds no utilities; it exists for `var()`.
541
+ * `packages/admin/src/styles/__tests__/editor-token-emission.test.ts` holds
542
+ * the admin's built stylesheet to emitting every token the editor reads.
543
+ * ============================================ */
544
+ @theme static {
545
+ /* Type Scale - Base Size: 16px (1rem) */
546
+ --text-xs: 0.75rem;
547
+ /* 12px */
548
+ --text-sm: 0.875rem;
549
+ /* 14px */
550
+ --text-base: 1rem;
551
+ /* 16px - body text (WCAG minimum) */
552
+ --text-lg: 1.125rem;
553
+ /* 18px */
554
+ --text-xl: 1.25rem;
555
+ /* 20px */
556
+ --text-2xl: 1.5rem;
557
+ /* 24px */
558
+ --text-3xl: 1.875rem;
559
+ /* 30px */
560
+ --text-4xl: 2.25rem;
561
+ /* 36px */
562
+ --text-5xl: 3rem;
563
+ /* 48px */
564
+ --text-6xl: 3.75rem;
565
+ /* 60px */
566
+
567
+ /* Spacing Scale (8px base unit) */
568
+ --space-0: 0rem;
569
+ /* 0px */
570
+ --space-px: 0.0625rem;
571
+ /* 1px - for fine borders */
572
+ --space-0-5: 0.125rem;
573
+ /* 2px */
574
+ --space-1: 0.25rem;
575
+ /* 4px - icon padding, tiny gaps */
576
+ --space-1-5: 0.375rem;
577
+ /* 6px */
578
+ --space-2: 0.5rem;
579
+ /* 8px - tight spacing, inline elements */
580
+ --space-2-5: 0.625rem;
581
+ /* 10px */
582
+ --space-3: 0.75rem;
583
+ /* 12px - between related elements */
584
+ --space-3-5: 0.875rem;
585
+ /* 14px */
586
+ --space-4: 1rem;
587
+ /* 16px - standard element spacing */
588
+ --space-5: 1.25rem;
589
+ /* 20px */
590
+ --space-6: 1.5rem;
591
+ /* 24px - between form fields */
592
+ --space-7: 1.75rem;
593
+ /* 28px */
594
+ --space-8: 2rem;
595
+ /* 32px - between sections */
596
+ --space-9: 2.25rem;
597
+ /* 36px */
598
+ --space-10: 2.5rem;
599
+ /* 40px */
600
+ --space-11: 2.75rem;
601
+ /* 44px - minimum touch target */
602
+ --space-12: 3rem;
603
+ /* 48px - between major sections */
604
+ --space-14: 3.5rem;
605
+ /* 56px */
606
+ --space-16: 4rem;
607
+ /* 64px - page margins */
608
+ --space-20: 5rem;
609
+ /* 80px */
610
+ --space-24: 6rem;
611
+ /* 96px - large section breaks */
612
+ }
613
+
614
+ /* ============================================
615
+ * LARGER HEADING SIZES
616
+ *
617
+ * Tailwind lifts an `@theme` out of an enclosing `@media`: these declarations
618
+ * are not limited to wide screens. They replace the `--text-2xl` to
619
+ * `--text-5xl` values of the type scale above at EVERY width, and the built
620
+ * stylesheet declares only these. Because that scale is non-inline, the
621
+ * `text-2xl` to `text-5xl` utilities read `var(--text-*)` and so render at
622
+ * these sizes. The block is `static` like the scale: a token's options come
623
+ * from its last declaration, and without it the sizes no utility uses would
624
+ * be dropped from the build again.
625
+ * ============================================ */
626
+ @media (min-width: 768px) {
627
+ @theme static {
628
+ --text-2xl: 1.75rem;
629
+ /* 28px (the scale above says 24px) */
630
+ --text-3xl: 2.25rem;
631
+ /* 36px (the scale above says 30px) */
632
+ --text-4xl: 3rem;
633
+ /* 48px (the scale above says 36px) */
634
+ --text-5xl: 4rem;
635
+ /* 64px (the scale above says 48px) */
636
+ }
637
+ }
638
+
639
+ /* Animation keyframes referenced by the --animate-* tokens above. */
640
+ /* Keyframes for custom animations */
641
+ @keyframes brand-orbit {
642
+ from {
643
+ transform: rotate(0deg);
644
+ }
645
+ to {
646
+ transform: rotate(360deg);
647
+ }
648
+ }
649
+
650
+ /* From fully off the left edge to fully off the right one, so the segment
651
+ never sits still at either end. Driven by `transform`, never by `left`: a
652
+ moving box counts as a layout shift, and a transform does not. The segment
653
+ is 30% of the line, so the line's far edge is 100 / 30 of its own widths
654
+ from its start. */
655
+ @keyframes loading-line {
656
+ from {
657
+ transform: translateX(-100%);
658
+ }
659
+ to {
660
+ transform: translateX(333.34%);
661
+ }
662
+ }
663
+
664
+ @keyframes brand-pulse {
665
+ 0%,
666
+ 100% {
667
+ transform: scale(0.97);
668
+ filter: drop-shadow(
669
+ 0 0 10px color-mix(in srgb, var(--nx-primary) 8%, transparent)
670
+ );
671
+ }
672
+ 50% {
673
+ transform: scale(1.03);
674
+ filter: drop-shadow(
675
+ 0 0 20px color-mix(in srgb, var(--nx-primary) 22%, transparent)
676
+ );
677
+ }
678
+ }
679
+
680
+ @keyframes accordion-down {
681
+ from {
682
+ height: 0;
683
+ }
684
+
685
+ to {
686
+ height: var(--radix-accordion-content-height);
687
+ }
688
+ }
689
+
690
+ @keyframes accordion-up {
691
+ from {
692
+ height: var(--radix-accordion-content-height);
693
+ }
694
+
695
+ to {
696
+ height: 0;
697
+ }
698
+ }
699
+
700
+ @keyframes fade-in {
701
+ from {
702
+ opacity: 0;
703
+ }
704
+
705
+ to {
706
+ opacity: 1;
707
+ }
708
+ }
709
+
710
+ @keyframes fade-out {
711
+ from {
712
+ opacity: 1;
713
+ }
714
+
715
+ to {
716
+ opacity: 0;
717
+ }
718
+ }
719
+
720
+ @keyframes zoom-in-95 {
721
+ from {
722
+ opacity: 0;
723
+ transform: scale(0.95);
724
+ }
725
+
726
+ to {
727
+ opacity: 1;
728
+ transform: scale(1);
729
+ }
730
+ }
731
+
732
+ @keyframes zoom-out-95 {
733
+ from {
734
+ opacity: 1;
735
+ transform: scale(1);
736
+ }
737
+
738
+ to {
739
+ opacity: 0;
740
+ transform: scale(0.95);
741
+ }
742
+ }
743
+
744
+ @keyframes slide-in-from-top-2 {
745
+ from {
746
+ transform: translateY(-0.5rem);
747
+ }
748
+
749
+ to {
750
+ transform: translateY(0);
751
+ }
752
+ }
753
+
754
+ @keyframes slide-in-from-bottom-2 {
755
+ from {
756
+ transform: translateY(0.5rem);
757
+ }
758
+
759
+ to {
760
+ transform: translateY(0);
761
+ }
762
+ }
763
+
764
+ @keyframes slide-in-from-left-2 {
765
+ from {
766
+ transform: translateX(-0.5rem);
767
+ }
768
+
769
+ to {
770
+ transform: translateX(0);
771
+ }
772
+ }
773
+
774
+ @keyframes slide-in-from-right-2 {
775
+ from {
776
+ transform: translateX(0.5rem);
777
+ }
778
+
779
+ to {
780
+ transform: translateX(0);
781
+ }
782
+ }
783
+
784
+ :root {
785
+ /* Base colors - using Slate neutral scale */
786
+ --nx-background: oklch(0.99 0 0);
787
+ /* Pure white for weightless aesthetic */
788
+ --nx-page-background: oklch(0.97 0 0);
789
+ /* #f9f9f9 for page content area */
790
+ --nx-foreground: oklch(0 0 0);
791
+
792
+ /* Component colors */
793
+ --nx-card: oklch(1 0 0);
794
+ /* pure white for cards to pop on off-white bg */
795
+ --nx-card-foreground: oklch(0 0 0);
796
+ --nx-popover: oklch(0.99 0 0);
797
+ /* white */
798
+ --nx-popover-foreground: oklch(0 0 0);
799
+ /* Table headers, table footers and the pagination bar. A surface, so it lives
800
+ with the other surfaces: declared next to the component that paints it, a
801
+ palette change would move everything around it and leave it behind. */
802
+ --nx-table-header-bg: oklch(1 0 0);
803
+
804
+ /* Brand colors - Blue-Cyan Professional Palette */
805
+ --nx-primary: oklch(0 0 0);
806
+ /* Black for premium minimalist aesthetic */
807
+ --nx-primary-foreground: oklch(1 0 0);
808
+ /* white */
809
+
810
+ /* Secondary colors - using slate-100 for subtle backgrounds */
811
+ --nx-secondary: oklch(0.94 0 0);
812
+ /* slate-100 */
813
+ --nx-secondary-foreground: oklch(0 0 0);
814
+
815
+ /* Utility colors */
816
+ --nx-muted: oklch(0.97 0 0);
817
+ /* Darkened so muted text clears WCAG 4.5:1 on the muted surface (was 4.35:1). */
818
+ --nx-muted-foreground: oklch(0.44 0 0);
819
+ /* A hover and selection SURFACE, not ink: one step off the page, with
820
+ `--nx-accent-foreground` as the only thing meant to be read on it. */
821
+ --nx-accent: oklch(0.94 0 0);
822
+ --nx-accent-foreground: oklch(0 0 0);
823
+
824
+ /* State colors - WCAG 2.2 AA Compliant.
825
+ * Each status has two roles kept as separate tokens, the industry-standard
826
+ * split (Radix/Primer): the base token is the readable TEXT color used by
827
+ * `text-destructive` and derived shades, and `-solid` is the saturated FILL
828
+ * used by buttons under the on-color ink. In light mode both roles can be
829
+ * the same value and the ink is white. In dark mode they cannot: a fill
830
+ * light enough to read as text on the page is too light for white text, so
831
+ * success splits the fill and destructive flips its ink to black instead.
832
+ * The on-color token is what varies, not just the fill. */
833
+ /* red-500 itself, the reference palette's red. It is lighter than the 4.5:1
834
+ * text minimum allows; darkening it to pass reads as a different colour, and
835
+ * the palette is built around this one. `contrast/accepted.ts` records the
836
+ * affected pairings with their measured ratios. */
837
+ --nx-destructive: oklch(0.63 0.19 23.03);
838
+ --nx-destructive-solid: oklch(0.63 0.19 23.03);
839
+ /* Hover deepens the fill toward black, which its white label reads better on. */
840
+ --nx-destructive-hover: color-mix(
841
+ in srgb,
842
+ var(--nx-destructive-solid),
843
+ black 20%
844
+ );
845
+ --nx-destructive-foreground: oklch(1 0 0);
846
+ /* white */
847
+ /* Darkened from green-600; renders as #00852c, ~4.8:1 as text on white. */
848
+ --nx-success: oklch(0.4981 0.17 149.2);
849
+ --nx-success-solid: oklch(0.53 0.17 149.2);
850
+ --nx-success-foreground: oklch(1 0 0);
851
+ /* white */
852
+ /* A success toast's surface and text, which the Toaster hands to its toasts.
853
+ * The surface is the toast library's own pale green; the text is darkened
854
+ * from the library's green, which read at 4.26:1 on it, to about 5.2:1. */
855
+ --nx-toast-success-bg: oklch(0.9788 0.0221 160.24);
856
+ --nx-toast-success-text: oklch(0.5048 0.1506 146.87);
857
+ /* A warning toast's surface and text, the same way: the library's own pale
858
+ * amber surface, and its amber text, which read at 3.07:1 on it, darkened
859
+ * to about 5.1:1. */
860
+ --nx-toast-warning-bg: oklch(0.9904 0.0167 96.37);
861
+ --nx-toast-warning-text: oklch(0.54 0.13 60);
862
+
863
+ /* Darkened from amber-500 so it reads as text on white at WCAG 4.5:1 (was
864
+ * 2.15:1); its light shades still tint badge/alert surfaces. */
865
+ --nx-warning: oklch(0.529 0.1646 70.11);
866
+ --nx-warning-foreground: oklch(0.2079 0.0399 265.73);
867
+ /* slate-900 - REQUIRED for AA contrast (warning-500 on white = 3.4:1, fails AA) */
868
+
869
+ /* Status tokens. Each status has a faint SURFACE (an alert, a highlighted
870
+ * row), a BORDER for anything drawn on that surface, TEXT that reads at 4.5:1
871
+ * on its surface, on a card and on the page, and a SOLID for dots and icons
872
+ * that meets 3:1 on the page. They replace the white/black mixes of the
873
+ * numbered shades (`success-100`, `warning-700`), which tinted every chip.
874
+ * `danger` is a status (Failed, Error); `destructive` stays the colour of a
875
+ * destructive action. Success keeps its existing `-solid`. */
876
+ --nx-success-surface: oklch(0.975 0.013 150);
877
+ --nx-success-border: oklch(0.86 0.06 150);
878
+ --nx-success-text: oklch(0.43 0.12 150);
879
+ --nx-warning-surface: oklch(0.978 0.018 80);
880
+ --nx-warning-border: oklch(0.86 0.08 80);
881
+ --nx-warning-text: oklch(0.47 0.11 65);
882
+ --nx-warning-solid: oklch(0.64 0.15 62);
883
+ --nx-danger-surface: oklch(0.975 0.013 25);
884
+ --nx-danger-border: oklch(0.86 0.06 25);
885
+ --nx-danger-text: oklch(0.5 0.17 27);
886
+ --nx-danger-solid: oklch(0.6 0.2 27);
887
+ --nx-info-surface: oklch(0.975 0.012 250);
888
+ --nx-info-border: oklch(0.86 0.05 250);
889
+ --nx-info-text: oklch(0.45 0.13 255);
890
+ --nx-info-solid: oklch(0.58 0.16 255);
891
+
892
+ /* The highlighter mark in authored content. Kept a light yellow in both
893
+ * modes on purpose: it stands for a marker pen drawn over the text, and the
894
+ * pairing below is what keeps that readable rather than the page's own
895
+ * foreground, which would be white-on-yellow in dark mode. */
896
+ --nx-highlight: oklch(0.9297 0.1638 101.06);
897
+ /* yellow-200 */
898
+ --nx-highlight-foreground: oklch(0.2079 0.0399 265.73);
899
+ /* slate-900 — the mark keeps its own dark text, whatever the page does */
900
+
901
+ /* Syntax colors. The tokenizer reports what a token *is*; these decide how
902
+ * it looks, so a code block carries no colour of its own and renders from
903
+ * whichever mode is active. Kept muted against the monochrome chrome, and
904
+ * held above 4.5:1 on --nx-code-bg since code is small text. */
905
+ --nx-code-bg: oklch(0.9761 0.0035 247.86);
906
+ --nx-code-fg: oklch(0.2079 0.0399 265.73);
907
+ /* Darkened slightly to clear WCAG 4.5:1 on the code surface (was 4.44:1). */
908
+ --nx-code-comment: oklch(0.5264 0.0407 257.44);
909
+ --nx-code-keyword: oklch(0.4882 0.2172 303.9);
910
+ --nx-code-string: oklch(0.4478 0.1189 152.1);
911
+ --nx-code-number: oklch(0.5106 0.1518 44.2);
912
+ --nx-code-function: oklch(0.4757 0.1444 254.6);
913
+ --nx-code-operator: oklch(0.4936 0.1418 8.4);
914
+ /* Darkened slightly to clear WCAG 4.5:1 on the code surface (was 4.44:1). */
915
+ --nx-code-punctuation: oklch(0.5264 0.0407 257.44);
916
+ --nx-code-variable: oklch(0.4694 0.1173 62.3);
917
+ --nx-code-tag: oklch(0.5054 0.1905 27.5);
918
+ --nx-code-deleted: oklch(0.5054 0.1905 27.5);
919
+ --nx-code-inserted: oklch(0.4478 0.1189 152.1);
920
+
921
+ /* Element colors — 3-tier translucent border scale (monochrome).
922
+ * The first two tiers are decorative and are tuned by eye: subtle = faint
923
+ * dividers, default = the container edge on cards, groups, and tables
924
+ * (composites to a light grey on white, a hairline rather than a rule). The third
925
+ * is not decorative — strong marks the edge of a control that has no other
926
+ * boundary, so it is held to a contrast minimum instead. */
927
+ /* The scrim behind a modal. A token rather than a literal because it is the
928
+ * one surface colour that must differ between the two modes for the same
929
+ * reason a border does: it composites over what is beneath it, and what is
930
+ * beneath it is white here and near-black in dark. It was written inline as
931
+ * `bg-black/80`, identical in both modes, at four different strengths across
932
+ * six components — drift rather than intent. */
933
+ --nx-overlay: oklch(0 0 0 / 0.55);
934
+ /* A scrim you READ ON rather than look through. `--nx-overlay` sits under a
935
+ * modal, which supplies its own surface for text; a full-screen state screen
936
+ * puts its message straight onto the scrim, where the MUTED line decides the
937
+ * strength, not the heading: `text-white/60` over 55% on a white page is
938
+ * 2.81:1, and over 80% it is 5.66:1. Pure white clears AA on either (4.76:1
939
+ * and 12.63:1), so the heading alone would not have justified this token. */
940
+ --nx-overlay-strong: oklch(0 0 0 / 0.8);
941
+ /* For a scrim over CONTENT rather than the page: an image's hover actions,
942
+ * where the content beneath still has to read through. */
943
+ --nx-overlay-soft: oklch(0 0 0 / 0.4);
944
+ --nx-border-subtle: color-mix(in srgb, oklch(0.92 0 0), transparent 60%);
945
+ --nx-border: oklch(0.92 0 0);
946
+ /* These two sit BELOW the WCAG 1.4.11 3:1 minimum for a control boundary,
947
+ * deliberately, to keep the light border weight the palette is designed
948
+ * around. `contrast/accepted.ts` records each affected pairing with its
949
+ * measured ratio and is what keeps that visible rather than silent; the
950
+ * contrast suite reads that list, so neither token can drift further without
951
+ * failing. */
952
+ --nx-border-strong: color-mix(in srgb, oklch(0.92 0 0), black 25%);
953
+ --nx-input: oklch(0.94 0 0);
954
+ /* The boundary of a control that has NOTHING ELSE to identify it.
955
+ *
956
+ * A text field at --nx-input is identifiable without its edge: it carries a
957
+ * label, a placeholder, a value, and a focus ring the moment it is used. An
958
+ * unchecked checkbox or radio is only the box. Its border is not decoration
959
+ * around the control, it IS the control, so 1.4.11's 3:1 applies with nothing
960
+ * to fall back on -- and at the reference palette's border weight the box is
961
+ * effectively invisible.
962
+ *
963
+ * These were one token, which is why the reference weight could not be taken
964
+ * without losing the checkbox. They are two questions -- "how heavy is a field
965
+ * edge" and "can this control be seen at all" -- and they only shared an
966
+ * answer by accident. Splitting them is what lets the field borders match the
967
+ * reference while the controls stay identifiable.
968
+ *
969
+ * Solved to the LIGHTEST value that still clears 3:1 with the margin the
970
+ * contrast suite requires, against the darkest surface a control lands on, so
971
+ * it sits as close to the reference weight as the criterion permits. */
972
+ --nx-control-border: oklch(0.62 0 0);
973
+ --nx-ring: var(--nx-primary);
974
+
975
+ /* The base colour of the elevation ramp (--shadow-sm..xl, -inner-subtle,
976
+ * -neo). Each step mixes this down to its own alpha, so retinting every
977
+ * shadow at once is a single token change. */
978
+ --nx-shadow-color: oklch(0 0 0);
979
+
980
+ /* Chart colors for data visualization.
981
+ *
982
+ * Held to the 3:1 non-text minimum against --nx-card, the surface a widget
983
+ * draws on, and against a bar's track (--nx-muted) and the tooltip
984
+ * (--nx-popover), because a chart mark is a graphical object required to
985
+ * read the chart. Each pair of slots also stays apart for a reader with
986
+ * protanopia, deuteranopia or tritanopia: the slots step in LIGHTNESS as
987
+ * well as hue, since a lightness step survives every kind of colour-vision
988
+ * deficiency where a hue step alone does not. Slot 4 is the darkest for that
989
+ * reason, below the green and the red it would otherwise match. Solved as
990
+ * the nearest values to the cyan, green, amber and red they started from
991
+ * that pass both; `chart-palette-colour-vision.test.ts` holds the margins.
992
+ * The two modes need different values, since the light ones sit on
993
+ * near-white and the dark ones on near-black. */
994
+ --nx-chart-1: var(--nx-primary);
995
+ --nx-chart-2: oklch(0.6179 0.1124 221.32);
996
+ --nx-chart-3: oklch(0.5485 0.1626 143.34);
997
+ --nx-chart-4: oklch(0.4489 0.1281 44.12);
998
+ --nx-chart-5: oklch(0.6286 0.2113 21.48);
999
+
1000
+ /* Design tokens */
1001
+ /* The one corner knob. Every tier below derives from it, so this single
1002
+ * declaration re-rounds the whole admin and a plugin built against the
1003
+ * published preset re-rounds with it. */
1004
+ --radius: 0.5rem;
1005
+
1006
+ /* Control sizing — derived from a single height knob so control density
1007
+ * scales from one place. Steps map to the control size variants:
1008
+ * sm 32px, md 36px, default 40px, lg 44px. */
1009
+ --nx-control-height: 2.5rem;
1010
+ --nx-control-height-sm: calc(var(--nx-control-height) - 0.5rem);
1011
+ --nx-control-height-md: calc(var(--nx-control-height) - 0.25rem);
1012
+ --nx-control-height-lg: calc(var(--nx-control-height) + 0.25rem);
1013
+
1014
+ /* Field width caps — bound how wide a form control grows so a short value
1015
+ * (a slug, a toggle, a single date) does not stretch to the full content
1016
+ * width. `FieldShell` reads these with a literal fallback, so a consumer
1017
+ * theme that predates these tokens still renders correctly; the token is
1018
+ * what lets a theme retune the caps centrally instead. A length, not a
1019
+ * colour, so it is declared once here rather than per light/dark block —
1020
+ * a field's width does not change with the theme. */
1021
+ --nx-field-half: 380px;
1022
+ --nx-field-full: 760px;
1023
+
1024
+ /* Page shell — the inset from the content panel's edge to the page's content,
1025
+ * and the measure that content is bounded to. `PageShell` spends these as
1026
+ * GRID COLUMNS rather than as padding, because padding cannot be cancelled by
1027
+ * a descendant: that is why full-bleed content previously had to be rendered
1028
+ * OUTSIDE the wrapper to escape the measure, and why two wrappers each
1029
+ * applying their own inset silently doubled it.
1030
+ *
1031
+ * A length rather than a colour, so it is declared once here rather than per
1032
+ * light/dark block — a page's inset does not change with the theme. */
1033
+ --nx-gutter: 2rem;
1034
+ --nx-measure-form: 56rem;
1035
+ --nx-measure-wide: 72rem;
1036
+
1037
+ /* The measure the content column is bounded to, declared here so a theme can
1038
+ * retune it centrally and so the token resolves to a real value rather than
1039
+ * to a `var()` fallback. `PageShell` overrides it INLINE per its `width`
1040
+ * prop, which is what makes the three widths one grid template instead of
1041
+ * three near-identical ones; this declaration is the value that applies when
1042
+ * the grid is used without that component. */
1043
+ --nx-shell-measure: var(--nx-measure-form);
1044
+
1045
+ /* The single vertical-rhythm token for a form section. `FormSection` applies
1046
+ * it to every DIRECT child, so the card's top and bottom breathing room and
1047
+ * the gap between two fields are one decision and cannot drift apart — the
1048
+ * first child's top padding IS the card's top inset.
1049
+ *
1050
+ * The rhythm belongs to the section rather than to the rows it is handed. A
1051
+ * section renders whatever children it is given, and cannot tell one row
1052
+ * idiom from another; leaving each row to supply its own vertical padding
1053
+ * makes the card's inset depend on which idiom the caller happened to reach
1054
+ * for, and a row that supplies none renders flush against the borders. */
1055
+ --nx-field-gap: 1.25rem;
1056
+
1057
+ /* Focus ring colors */
1058
+ --nx-focus-ring: var(--nx-primary);
1059
+ --nx-focus-ring-offset: oklch(1 0 0);
1060
+ /* white */
1061
+
1062
+ /* Sidebar specific colors - using Slate scale */
1063
+ --nx-sidebar-background: oklch(0.99 0 0);
1064
+ /* flat with the content surface; nav is separated by borders, not fill */
1065
+ /* Resting and active nav ink are the same value in light mode: nav labels sit
1066
+ * at body-text weight rather than a step back from it, which is the reference
1067
+ * palette's arrangement.
1068
+ *
1069
+ * So the active row is marked by its FILL (--nx-sidebar-accent) TOGETHER WITH
1070
+ * a font-weight change, and the pair is load-bearing rather than decorative.
1071
+ * The fill alone is about 1.11:1, far under the 3:1 WCAG 1.4.11 asks of
1072
+ * information identifying a component's state, and there is no exemption for
1073
+ * a large filled region -- that is 1.4.3, and it is about text. The weight
1074
+ * change is what satisfies the criterion, being a difference that is not a
1075
+ * colour and so carries no ratio at all.
1076
+ *
1077
+ * Removing `data-[active=true]:font-medium` from the sidebar menu buttons
1078
+ * therefore leaves the nav with no conforming active state, and
1079
+ * `contrast/__tests__/sidebar-ink-hierarchy.test.ts` fails per variant if
1080
+ * either loses it.
1081
+ *
1082
+ * Dark mode keeps the two-step ink relationship instead, where a near-white
1083
+ * active ink on a dark row is what separates the states. */
1084
+ --nx-sidebar-foreground: oklch(0 0 0);
1085
+ --nx-sidebar-primary: oklch(0 0 0);
1086
+ --nx-sidebar-primary-foreground: oklch(1 0 0);
1087
+ /* slate-50 */
1088
+ --nx-sidebar-accent: oklch(0.94 0 0);
1089
+ /* slate-100 */
1090
+ --nx-sidebar-accent-foreground: oklch(0 0 0);
1091
+ /* Below the 3:1 boundary minimum, deliberately, to match the border weight of
1092
+ * the rest of the palette. Recorded in `contrast/accepted.ts`. */
1093
+ --nx-sidebar-border: oklch(0.94 0 0);
1094
+ --nx-sidebar-ring: var(--nx-primary);
1095
+
1096
+ /* Data table specific colors */
1097
+ --nx-table-row-hover: oklch(0.97 0 0);
1098
+ --nx-table-row-selected: var(--nx-primary);
1099
+ --nx-table-border: var(--nx-border);
1100
+ }
1101
+
1102
+ /* Dark theme overrides when using class-based theming */
1103
+ .dark {
1104
+ /* Base colors - using Slate dark scale */
1105
+ --nx-background: oklch(0 0 0);
1106
+ /* ultra deep dark background (darker than slate-950) */
1107
+ --nx-page-background: oklch(0.23 0 0);
1108
+ /* Matches background in dark mode */
1109
+ --nx-foreground: oklch(1 0 0);
1110
+ /* slate-50 */
1111
+
1112
+ /* Component colors */
1113
+ --nx-card: oklch(0.14 0 0);
1114
+ /* raised one tonal step above --nx-background (222 47% 4%) so panels/cards
1115
+ * read as distinct surfaces in dark mode instead of merging into the page */
1116
+ --nx-card-foreground: oklch(1 0 0);
1117
+ /* slate-50 */
1118
+ /* Darkened toward the card elevation so borders, inputs, and muted text
1119
+ * placed on a popover clear their WCAG minimums (border was 2.85:1, input
1120
+ * 1.73:1); the surface was too light for its own contents. */
1121
+ --nx-popover: oklch(0.18 0 0);
1122
+ --nx-popover-foreground: oklch(1 0 0);
1123
+ /* slate-50 */
1124
+ /* A step above the card beneath it, carrying no chroma of its own: a hue here
1125
+ would tint the header band independently of every surface around it. */
1126
+ --nx-table-header-bg: oklch(0.1573 0 0);
1127
+
1128
+ /* Brand colors - Blue-Cyan Professional Palette (Dark Mode) */
1129
+ --nx-primary: oklch(1 0 0); /* High contrast White for dark mode */
1130
+ --nx-primary-foreground: oklch(0 0 0);
1131
+
1132
+ /* Secondary colors - using slate-800 for dark backgrounds */
1133
+ --nx-secondary: oklch(0.25 0 0);
1134
+ /* slate-800 */
1135
+ --nx-secondary-foreground: oklch(1 0 0);
1136
+ /* slate-50 */
1137
+
1138
+ /* Utility colors */
1139
+ --nx-muted: oklch(0.23 0 0);
1140
+ --nx-muted-foreground: oklch(0.72 0 0);
1141
+ /* The hover and selected surface: one step lighter than --nx-muted so a row
1142
+ under the pointer separates from a merely quiet one. Neutral, not the blue
1143
+ it was once labelled -- a tinted accent reads as a status on a surface that
1144
+ carries none. */
1145
+ --nx-accent: oklch(0.32 0 0);
1146
+ --nx-accent-foreground: oklch(1 0 0);
1147
+ /* white */
1148
+
1149
+ /* State colors - WCAG 2.2 AA Compliant (Dark Mode).
1150
+ * The base token is lightened from the fill color so it reads as text on the
1151
+ * dark page at 4.5:1. The two statuses then resolve the on-color problem
1152
+ * differently, because a fill light enough to read as text on a dark page is
1153
+ * too light for white text: destructive keeps ONE value for base and fill
1154
+ * and flips its ink to black (6.90:1), while success keeps a darker separate
1155
+ * fill and keeps its ink white (4.80:1). Warning is already light enough to
1156
+ * read on dark, so its base is unchanged here. */
1157
+ /* Lightened red so it reads as text at WCAG 4.5:1 on the dark page and on the
1158
+ * lighter popover surface (was 4.17:1 on the page, 4.25:1 on a popover). */
1159
+ --nx-destructive: oklch(0.69 0.2 23.91);
1160
+ /* Same value as the base: the button fill needs no darkening here because
1161
+ its ink is black rather than white. */
1162
+ --nx-destructive-solid: oklch(0.69 0.2 23.91);
1163
+ /* Hover lightens the fill, since its label here is black: deepening it
1164
+ would take the label toward the fill. */
1165
+ --nx-destructive-hover: color-mix(
1166
+ in srgb,
1167
+ var(--nx-destructive-solid),
1168
+ white 15%
1169
+ );
1170
+ /* Black, not white. The dark-mode fill is light enough that black on-color
1171
+ text reads at 6.90:1 where white would fall below the minimum. */
1172
+ --nx-destructive-foreground: oklch(0 0 0);
1173
+ /* Lightened green so it reads as text at WCAG 4.5:1 on the dark page and on
1174
+ * the lighter popover surface (was 4.17:1 on the page, 4.29:1 on a popover). */
1175
+ /* Lightened a step so success ink clears 4.5:1 on --nx-muted with the margin
1176
+ * the suite requires. Muted is the binding surface here, being the lightest
1177
+ * of the dark surfaces this ink lands on; against card or page it was never
1178
+ * close. */
1179
+ --nx-success: oklch(0.61 0.1921 149.58);
1180
+ /* Darker green fill so white on-color button text clears 4.5:1. */
1181
+ --nx-success-solid: oklch(0.5225 0.1921 149.58);
1182
+ --nx-success-foreground: oklch(1 0 0);
1183
+ /* white */
1184
+ /* The toast library's own dark success surface and text, kept: about 12.3:1. */
1185
+ --nx-toast-success-bg: oklch(0.2107 0.0498 157.43);
1186
+ --nx-toast-success-text: oklch(0.8635 0.1699 157.75);
1187
+ /* The toast library's own dark warning surface and text, kept: about 11.2:1. */
1188
+ --nx-toast-warning-bg: oklch(0.2277 0.0509 113.29);
1189
+ --nx-toast-warning-text: oklch(0.8642 0.1416 92.19);
1190
+ --nx-warning: oklch(0.7686 0.1646 70.11);
1191
+ /* amber-500 */
1192
+ --nx-warning-foreground: oklch(0.2079 0.0399 265.73);
1193
+ /* slate-900 */
1194
+
1195
+ /* Status tokens, dark: a deep tinted surface, a mid border, light text and a
1196
+ * bright solid, so each reads on the black page as its light twin does. */
1197
+ --nx-success-surface: oklch(0.22 0.03 150);
1198
+ --nx-success-border: oklch(0.37 0.07 150);
1199
+ --nx-success-text: oklch(0.82 0.13 150);
1200
+ --nx-warning-surface: oklch(0.23 0.035 75);
1201
+ --nx-warning-border: oklch(0.4 0.08 75);
1202
+ --nx-warning-text: oklch(0.85 0.12 80);
1203
+ --nx-warning-solid: oklch(0.78 0.15 75);
1204
+ --nx-danger-surface: oklch(0.23 0.04 25);
1205
+ --nx-danger-border: oklch(0.4 0.09 25);
1206
+ --nx-danger-text: oklch(0.8 0.11 25);
1207
+ --nx-danger-solid: oklch(0.68 0.19 25);
1208
+ --nx-info-surface: oklch(0.22 0.035 255);
1209
+ --nx-info-border: oklch(0.38 0.08 255);
1210
+ --nx-info-text: oklch(0.82 0.09 250);
1211
+ --nx-info-solid: oklch(0.68 0.14 255);
1212
+
1213
+ /* Dimmed so the mark reads as highlighted rather than as a lamp on a dark
1214
+ * page, while its own foreground stays dark enough to read against it. */
1215
+ --nx-highlight: oklch(0.8 0.1425 101.06);
1216
+ /* yellow-300-ish, pulled back for the dark surface */
1217
+ --nx-highlight-foreground: oklch(0.2079 0.0399 265.73);
1218
+ /* slate-900 */
1219
+
1220
+ /* Syntax colors (dark). Lightened rather than reused from light mode: the
1221
+ * light hues sit near 0.45-0.5 lightness and disappear on the dark surface.
1222
+ * Chroma is pulled back slightly so they don't vibrate against it. */
1223
+ --nx-code-bg: oklch(0.1916 0.0228 266.36);
1224
+ --nx-code-fg: oklch(0.9838 0.0035 247.86);
1225
+ --nx-code-comment: oklch(0.6626 0.0364 256.79);
1226
+ --nx-code-keyword: oklch(0.7482 0.1235 303.9);
1227
+ --nx-code-string: oklch(0.7654 0.1476 152.1);
1228
+ --nx-code-number: oklch(0.7807 0.1189 44.2);
1229
+ --nx-code-function: oklch(0.7365 0.1163 254.6);
1230
+ --nx-code-operator: oklch(0.7549 0.1234 8.4);
1231
+ --nx-code-punctuation: oklch(0.6626 0.0364 256.79);
1232
+ --nx-code-variable: oklch(0.7938 0.1052 62.3);
1233
+ --nx-code-tag: oklch(0.7118 0.1476 27.5);
1234
+ --nx-code-deleted: oklch(0.7118 0.1476 27.5);
1235
+ --nx-code-inserted: oklch(0.7654 0.1476 152.1);
1236
+
1237
+ /* Element colors — 3-tier translucent border scale (white-alpha for dark).
1238
+ * Recomputed as white-over-dark alpha (not a flipped hex) so dividers read
1239
+ * on the deep background without glowing. The decorative tiers carry the same
1240
+ * alphas as light mode, which lands the container edge at a matched 1.41:1 on
1241
+ * the page (1.38:1 light), so a hairline weighs the same in both modes. */
1242
+ /* Stronger than light: the surfaces beneath are mid-tone rather than white,
1243
+ * so the same alpha suppresses less of them. Still black rather than a tinted
1244
+ * scrim, because the modal above it supplies the contrast. */
1245
+ --nx-overlay: oklch(0 0 0 / 0.7);
1246
+ --nx-overlay-strong: oklch(0 0 0 / 0.85);
1247
+ --nx-overlay-soft: oklch(0 0 0 / 0.5);
1248
+ --nx-border-subtle: color-mix(in srgb, oklch(0.26 0 0), transparent 60%);
1249
+ --nx-border: oklch(0.26 0 0);
1250
+ /* Alpha raised so the composited strong border clears WCAG 3:1 / ~4:1 (was 3.00:1). */
1251
+ --nx-border-strong: oklch(0.5444 0 0);
1252
+ /* Brightened so the field border clears WCAG 3:1 on the lighter popover
1253
+ * surface as well as the page and card (was 1.73:1 on a popover). */
1254
+ --nx-input: oklch(0.5445 0 0);
1255
+ /* Dark mode never gave up the boundary minimum, so the control border simply
1256
+ tracks the field border here and the split costs nothing. */
1257
+ --nx-control-border: oklch(0.5445 0 0);
1258
+ --nx-ring: var(--nx-primary);
1259
+
1260
+ /* Black in dark mode too: the ramp reads as depth against the deep surfaces
1261
+ * rather than as a glow, which a lightened shadow colour would produce.
1262
+ * One --shadow-* ramp serves both modes and inlines a single set of
1263
+ * color-mix opacities, so this token is the only place elevation is
1264
+ * retuned -- overriding it resolves the whole ramp to that hue. */
1265
+ --nx-shadow-color: oklch(0 0 0);
1266
+
1267
+ /* Chart colors for data visualization.
1268
+ *
1269
+ * NOT the same as light mode: here the slots sit on near-black and need the
1270
+ * lighter values to stay legible. Held to the same minimums as light mode,
1271
+ * against the same three surfaces and the same three colour-vision
1272
+ * deficiencies, by `chart-palette-colour-vision.test.ts`. */
1273
+ --nx-chart-1: var(--nx-primary);
1274
+ --nx-chart-2: oklch(0.7717 0.1304 210.71);
1275
+ --nx-chart-3: oklch(0.7031 0.1315 159.76);
1276
+ --nx-chart-4: oklch(0.7676 0.1653 69.92);
1277
+ --nx-chart-5: oklch(0.6348 0.2057 27.82);
1278
+
1279
+ /* Sidebar specific colors - dark mode */
1280
+ --nx-sidebar-background: oklch(0.18 0 0);
1281
+ /* flat with the content surface; nav is separated by borders, not fill */
1282
+ /* Resting nav ink, dimmed off slate-50 so it sits a step below
1283
+ * --nx-sidebar-accent-foreground the way the light pair does: the lightness
1284
+ * gap here (0.164) is the same one light mode puts between slate-600 and
1285
+ * slate-900, so an active row reads as emphasised by its ink and not only by
1286
+ * its fill. Chroma and hue track the theme's other secondary ink
1287
+ * (--nx-muted-foreground) so lightness alone carries the hierarchy. */
1288
+ --nx-sidebar-foreground: oklch(0.72 0 0);
1289
+ --nx-sidebar-primary: oklch(1 0 0);
1290
+ /* slate-50 */
1291
+ --nx-sidebar-primary-foreground: oklch(0 0 0);
1292
+ --nx-sidebar-accent: oklch(0.32 0 0);
1293
+ --nx-sidebar-accent-foreground: oklch(1 0 0);
1294
+ /* slate-50 */
1295
+ /* Lightened so the sidebar border clears WCAG 3:1 on its surface (was 1.19:1). */
1296
+ --nx-sidebar-border: oklch(0.519 0 0);
1297
+ --nx-sidebar-ring: var(--nx-primary);
1298
+
1299
+ /* Data table specific colors - dark mode */
1300
+ --nx-table-row-hover: oklch(0.23 0 0);
1301
+ --nx-table-row-selected: var(--nx-primary);
1302
+ --nx-table-border: var(--nx-border);
1303
+ /* inherit the retuned white-alpha border (was a fixed faint slate) */
1304
+ }
1305
+
1306
+ /* ============================================================
1307
+ * Page shell
1308
+ * ============================================================
1309
+ *
1310
+ * The gutter and the measure are ONE grid definition, spent as columns rather
1311
+ * than as padding. That is load-bearing rather than stylistic:
1312
+ *
1313
+ * - Padding cannot be cancelled by a descendant, so a block that must run
1314
+ * edge-to-edge previously had to be rendered OUTSIDE the wrapper imposing
1315
+ * the measure. `.nx-bleed` turns that from an accident into a declaration.
1316
+ * - Two wrappers that each apply an inset silently add. As columns there is
1317
+ * one declaration, so double-padding is unrepresentable rather than merely
1318
+ * discouraged.
1319
+ * - Every direct child defaults to the `content` column, so a page header and
1320
+ * the card beneath it cannot disagree about their left edge.
1321
+ *
1322
+ * Centring comes from the two outer tracks being equal rather than from
1323
+ * `margin-inline: auto` on a max-width box, which does nothing at panel widths
1324
+ * where the cap does not bind.
1325
+ */
1326
+ @layer components {
1327
+ /* A form section's vertical rhythm, applied to every DIRECT child.
1328
+ *
1329
+ * Plain CSS rather than a Tailwind utility on the element, for two reasons.
1330
+ * The parenthesised custom-property shorthand is v4-only, so the same class
1331
+ * compiles to a rule under one Tailwind major and to nothing under the other,
1332
+ * and the section renders flush wherever it compiles to nothing — silently,
1333
+ * because the markup is identical either way. And an arbitrary-value token is
1334
+ * EXTRACTED from any file the scanner reads, a comment or a test string
1335
+ * included, so merely naming one of these utilities in prose emits its rule;
1336
+ * a malformed spelling anywhere in the repository fails the whole stylesheet.
1337
+ *
1338
+ * A rule shipped in the theme has neither property: it is the same CSS under
1339
+ * both majors, and there is no token for a scanner to find.
1340
+ *
1341
+ * Children must not pad themselves. The two paddings are additive, so a row
1342
+ * carrying its own `py-*` doubles the rhythm on the sections that are already
1343
+ * correct. */
1344
+ .nx-form-section-rows > * {
1345
+ padding-block: var(--nx-field-gap);
1346
+ }
1347
+
1348
+ .nx-page-shell {
1349
+ display: grid;
1350
+ /* The outer tracks are `minmax(gutter, 1fr)` rather than a fixed gutter so
1351
+ * the grid always spans its container: a fixed pair would total only
1352
+ * `measure + 2 * gutter`, leaving `full-start`/`full-end` short of the
1353
+ * panel's edges in anything wider, and a `Bleed` child short with them. The
1354
+ * `1fr` maximum absorbs the surplus while `gutter` holds as the minimum.
1355
+ *
1356
+ * Their being equal is also what centres the content column, so no
1357
+ * `justify-content` is declared: with flexible tracks the grid fills its
1358
+ * container and there is no free space for it to distribute. */
1359
+ grid-template-columns:
1360
+ [full-start] minmax(var(--nx-gutter), 1fr)
1361
+ [content-start] minmax(0, var(--nx-shell-measure))
1362
+ [content-end] minmax(var(--nx-gutter), 1fr)
1363
+ [full-end];
1364
+ align-content: start;
1365
+ }
1366
+
1367
+ /* A list page's inset: the shell's gutter as padding on a plain block, for a
1368
+ * page that must stay a block (it hands its height down through
1369
+ * `height: 100%`, which a grid area sized by `align-content: start` would
1370
+ * collapse). */
1371
+ .nx-page-pad {
1372
+ padding-inline: var(--nx-gutter);
1373
+ }
1374
+
1375
+ /* A start-aligned shell keeps the leading gutter fixed and gives all the
1376
+ * surplus to the trailing track, so a bounded column starts at the same edge
1377
+ * as the page header and every list instead of drifting right as the screen
1378
+ * widens. A `full` column still fills the row. */
1379
+ .nx-page-shell[data-align="start"] {
1380
+ grid-template-columns:
1381
+ [full-start] var(--nx-gutter)
1382
+ [content-start] minmax(0, var(--nx-shell-measure))
1383
+ [content-end] minmax(var(--nx-gutter), 1fr)
1384
+ [full-end];
1385
+ }
1386
+
1387
+ /* `min-width: 0` because a grid item's default `min-width: auto` refuses to
1388
+ * shrink below its content, which lets one wide descendant — a long code
1389
+ * string, a table — push the column past the measure it was given. */
1390
+ .nx-page-shell > * {
1391
+ grid-column: content;
1392
+ min-width: 0;
1393
+ }
1394
+
1395
+ /* Scoped to a DIRECT child: the named lines exist on this grid alone, so a
1396
+ * `.nx-bleed` nested deeper resolves against a grid that never declared them.
1397
+ * Writing the rule this way means such a case is inert rather than
1398
+ * mysteriously half-working. */
1399
+ .nx-page-shell > .nx-bleed {
1400
+ grid-column: full;
1401
+ }
1402
+ }
1403
+
1404
+ /* The gutter steps with the content PANEL rather than the viewport: the panel's
1405
+ * width changes when a sidebar opens, and the panel is what the page sits in.
1406
+ * `content` is the container the admin's <main> already names. The step values
1407
+ * match Payload's --gutter-h ladder (32 / 24 / 16).
1408
+ *
1409
+ * The override lands on `.nx-page-shell`, a DESCENDANT of that container. A
1410
+ * container query styles only elements inside its container, so a rule naming
1411
+ * `:root` or `.nextly-admin` — both ancestors of the `<main>` that declares it —
1412
+ * never matches, and the gutter keeps its widest value at every panel size. */
1413
+ @container content (max-width: 1024px) {
1414
+ .nx-page-shell,
1415
+ .nx-page-pad {
1416
+ --nx-gutter: 1.5rem;
1417
+ }
1418
+ }
1419
+
1420
+ @container content (max-width: 768px) {
1421
+ .nx-page-shell,
1422
+ .nx-page-pad {
1423
+ --nx-gutter: 1rem;
1424
+ }
1425
+ }