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