@lilydesignsystem/themes 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/LICENSE.md +64 -0
  2. package/dist/abyss.css +3174 -0
  3. package/dist/acid.css +3174 -0
  4. package/dist/adobe-spectrum.css +3174 -0
  5. package/dist/aqua.css +3174 -0
  6. package/dist/autumn.css +3174 -0
  7. package/dist/black.css +3174 -0
  8. package/dist/bumblebee.css +3174 -0
  9. package/dist/business.css +3174 -0
  10. package/dist/caramellatte.css +3174 -0
  11. package/dist/cmyk.css +3174 -0
  12. package/dist/coffee.css +3174 -0
  13. package/dist/corporate.css +3174 -0
  14. package/dist/cupcake.css +3174 -0
  15. package/dist/cyberpunk.css +3174 -0
  16. package/dist/dark.css +3175 -0
  17. package/dist/dim.css +3174 -0
  18. package/dist/dracula.css +3174 -0
  19. package/dist/emerald.css +3174 -0
  20. package/dist/fantasy.css +3174 -0
  21. package/dist/forest.css +3174 -0
  22. package/dist/garden.css +3174 -0
  23. package/dist/halloween.css +3174 -0
  24. package/dist/lemonade.css +3174 -0
  25. package/dist/light.css +3174 -0
  26. package/dist/lofi.css +3174 -0
  27. package/dist/luxury.css +3174 -0
  28. package/dist/mozilla-protocol.css +3174 -0
  29. package/dist/night.css +3174 -0
  30. package/dist/nord.css +3174 -0
  31. package/dist/pastel.css +3174 -0
  32. package/dist/retro.css +3174 -0
  33. package/dist/silk.css +3174 -0
  34. package/dist/sunset.css +3174 -0
  35. package/dist/synthwave.css +3174 -0
  36. package/dist/united-kingdom-government-digital-service.css +3179 -0
  37. package/dist/united-kingdom-national-health-service-england-for-patients.css +3215 -0
  38. package/dist/united-kingdom-national-health-service-england-for-practitioners.css +3308 -0
  39. package/dist/united-kingdom-national-health-service-scotland-for-patients.css +3318 -0
  40. package/dist/united-kingdom-national-health-service-scotland-for-practitioners.css +3404 -0
  41. package/dist/united-kingdom-national-health-service-wales-for-patients.css +4211 -0
  42. package/dist/united-kingdom-national-health-service-wales-for-practitioners.css +4387 -0
  43. package/dist/united-states-web-design-system.css +3175 -0
  44. package/dist/valentine.css +3175 -0
  45. package/dist/winter.css +3175 -0
  46. package/dist/wireframe.css +3175 -0
  47. package/index.md +95 -0
  48. package/package.json +43 -0
