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