@@ -0,0 +1,3179 @@
1
+ /* ============================================================================
2
+ * Lily theme: united-kingdom-government-digital-service
3
+ *
4
+ * Standalone Lily Design System theme — declares the theme tokens and inlines
5
+ * the component CSS for all 492 Lily components, so this single file is the
6
+ * only stylesheet required to render a Lily-styled page.
7
+ *
8
+ * Credit for the theme source: GOV.UK Design System / Government Digital Service (https://design-system.service.gov.uk/)
9
+ *
10
+ * Upstream tracked: GOV.UK Frontend v6.x (web palette v1.0, 2026).
11
+ * Refreshed 2026-08-26 for the v6.0.0 palette changes that touch tokens
12
+ * used here: green #00703c -> #0f7a52 (success), red #d4351c -> #ca3535
13
+ * (error). Blue #1d70b8, black #0b0c0c, and focus yellow #ffdd00 are
14
+ * unchanged in v6. Independent implementation against Lily class hooks;
15
+ * not affiliated with or endorsed by GDS.
16
+ * ========================================================================= */
17
+
18
+ /* Theme tokens — the colour, radius, border, and depth variables consumed
19
+ * by every Lily component rule below. The theme applies by default (`:root`)
20
+ * and also when explicitly opted into via `<html data-theme="light">`,
21
+ * so multiple themes can coexist in one document and be switched at runtime
22
+ * by updating the `data-theme` attribute. */
23
+
24
+ :where(:root, :root[data-theme="united-kingdom-government-digital-service"]) {
25
+ color-scheme: light;
26
+
27
+ /* Page-level surface (primary canvas). Sits behind body copy
28
+ and primary content areas. Lightest base shade in light
29
+ themes, deepest in dark themes. */
30
+ --color-base-100: #ffffff;
31
+ /* Secondary surface — section panels, card backgrounds,
32
+ sidebars, table-header fills. One step away from the page
33
+ surface. */
34
+ --color-base-200: #f3f2f1;
35
+ /* Tertiary surface — dividers, sunken wells, hover-row
36
+ backgrounds. The most muted of the three base shades. */
37
+ --color-base-300: #dee0e2;
38
+ /* Primary text colour. High-contrast against base-100 to meet
39
+ WCAG contrast ratios for body copy. */
40
+ --color-base-content: #0b0c0c;
41
+ /* Primary brand / action colour. Used on primary buttons,
42
+ active navigation items, selected states, and the focus
43
+ ring. */
44
+ --color-primary: #1d70b8;
45
+ /* Foreground colour used over `--color-primary` fills (so
46
+ primary buttons retain a guaranteed contrast ratio). */
47
+ --color-primary-content: #ffffff;
48
+ /* Secondary brand colour. Pressed/hover state for primary
49
+ buttons and visited links; also drives the secondary chrome
50
+ family. */
51
+ --color-secondary: #003078;
52
+ /* Foreground colour used over `--color-secondary` fills. */
53
+ --color-secondary-content: #ffffff;
54
+ /* Accent colour — used sparingly for emphasis, the AI label,
55
+ illustrations, and tertiary call-outs. */
56
+ --color-accent: #ffdd00;
57
+ /* Foreground colour used over `--color-accent` fills. */
58
+ --color-accent-content: #0b0c0c;
59
+ /* Neutral chrome surface — footer bars, code blocks,
60
+ tooltips, government-banner strips. Typically the theme's
61
+ darkest neutral. */
62
+ --color-neutral: #0b0c0c;
63
+ /* Foreground colour used over `--color-neutral` fills. */
64
+ --color-neutral-content: #ffffff;
65
+ /* Informational status colour — informational banners, links,
66
+ 'did-you-know' callouts. */
67
+ --color-info: #1d70b8;
68
+ /* Foreground colour used over `--color-info` fills. */
69
+ --color-info-content: #ffffff;
70
+ /* Success / confirmation colour — used on success panels,
71
+ completed step indicators, validation pass states, and the
72
+ green RAG status. */
73
+ --color-success: #0f7a52;
74
+ /* Foreground colour used over `--color-success` fills. */
75
+ --color-success-content: #ffffff;
76
+ /* Warning colour — yellow/amber band; used on phase banners,
77
+ in-progress states, validation warnings, and the amber RAG
78
+ status. */
79
+ --color-warning: #f47738;
80
+ /* Foreground colour used over `--color-warning` fills. Often
81
+ dark so text remains legible on a bright yellow background. */
82
+ --color-warning-content: #0b0c0c;
83
+ /* Error / destructive colour — used on alert dialogs, error
84
+ messages, validation failures, urgent care cards, and the
85
+ red RAG status. */
86
+ --color-error: #ca3535;
87
+ /* Foreground colour used over `--color-error` fills. */
88
+ --color-error-content: #ffffff;
89
+ /* Smallest corner radius. Applied to chips, badges, switches,
90
+ and radio/checkbox containers (mapped to `--lily-radius-
91
+ sm`). */
92
+ --radius-selector: 0;
93
+ /* Medium corner radius. Applied to inputs, buttons, menu
94
+ items, tooltips, and most everyday form controls (mapped to
95
+ `--lily-radius-md`). */
96
+ --radius-field: 0;
97
+ /* Largest corner radius. Applied to cards, dialogs, drawers,
98
+ and hero blocks (mapped to `--lily-radius-lg`). */
99
+ --radius-box: 0;
100
+ /* Base size for selector-style controls (checkbox/radio glyph
101
+ size, switch thumb diameter). Currently unused by Lily's
102
+ baseline component rules but available for theme
103
+ extensions. */
104
+ --size-selector: 0.25rem;
105
+ /* Base size for field-style controls (input height
106
+ multiplier). Currently unused by Lily's baseline component
107
+ rules but available for theme extensions. */
108
+ --size-field: 0.25rem;
109
+ /* Default border width applied to inputs, buttons, dividers,
110
+ table cells, etc. Single source of truth for the system's
111
+ stroke weight. */
112
+ --border: 1px;
113
+ /* Depth flag (0 or 1). Lily's baseline rules read it
114
+ implicitly via the shadow tokens; a depth-0 theme
115
+ effectively renders flat. */
116
+ --depth: 0;
117
+ /* Noise flag (0 or 1). Reserved for theme extensions that
118
+ want to layer a subtle texture; the baseline rules do not
119
+ consume it. */
120
+ --noise: 0;
121
+ }
122
+
123
+ /* ----------------------------------------------------------------------------
124
+ * Lily component styling — applied automatically once this theme stylesheet
125
+ * is loaded. Every Lily class hook (492 components) consumes the theme tokens
126
+ * declared above, so no other stylesheet is required for the theme to render.
127
+ *
128
+ * Rules live in @layer lily with :where() selectors so the specificity stays
129
+ * at 0 — application CSS always wins. To replace a Lily component's default
130
+ * look, declare a higher-specificity rule (or a later @layer) in your own
131
+ * stylesheet.
132
+ * -------------------------------------------------------------------------- */
133
+
134
+ @layer lily {
135
+ /* ==========================================================================
136
+ * Tokens & primitives
137
+ * --------------------------------------------------------------------------
138
+ * Lily exposes a small, stable set of derived tokens (the `--lily-*`
139
+ * family) layered on top of the upstream theme primitives (the
140
+ * `--color-*`, `--radius-*`, `--border`, `--depth`, `--noise` family).
141
+ *
142
+ * Component rules consume only the `--lily-*` tokens. That indirection
143
+ * means a consumer can swap upstream themes (or invent a new one) without
144
+ * touching component CSS — the component rules below remain stable
145
+ * because their inputs do.
146
+ * ====================================================================== */
147
+
148
+ :where(:root) {
149
+ /* --- Surfaces ------------------------------------------------------ */
150
+ /* Default page surface — the canvas behind body copy. */
151
+ --lily-surface: var(--color-base-100);
152
+ /* Secondary surface — section panels, sidebars, table headers,
153
+ muted callouts. One step away from the page background. */
154
+ --lily-surface-alt: var(--color-base-200);
155
+ /* Sunken surface — used behind progress tracks, skeletons, and
156
+ inset wells. Suggests depth without requiring a shadow. */
157
+ --lily-surface-sunken: var(--color-base-300);
158
+
159
+ /* --- Text ---------------------------------------------------------- */
160
+ /* Primary body-copy colour. Maps to the theme's high-contrast
161
+ reading colour. */
162
+ --lily-text: var(--color-base-content);
163
+ /* Muted / secondary text — mixed 70% with transparent to keep the
164
+ hue but lower contrast for captions, helptext, placeholders. */
165
+ --lily-text-muted: color-mix(
166
+ in oklch,
167
+ var(--color-base-content) 70%,
168
+ transparent
169
+ );
170
+
171
+ /* --- Borders ------------------------------------------------------- */
172
+ /* Default border — 20% blend with body content colour, low-contrast,
173
+ used for subtle dividers between content blocks. */
174
+ --lily-border: color-mix(
175
+ in oklch,
176
+ var(--color-base-content) 20%,
177
+ transparent
178
+ );
179
+ /* Higher-contrast border — 40% blend, used on inputs, buttons, and
180
+ anywhere a clear edge is required (WCAG non-text contrast). */
181
+ --lily-border-strong: color-mix(
182
+ in oklch,
183
+ var(--color-base-content) 40%,
184
+ transparent
185
+ );
186
+
187
+ /* --- Focus ring ---------------------------------------------------- */
188
+ /* Outline colour for `:focus-visible`. Always the primary brand
189
+ colour so focus is visually tied to interactive intent. */
190
+ --lily-focus-ring: var(--color-primary);
191
+
192
+ /* --- Radii --------------------------------------------------------- */
193
+ /* Three tiers of corner rounding. `sm` for chips/badges,
194
+ `md` for inputs/buttons/cards, `lg` for dialogs/heroes. */
195
+ --lily-radius-sm: var(--radius-selector);
196
+ --lily-radius-md: var(--radius-field);
197
+ --lily-radius-lg: var(--radius-box);
198
+
199
+ /* --- Spacing scale ------------------------------------------------- */
200
+ /* Five-step spacing scale used by every gap, padding, and margin.
201
+ Linear progression keeps rhythm consistent at any zoom level. */
202
+ --lily-space-xs: 0.25rem;
203
+ --lily-space-sm: 0.5rem;
204
+ --lily-space-md: 1rem;
205
+ --lily-space-lg: 1.5rem;
206
+ --lily-space-xl: 2rem;
207
+
208
+ /* --- Typography ---------------------------------------------------- */
209
+ /* Body font stack — system fonts first so consumers get a
210
+ native-feeling baseline without shipping a web font. */
211
+ --lily-font-body:
212
+ system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
213
+ Arial, sans-serif;
214
+ /* Monospaced font stack — used by code, kbd, identifiers, and
215
+ anywhere alignment matters more than reading speed. */
216
+ --lily-font-mono:
217
+ ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
218
+ "Liberation Mono", monospace;
219
+
220
+ /* --- Shadows ------------------------------------------------------- */
221
+ /* Three depth tiers. The shadow colour is derived from the body
222
+ content token so it adapts to light/dark themes automatically. */
223
+ --lily-shadow-sm: 0 1px 2px
224
+ color-mix(in oklch, var(--color-base-content) 8%, transparent);
225
+ --lily-shadow-md: 0 4px 12px
226
+ color-mix(in oklch, var(--color-base-content) 12%, transparent);
227
+ --lily-shadow-lg: 0 12px 32px
228
+ color-mix(in oklch, var(--color-base-content) 16%, transparent);
229
+ }
230
+
231
+ /* Focus ring — every interactive Lily class hook gets the same visible
232
+ focus indicator. Centralising the selector means a consumer can
233
+ restyle every focus state at once by overriding `--lily-focus-ring`
234
+ (or this rule) rather than chasing 100+ component selectors. */
235
+ :where(
236
+ [class$="-input"],
237
+ [class$="-button"],
238
+ [class$="-link"],
239
+ [class$="-list-item"],
240
+ [class$="-option"],
241
+ [class$="-picker-button"],
242
+ .button,
243
+ .input,
244
+ .select,
245
+ .option,
246
+ .menu-item,
247
+ .tab-bar-button,
248
+ .switch-button,
249
+ .toggle-button,
250
+ .checkbox-input,
251
+ .radio-input,
252
+ .file-upload,
253
+ .signature-pad,
254
+ .editable
255
+ ):focus-visible {
256
+ outline: 2px solid var(--lily-focus-ring);
257
+ outline-offset: 2px;
258
+ }
259
+
260
+ /* ==========================================================================
261
+ * Inputs
262
+ * --------------------------------------------------------------------------
263
+ * Every Lily class ending in `-input` (textual, date, picker, range, file,
264
+ * national-identifier, etc.) shares the same baseline styling. The
265
+ * `[class$="-input"]` attribute selector catches single-class usage
266
+ * (`class="email-input"`); consumers needing multi-class composition can
267
+ * override with higher-specificity rules in their own stylesheet.
268
+ *
269
+ * The `:not([class$="-with-mask-input"])` exclusion exists because the
270
+ * masked-input variant carries its own typography (monospaced + letter
271
+ * spacing) and we don't want the generic baseline overriding it.
272
+ * Hidden inputs (`type="hidden"`) are also excluded — they must not be
273
+ * laid out as visible inputs.
274
+ * ====================================================================== */
275
+
276
+ /* Baseline visual treatment for every textual input. */
277
+ :where(
278
+ [class$="-input"]:not([class$="-with-mask-input"]):not([type="hidden"]),
279
+ .input
280
+ ) {
281
+ appearance: none; /* drop UA native chrome (Safari especially) */
282
+ display: inline-block;
283
+ width: 100%; /* fill parent by default; consumer caps via container */
284
+ max-width: 100%;
285
+ min-height: 2.5rem; /* WCAG 2.5.5 target-size guidance (~44px) */
286
+ padding: 0.5rem 0.75rem;
287
+ font: inherit;
288
+ font-family: var(--lily-font-body);
289
+ color: var(--lily-text);
290
+ background-color: var(--lily-surface);
291
+ border: var(--border) solid var(--lily-border-strong);
292
+ border-radius: var(--lily-radius-md);
293
+ box-sizing: border-box;
294
+ /* Smooth focus/hover edge transitions — short enough to feel
295
+ responsive, long enough to read as intentional. */
296
+ transition:
297
+ border-color 120ms ease,
298
+ box-shadow 120ms ease;
299
+ }
300
+
301
+ /* Hover affordance — switches the border to the primary brand colour so
302
+ users get a visual cue that the field is interactive. The `:not(:disabled)`
303
+ guard prevents the cue from appearing on locked-out controls. */
304
+ :where([class$="-input"], .input):hover:not(:disabled) {
305
+ border-color: var(--color-primary);
306
+ }
307
+
308
+ /* Disabled / aria-disabled — desaturate and shift to the muted surface so
309
+ the control reads as inactive without losing its layout footprint. */
310
+ :where([class$="-input"], .input):disabled,
311
+ :where([class$="-input"], .input)[aria-disabled="true"] {
312
+ color: var(--lily-text-muted);
313
+ background-color: var(--lily-surface-alt);
314
+ cursor: not-allowed;
315
+ }
316
+
317
+ /* Invalid input — red border. The `aria-invalid="true"` attribute is the
318
+ ARIA contract; pairing it with a colour change keeps WCAG 1.4.1
319
+ (no colour-only meaning) honest because the ARIA state is also there. */
320
+ :where([class$="-input"], .input)[aria-invalid="true"] {
321
+ border-color: var(--color-error);
322
+ }
323
+
324
+ /* Placeholder — match the muted text token. `opacity: 1` overrides Firefox's
325
+ legacy default placeholder opacity, which would otherwise compound on
326
+ our already-muted colour. */
327
+ :where([class$="-input"], .input)::placeholder {
328
+ color: var(--lily-text-muted);
329
+ opacity: 1;
330
+ }
331
+
332
+ /* --- Input type-specific tweaks ----------------------------------------- */
333
+
334
+ /* Hidden inputs must never render. */
335
+ :where(.hidden-input) {
336
+ display: none;
337
+ }
338
+
339
+ /* Submit / reset / image / generic button inputs render as buttons. */
340
+ :where(.button-input, .submit-input, .reset-input, .image-input) {
341
+ width: auto;
342
+ min-width: 2.5rem;
343
+ background-color: var(--color-primary);
344
+ color: var(--color-primary-content);
345
+ border-color: transparent;
346
+ cursor: pointer;
347
+ font-weight: 600;
348
+ }
349
+
350
+ /* Reset input is the secondary-action variant — muted surface, not the
351
+ primary brand colour, because "reset" is a destructive op. */
352
+ :where(.reset-input) {
353
+ background-color: var(--lily-surface-alt);
354
+ color: var(--lily-text);
355
+ border-color: var(--lily-border-strong);
356
+ }
357
+
358
+ /* Color input — narrow swatch with internal padding so the colour chip
359
+ reads cleanly inside the input frame. */
360
+ :where(.color-input) {
361
+ min-height: 2.5rem;
362
+ padding: 0.25rem;
363
+ width: 3rem;
364
+ cursor: pointer;
365
+ }
366
+
367
+ /* Range / angle slider — strip the input chrome so the consumer can
368
+ restyle the track. `accent-color` provides a minimal styled fallback. */
369
+ :where(.range-input, .angle-slider-range-input) {
370
+ appearance: none;
371
+ background: transparent;
372
+ border: 0;
373
+ padding: 0;
374
+ height: 1.5rem;
375
+ accent-color: var(--color-primary);
376
+ }
377
+
378
+ /* File inputs — slightly tighter padding because the UA-rendered
379
+ "Choose file" button consumes most of the visual space. */
380
+ :where(.file-input, .image-file-input) {
381
+ padding: 0.375rem 0.5rem;
382
+ cursor: pointer;
383
+ }
384
+
385
+ /* Checkbox / radio — small square/round controls with the brand accent. */
386
+ :where(.checkbox-input, .radio-input) {
387
+ width: 1.125rem;
388
+ height: 1.125rem;
389
+ min-height: 0; /* override the 2.5rem input baseline */
390
+ padding: 0;
391
+ accent-color: var(--color-primary);
392
+ cursor: pointer;
393
+ }
394
+ :where(.radio-input) {
395
+ border-radius: 50%;
396
+ }
397
+ :where(.checkbox-input) {
398
+ border-radius: var(--lily-radius-sm);
399
+ }
400
+
401
+ /* Textarea variants — taller minimum, line-height tuned for reading,
402
+ vertical-only resize so layout columns aren't disturbed. */
403
+ :where(.text-area-input, .text-area-input-with-character-counter) {
404
+ min-height: 6rem;
405
+ line-height: 1.5;
406
+ resize: vertical;
407
+ }
408
+ /* Character-counter variant stacks the textarea and the counter span. */
409
+ :where(.text-area-input-with-character-counter) {
410
+ display: flex;
411
+ flex-direction: column;
412
+ }
413
+
414
+ /* --- Composite inputs with built-in DOM structure ----------------------- */
415
+
416
+ /* PIN input — N small slots side-by-side. The wrapper is invisible;
417
+ the children carry the styling. */
418
+ :where(.pin-input-div) {
419
+ display: inline-flex;
420
+ gap: 0.5rem;
421
+ padding: 0;
422
+ background: transparent;
423
+ border: 0;
424
+ width: auto;
425
+ min-height: 0;
426
+ }
427
+ :where(.pin-input-div > input) {
428
+ width: 2.5rem;
429
+ height: 3rem;
430
+ padding: 0;
431
+ text-align: center;
432
+ font-size: 1.125rem;
433
+ font-weight: 600;
434
+ background-color: var(--lily-surface);
435
+ border: var(--border) solid var(--lily-border-strong);
436
+ border-radius: var(--lily-radius-md);
437
+ color: var(--lily-text);
438
+ }
439
+
440
+ /* Password-toggle composite — text input + reveal button, sharing
441
+ a single visual frame via flush radii. */
442
+ :where(.password-input-or-text-input-div) {
443
+ display: inline-flex;
444
+ align-items: stretch;
445
+ width: 100%;
446
+ background: transparent;
447
+ border: 0;
448
+ padding: 0;
449
+ min-height: 0;
450
+ }
451
+ :where(.password-input-or-text-input-div > input) {
452
+ flex: 1;
453
+ min-height: 2.5rem;
454
+ padding: 0.5rem 0.75rem;
455
+ background-color: var(--lily-surface);
456
+ color: var(--lily-text);
457
+ border: var(--border) solid var(--lily-border-strong);
458
+ border-right: 0; /* drop the seam where input meets button */
459
+ border-radius: var(--lily-radius-md) 0 0 var(--lily-radius-md);
460
+ }
461
+ :where(.password-input-or-text-input-div > button) {
462
+ padding: 0 0.75rem;
463
+ background-color: var(--lily-surface-alt);
464
+ color: var(--lily-text);
465
+ border: var(--border) solid var(--lily-border-strong);
466
+ border-radius: 0 var(--lily-radius-md) var(--lily-radius-md) 0;
467
+ cursor: pointer;
468
+ }
469
+
470
+ /* --- Input compositions ------------------------------------------------- */
471
+
472
+ /* Input group — flush-joined controls (input + button, etc.). The negative
473
+ margin collapses overlapping borders into a single shared edge. */
474
+ :where(.input-group) {
475
+ display: inline-flex;
476
+ align-items: stretch;
477
+ width: 100%;
478
+ }
479
+ :where(.input-group > *) {
480
+ border-radius: 0;
481
+ margin-left: calc(-1 * var(--border));
482
+ }
483
+ :where(.input-group > *:first-child) {
484
+ border-top-left-radius: var(--lily-radius-md);
485
+ border-bottom-left-radius: var(--lily-radius-md);
486
+ margin-left: 0;
487
+ }
488
+ :where(.input-group > *:last-child) {
489
+ border-top-right-radius: var(--lily-radius-md);
490
+ border-bottom-right-radius: var(--lily-radius-md);
491
+ }
492
+
493
+ /* Masked input — monospaced font + slight letter-spacing so the mask
494
+ template (phone, SSN, etc.) aligns over the typed characters. */
495
+ :where(.input-with-mask) {
496
+ font-family: var(--lily-font-mono);
497
+ letter-spacing: 0.05em;
498
+ }
499
+
500
+ /* Search input — reserve space on the inline-start for the magnifier
501
+ glyph. The `linear-gradient(transparent, transparent)` is a no-op
502
+ background-image; it ensures the property exists so consumers can
503
+ layer an SVG icon over it by overriding `background-image`. */
504
+ :where(.text-input-with-search, .search-input) {
505
+ background-image: linear-gradient(transparent, transparent);
506
+ padding-inline-start: 2.25rem;
507
+ }
508
+
509
+ /* ==========================================================================
510
+ * Views
511
+ * --------------------------------------------------------------------------
512
+ * Read-only display chips for identifiers, dates, ratings, and other
513
+ * pre-formatted data. Every Lily class ending in `-view` is a span/div
514
+ * that renders a value the user shouldn't edit.
515
+ *
516
+ * The exclusions (`theme-view`, `split-view`)
517
+ * are larger containers that don't fit the chip pattern — they're
518
+ * styled separately further down.
519
+ * ====================================================================== */
520
+
521
+ :where(
522
+ [class$="-view"]:not(.theme-view):not(
523
+ .split-view
524
+ )
525
+ ) {
526
+ display: inline-block;
527
+ padding: 0.125rem 0.5rem;
528
+ font-family: var(--lily-font-mono); /* fixed-width for alignment */
529
+ color: var(--lily-text);
530
+ background-color: var(--lily-surface-alt);
531
+ border: var(--border) solid var(--lily-border);
532
+ border-radius: var(--lily-radius-md);
533
+ line-height: 1.4;
534
+ }
535
+
536
+ /* Dates / ranges are human-readable, not codes — switch back to body font. */
537
+ :where(.date-time-view, .date-range, .review-date) {
538
+ font-family: var(--lily-font-body);
539
+ }
540
+
541
+ /* Theme-view — small label + colour swatch composition. */
542
+ :where(.theme-view) {
543
+ display: inline-flex;
544
+ align-items: center;
545
+ gap: 0.5rem;
546
+ padding: 0.25rem 0.5rem;
547
+ color: var(--lily-text);
548
+ }
549
+
550
+ /* ==========================================================================
551
+ * Buttons
552
+ * --------------------------------------------------------------------------
553
+ * Every class ending in `-button` and the bare `.button` share one
554
+ * baseline. Hamburger-menu is excluded because it's an icon-only square
555
+ * with its own minimal frame styling (further down).
556
+ * ====================================================================== */
557
+
558
+ /* Baseline button — primary-coloured pill. Variants override colour or
559
+ shape below. */
560
+ :where(.button, [class$="-button"]:not(.hamburger-menu-button)) {
561
+ appearance: none;
562
+ display: inline-flex;
563
+ align-items: center;
564
+ justify-content: center;
565
+ gap: 0.5rem; /* leave room for an icon + label */
566
+ min-height: 2.5rem; /* WCAG target-size guidance */
567
+ padding: 0.5rem 1rem;
568
+ font: inherit;
569
+ font-family: var(--lily-font-body);
570
+ font-weight: 600;
571
+ line-height: 1.2;
572
+ color: var(--color-primary-content);
573
+ background-color: var(--color-primary);
574
+ border: var(--border) solid transparent;
575
+ border-radius: var(--lily-radius-md);
576
+ cursor: pointer;
577
+ user-select: none; /* prevent text drag-select on double-click */
578
+ text-decoration: none;
579
+ transition:
580
+ background-color 120ms ease,
581
+ color 120ms ease,
582
+ border-color 120ms ease;
583
+ }
584
+
585
+ /* Hover — shift to the secondary token for a subtle change of state. */
586
+ :where(.button, [class$="-button"]):hover:not(:disabled):not(
587
+ [aria-disabled="true"]
588
+ ) {
589
+ background-color: var(--color-secondary);
590
+ color: var(--color-secondary-content);
591
+ }
592
+
593
+ /* Disabled — half opacity, not-allowed cursor. */
594
+ :where(.button, [class$="-button"]):disabled,
595
+ :where(.button, [class$="-button"])[aria-disabled="true"] {
596
+ opacity: 0.5;
597
+ cursor: not-allowed;
598
+ }
599
+
600
+ /* Pressed (toggle/switch active state) — re-use the secondary colour. */
601
+ :where(.button, [class$="-button"])[aria-pressed="true"] {
602
+ background-color: var(--color-secondary);
603
+ color: var(--color-secondary-content);
604
+ }
605
+
606
+ /* --- Button variants ---------------------------------------------------- */
607
+
608
+ /* Icon button — square; aspect-ratio keeps it from squashing when the
609
+ icon font changes size. */
610
+ :where(.icon-button) {
611
+ padding: 0.5rem;
612
+ min-width: 2.5rem;
613
+ aspect-ratio: 1;
614
+ }
615
+
616
+ /* Floating action button — pinned to the bottom-right of the viewport.
617
+ Uses logical inset properties so it flips correctly under RTL. */
618
+ :where(.float-button) {
619
+ position: fixed;
620
+ inset-block-end: 1rem;
621
+ inset-inline-end: 1rem;
622
+ box-shadow: var(--lily-shadow-lg);
623
+ border-radius: 999px;
624
+ width: 3.5rem;
625
+ height: 3.5rem;
626
+ padding: 0;
627
+ }
628
+
629
+ /* Split button — extra padding-end for the dropdown caret. */
630
+ :where(.split-button) {
631
+ padding-inline-end: 0.5rem;
632
+ }
633
+
634
+ /* Download button — stacks the action label over a hint (filesize, etc.). */
635
+ :where(.download-button) {
636
+ flex-direction: column;
637
+ align-items: flex-start;
638
+ text-align: start;
639
+ }
640
+
641
+ /* Clipboard-copy — muted style because it's auxiliary, not primary. */
642
+ :where(.clipboard-copy-button) {
643
+ background-color: var(--lily-surface-alt);
644
+ color: var(--lily-text);
645
+ border-color: var(--lily-border-strong);
646
+ }
647
+
648
+ /* Switch button — iOS-style toggle pill. The track is the sunken
649
+ surface; the thumb is drawn by the consumer (or via ::before in
650
+ higher-specificity overrides). */
651
+ :where(.switch-button) {
652
+ position: relative;
653
+ width: 2.75rem;
654
+ min-width: 2.75rem;
655
+ height: 1.5rem;
656
+ min-height: 1.5rem;
657
+ padding: 0;
658
+ background-color: var(--lily-surface-sunken);
659
+ border-radius: 999px;
660
+ }
661
+ :where(
662
+ .switch-button[aria-pressed="true"],
663
+ .switch-button[aria-checked="true"]
664
+ ) {
665
+ background-color: var(--color-primary);
666
+ }
667
+
668
+ /* Toggle button — when un-pressed, render as a muted secondary chip. */
669
+ :where(.toggle-button[aria-pressed="false"]) {
670
+ background-color: var(--lily-surface-alt);
671
+ color: var(--lily-text);
672
+ border-color: var(--lily-border-strong);
673
+ }
674
+
675
+ /* Link-style "button" — for back/skip/go-to controls that look like
676
+ text links but use the button machinery for keyboard semantics. */
677
+ :where(
678
+ .back-link,
679
+ .skip-link,
680
+ .go-to-top,
681
+ .go-to-next-section,
682
+ .go-to-previous-section
683
+ ) {
684
+ background-color: transparent;
685
+ color: var(--color-primary);
686
+ border-color: transparent;
687
+ text-decoration: underline;
688
+ text-underline-offset: 0.2em;
689
+ }
690
+
691
+ /* Skip-link — visually hidden off-screen until focused, then snaps to the
692
+ top-left of the page. Required pattern for keyboard accessibility
693
+ (WCAG 2.4.1 bypass blocks). */
694
+ :where(.skip-link) {
695
+ position: absolute;
696
+ top: -3rem;
697
+ left: 0.5rem;
698
+ padding: 0.5rem 1rem;
699
+ background-color: var(--color-primary);
700
+ color: var(--color-primary-content);
701
+ text-decoration: none;
702
+ border-radius: var(--lily-radius-md);
703
+ z-index: 9999;
704
+ }
705
+ :where(.skip-link:focus) {
706
+ top: 0.5rem;
707
+ }
708
+
709
+ /* Button group — horizontal cluster of related actions. */
710
+ :where(.button-group) {
711
+ display: inline-flex;
712
+ gap: 0.25rem;
713
+ }
714
+
715
+ /* --- Bars of buttons (action / menu / tab / task / tool) ---------------- */
716
+
717
+ :where(.action-bar, .menu-bar, .tab-bar, .task-bar, .tool-bar) {
718
+ display: flex;
719
+ align-items: center;
720
+ gap: 0.25rem;
721
+ padding: 0.5rem;
722
+ background-color: var(--lily-surface-alt);
723
+ border: var(--border) solid var(--lily-border);
724
+ border-radius: var(--lily-radius-md);
725
+ }
726
+ /* Children of bars render flush with the bar — transparent background,
727
+ no border, so the bar's surface acts as the visual frame. */
728
+ :where(
729
+ .action-bar-button,
730
+ .menu-bar-button,
731
+ .tab-bar-button,
732
+ .task-bar-button,
733
+ .tool-bar-button
734
+ ) {
735
+ background-color: transparent;
736
+ color: var(--lily-text);
737
+ border-color: transparent;
738
+ }
739
+ /* Selected tab — explicit primary colour. */
740
+ :where(.tab-bar-button[aria-selected="true"]) {
741
+ background-color: var(--color-primary);
742
+ color: var(--color-primary-content);
743
+ }
744
+ /* Panel revealed by the active tab. */
745
+ :where(.tab-panel) {
746
+ padding: 1rem;
747
+ background-color: var(--lily-surface);
748
+ border: var(--border) solid var(--lily-border);
749
+ border-radius: var(--lily-radius-md);
750
+ }
751
+
752
+ /* ==========================================================================
753
+ * Links, anchors, link-like
754
+ * --------------------------------------------------------------------------
755
+ * Generic `-link` styling — primary-coloured underlined text. The
756
+ * exclusions (`skip-link`, `back-link`) are styled as buttons above.
757
+ * ====================================================================== */
758
+
759
+ :where([class$="-link"]:not(.skip-link):not(.back-link)) {
760
+ color: var(--color-primary);
761
+ text-decoration: underline;
762
+ text-underline-offset: 0.15em;
763
+ }
764
+ /* Hover — thicker underline for a subtle affordance cue. */
765
+ :where([class$="-link"]):hover {
766
+ text-decoration-thickness: 2px;
767
+ }
768
+ /* Visited — secondary token. */
769
+ :where([class$="-link"]):visited {
770
+ color: var(--color-secondary);
771
+ }
772
+
773
+ /* ==========================================================================
774
+ * Lists & list items
775
+ * --------------------------------------------------------------------------
776
+ * Lily wraps `<ol>` / `<ul>` in role-specific classes (CheckList, DoList,
777
+ * etc.). The baseline kills the default browser bullet styling and zeroes
778
+ * margins so consumers can compose lists inside other components.
779
+ * ====================================================================== */
780
+
781
+ /* Baseline — kill bullets and the indent gutter on every list class. */
782
+ :where(
783
+ .accordion-list,
784
+ .breadcrumb-list,
785
+ .chat-list,
786
+ .check-list,
787
+ .collection-list,
788
+ .contents-list,
789
+ .description-list,
790
+ .document-list,
791
+ .do-list,
792
+ .dont-list,
793
+ .icon-list,
794
+ .pagination-list,
795
+ .section-list,
796
+ .step-list,
797
+ .summary-list,
798
+ .task-list,
799
+ .timeline-list,
800
+ .tour-list,
801
+ .tree-list,
802
+ .validation-list
803
+ ) {
804
+ list-style: none;
805
+ margin: 0;
806
+ padding: 0;
807
+ }
808
+
809
+ /* Baseline — every list-item gets a thin hairline rule between rows. */
810
+ :where(
811
+ .accordion-list-item,
812
+ .breadcrumb-list-item,
813
+ .chat-list-item,
814
+ .check-list-item,
815
+ .collection-list-item,
816
+ .contents-list-item,
817
+ .description-list-item,
818
+ .document-list-item,
819
+ .do-list-item,
820
+ .dont-list-item,
821
+ .icon-list-item,
822
+ .pagination-list-item,
823
+ .section-list-item,
824
+ .step-list-item,
825
+ .summary-list-item,
826
+ .task-list-item,
827
+ .timeline-list-item,
828
+ .tour-list-item,
829
+ .tree-list-item,
830
+ .validation-list-item
831
+ ) {
832
+ padding: 0.5rem 0;
833
+ border-bottom: var(--border) solid var(--lily-border);
834
+ }
835
+
836
+ /* --- Breadcrumb --------------------------------------------------------- */
837
+ /* Horizontal list separated by a "/" pseudo-element between items. */
838
+ :where(.breadcrumb-list) {
839
+ display: flex;
840
+ flex-wrap: wrap;
841
+ gap: 0.5rem;
842
+ align-items: center;
843
+ }
844
+ :where(.breadcrumb-list-item) {
845
+ border: 0; /* override the generic list-item bottom-border */
846
+ padding: 0;
847
+ display: inline-flex;
848
+ align-items: center;
849
+ }
850
+ /* Slash separator generated between adjacent items, not before the first. */
851
+ :where(.breadcrumb-list-item + .breadcrumb-list-item)::before {
852
+ content: "/";
853
+ margin-inline-end: 0.5rem;
854
+ color: var(--lily-text-muted);
855
+ }
856
+ /* Final crumb (the current page) — muted because it isn't a link. */
857
+ :where(.breadcrumb-list-item[aria-current="page"]) {
858
+ color: var(--lily-text-muted);
859
+ }
860
+
861
+ /* --- Pagination --------------------------------------------------------- */
862
+ :where(.pagination-list) {
863
+ display: flex;
864
+ flex-wrap: wrap;
865
+ gap: 0.25rem;
866
+ align-items: center;
867
+ }
868
+ :where(.pagination-list-item) {
869
+ border: 0;
870
+ padding: 0;
871
+ }
872
+ /* Pagination link — square-ish chip with a generous tap target. */
873
+ :where(.pagination-link) {
874
+ display: inline-flex;
875
+ align-items: center;
876
+ justify-content: center;
877
+ min-width: 2.5rem;
878
+ padding: 0.5rem 0.75rem;
879
+ border-radius: var(--lily-radius-md);
880
+ text-decoration: none;
881
+ }
882
+ /* Current page — filled with the primary brand colour. */
883
+ :where(.pagination-link[aria-current="page"]) {
884
+ background-color: var(--color-primary);
885
+ color: var(--color-primary-content);
886
+ }
887
+
888
+ /* --- Marker glyphs ------------------------------------------------------ */
889
+ /* Check / do — green ✓; dont — red ✗. The `::marker` pseudo-element
890
+ only works on list-items with the default list-style display, so the
891
+ generic baseline above intentionally kept that. */
892
+ :where(.check-list-item)::marker {
893
+ content: "✓ ";
894
+ color: var(--color-success);
895
+ }
896
+ :where(.do-list-item)::marker {
897
+ content: "✓ ";
898
+ color: var(--color-success);
899
+ }
900
+ :where(.dont-list-item)::marker {
901
+ content: "✗ ";
902
+ color: var(--color-error);
903
+ }
904
+
905
+ /* --- Tree --------------------------------------------------------------- */
906
+ /* Nested tree lists indent their children. */
907
+ :where(.tree-list .tree-list) {
908
+ padding-inline-start: 1.25rem;
909
+ }
910
+ :where(.tree-list-item) {
911
+ border: 0;
912
+ }
913
+
914
+ /* --- Step list ---------------------------------------------------------- */
915
+ /* CSS counter draws the step number in a circular badge. */
916
+ :where(.step-list) {
917
+ counter-reset: lily-step;
918
+ }
919
+ :where(.step-list-item) {
920
+ counter-increment: lily-step;
921
+ display: flex;
922
+ align-items: flex-start;
923
+ gap: 0.75rem;
924
+ }
925
+ :where(.step-list-item)::before {
926
+ content: counter(lily-step);
927
+ flex: 0 0 auto;
928
+ display: inline-flex;
929
+ align-items: center;
930
+ justify-content: center;
931
+ width: 1.75rem;
932
+ height: 1.75rem;
933
+ border-radius: 50%;
934
+ background-color: var(--lily-surface-sunken);
935
+ color: var(--lily-text);
936
+ font-weight: 600;
937
+ }
938
+ /* Step status variants — colour-coded badge fill. */
939
+ :where(.step-list-item[data-status="finished"])::before {
940
+ background-color: var(--color-success);
941
+ color: var(--color-success-content);
942
+ }
943
+ :where(.step-list-item[data-status="in-progress"])::before {
944
+ background-color: var(--color-primary);
945
+ color: var(--color-primary-content);
946
+ }
947
+ :where(.step-list-item[data-status="error"])::before {
948
+ background-color: var(--color-error);
949
+ color: var(--color-error-content);
950
+ }
951
+
952
+ /* --- Task list ---------------------------------------------------------- */
953
+ /* Flex row so the checkbox aligns with its label. */
954
+ :where(.task-list-item) {
955
+ display: flex;
956
+ align-items: center;
957
+ gap: 0.5rem;
958
+ }
959
+
960
+ /* --- Timeline ----------------------------------------------------------- */
961
+ /* Vertical rule down the left, with a dot per event. */
962
+ :where(.timeline-list-item) {
963
+ position: relative;
964
+ padding-inline-start: 1.5rem;
965
+ border-left: var(--border) solid var(--lily-border-strong);
966
+ margin-inline-start: 0.5rem;
967
+ }
968
+ :where(.timeline-list-item)::before {
969
+ content: "";
970
+ position: absolute;
971
+ inset-inline-start: -0.4rem;
972
+ inset-block-start: 0.65rem;
973
+ width: 0.7rem;
974
+ height: 0.7rem;
975
+ border-radius: 50%;
976
+ background-color: var(--color-primary);
977
+ }
978
+
979
+ /* --- Validation list — pass / fail / pending status colours ------------ */
980
+ :where(.validation-list-item[data-status="passed"]) {
981
+ color: var(--color-success);
982
+ }
983
+ :where(.validation-list-item[data-status="failed"]) {
984
+ color: var(--color-error);
985
+ }
986
+ :where(.validation-list-item[data-status="pending"]) {
987
+ color: var(--lily-text-muted);
988
+ }
989
+
990
+ /* --- Description list (semantic <dl>) ----------------------------------- */
991
+ /* Two-column grid: term in the left column, description in the right. */
992
+ :where(.description-list) {
993
+ display: grid;
994
+ grid-template-columns: minmax(min-content, max-content) 1fr;
995
+ column-gap: 1rem;
996
+ row-gap: 0.5rem;
997
+ }
998
+ /* `display: contents` lets the dt/dd children participate directly in
999
+ the parent grid without an intermediate row wrapper. */
1000
+ :where(.description-list-item) {
1001
+ display: contents;
1002
+ border: 0;
1003
+ }
1004
+ :where(.description-list dt) {
1005
+ font-weight: 600;
1006
+ }
1007
+
1008
+ /* --- Summary list (three-column key/value/action grid) ------------------ */
1009
+ :where(.summary-list) {
1010
+ display: grid;
1011
+ grid-template-columns: minmax(0, max-content) 1fr auto;
1012
+ column-gap: 1rem;
1013
+ row-gap: 0.5rem;
1014
+ }
1015
+ :where(.summary-list-item) {
1016
+ display: contents;
1017
+ border: 0;
1018
+ }
1019
+
1020
+ /* --- Icon / collection / document lists — flex rows with leading icon -- */
1021
+ :where(.icon-list-item, .collection-list-item, .document-list-item) {
1022
+ display: flex;
1023
+ align-items: flex-start;
1024
+ gap: 0.75rem;
1025
+ }
1026
+
1027
+ /* --- Navs --------------------------------------------------------------- */
1028
+ /* Nav wrappers are layout-neutral by default — the inner list handles
1029
+ layout, the nav just provides the landmark semantics. */
1030
+ :where(
1031
+ .accordion-nav,
1032
+ .breadcrumb-nav,
1033
+ .chat-nav,
1034
+ .contents-nav,
1035
+ .pagination-nav,
1036
+ .section-nav,
1037
+ .tree-nav,
1038
+ .navigation-menu
1039
+ ) {
1040
+ display: block;
1041
+ padding: 0;
1042
+ }
1043
+
1044
+ /* ==========================================================================
1045
+ * Tables (plain, data, calendar, kanban, gantt)
1046
+ * --------------------------------------------------------------------------
1047
+ * Every Lily table variant shares the same baseline: full-width, collapsed
1048
+ * borders, body font. Variants override below for specialised behaviour
1049
+ * (kanban columns, gantt bars, calendar selection).
1050
+ * ====================================================================== */
1051
+
1052
+ :where(.table, .data-table, .calendar-table, .kanban-table, .gantt-table) {
1053
+ width: 100%;
1054
+ border-collapse: collapse; /* shared edges between cells */
1055
+ background-color: var(--lily-surface);
1056
+ color: var(--lily-text);
1057
+ font-family: var(--lily-font-body);
1058
+ }
1059
+
1060
+ /* Thead gets the alt surface so it visually anchors above the body. */
1061
+ :where(
1062
+ .table-head,
1063
+ .data-table-head,
1064
+ .calendar-table-head,
1065
+ .kanban-table-head,
1066
+ .gantt-table-thead
1067
+ ) {
1068
+ background-color: var(--lily-surface-alt);
1069
+ }
1070
+
1071
+ /* Header cells — bold, slightly tighter padding, with a 2px under-rule. */
1072
+ :where(
1073
+ .table-th,
1074
+ .data-table-th,
1075
+ .calendar-table-th,
1076
+ .kanban-table-th,
1077
+ .gantt-table-th
1078
+ ) {
1079
+ padding: 0.625rem 0.75rem;
1080
+ text-align: start;
1081
+ font-weight: 600;
1082
+ border-bottom: 2px solid var(--lily-border-strong);
1083
+ }
1084
+
1085
+ /* Body cells — top-aligned (multi-line content reads better when the
1086
+ baseline is at the top, not centred). */
1087
+ :where(
1088
+ .table-td,
1089
+ .data-table-td,
1090
+ .calendar-table-td,
1091
+ .kanban-table-td,
1092
+ .gantt-table-td
1093
+ ) {
1094
+ padding: 0.625rem 0.75rem;
1095
+ border-bottom: var(--border) solid var(--lily-border);
1096
+ vertical-align: top;
1097
+ }
1098
+
1099
+ /* Row hover — subtle highlight for scanning long tables. */
1100
+ :where(
1101
+ .table-row,
1102
+ .data-table-row,
1103
+ .calendar-table-row,
1104
+ .kanban-table-row,
1105
+ .gantt-table-tr
1106
+ ):hover {
1107
+ background-color: var(--lily-surface-alt);
1108
+ }
1109
+
1110
+ /* Data-table filter form — chips that sit above the table. */
1111
+ :where(.data-filter-form) {
1112
+ display: flex;
1113
+ flex-wrap: wrap;
1114
+ gap: 0.75rem;
1115
+ padding: 1rem;
1116
+ background-color: var(--lily-surface-alt);
1117
+ border-radius: var(--lily-radius-md);
1118
+ }
1119
+
1120
+ /* --- Calendar specifics ------------------------------------------------- */
1121
+ /* Selected date — filled with the primary brand colour. */
1122
+ :where(.calendar-table-td[aria-selected="true"]) {
1123
+ background-color: var(--color-primary);
1124
+ color: var(--color-primary-content);
1125
+ }
1126
+ /* Today — outlined rather than filled, so a selected non-today date
1127
+ still reads as the "selected" one. */
1128
+ :where(.calendar-table-td[aria-current="date"]) {
1129
+ outline: 2px solid var(--color-primary);
1130
+ outline-offset: -2px;
1131
+ }
1132
+
1133
+ /* --- Kanban specifics --------------------------------------------------- */
1134
+ /* Each column renders as a `<td>`; widen the cells so cards have room. */
1135
+ :where(.kanban-table) {
1136
+ display: table;
1137
+ }
1138
+ :where(.kanban-table-td) {
1139
+ vertical-align: top;
1140
+ background-color: var(--lily-surface);
1141
+ min-width: 14rem;
1142
+ }
1143
+
1144
+ /* --- Gantt specifics ---------------------------------------------------- */
1145
+ /* Cells marked as bars are filled with the primary colour to render the
1146
+ schedule bar inline within the grid. */
1147
+ :where(.gantt-table-td[data-state="bar"]) {
1148
+ background-color: var(--color-primary);
1149
+ }
1150
+
1151
+ /* ==========================================================================
1152
+ * Cards, panels, surfaces
1153
+ * --------------------------------------------------------------------------
1154
+ * Family of generic content containers. Differ mostly in elevation
1155
+ * (shadow depth) and accent colour.
1156
+ * ====================================================================== */
1157
+
1158
+ :where(
1159
+ .card,
1160
+ .feature-card,
1161
+ .product-card,
1162
+ .care-card,
1163
+ .hover-card,
1164
+ .panel,
1165
+ .floating-panel,
1166
+ .success-panel
1167
+ ) {
1168
+ display: block;
1169
+ padding: 1rem;
1170
+ background-color: var(--lily-surface);
1171
+ color: var(--lily-text);
1172
+ border: var(--border) solid var(--lily-border);
1173
+ border-radius: var(--lily-radius-lg);
1174
+ box-shadow: var(--lily-shadow-sm);
1175
+ }
1176
+ /* Feature card — generous padding because it leads the page. */
1177
+ :where(.feature-card) {
1178
+ padding: 1.5rem;
1179
+ }
1180
+ /* Hover card — popover-like; lift it with the medium shadow. */
1181
+ :where(.hover-card) {
1182
+ box-shadow: var(--lily-shadow-md);
1183
+ }
1184
+ /* Floating panel — pinned overlay; largest shadow. */
1185
+ :where(.floating-panel) {
1186
+ box-shadow: var(--lily-shadow-lg);
1187
+ }
1188
+ /* Success panel — green border + faint green tint. */
1189
+ :where(.success-panel) {
1190
+ border-color: var(--color-success);
1191
+ background-color: color-mix(
1192
+ in oklch,
1193
+ var(--color-success) 8%,
1194
+ var(--lily-surface)
1195
+ );
1196
+ }
1197
+ /* Care card urgency variants — coloured left rail (urgent/non-urgent/
1198
+ primary). Pattern adapted from the NHS care-card guidance. */
1199
+ :where(.care-card[data-urgency="urgent"]) {
1200
+ border-color: var(--color-error);
1201
+ border-left-width: 0.375rem;
1202
+ }
1203
+ :where(.care-card[data-urgency="non-urgent"]) {
1204
+ border-color: var(--color-info);
1205
+ border-left-width: 0.375rem;
1206
+ }
1207
+ :where(.care-card[data-urgency="primary"]) {
1208
+ border-color: var(--color-primary);
1209
+ border-left-width: 0.375rem;
1210
+ }
1211
+
1212
+ /* ==========================================================================
1213
+ * Banners, alerts, callouts, notifications
1214
+ * --------------------------------------------------------------------------
1215
+ * Family of messages with a coloured left rail. The rail colour is set
1216
+ * per severity so the message reads at a glance.
1217
+ * ====================================================================== */
1218
+
1219
+ /* Baseline — alert/banner/callout/notification all share the same frame. */
1220
+ :where(
1221
+ .alert,
1222
+ .banner,
1223
+ .announcement-banner,
1224
+ .phase-banner,
1225
+ .government-banner,
1226
+ .medical-banner,
1227
+ .super-banner,
1228
+ .information-callout,
1229
+ .warning-callout,
1230
+ .summary-box,
1231
+ .notification,
1232
+ .toast,
1233
+ .sonner
1234
+ ) {
1235
+ display: flex;
1236
+ align-items: flex-start;
1237
+ gap: 0.75rem;
1238
+ padding: 1rem;
1239
+ background-color: var(--lily-surface-alt);
1240
+ color: var(--lily-text);
1241
+ border: var(--border) solid var(--lily-border);
1242
+ border-inline-start-width: 0.375rem; /* the coloured rail */
1243
+ border-radius: var(--lily-radius-md);
1244
+ }
1245
+
1246
+ /* Severity variants — rail + faint background tint. */
1247
+ :where(
1248
+ .alert[data-severity="info"],
1249
+ .information-callout,
1250
+ .announcement-banner
1251
+ ) {
1252
+ border-inline-start-color: var(--color-info);
1253
+ background-color: color-mix(
1254
+ in oklch,
1255
+ var(--color-info) 8%,
1256
+ var(--lily-surface)
1257
+ );
1258
+ }
1259
+ :where(.alert[data-severity="success"]) {
1260
+ border-inline-start-color: var(--color-success);
1261
+ background-color: color-mix(
1262
+ in oklch,
1263
+ var(--color-success) 8%,
1264
+ var(--lily-surface)
1265
+ );
1266
+ }
1267
+ :where(.alert[data-severity="warning"], .warning-callout, .phase-banner) {
1268
+ border-inline-start-color: var(--color-warning);
1269
+ background-color: color-mix(
1270
+ in oklch,
1271
+ var(--color-warning) 12%,
1272
+ var(--lily-surface)
1273
+ );
1274
+ }
1275
+ :where(
1276
+ .alert[data-severity="error"],
1277
+ .error-message,
1278
+ .error-summary,
1279
+ .super-banner
1280
+ ) {
1281
+ border-inline-start-color: var(--color-error);
1282
+ background-color: color-mix(
1283
+ in oklch,
1284
+ var(--color-error) 8%,
1285
+ var(--lily-surface)
1286
+ );
1287
+ }
1288
+ /* Medical banner — primary brand colour. */
1289
+ :where(.medical-banner) {
1290
+ border-inline-start-color: var(--color-primary);
1291
+ }
1292
+ /* Medical banner inner boxes — danger / advice variants. */
1293
+ :where(.medical-banner-box-for-danger) {
1294
+ border-color: var(--color-error);
1295
+ background-color: color-mix(
1296
+ in oklch,
1297
+ var(--color-error) 8%,
1298
+ var(--lily-surface)
1299
+ );
1300
+ }
1301
+ :where(.medical-banner-box-for-advice) {
1302
+ border-color: var(--color-info);
1303
+ background-color: color-mix(
1304
+ in oklch,
1305
+ var(--color-info) 8%,
1306
+ var(--lily-surface)
1307
+ );
1308
+ }
1309
+ /* Government banner — solid neutral surface (US-government / GOV.UK
1310
+ style: a chrome bar at the top of the page identifying the site
1311
+ as an official property). No coloured rail. */
1312
+ :where(.government-banner) {
1313
+ background-color: var(--color-neutral);
1314
+ color: var(--color-neutral-content);
1315
+ border-color: transparent;
1316
+ border-inline-start-color: transparent;
1317
+ }
1318
+ /* Summary box — primary-coloured rail; used for "answer at a glance"
1319
+ callouts on long forms (e.g. cost summary). */
1320
+ :where(.summary-box) {
1321
+ border-color: var(--color-primary);
1322
+ border-inline-start-width: 0.375rem;
1323
+ }
1324
+
1325
+ /* Banner boxes — chrome strip variants used inside header areas. */
1326
+ :where(.banner-box, .medical-banner-box) {
1327
+ display: flex;
1328
+ align-items: center;
1329
+ gap: 0.75rem;
1330
+ padding: 0.75rem 1rem;
1331
+ }
1332
+
1333
+ /* Sticky promo — sits at the very top of the viewport on scroll. */
1334
+ :where(.sticky-promo-banner) {
1335
+ position: sticky;
1336
+ inset-block-start: 0;
1337
+ z-index: 10;
1338
+ }
1339
+
1340
+ /* Error message — inline form-validation message. */
1341
+ :where(.error-message) {
1342
+ color: var(--color-error);
1343
+ font-weight: 600;
1344
+ }
1345
+ /* Error summary — heavyweight 4px border (GOV.UK pattern) so users
1346
+ scrolling back to the top of a form see it immediately. */
1347
+ :where(.error-summary) {
1348
+ padding: 1rem;
1349
+ border: 0.25rem solid var(--color-error);
1350
+ }
1351
+
1352
+ /* Toast / Sonner — floating notifications; medium elevation. */
1353
+ :where(.toast, .sonner) {
1354
+ box-shadow: var(--lily-shadow-md);
1355
+ }
1356
+ /* In-page notification — small elevation. */
1357
+ :where(.notification) {
1358
+ box-shadow: var(--lily-shadow-sm);
1359
+ }
1360
+
1361
+ /* ==========================================================================
1362
+ * Forms
1363
+ * --------------------------------------------------------------------------
1364
+ * Form / field / fieldset layout primitives. Stack vertically with a
1365
+ * consistent gap so consumer markup stays brief.
1366
+ * ====================================================================== */
1367
+
1368
+ :where(.form, .editable-form) {
1369
+ display: flex;
1370
+ flex-direction: column;
1371
+ gap: 1rem;
1372
+ }
1373
+ /* Field — wraps a single label + input + hint/error trio. */
1374
+ :where(.field) {
1375
+ display: flex;
1376
+ flex-direction: column;
1377
+ gap: 0.375rem;
1378
+ }
1379
+ /* Fieldset — semantic <fieldset>; border + padded inset, legend bold. */
1380
+ :where(.fieldset) {
1381
+ border: var(--border) solid var(--lily-border);
1382
+ border-radius: var(--lily-radius-md);
1383
+ padding: 1rem;
1384
+ }
1385
+ :where(.fieldset > legend) {
1386
+ padding-inline: 0.5rem;
1387
+ font-weight: 600;
1388
+ }
1389
+ /* Label — bold and dark; consumers can override per-form. */
1390
+ :where(.label) {
1391
+ font-weight: 600;
1392
+ color: var(--lily-text);
1393
+ }
1394
+ /* Hint — small muted helptext under the input. */
1395
+ :where(.hint) {
1396
+ color: var(--lily-text-muted);
1397
+ font-size: 0.875rem;
1398
+ }
1399
+ /* Character counter — same colour/size as hint but right-aligned. */
1400
+ :where(.character-counter) {
1401
+ color: var(--lily-text-muted);
1402
+ font-size: 0.875rem;
1403
+ text-align: end;
1404
+ }
1405
+
1406
+ /* ==========================================================================
1407
+ * Layout & containers
1408
+ * ====================================================================== */
1409
+
1410
+ /* Page-width containers. */
1411
+ :where(
1412
+ .container,
1413
+ .container-with-fixed-width,
1414
+ .container-with-fluid-width
1415
+ ) {
1416
+ display: block;
1417
+ width: 100%;
1418
+ margin-inline: auto;
1419
+ padding-inline: 1rem;
1420
+ box-sizing: border-box;
1421
+ }
1422
+ /* Fixed-width — caps at a comfortable reading width (~1152px). */
1423
+ :where(.container-with-fixed-width) {
1424
+ max-width: 72rem;
1425
+ }
1426
+ /* Fluid-width — fills the viewport edge-to-edge. */
1427
+ :where(.container-with-fluid-width) {
1428
+ max-width: none;
1429
+ }
1430
+ /* Reset the inline padding when a container should butt against the edge. */
1431
+ :where(.padding-reset) {
1432
+ padding-inline: 0;
1433
+ }
1434
+
1435
+ /* Flex / grid / masonry primitives. */
1436
+ :where(.flex-stack) {
1437
+ display: flex;
1438
+ flex-direction: column;
1439
+ gap: 1rem;
1440
+ }
1441
+ :where(.grid) {
1442
+ display: grid;
1443
+ gap: 1rem;
1444
+ }
1445
+ :where(.masonry) {
1446
+ column-count: 3;
1447
+ column-gap: 1rem;
1448
+ }
1449
+ /* Horizontal-rule replacement that respects theme borders. */
1450
+ :where(.separator) {
1451
+ border: 0;
1452
+ border-top: var(--border) solid var(--lily-border);
1453
+ margin: 1rem 0;
1454
+ }
1455
+ /* Generic content tile. */
1456
+ :where(.tile) {
1457
+ display: block;
1458
+ padding: 1rem;
1459
+ background-color: var(--lily-surface);
1460
+ border: var(--border) solid var(--lily-border);
1461
+ border-radius: var(--lily-radius-md);
1462
+ }
1463
+ /* Sidebar — secondary-surface panel; sits beside main content. */
1464
+ :where(.sidebar) {
1465
+ display: block;
1466
+ background-color: var(--lily-surface-alt);
1467
+ padding: 1rem;
1468
+ border-radius: var(--lily-radius-md);
1469
+ }
1470
+ /* Aspect-ratio box — 16:9 default; consumers override `aspect-ratio`. */
1471
+ :where(.aspect-ratio-container) {
1472
+ position: relative;
1473
+ display: block;
1474
+ aspect-ratio: 16 / 9;
1475
+ overflow: hidden;
1476
+ border-radius: var(--lily-radius-md);
1477
+ }
1478
+ /* Framer — bordered box for embeds / illustrations. */
1479
+ :where(.framer) {
1480
+ padding: 1rem;
1481
+ border: var(--border) solid var(--lily-border);
1482
+ border-radius: var(--lily-radius-md);
1483
+ }
1484
+ /* Article-layout — declares column-width tokens that content-block reads.
1485
+ Pattern lifted from the Reuters Graphics components system. */
1486
+ :where(.article-layout) {
1487
+ --content-width-narrower: 20.625rem; /* 330px */
1488
+ --content-width-narrow: 31.875rem; /* 510px */
1489
+ --content-width-normal: 41.25rem; /* 660px (default reading width) */
1490
+ --content-width-wide: 58.125rem; /* 930px (chart escape) */
1491
+ --content-width-wider: 75rem; /* 1200px (full-bleed escape) */
1492
+ display: block;
1493
+ }
1494
+ /* Content-block — reads the column-width tokens; switch via data-width. */
1495
+ :where(.content-block) {
1496
+ max-width: var(--content-width-normal);
1497
+ margin-inline: auto;
1498
+ padding-inline: 1rem;
1499
+ box-sizing: border-box;
1500
+ }
1501
+ :where(.content-block[data-width="narrower"]) {
1502
+ max-width: var(--content-width-narrower);
1503
+ }
1504
+ :where(.content-block[data-width="narrow"]) {
1505
+ max-width: var(--content-width-narrow);
1506
+ }
1507
+ :where(.content-block[data-width="wide"]) {
1508
+ max-width: var(--content-width-wide);
1509
+ }
1510
+ :where(.content-block[data-width="wider"]) {
1511
+ max-width: var(--content-width-wider);
1512
+ }
1513
+
1514
+ /* --- Grail layout (5-region responsive page shell) --------------------- */
1515
+ /* Header spans the top; left-aside / main / right-aside fill the middle;
1516
+ footer spans the bottom. At ≤768px the asides drop below the main. */
1517
+ :where(.grail-layout) {
1518
+ display: grid;
1519
+ min-height: 100vh;
1520
+ grid-template-areas:
1521
+ "header header header"
1522
+ "left main right"
1523
+ "footer footer footer";
1524
+ grid-template-rows: auto 1fr auto;
1525
+ grid-template-columns: minmax(0, 1fr) minmax(0, 3fr) minmax(0, 1fr);
1526
+ background-color: var(--lily-surface);
1527
+ color: var(--lily-text);
1528
+ }
1529
+ :where(.grail-layout-top-header) {
1530
+ grid-area: header;
1531
+ }
1532
+ :where(.grail-layout-left-aside) {
1533
+ grid-area: left;
1534
+ }
1535
+ :where(.grail-layout-center-main) {
1536
+ grid-area: main;
1537
+ }
1538
+ :where(.grail-layout-right-aside) {
1539
+ grid-area: right;
1540
+ }
1541
+ :where(.grail-layout-bottom-footer) {
1542
+ grid-area: footer;
1543
+ }
1544
+ /* Header / footer chrome — secondary surface, padded. */
1545
+ :where(.grail-layout-top-header, .grail-layout-bottom-footer) {
1546
+ background-color: var(--lily-surface-alt);
1547
+ padding: 1rem;
1548
+ }
1549
+ /* Asides — secondary surface, padded. */
1550
+ :where(.grail-layout-left-aside, .grail-layout-right-aside) {
1551
+ padding: 1rem;
1552
+ background-color: var(--lily-surface-alt);
1553
+ }
1554
+ /* Main content area — primary surface, more generous padding. */
1555
+ :where(.grail-layout-center-main) {
1556
+ padding: 1.5rem;
1557
+ }
1558
+ /* Mobile breakpoint — collapse to a single column, stacking the regions. */
1559
+ @media (max-width: 48rem) {
1560
+ :where(.grail-layout) {
1561
+ grid-template-areas: "header" "main" "left" "right" "footer";
1562
+ grid-template-columns: 1fr;
1563
+ grid-template-rows: auto auto auto auto auto;
1564
+ }
1565
+ }
1566
+
1567
+ /* Standalone semantic header / footer landmarks. */
1568
+ :where(.header) {
1569
+ display: block;
1570
+ padding: 1rem;
1571
+ background-color: var(--lily-surface);
1572
+ border-bottom: var(--border) solid var(--lily-border);
1573
+ }
1574
+ :where(.footer) {
1575
+ display: block;
1576
+ padding: 1rem;
1577
+ background-color: var(--lily-surface-alt);
1578
+ border-top: var(--border) solid var(--lily-border);
1579
+ }
1580
+
1581
+ /* ==========================================================================
1582
+ * Dialogs, popovers, overlays
1583
+ * --------------------------------------------------------------------------
1584
+ * Modal and floating UI. Backdrop is a blur + 50% black overlay; dialog
1585
+ * frames are rounded with the largest shadow.
1586
+ * ====================================================================== */
1587
+
1588
+ /* Native <dialog> + variant types. */
1589
+ :where(
1590
+ .dialog,
1591
+ .alert-dialog,
1592
+ .timeout-dialog,
1593
+ .popconfirm-dialog,
1594
+ .file-dialog
1595
+ ) {
1596
+ background-color: var(--lily-surface);
1597
+ color: var(--lily-text);
1598
+ border: var(--border) solid var(--lily-border);
1599
+ border-radius: var(--lily-radius-lg);
1600
+ padding: 1.5rem;
1601
+ box-shadow: var(--lily-shadow-lg);
1602
+ max-width: min(40rem, 90vw); /* cap on big screens, fit on small */
1603
+ }
1604
+ /* Backdrop — dim the page and blur slightly so focus stays on the dialog. */
1605
+ :where(
1606
+ .dialog::backdrop,
1607
+ .alert-dialog::backdrop,
1608
+ .timeout-dialog::backdrop,
1609
+ .popconfirm-dialog::backdrop,
1610
+ .file-dialog::backdrop
1611
+ ) {
1612
+ background-color: color-mix(in oklch, black 50%, transparent);
1613
+ backdrop-filter: blur(2px);
1614
+ }
1615
+ /* Alert dialog — red rail so the user knows it's destructive. */
1616
+ :where(.alert-dialog) {
1617
+ border-color: var(--color-error);
1618
+ border-inline-start-width: 0.375rem;
1619
+ }
1620
+
1621
+ /* Popover / tooltip family — small floating labels. */
1622
+ :where(.popover, .popup, .tooltip, .coachmark, .contextual-help) {
1623
+ display: block;
1624
+ padding: 0.5rem 0.75rem;
1625
+ background-color: var(--color-neutral);
1626
+ color: var(--color-neutral-content);
1627
+ border-radius: var(--lily-radius-md);
1628
+ box-shadow: var(--lily-shadow-md);
1629
+ font-size: 0.875rem;
1630
+ max-width: 20rem;
1631
+ }
1632
+ /* Popover / popup — surface-coloured (more substantial than a tooltip). */
1633
+ :where(.popover, .popup) {
1634
+ background-color: var(--lily-surface);
1635
+ color: var(--lily-text);
1636
+ border: var(--border) solid var(--lily-border);
1637
+ max-width: 24rem;
1638
+ }
1639
+ /* Coachmark — primary-coloured border so it reads as a tutorial hint. */
1640
+ :where(.coachmark) {
1641
+ border: 2px solid var(--color-primary);
1642
+ }
1643
+
1644
+ /* Full-page overlay container — dims everything beneath a high-z child. */
1645
+ :where(.overlay-container) {
1646
+ position: fixed;
1647
+ inset: 0;
1648
+ background-color: color-mix(in oklch, black 50%, transparent);
1649
+ z-index: 100;
1650
+ }
1651
+
1652
+ /* Drawers — side panels (right edge by default; RTL-aware via logical
1653
+ properties). Sit above the overlay container (z-index 101). */
1654
+ :where(.drawer, .slide-out-drawer, .sheet) {
1655
+ position: fixed;
1656
+ inset-block: 0;
1657
+ inset-inline-end: 0;
1658
+ width: min(28rem, 90vw);
1659
+ background-color: var(--lily-surface);
1660
+ color: var(--lily-text);
1661
+ border-inline-start: var(--border) solid var(--lily-border);
1662
+ box-shadow: var(--lily-shadow-lg);
1663
+ padding: 1rem;
1664
+ z-index: 101;
1665
+ }
1666
+
1667
+ /* ==========================================================================
1668
+ * Menus
1669
+ * ====================================================================== */
1670
+
1671
+ /* Menu containers — surface-coloured popover with thin border + sm shadow. */
1672
+ :where(.menu, .context-menu, .dropdown-menu, .tree-menu, .command) {
1673
+ display: block;
1674
+ background-color: var(--lily-surface);
1675
+ color: var(--lily-text);
1676
+ border: var(--border) solid var(--lily-border);
1677
+ border-radius: var(--lily-radius-md);
1678
+ padding: 0.25rem;
1679
+ box-shadow: var(--lily-shadow-sm);
1680
+ list-style: none;
1681
+ margin: 0;
1682
+ }
1683
+ /* Menu items — flex row with icon + label slot. */
1684
+ :where(.menu-item, .context-menu-item) {
1685
+ display: flex;
1686
+ align-items: center;
1687
+ gap: 0.5rem;
1688
+ padding: 0.5rem 0.75rem;
1689
+ border-radius: var(--lily-radius-md);
1690
+ cursor: pointer;
1691
+ }
1692
+ /* Highlight on hover / aria-selected — alt surface. */
1693
+ :where(
1694
+ .menu-item:hover,
1695
+ .context-menu-item:hover,
1696
+ .menu-item[aria-selected="true"]
1697
+ ) {
1698
+ background-color: var(--lily-surface-alt);
1699
+ }
1700
+ /* Menu group — section within a menu. The aria-label becomes a header. */
1701
+ :where(.menu-group) {
1702
+ padding: 0.25rem 0;
1703
+ }
1704
+ :where(.menu-group::before) {
1705
+ content: attr(aria-label);
1706
+ display: block;
1707
+ padding: 0.25rem 0.75rem;
1708
+ color: var(--lily-text-muted);
1709
+ font-size: 0.75rem;
1710
+ text-transform: uppercase;
1711
+ letter-spacing: 0.05em;
1712
+ }
1713
+ /* Cascader / navigation-menu — horizontal flex row of menu columns. */
1714
+ :where(.cascader, .navigation-menu) {
1715
+ display: flex;
1716
+ gap: 0.25rem;
1717
+ }
1718
+ /* Hamburger — bordered icon-button. */
1719
+ :where(.hamburger-menu) {
1720
+ display: inline-flex;
1721
+ align-items: center;
1722
+ justify-content: center;
1723
+ padding: 0.5rem;
1724
+ background: transparent;
1725
+ border: var(--border) solid var(--lily-border-strong);
1726
+ border-radius: var(--lily-radius-md);
1727
+ color: var(--lily-text);
1728
+ cursor: pointer;
1729
+ }
1730
+
1731
+ /* ==========================================================================
1732
+ * Segments, toggles, groups
1733
+ * ====================================================================== */
1734
+
1735
+ /* Generic group containers — inline-flex, wrap, small gap. */
1736
+ :where(
1737
+ .segment-group,
1738
+ .toggle-group,
1739
+ .checkbox-group,
1740
+ .radio-group,
1741
+ .dial-group,
1742
+ .tag-group,
1743
+ .avatar-group,
1744
+ .mutually-exclusive
1745
+ ) {
1746
+ display: inline-flex;
1747
+ gap: 0.25rem;
1748
+ flex-wrap: wrap;
1749
+ }
1750
+ /* Segment group / toggle group get an inset background (iOS-segmented
1751
+ control aesthetic). */
1752
+ :where(.segment-group, .toggle-group) {
1753
+ padding: 0.25rem;
1754
+ background-color: var(--lily-surface-alt);
1755
+ border-radius: var(--lily-radius-md);
1756
+ }
1757
+ /* Segment items — transparent until pressed; then primary fill. */
1758
+ :where(.segment-group-item) {
1759
+ padding: 0.375rem 0.75rem;
1760
+ background: transparent;
1761
+ border: 0;
1762
+ border-radius: var(--lily-radius-md);
1763
+ color: var(--lily-text);
1764
+ cursor: pointer;
1765
+ }
1766
+ :where(
1767
+ .segment-group-item[aria-pressed="true"],
1768
+ .segment-group-item[aria-selected="true"]
1769
+ ) {
1770
+ background-color: var(--color-primary);
1771
+ color: var(--color-primary-content);
1772
+ }
1773
+ /* Avatar group — overlap each subsequent avatar by 0.5rem, with a
1774
+ contrast ring for separation. */
1775
+ :where(.avatar-group > *) {
1776
+ margin-inline-start: -0.5rem;
1777
+ border: 2px solid var(--lily-surface);
1778
+ }
1779
+
1780
+ /* ==========================================================================
1781
+ * Progress, loading
1782
+ * ====================================================================== */
1783
+
1784
+ /* Native <progress> / <meter> / bar variant — short, pill-shaped track. */
1785
+ :where(.progress, .progress-bar, .meter) {
1786
+ display: block;
1787
+ width: 100%;
1788
+ height: 0.5rem;
1789
+ appearance: none;
1790
+ background-color: var(--lily-surface-sunken);
1791
+ border: 0;
1792
+ border-radius: 999px;
1793
+ overflow: hidden;
1794
+ }
1795
+ /* Vendor pseudo-elements: track + value. */
1796
+ :where(.progress::-webkit-progress-bar, .meter::-webkit-meter-bar) {
1797
+ background-color: var(--lily-surface-sunken);
1798
+ }
1799
+ :where(
1800
+ .progress::-webkit-progress-value,
1801
+ .meter::-webkit-meter-optimum-value
1802
+ ) {
1803
+ background-color: var(--color-primary);
1804
+ }
1805
+ :where(.progress::-moz-progress-bar) {
1806
+ background-color: var(--color-primary);
1807
+ }
1808
+
1809
+ /* Progress circle — conic-gradient renders the sweep based on the
1810
+ --progress custom property (0–100). */
1811
+ :where(.progress-circle) {
1812
+ display: inline-block;
1813
+ width: 2rem;
1814
+ height: 2rem;
1815
+ border-radius: 50%;
1816
+ background: conic-gradient(
1817
+ var(--color-primary) calc(var(--progress, 0) * 1%),
1818
+ var(--lily-surface-sunken) 0
1819
+ );
1820
+ }
1821
+ /* Spinner / loading — classic CSS rotating partial-ring. */
1822
+ :where(.progress-spinner, .loading) {
1823
+ display: inline-block;
1824
+ width: 1.5rem;
1825
+ height: 1.5rem;
1826
+ border: 3px solid var(--lily-surface-sunken);
1827
+ border-top-color: var(--color-primary);
1828
+ border-radius: 50%;
1829
+ animation: lily-spin 0.8s linear infinite;
1830
+ }
1831
+ @keyframes lily-spin {
1832
+ to {
1833
+ transform: rotate(360deg);
1834
+ }
1835
+ }
1836
+ /* Skeleton — shimmering placeholder while content is loading. */
1837
+ :where(.skeleton) {
1838
+ display: block;
1839
+ background: linear-gradient(
1840
+ 90deg,
1841
+ var(--lily-surface-alt) 0%,
1842
+ var(--lily-surface-sunken) 50%,
1843
+ var(--lily-surface-alt) 100%
1844
+ );
1845
+ background-size: 200% 100%;
1846
+ animation: lily-skeleton 1.4s ease-in-out infinite;
1847
+ border-radius: var(--lily-radius-md);
1848
+ min-height: 1rem;
1849
+ }
1850
+ @keyframes lily-skeleton {
1851
+ 0% {
1852
+ background-position: 200% 0;
1853
+ }
1854
+ 100% {
1855
+ background-position: -200% 0;
1856
+ }
1857
+ }
1858
+ /* Respect prefers-reduced-motion — kill the perpetual animations.
1859
+ (WCAG 2.3.3 Animation from interactions.) */
1860
+ @media (prefers-reduced-motion: reduce) {
1861
+ :where(.progress-spinner, .loading, .skeleton, .beach-ball) {
1862
+ animation: none;
1863
+ }
1864
+ }
1865
+
1866
+ /* ==========================================================================
1867
+ * Avatars, badges, tags, status
1868
+ * ====================================================================== */
1869
+
1870
+ /* Avatar — circular tile (2.5rem) with sunken background as the
1871
+ fallback colour when no image is provided. */
1872
+ :where(.avatar) {
1873
+ display: inline-flex;
1874
+ align-items: center;
1875
+ justify-content: center;
1876
+ width: 2.5rem;
1877
+ height: 2.5rem;
1878
+ border-radius: 50%;
1879
+ background-color: var(--lily-surface-sunken);
1880
+ color: var(--lily-text);
1881
+ overflow: hidden;
1882
+ font-weight: 600;
1883
+ }
1884
+ :where(.avatar-image) {
1885
+ width: 100%;
1886
+ height: 100%;
1887
+ object-fit: cover;
1888
+ display: block;
1889
+ }
1890
+ /* Avatar fallback text — uppercase initials. */
1891
+ :where(.avatar-text) {
1892
+ text-transform: uppercase;
1893
+ }
1894
+
1895
+ /* Badge / flair / tag family — small pill-shaped labels. */
1896
+ :where(.badge, .flair, .status-tag, .tag, .ai-label) {
1897
+ display: inline-flex;
1898
+ align-items: center;
1899
+ gap: 0.25rem;
1900
+ padding: 0.125rem 0.5rem;
1901
+ font-size: 0.75rem;
1902
+ font-weight: 600;
1903
+ line-height: 1.5;
1904
+ background-color: var(--color-neutral);
1905
+ color: var(--color-neutral-content);
1906
+ border-radius: 999px;
1907
+ }
1908
+ /* Tag — neutral chip with a visible border (so it's not confused with
1909
+ a status badge). */
1910
+ :where(.tag) {
1911
+ background-color: var(--lily-surface-alt);
1912
+ color: var(--lily-text);
1913
+ border: var(--border) solid var(--lily-border);
1914
+ }
1915
+ /* AI label — accent colour so AI-generated content is visually marked. */
1916
+ :where(.ai-label) {
1917
+ background-color: var(--color-accent);
1918
+ color: var(--color-accent-content);
1919
+ }
1920
+ /* Status tags — pre-baked colour for each status. */
1921
+ :where(.status-tag[data-status="success"]) {
1922
+ background-color: var(--color-success);
1923
+ color: var(--color-success-content);
1924
+ }
1925
+ :where(.status-tag[data-status="warning"]) {
1926
+ background-color: var(--color-warning);
1927
+ color: var(--color-warning-content);
1928
+ }
1929
+ :where(.status-tag[data-status="error"]) {
1930
+ background-color: var(--color-error);
1931
+ color: var(--color-error-content);
1932
+ }
1933
+ :where(.status-tag[data-status="info"]) {
1934
+ background-color: var(--color-info);
1935
+ color: var(--color-info-content);
1936
+ }
1937
+
1938
+ /* Status light — a coloured dot followed by a label. */
1939
+ :where(.status-light) {
1940
+ display: inline-flex;
1941
+ align-items: center;
1942
+ gap: 0.375rem;
1943
+ }
1944
+ :where(.status-light)::before {
1945
+ content: "";
1946
+ display: inline-block;
1947
+ width: 0.625rem;
1948
+ height: 0.625rem;
1949
+ border-radius: 50%;
1950
+ background-color: var(--color-neutral);
1951
+ }
1952
+ :where(.status-light[data-status="success"])::before {
1953
+ background-color: var(--color-success);
1954
+ }
1955
+ :where(.status-light[data-status="warning"])::before {
1956
+ background-color: var(--color-warning);
1957
+ }
1958
+ :where(.status-light[data-status="error"])::before {
1959
+ background-color: var(--color-error);
1960
+ }
1961
+ :where(.status-light[data-status="info"])::before {
1962
+ background-color: var(--color-info);
1963
+ }
1964
+
1965
+ /* ==========================================================================
1966
+ * Pickers, ratings, theme
1967
+ * ====================================================================== */
1968
+
1969
+ /* Picker baseline — inline row of selectable chips/buttons. */
1970
+ :where(
1971
+ .color-picker,
1972
+ .five-face-rating-picker,
1973
+ .five-star-rating-picker,
1974
+ .net-promoter-score-picker,
1975
+ .red-amber-green-picker,
1976
+ .red-orange-yellow-green-blue-picker,
1977
+ .emoji-character-picker,
1978
+ .calendar-range-picker
1979
+ ) {
1980
+ display: inline-flex;
1981
+ align-items: center;
1982
+ gap: 0.25rem;
1983
+ padding: 0.25rem;
1984
+ background-color: var(--lily-surface);
1985
+ border: var(--border) solid var(--lily-border);
1986
+ border-radius: var(--lily-radius-md);
1987
+ }
1988
+ /* Picker buttons — small alt-surface chips. */
1989
+ :where(
1990
+ .color-picker-button,
1991
+ .five-face-rating-picker-button,
1992
+ .five-star-rating-picker-button,
1993
+ .net-promoter-score-picker-button,
1994
+ .red-amber-green-picker-button,
1995
+ .red-orange-yellow-green-blue-picker-button
1996
+ ) {
1997
+ background-color: var(--lily-surface-alt);
1998
+ color: var(--lily-text);
1999
+ border: var(--border) solid var(--lily-border);
2000
+ min-width: 2rem;
2001
+ min-height: 2rem;
2002
+ padding: 0.25rem 0.5rem;
2003
+ }
2004
+ /* Color picker — circular swatch. */
2005
+ :where(.color-picker-button) {
2006
+ width: 1.75rem;
2007
+ height: 1.75rem;
2008
+ padding: 0;
2009
+ border-radius: 50%;
2010
+ }
2011
+ /* Filled stars — warning (gold) colour for both viewer and pressed state. */
2012
+ :where(
2013
+ .five-star-rating-view,
2014
+ .five-star-rating-picker-button[aria-pressed="true"]
2015
+ ) {
2016
+ color: var(--color-warning);
2017
+ }
2018
+ /* RAG (red/amber/green) — semantic colour per status. */
2019
+ :where(
2020
+ .red-amber-green-view[data-status="red"],
2021
+ .red-amber-green-picker-button[data-status="red"]
2022
+ ) {
2023
+ background-color: var(--color-error);
2024
+ color: var(--color-error-content);
2025
+ }
2026
+ :where(
2027
+ .red-amber-green-view[data-status="amber"],
2028
+ .red-amber-green-picker-button[data-status="amber"]
2029
+ ) {
2030
+ background-color: var(--color-warning);
2031
+ color: var(--color-warning-content);
2032
+ }
2033
+ :where(
2034
+ .red-amber-green-view[data-status="green"],
2035
+ .red-amber-green-picker-button[data-status="green"]
2036
+ ) {
2037
+ background-color: var(--color-success);
2038
+ color: var(--color-success-content);
2039
+ }
2040
+
2041
+ /* Native <select> styling — drop the UA chrome and draw our own caret
2042
+ via two stacked linear-gradients. */
2043
+ :where(select.theme-select, .select, .select-with-extras, .tree-select) {
2044
+ width: 100%;
2045
+ min-height: 2.5rem;
2046
+ padding: 0.5rem 2rem 0.5rem 0.75rem; /* extra right padding for caret */
2047
+ font: inherit;
2048
+ background-color: var(--lily-surface);
2049
+ color: var(--lily-text);
2050
+ border: var(--border) solid var(--lily-border-strong);
2051
+ border-radius: var(--lily-radius-md);
2052
+ appearance: none;
2053
+ background-image:
2054
+ linear-gradient(45deg, transparent 50%, var(--lily-text) 50%),
2055
+ linear-gradient(135deg, var(--lily-text) 50%, transparent 50%);
2056
+ background-position:
2057
+ calc(100% - 1.1rem) 1.1rem,
2058
+ calc(100% - 0.7rem) 1.1rem;
2059
+ background-size: 0.4rem 0.4rem;
2060
+ background-repeat: no-repeat;
2061
+ }
2062
+ /* Options inherit the select colours so the dropdown matches the input. */
2063
+ :where(.option, .theme-select-option) {
2064
+ background-color: var(--lily-surface);
2065
+ color: var(--lily-text);
2066
+ }
2067
+
2068
+ /* The four *-picker helpers are an icon button that opens a popup,
2069
+ so they are styled as a popup rather than a form field. No :has()
2070
+ guard is needed any more: before the July 2026 rename these shared
2071
+ the `.theme-select` hook with the catalog theme-select component
2072
+ and had to be told apart. Distinct names, no collision. */
2073
+ :where(
2074
+ .theme-picker,
2075
+ .locale-picker,
2076
+ .text-size-picker,
2077
+ .share-picker,
2078
+ .date-time-picker
2079
+ ) {
2080
+ position: relative;
2081
+ display: inline-block;
2082
+ }
2083
+
2084
+ :where(
2085
+ .theme-picker-button,
2086
+ .locale-picker-button,
2087
+ .text-size-picker-button,
2088
+ .share-picker-button,
2089
+ .date-time-picker-button
2090
+ ) {
2091
+ display: inline-flex;
2092
+ align-items: center;
2093
+ justify-content: center;
2094
+ min-width: 2.5rem;
2095
+ min-height: 2.5rem;
2096
+ padding: var(--lily-space-xs);
2097
+ font: inherit;
2098
+ line-height: 1;
2099
+ color: var(--lily-text);
2100
+ background-color: var(--lily-surface);
2101
+ border: var(--border) solid var(--lily-border-strong);
2102
+ border-radius: var(--lily-radius-md);
2103
+ cursor: pointer;
2104
+ }
2105
+
2106
+ /* The icon is decorative (aria-hidden); the button's aria-label
2107
+ carries the accessible name. Reversed 2026-09-16: five of the
2108
+ six picker icons (theme, locale, text-size, motion, share) are
2109
+ now bundled SVGs, not Unicode glyphs. Each ships its own
2110
+ explicit width="1.05rem" height="1.05rem" on the <svg> element,
2111
+ so unlike a font-dependent character glyph -- where different
2112
+ glyphs ink different fractions of their em box, needing a
2113
+ per-glyph optical correction -- every icon in this family
2114
+ already inks the same visual size by construction (the icon's
2115
+ own author controls its viewBox). This rule only supplies flex
2116
+ centering; override the icon's own width/height if you need a
2117
+ different size. */
2118
+ :where(
2119
+ .theme-picker-icon,
2120
+ .locale-picker-icon,
2121
+ .text-size-picker-icon,
2122
+ .motion-picker-icon,
2123
+ .share-picker-icon
2124
+ ) {
2125
+ display: inline-flex;
2126
+ align-items: center;
2127
+ justify-content: center;
2128
+ }
2129
+
2130
+ /* date-time-picker's calendar icon is still a Unicode glyph
2131
+ (U+1F4C5 + U+FE0E) -- out of scope for the 2026-09-16 SVG-icon
2132
+ reversal, since date-time-picker was not part of that change
2133
+ (see AGENTS/helpers.md) -- so it keeps the font-size-based
2134
+ sizing the other five used to share.
2135
+
2136
+ U+1F4C5 calendar inks 1.000 of its em box (max extent) against
2137
+ U+25D1 half-circle's reference 0.850 (the pre-reversal
2138
+ baseline, still valid here since this is the same glyph
2139
+ measurement, unchanged): 0.850/1.000 ≈ 0.85, shipped as 0.845.
2140
+ A colour-emoji font paints every one of its glyphs into one
2141
+ identical em square, so globe, calendar, rocket and heart all
2142
+ measure the same ink box -- any future emoji helper icon can
2143
+ reuse this factor without re-measuring.
2144
+
2145
+ (Measuring also confirms the U+FE0E text-presentation selector is
2146
+ ignored here: the bare and VS-15 forms are metrically identical. It
2147
+ stays in the source as a hint to the platforms that do honour it.) */
2148
+ :where(.date-time-picker-icon) {
2149
+ display: inline-flex;
2150
+ align-items: center;
2151
+ justify-content: center;
2152
+ font-size: calc(1.25em * var(--lily-picker-icon-scale, 1));
2153
+ line-height: 1;
2154
+ --lily-picker-icon-scale: 0.845;
2155
+ }
2156
+
2157
+ /* The share list holds real links and a button rather than options,
2158
+ so its items get the same padding without the option selectors. */
2159
+ :where(.share-picker-list) > :where(.share-picker-list-item) {
2160
+ list-style: none;
2161
+ }
2162
+
2163
+ :where(.share-picker-target, .share-picker-copy) {
2164
+ display: block;
2165
+ width: 100%;
2166
+ padding: var(--lily-space-xs) var(--lily-space-sm);
2167
+ font: inherit;
2168
+ text-align: start;
2169
+ color: var(--lily-text);
2170
+ background: none;
2171
+ border: 0;
2172
+ border-radius: var(--lily-radius-sm);
2173
+ cursor: pointer;
2174
+ }
2175
+
2176
+ :where(.share-picker-target:hover, .share-picker-copy:hover) {
2177
+ background-color: var(--lily-surface-alt);
2178
+ }
2179
+
2180
+ /* Copy feedback. Never display:none this — that silences the live
2181
+ region for screen-reader users. */
2182
+ :where(.share-picker-status) {
2183
+ margin: var(--lily-space-xs) 0 0;
2184
+ font-size: 0.875em;
2185
+ color: var(--lily-text-muted);
2186
+ }
2187
+
2188
+ /* The status paragraph is always rendered so the aria-live region
2189
+ exists before the first announcement (see above); empty, it still
2190
+ generates a line box and carries the margin-top set above, both of
2191
+ which push the button row out of alignment in a flex layout like
2192
+ picker-bar (found independently by two downstream consumers, each
2193
+ patching around it locally). :empty here matches a Svelte-rendered
2194
+ {status} of "" (a zero-length text node doesn't count as a child
2195
+ per the CSS spec), so this only applies while there is nothing to
2196
+ announce, and normal spacing returns the moment status has text. */
2197
+ :where(.share-picker-status:empty) {
2198
+ margin: 0;
2199
+ line-height: 0;
2200
+ }
2201
+
2202
+ :where(
2203
+ .theme-picker-list,
2204
+ .locale-picker-list,
2205
+ .text-size-picker-list,
2206
+ .share-picker-list
2207
+ ) {
2208
+ position: absolute;
2209
+ z-index: 10;
2210
+ inset-inline-start: 0;
2211
+ min-width: max-content;
2212
+ max-height: 60vh;
2213
+ margin-block-start: var(--lily-space-xs);
2214
+ padding: var(--lily-space-xs);
2215
+ overflow-y: auto;
2216
+ list-style: none;
2217
+ color: var(--lily-text);
2218
+ background-color: var(--lily-surface);
2219
+ border: var(--border) solid var(--lily-border-strong);
2220
+ border-radius: var(--lily-radius-md);
2221
+ box-shadow: var(--lily-shadow-md);
2222
+ }
2223
+
2224
+ /* Explicit, because the rules above would otherwise beat the UA
2225
+ stylesheet's [hidden] { display: none }. */
2226
+ :where(
2227
+ .theme-picker-list,
2228
+ .locale-picker-list,
2229
+ .text-size-picker-list,
2230
+ .share-picker-list
2231
+ )[hidden] {
2232
+ display: none;
2233
+ }
2234
+
2235
+ :where(.theme-picker-list, .locale-picker-list, .text-size-picker-list)
2236
+ > :where(
2237
+ .theme-picker-option,
2238
+ .locale-picker-option,
2239
+ .text-size-picker-option
2240
+ ) {
2241
+ padding: var(--lily-space-xs) var(--lily-space-sm);
2242
+ border-radius: var(--lily-radius-sm);
2243
+ cursor: pointer;
2244
+ }
2245
+
2246
+ /* data-active is the keyboard cursor (aria-activedescendant); focus
2247
+ stays on the listbox, so this is the only visible cue for it. */
2248
+ :where(.theme-picker-list, .locale-picker-list, .text-size-picker-list)
2249
+ > :where([data-active]) {
2250
+ background-color: var(--lily-surface-alt);
2251
+ outline: var(--lily-focus-ring);
2252
+ outline-offset: -2px;
2253
+ }
2254
+
2255
+ /* aria-selected marks the applied theme/locale, which is not the
2256
+ same thing as the keyboard cursor. Both can be visible at once. */
2257
+ :where(.theme-picker-list, .locale-picker-list, .text-size-picker-list)
2258
+ > :where([aria-selected="true"]) {
2259
+ font-weight: 600;
2260
+ background-color: var(--lily-surface-sunken);
2261
+ }
2262
+
2263
+ /* Locale options inherit the select colours, same as theme options. */
2264
+ :where(.locale-picker-option) {
2265
+ background-color: var(--lily-surface);
2266
+ color: var(--lily-text);
2267
+ }
2268
+
2269
+ /* ----------------------------------------------------------------------
2270
+ * date-time-picker
2271
+ *
2272
+ * The one helper that is a form control rather than a page-header
2273
+ * control, so it is the only one with a text field beside its trigger
2274
+ * and a dialog rather than a listbox. The field itself needs no rules
2275
+ * here: `.date-time-picker-input` already matches the generic
2276
+ * [class$="-input"] baseline further up.
2277
+ * -------------------------------------------------------------------- */
2278
+
2279
+ :where(.date-time-picker-field) {
2280
+ display: flex;
2281
+ align-items: center;
2282
+ gap: var(--lily-space-xs);
2283
+ }
2284
+
2285
+ :where(.date-time-picker-dialog) {
2286
+ position: absolute;
2287
+ z-index: 10;
2288
+ inset-inline-start: 0;
2289
+ margin-block-start: var(--lily-space-xs);
2290
+ padding: var(--lily-space-sm);
2291
+ color: var(--lily-text);
2292
+ background-color: var(--lily-surface);
2293
+ border: var(--border) solid var(--lily-border-strong);
2294
+ border-radius: var(--lily-radius-md);
2295
+ box-shadow: var(--lily-shadow-md);
2296
+ }
2297
+
2298
+ /* Explicit, because the rule above would otherwise beat the UA
2299
+ stylesheet's [hidden] { display: none } — the same trap the
2300
+ listbox popups have to step around. */
2301
+ :where(.date-time-picker-dialog)[hidden] {
2302
+ display: none;
2303
+ }
2304
+
2305
+ :where(.date-time-picker-header) {
2306
+ display: flex;
2307
+ align-items: center;
2308
+ justify-content: space-between;
2309
+ gap: var(--lily-space-xs);
2310
+ margin-block-end: var(--lily-space-xs);
2311
+ }
2312
+
2313
+ /* The month/year heading is a live region, so it must keep its box
2314
+ even while empty — never display:none it. */
2315
+ :where(.date-time-picker-period) {
2316
+ flex: 1;
2317
+ font-weight: 600;
2318
+ text-align: center;
2319
+ }
2320
+
2321
+ /* The four navigation buttons and the footer/shortcut buttons do not
2322
+ end in `-button`, so the generic button family never reaches them. */
2323
+ :where(
2324
+ .date-time-picker-previous-year,
2325
+ .date-time-picker-previous-month,
2326
+ .date-time-picker-previous-week,
2327
+ .date-time-picker-previous-day,
2328
+ .date-time-picker-next-day,
2329
+ .date-time-picker-next-week,
2330
+ .date-time-picker-next-month,
2331
+ .date-time-picker-next-year,
2332
+ .date-time-picker-shortcut,
2333
+ .date-time-picker-clear,
2334
+ .date-time-picker-cancel,
2335
+ .date-time-picker-confirm
2336
+ ) {
2337
+ padding: var(--lily-space-xs) var(--lily-space-sm);
2338
+ font: inherit;
2339
+ color: var(--lily-text);
2340
+ background-color: var(--lily-surface);
2341
+ border: var(--border) solid var(--lily-border-strong);
2342
+ border-radius: var(--lily-radius-sm);
2343
+ cursor: pointer;
2344
+ }
2345
+
2346
+ :where(
2347
+ .date-time-picker-previous-year:hover,
2348
+ .date-time-picker-previous-month:hover,
2349
+ .date-time-picker-previous-week:hover,
2350
+ .date-time-picker-previous-day:hover,
2351
+ .date-time-picker-next-day:hover,
2352
+ .date-time-picker-next-week:hover,
2353
+ .date-time-picker-next-month:hover,
2354
+ .date-time-picker-next-year:hover,
2355
+ .date-time-picker-shortcut:hover,
2356
+ .date-time-picker-clear:hover,
2357
+ .date-time-picker-cancel:hover,
2358
+ .date-time-picker-confirm:hover
2359
+ ) {
2360
+ background-color: var(--lily-surface-alt);
2361
+ }
2362
+
2363
+ /* The commit action is the primary one on the dialog. */
2364
+ :where(.date-time-picker-confirm) {
2365
+ color: var(--color-primary-content);
2366
+ background-color: var(--color-primary);
2367
+ border-color: var(--color-primary);
2368
+ }
2369
+
2370
+ :where(.date-time-picker-calendar) {
2371
+ border-collapse: collapse;
2372
+ table-layout: fixed;
2373
+ }
2374
+
2375
+ :where(.date-time-picker-weekday, .date-time-picker-week-heading) {
2376
+ padding: var(--lily-space-xs);
2377
+ font-size: 0.8125em;
2378
+ font-weight: 600;
2379
+ color: var(--lily-text-muted);
2380
+ }
2381
+
2382
+ /* Week numbers are reference data, not navigation: muted, and set in
2383
+ tabular figures so the column does not shimmer as months change. */
2384
+ :where(.date-time-picker-week) {
2385
+ padding-inline-end: var(--lily-space-xs);
2386
+ font-size: 0.8125em;
2387
+ font-weight: 400;
2388
+ font-variant-numeric: tabular-nums;
2389
+ color: var(--lily-text-muted);
2390
+ text-align: end;
2391
+ }
2392
+
2393
+ :where(.date-time-picker-day) {
2394
+ display: flex;
2395
+ align-items: center;
2396
+ justify-content: center;
2397
+ /* 2rem is a compromise: WCAG 2.5.8 (AA) wants 24px, 2.5.5 (AAA)
2398
+ wants 44px, and seven 44px columns do not fit a 320px viewport
2399
+ alongside dialog chrome. Consumers targeting AAA should enlarge
2400
+ these and let the dialog go full-width on small screens. */
2401
+ min-width: 2rem;
2402
+ min-height: 2rem;
2403
+ padding: 0;
2404
+ font: inherit;
2405
+ font-variant-numeric: tabular-nums;
2406
+ color: var(--lily-text);
2407
+ background: none;
2408
+ border: var(--border) solid transparent;
2409
+ border-radius: var(--lily-radius-sm);
2410
+ cursor: pointer;
2411
+ }
2412
+
2413
+ :where(.date-time-picker-day:hover:not([data-disabled])) {
2414
+ background-color: var(--lily-surface-alt);
2415
+ }
2416
+
2417
+ /* Adjacent-month days stay legible rather than being hidden: they are
2418
+ real, selectable dates, and blanking them makes the grid harder to
2419
+ scan across a month boundary. */
2420
+ :where(.date-time-picker-day[data-outside]) {
2421
+ color: var(--lily-text-muted);
2422
+ }
2423
+
2424
+ /* Today is marked with a border, the selection with a fill. Two
2425
+ different channels, so a day that is both still reads as both. */
2426
+ :where(.date-time-picker-day[data-today]) {
2427
+ border-color: var(--lily-border-strong);
2428
+ font-weight: 600;
2429
+ }
2430
+
2431
+ :where(.date-time-picker-day[data-selected]) {
2432
+ color: var(--color-primary-content);
2433
+ background-color: var(--color-primary);
2434
+ border-color: var(--color-primary);
2435
+ }
2436
+
2437
+ :where(.date-time-picker-day[data-disabled]) {
2438
+ color: var(--lily-text-muted);
2439
+ cursor: not-allowed;
2440
+ /* Struck through as well as dimmed: "unavailable" must not rest on
2441
+ contrast alone (WCAG 1.4.1). */
2442
+ text-decoration: line-through;
2443
+ }
2444
+
2445
+ :where(.date-time-picker-time) {
2446
+ display: flex;
2447
+ flex-wrap: wrap;
2448
+ align-items: center;
2449
+ gap: var(--lily-space-xs);
2450
+ margin-block-start: var(--lily-space-sm);
2451
+ }
2452
+
2453
+ :where(.date-time-picker-time-label) {
2454
+ font-size: 0.8125em;
2455
+ color: var(--lily-text-muted);
2456
+ }
2457
+
2458
+ :where(.date-time-picker-time-zone) {
2459
+ display: flex;
2460
+ flex-wrap: wrap;
2461
+ align-items: center;
2462
+ gap: var(--lily-space-xs);
2463
+ margin-block-end: var(--lily-space-sm);
2464
+ }
2465
+
2466
+ :where(.date-time-picker-time-zone-label) {
2467
+ font-size: 0.8125em;
2468
+ color: var(--lily-text-muted);
2469
+ }
2470
+
2471
+ :where(
2472
+ .date-time-picker-hour,
2473
+ .date-time-picker-minute,
2474
+ .date-time-picker-meridiem,
2475
+ .date-time-picker-time-zone-select
2476
+ ) {
2477
+ padding: var(--lily-space-xs);
2478
+ font: inherit;
2479
+ color: var(--lily-text);
2480
+ background-color: var(--lily-surface);
2481
+ border: var(--border) solid var(--lily-border-strong);
2482
+ border-radius: var(--lily-radius-sm);
2483
+ }
2484
+
2485
+ :where(.date-time-picker-shortcuts) {
2486
+ display: flex;
2487
+ flex-wrap: wrap;
2488
+ gap: var(--lily-space-xs);
2489
+ margin-block-start: var(--lily-space-sm);
2490
+ }
2491
+
2492
+ :where(.date-time-picker-footer) {
2493
+ display: flex;
2494
+ justify-content: flex-end;
2495
+ gap: var(--lily-space-xs);
2496
+ margin-block-start: var(--lily-space-sm);
2497
+ }
2498
+
2499
+ /* Combobox / listbox / autosuggest — non-native variant of <select>. */
2500
+ :where(.combobox, .listbox, .autosuggest) {
2501
+ background-color: var(--lily-surface);
2502
+ border: var(--border) solid var(--lily-border-strong);
2503
+ border-radius: var(--lily-radius-md);
2504
+ }
2505
+
2506
+ /* ==========================================================================
2507
+ * Editorial typography
2508
+ * --------------------------------------------------------------------------
2509
+ * Headlines, body text, byline, blockquote, code — the long-form reading
2510
+ * primitives. Headlines use clamp() so they shrink on narrow viewports
2511
+ * without media queries.
2512
+ * ====================================================================== */
2513
+
2514
+ :where(.headline, .hero-headline, .section-heading) {
2515
+ color: var(--lily-text);
2516
+ font-family: var(--lily-font-body);
2517
+ font-weight: 700;
2518
+ line-height: 1.15;
2519
+ margin: 0 0 0.5rem 0;
2520
+ }
2521
+ :where(.headline) {
2522
+ font-size: clamp(1.5rem, 3vw, 2.25rem);
2523
+ }
2524
+ :where(.hero-headline) {
2525
+ font-size: clamp(2rem, 5vw, 3.5rem);
2526
+ }
2527
+ :where(.section-heading) {
2528
+ font-size: clamp(1.25rem, 2vw, 1.75rem);
2529
+ }
2530
+ /* Body text — 1.6 line-height (sweet spot for reading). */
2531
+ :where(.body-text) {
2532
+ line-height: 1.6;
2533
+ color: var(--lily-text);
2534
+ }
2535
+ /* Byline — author / date line under a headline. */
2536
+ :where(.byline) {
2537
+ color: var(--lily-text-muted);
2538
+ font-size: 0.875rem;
2539
+ }
2540
+ /* Blockquote — primary-coloured rail + italic body. */
2541
+ :where(.blockquote) {
2542
+ margin: 1rem 0;
2543
+ padding: 0.5rem 1rem;
2544
+ border-inline-start: 0.25rem solid var(--color-primary);
2545
+ color: var(--lily-text);
2546
+ font-style: italic;
2547
+ }
2548
+ /* End-notes / related content — top-bordered section at the foot. */
2549
+ :where(.end-notes, .related-content) {
2550
+ margin-top: 2rem;
2551
+ padding-top: 1rem;
2552
+ border-top: var(--border) solid var(--lily-border);
2553
+ }
2554
+ /* Caption / footnote / citation — small muted text. */
2555
+ :where(.caption, .footnote, .citation) {
2556
+ font-size: 0.875rem;
2557
+ color: var(--lily-text-muted);
2558
+ }
2559
+ /* KBD — keyboard key glyph; thicker bottom border simulates the keytop. */
2560
+ :where(.kbd) {
2561
+ display: inline-block;
2562
+ padding: 0.125rem 0.4rem;
2563
+ font-family: var(--lily-font-mono);
2564
+ font-size: 0.85em;
2565
+ background-color: var(--lily-surface-alt);
2566
+ border: var(--border) solid var(--lily-border-strong);
2567
+ border-bottom-width: 2px;
2568
+ border-radius: var(--lily-radius-sm);
2569
+ }
2570
+ /* Inline code — slight background tint + monospaced font. */
2571
+ :where(.code) {
2572
+ font-family: var(--lily-font-mono);
2573
+ padding: 0.1em 0.3em;
2574
+ background-color: var(--lily-surface-alt);
2575
+ border-radius: var(--lily-radius-sm);
2576
+ font-size: 0.9em;
2577
+ }
2578
+ /* Code block — full-width block with horizontal scroll. */
2579
+ :where(.code-block) {
2580
+ display: block;
2581
+ padding: 1rem;
2582
+ background-color: var(--color-neutral);
2583
+ color: var(--color-neutral-content);
2584
+ font-family: var(--lily-font-mono);
2585
+ border-radius: var(--lily-radius-md);
2586
+ overflow-x: auto;
2587
+ white-space: pre;
2588
+ }
2589
+ /* Inset text — left-railed callout for "Important" content
2590
+ (GOV.UK / NHS pattern). */
2591
+ :where(.inset-text) {
2592
+ padding: 0.75rem 1rem;
2593
+ border-inline-start: 0.25rem solid var(--color-primary);
2594
+ background-color: var(--lily-surface-alt);
2595
+ }
2596
+ /* Generic character — monospaced single-glyph display. */
2597
+ :where(.character) {
2598
+ font-family: var(--lily-font-mono);
2599
+ }
2600
+ /* Clamp-text — truncate to N lines (controlled by --lily-clamp-lines). */
2601
+ :where(.clamp-text) {
2602
+ display: -webkit-box;
2603
+ -webkit-line-clamp: var(--lily-clamp-lines, 3);
2604
+ line-clamp: var(--lily-clamp-lines, 3);
2605
+ -webkit-box-orient: vertical;
2606
+ overflow: hidden;
2607
+ }
2608
+ /* Screen-reader-only — visually hidden but available to AT. The
2609
+ classic clip-rect pattern (works in every screen reader). */
2610
+ :where(.screen-reader-span) {
2611
+ position: absolute;
2612
+ width: 1px;
2613
+ height: 1px;
2614
+ padding: 0;
2615
+ margin: -1px;
2616
+ overflow: hidden;
2617
+ clip: rect(0, 0, 0, 0);
2618
+ white-space: nowrap;
2619
+ border: 0;
2620
+ }
2621
+
2622
+ /* ==========================================================================
2623
+ * Hero, figure, photo, media
2624
+ * ====================================================================== */
2625
+
2626
+ /* Hero block — primary-filled banner with centred content. clamp() pad
2627
+ scales vertically across viewport sizes. */
2628
+ :where(.hero) {
2629
+ display: block;
2630
+ padding: clamp(2rem, 5vw, 4rem) 1rem;
2631
+ background-color: var(--color-primary);
2632
+ color: var(--color-primary-content);
2633
+ border-radius: var(--lily-radius-lg);
2634
+ text-align: center;
2635
+ }
2636
+ /* Figure — centred block with vertical margin. */
2637
+ :where(.figure) {
2638
+ margin: 1rem 0;
2639
+ text-align: center;
2640
+ }
2641
+ /* Feature photo — responsive lead image. */
2642
+ :where(.feature-photo) {
2643
+ display: block;
2644
+ width: 100%;
2645
+ height: auto;
2646
+ border-radius: var(--lily-radius-md);
2647
+ }
2648
+ /* Photo pack — responsive grid of thumbnails. */
2649
+ :where(.photo-pack) {
2650
+ display: grid;
2651
+ grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
2652
+ gap: 0.5rem;
2653
+ }
2654
+ /* Generic image — responsive block image. */
2655
+ :where(.image) {
2656
+ max-width: 100%;
2657
+ height: auto;
2658
+ display: block;
2659
+ }
2660
+ /* QR / barcode / signature — frame them as a labelled tile. */
2661
+ :where(.qr-code-image, .barcode-image, .signature-pad) {
2662
+ display: inline-block;
2663
+ background-color: var(--lily-surface);
2664
+ border: var(--border) solid var(--lily-border);
2665
+ border-radius: var(--lily-radius-md);
2666
+ padding: 0.5rem;
2667
+ }
2668
+ /* Signature pad — drawable surface; crosshair cursor signals input. */
2669
+ :where(.signature-pad) {
2670
+ min-height: 8rem;
2671
+ cursor: crosshair;
2672
+ }
2673
+ /* Video player — responsive black-letterboxed frame. */
2674
+ :where(.video-player) {
2675
+ display: block;
2676
+ width: 100%;
2677
+ max-width: 100%;
2678
+ border-radius: var(--lily-radius-md);
2679
+ /* Video chrome is black in every theme; pair the text colour with
2680
+ it here rather than inheriting the theme's (possibly dark)
2681
+ content colour onto a black surface. */
2682
+ background-color: black;
2683
+ color: white;
2684
+ }
2685
+
2686
+ /* ==========================================================================
2687
+ * Mockups & pictograms
2688
+ * --------------------------------------------------------------------------
2689
+ * Device frames for screenshots / illustrations — browser, phone, tablet,
2690
+ * laptop, watch, shell window. All share the same rounded-outline frame
2691
+ * baseline; specific frames override the radius / border-width.
2692
+ * ====================================================================== */
2693
+
2694
+ :where(
2695
+ .mockup-browser,
2696
+ .mockup-window,
2697
+ .mockup-shell,
2698
+ .mockup-phone-portrait,
2699
+ .mockup-phone-landscape,
2700
+ .mockup-tablet-portrait,
2701
+ .mockup-tablet-landscape,
2702
+ .mockup-laptop,
2703
+ .mockup-watch
2704
+ ) {
2705
+ display: block;
2706
+ background-color: var(--lily-surface);
2707
+ border: 2px solid var(--color-neutral);
2708
+ border-radius: var(--lily-radius-lg);
2709
+ overflow: hidden;
2710
+ box-shadow: var(--lily-shadow-md);
2711
+ }
2712
+ /* Mockup shell — terminal window; dark neutral fill + mono font. */
2713
+ :where(.mockup-shell) {
2714
+ background-color: var(--color-neutral);
2715
+ color: var(--color-neutral-content);
2716
+ font-family: var(--lily-font-mono);
2717
+ padding: 1rem;
2718
+ }
2719
+ /* Phones — heavier bezel (6px) and more rounded corners. */
2720
+ :where(.mockup-phone-portrait, .mockup-phone-landscape) {
2721
+ border-radius: 1.5rem;
2722
+ border-width: 6px;
2723
+ }
2724
+ /* Smartwatch — chunky bezel (4px) and pill radius. */
2725
+ :where(.mockup-watch) {
2726
+ border-radius: 1rem;
2727
+ border-width: 4px;
2728
+ }
2729
+ /* Pictogram — stacked icon + caption, centred. */
2730
+ :where(.pictogram) {
2731
+ display: inline-flex;
2732
+ flex-direction: column;
2733
+ align-items: center;
2734
+ gap: 0.5rem;
2735
+ padding: 1rem;
2736
+ text-align: center;
2737
+ }
2738
+
2739
+ /* ==========================================================================
2740
+ * Charts (containers only — content supplied by consumer)
2741
+ * --------------------------------------------------------------------------
2742
+ * Headless: Lily provides the frame + a 6-colour palette as custom
2743
+ * properties. The consumer's chart library (D3, Chart.js, ECharts, etc.)
2744
+ * reads `var(--lily-chart-color-1..6)` for its series colours.
2745
+ * ====================================================================== */
2746
+
2747
+ :where(
2748
+ .area-chart,
2749
+ .bar-chart,
2750
+ .column-chart,
2751
+ .line-chart,
2752
+ .scatter-chart,
2753
+ .sparkline,
2754
+ .tile-map,
2755
+ .graphic-block
2756
+ ) {
2757
+ display: block;
2758
+ background-color: var(--lily-surface);
2759
+ border-radius: var(--lily-radius-md);
2760
+ padding: 1rem;
2761
+ color: var(--lily-text);
2762
+ /* Six-colour palette — the consumer's chart library picks these up. */
2763
+ --lily-chart-color-1: var(--color-primary);
2764
+ --lily-chart-color-2: var(--color-secondary);
2765
+ --lily-chart-color-3: var(--color-accent);
2766
+ --lily-chart-color-4: var(--color-info);
2767
+ --lily-chart-color-5: var(--color-success);
2768
+ --lily-chart-color-6: var(--color-warning);
2769
+ }
2770
+ /* Sparkline — small inline chart; no padding. */
2771
+ :where(.sparkline) {
2772
+ padding: 0;
2773
+ height: 1.5rem;
2774
+ width: 6rem;
2775
+ display: inline-block;
2776
+ }
2777
+ /* Graphic block — bordered chart container. */
2778
+ :where(.graphic-block) {
2779
+ border: var(--border) solid var(--lily-border);
2780
+ }
2781
+
2782
+ /* ==========================================================================
2783
+ * Scrolling, splits, resize
2784
+ * ====================================================================== */
2785
+
2786
+ /* Scroll area — capped at 20rem, auto-overflow. */
2787
+ :where(.scroll-area) {
2788
+ overflow: auto;
2789
+ max-height: 20rem;
2790
+ }
2791
+ /* Horizontal scroller — flex row that overflows on x. */
2792
+ :where(.horizontal-scroller) {
2793
+ overflow-x: auto;
2794
+ display: flex;
2795
+ gap: 0.5rem;
2796
+ }
2797
+ /* Scroller (Reuters-pattern scrollytelling) — positioning anchor. */
2798
+ :where(.scroller, .scroller-base, .scroller-video) {
2799
+ position: relative;
2800
+ display: block;
2801
+ }
2802
+ /* Custom scrollbar track. */
2803
+ :where(.scroll-bar) {
2804
+ background-color: var(--lily-surface-sunken);
2805
+ border-radius: 999px;
2806
+ height: 0.5rem;
2807
+ }
2808
+ /* Affix — stick to the top of the viewport on scroll. */
2809
+ :where(.affix) {
2810
+ position: sticky;
2811
+ inset-block-start: 0;
2812
+ }
2813
+ /* Visible — IntersectionObserver target; baseline is a visible block. */
2814
+ :where(.visible) {
2815
+ display: block;
2816
+ }
2817
+ /* Resizable — native CSS resize handle (corner). */
2818
+ :where(.resizable) {
2819
+ resize: both;
2820
+ overflow: auto;
2821
+ }
2822
+ /* Split-view + splitter — two-pane horizontal layout. */
2823
+ :where(.split-view) {
2824
+ display: flex;
2825
+ align-items: stretch;
2826
+ gap: 0;
2827
+ }
2828
+ :where(.splitter) {
2829
+ flex: 0 0 0.375rem;
2830
+ background-color: var(--lily-border);
2831
+ cursor: col-resize;
2832
+ }
2833
+
2834
+ /* ==========================================================================
2835
+ * Misc unique components
2836
+ * ====================================================================== */
2837
+
2838
+ /* Statistic — stacked label + value; value is large and primary-coloured. */
2839
+ :where(.statistic) {
2840
+ display: inline-flex;
2841
+ flex-direction: column;
2842
+ gap: 0.25rem;
2843
+ }
2844
+ :where(.statistic > [data-part="value"]) {
2845
+ font-size: 1.5rem;
2846
+ font-weight: 700;
2847
+ color: var(--color-primary);
2848
+ }
2849
+ /* Watermark — diagonal repeating-line pattern at 8% opacity behind content. */
2850
+ :where(.watermark) {
2851
+ position: absolute;
2852
+ inset: 0;
2853
+ pointer-events: none;
2854
+ opacity: 0.08;
2855
+ background: repeating-linear-gradient(
2856
+ -45deg,
2857
+ var(--lily-text) 0 1px,
2858
+ transparent 1px 8rem
2859
+ );
2860
+ }
2861
+ /* Beach ball (macOS "waiting" indicator) — six-colour conic wheel. */
2862
+ :where(.beach-ball) {
2863
+ display: inline-block;
2864
+ width: 2rem;
2865
+ height: 2rem;
2866
+ border-radius: 50%;
2867
+ background: conic-gradient(
2868
+ var(--color-error),
2869
+ var(--color-warning),
2870
+ var(--color-success),
2871
+ var(--color-info),
2872
+ var(--color-primary),
2873
+ var(--color-error)
2874
+ );
2875
+ animation: lily-spin 2s linear infinite;
2876
+ }
2877
+ /* Diff — side-by-side two-column comparison. */
2878
+ :where(.diff) {
2879
+ display: grid;
2880
+ grid-template-columns: 1fr 1fr;
2881
+ gap: 0.5rem;
2882
+ }
2883
+ /* Addressograph box — paper-form ID label (NHS / hospital pattern). */
2884
+ :where(.addressograph-box) {
2885
+ display: block;
2886
+ padding: 0.75rem 1rem;
2887
+ background-color: var(--lily-surface-alt);
2888
+ border: 2px solid var(--lily-text);
2889
+ font-family: var(--lily-font-mono);
2890
+ line-height: 1.4;
2891
+ }
2892
+ /* Government identifier — dark chrome bar containing an ID number. */
2893
+ :where(.government-identifier) {
2894
+ display: flex;
2895
+ align-items: center;
2896
+ gap: 0.75rem;
2897
+ padding: 0.75rem 1rem;
2898
+ background-color: var(--color-neutral);
2899
+ color: var(--color-neutral-content);
2900
+ }
2901
+ /* Share / signup / CTA panels — alt-surface promo blocks. */
2902
+ :where(.share-page, .newsletter-signup, .call-to-action) {
2903
+ padding: 1rem;
2904
+ background-color: var(--lily-surface-alt);
2905
+ border-radius: var(--lily-radius-md);
2906
+ }
2907
+ /* CTA — override with primary fill so it reads as the page action. */
2908
+ :where(.call-to-action) {
2909
+ background-color: var(--color-primary);
2910
+ color: var(--color-primary-content);
2911
+ }
2912
+ /* Links inside the call-to-action inherit its content colour —
2913
+ otherwise the UA default link blue lands on the primary fill. */
2914
+ :where(.call-to-action) :where(a) {
2915
+ color: inherit;
2916
+ }
2917
+ /* Expander / collapsible / details — boxed disclosure controls. */
2918
+ :where(.expander, .collapsible, .details) {
2919
+ display: block;
2920
+ border: var(--border) solid var(--lily-border);
2921
+ border-radius: var(--lily-radius-md);
2922
+ padding: 0.5rem 1rem;
2923
+ }
2924
+ :where(.details > summary, .expander > summary, .collapsible > summary) {
2925
+ cursor: pointer;
2926
+ font-weight: 600;
2927
+ padding: 0.25rem 0;
2928
+ }
2929
+ /* Carousel — horizontal scroller with snap-points so each slide locks
2930
+ into view as the user swipes. */
2931
+ :where(.carousel) {
2932
+ display: flex;
2933
+ overflow-x: auto;
2934
+ scroll-snap-type: x mandatory;
2935
+ gap: 0.5rem;
2936
+ }
2937
+ :where(.carousel > *) {
2938
+ scroll-snap-align: start;
2939
+ flex: 0 0 auto;
2940
+ }
2941
+
2942
+ /* --- Semantic entities — neutral display blocks. ----------------------- */
2943
+ :where(
2944
+ .person,
2945
+ .organization,
2946
+ .place,
2947
+ .event,
2948
+ .comment,
2949
+ .question,
2950
+ .answer
2951
+ ) {
2952
+ display: block;
2953
+ padding: 0.75rem 0;
2954
+ }
2955
+ /* Draft wrapper — dashed border + optional "Draft" pill prefix. */
2956
+ :where(.draft) {
2957
+ border: 1px dashed var(--lily-border-strong);
2958
+ background-color: var(--lily-surface-alt);
2959
+ padding: 1rem;
2960
+ border-radius: var(--lily-radius-md);
2961
+ }
2962
+ :where(.draft[data-status="draft"])::before {
2963
+ content: "Draft";
2964
+ display: inline-block;
2965
+ margin-inline-end: 0.5rem;
2966
+ padding: 0.125rem 0.5rem;
2967
+ background-color: var(--color-warning);
2968
+ color: var(--color-warning-content);
2969
+ border-radius: 999px;
2970
+ font-size: 0.75rem;
2971
+ font-weight: 600;
2972
+ }
2973
+
2974
+ /* Dial — circular gauge driven by --dial-value (0–100). */
2975
+ :where(.dial) {
2976
+ display: inline-block;
2977
+ width: 4rem;
2978
+ height: 4rem;
2979
+ border-radius: 50%;
2980
+ background: conic-gradient(
2981
+ var(--color-primary) calc(var(--dial-value, 0) * 1%),
2982
+ var(--lily-surface-sunken) 0
2983
+ );
2984
+ }
2985
+
2986
+ /* File upload — drop-zone aesthetic: dashed border, alt surface. */
2987
+ :where(.file-upload) {
2988
+ display: block;
2989
+ padding: 1.5rem;
2990
+ background-color: var(--lily-surface-alt);
2991
+ border: 2px dashed var(--lily-border-strong);
2992
+ border-radius: var(--lily-radius-md);
2993
+ text-align: center;
2994
+ cursor: pointer;
2995
+ }
2996
+ /* File manager — surface-coloured frame holding a file list. */
2997
+ :where(.file-manager) {
2998
+ display: block;
2999
+ background-color: var(--lily-surface);
3000
+ border: var(--border) solid var(--lily-border);
3001
+ border-radius: var(--lily-radius-md);
3002
+ padding: 0.5rem;
3003
+ }
3004
+ /* Transfer list — two columns + central button stack. */
3005
+ :where(.transfer-list) {
3006
+ display: grid;
3007
+ grid-template-columns: 1fr auto 1fr;
3008
+ gap: 0.5rem;
3009
+ align-items: center;
3010
+ }
3011
+
3012
+ /* Tour — onboarding card with medium elevation. */
3013
+ :where(.tour) {
3014
+ display: block;
3015
+ background-color: var(--lily-surface);
3016
+ border: var(--border) solid var(--lily-border);
3017
+ border-radius: var(--lily-radius-lg);
3018
+ padding: 1rem;
3019
+ box-shadow: var(--lily-shadow-md);
3020
+ }
3021
+
3022
+ /* Editable text — dashed underline indicates click-to-edit. */
3023
+ :where(.editable) {
3024
+ display: inline-block;
3025
+ padding: 0.125rem 0.25rem;
3026
+ border-bottom: 1px dashed var(--lily-border-strong);
3027
+ cursor: text;
3028
+ }
3029
+ /* Editing state — alt surface + primary underline. */
3030
+ :where(.editable[aria-expanded="true"]) {
3031
+ background-color: var(--lily-surface-alt);
3032
+ border-bottom-color: var(--color-primary);
3033
+ }
3034
+
3035
+ /* Accordion-checkbox — a checkbox that toggles a panel via sibling
3036
+ combinator (no JS needed). */
3037
+ :where(.accordion-checkbox) {
3038
+ display: block;
3039
+ border: var(--border) solid var(--lily-border);
3040
+ border-radius: var(--lily-radius-md);
3041
+ padding: 0.5rem 0.75rem;
3042
+ }
3043
+ :where(.accordion-checkbox-input) {
3044
+ margin-inline-end: 0.5rem;
3045
+ }
3046
+ :where(.accordion-checkbox-panel) {
3047
+ display: none;
3048
+ padding-block-start: 0.5rem;
3049
+ }
3050
+ /* Reveal the panel when the input is checked. */
3051
+ :where(.accordion-checkbox-input:checked ~ .accordion-checkbox-panel) {
3052
+ display: block;
3053
+ }
3054
+
3055
+ /* Icon — 1em square container; sizes with surrounding text. */
3056
+ :where(.icon) {
3057
+ display: inline-flex;
3058
+ align-items: center;
3059
+ justify-content: center;
3060
+ width: 1em;
3061
+ height: 1em;
3062
+ flex: 0 0 auto;
3063
+ }
3064
+
3065
+ /* Emoji — inline glyph; not italicised. */
3066
+ :where(.emoji) {
3067
+ display: inline-block;
3068
+ font-style: normal;
3069
+ }
3070
+
3071
+ /* Slider — primary-filled track based on --slider-value (0–100). */
3072
+ :where(.slider) {
3073
+ display: block;
3074
+ width: 100%;
3075
+ height: 1.5rem;
3076
+ background: linear-gradient(
3077
+ to right,
3078
+ var(--color-primary) calc(var(--slider-value, 50) * 1%),
3079
+ var(--lily-surface-sunken) 0
3080
+ );
3081
+ border-radius: 999px;
3082
+ }
3083
+
3084
+ /* Timer — fixed-width digits so the display doesn't jiggle as it ticks. */
3085
+ :where(.timer) {
3086
+ display: inline-block;
3087
+ font-family: var(--lily-font-mono);
3088
+ font-variant-numeric: tabular-nums;
3089
+ font-weight: 600;
3090
+ }
3091
+
3092
+ /* Medical banner inner boxes — spacing-only override. */
3093
+ :where(.medical-banner-box-for-advice, .medical-banner-box-for-danger) {
3094
+ padding: 0.75rem 1rem;
3095
+ border-radius: var(--lily-radius-md);
3096
+ margin: 0.25rem 0;
3097
+ }
3098
+
3099
+ /* ==========================================================================
3100
+ * Print
3101
+ * --------------------------------------------------------------------------
3102
+ * On paper, transient/floating chrome (skip-link, FAB, toast, tooltip)
3103
+ * is meaningless — hide it. Card-like surfaces drop their drop-shadow
3104
+ * and shift to a high-contrast outline so they're readable in monochrome.
3105
+ * ====================================================================== */
3106
+ @media print {
3107
+ :where(
3108
+ .skip-link,
3109
+ .float-button,
3110
+ .toast,
3111
+ .sonner,
3112
+ .tooltip,
3113
+ .coachmark
3114
+ ) {
3115
+ display: none !important;
3116
+ }
3117
+ :where(.card, .panel, .dialog, .alert) {
3118
+ box-shadow: none;
3119
+ border-color: var(--lily-text);
3120
+ }
3121
+ }
3122
+ }
3123
+
3124
+ /* ============================================================================
3125
+ * WCAG 2.2 target-size (minimum) floor — 2.5.8
3126
+ *
3127
+ * Every interactive Lily hook offers a >=24x24 CSS-pixel target. Links
3128
+ * that render as short inline text (a pagination "1", a breadcrumb crumb)
3129
+ * fail the 24px floor under typographic sizing alone, so the link-shaped
3130
+ * hooks become inline-block with a minimum box. :where() keeps specificity
3131
+ * at zero, so any consumer rule still wins. Shared verbatim by all themes.
3132
+ * ========================================================================= */
3133
+
3134
+ :where(.action-link,
3135
+ .back-link,
3136
+ .breadcrumb-list-item > a,
3137
+ .pagination-list-item > a,
3138
+ .contents-list-item > a,
3139
+ .section-list-item > a) {
3140
+ display: inline-block;
3141
+ min-inline-size: 24px;
3142
+ min-block-size: 24px;
3143
+ }
3144
+
3145
+ :where(.pagination-list-item > a) {
3146
+ text-align: center;
3147
+ }
3148
+
3149
+ :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
3150
+ min-block-size: 24px;
3151
+ }
3152
+
3153
+ /* ============================================================================
3154
+ * Overflow guards — narrow-viewport safety, shared verbatim by all themes.
3155
+ *
3156
+ * Content that is intrinsically wider than the viewport scrolls or wraps
3157
+ * within its own box instead of pushing the page wider. Deliberately NOT
3158
+ * `display: block` on <table> — that strips implicit table semantics for
3159
+ * assistive technology; capping width and letting cell content wrap keeps
3160
+ * both the layout and the roles. Proven in the example apps' own
3161
+ * stylesheets before the theme layer took over component styling.
3162
+ * ========================================================================= */
3163
+
3164
+ :where(pre) {
3165
+ max-width: 100%;
3166
+ overflow-x: auto;
3167
+ }
3168
+
3169
+ :where(table) {
3170
+ max-width: 100%;
3171
+ }
3172
+
3173
+ :where(th, td) {
3174
+ overflow-wrap: anywhere;
3175
+ }
3176
+
3177
+ :where(a, code) {
3178
+ overflow-wrap: anywhere;
3179
+ }