@prismora/css 0.0.0-stage → 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 (153) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +18 -2
  3. package/dist/components/accordion.css +57 -0
  4. package/dist/components/alert.css +31 -0
  5. package/dist/components/avatar.css +34 -0
  6. package/dist/components/badge.css +25 -0
  7. package/dist/components/banner.css +25 -0
  8. package/dist/components/breadcrumb.css +37 -0
  9. package/dist/components/button.css +162 -0
  10. package/dist/components/calendar.css +60 -0
  11. package/dist/components/card.css +34 -0
  12. package/dist/components/carousel.css +70 -0
  13. package/dist/components/chart.css +63 -0
  14. package/dist/components/chat.css +66 -0
  15. package/dist/components/checkbox.css +67 -0
  16. package/dist/components/color-picker.css +78 -0
  17. package/dist/components/combobox.css +42 -0
  18. package/dist/components/command.css +58 -0
  19. package/dist/components/data-table.css +295 -0
  20. package/dist/components/description-list.css +24 -0
  21. package/dist/components/dialog.css +58 -0
  22. package/dist/components/drawer.css +60 -0
  23. package/dist/components/editor.css +46 -0
  24. package/dist/components/empty-state.css +30 -0
  25. package/dist/components/extras.css +99 -0
  26. package/dist/components/field.css +38 -0
  27. package/dist/components/file-upload.css +48 -0
  28. package/dist/components/helpers.css +128 -0
  29. package/dist/components/icon.css +21 -0
  30. package/dist/components/image.css +28 -0
  31. package/dist/components/indicator.css +56 -0
  32. package/dist/components/input.css +109 -0
  33. package/dist/components/kbd.css +26 -0
  34. package/dist/components/list.css +77 -0
  35. package/dist/components/listbox.css +56 -0
  36. package/dist/components/meter.css +34 -0
  37. package/dist/components/nav.css +116 -0
  38. package/dist/components/number-input.css +33 -0
  39. package/dist/components/overlay.css +34 -0
  40. package/dist/components/pagination.css +47 -0
  41. package/dist/components/pickers.css +68 -0
  42. package/dist/components/pin-input.css +21 -0
  43. package/dist/components/popover.css +110 -0
  44. package/dist/components/progress.css +40 -0
  45. package/dist/components/pull-refresh.css +39 -0
  46. package/dist/components/range-slider.css +76 -0
  47. package/dist/components/rating.css +34 -0
  48. package/dist/components/scheduler.css +65 -0
  49. package/dist/components/segmented.css +41 -0
  50. package/dist/components/select.css +69 -0
  51. package/dist/components/separator.css +22 -0
  52. package/dist/components/sheet.css +47 -0
  53. package/dist/components/skeleton.css +25 -0
  54. package/dist/components/slider.css +57 -0
  55. package/dist/components/sortable.css +31 -0
  56. package/dist/components/spinner.css +21 -0
  57. package/dist/components/splitter.css +40 -0
  58. package/dist/components/stat.css +32 -0
  59. package/dist/components/steps.css +74 -0
  60. package/dist/components/surface.css +24 -0
  61. package/dist/components/switch.css +56 -0
  62. package/dist/components/table.css +95 -0
  63. package/dist/components/tabs.css +124 -0
  64. package/dist/components/tag.css +59 -0
  65. package/dist/components/time-picker.css +24 -0
  66. package/dist/components/timeline.css +43 -0
  67. package/dist/components/toast.css +84 -0
  68. package/dist/components/toggle.css +45 -0
  69. package/dist/components/toolbar.css +20 -0
  70. package/dist/components/tooltip.css +26 -0
  71. package/dist/components/tree.css +60 -0
  72. package/dist/core.css +4275 -0
  73. package/dist/foundation.css +898 -0
  74. package/dist/prismora.css +4682 -0
  75. package/dist/theme.css +409 -0
  76. package/dist/tone.css +11 -0
  77. package/dist/typography.css +157 -0
  78. package/package.json +42 -4
  79. package/src/base.css +66 -0
  80. package/src/components/accordion.css +54 -0
  81. package/src/components/alert.css +28 -0
  82. package/src/components/avatar.css +31 -0
  83. package/src/components/badge.css +22 -0
  84. package/src/components/banner.css +22 -0
  85. package/src/components/breadcrumb.css +34 -0
  86. package/src/components/button.css +159 -0
  87. package/src/components/calendar.css +57 -0
  88. package/src/components/card.css +31 -0
  89. package/src/components/carousel.css +67 -0
  90. package/src/components/chart.css +60 -0
  91. package/src/components/chat.css +63 -0
  92. package/src/components/checkbox.css +64 -0
  93. package/src/components/color-picker.css +75 -0
  94. package/src/components/combobox.css +39 -0
  95. package/src/components/command.css +55 -0
  96. package/src/components/data-table.css +292 -0
  97. package/src/components/description-list.css +21 -0
  98. package/src/components/dialog.css +55 -0
  99. package/src/components/drawer.css +57 -0
  100. package/src/components/editor.css +43 -0
  101. package/src/components/empty-state.css +27 -0
  102. package/src/components/extras.css +96 -0
  103. package/src/components/field.css +35 -0
  104. package/src/components/file-upload.css +45 -0
  105. package/src/components/helpers.css +125 -0
  106. package/src/components/icon.css +18 -0
  107. package/src/components/image.css +25 -0
  108. package/src/components/indicator.css +53 -0
  109. package/src/components/input.css +106 -0
  110. package/src/components/kbd.css +23 -0
  111. package/src/components/list.css +74 -0
  112. package/src/components/listbox.css +53 -0
  113. package/src/components/meter.css +31 -0
  114. package/src/components/nav.css +113 -0
  115. package/src/components/number-input.css +30 -0
  116. package/src/components/overlay.css +31 -0
  117. package/src/components/pagination.css +44 -0
  118. package/src/components/pickers.css +65 -0
  119. package/src/components/pin-input.css +18 -0
  120. package/src/components/popover.css +107 -0
  121. package/src/components/progress.css +37 -0
  122. package/src/components/pull-refresh.css +36 -0
  123. package/src/components/range-slider.css +73 -0
  124. package/src/components/rating.css +31 -0
  125. package/src/components/scheduler.css +62 -0
  126. package/src/components/segmented.css +38 -0
  127. package/src/components/select.css +66 -0
  128. package/src/components/separator.css +19 -0
  129. package/src/components/sheet.css +44 -0
  130. package/src/components/skeleton.css +22 -0
  131. package/src/components/slider.css +54 -0
  132. package/src/components/sortable.css +28 -0
  133. package/src/components/spinner.css +18 -0
  134. package/src/components/splitter.css +37 -0
  135. package/src/components/stat.css +29 -0
  136. package/src/components/steps.css +71 -0
  137. package/src/components/surface.css +21 -0
  138. package/src/components/switch.css +53 -0
  139. package/src/components/table.css +92 -0
  140. package/src/components/tabs.css +121 -0
  141. package/src/components/tag.css +56 -0
  142. package/src/components/time-picker.css +21 -0
  143. package/src/components/timeline.css +40 -0
  144. package/src/components/toast.css +81 -0
  145. package/src/components/toggle.css +42 -0
  146. package/src/components/toolbar.css +17 -0
  147. package/src/components/tooltip.css +23 -0
  148. package/src/components/tree.css +57 -0
  149. package/src/layers.css +2 -0
  150. package/src/layout.css +113 -0
  151. package/src/reset.css +18 -0
  152. package/src/typography.css +154 -0
  153. package/src/utilities.css +99 -0
package/dist/core.css ADDED
@@ -0,0 +1,4275 @@
1
+ /* Prismora cascade layers. Your own unlayered CSS always wins over every layer below. */
2
+ @layer pm.reset, pm.base, pm.themes, pm.components, pm.utilities;
3
+
4
+ /* Targeted reset: no `*` selectors, so web components and lower layers stay overridable. */
5
+ @layer pm.reset {
6
+ :where(html) {
7
+ -webkit-text-size-adjust: none;
8
+ text-size-adjust: none;
9
+ interpolate-size: allow-keywords;
10
+ }
11
+ :where(body) { margin: 0; min-block-size: 100dvh; }
12
+ :where(h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd) { margin-block: 0; }
13
+ :where(ul[role="list"], ol[role="list"]) { list-style: none; margin: 0; padding: 0; }
14
+ :where(img, picture, video, canvas, svg) { display: block; max-inline-size: 100%; block-size: auto; }
15
+ :where(input, button, textarea, select) { font: inherit; letter-spacing: inherit; }
16
+ :where(button) { color: inherit; }
17
+ :where(textarea:not([rows])) { min-block-size: 6em; }
18
+ :where([class^="pm-"], [class*=" pm-"]),
19
+ :where([class^="pm-"], [class*=" pm-"])::before,
20
+ :where([class^="pm-"], [class*=" pm-"])::after { box-sizing: border-box; }
21
+ }
22
+
23
+ @layer pm.base {
24
+ :where(html) {
25
+ color: var(--pm-color-fg);
26
+ background: var(--pm-color-bg-canvas);
27
+ font-family: var(--pm-font-sans);
28
+ font-size: 100%;
29
+ line-height: var(--pm-line-height-normal);
30
+ accent-color: var(--pm-color-accent-solid);
31
+ scrollbar-color: var(--pm-color-border-strong) transparent;
32
+ -webkit-font-smoothing: antialiased;
33
+ text-rendering: optimizeLegibility;
34
+ }
35
+ /* User text size: every rem-based token (type, space, controls) scales with the root size. */
36
+ :where(html[data-text-size="sm"]) { font-size: 93.75%; }
37
+ :where(html[data-text-size="lg"]) { font-size: 112.5%; }
38
+ :where(html[data-text-size="xl"]) { font-size: 125%; }
39
+ :where(h1, h2, h3, h4) {
40
+ font-family: var(--pm-font-display);
41
+ line-height: var(--pm-line-height-tight);
42
+ letter-spacing: -0.015em;
43
+ text-wrap: balance;
44
+ }
45
+ :where(h1) { font-size: var(--pm-font-size-4xl); font-weight: var(--pm-font-weight-bold); }
46
+ :where(h2) { font-size: var(--pm-font-size-3xl); font-weight: var(--pm-font-weight-bold); }
47
+ :where(h3) { font-size: var(--pm-font-size-2xl); font-weight: var(--pm-font-weight-semibold); }
48
+ :where(h4) { font-size: var(--pm-font-size-xl); font-weight: var(--pm-font-weight-semibold); }
49
+ :where(p, li) { text-wrap: pretty; }
50
+ :where(a) { color: var(--pm-color-accent-text); text-underline-offset: 0.2em; text-decoration-thickness: 0.08em; }
51
+ :where(a:hover) { text-decoration-thickness: 0.14em; }
52
+ :where(code, kbd, samp, pre) { font-family: var(--pm-font-mono); font-size: 0.92em; }
53
+ :where(hr) { border: 0; border-block-start: 1px solid var(--pm-color-border); margin-block: var(--pm-space-6); }
54
+ ::selection { background: var(--pm-color-selection); }
55
+
56
+ /* One consistent, high-contrast focus ring (≥ 3:1) for every interactive element. */
57
+ :where(:focus-visible) {
58
+ outline: 2px solid var(--pm-color-ring);
59
+ outline-offset: 2px;
60
+ }
61
+
62
+ /* ---------- Touch & mobile ---------- */
63
+ /* Native-size hit targets on touch screens (44 px, Apple HIG / Material 48 dp ≈ 44 CSS px). */
64
+ @media (pointer: coarse) {
65
+ :where(:root) { --pm-touch-min: 2.75rem; --pm-touch-min-sm: 2.25rem; }
66
+ /* iOS zooms into fields with text under 16 px; keep form text at 16 px on touch screens. */
67
+ :where(input:not([type=checkbox], [type=radio], [type=range]), select, textarea) { font-size: max(1rem, 1em); }
68
+ }
69
+ /* No 300 ms double-tap delay and no grey tap flash on controls; content still pinch-zooms. */
70
+ :where(a, button, input, select, textarea, label, summary, [role="button"], [tabindex]) {
71
+ touch-action: manipulation;
72
+ -webkit-tap-highlight-color: transparent;
73
+ }
74
+ /* Notch / home-indicator safe areas (needs <meta name="viewport" content="…, viewport-fit=cover">). */
75
+ :where(:root) {
76
+ --pm-safe-top: env(safe-area-inset-top, 0px);
77
+ --pm-safe-bottom: env(safe-area-inset-bottom, 0px);
78
+ --pm-safe-left: env(safe-area-inset-left, 0px);
79
+ --pm-safe-right: env(safe-area-inset-right, 0px);
80
+ }
81
+ /* Scroll chaining stops at overlays, so the page behind a sheet does not move. */
82
+ :where(dialog, [popover]) { overscroll-behavior: contain; }
83
+
84
+ /* Hidden popovers before any polyfill loads. */
85
+ @supports not selector(:popover-open) {
86
+ [popover]:not(.\:popover-open) { display: none; }
87
+ }
88
+ }
89
+
90
+ /* Tone context (generated) */
91
+ @layer pm.components {
92
+ :where(:root, [data-theme]) { --pm-tone-solid: var(--pm-color-accent-solid); --pm-tone-solid-hover: var(--pm-color-accent-solid-hover); --pm-tone-on-solid: var(--pm-color-accent-on-solid); --pm-tone-soft: var(--pm-color-accent-soft); --pm-tone-soft-hover: var(--pm-color-accent-soft-hover); --pm-tone-soft-active: var(--pm-color-accent-soft-active); --pm-tone-border: var(--pm-color-accent-border); --pm-tone-border-strong: var(--pm-color-accent-border-strong); --pm-tone-text: var(--pm-color-accent-text); --pm-tone-text-strong: var(--pm-color-accent-text-strong); }
93
+ :where([data-tone="accent"]) { --pm-tone-solid: var(--pm-color-accent-solid); --pm-tone-solid-hover: var(--pm-color-accent-solid-hover); --pm-tone-on-solid: var(--pm-color-accent-on-solid); --pm-tone-soft: var(--pm-color-accent-soft); --pm-tone-soft-hover: var(--pm-color-accent-soft-hover); --pm-tone-soft-active: var(--pm-color-accent-soft-active); --pm-tone-border: var(--pm-color-accent-border); --pm-tone-border-strong: var(--pm-color-accent-border-strong); --pm-tone-text: var(--pm-color-accent-text); --pm-tone-text-strong: var(--pm-color-accent-text-strong); }
94
+ :where([data-tone="secondary"]) { --pm-tone-solid: var(--pm-color-secondary-solid); --pm-tone-solid-hover: var(--pm-color-secondary-solid-hover); --pm-tone-on-solid: var(--pm-color-secondary-on-solid); --pm-tone-soft: var(--pm-color-secondary-soft); --pm-tone-soft-hover: var(--pm-color-secondary-soft-hover); --pm-tone-soft-active: var(--pm-color-secondary-soft-active); --pm-tone-border: var(--pm-color-secondary-border); --pm-tone-border-strong: var(--pm-color-secondary-border-strong); --pm-tone-text: var(--pm-color-secondary-text); --pm-tone-text-strong: var(--pm-color-secondary-text-strong); }
95
+ :where([data-tone="neutral"]) { --pm-tone-solid: var(--pm-color-neutral-solid); --pm-tone-solid-hover: var(--pm-color-neutral-solid-hover); --pm-tone-on-solid: var(--pm-color-neutral-on-solid); --pm-tone-soft: var(--pm-color-neutral-soft); --pm-tone-soft-hover: var(--pm-color-neutral-soft-hover); --pm-tone-soft-active: var(--pm-color-neutral-soft-active); --pm-tone-border: var(--pm-color-neutral-border); --pm-tone-border-strong: var(--pm-color-neutral-border-strong); --pm-tone-text: var(--pm-color-neutral-text); --pm-tone-text-strong: var(--pm-color-neutral-text-strong); }
96
+ :where([data-tone="success"]) { --pm-tone-solid: var(--pm-color-success-solid); --pm-tone-solid-hover: var(--pm-color-success-solid-hover); --pm-tone-on-solid: var(--pm-color-success-on-solid); --pm-tone-soft: var(--pm-color-success-soft); --pm-tone-soft-hover: var(--pm-color-success-soft-hover); --pm-tone-soft-active: var(--pm-color-success-soft-active); --pm-tone-border: var(--pm-color-success-border); --pm-tone-border-strong: var(--pm-color-success-border-strong); --pm-tone-text: var(--pm-color-success-text); --pm-tone-text-strong: var(--pm-color-success-text-strong); }
97
+ :where([data-tone="warning"]) { --pm-tone-solid: var(--pm-color-warning-solid); --pm-tone-solid-hover: var(--pm-color-warning-solid-hover); --pm-tone-on-solid: var(--pm-color-warning-on-solid); --pm-tone-soft: var(--pm-color-warning-soft); --pm-tone-soft-hover: var(--pm-color-warning-soft-hover); --pm-tone-soft-active: var(--pm-color-warning-soft-active); --pm-tone-border: var(--pm-color-warning-border); --pm-tone-border-strong: var(--pm-color-warning-border-strong); --pm-tone-text: var(--pm-color-warning-text); --pm-tone-text-strong: var(--pm-color-warning-text-strong); }
98
+ :where([data-tone="danger"]) { --pm-tone-solid: var(--pm-color-danger-solid); --pm-tone-solid-hover: var(--pm-color-danger-solid-hover); --pm-tone-on-solid: var(--pm-color-danger-on-solid); --pm-tone-soft: var(--pm-color-danger-soft); --pm-tone-soft-hover: var(--pm-color-danger-soft-hover); --pm-tone-soft-active: var(--pm-color-danger-soft-active); --pm-tone-border: var(--pm-color-danger-border); --pm-tone-border-strong: var(--pm-color-danger-border-strong); --pm-tone-text: var(--pm-color-danger-text); --pm-tone-text-strong: var(--pm-color-danger-text-strong); }
99
+ :where([data-tone="info"]) { --pm-tone-solid: var(--pm-color-info-solid); --pm-tone-solid-hover: var(--pm-color-info-solid-hover); --pm-tone-on-solid: var(--pm-color-info-on-solid); --pm-tone-soft: var(--pm-color-info-soft); --pm-tone-soft-hover: var(--pm-color-info-soft-hover); --pm-tone-soft-active: var(--pm-color-info-soft-active); --pm-tone-border: var(--pm-color-info-border); --pm-tone-border-strong: var(--pm-color-info-border-strong); --pm-tone-text: var(--pm-color-info-text); --pm-tone-text-strong: var(--pm-color-info-text-strong); }
100
+ }
101
+
102
+ /* Button — <button class="pm-button" data-variant="solid|soft|outline|ghost|link" data-tone data-size> */
103
+ @layer pm.components {
104
+ :where(.pm-button) {
105
+ --_h: var(--pm-control-height-md);
106
+ --_px: calc(var(--pm-space-4) * var(--pm-density, 1));
107
+ --_fs: var(--pm-font-size-sm);
108
+ --_bg: var(--pm-tone-solid);
109
+ --_bg-hover: var(--pm-tone-solid-hover);
110
+ --_fg: var(--pm-tone-on-solid);
111
+ --_border: transparent;
112
+ --_image: var(--pm-sf-solid-image, none);
113
+ --_shadow: var(--pm-sf-raise, none);
114
+ --_shadow-active: var(--pm-sf-press, none);
115
+
116
+ display: inline-flex;
117
+ align-items: center;
118
+ justify-content: center;
119
+ gap: 0.5em;
120
+ min-block-size: var(--_h);
121
+ min-inline-size: var(--_h);
122
+ padding-inline: var(--_px);
123
+ border: 1px solid var(--_border);
124
+ border-radius: var(--pm-radius-control, var(--pm-radius-md));
125
+ background: var(--_image), var(--_bg);
126
+ color: var(--_fg);
127
+ box-shadow: var(--_shadow);
128
+ font: inherit;
129
+ font-size: var(--_fs);
130
+ font-weight: var(--pm-font-weight-semibold);
131
+ line-height: 1;
132
+ white-space: nowrap;
133
+ text-decoration: none;
134
+ cursor: pointer;
135
+ user-select: none;
136
+ -webkit-tap-highlight-color: transparent;
137
+ corner-shape: squircle;
138
+ transition:
139
+ background-color var(--pm-duration-fast) var(--pm-ease-standard),
140
+ border-color var(--pm-duration-fast) var(--pm-ease-standard),
141
+ color var(--pm-duration-fast) var(--pm-ease-standard),
142
+ box-shadow var(--pm-duration-normal) var(--pm-ease-standard);
143
+
144
+ @media (prefers-reduced-motion: no-preference) {
145
+ transition:
146
+ background-color var(--pm-duration-fast) var(--pm-ease-standard),
147
+ border-color var(--pm-duration-fast) var(--pm-ease-standard),
148
+ color var(--pm-duration-fast) var(--pm-ease-standard),
149
+ box-shadow var(--pm-duration-normal) var(--pm-ease-standard),
150
+ scale var(--pm-duration-normal) var(--pm-ease-spring);
151
+ }
152
+
153
+ &:hover:not(:disabled, [aria-disabled="true"]) { --_bg: var(--_bg-hover); }
154
+ &:active:not(:disabled, [aria-disabled="true"]) {
155
+ --_shadow: var(--_shadow-active);
156
+ @media (prefers-reduced-motion: no-preference) { scale: 0.97; }
157
+ }
158
+ &:is(:disabled, [aria-disabled="true"]) {
159
+ cursor: not-allowed;
160
+ opacity: 0.55;
161
+ box-shadow: none;
162
+ }
163
+ & > svg { inline-size: 1.15em; block-size: 1.15em; flex: none; }
164
+ }
165
+
166
+ /* Variants */
167
+ :where(.pm-button[data-variant="soft"]) {
168
+ --_bg: color-mix(in oklab, var(--pm-tone-soft) var(--pm-sf-soft-mix, 100%), transparent);
169
+ --_bg-hover: color-mix(in oklab, var(--pm-tone-soft-hover) var(--pm-sf-soft-mix, 100%), transparent);
170
+ --_fg: var(--pm-tone-text);
171
+ --_image: none;
172
+ }
173
+ :where(.pm-button[data-variant="outline"]) {
174
+ --_bg: transparent;
175
+ --_bg-hover: var(--pm-tone-soft);
176
+ --_fg: var(--pm-tone-text);
177
+ --_border: var(--pm-tone-border-strong);
178
+ --_image: none;
179
+ --_shadow: none;
180
+ }
181
+ :where(.pm-button[data-variant="ghost"]) {
182
+ --_bg: transparent;
183
+ --_bg-hover: var(--pm-tone-soft);
184
+ --_fg: var(--pm-tone-text);
185
+ --_image: none;
186
+ --_shadow: none;
187
+ --_shadow-active: none;
188
+ }
189
+ :where(.pm-button[data-variant="link"]) {
190
+ --_bg: transparent;
191
+ --_bg-hover: transparent;
192
+ --_fg: var(--pm-tone-text);
193
+ --_image: none;
194
+ --_shadow: none;
195
+ --_shadow-active: none;
196
+ --_px: 0;
197
+ min-inline-size: 0;
198
+ text-decoration: underline;
199
+ text-underline-offset: 0.2em;
200
+ }
201
+
202
+ /* Sizes */
203
+ :where(.pm-button[data-size="xs"]) { --_h: var(--pm-control-height-xs); --_px: calc(var(--pm-space-2) * var(--pm-density, 1)); --_fs: var(--pm-font-size-xs); }
204
+ :where(.pm-button[data-size="sm"]) { --_h: var(--pm-control-height-sm); --_px: calc(var(--pm-space-3) * var(--pm-density, 1)); --_fs: var(--pm-font-size-sm); }
205
+ :where(.pm-button[data-size="lg"]) { --_h: var(--pm-control-height-lg); --_px: calc(var(--pm-space-5) * var(--pm-density, 1)); --_fs: var(--pm-font-size-md); }
206
+ :where(.pm-button[data-size="xl"]) { --_h: var(--pm-control-height-xl); --_px: calc(var(--pm-space-6) * var(--pm-density, 1)); --_fs: var(--pm-font-size-lg); }
207
+
208
+ /* Icon-only button: square, needs aria-label */
209
+ :where(.pm-button[data-icon]) {
210
+ --_px: 0;
211
+ inline-size: var(--_h);
212
+ /* The glyph is the whole label: a little larger than in a text button. */
213
+ --pm-icon-size: 1.3em;
214
+ & > svg { inline-size: 1.3em; block-size: 1.3em; }
215
+ }
216
+
217
+ /* Loading: keep width, show spinner, block interaction */
218
+ :where(.pm-button[data-loading]) {
219
+ position: relative;
220
+ color: transparent;
221
+ pointer-events: none;
222
+ &::after {
223
+ content: "";
224
+ position: absolute;
225
+ inset: 0;
226
+ margin: auto;
227
+ inline-size: 1.1em;
228
+ block-size: 1.1em;
229
+ border: 2px solid var(--_fg);
230
+ border-inline-end-color: transparent;
231
+ border-radius: 50%;
232
+ @media (prefers-reduced-motion: no-preference) {
233
+ animation: pm-spin 0.7s linear infinite;
234
+ }
235
+ }
236
+ }
237
+
238
+ /* Button group: joined edges */
239
+ :where(.pm-button-group) {
240
+ display: inline-flex;
241
+ isolation: isolate;
242
+ & > :where(.pm-button) { border-radius: 0; }
243
+ & > :where(.pm-button:first-child) {
244
+ border-start-start-radius: var(--pm-radius-control, var(--pm-radius-md));
245
+ border-end-start-radius: var(--pm-radius-control, var(--pm-radius-md));
246
+ }
247
+ & > :where(.pm-button:last-child) {
248
+ border-start-end-radius: var(--pm-radius-control, var(--pm-radius-md));
249
+ border-end-end-radius: var(--pm-radius-control, var(--pm-radius-md));
250
+ }
251
+ & > :where(.pm-button:not(:first-child)) { margin-inline-start: -1px; }
252
+ & > :where(.pm-button:focus-visible) { z-index: 1; }
253
+ }
254
+
255
+ @keyframes pm-spin { to { rotate: 1turn; } }
256
+
257
+ @media (forced-colors: active) {
258
+ :where(.pm-button) { border-color: ButtonText; }
259
+ }
260
+ }
261
+
262
+ /* Surface */
263
+ @layer pm.components {
264
+ /* ---------- Surface container (applies the active surface style) ---------- */
265
+ :where(.pm-surface, .pm-card) {
266
+ border: 1px solid var(--pm-sf-border);
267
+ border-radius: var(--pm-radius-xl);
268
+ background: var(--pm-sf-image), var(--pm-sf-bg);
269
+ box-shadow: var(--pm-sf-shadow);
270
+ backdrop-filter: var(--pm-sf-backdrop);
271
+ -webkit-backdrop-filter: var(--pm-sf-backdrop);
272
+ color: var(--pm-color-fg);
273
+ corner-shape: squircle;
274
+ }
275
+ /* Elevation override */
276
+ :where([data-elevation="0"]) { --pm-sf-shadow: none; }
277
+ :where([data-elevation="1"]) { --pm-sf-shadow: var(--pm-elevation-1); }
278
+ :where([data-elevation="2"]) { --pm-sf-shadow: var(--pm-elevation-2); }
279
+ :where([data-elevation="3"]) { --pm-sf-shadow: var(--pm-elevation-3); }
280
+ :where([data-elevation="4"]) { --pm-sf-shadow: var(--pm-elevation-4); }
281
+ :where([data-elevation="5"]) { --pm-sf-shadow: var(--pm-elevation-5); }
282
+ }
283
+
284
+ /* Card */
285
+ @layer pm.components {
286
+ /* ---------- Card ---------- */
287
+ :where(.pm-card) {
288
+ --_pad: calc(var(--pm-space-6) * var(--pm-density, 1));
289
+ display: flex;
290
+ flex-direction: column;
291
+ gap: var(--pm-space-4);
292
+ padding: var(--_pad);
293
+ & > :where(header) { display: grid; gap: var(--pm-space-1); }
294
+ & :where(.pm-card-title) { font-size: var(--pm-font-size-lg); font-weight: var(--pm-font-weight-semibold); line-height: var(--pm-line-height-snug); }
295
+ & :where(.pm-card-description) { color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-sm); }
296
+ & > :where(footer) { display: flex; gap: var(--pm-space-2); justify-content: flex-end; flex-wrap: wrap; }
297
+ & > :where(.pm-card-media) {
298
+ margin: calc(var(--_pad) * -1) calc(var(--_pad) * -1) 0;
299
+ border-start-start-radius: inherit;
300
+ border-start-end-radius: inherit;
301
+ overflow: hidden;
302
+ & > :where(img, video) { inline-size: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
303
+ }
304
+ }
305
+ :where(.pm-card[data-size="sm"]) { --_pad: calc(var(--pm-space-4) * var(--pm-density, 1)); border-radius: var(--pm-radius-lg); }
306
+ :where(.pm-card[data-interactive]) {
307
+ cursor: pointer;
308
+ @media (prefers-reduced-motion: no-preference) {
309
+ transition: translate var(--pm-duration-moderate) var(--pm-ease-spring), box-shadow var(--pm-duration-moderate);
310
+ &:hover { translate: 0 -2px; }
311
+ }
312
+ &:hover { box-shadow: var(--pm-sf-shadow), var(--pm-elevation-3); }
313
+ }
314
+ }
315
+
316
+ /* Badge */
317
+ @layer pm.components {
318
+ /* ---------- Badge ---------- */
319
+ :where(.pm-badge) {
320
+ display: inline-flex;
321
+ align-items: center;
322
+ gap: 0.35em;
323
+ padding: 0.2em 0.6em;
324
+ border: 1px solid transparent;
325
+ border-radius: var(--pm-radius-full);
326
+ background: var(--pm-tone-soft);
327
+ color: var(--pm-tone-text);
328
+ font-size: var(--pm-font-size-xs);
329
+ font-weight: var(--pm-font-weight-semibold);
330
+ line-height: 1.3;
331
+ white-space: nowrap;
332
+ & > :where(.pm-badge-dot) { inline-size: 0.5em; block-size: 0.5em; border-radius: 50%; background: currentColor; }
333
+ }
334
+ :where(.pm-badge[data-variant="solid"]) { background: var(--pm-sf-solid-image, none), var(--pm-tone-solid); color: var(--pm-tone-on-solid); }
335
+ :where(.pm-badge[data-variant="outline"]) { background: transparent; border-color: var(--pm-tone-border-strong); }
336
+ :where(.pm-badge[data-size="lg"]) { font-size: var(--pm-font-size-sm); }
337
+ }
338
+
339
+ /* Avatar */
340
+ @layer pm.components {
341
+ /* ---------- Avatar ---------- */
342
+ :where(.pm-avatar) {
343
+ --_size: 2.5rem;
344
+ position: relative;
345
+ display: inline-grid;
346
+ place-items: center;
347
+ flex: none;
348
+ inline-size: var(--_size);
349
+ block-size: var(--_size);
350
+ border-radius: 50%;
351
+ background: var(--pm-tone-soft);
352
+ color: var(--pm-tone-text);
353
+ font-size: calc(var(--_size) * 0.4);
354
+ font-weight: var(--pm-font-weight-semibold);
355
+ overflow: hidden;
356
+ user-select: none;
357
+ & > :where(img) { inline-size: 100%; block-size: 100%; object-fit: cover; }
358
+ }
359
+ :where(.pm-avatar[data-size="xs"]) { --_size: 1.5rem; }
360
+ :where(.pm-avatar[data-size="sm"]) { --_size: 2rem; }
361
+ :where(.pm-avatar[data-size="lg"]) { --_size: 3rem; }
362
+ :where(.pm-avatar[data-size="xl"]) { --_size: 4rem; }
363
+ :where(.pm-avatar[data-shape="square"]) { border-radius: var(--pm-radius-md); }
364
+ :where(.pm-avatar-group) {
365
+ display: inline-flex;
366
+ & > :where(.pm-avatar) { box-shadow: 0 0 0 2px var(--pm-color-bg-surface); }
367
+ & > :where(.pm-avatar:not(:first-child)) { margin-inline-start: calc(var(--_size, 2.5rem) * -0.2); }
368
+ }
369
+ }
370
+
371
+ /* Alert */
372
+ @layer pm.components {
373
+ /* ---------- Alert / callout ---------- */
374
+ :where(.pm-alert) {
375
+ display: grid;
376
+ grid-template-columns: auto 1fr auto;
377
+ gap: var(--pm-space-1) var(--pm-space-3);
378
+ align-items: start;
379
+ padding: calc(var(--pm-space-4) * var(--pm-density, 1));
380
+ border: 1px solid var(--pm-tone-border);
381
+ border-radius: var(--pm-radius-lg);
382
+ background: color-mix(in oklab, var(--pm-tone-soft) var(--pm-sf-soft-mix, 100%), transparent);
383
+ backdrop-filter: var(--pm-sf-backdrop);
384
+ color: var(--pm-color-fg);
385
+ font-size: var(--pm-font-size-sm);
386
+ & > :where(.pm-alert-icon) { color: var(--pm-tone-text); grid-row: span 2; display: grid; place-items: center; block-size: 1.5em; }
387
+ & > :where(.pm-alert-title) { font-weight: var(--pm-font-weight-semibold); color: var(--pm-tone-text-strong); }
388
+ & > :where(.pm-alert-body) { grid-column: 2; color: var(--pm-color-fg); }
389
+ & > :where(.pm-alert-actions) { grid-column: 3; grid-row: 1 / span 2; }
390
+ }
391
+ :where(.pm-alert[data-variant="solid"]) {
392
+ background: var(--pm-tone-solid);
393
+ border-color: transparent;
394
+ color: var(--pm-tone-on-solid);
395
+ & > :where(.pm-alert-icon, .pm-alert-title, .pm-alert-body) { color: inherit; }
396
+ }
397
+ :where(.pm-alert[data-variant="outline"]) { background: transparent; border-color: var(--pm-tone-border-strong); }
398
+ }
399
+
400
+ /* Progress */
401
+ @layer pm.components {
402
+ /* ---------- Progress ---------- */
403
+ :where(.pm-progress) {
404
+ --_h: 0.5rem;
405
+ appearance: none;
406
+ inline-size: 100%;
407
+ block-size: var(--_h);
408
+ border: 0;
409
+ border-radius: 999px;
410
+ background: var(--pm-color-bg-active);
411
+ color: var(--pm-tone-solid);
412
+ overflow: hidden;
413
+ box-shadow: var(--pm-sf-control-shadow, none);
414
+ &::-webkit-progress-bar { background: transparent; }
415
+ &::-webkit-progress-value {
416
+ background: var(--pm-sf-solid-image, none), var(--pm-tone-solid);
417
+ border-radius: 999px;
418
+ @media (prefers-reduced-motion: no-preference) { transition: inline-size var(--pm-duration-slow) var(--pm-ease-standard); }
419
+ }
420
+ &::-moz-progress-bar { background: var(--pm-tone-solid); border-radius: 999px; }
421
+ /* Indeterminate: a sliding bar; slowed (not removed) for reduced motion */
422
+ &:indeterminate {
423
+ background: linear-gradient(90deg, transparent, var(--pm-tone-solid), transparent) 0 0 / 40% 100% no-repeat, var(--pm-color-bg-active);
424
+ animation: pm-progress-slide 1.2s var(--pm-ease-standard) infinite;
425
+ @media (prefers-reduced-motion: reduce) { animation-duration: 6s; }
426
+ &::-webkit-progress-value { background: transparent; }
427
+ &::-moz-progress-bar { background: transparent; }
428
+ }
429
+ }
430
+ :where(.pm-progress[data-size="sm"]) { --_h: 0.25rem; }
431
+ :where(.pm-progress[data-size="lg"]) { --_h: 0.75rem; }
432
+ @keyframes pm-progress-slide {
433
+ from { background-position: -40% 0, 0 0; }
434
+ to { background-position: 140% 0, 0 0; }
435
+ }
436
+ }
437
+
438
+ /* Spinner */
439
+ @layer pm.components {
440
+ /* ---------- Spinner: <span class="pm-spinner" role="status" aria-label="Loading"> ---------- */
441
+ :where(.pm-spinner) {
442
+ --_size: 1.25em;
443
+ display: inline-block;
444
+ inline-size: var(--_size);
445
+ block-size: var(--_size);
446
+ border-radius: 50%;
447
+ border: 2.5px solid color-mix(in oklab, var(--pm-tone-solid) 25%, transparent);
448
+ border-block-start-color: var(--pm-tone-solid);
449
+ animation: pm-spin 0.75s linear infinite;
450
+ /* Reduced motion: keep a slow rotation so busy state is still communicated */
451
+ @media (prefers-reduced-motion: reduce) { animation-duration: 2.4s; }
452
+ }
453
+ :where(.pm-spinner[data-size="sm"]) { --_size: 1em; }
454
+ :where(.pm-spinner[data-size="lg"]) { --_size: 2em; }
455
+ }
456
+
457
+ /* Skeleton */
458
+ @layer pm.components {
459
+ /* ---------- Skeleton ---------- */
460
+ :where(.pm-skeleton) {
461
+ display: block;
462
+ min-block-size: 1em;
463
+ border-radius: var(--pm-radius-sm);
464
+ background: var(--pm-color-bg-muted);
465
+ @media (prefers-reduced-motion: no-preference) {
466
+ background:
467
+ linear-gradient(90deg in oklab, transparent, color-mix(in oklab, var(--pm-color-bg-surface) 70%, transparent), transparent) 0 0 / 50% 100% no-repeat,
468
+ var(--pm-color-bg-muted);
469
+ animation: pm-shimmer 1.6s var(--pm-ease-standard) infinite;
470
+ }
471
+ }
472
+ :where(.pm-skeleton[data-shape="circle"]) { border-radius: 50%; aspect-ratio: 1; }
473
+ :where(.pm-skeleton[data-shape="text"]) { block-size: 0.8em; margin-block: 0.25em; }
474
+ @keyframes pm-shimmer {
475
+ from { background-position: -50% 0, 0 0; }
476
+ to { background-position: 150% 0, 0 0; }
477
+ }
478
+ }
479
+
480
+ /* Table — plain <table class="pm-table"> (zero JS), plus the frame shared by <pm-table> and <pm-data-table> */
481
+ @layer pm.components {
482
+ /* ---------- Table ---------- */
483
+ :where(.pm-table) {
484
+ inline-size: 100%;
485
+ border-collapse: separate;
486
+ border-spacing: 0;
487
+ font-size: var(--pm-font-size-sm);
488
+ font-variant-numeric: tabular-nums;
489
+ & :where(th, td) {
490
+ padding: calc(var(--pm-space-2) * var(--pm-density, 1)) var(--pm-space-3);
491
+ border-block-end: 1px solid var(--pm-color-border);
492
+ text-align: start;
493
+ vertical-align: middle;
494
+ }
495
+ & :where(th) { color: var(--pm-color-fg-muted); font-weight: var(--pm-font-weight-semibold); font-size: var(--pm-font-size-xs); }
496
+ & :where(th[data-align="end"], td[data-align="end"]) { text-align: end; }
497
+ & :where(th[data-align="center"], td[data-align="center"]) { text-align: center; }
498
+ & :where(td[data-nowrap]) { white-space: nowrap; }
499
+ & :where(td[data-align="end"]) { font-variant-numeric: tabular-nums; }
500
+ & :where(tbody tr:last-child) :where(td) { border-block-end: 0; }
501
+ & :where(tbody tr) { --_row: transparent; background: var(--_row); }
502
+ &:where([data-striped]) :where(tbody tr:nth-child(even)) { --_row: var(--pm-color-bg-subtle); }
503
+ &:where([data-hover]) :where(tbody tr:hover) { --_row: var(--pm-color-bg-hover); }
504
+ & :where(tbody tr[aria-selected="true"]) { --_row: var(--pm-tone-soft); }
505
+ & :where(.pm-table-empty) { padding: var(--pm-space-10) var(--pm-space-4); text-align: center; color: var(--pm-color-fg-muted); }
506
+ }
507
+
508
+ /* ---------- Frame: border, scroll area, sticky header ---------- */
509
+ :where(.pm-table-wrap) {
510
+ position: relative;
511
+ border: 1px solid var(--pm-color-border);
512
+ border-radius: var(--pm-radius-lg);
513
+ background: var(--pm-color-bg-surface);
514
+ overflow: hidden;
515
+ }
516
+ :where(.pm-table-scroll) {
517
+ overflow: auto;
518
+ max-block-size: var(--pm-table-max-height, var(--pm-data-table-max-height, none));
519
+ overscroll-behavior-inline: contain;
520
+ &:focus-visible { outline: 2px solid var(--pm-color-ring); outline-offset: -2px; }
521
+ }
522
+ :where(.pm-table-wrap) :where(.pm-table) {
523
+ & :where(thead) { position: sticky; inset-block-start: 0; z-index: 3; }
524
+ & :where(thead th) { background: var(--pm-color-bg-subtle); white-space: nowrap; }
525
+ }
526
+ :where(.pm-sort) {
527
+ min-block-size: 1.5rem; /* WCAG 2.5.8 target size */
528
+ display: inline-flex;
529
+ align-items: center;
530
+ gap: var(--pm-space-1);
531
+ margin-inline: calc(var(--pm-space-1) * -1);
532
+ padding: 2px var(--pm-space-1);
533
+ border: 0;
534
+ border-radius: var(--pm-radius-sm);
535
+ background: none;
536
+ color: inherit;
537
+ font: inherit;
538
+ cursor: pointer;
539
+ &:hover { color: var(--pm-color-fg); background: var(--pm-color-bg-hover); }
540
+ &:focus-visible { outline: 2px solid var(--pm-color-ring); }
541
+ & :where(svg) { opacity: 0.35; }
542
+ &[data-dir] :where(svg) { opacity: 1; color: var(--pm-tone-text); }
543
+ }
544
+
545
+ /* ---------- Narrow containers (phones, side panels): rows become labelled cards ---------- */
546
+ :where(.pm-table-wrap[data-stack="auto"]) { container: pm-table / inline-size; }
547
+ @container pm-table (width < 36rem) {
548
+ :where(.pm-table-wrap) :where(.pm-table) {
549
+ display: block;
550
+ & :where(caption) { display: block; }
551
+ & :where(thead) { display: block; position: static; border-block-end: 1px solid var(--pm-color-border); }
552
+ & :where(thead tr) { display: flex; flex-wrap: wrap; align-items: center; gap: var(--pm-space-1) var(--pm-space-3); padding: var(--pm-space-2) var(--pm-space-3); }
553
+ & :where(thead th) { position: static; padding: 0; border: 0; background: none; inline-size: auto !important; }
554
+ & :where(tbody, tfoot) { display: grid; }
555
+ & :where(tbody tr, tfoot tr) { display: grid; gap: var(--pm-space-1); padding: var(--pm-space-3); border-block-end: 1px solid var(--pm-color-border); position: relative; background: var(--_row); }
556
+ & :where(tbody tr:last-child) { border-block-end: 0; }
557
+ & :where(tbody td, tfoot td) {
558
+ display: grid;
559
+ grid-template-columns: minmax(6rem, 40%) 1fr;
560
+ gap: var(--pm-space-3);
561
+ padding: 0;
562
+ border: 0;
563
+ text-align: start;
564
+ position: static;
565
+ background: none;
566
+ }
567
+ & :where(td[data-label])::before { content: attr(data-label); color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-xs); font-weight: var(--pm-font-weight-semibold); align-self: center; }
568
+ & :where(tbody td.pm-table-empty) { display: block; }
569
+ }
570
+ }
571
+ }
572
+
573
+ /* Field */
574
+ @layer pm.components {
575
+ :where(:root, :host) { --pm-icon-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 8v4.5m0 3.5h.01'/%3E%3C/svg%3E"); }
576
+ /* ---------- Field wrapper: label, hint, error ---------- */
577
+ :where(.pm-field) {
578
+ display: grid;
579
+ gap: var(--pm-space-1-5);
580
+ & > :where(label, .pm-label) {
581
+ font-size: var(--pm-font-size-sm);
582
+ font-weight: var(--pm-font-weight-medium);
583
+ }
584
+ & :where(.pm-hint) { font-size: var(--pm-font-size-xs); color: var(--pm-color-fg-muted); }
585
+ & :where(.pm-error) {
586
+ display: flex;
587
+ gap: 0.4em;
588
+ align-items: center;
589
+ font-size: var(--pm-font-size-xs);
590
+ color: var(--pm-color-danger-text);
591
+ /* Not colour alone: an icon marks the error (WCAG 1.4.1). */
592
+ &::before {
593
+ content: "";
594
+ flex: none;
595
+ inline-size: 1.15em;
596
+ block-size: 1.15em;
597
+ background: currentColor;
598
+ mask: var(--pm-icon-alert) center / contain no-repeat;
599
+ @media (forced-colors: active) { forced-color-adjust: none; background: CanvasText; }
600
+ }
601
+ &:is([hidden], :empty) { display: none; }
602
+ }
603
+ &:not(:has(:user-invalid, [aria-invalid="true"])) :where(.pm-error[data-auto]) { display: none; }
604
+ }
605
+ :where(.pm-label[data-required])::after,
606
+ :where(.pm-field:has(:required) > label)::after { content: " *"; content: " *" / ""; color: var(--pm-color-danger-text); }
607
+ }
608
+
609
+ /* Input */
610
+ @layer pm.components {
611
+ /* ---------- Text inputs & textarea ---------- */
612
+ :where(.pm-input, .pm-select) {
613
+ --_h: var(--pm-control-height-md);
614
+ --_px: calc(var(--pm-space-3) * var(--pm-density, 1));
615
+ --_border: var(--pm-sf-control-border, var(--pm-color-border-strong));
616
+
617
+ inline-size: 100%;
618
+ min-block-size: var(--_h);
619
+ padding: 0 var(--_px);
620
+ border: 1px solid var(--_border);
621
+ border-radius: var(--pm-radius-control, var(--pm-radius-md));
622
+ background: var(--pm-sf-control-bg, var(--pm-color-bg-surface));
623
+ box-shadow: var(--pm-sf-control-shadow, none);
624
+ color: var(--pm-color-fg);
625
+ font: inherit;
626
+ font-size: var(--pm-font-size-sm);
627
+ corner-shape: squircle;
628
+ transition:
629
+ border-color var(--pm-duration-fast) var(--pm-ease-standard),
630
+ box-shadow var(--pm-duration-fast) var(--pm-ease-standard);
631
+
632
+ &::placeholder { color: var(--pm-color-fg-muted); opacity: 1; }
633
+ &:hover:not(:disabled, :focus-visible) { --_border: var(--pm-color-accent-border-strong); }
634
+ &:focus-visible {
635
+ outline: 2px solid var(--pm-color-ring);
636
+ outline-offset: 0;
637
+ --_border: var(--pm-color-ring);
638
+ }
639
+ &:is(:user-invalid, [aria-invalid="true"]) { --_border: var(--pm-color-danger-border-strong); }
640
+ &:is(:user-invalid, [aria-invalid="true"]):focus-visible { outline-color: var(--pm-color-danger-solid); }
641
+ &:disabled { opacity: 0.55; cursor: not-allowed; }
642
+ &[readonly] { background: var(--pm-color-bg-muted); }
643
+ }
644
+ :where(textarea.pm-input) {
645
+ padding-block: calc(var(--pm-space-2) * var(--pm-density, 1));
646
+ line-height: var(--pm-line-height-normal);
647
+ resize: vertical;
648
+ field-sizing: content;
649
+ min-block-size: 5lh;
650
+ }
651
+ :where(.pm-input, .pm-select)[data-size="sm"] { --_h: var(--pm-control-height-sm); --_px: var(--pm-space-2); }
652
+ :where(.pm-input, .pm-select)[data-size="lg"] { --_h: var(--pm-control-height-lg); --_px: var(--pm-space-4); font-size: var(--pm-font-size-md); }
653
+
654
+ /* Input group with leading/trailing adornments */
655
+ :where(.pm-input-group) {
656
+ position: relative;
657
+ display: flex;
658
+ align-items: center;
659
+ & > :where(.pm-input) { flex: 1; }
660
+ & > :where([data-slot="start"], [data-slot="end"]) {
661
+ position: absolute;
662
+ display: grid;
663
+ place-items: center;
664
+ color: var(--pm-color-fg-muted);
665
+ pointer-events: none;
666
+ min-inline-size: var(--pm-control-height-md);
667
+ padding-inline: var(--pm-space-2-5, 0.625rem);
668
+ font-size: var(--pm-font-size-sm);
669
+ white-space: nowrap;
670
+ }
671
+ & > :where([data-slot="start"]) { inset-inline-start: 0; }
672
+ & > :where([data-slot="end"]) { inset-inline-end: 0; }
673
+ /* Adornment widths are measured into --_start / --_end (falls back to one control height). */
674
+ &:has([data-slot="start"]) > .pm-input { padding-inline-start: var(--_start, var(--pm-control-height-md)); }
675
+ &:has([data-slot="end"], .pm-input-actions) > .pm-input { padding-inline-end: var(--_end, var(--pm-control-height-md)); }
676
+ & > :where(.pm-input-actions) {
677
+ position: absolute;
678
+ inset-inline-end: var(--_end-slot, 0px);
679
+ display: flex;
680
+ align-items: center;
681
+ gap: 2px;
682
+ padding-inline-end: var(--pm-space-1);
683
+ }
684
+ }
685
+ :where(.pm-input-action) {
686
+ display: inline-grid;
687
+ place-items: center;
688
+ inline-size: 1.75rem;
689
+ block-size: 1.75rem;
690
+ padding: 0;
691
+ border: 0;
692
+ border-radius: var(--pm-radius-sm);
693
+ background: transparent;
694
+ color: var(--pm-color-fg-muted);
695
+ font: inherit;
696
+ cursor: pointer;
697
+ &:hover { background: var(--pm-color-bg-hover); color: var(--pm-color-fg); }
698
+ }
699
+ :where(.pm-input-counter) {
700
+ justify-self: end;
701
+ margin-block-start: calc(var(--pm-space-1) * -0.5);
702
+ color: var(--pm-color-fg-muted);
703
+ font-size: var(--pm-font-size-xs);
704
+ font-variant-numeric: tabular-nums;
705
+ &[data-over] { color: var(--pm-color-danger-text); font-weight: var(--pm-font-weight-semibold); }
706
+ }
707
+ /* Touch screens: 16 px text stops iOS from zooming into the field. */
708
+ @media (pointer: coarse) { :where(.pm-input, .pm-select) { font-size: max(1rem, var(--pm-font-size-sm)); } }
709
+ /* Hide native number spinners and search clear (Prismora renders its own) */
710
+ :where(.pm-input[data-custom-controls])::-webkit-inner-spin-button,
711
+ :where(.pm-input[data-custom-controls])::-webkit-outer-spin-button,
712
+ :where(.pm-input[data-custom-controls])::-webkit-search-cancel-button { -webkit-appearance: none; margin: 0; }
713
+ :where(.pm-input[data-custom-controls]) { -moz-appearance: textfield; appearance: textfield; }
714
+ }
715
+
716
+ /* Select */
717
+ @layer pm.components {
718
+ /* ---------- Select (customizable select as progressive enhancement) ---------- */
719
+ :where(.pm-select) {
720
+ padding-inline-end: calc(var(--_px) + 1.5em);
721
+ cursor: pointer;
722
+ appearance: none;
723
+ background-image: var(--pm-chevron);
724
+ background-repeat: no-repeat;
725
+ background-position: right var(--_px) center;
726
+ background-size: 1em;
727
+ &:dir(rtl) { background-position: left var(--_px) center; }
728
+ }
729
+ :where(:root, :host) { --pm-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
730
+
731
+ @supports (appearance: base-select) {
732
+ :where(.pm-select),
733
+ :where(.pm-select)::picker(select) { appearance: base-select; }
734
+ :where(.pm-select) {
735
+ background-image: none;
736
+ padding-inline-end: var(--_px);
737
+ display: flex;
738
+ align-items: center;
739
+ /* The system chevron, not the browser's "▼" glyph: drawn as a mask so it takes the text colour. */
740
+ &::picker-icon {
741
+ content: "";
742
+ flex: none;
743
+ inline-size: 1em;
744
+ block-size: 1em;
745
+ margin-inline-start: auto;
746
+ background: var(--pm-color-fg-muted);
747
+ mask: var(--pm-chevron) center / contain no-repeat;
748
+ @media (forced-colors: active) { forced-color-adjust: none; background: CanvasText; }
749
+ @media (prefers-reduced-motion: no-preference) {
750
+ transition: rotate var(--pm-duration-normal) var(--pm-ease-standard);
751
+ }
752
+ }
753
+ &:open::picker-icon { rotate: 180deg; }
754
+ }
755
+ :where(.pm-select)::picker(select) {
756
+ margin-block: var(--pm-space-1);
757
+ padding: var(--pm-space-1);
758
+ border: 1px solid var(--pm-sf-border, var(--pm-color-border));
759
+ border-radius: var(--pm-radius-lg);
760
+ background: var(--pm-sf-image, none), var(--pm-sf-bg, var(--pm-color-bg-surface));
761
+ backdrop-filter: var(--pm-sf-backdrop, none);
762
+ box-shadow: var(--pm-elevation-4);
763
+ color: var(--pm-color-fg);
764
+ opacity: 1;
765
+ transition: opacity var(--pm-duration-normal), display var(--pm-duration-normal), overlay var(--pm-duration-normal);
766
+ transition-behavior: allow-discrete;
767
+ @starting-style { opacity: 0; }
768
+ }
769
+ :where(.pm-select) option {
770
+ display: flex;
771
+ gap: var(--pm-space-2);
772
+ align-items: center;
773
+ padding: var(--pm-space-2) var(--pm-space-3);
774
+ border-radius: var(--pm-radius-sm);
775
+ cursor: pointer;
776
+ &:is(:hover, :focus-visible) { background: var(--pm-color-bg-hover); outline: none; }
777
+ &:checked { font-weight: var(--pm-font-weight-semibold); }
778
+ &::checkmark { color: var(--pm-color-accent-text); }
779
+ }
780
+ }
781
+ }
782
+
783
+ /* Checkbox */
784
+ @layer pm.components {
785
+ /* ---------- Checkbox & radio (native inputs, custom-drawn for every surface) ---------- */
786
+ :where(.pm-checkbox, .pm-radio) {
787
+ --_size: calc(1.125rem * var(--pm-density, 1));
788
+ appearance: none;
789
+ flex: none;
790
+ display: inline-grid;
791
+ place-content: center;
792
+ inline-size: var(--_size);
793
+ block-size: var(--_size);
794
+ margin: 0;
795
+ border: 1.5px solid var(--pm-sf-control-border, var(--pm-color-border-strong));
796
+ border-radius: var(--pm-radius-xs);
797
+ background: var(--pm-sf-control-bg, var(--pm-color-bg-surface));
798
+ box-shadow: var(--pm-sf-control-shadow, none);
799
+ color: var(--pm-tone-on-solid);
800
+ cursor: pointer;
801
+ vertical-align: middle;
802
+ transition: background-color var(--pm-duration-fast), border-color var(--pm-duration-fast);
803
+
804
+ &::before {
805
+ content: "";
806
+ inline-size: 0.7em;
807
+ block-size: 0.7em;
808
+ background: currentColor;
809
+ scale: 0;
810
+ mask: var(--pm-check-mask) center / contain no-repeat;
811
+ @media (prefers-reduced-motion: no-preference) {
812
+ transition: scale var(--pm-duration-normal) var(--pm-ease-spring);
813
+ }
814
+ }
815
+ /* Radios with nothing chosen also match :indeterminate, so that state is limited to checkboxes. */
816
+ &:is(:checked, [type="checkbox"]:indeterminate) {
817
+ background: var(--pm-tone-solid);
818
+ border-color: var(--pm-tone-solid);
819
+ &::before { scale: 1; }
820
+ }
821
+ &:where([type="checkbox"]):indeterminate::before { mask-image: var(--pm-dash-mask); }
822
+ &:hover:not(:disabled, :checked) { border-color: var(--pm-tone-border-strong); }
823
+ &:disabled { opacity: 0.55; cursor: not-allowed; }
824
+ &:is(:user-invalid, [aria-invalid="true"]) { border-color: var(--pm-color-danger-border-strong); }
825
+ }
826
+ :where(.pm-radio) {
827
+ border-radius: 50%;
828
+ &::before { mask: none; border-radius: 50%; inline-size: 0.45em; block-size: 0.45em; }
829
+ }
830
+ :where(:root, :host) {
831
+ --pm-check-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5 9.5 18 20 6'/%3E%3C/svg%3E");
832
+ --pm-dash-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='4' stroke-linecap='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E");
833
+ }
834
+ /* Label + control row */
835
+ :where(.pm-check-label) {
836
+ display: inline-flex;
837
+ align-items: center;
838
+ gap: var(--pm-space-2);
839
+ font-size: var(--pm-font-size-sm);
840
+ cursor: pointer;
841
+ &:has(:disabled) { cursor: not-allowed; color: var(--pm-color-fg-muted); }
842
+ }
843
+ @media (forced-colors: active) {
844
+ :where(.pm-checkbox, .pm-radio):checked { background: Highlight; border-color: Highlight; }
845
+ }
846
+ }
847
+
848
+ /* Switch */
849
+ @layer pm.components {
850
+ /* ---------- Switch: <input type="checkbox" switch role="switch" class="pm-switch"> ---------- */
851
+ :where(.pm-switch) {
852
+ --_w: calc(2.5rem * var(--pm-density, 1));
853
+ --_h: calc(1.4rem * var(--pm-density, 1));
854
+ --_pad: 3px;
855
+ --_thumb: calc(var(--_h) - var(--_pad) * 2 - 2px);
856
+ appearance: none;
857
+ flex: none;
858
+ position: relative;
859
+ inline-size: var(--_w);
860
+ block-size: var(--_h);
861
+ margin: 0;
862
+ border: 1px solid var(--pm-sf-control-border, var(--pm-color-border-strong));
863
+ border-radius: 999px;
864
+ background: var(--pm-color-bg-active);
865
+ box-shadow: var(--pm-sf-control-shadow, none);
866
+ cursor: pointer;
867
+ transition: background-color var(--pm-duration-normal) var(--pm-ease-standard), border-color var(--pm-duration-normal);
868
+
869
+ &::before {
870
+ content: "";
871
+ position: absolute;
872
+ inset-block-start: var(--_pad);
873
+ inset-inline-start: var(--_pad);
874
+ inline-size: var(--_thumb);
875
+ block-size: var(--_thumb);
876
+ border-radius: 50%;
877
+ background: var(--pm-color-bg-surface);
878
+ /* Thumb outline keeps ≥ 3:1 against the off track */
879
+ box-shadow: 0 0 0 1px var(--pm-color-border-strong), var(--pm-sf-raise, var(--pm-elevation-1));
880
+ @media (prefers-reduced-motion: no-preference) {
881
+ transition: translate var(--pm-duration-moderate) var(--pm-ease-spring);
882
+ }
883
+ }
884
+ &:checked {
885
+ background: var(--pm-sf-solid-image, none), var(--pm-tone-solid);
886
+ border-color: var(--pm-tone-solid);
887
+ &::before {
888
+ translate: calc(var(--_w) - var(--_thumb) - var(--_pad) * 2 - 2px) 0;
889
+ background: var(--pm-tone-on-solid);
890
+ box-shadow: var(--pm-elevation-1);
891
+ }
892
+ &:dir(rtl)::before { translate: calc((var(--_w) - var(--_thumb) - var(--_pad) * 2 - 2px) * -1) 0; }
893
+ }
894
+ &:disabled { opacity: 0.55; cursor: not-allowed; }
895
+ }
896
+ @media (forced-colors: active) {
897
+ :where(.pm-switch):checked { background: Highlight; border-color: Highlight; }
898
+ :where(.pm-switch)::before { background: CanvasText; }
899
+ }
900
+ }
901
+
902
+ /* Slider */
903
+ @layer pm.components {
904
+ /* ---------- Slider: <input type="range" class="pm-slider"> ---------- */
905
+ :where(.pm-slider) {
906
+ --_track: 6px;
907
+ --_thumb: 1.1rem;
908
+ --_fill: var(--pm-value, 50%);
909
+ &[data-size="xs"], &[data-size="sm"] { --_track: 4px; --_thumb: 0.9rem; }
910
+ &[data-size="lg"], &[data-size="xl"] { --_track: 8px; --_thumb: 1.4rem; }
911
+ appearance: none;
912
+ inline-size: 100%;
913
+ block-size: var(--_thumb);
914
+ margin: 0;
915
+ background: transparent;
916
+ cursor: pointer;
917
+ accent-color: var(--pm-tone-solid);
918
+
919
+ &::-webkit-slider-runnable-track {
920
+ block-size: var(--_track);
921
+ border-radius: 999px;
922
+ background: linear-gradient(to right, var(--pm-tone-solid) var(--_fill), var(--pm-color-bg-active) var(--_fill));
923
+ box-shadow: var(--pm-sf-control-shadow, none);
924
+ }
925
+ &::-moz-range-track {
926
+ block-size: var(--_track);
927
+ border-radius: 999px;
928
+ background: var(--pm-color-bg-active);
929
+ }
930
+ &::-moz-range-progress { block-size: var(--_track); border-radius: 999px; background: var(--pm-tone-solid); }
931
+ &::-webkit-slider-thumb {
932
+ appearance: none;
933
+ inline-size: var(--_thumb);
934
+ block-size: var(--_thumb);
935
+ margin-block-start: calc((var(--_track) - var(--_thumb)) / 2);
936
+ border: 2px solid var(--pm-tone-solid);
937
+ border-radius: 50%;
938
+ background: var(--pm-color-bg-surface);
939
+ box-shadow: var(--pm-sf-raise, var(--pm-elevation-1));
940
+ @media (prefers-reduced-motion: no-preference) {
941
+ transition: scale var(--pm-duration-normal) var(--pm-ease-spring);
942
+ }
943
+ }
944
+ &::-moz-range-thumb {
945
+ inline-size: var(--_thumb);
946
+ block-size: var(--_thumb);
947
+ border: 2px solid var(--pm-tone-solid);
948
+ border-radius: 50%;
949
+ background: var(--pm-color-bg-surface);
950
+ }
951
+ &:active::-webkit-slider-thumb { scale: 1.15; }
952
+ &:focus-visible { outline-offset: 4px; }
953
+ &:disabled { opacity: 0.55; cursor: not-allowed; }
954
+ }
955
+ }
956
+
957
+ /* Tabs */
958
+ @layer pm.components {
959
+ /* ---------- Tabs ---------- */
960
+ :where(.pm-tabs) { display: grid; gap: var(--pm-space-4); }
961
+ :where(.pm-tablist) {
962
+ position: relative;
963
+ display: flex;
964
+ gap: var(--pm-space-1);
965
+ overflow-x: auto;
966
+ scrollbar-width: none;
967
+ border-block-end: 1px solid var(--pm-color-border);
968
+ anchor-name: --pm-tablist;
969
+ }
970
+ :where(.pm-tablist [role="tab"], .pm-tab) {
971
+ position: relative;
972
+ flex: none;
973
+ display: inline-flex;
974
+ align-items: center;
975
+ gap: var(--pm-space-2);
976
+ min-block-size: var(--pm-control-height-md);
977
+ padding: 0 var(--pm-space-3);
978
+ border: 0;
979
+ background: transparent;
980
+ color: var(--pm-color-fg-muted);
981
+ font: inherit;
982
+ font-size: var(--pm-font-size-sm);
983
+ font-weight: var(--pm-font-weight-medium);
984
+ cursor: pointer;
985
+ transition: color var(--pm-duration-fast);
986
+ &:hover { color: var(--pm-color-fg); }
987
+ &:focus-visible { outline-offset: -2px; border-radius: var(--pm-radius-sm); }
988
+ /* Selected: colour + a border-drawn underline (survives forced colours). */
989
+ &[aria-selected="true"] {
990
+ color: var(--pm-tone-text);
991
+ &::after {
992
+ content: "";
993
+ position: absolute;
994
+ inset: auto 0 -1px;
995
+ border-block-end: 2px solid var(--pm-tone-solid);
996
+ }
997
+ }
998
+ }
999
+ /* Animated indicator: tether one underline to the selected tab where anchor positioning exists. */
1000
+ @supports (anchor-name: --a) {
1001
+ :where(.pm-tablist[data-animated]) {
1002
+ & [aria-selected="true"] { anchor-name: --pm-selected-tab; &::after { display: none; } }
1003
+ &::after {
1004
+ content: "";
1005
+ position: absolute;
1006
+ position-anchor: --pm-selected-tab;
1007
+ inset-inline-start: anchor(start);
1008
+ inset-inline-end: anchor(end);
1009
+ inset-block-end: 0;
1010
+ border-block-end: 2px solid var(--pm-tone-solid);
1011
+ @media (prefers-reduced-motion: no-preference) {
1012
+ transition: inset-inline-start var(--pm-duration-moderate) var(--pm-ease-spring), inset-inline-end var(--pm-duration-moderate) var(--pm-ease-spring);
1013
+ }
1014
+ }
1015
+ }
1016
+ }
1017
+ /* Pill-style tabs (segmented control look) */
1018
+ :where(.pm-tablist[data-variant="pills"]) {
1019
+ border: 0;
1020
+ padding: var(--pm-space-1);
1021
+ border-radius: var(--pm-radius-lg);
1022
+ background: var(--pm-color-bg-muted);
1023
+ box-shadow: var(--pm-sf-control-shadow, none);
1024
+ inline-size: fit-content;
1025
+ & [role="tab"] { border-radius: var(--pm-radius-md); min-block-size: var(--pm-control-height-sm); }
1026
+ & [role="tab"][aria-selected="true"] {
1027
+ background: var(--pm-color-bg-surface);
1028
+ color: var(--pm-color-fg);
1029
+ box-shadow: var(--pm-sf-raise, var(--pm-elevation-1));
1030
+ outline: 1px solid var(--pm-color-border);
1031
+ &::after { display: none; }
1032
+ }
1033
+ }
1034
+ /* Web-component tabs in pills mode: no underline */
1035
+ :where(pm-tabs[variant="pills"] > pm-tab[aria-selected="true"])::after { display: none; }
1036
+ :where(.pm-tabpanel):focus-visible { outline-offset: 4px; border-radius: var(--pm-radius-sm); }
1037
+ }
1038
+ /* Vertical tabs, closable and disabled tabs */
1039
+ @layer pm.components {
1040
+ :where(.pm-tablist[aria-orientation="vertical"]) {
1041
+ flex-direction: column;
1042
+ border-block-end: 0;
1043
+ border-inline-end: 1px solid var(--pm-color-border);
1044
+ & :where([role="tab"]) { justify-content: flex-start; }
1045
+ & :where([role="tab"][aria-selected="true"])::after { inset: 0 -1px 0 auto; border-block-end: 0; border-inline-end: 2px solid var(--pm-tone-solid); }
1046
+ }
1047
+ :where(pm-tabs[orientation="vertical"] > pm-tab) { justify-content: flex-start; }
1048
+ :where(pm-tabs[orientation="vertical"] > pm-tab[aria-selected="true"])::after { inset: 0 -1px 0 auto; border-block-end: 0; border-inline-end: 2px solid var(--pm-tone-solid); }
1049
+ :where(.pm-tab[aria-disabled="true"], [role="tab"][aria-disabled="true"]) { opacity: 0.45; cursor: not-allowed; }
1050
+ /* Count after a tab label: <span class="pm-tab-count">3</span> (pm-tab count="3" adds it). */
1051
+ :where(.pm-tab-count) {
1052
+ display: inline-grid;
1053
+ place-items: center;
1054
+ min-inline-size: 1.25rem;
1055
+ block-size: 1.25rem;
1056
+ padding-inline: 0.35em;
1057
+ border-radius: var(--pm-radius-full);
1058
+ background: var(--pm-color-bg-muted);
1059
+ color: var(--pm-color-fg-muted);
1060
+ font-size: var(--pm-font-size-xs);
1061
+ font-weight: var(--pm-font-weight-semibold);
1062
+ font-variant-numeric: tabular-nums;
1063
+ line-height: 1;
1064
+ }
1065
+ :where([aria-selected="true"]) > :where(.pm-tab-count) { background: var(--pm-color-accent-soft); color: var(--pm-color-accent-text); }
1066
+ :where(.pm-tab-close) {
1067
+ display: inline-grid;
1068
+ place-items: center;
1069
+ inline-size: 1.25rem;
1070
+ block-size: 1.25rem;
1071
+ margin-inline-end: calc(var(--pm-space-1) * -1);
1072
+ border-radius: var(--pm-radius-sm);
1073
+ color: var(--pm-color-fg-muted);
1074
+ &:hover { background: var(--pm-color-bg-hover); color: var(--pm-color-fg); }
1075
+ @media (pointer: coarse) { inline-size: 1.75rem; block-size: 1.75rem; }
1076
+ }
1077
+ }
1078
+
1079
+ /* Accordion */
1080
+ @layer pm.components {
1081
+ /* ---------- Accordion: <details name="group" class="pm-accordion-item"> ---------- */
1082
+ :where(.pm-accordion) {
1083
+ display: grid;
1084
+ border: 1px solid var(--pm-sf-border, var(--pm-color-border));
1085
+ border-radius: var(--pm-radius-lg);
1086
+ background: var(--pm-sf-image, none), var(--pm-sf-bg, var(--pm-color-bg-surface));
1087
+ backdrop-filter: var(--pm-sf-backdrop, none);
1088
+ overflow: clip;
1089
+ }
1090
+ :where(.pm-accordion-item) {
1091
+ &:not(:last-child) { border-block-end: 1px solid var(--pm-color-border); }
1092
+ & > summary {
1093
+ display: flex;
1094
+ align-items: center;
1095
+ justify-content: space-between;
1096
+ gap: var(--pm-space-3);
1097
+ padding: calc(var(--pm-space-4) * var(--pm-density, 1));
1098
+ font-weight: var(--pm-font-weight-medium);
1099
+ cursor: pointer;
1100
+ list-style: none;
1101
+ &::-webkit-details-marker { display: none; }
1102
+ &::after {
1103
+ content: "";
1104
+ flex: none;
1105
+ inline-size: 1em;
1106
+ block-size: 1em;
1107
+ background: currentColor;
1108
+ mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
1109
+ color: var(--pm-color-fg-muted);
1110
+ @media (prefers-reduced-motion: no-preference) { transition: rotate var(--pm-duration-moderate) var(--pm-ease-standard); }
1111
+ }
1112
+ &:hover { background: var(--pm-color-bg-hover); }
1113
+ &:focus-visible { outline-offset: -2px; }
1114
+ }
1115
+ &[open] > summary::after { rotate: 180deg; }
1116
+ & > summary[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
1117
+ /* Smooth open/close with ::details-content + interpolate-size (progressive). */
1118
+ &::details-content {
1119
+ block-size: 0;
1120
+ overflow: clip;
1121
+ @media (prefers-reduced-motion: no-preference) {
1122
+ transition: block-size var(--pm-duration-moderate) var(--pm-ease-standard), content-visibility var(--pm-duration-moderate);
1123
+ transition-behavior: allow-discrete;
1124
+ }
1125
+ }
1126
+ &[open]::details-content { block-size: auto; }
1127
+ & > :where(:not(summary)) {
1128
+ padding: 0 calc(var(--pm-space-4) * var(--pm-density, 1)) calc(var(--pm-space-4) * var(--pm-density, 1));
1129
+ color: var(--pm-color-fg-muted);
1130
+ }
1131
+ }
1132
+ }
1133
+
1134
+ /* Shared top-layer surface and enter/exit (dialog, drawer, popover, menu, tooltip, toast) */
1135
+ @layer pm.components {
1136
+ /* Shared top-layer surface */
1137
+ :where(.pm-dialog, .pm-drawer, .pm-popover, .pm-menu, .pm-toast) {
1138
+ border: 1px solid var(--pm-sf-border);
1139
+ background: var(--pm-sf-image), var(--pm-sf-bg);
1140
+ backdrop-filter: var(--pm-sf-backdrop);
1141
+ -webkit-backdrop-filter: var(--pm-sf-backdrop);
1142
+ color: var(--pm-color-fg);
1143
+ box-shadow: var(--pm-sf-shadow), var(--pm-elevation-4);
1144
+ }
1145
+ /* Overlays always need an opaque-enough fill even when the page surface is "outline". */
1146
+ :where(.pm-dialog, .pm-drawer, .pm-popover, .pm-menu, .pm-toast)[data-surface="outline"],
1147
+ :where([data-surface="outline"]) :where(.pm-dialog, .pm-drawer, .pm-popover, .pm-menu, .pm-toast) {
1148
+ background: var(--pm-color-bg-surface);
1149
+ }
1150
+
1151
+ /* Shared enter/exit for top-layer elements (guide: animate-to-from-top-layer) */
1152
+ :where(.pm-dialog, .pm-drawer, .pm-popover, .pm-menu, .pm-tooltip, .pm-toast) {
1153
+ opacity: 0;
1154
+ transition-property: opacity, translate, scale, display, overlay;
1155
+ transition-duration: var(--pm-duration-moderate);
1156
+ transition-timing-function: var(--pm-ease-standard);
1157
+ transition-behavior: allow-discrete;
1158
+ @media (prefers-reduced-motion: reduce) { transition-duration: var(--pm-duration-fast); }
1159
+ }
1160
+ :is(.pm-dialog[open], .pm-drawer[open], :is(.pm-popover, .pm-menu, .pm-tooltip, .pm-toast):is(:popover-open, .\:popover-open)):where(:not([data-closing])) {
1161
+ opacity: 1;
1162
+ @starting-style { opacity: 0; }
1163
+ }
1164
+ }
1165
+
1166
+ /* Dialog */
1167
+ @layer pm.components {
1168
+ /* ---------- Dialog ---------- */
1169
+ :where(.pm-dialog) {
1170
+ inline-size: min(100% - 2rem, var(--pm-dialog-width, 32rem));
1171
+ max-block-size: min(100dvh - 2rem, 48rem);
1172
+ padding: calc(var(--pm-space-6) * var(--pm-density, 1));
1173
+ border-radius: var(--pm-radius-2xl);
1174
+ corner-shape: squircle;
1175
+ @media (prefers-reduced-motion: no-preference) {
1176
+ scale: 0.96;
1177
+ translate: 0 8px;
1178
+ transition-timing-function: var(--pm-ease-spring);
1179
+ }
1180
+ & > :where(header) { display: grid; gap: var(--pm-space-1); margin-block-end: var(--pm-space-4); }
1181
+ & :where(h1, h2, .pm-dialog-title) { font-size: var(--pm-font-size-xl); font-weight: var(--pm-font-weight-semibold); }
1182
+ & :where(.pm-dialog-description) { color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-sm); }
1183
+ & > :where(footer, form[method="dialog"]:last-child) {
1184
+ display: flex;
1185
+ gap: var(--pm-space-2);
1186
+ justify-content: flex-end;
1187
+ flex-wrap: wrap;
1188
+ margin-block-start: var(--pm-space-6);
1189
+ }
1190
+ }
1191
+ :where(.pm-dialog[data-size="sm"]) { --pm-dialog-width: 24rem; }
1192
+ :where(.pm-dialog[data-size="lg"]) { --pm-dialog-width: 48rem; }
1193
+ :where(.pm-dialog[data-size="full"]) { --pm-dialog-width: 100vw; max-block-size: 100dvh; border-radius: 0; }
1194
+ :is(.pm-dialog[open]):where(:not([data-closing])) {
1195
+ @media (prefers-reduced-motion: no-preference) {
1196
+ scale: 1;
1197
+ translate: 0 0;
1198
+ @starting-style { scale: 0.96; translate: 0 8px; }
1199
+ }
1200
+ }
1201
+ /* Phones: bottom sheet (default) or full screen; same markup. */
1202
+ :is(.pm-dialog[open][data-sheet]):where(:not([data-closing])) {
1203
+ @media (prefers-reduced-motion: no-preference) { scale: 1; @starting-style { scale: 1; translate: 0 100%; } }
1204
+ }
1205
+ :where(.pm-dialog[data-sheet][data-closing]) { @media (prefers-reduced-motion: no-preference) { scale: 1; translate: 0 100%; } }
1206
+ :where(.pm-dialog[data-fullscreen]) { inline-size: 100vw; max-inline-size: none; block-size: 100dvh; max-block-size: none; border-radius: 0; padding-block-start: max(var(--pm-space-6), var(--pm-safe-top, 0px)); }
1207
+ :where(.pm-dialog, .pm-drawer):modal { overscroll-behavior: contain; }
1208
+ :where(.pm-dialog, .pm-drawer)::backdrop {
1209
+ background: transparent;
1210
+ overflow: hidden;
1211
+ overscroll-behavior: contain;
1212
+ transition: background-color var(--pm-duration-moderate), backdrop-filter var(--pm-duration-moderate), display var(--pm-duration-moderate), overlay var(--pm-duration-moderate);
1213
+ transition-behavior: allow-discrete;
1214
+ }
1215
+ :is(.pm-dialog[open], .pm-drawer[open]):where(:not([data-closing]))::backdrop {
1216
+ background: var(--pm-color-overlay);
1217
+ backdrop-filter: blur(var(--pm-blur-sm));
1218
+ @starting-style { background: transparent; backdrop-filter: blur(0); }
1219
+ }
1220
+ }
1221
+
1222
+ /* Drawer */
1223
+ @layer pm.components {
1224
+ /* ---------- Drawer / sheet (dialog anchored to an edge) ---------- */
1225
+ :where(.pm-drawer) {
1226
+ --_size: min(100vw, var(--pm-drawer-size, 24rem));
1227
+ margin: 0;
1228
+ padding: calc(var(--pm-space-6) * var(--pm-density, 1));
1229
+ max-inline-size: none;
1230
+ max-block-size: none;
1231
+ inline-size: var(--_size);
1232
+ block-size: 100dvh;
1233
+ inset-block: 0;
1234
+ inset-inline: auto 0;
1235
+ border-radius: 0;
1236
+ border-block: 0;
1237
+ border-inline-end: 0;
1238
+ @media (prefers-reduced-motion: no-preference) { translate: 100% 0; }
1239
+ }
1240
+ :where(.pm-drawer[data-side="start"]) {
1241
+ inset-inline: 0 auto;
1242
+ border-inline-start: 0;
1243
+ border-inline-end: 1px solid var(--pm-sf-border);
1244
+ @media (prefers-reduced-motion: no-preference) { translate: -100% 0; }
1245
+ }
1246
+ :where(.pm-drawer[data-side="bottom"]) {
1247
+ inline-size: 100vw;
1248
+ block-size: auto;
1249
+ max-block-size: 85dvh;
1250
+ inset: auto 0 0 0;
1251
+ border-inline: 0;
1252
+ border-block-start: 1px solid var(--pm-sf-border);
1253
+ border-start-start-radius: var(--pm-radius-2xl);
1254
+ border-start-end-radius: var(--pm-radius-2xl);
1255
+ @media (prefers-reduced-motion: no-preference) { translate: 0 100%; }
1256
+ }
1257
+ :where(.pm-drawer[data-side="top"]) {
1258
+ inline-size: 100vw;
1259
+ block-size: auto;
1260
+ max-block-size: 85dvh;
1261
+ inset: 0 0 auto 0;
1262
+ border-inline: 0;
1263
+ border-block-end: 1px solid var(--pm-sf-border);
1264
+ border-end-start-radius: var(--pm-radius-2xl);
1265
+ border-end-end-radius: var(--pm-radius-2xl);
1266
+ @media (prefers-reduced-motion: no-preference) { translate: 0 -100%; }
1267
+ }
1268
+ :is(.pm-drawer[open]):where(:not([data-closing])) {
1269
+ @media (prefers-reduced-motion: no-preference) {
1270
+ translate: 0 0;
1271
+ @starting-style { translate: var(--_from, 100% 0); }
1272
+ }
1273
+ }
1274
+ :where(.pm-drawer[data-side="start"]) { --_from: -100% 0; }
1275
+ :where(.pm-drawer):dir(rtl) { --_from: -100% 0; }
1276
+ :where(.pm-drawer[data-side="bottom"]) { --_from: 0 100%; }
1277
+ :where(.pm-drawer[data-side="top"]) { --_from: 0 -100%; }
1278
+ }
1279
+
1280
+ /* Popover */
1281
+ @layer pm.components {
1282
+ /* ---------- Popover & menu ---------- */
1283
+ :where(.pm-popover, .pm-menu) {
1284
+ padding: var(--pm-space-3);
1285
+ border-radius: var(--pm-radius-lg);
1286
+ max-inline-size: min(22rem, 100vw - 1rem);
1287
+ @media (prefers-reduced-motion: no-preference) { scale: 0.96; }
1288
+ }
1289
+ :is(.pm-popover, .pm-menu):is(:popover-open, .\:popover-open):where(:not([data-closing])) {
1290
+ @media (prefers-reduced-motion: no-preference) {
1291
+ scale: 1;
1292
+ @starting-style { scale: 0.96; }
1293
+ }
1294
+ }
1295
+ /* Anchor-position next to the invoker where supported; otherwise keep UA centring. */
1296
+ @supports (position-area: block-end) {
1297
+ :where(.pm-popover, .pm-menu, .pm-tooltip) {
1298
+ inset: auto;
1299
+ margin: var(--pm-space-1-5);
1300
+ position-area: block-end span-inline-end;
1301
+ position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline;
1302
+ }
1303
+ /* Placement for popovers; submenus open beside their item. */
1304
+ :where(.pm-popover[data-placement="top"]) { position-area: block-start span-inline-end; }
1305
+ :where(.pm-popover[data-placement="start"]) { position-area: inline-start span-block-end; position-try-fallbacks: flip-inline, flip-block; }
1306
+ :where(.pm-popover[data-placement="end"], .pm-menu[data-submenu]) { position-area: inline-end span-block-end; position-try-fallbacks: flip-inline, flip-block, flip-inline flip-block; }
1307
+ :where(.pm-menu[data-submenu]) { margin: 0 var(--pm-space-1); }
1308
+ :where(.pm-tooltip) { position-area: block-start; position-try-fallbacks: flip-block; }
1309
+ :where(.pm-tooltip[data-side="bottom"]) { position-area: block-end; }
1310
+ :where(.pm-tooltip[data-side="start"]) { position-area: inline-start; position-try-fallbacks: flip-inline; }
1311
+ :where(.pm-tooltip[data-side="end"]) { position-area: inline-end; position-try-fallbacks: flip-inline; }
1312
+ }
1313
+
1314
+ :where(.pm-menu) {
1315
+ min-inline-size: 12rem;
1316
+ padding: var(--pm-space-1);
1317
+ display: none;
1318
+ &:is(:popover-open, .\:popover-open) { display: grid; }
1319
+ & :where([role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"], .pm-menu-item) {
1320
+ display: flex;
1321
+ align-items: center;
1322
+ gap: var(--pm-space-2);
1323
+ inline-size: 100%;
1324
+ min-block-size: calc(var(--pm-control-height-sm) + 2px);
1325
+ padding: 0 var(--pm-space-2-5, 0.625rem);
1326
+ border: 0;
1327
+ border-radius: var(--pm-radius-sm);
1328
+ background: transparent;
1329
+ color: inherit;
1330
+ font: inherit;
1331
+ font-size: var(--pm-font-size-sm);
1332
+ text-align: start;
1333
+ text-decoration: none;
1334
+ cursor: pointer;
1335
+ &:is(:hover, :focus-visible) { background: var(--pm-color-bg-hover); outline: none; }
1336
+ &:focus-visible { box-shadow: inset 0 0 0 2px var(--pm-color-ring); }
1337
+ &[data-tone="danger"] { color: var(--pm-color-danger-text); }
1338
+ &:is(:disabled, [aria-disabled="true"]) { opacity: 0.55; cursor: not-allowed; }
1339
+ & > :where(kbd, .pm-shortcut) { margin-inline-start: auto; color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-xs); }
1340
+ }
1341
+ /* Checkbox and radio items: a tick column, filled from aria-checked. */
1342
+ & :where([role="menuitemcheckbox"], [role="menuitemradio"])::before {
1343
+ content: ""; flex: none; inline-size: 1em; block-size: 1em; background: currentColor; mask: var(--pm-check-mask) center / contain no-repeat; opacity: 0;
1344
+ }
1345
+ & :where([role="menuitemradio"])::before { mask: none; border-radius: 50%; scale: 0.45; }
1346
+ & :where([aria-checked="true"])::before { opacity: 1; }
1347
+ /* Items that open a submenu point to it. */
1348
+ & :where([role="menuitem"][popovertarget])::after {
1349
+ content: ""; flex: none; margin-inline-start: auto; inline-size: 0.45em; block-size: 0.45em;
1350
+ border-block-start: 1.5px solid currentColor; border-inline-end: 1.5px solid currentColor; rotate: 45deg; opacity: 0.7;
1351
+ }
1352
+ & :where([role="menuitem"][popovertarget]):dir(rtl)::after { rotate: -135deg; }
1353
+ & :where([role="menuitem"][aria-expanded="true"]) { background: var(--pm-color-bg-hover); }
1354
+ & :where([role="group"]) { display: grid; }
1355
+
1356
+ /* ---------- Menubar: a row of buttons that each open a menu ---------- */
1357
+ }
1358
+ :where(.pm-menubar) {
1359
+ display: flex; flex-wrap: wrap; align-items: center; gap: var(--pm-space-0-5, 0.125rem);
1360
+ padding: var(--pm-space-1); border: 1px solid var(--pm-color-border); border-radius: var(--pm-radius-md); background: var(--pm-color-bg-surface);
1361
+ & > :where(button) {
1362
+ min-block-size: var(--pm-control-height-sm); padding: 0 var(--pm-space-3); border: 0; border-radius: var(--pm-radius-sm);
1363
+ background: transparent; color: inherit; font: inherit; font-size: var(--pm-font-size-sm); font-weight: var(--pm-font-weight-medium); cursor: pointer;
1364
+ &:is(:hover, [aria-expanded="true"]) { background: var(--pm-color-bg-hover); }
1365
+ &:focus-visible { outline: 2px solid var(--pm-color-ring); outline-offset: 1px; }
1366
+ }
1367
+ }
1368
+ /* ---------- Mega menu: a wide popover of link groups — <pm-popover class="pm-mega"> ---------- */
1369
+ :where(.pm-popover.pm-mega) {
1370
+ max-inline-size: min(52rem, 100vw - 1rem); inline-size: max-content; padding: var(--pm-space-5);
1371
+ &:is(:popover-open, .\:popover-open) { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: var(--pm-space-5) var(--pm-space-6); }
1372
+ & :where(.pm-mega-group) { display: grid; align-content: start; gap: var(--pm-space-1); min-inline-size: 0; }
1373
+ & :where(.pm-mega-title) { margin: 0 0 var(--pm-space-1); padding-inline: var(--pm-space-2); color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-xs); font-weight: var(--pm-font-weight-semibold); letter-spacing: 0.06em; text-transform: uppercase; }
1374
+ & :where(.pm-mega-group a) {
1375
+ display: grid; gap: 2px; padding: var(--pm-space-2); border-radius: var(--pm-radius-md); color: inherit; text-decoration: none; font-size: var(--pm-font-size-sm); font-weight: var(--pm-font-weight-medium);
1376
+ &:is(:hover, :focus-visible) { background: var(--pm-color-bg-hover); outline: none; }
1377
+ &:focus-visible { box-shadow: inset 0 0 0 2px var(--pm-color-ring); }
1378
+ & > :where(small) { color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-xs); font-weight: var(--pm-font-weight-regular, 400); }
1379
+ }
1380
+ @media (width < 40rem) { inline-size: calc(100vw - 1rem); }
1381
+ }
1382
+ :where(.pm-menu) {
1383
+ & :where([role="separator"], hr) { margin: var(--pm-space-1) calc(var(--pm-space-1) * -1); border: 0; border-block-start: 1px solid var(--pm-color-border); }
1384
+ & :where(.pm-menu-label) { padding: var(--pm-space-1-5) var(--pm-space-2-5, 0.625rem); color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-xs); font-weight: var(--pm-font-weight-semibold); }
1385
+ }
1386
+ }
1387
+
1388
+ /* Tooltip */
1389
+ @layer pm.components {
1390
+ /* ---------- Tooltip: popover="hint" + interestfor ---------- */
1391
+ :where(.pm-tooltip) {
1392
+ max-inline-size: 18rem;
1393
+ padding: var(--pm-space-1-5) var(--pm-space-2-5, 0.625rem);
1394
+ border: 0;
1395
+ border-radius: var(--pm-radius-sm);
1396
+ background: var(--pm-color-bg-inverse);
1397
+ color: var(--pm-color-fg-inverse);
1398
+ font-size: var(--pm-font-size-xs);
1399
+ line-height: var(--pm-line-height-snug);
1400
+ box-shadow: var(--pm-elevation-2);
1401
+ pointer-events: auto; /* hoverable (WCAG 1.4.13) */
1402
+ transition-duration: var(--pm-duration-fast);
1403
+ }
1404
+ :where([interestfor]) {
1405
+ --interest-delay-start: 0.35s;
1406
+ interest-delay-start: var(--interest-delay-start);
1407
+ --interest-delay-end: 0.15s;
1408
+ interest-delay-end: var(--interest-delay-end);
1409
+ }
1410
+ }
1411
+
1412
+ /* Toast */
1413
+ @layer pm.components {
1414
+ /* ---------- Toast: popover="manual" inside a labelled region ---------- */
1415
+ :where(.pm-toaster) {
1416
+ position: fixed;
1417
+ z-index: var(--pm-z-toast);
1418
+ inset-block-end: var(--pm-space-4);
1419
+ inset-inline-end: var(--pm-space-4);
1420
+ display: grid;
1421
+ gap: var(--pm-space-2);
1422
+ inline-size: min(24rem, 100vw - 2rem);
1423
+ pointer-events: none;
1424
+ & > * { pointer-events: auto; }
1425
+ }
1426
+ :where(.pm-toast) {
1427
+ position: static;
1428
+ inset: auto;
1429
+ margin: 0;
1430
+ display: none;
1431
+ grid-template-columns: auto 1fr auto;
1432
+ gap: var(--pm-space-1) var(--pm-space-3);
1433
+ align-items: start;
1434
+ inline-size: 100%;
1435
+ padding: var(--pm-space-4);
1436
+ border-radius: var(--pm-radius-lg);
1437
+ font-size: var(--pm-font-size-sm);
1438
+ &:is(:popover-open, .\:popover-open) { display: grid; }
1439
+ @media (prefers-reduced-motion: no-preference) {
1440
+ translate: 0 12px;
1441
+ transition-timing-function: var(--pm-ease-spring);
1442
+ }
1443
+ & > :where(.pm-toast-icon) { color: var(--pm-tone-text); }
1444
+ & > :where(.pm-toast-title) { font-weight: var(--pm-font-weight-semibold); }
1445
+ & > :where(.pm-toast-body) { grid-column: 2; color: var(--pm-color-fg-muted); }
1446
+ & > :where(.pm-toast-close) { grid-column: 3; grid-row: 1; }
1447
+ }
1448
+ :is(.pm-toast):is(:popover-open, .\:popover-open):where(:not([data-closing])) {
1449
+ @media (prefers-reduced-motion: no-preference) {
1450
+ translate: 0 0;
1451
+ @starting-style { translate: 0 12px; }
1452
+ }
1453
+ }
1454
+ /* Toast placed in the top layer: stacked by JS offsets (--pm-toast-offset) at the toaster's position. */
1455
+ :where(.pm-toast[popover]) {
1456
+ --_gap: var(--pm-space-4);
1457
+ position: fixed;
1458
+ inset: auto var(--_gap) calc(var(--_gap) + max(var(--pm-safe-bottom, 0px), var(--pm-bottom-inset, 0px)) + var(--pm-toast-offset, 0px)) auto;
1459
+ inline-size: min(24rem, 100vw - 2rem);
1460
+ touch-action: pan-y;
1461
+ user-select: none;
1462
+ @media (prefers-reduced-motion: no-preference) { transition-property: translate, opacity, inset, display, overlay; }
1463
+ }
1464
+ :where(.pm-toast[data-position^="top"]) {
1465
+ inset-block: calc(var(--_gap) + var(--pm-safe-top, 0px) + var(--pm-toast-offset, 0px)) auto;
1466
+ @media (prefers-reduced-motion: no-preference) { translate: 0 -12px; }
1467
+ }
1468
+ :where(.pm-toast[data-position$="start"]) { inset-inline: var(--_gap) auto; }
1469
+ :where(.pm-toast[data-position$="center"]) { inset-inline: 0; margin-inline: auto; }
1470
+ :is(.pm-toast[data-position^="top"]):is(:popover-open, .\:popover-open):where(:not([data-closing])) {
1471
+ @media (prefers-reduced-motion: no-preference) { @starting-style { translate: 0 -12px; } }
1472
+ }
1473
+ :where(.pm-toast[data-swiping]) { transition: none; cursor: grabbing; }
1474
+ :where(.pm-toast) > :where(.pm-toast-action) { grid-column: 2; justify-self: start; }
1475
+ :where(.pm-toast) > :where(.pm-toast-body[hidden]) { display: none; }
1476
+ :where(.pm-toast-spinner) {
1477
+ display: inline-block;
1478
+ inline-size: 1.05em;
1479
+ block-size: 1.05em;
1480
+ border: 2px solid color-mix(in oklab, currentColor 25%, transparent);
1481
+ border-block-start-color: currentColor;
1482
+ border-radius: 50%;
1483
+ vertical-align: -0.15em;
1484
+ @media (prefers-reduced-motion: no-preference) { animation: pm-toast-spin 0.8s linear infinite; }
1485
+ @media (prefers-reduced-motion: reduce) { animation: pm-toast-spin 2.4s linear infinite; }
1486
+ }
1487
+ @keyframes pm-toast-spin { to { rotate: 1turn; } }
1488
+ /* Phones: full width with a small gutter (centred by restack()). */
1489
+ @media (width < 40rem) {
1490
+ :where(.pm-toast[popover][data-position$="center"]) { --_gap: var(--pm-space-2); inline-size: calc(100vw - 2 * var(--pm-space-2)); }
1491
+ }
1492
+ }
1493
+
1494
+ /* Icon — <span class="pm-icon"><svg …></svg></span>; 24×24 stroke icons sized by font-size */
1495
+ @layer pm.components {
1496
+ :where(.pm-icon) {
1497
+ display: inline-grid;
1498
+ place-items: center;
1499
+ inline-size: var(--pm-icon-size, 1em);
1500
+ block-size: var(--pm-icon-size, 1em);
1501
+ flex: none;
1502
+ color: inherit;
1503
+ vertical-align: -0.125em;
1504
+ & > svg { inline-size: 100%; block-size: 100%; }
1505
+ }
1506
+ :where(.pm-icon[data-size="xs"]) { --pm-icon-size: 0.75rem; }
1507
+ :where(.pm-icon[data-size="sm"]) { --pm-icon-size: 1rem; }
1508
+ :where(.pm-icon[data-size="md"]) { --pm-icon-size: 1.25rem; }
1509
+ :where(.pm-icon[data-size="lg"]) { --pm-icon-size: 1.5rem; }
1510
+ :where(.pm-icon[data-size="xl"]) { --pm-icon-size: 2rem; }
1511
+ }
1512
+
1513
+ /* Keyboard key — <kbd class="pm-kbd">⌘</kbd> */
1514
+ @layer pm.components {
1515
+ :where(.pm-kbd) {
1516
+ display: inline-flex;
1517
+ align-items: center;
1518
+ justify-content: center;
1519
+ min-inline-size: 1.6em;
1520
+ block-size: 1.6em;
1521
+ padding: 0 0.4em;
1522
+ border: 1px solid var(--pm-color-border);
1523
+ border-block-end-width: 2px;
1524
+ border-radius: var(--pm-radius-sm);
1525
+ background: var(--pm-color-bg-subtle);
1526
+ color: var(--pm-color-fg-muted);
1527
+ font-family: var(--pm-font-sans);
1528
+ font-size: var(--pm-font-size-xs);
1529
+ font-weight: var(--pm-font-weight-medium);
1530
+ line-height: 1;
1531
+ white-space: nowrap;
1532
+ }
1533
+ :where(.pm-kbd[data-size="sm"]) { font-size: 0.6875rem; }
1534
+ :where(.pm-kbd[data-size="lg"]) { font-size: var(--pm-font-size-sm); }
1535
+ }
1536
+
1537
+ /* Separator — <div class="pm-separator" role="separator">optional label</div> */
1538
+ @layer pm.components {
1539
+ :where(.pm-separator) {
1540
+ display: flex;
1541
+ align-items: center;
1542
+ gap: var(--pm-space-3);
1543
+ color: var(--pm-color-fg-muted);
1544
+ font-size: var(--pm-font-size-xs);
1545
+ &::before, &::after { content: ""; flex: 1; border-block-start: 1px solid var(--pm-color-border); }
1546
+ &:is(:empty, [data-empty]) { gap: 0; }
1547
+ &:is(:empty, [data-empty])::after { display: none; }
1548
+ }
1549
+ :where(.pm-separator[aria-orientation="vertical"]) {
1550
+ flex-direction: column;
1551
+ align-self: stretch;
1552
+ min-block-size: 1em;
1553
+ &::before, &::after { border-block-start: 0; border-inline-start: 1px solid var(--pm-color-border); }
1554
+ }
1555
+ }
1556
+
1557
+ /* Tag / chip — <span class="pm-tag" data-tone data-variant="soft|solid|outline">Label</span>; filter chips use aria-pressed */
1558
+ @layer pm.components {
1559
+ :where(.pm-tag) {
1560
+ --_h: 1.75rem;
1561
+ display: inline-flex;
1562
+ align-items: center;
1563
+ gap: 0.35em;
1564
+ block-size: var(--_h);
1565
+ padding-inline: 0.65em;
1566
+ border: 1px solid var(--pm-tone-border);
1567
+ border-radius: var(--pm-radius-control, var(--pm-radius-md));
1568
+ background: var(--pm-tone-soft);
1569
+ color: var(--pm-tone-text);
1570
+ font: inherit;
1571
+ font-size: var(--pm-font-size-sm);
1572
+ font-weight: var(--pm-font-weight-medium);
1573
+ line-height: 1;
1574
+ white-space: nowrap;
1575
+ text-decoration: none;
1576
+ max-inline-size: 100%;
1577
+ & > :where(.pm-tag-label) { overflow: hidden; text-overflow: ellipsis; }
1578
+ }
1579
+ :where(.pm-tag[data-size="sm"]) { --_h: 1.375rem; font-size: var(--pm-font-size-xs); }
1580
+ :where(.pm-tag[data-size="lg"]) { --_h: 2.125rem; }
1581
+ :where(.pm-tag[data-variant="solid"]) { background: var(--pm-tone-solid); border-color: transparent; color: var(--pm-tone-on-solid); }
1582
+ :where(.pm-tag[data-variant="outline"]) { background: transparent; border-color: var(--pm-tone-border-strong); }
1583
+ :where(button.pm-tag) {
1584
+ cursor: pointer;
1585
+ transition: background-color var(--pm-duration-fast) var(--pm-ease-standard);
1586
+ &:hover { background: var(--pm-tone-soft-hover); }
1587
+ &[aria-pressed="true"] { background: var(--pm-tone-solid); color: var(--pm-tone-on-solid); border-color: transparent; }
1588
+ &[aria-pressed="true"]::before { content: "✓"; content: "✓" / ""; }
1589
+ &:disabled { opacity: 0.55; cursor: not-allowed; }
1590
+ }
1591
+ :where(.pm-tag-remove) {
1592
+ display: inline-grid;
1593
+ place-items: center;
1594
+ inline-size: 1.25em;
1595
+ block-size: 1.25em;
1596
+ margin-inline-end: -0.3em;
1597
+ padding: 0;
1598
+ border: 0;
1599
+ border-radius: 50%;
1600
+ background: transparent;
1601
+ color: inherit;
1602
+ font: inherit;
1603
+ line-height: 1;
1604
+ cursor: pointer;
1605
+ opacity: 0.75;
1606
+ /* 24px minimum target (WCAG 2.5.8) without growing the chip. */
1607
+ position: relative;
1608
+ &::after { content: ""; position: absolute; inset: -0.3rem; }
1609
+ &:hover { opacity: 1; background: color-mix(in oklab, currentColor 14%, transparent); }
1610
+ }
1611
+ @media (forced-colors: active) { :where(button.pm-tag[aria-pressed="true"]) { border-color: Highlight; } }
1612
+ }
1613
+
1614
+ /* Empty state — <div class="pm-empty-state"><span class="pm-empty-state-icon">…</span><h3>…</h3><p>…</p>actions</div> */
1615
+ @layer pm.components {
1616
+ :where(.pm-empty-state) {
1617
+ display: grid;
1618
+ justify-items: center;
1619
+ gap: var(--pm-space-2);
1620
+ padding: var(--pm-space-10) var(--pm-space-6);
1621
+ text-align: center;
1622
+ color: var(--pm-color-fg);
1623
+ & :where(.pm-empty-state-icon) {
1624
+ display: grid;
1625
+ place-items: center;
1626
+ inline-size: 3rem;
1627
+ block-size: 3rem;
1628
+ margin-block-end: var(--pm-space-2);
1629
+ border-radius: var(--pm-radius-lg);
1630
+ background: var(--pm-tone-soft);
1631
+ color: var(--pm-tone-text);
1632
+ font-size: 1.5rem;
1633
+ }
1634
+ & :where(.pm-empty-state-title) { font-size: var(--pm-font-size-lg); font-weight: var(--pm-font-weight-semibold); }
1635
+ & :where(.pm-empty-state-description) { max-inline-size: 36ch; color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-sm); }
1636
+ & :where(.pm-empty-state-actions) { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--pm-space-2); margin-block-start: var(--pm-space-3); }
1637
+ & :where(.pm-empty-state-actions:empty) { display: none; }
1638
+ }
1639
+ :where(.pm-empty-state[data-bordered]) { border: 1px dashed var(--pm-color-border-strong); border-radius: var(--pm-radius-xl); }
1640
+ }
1641
+
1642
+ /* Stat / KPI — <div class="pm-stat"><span class="pm-stat-label">…</span><span class="pm-stat-value">…</span><span class="pm-stat-delta" data-trend="up">…</span></div> */
1643
+ @layer pm.components {
1644
+ :where(.pm-stat) {
1645
+ display: grid;
1646
+ gap: var(--pm-space-1);
1647
+ min-inline-size: 0;
1648
+ & :where(.pm-stat-label) { display: flex; align-items: center; gap: var(--pm-space-2); color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-sm); }
1649
+ & :where(.pm-stat-value) { font-family: var(--pm-font-display); font-size: var(--pm-font-size-3xl); font-weight: var(--pm-font-weight-bold); line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
1650
+ & :where(.pm-stat-footer) { display: flex; flex-wrap: wrap; align-items: center; gap: var(--pm-space-2); font-size: var(--pm-font-size-sm); color: var(--pm-color-fg-muted); }
1651
+ & :where(.pm-stat-delta) {
1652
+ display: inline-flex;
1653
+ align-items: center;
1654
+ gap: 0.2em;
1655
+ padding: 0.1em 0.45em;
1656
+ border-radius: var(--pm-radius-sm);
1657
+ font-weight: var(--pm-font-weight-semibold);
1658
+ font-variant-numeric: tabular-nums;
1659
+ background: var(--pm-color-neutral-soft);
1660
+ color: var(--pm-color-fg);
1661
+ }
1662
+ /* The arrow follows the direction; colour says good or bad. `data-inverse` (costs, churn, latency) makes down good. */
1663
+ & :where(.pm-stat-delta:is([data-trend="up"]:not([data-inverse]), [data-trend="down"][data-inverse])) { background: var(--pm-color-success-soft); color: var(--pm-color-success-text); }
1664
+ & :where(.pm-stat-delta:is([data-trend="down"]:not([data-inverse]), [data-trend="up"][data-inverse])) { background: var(--pm-color-danger-soft); color: var(--pm-color-danger-text); }
1665
+ & :where(.pm-stat-delta[data-trend="up"])::before { content: "↑"; content: "↑" / ""; }
1666
+ & :where(.pm-stat-delta[data-trend="down"])::before { content: "↓"; content: "↓" / ""; }
1667
+ }
1668
+ :where(.pm-stat[data-size="sm"]) :where(.pm-stat-value) { font-size: var(--pm-font-size-2xl); }
1669
+ :where(.pm-stat[data-size="lg"]) :where(.pm-stat-value) { font-size: var(--pm-font-size-4xl); }
1670
+ }
1671
+
1672
+ /* Timeline — <ol class="pm-timeline"><li class="pm-timeline-item" data-tone>…</li></ol> */
1673
+ @layer pm.components {
1674
+ :where(.pm-timeline) { display: grid; margin: 0; padding: 0; list-style: none; }
1675
+ :where(.pm-timeline-item) {
1676
+ --_dot: 1.75rem;
1677
+ position: relative;
1678
+ display: grid;
1679
+ grid-template-columns: var(--_dot) 1fr;
1680
+ column-gap: var(--pm-space-3);
1681
+ padding-block-end: var(--pm-space-5);
1682
+ &::before {
1683
+ content: "";
1684
+ position: absolute;
1685
+ inset-block: calc(var(--_dot) + 0.25rem) 0.25rem;
1686
+ inset-inline-start: calc(var(--_dot) / 2 - 1px);
1687
+ inline-size: 2px;
1688
+ border-radius: 1px;
1689
+ background: var(--pm-color-border);
1690
+ }
1691
+ &:last-child { padding-block-end: 0; }
1692
+ &:last-child::before { display: none; }
1693
+ & :where(.pm-timeline-dot) {
1694
+ display: grid;
1695
+ place-items: center;
1696
+ inline-size: var(--_dot);
1697
+ block-size: var(--_dot);
1698
+ border-radius: 50%;
1699
+ background: var(--pm-tone-soft);
1700
+ color: var(--pm-tone-text);
1701
+ border: 2px solid var(--pm-color-bg-surface);
1702
+ box-shadow: 0 0 0 1px var(--pm-tone-border);
1703
+ font-size: 0.85rem;
1704
+ }
1705
+ & :where(.pm-timeline-dot:empty, .pm-timeline-dot[data-empty])::after { content: ""; inline-size: 0.5rem; block-size: 0.5rem; border-radius: 50%; background: var(--pm-tone-solid); }
1706
+ & :where(.pm-timeline-body) { display: grid; gap: var(--pm-space-1); padding-block-start: 0.2rem; min-inline-size: 0; }
1707
+ & :where(.pm-timeline-head) { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--pm-space-2); font-weight: var(--pm-font-weight-semibold); }
1708
+ & :where(time, .pm-timeline-time) { color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-xs); font-weight: var(--pm-font-weight-regular, 400); }
1709
+ & :where(.pm-timeline-content) { color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-sm); }
1710
+ }
1711
+ }
1712
+
1713
+ /* Breadcrumb — <nav aria-label="Breadcrumb"><ol class="pm-breadcrumb"><li><a href>…</a></li><li><a aria-current="page">…</a></li></ol></nav> */
1714
+ @layer pm.components {
1715
+ :where(.pm-breadcrumb) {
1716
+ display: flex;
1717
+ flex-wrap: wrap;
1718
+ align-items: center;
1719
+ gap: var(--pm-space-1-5);
1720
+ margin: 0;
1721
+ padding: 0;
1722
+ list-style: none;
1723
+ font-size: var(--pm-font-size-sm);
1724
+ color: var(--pm-color-fg-muted);
1725
+ & > :where(li) { display: inline-flex; align-items: center; gap: var(--pm-space-1-5); }
1726
+ & > :where(li + li)::before { content: var(--pm-breadcrumb-separator, "/"); content: var(--pm-breadcrumb-separator, "/") / ""; color: var(--pm-color-border-strong); }
1727
+ }
1728
+ :where(.pm-breadcrumb-link) {
1729
+ color: var(--pm-color-fg-muted);
1730
+ text-decoration: none;
1731
+ border-radius: var(--pm-radius-xs);
1732
+ &:is(a):hover { color: var(--pm-color-fg); text-decoration: underline; }
1733
+ &[aria-current="page"] { color: var(--pm-color-fg); font-weight: var(--pm-font-weight-medium); }
1734
+ }
1735
+ :where(.pm-breadcrumb-more) {
1736
+ padding: 0.1em 0.4em;
1737
+ min-block-size: 1.5rem;
1738
+ border: 0;
1739
+ border-radius: var(--pm-radius-sm);
1740
+ background: transparent;
1741
+ color: inherit;
1742
+ font: inherit;
1743
+ cursor: pointer;
1744
+ &:hover { background: var(--pm-color-bg-hover); color: var(--pm-color-fg); }
1745
+ }
1746
+ }
1747
+
1748
+ /* Pagination — <nav class="pm-pagination"><a class="pm-page" aria-current="page">1</a>…</nav> */
1749
+ @layer pm.components {
1750
+ :where(.pm-pagination) {
1751
+ display: flex;
1752
+ flex-wrap: wrap;
1753
+ align-items: center;
1754
+ gap: var(--pm-space-1);
1755
+ font-size: var(--pm-font-size-sm);
1756
+ font-variant-numeric: tabular-nums;
1757
+ }
1758
+ :where(.pm-page) {
1759
+ display: inline-flex;
1760
+ align-items: center;
1761
+ justify-content: center;
1762
+ gap: 0.3em;
1763
+ min-inline-size: var(--pm-control-height-sm);
1764
+ block-size: var(--pm-control-height-sm);
1765
+ padding-inline: var(--pm-space-2);
1766
+ border: 1px solid transparent;
1767
+ border-radius: var(--pm-radius-md);
1768
+ background: transparent;
1769
+ color: var(--pm-color-fg);
1770
+ font: inherit;
1771
+ text-decoration: none;
1772
+ cursor: pointer;
1773
+ &:hover:not(:disabled, [aria-current="page"]) { background: var(--pm-color-bg-hover); }
1774
+ &[aria-current="page"] { background: var(--pm-tone-solid); color: var(--pm-tone-on-solid); font-weight: var(--pm-font-weight-semibold); cursor: default; }
1775
+ &:disabled { opacity: 0.45; cursor: not-allowed; }
1776
+ }
1777
+ :where(.pm-pagination[data-size="sm"]) { font-size: var(--pm-font-size-xs); & :where(.pm-page) { min-inline-size: var(--pm-control-height-xs); block-size: var(--pm-control-height-xs); padding-inline: var(--pm-space-1); } }
1778
+ :where(.pm-pagination[data-size="lg"]) { font-size: var(--pm-font-size-md); & :where(.pm-page) { min-inline-size: var(--pm-control-height-md); block-size: var(--pm-control-height-md); } }
1779
+ :where(.pm-page-gap) { min-inline-size: 1.5rem; text-align: center; color: var(--pm-color-fg-muted); }
1780
+ :where(.pm-page-status) { padding-inline: var(--pm-space-2); color: var(--pm-color-fg-muted); }
1781
+ @media (forced-colors: active) { :where(.pm-page[aria-current="page"]) { border-color: Highlight; } }
1782
+ :where(.pm-page-compact) { display: none; }
1783
+ @media (width < 40rem) {
1784
+ :where(.pm-pagination:has(.pm-page-compact)) {
1785
+ flex-wrap: nowrap;
1786
+ & > :where(.pm-page:not(:first-child, :last-child), .pm-page-gap) { display: none; }
1787
+ & > :where(.pm-page-compact) { display: inline; }
1788
+ & > :where(.pm-page:is(:first-child, :last-child)) > :where(span) { display: none; }
1789
+ }
1790
+ }
1791
+ }
1792
+
1793
+ /* Steps / stepper — <ol class="pm-steps"><li class="pm-step" data-status="complete|current|upcoming|error">…</li></ol> */
1794
+ @layer pm.components {
1795
+ :where(.pm-steps) { display: flex; margin: 0; padding: 0; list-style: none; counter-reset: pm-step; }
1796
+ :where(.pm-step) {
1797
+ --_dot: 2rem;
1798
+ position: relative;
1799
+ flex: 1;
1800
+ display: grid;
1801
+ grid-template-rows: var(--_dot) auto;
1802
+ row-gap: var(--pm-space-2);
1803
+ justify-items: start;
1804
+ min-inline-size: 0;
1805
+ counter-increment: pm-step;
1806
+ color: var(--pm-color-fg-muted);
1807
+ /* connector: from this marker to the next one */
1808
+ &::after {
1809
+ content: "";
1810
+ position: absolute;
1811
+ inset-block-start: calc(var(--_dot) / 2 - 1px);
1812
+ inset-inline: calc(var(--_dot) + var(--pm-space-2)) var(--pm-space-2);
1813
+ block-size: 2px;
1814
+ border-radius: 1px;
1815
+ background: var(--pm-color-border);
1816
+ }
1817
+ &:last-child { flex: none; }
1818
+ &:last-child::after { display: none; }
1819
+ & :where(.pm-step-marker) {
1820
+ display: grid;
1821
+ place-items: center;
1822
+ inline-size: var(--_dot);
1823
+ block-size: var(--_dot);
1824
+ border: 2px solid var(--pm-color-border-strong);
1825
+ border-radius: 50%;
1826
+ background: var(--pm-color-bg-surface);
1827
+ font-size: var(--pm-font-size-sm);
1828
+ font-weight: var(--pm-font-weight-semibold);
1829
+ font-variant-numeric: tabular-nums;
1830
+ &:empty::before { content: counter(pm-step); }
1831
+ }
1832
+ & :where(.pm-step-text) { display: grid; gap: 0.1rem; padding-inline-end: var(--pm-space-3); }
1833
+ & :where(.pm-step-label) { color: var(--pm-color-fg); font-size: var(--pm-font-size-sm); font-weight: var(--pm-font-weight-medium); }
1834
+ & :where(.pm-step-description) { font-size: var(--pm-font-size-xs); }
1835
+ & :where(button.pm-step-hit) { all: unset; position: absolute; inset: -0.25rem; cursor: pointer; border-radius: var(--pm-radius-md); }
1836
+ & :where(button.pm-step-hit:hover) ~ :where(.pm-step-text) :where(.pm-step-label) { text-decoration: underline; }
1837
+ & :where(button.pm-step-hit:focus-visible) { outline: 2px solid var(--pm-color-ring); outline-offset: 2px; }
1838
+ }
1839
+ :where(.pm-step[data-status="complete"]) {
1840
+ & :where(.pm-step-marker) { border-color: var(--pm-tone-solid); background: var(--pm-tone-solid); color: var(--pm-tone-on-solid); }
1841
+ & :where(.pm-step-marker:empty)::before { content: "✓"; }
1842
+ &::after { background: var(--pm-tone-solid); }
1843
+ }
1844
+ :where(.pm-step[data-status="current"]) {
1845
+ & :where(.pm-step-marker) { border-color: var(--pm-tone-solid); color: var(--pm-tone-text); box-shadow: 0 0 0 4px var(--pm-tone-soft); }
1846
+ & :where(.pm-step-label) { color: var(--pm-tone-text); }
1847
+ }
1848
+ :where(.pm-step[data-status="error"]) {
1849
+ & :where(.pm-step-marker) { border-color: var(--pm-color-danger-solid); color: var(--pm-color-danger-text); }
1850
+ & :where(.pm-step-marker:empty)::before { content: "!"; }
1851
+ & :where(.pm-step-label) { color: var(--pm-color-danger-text); }
1852
+ }
1853
+ :where(.pm-steps[data-orientation="vertical"]) { flex-direction: column; }
1854
+ :where(.pm-steps[data-orientation="vertical"]) :where(.pm-step), :where(.pm-step[data-vertical]) {
1855
+ grid-template-rows: none;
1856
+ grid-template-columns: var(--_dot) 1fr;
1857
+ column-gap: var(--pm-space-3);
1858
+ padding-block-end: var(--pm-space-6);
1859
+ &::after { inset-block: calc(var(--_dot) + var(--pm-space-1)) var(--pm-space-1); inset-inline: calc(var(--_dot) / 2 - 1px) auto; inline-size: 2px; block-size: auto; }
1860
+ &:last-child { padding-block-end: 0; }
1861
+ & :where(.pm-step-text) { padding-block-start: 0.3rem; }
1862
+ }
1863
+ }
1864
+
1865
+ /* Segmented control — <div class="pm-segmented" role="radiogroup"><button role="radio" aria-checked="true">…</button>…</div> */
1866
+ @layer pm.components {
1867
+ :where(.pm-segmented) {
1868
+ --_h: var(--pm-control-height-md);
1869
+ position: relative;
1870
+ display: inline-flex;
1871
+ gap: 2px;
1872
+ padding: 3px;
1873
+ border-radius: calc(var(--pm-radius-control, var(--pm-radius-md)) + 3px);
1874
+ background: var(--pm-color-bg-muted);
1875
+ isolation: isolate;
1876
+ }
1877
+ :where(.pm-segmented[data-size="sm"]) { --_h: var(--pm-control-height-sm); font-size: var(--pm-font-size-sm); }
1878
+ :where(.pm-segmented[data-size="lg"]) { --_h: var(--pm-control-height-lg); }
1879
+ :where(.pm-segmented[data-full]) { display: flex; & > * { flex: 1; } }
1880
+ :where(.pm-segment) {
1881
+ display: inline-flex;
1882
+ align-items: center;
1883
+ justify-content: center;
1884
+ gap: 0.4em;
1885
+ min-block-size: calc(var(--_h) - 6px);
1886
+ padding-inline: var(--pm-space-3);
1887
+ border: 0;
1888
+ border-radius: var(--pm-radius-control, var(--pm-radius-md));
1889
+ background: transparent;
1890
+ color: var(--pm-color-fg-muted);
1891
+ font: inherit;
1892
+ font-weight: var(--pm-font-weight-medium);
1893
+ white-space: nowrap;
1894
+ cursor: pointer;
1895
+ transition: color var(--pm-duration-fast) var(--pm-ease-standard), background-color var(--pm-duration-fast) var(--pm-ease-standard);
1896
+ &:hover:not([aria-checked="true"], [data-checked], :disabled, [data-disabled]) { color: var(--pm-color-fg); }
1897
+ &:is([aria-checked="true"], [data-checked]) { background: var(--pm-color-bg-surface); color: var(--pm-color-fg); box-shadow: var(--pm-elevation-1), 0 0 0 1px var(--pm-color-border); }
1898
+ &:is(:disabled, [data-disabled]) { opacity: 0.5; cursor: not-allowed; }
1899
+ }
1900
+ :where([data-surface="neumorphic"]) :where(.pm-segmented) { background: var(--pm-sf-bg); box-shadow: var(--pm-sf-inset, inset 2px 2px 4px var(--pm-shadow-color-soft)); }
1901
+ @media (forced-colors: active) { :where(.pm-segment:is([aria-checked="true"], [data-checked])) { outline: 2px solid Highlight; } }
1902
+ }
1903
+
1904
+ /* Tree view — <ul class="pm-tree" role="tree"><li role="treeitem" aria-expanded>…</li></ul> */
1905
+ @layer pm.components {
1906
+ :where(.pm-tree) { margin: 0; padding: 0; list-style: none; font-size: var(--pm-font-size-sm); }
1907
+ :where(.pm-tree-row) {
1908
+ display: flex;
1909
+ align-items: center;
1910
+ gap: var(--pm-space-1-5);
1911
+ min-block-size: calc(var(--pm-control-height-sm) - 2px);
1912
+ padding-inline: calc(var(--pm-space-2) + var(--_depth, 0) * var(--pm-tree-indent, 1.25rem)) var(--pm-space-2);
1913
+ border-radius: var(--pm-radius-sm);
1914
+ color: var(--pm-color-fg);
1915
+ cursor: pointer;
1916
+ user-select: none;
1917
+ &:hover { background: var(--pm-color-bg-hover); }
1918
+ &[aria-selected="true"], &[data-selected] { background: var(--pm-tone-soft); color: var(--pm-tone-text); font-weight: var(--pm-font-weight-medium); }
1919
+ }
1920
+ :where(.pm-tree-toggle) {
1921
+ display: inline-grid;
1922
+ place-items: center;
1923
+ inline-size: 1rem;
1924
+ block-size: 1rem;
1925
+ flex: none;
1926
+ color: var(--pm-color-fg-muted);
1927
+ transition: rotate var(--pm-duration-fast) var(--pm-ease-standard);
1928
+ &[data-open] { rotate: 90deg; }
1929
+ &[data-leaf] { visibility: hidden; }
1930
+ }
1931
+ :where(.pm-tree-group) { margin: 0; padding: 0; list-style: none; }
1932
+ }
1933
+ /* Checkbox trees, lazy loading, filter highlight */
1934
+ @layer pm.components {
1935
+ :where(.pm-tree-check) {
1936
+ flex: none;
1937
+ display: inline-grid;
1938
+ place-items: center;
1939
+ inline-size: 1rem;
1940
+ block-size: 1rem;
1941
+ border: 1.5px solid var(--pm-color-border-strong);
1942
+ border-radius: var(--pm-radius-xs, 3px);
1943
+ background: var(--pm-color-bg-surface);
1944
+ color: var(--pm-color-accent-on-solid, white);
1945
+ &:is([data-state="checked"], [data-state="mixed"]) { background: var(--pm-color-accent-solid); border-color: var(--pm-color-accent-solid); }
1946
+ @media (forced-colors: active) { &:is([data-state="checked"], [data-state="mixed"]) { background: Highlight; color: HighlightText; } }
1947
+ }
1948
+ :where(.pm-tree-spinner) {
1949
+ display: block;
1950
+ inline-size: 0.8em;
1951
+ block-size: 0.8em;
1952
+ border: 2px solid color-mix(in oklab, currentColor 25%, transparent);
1953
+ border-block-start-color: currentColor;
1954
+ border-radius: 50%;
1955
+ animation: pm-tree-spin 0.8s linear infinite;
1956
+ @media (prefers-reduced-motion: reduce) { animation-duration: 2.4s; }
1957
+ }
1958
+ @keyframes pm-tree-spin { to { rotate: 1turn; } }
1959
+ :where(.pm-tree-mark) { background: var(--pm-color-warning-soft, #ff06); color: inherit; border-radius: 2px; }
1960
+ }
1961
+
1962
+ /* Carousel — scroll-snap track with previous/next buttons and slide pickers */
1963
+ @layer pm.components {
1964
+ :where(.pm-carousel) { position: relative; display: grid; gap: var(--pm-space-3); }
1965
+ /* Centre the arrows on the slides, not on slides + dots. */
1966
+ :where(.pm-carousel:has(.pm-carousel-dots)) { --_dots: calc(24px + var(--pm-space-3)); }
1967
+ :where(.pm-carousel-track) {
1968
+ display: grid;
1969
+ grid-auto-flow: column;
1970
+ grid-auto-columns: calc((100% - (var(--pm-carousel-per-view, 1) - 1) * var(--pm-carousel-gap, var(--pm-space-4))) / var(--pm-carousel-per-view, 1));
1971
+ gap: var(--pm-carousel-gap, var(--pm-space-4));
1972
+ overflow-x: auto;
1973
+ overscroll-behavior-x: contain;
1974
+ scroll-snap-type: x mandatory;
1975
+ scrollbar-width: none;
1976
+ border-radius: var(--pm-radius-lg);
1977
+ &::-webkit-scrollbar { display: none; }
1978
+ @media (prefers-reduced-motion: no-preference) { scroll-behavior: smooth; }
1979
+ & > :where(*) { scroll-snap-align: start; min-inline-size: 0; }
1980
+ }
1981
+ :where(.pm-carousel-nav) {
1982
+ position: absolute;
1983
+ inset-block-start: calc(50% - 1.25rem - var(--_dots, 0px) / 2);
1984
+ z-index: 1;
1985
+ display: grid;
1986
+ place-items: center;
1987
+ inline-size: 2.5rem;
1988
+ block-size: 2.5rem;
1989
+ border: 1px solid var(--pm-color-border);
1990
+ border-radius: 50%;
1991
+ background: color-mix(in oklab, var(--pm-color-bg-surface) 88%, transparent);
1992
+ backdrop-filter: blur(8px);
1993
+ color: var(--pm-color-fg);
1994
+ box-shadow: var(--pm-elevation-2);
1995
+ cursor: pointer;
1996
+ &:disabled { opacity: 0; pointer-events: none; }
1997
+ &[data-dir="prev"] { inset-inline-start: var(--pm-space-2); }
1998
+ &[data-dir="next"] { inset-inline-end: var(--pm-space-2); }
1999
+ &:dir(rtl) { scale: -1 1; }
2000
+ }
2001
+ :where(.pm-carousel-dots) { display: flex; justify-content: center; }
2002
+ /* 24×24 hit area (WCAG 2.5.8); the visible pill is drawn by ::before */
2003
+ :where(.pm-carousel-dot) {
2004
+ display: grid;
2005
+ place-items: center;
2006
+ min-inline-size: 24px;
2007
+ block-size: 24px;
2008
+ padding: 0 2px;
2009
+ border: 0;
2010
+ border-radius: var(--pm-radius-sm);
2011
+ background: none;
2012
+ cursor: pointer;
2013
+ &::before {
2014
+ content: "";
2015
+ inline-size: 0.5rem;
2016
+ block-size: 0.5rem;
2017
+ border-radius: 99px;
2018
+ background: var(--pm-color-border-strong);
2019
+ transition: inline-size var(--pm-duration-moderate) var(--pm-ease-standard), background-color var(--pm-duration-fast);
2020
+ }
2021
+ &[aria-current="true"]::before { inline-size: 1.5rem; background: var(--pm-tone-solid); }
2022
+ &:focus-visible { outline: 2px solid var(--pm-color-ring); }
2023
+ }
2024
+ @media (forced-colors: active) {
2025
+ :where(.pm-carousel-dot)::before { background: ButtonText; }
2026
+ :where(.pm-carousel-dot[aria-current="true"])::before { background: Highlight; }
2027
+ }
2028
+ }
2029
+
2030
+ /* Number input — .pm-input with stepper buttons */
2031
+ @layer pm.components {
2032
+ :where(.pm-number) {
2033
+ position: relative;
2034
+ display: flex;
2035
+ align-items: stretch;
2036
+ & > :where(.pm-input) { flex: 1; text-align: center; font-variant-numeric: tabular-nums; padding-inline: calc(var(--_h, var(--pm-control-height-md)) + var(--pm-space-1)); }
2037
+ }
2038
+ :where(.pm-number-step) {
2039
+ position: absolute;
2040
+ inset-block: 1px;
2041
+ z-index: 1;
2042
+ display: grid;
2043
+ place-items: center;
2044
+ inline-size: var(--pm-control-height-md);
2045
+ padding: 0;
2046
+ border: 0;
2047
+ background: transparent;
2048
+ color: var(--pm-color-fg-muted);
2049
+ font: inherit;
2050
+ font-size: 1.1em;
2051
+ cursor: pointer;
2052
+ &[data-dir="down"] { inset-inline-start: 1px; border-start-start-radius: inherit; border-end-start-radius: inherit; border-inline-end: 1px solid var(--pm-color-border); }
2053
+ &[data-dir="up"] { inset-inline-end: 1px; border-inline-start: 1px solid var(--pm-color-border); }
2054
+ &:hover:not(:disabled) { background: var(--pm-color-bg-hover); color: var(--pm-color-fg); }
2055
+ &:disabled { opacity: 0.4; cursor: not-allowed; }
2056
+ }
2057
+ :where(.pm-number[data-size="sm"]) :where(.pm-number-step) { inline-size: var(--pm-control-height-sm); }
2058
+ :where(.pm-number[data-size="lg"]) :where(.pm-number-step) { inline-size: var(--pm-control-height-lg); }
2059
+ }
2060
+
2061
+ /* PIN / one-time code — one box per character */
2062
+ @layer pm.components {
2063
+ :where(.pm-pin) { display: flex; gap: var(--pm-space-2); max-inline-size: 100%; }
2064
+ /* Cells shrink on narrow screens (never below a comfortable 2rem touch target) instead of overflowing. */
2065
+ :where(.pm-pin-cell) {
2066
+ flex: 0 1 var(--pm-control-height-lg);
2067
+ min-inline-size: 2rem;
2068
+ block-size: calc(var(--pm-control-height-lg) * 1.15);
2069
+ padding: 0;
2070
+ text-align: center;
2071
+ font-size: var(--pm-font-size-xl);
2072
+ font-weight: var(--pm-font-weight-semibold);
2073
+ font-variant-numeric: tabular-nums;
2074
+ caret-color: var(--pm-tone-solid);
2075
+ }
2076
+ :where(.pm-pin[data-size="sm"]) :where(.pm-pin-cell) { flex-basis: var(--pm-control-height-md); block-size: var(--pm-control-height-md); font-size: var(--pm-font-size-md); }
2077
+ :where(.pm-pin-sep) { align-self: center; color: var(--pm-color-fg-muted); }
2078
+ }
2079
+
2080
+ /* Rating — stars as a radio group */
2081
+ @layer pm.components {
2082
+ :where(.pm-rating) {
2083
+ --_size: 1.5rem;
2084
+ display: inline-flex;
2085
+ gap: 2px;
2086
+ color: var(--pm-color-border-strong);
2087
+ }
2088
+ :where(.pm-rating[data-size="sm"]) { --_size: 1.125rem; }
2089
+ :where(.pm-rating[data-size="lg"]) { --_size: 2rem; }
2090
+ :where(.pm-rating-star) {
2091
+ display: grid;
2092
+ place-items: center;
2093
+ inline-size: calc(var(--_size) + 0.25rem);
2094
+ block-size: calc(var(--_size) + 0.25rem);
2095
+ min-inline-size: 24px;
2096
+ min-block-size: 24px;
2097
+ padding: 0;
2098
+ border: 0;
2099
+ border-radius: var(--pm-radius-sm);
2100
+ background: transparent;
2101
+ color: inherit;
2102
+ cursor: pointer;
2103
+ & svg { inline-size: var(--_size); block-size: var(--_size); }
2104
+ &[data-on] { color: var(--pm-rating-color, var(--pm-color-warning-solid)); }
2105
+ &[data-on] svg { fill: currentColor; }
2106
+ @media (prefers-reduced-motion: no-preference) { transition: scale var(--pm-duration-fast) var(--pm-ease-standard), color var(--pm-duration-fast); &:hover { scale: 1.12; } }
2107
+ }
2108
+ :where(.pm-rating[data-readonly]) :where(.pm-rating-star) { cursor: default; scale: 1; }
2109
+ @media (forced-colors: active) { :where(.pm-rating-star[data-on]) { color: Highlight; } }
2110
+ }
2111
+
2112
+ /* File upload — drop zone + file list */
2113
+ @layer pm.components {
2114
+ :where(.pm-dropzone) {
2115
+ display: grid;
2116
+ justify-items: center;
2117
+ gap: var(--pm-space-2);
2118
+ padding: var(--pm-space-8) var(--pm-space-6);
2119
+ border: 2px dashed var(--pm-color-border-strong);
2120
+ border-radius: var(--pm-radius-xl);
2121
+ background: var(--pm-color-bg-subtle);
2122
+ color: var(--pm-color-fg-muted);
2123
+ text-align: center;
2124
+ font-size: var(--pm-font-size-sm);
2125
+ cursor: pointer;
2126
+ transition: border-color var(--pm-duration-fast), background-color var(--pm-duration-fast);
2127
+ &:hover, &[data-dragging] { border-color: var(--pm-tone-solid); background: var(--pm-tone-soft); color: var(--pm-color-fg); }
2128
+ &:focus-visible { outline: 2px solid var(--pm-color-ring); outline-offset: 2px; }
2129
+ &[data-disabled] { opacity: 0.55; cursor: not-allowed; }
2130
+ & :where(.pm-dropzone-icon) { display: grid; place-items: center; inline-size: 2.75rem; block-size: 2.75rem; border-radius: 50%; background: var(--pm-tone-soft); color: var(--pm-tone-text); font-size: 1.3rem; }
2131
+ & :where(strong) { color: var(--pm-tone-text); }
2132
+ }
2133
+ :where(.pm-file-list) { display: grid; gap: var(--pm-space-2); margin: var(--pm-space-3) 0 0; padding: 0; list-style: none; }
2134
+ :where(.pm-file) {
2135
+ display: grid;
2136
+ grid-template-columns: auto 1fr auto;
2137
+ align-items: center;
2138
+ gap: var(--pm-space-3);
2139
+ padding: var(--pm-space-2) var(--pm-space-3);
2140
+ border: 1px solid var(--pm-color-border);
2141
+ border-radius: var(--pm-radius-md);
2142
+ background: var(--pm-color-bg-surface);
2143
+ font-size: var(--pm-font-size-sm);
2144
+ & :where(.pm-file-name) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--pm-font-weight-medium); }
2145
+ & :where(.pm-file-meta) { color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-xs); }
2146
+ & :where(.pm-file-thumb) { inline-size: 2.25rem; block-size: 2.25rem; border-radius: var(--pm-radius-sm); object-fit: cover; background: var(--pm-color-bg-muted); display: grid; place-items: center; color: var(--pm-color-fg-muted); }
2147
+ }
2148
+ }
2149
+ /* Upload progress and status */
2150
+ @layer pm.components {
2151
+ :where(.pm-file-progress) { display: block; block-size: 4px; border-radius: 999px; background: var(--pm-color-bg-active); overflow: hidden; }
2152
+ :where(.pm-file-progress) > :where(span) { display: block; block-size: 100%; border-radius: inherit; background: var(--pm-color-accent-solid); @media (prefers-reduced-motion: no-preference) { transition: inline-size var(--pm-duration-moderate) var(--pm-ease-standard); } }
2153
+ :where(.pm-file[data-status="done"]) :where(.pm-file-meta) { color: var(--pm-color-success-text); }
2154
+ :where(.pm-file-error) { color: var(--pm-color-danger-text); }
2155
+ :where(.pm-file[data-status="error"]) { border-color: var(--pm-color-danger-border, var(--pm-color-danger-solid)); }
2156
+ }
2157
+
2158
+ /* Listbox popup — options for combobox, command palette and select-like controls */
2159
+ @layer pm.components {
2160
+ :where(.pm-listbox) {
2161
+ margin: 0;
2162
+ padding: var(--pm-space-1);
2163
+ max-block-size: min(var(--pm-listbox-max, 18rem), 60vh);
2164
+ overflow-y: auto;
2165
+ overscroll-behavior: contain;
2166
+ list-style: none;
2167
+ }
2168
+ :where(.pm-listbox-popup) {
2169
+ position: fixed;
2170
+ inset: auto;
2171
+ margin: 0;
2172
+ padding: 0;
2173
+ border: 1px solid var(--pm-color-border);
2174
+ border-radius: var(--pm-radius-lg);
2175
+ background: var(--pm-color-bg-surface);
2176
+ color: var(--pm-color-fg);
2177
+ box-shadow: var(--pm-elevation-4);
2178
+ overflow: hidden;
2179
+ }
2180
+ :where(.pm-option) {
2181
+ display: flex;
2182
+ align-items: center;
2183
+ gap: var(--pm-space-2);
2184
+ min-block-size: calc(var(--pm-control-height-sm) + 2px);
2185
+ padding: 0 var(--pm-space-2-5, 0.625rem);
2186
+ border-radius: var(--pm-radius-sm);
2187
+ color: var(--pm-color-fg);
2188
+ font-size: var(--pm-font-size-sm);
2189
+ cursor: pointer;
2190
+ user-select: none;
2191
+ & :where(.pm-option-check) { inline-size: 1rem; flex: none; color: var(--pm-tone-text); visibility: hidden; }
2192
+ & :where(.pm-option-label) { flex: 1; min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
2193
+ & :where(.pm-option-hint) { color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-xs); }
2194
+ & :where(mark) { background: none; color: var(--pm-tone-text); font-weight: var(--pm-font-weight-semibold); }
2195
+ &[data-active] { background: var(--pm-color-bg-hover); }
2196
+ &[aria-selected="true"] :where(.pm-option-check) { visibility: visible; }
2197
+ &[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
2198
+ }
2199
+ :where(.pm-listbox-group) { padding: var(--pm-space-2) var(--pm-space-2-5, 0.625rem) var(--pm-space-1); color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-xs); font-weight: var(--pm-font-weight-semibold); }
2200
+ :where(.pm-listbox-empty) { padding: var(--pm-space-6) var(--pm-space-3); color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-sm); text-align: center; }
2201
+ :where(.pm-listbox-empty[data-error]) { color: var(--pm-color-danger-text); }
2202
+ :where(.pm-listbox-retry) {
2203
+ margin-inline-start: var(--pm-space-1); min-block-size: 1.5rem; padding: 0 var(--pm-space-2);
2204
+ border: 1px solid var(--pm-color-border-strong); border-radius: var(--pm-radius-sm); background: none; color: var(--pm-color-fg);
2205
+ font: inherit; cursor: pointer;
2206
+ &:hover { background: var(--pm-color-bg-hover); }
2207
+ &:focus-visible { outline: 2px solid var(--pm-color-ring); outline-offset: 1px; }
2208
+ }
2209
+ @media (forced-colors: active) { :where(.pm-option[data-active]) { outline: 2px solid Highlight; outline-offset: -2px; } }
2210
+ }
2211
+
2212
+ /* Combobox — input + listbox; multiple selections render as tags inside the field */
2213
+ @layer pm.components {
2214
+ :where(.pm-combobox) {
2215
+ position: relative;
2216
+ display: flex;
2217
+ flex-wrap: wrap;
2218
+ align-items: center;
2219
+ gap: var(--pm-space-1);
2220
+ min-block-size: var(--_h, var(--pm-control-height-md));
2221
+ padding: 3px calc(var(--pm-control-height-md) - 4px) 3px var(--pm-space-1-5);
2222
+ cursor: text;
2223
+ & > :where(input) {
2224
+ flex: 1;
2225
+ min-inline-size: 6ch;
2226
+ block-size: calc(var(--_h, var(--pm-control-height-md)) - 8px);
2227
+ padding: 0 var(--pm-space-1-5);
2228
+ border: 0;
2229
+ background: transparent;
2230
+ color: inherit;
2231
+ font: inherit;
2232
+ outline: none;
2233
+ }
2234
+ & > :where(.pm-tag) { --_h: 1.5rem; }
2235
+ &:focus-within { outline: 2px solid var(--pm-color-ring); outline-offset: 0; --_border: var(--pm-color-ring); }
2236
+ &[data-invalid] { --_border: var(--pm-color-danger-border-strong); }
2237
+ &[data-disabled] { opacity: 0.55; cursor: not-allowed; }
2238
+ }
2239
+ :where(.pm-combobox-icon) {
2240
+ position: absolute;
2241
+ inset-block: 0;
2242
+ inset-inline-end: 0;
2243
+ display: grid;
2244
+ place-items: center;
2245
+ inline-size: var(--pm-control-height-md);
2246
+ color: var(--pm-color-fg-muted);
2247
+ pointer-events: none;
2248
+ }
2249
+ :where(.pm-combobox-clear) { pointer-events: auto; }
2250
+ }
2251
+
2252
+ /* Calendar — month grid (ARIA grid) */
2253
+ @layer pm.components {
2254
+ :where(.pm-calendar) { display: inline-grid; gap: var(--pm-space-2); font-size: var(--pm-font-size-sm); user-select: none; }
2255
+ :where(.pm-calendar-head) { display: flex; align-items: center; justify-content: space-between; gap: var(--pm-space-2); }
2256
+ :where(.pm-calendar-title) { font-weight: var(--pm-font-weight-semibold); text-transform: capitalize; }
2257
+ :where(.pm-calendar-grid) { border-collapse: collapse; font-variant-numeric: tabular-nums; }
2258
+ :where(.pm-calendar-grid th) { block-size: 2rem; color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-xs); font-weight: var(--pm-font-weight-medium); }
2259
+ :where(.pm-calendar-grid td) { padding: 1px 0; }
2260
+ :where(.pm-day) {
2261
+ position: relative;
2262
+ display: grid;
2263
+ place-items: center;
2264
+ inline-size: 2.25rem;
2265
+ block-size: 2.25rem;
2266
+ padding: 0;
2267
+ border: 0;
2268
+ border-radius: var(--pm-radius-md);
2269
+ background: transparent;
2270
+ color: var(--pm-color-fg);
2271
+ font: inherit;
2272
+ cursor: pointer;
2273
+ &:hover:not([aria-disabled="true"], [aria-selected="true"]) { background: var(--pm-color-bg-hover); }
2274
+ &[data-outside] { color: var(--pm-color-fg-muted); }
2275
+ &[data-today]::after { content: ""; position: absolute; inset-block-end: 4px; inline-size: 4px; block-size: 4px; border-radius: 50%; background: currentColor; }
2276
+ &[data-in-range] { border-radius: 0; background: var(--pm-tone-soft); color: var(--pm-tone-text); }
2277
+ &[aria-selected="true"] { background: var(--pm-tone-solid); color: var(--pm-tone-on-solid); font-weight: var(--pm-font-weight-semibold); }
2278
+ &[data-range-start] { border-start-end-radius: 0; border-end-end-radius: 0; }
2279
+ &[data-range-end] { border-start-start-radius: 0; border-end-start-radius: 0; }
2280
+ &[data-range-start][data-range-end] { border-radius: var(--pm-radius-md); }
2281
+ &[aria-disabled="true"] { color: var(--pm-color-fg-muted); text-decoration: line-through; cursor: not-allowed; }
2282
+ &:focus-visible { outline: 2px solid var(--pm-color-ring); outline-offset: 1px; z-index: 1; }
2283
+ }
2284
+ @media (forced-colors: active) { :where(.pm-day[aria-selected="true"]) { outline: 2px solid Highlight; } }
2285
+ }
2286
+ /* Month / year picker views */
2287
+ @layer pm.components {
2288
+ :where(.pm-calendar-picker) { display: grid; gap: var(--pm-space-1); inline-size: calc(7 * 2.25rem); }
2289
+ :where(.pm-calendar-picker > [role="row"]) { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--pm-space-1); }
2290
+ :where(.pm-calendar-cell) {
2291
+ position: relative;
2292
+ display: grid;
2293
+ place-items: center;
2294
+ block-size: 3rem;
2295
+ border-radius: var(--pm-radius-md);
2296
+ color: var(--pm-color-fg);
2297
+ cursor: pointer;
2298
+ text-transform: capitalize;
2299
+ font-variant-numeric: tabular-nums;
2300
+ &:hover:not([aria-disabled="true"], [aria-selected="true"]) { background: var(--pm-color-bg-hover); }
2301
+ &[data-today] { box-shadow: inset 0 0 0 1px var(--pm-color-border-strong); }
2302
+ &[aria-selected="true"] { background: var(--pm-tone-solid); color: var(--pm-tone-on-solid); font-weight: var(--pm-font-weight-semibold); }
2303
+ &[aria-disabled="true"] { color: var(--pm-color-fg-muted); text-decoration: line-through; cursor: not-allowed; }
2304
+ &:focus-visible { outline: 2px solid var(--pm-color-ring); outline-offset: 1px; }
2305
+ }
2306
+ :where(.pm-day[data-blank]) { visibility: hidden; }
2307
+ @media (forced-colors: active) { :where(.pm-calendar-cell[aria-selected="true"]) { outline: 2px solid Highlight; } }
2308
+ }
2309
+
2310
+ /* Command palette — search box + grouped actions in a modal */
2311
+ @layer pm.components {
2312
+ :where(.pm-command) {
2313
+ --pm-dialog-width: 36rem;
2314
+ padding: 0;
2315
+ overflow: hidden;
2316
+ align-self: start;
2317
+ margin-block-start: min(15vh, 8rem);
2318
+ }
2319
+ :where(.pm-command-search) {
2320
+ display: flex;
2321
+ align-items: center;
2322
+ gap: var(--pm-space-2);
2323
+ padding-inline: var(--pm-space-4);
2324
+ border-block-end: 1px solid var(--pm-color-border);
2325
+ color: var(--pm-color-fg-muted);
2326
+ & > :where(input) {
2327
+ flex: 1;
2328
+ min-inline-size: 0;
2329
+ block-size: 3.25rem;
2330
+ border: 0;
2331
+ background: transparent;
2332
+ color: var(--pm-color-fg);
2333
+ font: inherit;
2334
+ font-size: var(--pm-font-size-md);
2335
+ outline: none;
2336
+ &::placeholder { color: var(--pm-color-fg-muted); }
2337
+ }
2338
+ }
2339
+ :where(.pm-command) :where(.pm-listbox) { --pm-listbox-max: 22rem; padding: var(--pm-space-2); }
2340
+ :where(.pm-command) :where(.pm-option) { min-block-size: 2.5rem; gap: var(--pm-space-3); }
2341
+ :where(.pm-command-foot) {
2342
+ display: flex;
2343
+ gap: var(--pm-space-4);
2344
+ padding: var(--pm-space-2) var(--pm-space-4);
2345
+ border-block-start: 1px solid var(--pm-color-border);
2346
+ background: var(--pm-color-bg-subtle);
2347
+ color: var(--pm-color-fg-muted);
2348
+ font-size: var(--pm-font-size-xs);
2349
+ }
2350
+ /* Phones: a top sheet, so the on-screen keyboard never covers results. */
2351
+ @media (width < 40rem) {
2352
+ :where(.pm-command) {
2353
+ inline-size: 100%;
2354
+ max-inline-size: none;
2355
+ margin: 0;
2356
+ margin-block-start: 0;
2357
+ padding-block-start: var(--pm-safe-top, 0px);
2358
+ border-radius: 0 0 var(--pm-radius-2xl) var(--pm-radius-2xl);
2359
+ max-block-size: 85dvh;
2360
+ }
2361
+ :where(.pm-command) :where(.pm-listbox) { --pm-listbox-max: 60dvh; }
2362
+ :where(.pm-command) :where([role="option"]) { min-block-size: 2.75rem; }
2363
+ }
2364
+ }
2365
+
2366
+ /* Data table — advanced layer on top of table.css: toolbar, frozen columns, pinned rows, resize, menus, filters,
2367
+ groups, detail rows, merged cells, editing, footer aggregates. */
2368
+ @layer pm.components {
2369
+ :where(.pm-data-table) :where(.pm-table) {
2370
+ & :where(th, td) { background-clip: padding-box; }
2371
+ /* Utility columns keep a fixed, comfortable width whether or not they are frozen. */
2372
+ & :where(.pm-select-cell, .pm-dt-expand-cell) {
2373
+ inline-size: 2.75rem;
2374
+ min-inline-size: 2.75rem;
2375
+ max-inline-size: 2.75rem;
2376
+ padding-inline: 0;
2377
+ text-align: center;
2378
+ }
2379
+ & :where(.pm-select-cell, .pm-dt-expand-cell) > :where(*) { margin-inline: auto; }
2380
+ & :where(td[data-merged]) { display: none; }
2381
+ /* A merged cell spans several rows: it keeps the plain surface instead of the first row's hover/stripe colour. */
2382
+ & :where(td[rowspan]) { vertical-align: top; --_row: transparent; background-color: var(--pm-color-bg-surface); }
2383
+ & :where(tbody td:focus-visible, tbody td:focus) { outline: 2px solid var(--pm-color-ring); outline-offset: -2px; }
2384
+ & :where(tbody td) { scroll-margin-inline: 3rem; }
2385
+ }
2386
+ :where(.pm-data-table) :where(.pm-table[data-fixed]) :where(td:not(.pm-select-cell, .pm-dt-expand-cell, [colspan]), th) {
2387
+ overflow: hidden;
2388
+ text-overflow: ellipsis;
2389
+ white-space: nowrap;
2390
+ }
2391
+
2392
+ /* Header cell: label, pin mark, actions; resize handle on the edge */
2393
+ :where(.pm-dt-th) { display: flex; align-items: center; gap: var(--pm-space-1); min-inline-size: 0; }
2394
+ :where(.pm-dt-th) > :where(.pm-sort, .pm-dt-label) { min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; }
2395
+ :where(.pm-data-table) :where(thead th) { position: relative; }
2396
+ :where(.pm-data-table) :where(thead th[data-align="end"]) :where(.pm-dt-th) { justify-content: flex-end; }
2397
+ :where(.pm-data-table) :where(thead th[data-align="center"]) :where(.pm-dt-th) { justify-content: center; }
2398
+ :where(.pm-dt-level) { font-size: 0.625rem; color: var(--pm-tone-text); font-weight: var(--pm-font-weight-bold); }
2399
+ :where(.pm-dt-pinmark) { display: inline-flex; color: var(--pm-color-fg-subtle, var(--pm-color-fg-muted)); }
2400
+ :where(.pm-dt-icon) {
2401
+ display: inline-grid;
2402
+ place-items: center;
2403
+ flex: none;
2404
+ inline-size: 1.5rem;
2405
+ block-size: 1.5rem;
2406
+ padding: 0;
2407
+ border: 0;
2408
+ border-radius: var(--pm-radius-sm);
2409
+ background: none;
2410
+ color: var(--pm-color-fg-muted);
2411
+ cursor: pointer;
2412
+ &:hover { background: var(--pm-color-bg-hover); color: var(--pm-color-fg); }
2413
+ &:focus-visible { outline: 2px solid var(--pm-color-ring); }
2414
+ }
2415
+ :where(.pm-dt-colmenu) { margin-inline-start: auto; opacity: 0; }
2416
+ :where(th:hover, th:focus-within) :where(.pm-dt-colmenu), :where(.pm-dt-colmenu[aria-expanded="true"]) { opacity: 1; }
2417
+ @media (hover: none) { :where(.pm-dt-colmenu) { opacity: 1; } }
2418
+ :where(.pm-dt-expand) {
2419
+ & :where(svg) { @media (prefers-reduced-motion: no-preference) { transition: rotate var(--pm-duration-fast) var(--pm-ease-standard); } }
2420
+ &[aria-expanded="true"] :where(svg) { rotate: 90deg; }
2421
+ }
2422
+ :where(.pm-dt-resizer) {
2423
+ position: absolute;
2424
+ inset-block: 0;
2425
+ inset-inline-end: -4px;
2426
+ z-index: 2;
2427
+ inline-size: 8px;
2428
+ cursor: col-resize;
2429
+ touch-action: none;
2430
+ &::after { content: ""; position: absolute; inset-block: 25%; inset-inline-start: 3px; inline-size: 2px; border-radius: 1px; background: transparent; }
2431
+ &:hover::after, &:focus-visible::after { background: var(--pm-color-accent-solid); }
2432
+ &:focus-visible { outline: none; }
2433
+ }
2434
+ :where(th[data-drop="before"]) { box-shadow: inset 2px 0 0 var(--pm-color-accent-solid); }
2435
+ :where(th[data-drop="after"]) { box-shadow: inset -2px 0 0 var(--pm-color-accent-solid); }
2436
+ :where(.pm-dt-group-head) { text-align: center; }
2437
+
2438
+ /* Frozen columns (sticky with measured offsets) and pinned rows */
2439
+ :where(.pm-data-table) :where(.pm-table) {
2440
+ & :where([data-pin]) {
2441
+ position: sticky;
2442
+ z-index: 1;
2443
+ background-color: var(--pm-color-bg-surface);
2444
+ background-image: linear-gradient(var(--_row, transparent), var(--_row, transparent));
2445
+ }
2446
+ & :where(thead [data-pin]) { z-index: 2; background-color: var(--pm-color-bg-subtle); background-image: none; }
2447
+ & :where([data-pin="start"][data-pin-edge]) { box-shadow: inset -1px 0 0 var(--pm-color-border), 6px 0 8px -6px rgb(0 0 0 / 0.18); }
2448
+ & :where([data-pin="end"][data-pin-edge]) { box-shadow: inset 1px 0 0 var(--pm-color-border), -6px 0 8px -6px rgb(0 0 0 / 0.18); }
2449
+ & :where(tbody.pm-dt-pinned td) {
2450
+ position: sticky;
2451
+ inset-block-start: var(--_top, 0px);
2452
+ z-index: 2;
2453
+ background-color: var(--pm-color-bg-surface);
2454
+ background-image: linear-gradient(var(--_row, transparent), var(--_row, transparent));
2455
+ }
2456
+ & :where(tbody.pm-dt-pinned td[data-pin]) { z-index: 3; }
2457
+ & :where(tbody.pm-dt-pinned tr:last-child td) { border-block-end: 2px solid var(--pm-color-border-strong); }
2458
+ & :where(tfoot td) {
2459
+ position: sticky;
2460
+ inset-block-end: 0;
2461
+ z-index: 2;
2462
+ border-block-start: 2px solid var(--pm-color-border-strong);
2463
+ border-block-end: 0;
2464
+ background: var(--pm-color-bg-subtle);
2465
+ font-weight: var(--pm-font-weight-semibold);
2466
+ }
2467
+ & :where(tfoot td[data-pin]) { z-index: 3; }
2468
+ }
2469
+
2470
+ /* Filter row */
2471
+ :where(.pm-dt-filters) :where(td) { padding-block: var(--pm-space-1-5, 0.375rem); background: var(--pm-color-bg-subtle); }
2472
+ :where(.pm-dt-input) {
2473
+ inline-size: 100%;
2474
+ min-inline-size: 4rem;
2475
+ block-size: max(1.875rem, var(--pm-touch-min-sm, 0px));
2476
+ padding: 0 var(--pm-space-2);
2477
+ border: 1px solid var(--pm-color-border-strong);
2478
+ border-radius: var(--pm-radius-sm);
2479
+ background: var(--pm-color-bg-surface);
2480
+ color: var(--pm-color-fg);
2481
+ font: inherit;
2482
+ font-size: var(--pm-font-size-sm);
2483
+ font-weight: var(--pm-font-weight-normal);
2484
+ &::placeholder { color: var(--pm-color-fg-muted); }
2485
+ &:focus-visible { outline: 2px solid var(--pm-color-ring); outline-offset: -1px; border-color: var(--pm-color-ring); }
2486
+ @media (pointer: coarse) { font-size: max(1rem, var(--pm-font-size-sm)); }
2487
+ }
2488
+ :where(.pm-dt-editor) { margin-block: calc(var(--pm-space-1) * -1); }
2489
+ :where(td[data-editable]) { cursor: text; }
2490
+ :where(td[data-editable]:hover) { box-shadow: inset 0 0 0 1px var(--pm-color-border-strong); }
2491
+
2492
+ /* Group and detail rows */
2493
+ :where(.pm-dt-group) > :where(td) { padding-block: var(--pm-space-1-5, 0.375rem); background: var(--pm-color-bg-muted, var(--pm-color-bg-subtle)); }
2494
+ :where(.pm-dt-group-inner) { position: sticky; inset-inline-start: var(--pm-space-3); display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--pm-space-1) var(--pm-space-4); }
2495
+ :where(.pm-dt-group-toggle) {
2496
+ display: inline-flex;
2497
+ align-items: center;
2498
+ gap: var(--pm-space-1-5, 0.375rem);
2499
+ padding: 2px var(--pm-space-1);
2500
+ border: 0;
2501
+ border-radius: var(--pm-radius-sm);
2502
+ background: none;
2503
+ color: var(--pm-color-fg);
2504
+ font: inherit;
2505
+ cursor: pointer;
2506
+ & :where(svg) { @media (prefers-reduced-motion: no-preference) { transition: rotate var(--pm-duration-fast) var(--pm-ease-standard); } }
2507
+ &[aria-expanded="true"] :where(svg) { rotate: 90deg; }
2508
+ &:hover { background: var(--pm-color-bg-hover); }
2509
+ &:focus-visible { outline: 2px solid var(--pm-color-ring); }
2510
+ }
2511
+ :where(.pm-dt-group-label) { color: var(--pm-color-fg-muted); }
2512
+ :where(.pm-dt-group-count) { padding: 0 0.45em; border-radius: 999px; background: var(--pm-color-bg-surface); color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-xs); font-variant-numeric: tabular-nums; }
2513
+ :where(.pm-dt-group-agg) { color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-xs); }
2514
+ :where(.pm-dt-detail) > :where(td) { padding: 0; background: var(--pm-color-bg-subtle); }
2515
+ :where(.pm-dt-detail-body) { position: sticky; inset-inline-start: 0; max-inline-size: var(--pm-dt-detail-width, 100cqi); padding: var(--pm-space-4); }
2516
+
2517
+ /* Toolbar and footer */
2518
+ :where(.pm-data-table-bar) {
2519
+ display: flex;
2520
+ flex-wrap: wrap;
2521
+ align-items: center;
2522
+ justify-content: space-between;
2523
+ gap: var(--pm-space-2) var(--pm-space-3);
2524
+ padding: var(--pm-space-2) var(--pm-space-3);
2525
+ border-block-start: 1px solid var(--pm-color-border);
2526
+ color: var(--pm-color-fg-muted);
2527
+ font-size: var(--pm-font-size-sm);
2528
+ &:first-child { border-block-start: 0; border-block-end: 1px solid var(--pm-color-border); }
2529
+ }
2530
+ :where(.pm-dt-bar-start, .pm-dt-bar-end) { display: flex; flex-wrap: wrap; align-items: center; gap: var(--pm-space-2); }
2531
+ :where(.pm-dt-bar-start) { flex: 1 1 14rem; }
2532
+ :where(.pm-dt-search) {
2533
+ position: relative;
2534
+ display: flex;
2535
+ align-items: center;
2536
+ flex: 1 1 12rem;
2537
+ max-inline-size: 20rem;
2538
+ & > :where(svg) { position: absolute; inset-inline-start: var(--pm-space-2); color: var(--pm-color-fg-muted); pointer-events: none; }
2539
+ & > :where(.pm-dt-input) { padding-inline-start: 1.85rem; block-size: max(2rem, var(--pm-touch-min-sm, 0px)); }
2540
+ }
2541
+ :where(.pm-dt-pagesize) { inline-size: auto; }
2542
+ :where(.pm-dt-btn) {
2543
+ display: inline-flex;
2544
+ align-items: center;
2545
+ gap: var(--pm-space-1-5, 0.375rem);
2546
+ min-block-size: max(2rem, var(--pm-touch-min-sm, 0px));
2547
+ padding: 0 var(--pm-space-2-5, 0.625rem);
2548
+ border: 1px solid var(--pm-color-border-strong);
2549
+ border-radius: var(--pm-radius-md);
2550
+ background: var(--pm-color-bg-surface);
2551
+ color: var(--pm-color-fg);
2552
+ font: inherit;
2553
+ font-size: var(--pm-font-size-sm);
2554
+ cursor: pointer;
2555
+ &:hover { background: var(--pm-color-bg-hover); }
2556
+ &:focus-visible { outline: 2px solid var(--pm-color-ring); outline-offset: 1px; }
2557
+ &[data-variant="link"] { min-block-size: 0; padding: 0 var(--pm-space-1); border: 0; background: none; color: var(--pm-color-accent-text); text-decoration: underline; text-underline-offset: 2px; }
2558
+ }
2559
+ :where(.pm-dt-alert) {
2560
+ display: flex; align-items: center; justify-content: space-between; gap: var(--pm-space-3);
2561
+ margin-block-end: var(--pm-space-2); padding: var(--pm-space-2) var(--pm-space-3);
2562
+ border: 1px solid var(--pm-color-danger-border, var(--pm-color-border)); border-radius: var(--pm-radius-md);
2563
+ background: var(--pm-color-danger-soft); color: var(--pm-color-danger-text); font-size: var(--pm-font-size-sm);
2564
+ }
2565
+ :where(.pm-dt-progress) {
2566
+ position: absolute;
2567
+ z-index: 5;
2568
+ inset-inline: 0;
2569
+ block-size: 2px;
2570
+ overflow: hidden;
2571
+ background: var(--pm-color-accent-soft);
2572
+ &::after {
2573
+ content: "";
2574
+ position: absolute;
2575
+ inset-block: 0;
2576
+ inline-size: 35%;
2577
+ background: var(--pm-color-accent-solid);
2578
+ animation: pm-dt-progress 1.1s ease-in-out infinite;
2579
+ @media (prefers-reduced-motion: reduce) { animation-duration: 3s; }
2580
+ }
2581
+ }
2582
+ @keyframes pm-dt-progress { from { translate: -100% 0; } to { translate: 300% 0; } }
2583
+
2584
+ /* Popovers: column actions and column picker */
2585
+ :where(.pm-dt-pop) {
2586
+ position: fixed;
2587
+ inset: auto;
2588
+ margin: 0;
2589
+ min-inline-size: 12rem;
2590
+ max-block-size: min(24rem, 80dvh);
2591
+ overflow: auto;
2592
+ padding: var(--pm-space-1);
2593
+ border: 1px solid var(--pm-color-border);
2594
+ border-radius: var(--pm-radius-lg);
2595
+ background: var(--pm-color-bg-surface);
2596
+ color: var(--pm-color-fg);
2597
+ box-shadow: var(--pm-elevation-3, 0 8px 24px rgb(0 0 0 / 0.16));
2598
+ font-size: var(--pm-font-size-sm);
2599
+ & :where(hr) { margin: var(--pm-space-1) 0; border: 0; border-block-start: 1px solid var(--pm-color-border); }
2600
+ & > :where(.pm-dt-btn) { inline-size: 100%; justify-content: center; margin-block-start: var(--pm-space-1); }
2601
+ }
2602
+ :where(.pm-dt-menuitem) {
2603
+ display: flex;
2604
+ align-items: center;
2605
+ inline-size: 100%;
2606
+ min-block-size: max(2rem, var(--pm-touch-min-sm, 0px));
2607
+ padding: 0 var(--pm-space-2-5, 0.625rem);
2608
+ border: 0;
2609
+ border-radius: var(--pm-radius-sm);
2610
+ background: none;
2611
+ color: inherit;
2612
+ font: inherit;
2613
+ text-align: start;
2614
+ cursor: pointer;
2615
+ &:hover:not(:disabled), &:focus-visible { background: var(--pm-color-bg-hover); outline: none; }
2616
+ &:disabled { opacity: 0.45; cursor: default; }
2617
+ &[aria-current="true"] { color: var(--pm-color-accent-text); font-weight: var(--pm-font-weight-semibold); }
2618
+ }
2619
+ :where(.pm-dt-picker) { display: grid; gap: 2px; margin: 0; padding: 0; border: 0; }
2620
+ :where(.pm-dt-check) {
2621
+ display: flex;
2622
+ align-items: center;
2623
+ gap: var(--pm-space-2);
2624
+ min-block-size: max(2rem, var(--pm-touch-min-sm, 0px));
2625
+ padding: 0 var(--pm-space-2);
2626
+ border-radius: var(--pm-radius-sm);
2627
+ cursor: pointer;
2628
+ &:hover { background: var(--pm-color-bg-hover); }
2629
+ }
2630
+
2631
+ @media (forced-colors: active) {
2632
+ :where(.pm-data-table) :where([data-pin], tfoot td, tbody.pm-dt-pinned td) { background: Canvas; }
2633
+ :where(.pm-dt-resizer:focus-visible)::after, :where(.pm-dt-progress)::after { background: Highlight; }
2634
+ }
2635
+ }
2636
+
2637
+ /* Narrow containers: cards (see table.css) — tidy the advanced parts */
2638
+ @layer pm.components {
2639
+ @container pm-table (width < 36rem) {
2640
+ :where(.pm-data-table) :where(.pm-table) {
2641
+ & :where(.pm-dt-group-head) { display: none; }
2642
+ & :where([data-pin], tbody.pm-dt-pinned td, tfoot td) { position: static; box-shadow: none; background: none; }
2643
+ & :where(thead th) { box-shadow: none; }
2644
+ & :where(.pm-dt-filters) { padding-block: 0; }
2645
+ & :where(.pm-dt-filters) { display: grid; grid-template-columns: 1fr; }
2646
+ & :where(.pm-dt-filters td:empty) { display: none; }
2647
+ & :where(.pm-dt-resizer, .pm-dt-pinmark) { display: none; }
2648
+ & :where(td[data-merged]) { display: grid; }
2649
+ & :where(tbody td.pm-select-cell) { position: absolute; inset-block-start: var(--pm-space-3); inset-inline-start: auto !important; inset-inline-end: var(--pm-space-3); display: block; inline-size: auto; }
2650
+ & :where(tbody td.pm-dt-expand-cell) { position: absolute; inset-block-start: var(--pm-space-3); inset-inline-start: auto !important; inset-inline-end: calc(var(--pm-space-3) + 2.25rem); display: block; inline-size: auto; }
2651
+ & :where(tbody tr:has(> .pm-select-cell, > .pm-dt-expand-cell)) { padding-inline-end: 5.5rem; }
2652
+ & :where(.pm-dt-group, .pm-dt-detail) { display: block; padding: 0; }
2653
+ & :where(.pm-dt-group > td, .pm-dt-detail > td) { display: block; position: static; padding: var(--pm-space-2) var(--pm-space-3); }
2654
+ & :where(tfoot td:empty) { display: none; }
2655
+ }
2656
+ }
2657
+ }
2658
+
2659
+ /* Colour picker — saturation/brightness area, hue and alpha tracks, swatches */
2660
+ @layer pm.components {
2661
+ :where(.pm-color-panel) { display: grid; gap: var(--pm-space-3); inline-size: min(100%, 16.5rem); }
2662
+ :where(.pm-color-area) {
2663
+ --_hue: 0;
2664
+ position: relative;
2665
+ aspect-ratio: 4 / 3;
2666
+ border-radius: var(--pm-radius-md);
2667
+ background:
2668
+ linear-gradient(to top, #000, transparent),
2669
+ linear-gradient(to right, #fff, hsl(calc(var(--_hue) * 1deg) 100% 50%));
2670
+ box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--pm-color-fg) 15%, transparent);
2671
+ touch-action: none;
2672
+ cursor: crosshair;
2673
+ }
2674
+ :where(.pm-color-area-thumb) {
2675
+ position: absolute;
2676
+ inline-size: 1.125rem;
2677
+ block-size: 1.125rem;
2678
+ border: 2px solid #fff;
2679
+ border-radius: 50%;
2680
+ box-shadow: 0 0 0 1px rgb(0 0 0 / 0.45), 0 1px 3px rgb(0 0 0 / 0.4);
2681
+ translate: -50% -50%;
2682
+ outline: none;
2683
+ &:focus-visible { box-shadow: 0 0 0 1px rgb(0 0 0 / 0.45), 0 0 0 4px var(--pm-color-ring); }
2684
+ }
2685
+ :where(.pm-color-sliders) { display: flex; align-items: center; gap: var(--pm-space-2); }
2686
+ :where(.pm-color-tracks) { flex: 1; display: grid; gap: var(--pm-space-2); }
2687
+ :where(.pm-color-hue, .pm-color-alpha) {
2688
+ appearance: none;
2689
+ inline-size: 100%;
2690
+ block-size: 0.875rem;
2691
+ margin: 0;
2692
+ border-radius: 999px;
2693
+ box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--pm-color-fg) 15%, transparent);
2694
+ cursor: pointer;
2695
+ &::-webkit-slider-thumb { appearance: none; inline-size: 1.125rem; block-size: 1.125rem; border: 2px solid #fff; border-radius: 50%; background: transparent; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.45), 0 1px 3px rgb(0 0 0 / 0.35); }
2696
+ &::-moz-range-thumb { inline-size: 0.875rem; block-size: 0.875rem; border: 2px solid #fff; border-radius: 50%; background: transparent; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.45); }
2697
+ &:focus-visible { outline: 2px solid var(--pm-color-ring); outline-offset: 2px; }
2698
+ &:disabled { opacity: 0.55; cursor: not-allowed; }
2699
+ }
2700
+ :where(.pm-color-hue) { background: linear-gradient(to right in hsl longer hue, hsl(0 100% 50%), hsl(0 100% 50%)); }
2701
+ @supports not (background: linear-gradient(in hsl longer hue, red, red)) {
2702
+ :where(.pm-color-hue) { background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); }
2703
+ }
2704
+ :where(.pm-color-alpha) {
2705
+ --_checker: repeating-conic-gradient(#ccc 0 25%, #fff 0 50%) 0 0 / 8px 8px;
2706
+ background: linear-gradient(to right, transparent, var(--_solid, #000)), var(--_checker);
2707
+ }
2708
+ :where(.pm-color-preview, .pm-color-swatch) {
2709
+ --_c: transparent;
2710
+ flex: none;
2711
+ background: linear-gradient(var(--_c), var(--_c)), repeating-conic-gradient(#ccc 0 25%, #fff 0 50%) 0 0 / 8px 8px;
2712
+ box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--pm-color-fg) 20%, transparent);
2713
+ }
2714
+ :where(.pm-color-preview) { inline-size: 2.25rem; block-size: 2.25rem; border-radius: var(--pm-radius-md); }
2715
+ :where(.pm-color-swatches) { display: grid; grid-template-columns: repeat(auto-fill, minmax(1.75rem, 1fr)); gap: var(--pm-space-1-5, 0.375rem); }
2716
+ :where(.pm-color-swatch) {
2717
+ display: inline-block;
2718
+ inline-size: 1.75rem;
2719
+ block-size: 1.75rem;
2720
+ padding: 0;
2721
+ border: 0;
2722
+ border-radius: var(--pm-radius-sm);
2723
+ cursor: pointer;
2724
+ &:hover:not(:disabled) { scale: 1.08; }
2725
+ &[aria-pressed="true"] { outline: 2px solid var(--pm-color-fg); outline-offset: 2px; }
2726
+ &:focus-visible { outline: 2px solid var(--pm-color-ring); outline-offset: 2px; }
2727
+ &:disabled { cursor: not-allowed; opacity: 0.55; }
2728
+ @media (prefers-reduced-motion: no-preference) { transition: scale var(--pm-duration-fast) var(--pm-ease-standard); }
2729
+ }
2730
+ @media (forced-colors: active) {
2731
+ :where(.pm-color-swatch, .pm-color-preview, .pm-color-area) { forced-color-adjust: none; border: 1px solid CanvasText; }
2732
+ }
2733
+ }
2734
+
2735
+ /* Time picker — hour / minute / period columns */
2736
+ @layer pm.components {
2737
+ :where(.pm-time-cols) { display: flex; gap: var(--pm-space-1); }
2738
+ :where(.pm-time-col) {
2739
+ display: grid;
2740
+ align-content: start;
2741
+ gap: 2px;
2742
+ inline-size: 3.5rem;
2743
+ max-block-size: 14rem;
2744
+ overflow-y: auto;
2745
+ overscroll-behavior: contain;
2746
+ scrollbar-width: thin;
2747
+ padding: 2px;
2748
+ &:not(:last-child) { border-inline-end: 1px solid var(--pm-color-border); padding-inline-end: var(--pm-space-1); }
2749
+ & :where([role="option"]) { justify-content: center; min-block-size: 2rem; font-variant-numeric: tabular-nums; }
2750
+ & :where([role="option"]):hover:not([aria-selected="true"], [aria-disabled="true"]) { background: var(--pm-color-bg-hover); }
2751
+ & :where([role="option"][aria-selected="true"]) { background: var(--pm-tone-solid); color: var(--pm-tone-on-solid); font-weight: var(--pm-font-weight-semibold); }
2752
+ & :where([role="option"]):focus-visible { outline: 2px solid var(--pm-color-ring); outline-offset: -2px; }
2753
+ }
2754
+ @media (forced-colors: active) { :where(.pm-time-col [aria-selected="true"]) { outline: 2px solid Highlight; outline-offset: -2px; } }
2755
+ }
2756
+
2757
+ /* Toggle & toggle group — <div class="pm-toggle-group" role="group"><button class="pm-toggle" aria-pressed="true">…</button>…</div> */
2758
+ @layer pm.components {
2759
+ /* Wraps onto more lines rather than overflowing narrow screens. */
2760
+ :where(.pm-toggle-group) { display: inline-flex; flex-wrap: wrap; gap: 2px; max-inline-size: 100%; }
2761
+ :where(.pm-toggle-group[data-orientation="vertical"]) { flex-direction: column; }
2762
+ :where(.pm-toggle) {
2763
+ --_h: var(--pm-control-height-md);
2764
+ display: inline-flex;
2765
+ align-items: center;
2766
+ justify-content: center;
2767
+ gap: 0.4em;
2768
+ min-inline-size: var(--_h);
2769
+ min-block-size: var(--_h);
2770
+ padding-inline: var(--pm-space-2-5, 0.625rem);
2771
+ border: 1px solid var(--pm-color-border-strong);
2772
+ border-radius: var(--pm-radius-control, var(--pm-radius-md));
2773
+ background: var(--pm-sf-control-bg, var(--pm-color-bg-surface));
2774
+ color: var(--pm-color-fg-muted);
2775
+ font: inherit;
2776
+ font-size: var(--pm-font-size-sm);
2777
+ font-weight: var(--pm-font-weight-medium);
2778
+ white-space: nowrap;
2779
+ cursor: pointer;
2780
+ user-select: none;
2781
+ &[data-size="sm"] { --_h: var(--pm-control-height-sm); padding-inline: var(--pm-space-2); }
2782
+ &[data-size="lg"] { --_h: var(--pm-control-height-lg); padding-inline: var(--pm-space-3); font-size: var(--pm-font-size-md); }
2783
+ &[data-variant="ghost"] { border-color: transparent; background: transparent; }
2784
+ &[data-variant="soft"] { border-color: transparent; background: var(--pm-color-bg-muted); }
2785
+ &:hover:not([data-pressed], [aria-pressed="true"], [data-disabled], :disabled) { background: var(--pm-color-bg-hover); color: var(--pm-color-fg); }
2786
+ &:is([data-pressed], [aria-pressed="true"]) {
2787
+ border-color: var(--pm-tone-border-strong, var(--pm-tone-border));
2788
+ background: var(--pm-tone-soft);
2789
+ color: var(--pm-tone-text);
2790
+ }
2791
+ &:is([data-disabled], :disabled) { opacity: 0.5; cursor: not-allowed; }
2792
+ &:focus-visible { outline: 2px solid var(--pm-color-ring); outline-offset: 2px; }
2793
+ @media (prefers-reduced-motion: no-preference) {
2794
+ transition: background-color var(--pm-duration-fast) var(--pm-ease-standard), color var(--pm-duration-fast) var(--pm-ease-standard);
2795
+ }
2796
+ }
2797
+ @media (forced-colors: active) { :where(.pm-toggle:is([data-pressed], [aria-pressed="true"])) { outline: 2px solid Highlight; outline-offset: -3px; } }
2798
+ }
2799
+
2800
+ /* Splitter — two panes and a draggable separator */
2801
+ @layer pm.components {
2802
+ :where(.pm-splitter) {
2803
+ --_pos: 50%;
2804
+ --_bar: 0.75rem;
2805
+ display: grid;
2806
+ grid-template-columns: minmax(0, var(--_pos)) var(--_bar) minmax(0, 1fr);
2807
+ min-block-size: 0;
2808
+ border: 1px solid var(--pm-color-border);
2809
+ border-radius: var(--pm-radius-lg);
2810
+ background: var(--pm-sf-bg, var(--pm-color-bg-surface));
2811
+ overflow: hidden;
2812
+ }
2813
+ :where(.pm-splitter[data-orientation="vertical"]) { grid-template-columns: none; grid-template-rows: minmax(0, var(--_pos)) var(--_bar) minmax(0, 1fr); }
2814
+ :where(.pm-splitter-pane) { min-inline-size: 0; min-block-size: 0; overflow: auto; }
2815
+ :where(.pm-splitter-bar) {
2816
+ position: relative;
2817
+ display: grid;
2818
+ place-items: center;
2819
+ cursor: col-resize;
2820
+ touch-action: none;
2821
+ outline: none;
2822
+ &::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 50%; inline-size: 1px; background: var(--pm-color-border); }
2823
+ &::after { content: ""; position: relative; inline-size: 4px; block-size: 2rem; border-radius: 2px; background: var(--pm-color-border-strong); }
2824
+ &:hover::before, &:focus-visible::before { inline-size: 2px; translate: -0.5px; background: var(--pm-color-accent-solid); }
2825
+ &:focus-visible::after { outline: 2px solid var(--pm-color-ring); outline-offset: 2px; }
2826
+ &[aria-disabled="true"] { cursor: default; }
2827
+ }
2828
+ :where(.pm-splitter[data-orientation="vertical"] > .pm-splitter-bar) {
2829
+ cursor: row-resize;
2830
+ &::before { inset-inline: 0; inset-block-start: 50%; inset-block-end: auto; inline-size: auto; block-size: 1px; }
2831
+ &::after { inline-size: 2rem; block-size: 4px; }
2832
+ &:hover::before, &:focus-visible::before { inline-size: auto; block-size: 2px; translate: 0 -0.5px; }
2833
+ }
2834
+ :where(.pm-splitter[data-dragging]) { user-select: none; }
2835
+ @media (forced-colors: active) { :where(.pm-splitter-bar)::after { background: ButtonText; } }
2836
+ }
2837
+
2838
+ /* Toolbar — <div class="pm-toolbar" role="toolbar">…</div> */
2839
+ @layer pm.components {
2840
+ :where(.pm-toolbar) {
2841
+ display: flex;
2842
+ flex-wrap: wrap;
2843
+ align-items: center;
2844
+ gap: var(--pm-space-1);
2845
+ padding: var(--pm-space-1);
2846
+ border: 1px solid var(--pm-color-border);
2847
+ border-radius: calc(var(--pm-radius-control, var(--pm-radius-md)) + 4px);
2848
+ background: var(--pm-sf-bg, var(--pm-color-bg-surface));
2849
+ box-shadow: var(--pm-sf-shadow, none);
2850
+ }
2851
+ :where(.pm-toolbar[orientation="vertical"]) { flex-direction: column; align-items: stretch; inline-size: fit-content; }
2852
+ :where(.pm-toolbar[data-plain]) { padding: 0; border: 0; background: none; box-shadow: none; }
2853
+ :where(.pm-toolbar > .pm-toolbar-spacer) { flex: 1; }
2854
+ }
2855
+
2856
+ /* List — rows with leading media, text and trailing meta/actions */
2857
+ @layer pm.components {
2858
+ :where(.pm-list) { display: grid; }
2859
+ :where(.pm-list[data-bordered]) { border: 1px solid var(--pm-color-border); border-radius: var(--pm-radius-lg); background: var(--pm-sf-bg, var(--pm-color-bg-surface)); overflow: hidden; padding: var(--pm-space-1); }
2860
+ :where(.pm-list-item) {
2861
+ display: flex;
2862
+ align-items: center;
2863
+ gap: var(--pm-space-3);
2864
+ padding-inline-end: var(--pm-space-3);
2865
+ border-radius: var(--pm-radius-md);
2866
+ color: var(--pm-color-fg);
2867
+ &[data-divided] { border-radius: 0; }
2868
+ &[data-interactive]:hover:not([data-disabled]) { background: var(--pm-color-bg-hover); }
2869
+ &[data-selected] { background: var(--pm-color-accent-soft); }
2870
+ &[data-selected] :where(.pm-list-heading) { color: var(--pm-color-accent-text); }
2871
+ &[data-disabled] { opacity: 0.55; }
2872
+ }
2873
+ :where(.pm-list-main) {
2874
+ flex: 1;
2875
+ min-inline-size: 0;
2876
+ display: flex;
2877
+ align-items: center;
2878
+ gap: var(--pm-space-3);
2879
+ padding: calc(var(--pm-space-2-5, 0.625rem) * var(--pm-density, 1)) var(--pm-space-3);
2880
+ padding-inline-end: 0;
2881
+ border: 0;
2882
+ border-radius: inherit;
2883
+ background: none;
2884
+ color: inherit;
2885
+ font: inherit;
2886
+ text-align: start;
2887
+ text-decoration: none;
2888
+ &:is(a, button) { cursor: pointer; }
2889
+ &:is(a, button):focus-visible { outline: 2px solid var(--pm-color-ring); outline-offset: -2px; }
2890
+ &:disabled { cursor: not-allowed; }
2891
+ }
2892
+ :where(.pm-list-start, .pm-list-end) { display: flex; align-items: center; gap: var(--pm-space-2); flex: none; color: var(--pm-color-fg-muted); }
2893
+ :where(.pm-list-start[hidden]) { display: none; }
2894
+ :where(.pm-list-end) { font-size: var(--pm-font-size-sm); }
2895
+ :where(.pm-list-body) { display: grid; gap: 2px; min-inline-size: 0; flex: 1; }
2896
+ :where(.pm-list-heading) { font-weight: var(--pm-font-weight-medium); overflow-wrap: anywhere; }
2897
+ :where(.pm-list-desc) { color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
2898
+ /* Swipe actions: the row slides over action buttons on touch screens. */
2899
+ :where(.pm-list[data-bordered]) { --pm-list-bg: var(--pm-sf-bg, var(--pm-color-bg-surface)); }
2900
+ :where(.pm-list-swipe) {
2901
+ position: relative;
2902
+ display: grid;
2903
+ overflow: hidden;
2904
+ border-radius: var(--pm-radius-md);
2905
+ touch-action: pan-y;
2906
+ &[data-divided] { border-radius: 0; }
2907
+ & > :where(.pm-list-item) {
2908
+ position: relative;
2909
+ z-index: 1;
2910
+ background: var(--pm-list-bg, var(--pm-color-bg-canvas));
2911
+ translate: var(--_x, 0px) 0;
2912
+ transition: translate var(--pm-duration-normal, 200ms) var(--pm-ease-out, ease-out);
2913
+ }
2914
+ &[data-dragging] > :where(.pm-list-item) { transition: none; }
2915
+ &:dir(rtl) > :where(.pm-list-item) { translate: calc(var(--_x, 0px) * -1) 0; }
2916
+ @media (prefers-reduced-motion: reduce) { & > :where(.pm-list-item) { transition: none; } }
2917
+ }
2918
+ :where(.pm-list-actions) {
2919
+ position: absolute;
2920
+ inset-block: 0;
2921
+ display: flex;
2922
+ align-items: center;
2923
+ gap: var(--pm-space-1);
2924
+ padding-inline: var(--pm-space-2);
2925
+ &[data-side="start"] { inset-inline-start: 0; }
2926
+ &[data-side="end"] { inset-inline-end: 0; }
2927
+ }
2928
+ @media (forced-colors: active) { :where(.pm-list-item[data-selected]) { outline: 2px solid Highlight; outline-offset: -2px; } }
2929
+ }
2930
+
2931
+ /* Sidebar navigation — groups, items, collapsible parents, icon rail */
2932
+ @layer pm.components {
2933
+ :where(.pm-nav) { display: grid; gap: var(--pm-space-3); font-size: var(--pm-font-size-sm); }
2934
+ :where(.pm-nav-group) { display: grid; gap: 2px; }
2935
+ :where(.pm-nav-heading) {
2936
+ padding: var(--pm-space-1) var(--pm-space-3);
2937
+ color: var(--pm-color-fg-muted);
2938
+ font-size: var(--pm-font-size-xs);
2939
+ font-weight: var(--pm-font-weight-semibold);
2940
+ letter-spacing: 0.06em;
2941
+ text-transform: uppercase;
2942
+ &[data-collapsed] { block-size: 1px; padding: 0; margin-block: var(--pm-space-2); overflow: hidden; color: transparent; background: var(--pm-color-border); }
2943
+ }
2944
+ :where(.pm-nav-item) { display: grid; }
2945
+ :where(.pm-nav-link) {
2946
+ --_depth: 0;
2947
+ display: flex;
2948
+ align-items: center;
2949
+ gap: var(--pm-space-2-5, 0.625rem);
2950
+ inline-size: 100%;
2951
+ min-block-size: 2.25rem;
2952
+ padding-block: var(--pm-space-1);
2953
+ padding-inline: calc(var(--pm-space-3) + var(--_depth) * 1.75rem) var(--pm-space-2-5, 0.625rem);
2954
+ border: 0;
2955
+ border-radius: var(--pm-radius-md);
2956
+ background: none;
2957
+ color: var(--pm-color-fg-muted);
2958
+ font: inherit;
2959
+ font-weight: var(--pm-font-weight-medium);
2960
+ text-align: start;
2961
+ text-decoration: none;
2962
+ cursor: pointer;
2963
+ position: relative;
2964
+ &:hover:not([aria-disabled="true"], :disabled) { background: var(--pm-color-bg-hover); color: var(--pm-color-fg); }
2965
+ &[aria-current="page"] { background: var(--pm-color-accent-soft); color: var(--pm-color-accent-text); font-weight: var(--pm-font-weight-semibold); }
2966
+ &[aria-current="page"]::before { content: ""; position: absolute; inset-inline-start: 0; inset-block: 0.5rem; inline-size: 3px; border-radius: 2px; background: var(--pm-color-accent-solid); }
2967
+ &[data-has-current] { color: var(--pm-color-fg); }
2968
+ &:is([aria-disabled="true"], :disabled) { opacity: 0.5; cursor: not-allowed; }
2969
+ &:focus-visible { outline: 2px solid var(--pm-color-ring); outline-offset: -2px; }
2970
+ }
2971
+ :where(.pm-nav-icon) { display: inline-grid; place-items: center; flex: none; font-size: 1.1em; }
2972
+ :where(.pm-nav-icon[hidden]) { display: none; }
2973
+ :where(.pm-nav-label) { flex: 1; min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
2974
+ :where(.pm-nav-end) { display: inline-flex; align-items: center; flex: none; }
2975
+ /* Count on a nav item (pm-nav-item count="3"): a pill at the end; on the phone tab bar it sits on the icon. */
2976
+ :where(.pm-nav-count) {
2977
+ display: inline-grid;
2978
+ place-items: center;
2979
+ min-inline-size: 1.25rem;
2980
+ block-size: 1.25rem;
2981
+ padding-inline: 0.35em;
2982
+ border-radius: var(--pm-radius-full);
2983
+ background: var(--pm-tone-solid, var(--pm-color-accent-solid));
2984
+ color: var(--pm-tone-on-solid, var(--pm-color-accent-on-solid));
2985
+ font-size: var(--pm-font-size-xs);
2986
+ font-weight: var(--pm-font-weight-semibold);
2987
+ font-variant-numeric: tabular-nums;
2988
+ line-height: 1;
2989
+ &[data-dot] { min-inline-size: 0.5rem; block-size: 0.5rem; padding: 0; }
2990
+ }
2991
+ /* Collapsed rail: the count becomes a dot on the icon. */
2992
+ :where(.pm-nav-item[data-collapsed]) :where(.pm-nav-icon) { position: relative; }
2993
+ :where(.pm-nav-item[data-collapsed]) :where(.pm-nav-count) {
2994
+ position: absolute; inset-block-start: -0.2rem; inset-inline-end: -0.3rem; min-inline-size: 0.5rem; block-size: 0.5rem; padding: 0; font-size: 0; box-shadow: 0 0 0 2px var(--pm-color-bg-canvas);
2995
+ }
2996
+ :where(.pm-nav-chevron) { flex: none; transition: rotate var(--pm-duration-fast) var(--pm-ease-standard); }
2997
+ :where(.pm-nav-link[aria-expanded="true"]) :where(.pm-nav-chevron) { rotate: 90deg; }
2998
+ @media (prefers-reduced-motion: reduce) { :where(.pm-nav-chevron) { transition: none; } }
2999
+ :where(.pm-nav-children) { display: grid; gap: 2px; margin-block-start: 2px; }
3000
+ :where(.pm-nav-children[hidden]) { display: none; }
3001
+ /* Icon rail */
3002
+ :where(.pm-nav-item[data-collapsed]) :where(.pm-nav-link) { justify-content: center; padding-inline: 0; inline-size: 2.5rem; min-block-size: 2.5rem; }
3003
+ :where(.pm-nav-item[data-collapsed]) :where(.pm-nav-label, .pm-nav-end, .pm-nav-chevron) { display: none; }
3004
+ :where([dir="rtl"]) :where(.pm-nav-chevron) { scale: -1 1; }
3005
+ @media (forced-colors: active) { :where(.pm-nav-link[aria-current="page"])::before { background: Highlight; } }
3006
+ }
3007
+ /* Bottom tab bar (pm-nav mobile="bar" on phones) */
3008
+ @layer pm.components {
3009
+ :where(.pm-nav[data-bar]) {
3010
+ display: flex;
3011
+ align-items: stretch;
3012
+ gap: 0;
3013
+ padding: var(--pm-space-1) var(--pm-space-1) max(var(--pm-space-1), var(--pm-safe-bottom, 0px));
3014
+ border-block-start: 1px solid var(--pm-color-border);
3015
+ background: color-mix(in oklab, var(--pm-color-bg-surface) 88%, transparent);
3016
+ backdrop-filter: blur(var(--pm-blur-md, 12px)) saturate(1.4);
3017
+ }
3018
+ @supports not (backdrop-filter: blur(1px)) { :where(.pm-nav[data-bar]) { background: var(--pm-color-bg-surface); } }
3019
+ :where(.pm-nav-link[data-bar]) {
3020
+ flex-direction: column;
3021
+ justify-content: center;
3022
+ gap: 2px;
3023
+ min-block-size: 3.25rem;
3024
+ padding: var(--pm-space-1);
3025
+ font-size: 0.6875rem;
3026
+ font-weight: var(--pm-font-weight-medium);
3027
+ text-align: center;
3028
+ &::before { display: none; }
3029
+ &[aria-current] { background: none; color: var(--pm-color-accent-text); }
3030
+ & :where(.pm-nav-icon) {
3031
+ position: relative;
3032
+ inline-size: 3.5rem;
3033
+ block-size: 1.75rem;
3034
+ border-radius: 999px;
3035
+ font-size: 1.35rem;
3036
+ @media (prefers-reduced-motion: no-preference) { transition: background-color var(--pm-duration-fast) var(--pm-ease-standard); }
3037
+ }
3038
+ &[aria-current] :where(.pm-nav-icon) { background: var(--pm-color-accent-soft); }
3039
+ & :where(.pm-nav-label) { inline-size: 100%; }
3040
+ & :where(.pm-nav-end) { position: absolute; inset-block-start: 0.125rem; inset-inline-start: calc(50% + 0.5rem); font-size: 0.625rem; }
3041
+ & :where(.pm-nav-chevron) { display: none; }
3042
+ }
3043
+ }
3044
+
3045
+ /* Range slider — two native range inputs over one track */
3046
+ @layer pm.components {
3047
+ :where(.pm-range-head) { display: flex; justify-content: space-between; align-items: baseline; gap: var(--pm-space-2); }
3048
+ :where(.pm-range-label) { font-size: var(--pm-font-size-sm); font-weight: var(--pm-font-weight-medium); }
3049
+ :where(.pm-range-value) { color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-sm); font-variant-numeric: tabular-nums; }
3050
+ :where(.pm-range) {
3051
+ --_track: 6px;
3052
+ --_thumb: 1.25rem;
3053
+ position: relative;
3054
+ display: grid;
3055
+ align-items: center;
3056
+ --_box: 1.5rem;
3057
+ block-size: var(--_box);
3058
+ &[data-disabled] { opacity: 0.55; }
3059
+ &[data-size="sm"] { --_track: 4px; --_thumb: 1rem; --_box: 1.5rem; /* 24px: the WCAG 2.5.8 minimum target, even at the small size */ }
3060
+ &[data-size="lg"] { --_track: 8px; --_thumb: 1.5rem; --_box: 1.75rem; }
3061
+ }
3062
+ :where(.pm-range-track) {
3063
+ position: absolute;
3064
+ inset-inline: calc(var(--_thumb) / 2);
3065
+ block-size: var(--_track);
3066
+ border-radius: 999px;
3067
+ background: var(--pm-color-bg-active);
3068
+ box-shadow: var(--pm-sf-control-shadow, none);
3069
+ }
3070
+ :where(.pm-range-fill) {
3071
+ position: absolute;
3072
+ inset-block: 0;
3073
+ inset-inline-start: var(--_lo);
3074
+ inline-size: calc(var(--_hi) - var(--_lo));
3075
+ border-radius: inherit;
3076
+ background: var(--pm-tone-solid);
3077
+ }
3078
+ :where(.pm-range-input) {
3079
+ position: absolute;
3080
+ inset: 0;
3081
+ inline-size: 100%;
3082
+ block-size: 100%;
3083
+ margin: 0;
3084
+ appearance: none;
3085
+ background: none;
3086
+ pointer-events: none;
3087
+ outline: none;
3088
+ &::-webkit-slider-runnable-track { background: none; block-size: 100%; }
3089
+ &::-moz-range-track { background: none; }
3090
+ &::-webkit-slider-thumb {
3091
+ appearance: none;
3092
+ pointer-events: auto;
3093
+ inline-size: var(--_thumb);
3094
+ block-size: var(--_thumb);
3095
+ margin-block-start: calc((var(--_box) - var(--_thumb)) / 2);
3096
+ border: 2px solid var(--pm-tone-solid);
3097
+ border-radius: 50%;
3098
+ background: var(--pm-color-bg-surface);
3099
+ box-shadow: var(--pm-sf-raise, var(--pm-elevation-1));
3100
+ cursor: grab;
3101
+ }
3102
+ &::-moz-range-thumb {
3103
+ pointer-events: auto;
3104
+ inline-size: calc(var(--_thumb) - 4px);
3105
+ block-size: calc(var(--_thumb) - 4px);
3106
+ border: 2px solid var(--pm-tone-solid);
3107
+ border-radius: 50%;
3108
+ background: var(--pm-color-bg-surface);
3109
+ cursor: grab;
3110
+ }
3111
+ &:active::-webkit-slider-thumb { cursor: grabbing; }
3112
+ &:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--pm-color-ring); outline-offset: 2px; }
3113
+ &:focus-visible::-moz-range-thumb { outline: 2px solid var(--pm-color-ring); outline-offset: 2px; }
3114
+ &:disabled::-webkit-slider-thumb { cursor: not-allowed; }
3115
+ }
3116
+ @media (forced-colors: active) { :where(.pm-range-fill) { background: Highlight; } }
3117
+ }
3118
+
3119
+ /* Sortable — reorderable rows */
3120
+ @layer pm.components {
3121
+ :where(.pm-sortable) { display: grid; gap: var(--pm-space-2); }
3122
+ :where(.pm-sortable-item) {
3123
+ position: relative;
3124
+ display: flex;
3125
+ align-items: center;
3126
+ gap: var(--pm-space-3);
3127
+ padding: var(--pm-space-2-5, 0.625rem) var(--pm-space-3);
3128
+ border: 1px solid var(--pm-color-border);
3129
+ border-radius: var(--pm-radius-md);
3130
+ background: var(--pm-sf-bg, var(--pm-color-bg-surface));
3131
+ box-shadow: var(--pm-sf-shadow, none);
3132
+ cursor: grab;
3133
+ user-select: none;
3134
+ touch-action: none;
3135
+ &:has([data-handle]) { cursor: default; touch-action: auto; }
3136
+ & :where([data-handle]) { cursor: grab; touch-action: none; color: var(--pm-color-fg-muted); }
3137
+ &:focus-visible { outline: 2px solid var(--pm-color-ring); outline-offset: 2px; }
3138
+ &:is([data-grabbed], [data-dragging]) { z-index: 1; border-color: var(--pm-color-accent-border-strong, var(--pm-color-ring)); box-shadow: var(--pm-elevation-3); cursor: grabbing; }
3139
+ &[data-grabbed] { background: var(--pm-color-accent-soft); }
3140
+ @media (prefers-reduced-motion: no-preference) {
3141
+ &:is([data-grabbed], [data-dragging]) { scale: 1.015; }
3142
+ transition: scale var(--pm-duration-fast) var(--pm-ease-standard), box-shadow var(--pm-duration-fast) var(--pm-ease-standard);
3143
+ }
3144
+ }
3145
+ @media (forced-colors: active) { :where(.pm-sortable-item[data-grabbed]) { outline: 2px solid Highlight; } }
3146
+ }
3147
+
3148
+ /* Sheet — Bottom sheets (shared by dialogs, drawers, menus and picker popups on phones) */
3149
+ @layer pm.components {
3150
+ :where([data-sheet]) {
3151
+ position: fixed;
3152
+ inset: auto 0 0 0;
3153
+ inline-size: 100%;
3154
+ max-inline-size: none;
3155
+ max-block-size: min(88dvh, 100dvh - var(--pm-safe-top, 0px) - 1rem);
3156
+ margin: 0;
3157
+ padding-block-start: 1.75rem;
3158
+ padding-block-end: max(var(--pm-space-4), var(--pm-safe-bottom, 0px));
3159
+ border-radius: var(--pm-radius-2xl) var(--pm-radius-2xl) 0 0;
3160
+ border-block-end: 0;
3161
+ border-inline: 0;
3162
+ overflow-y: auto;
3163
+ overscroll-behavior: contain;
3164
+ touch-action: pan-y;
3165
+ /* Grab handle */
3166
+ &::before {
3167
+ content: "";
3168
+ position: absolute;
3169
+ inset-block-start: 0.625rem;
3170
+ inset-inline-start: 50%;
3171
+ translate: -50% 0;
3172
+ inline-size: 2.5rem;
3173
+ block-size: 0.3125rem;
3174
+ border-radius: 999px;
3175
+ background: var(--pm-color-border-strong);
3176
+ }
3177
+ @media (prefers-reduced-motion: no-preference) {
3178
+ transition: translate var(--pm-duration-moderate) var(--pm-ease-emphasized, var(--pm-ease-standard)), overlay var(--pm-duration-moderate) allow-discrete, display var(--pm-duration-moderate) allow-discrete;
3179
+ @starting-style { translate: 0 100%; }
3180
+ }
3181
+ }
3182
+ /* Anchored popovers (menus) drop their anchor placement when shown as a sheet. */
3183
+ :where([popover][data-sheet]) { position-area: none; position-try-fallbacks: none; }
3184
+ :where(.pm-menu[data-sheet]) {
3185
+ padding-inline: var(--pm-space-2);
3186
+ & :where([role^="menuitem"], .pm-menu-item) { min-block-size: 3rem; font-size: var(--pm-font-size-md); }
3187
+ }
3188
+ :where([data-sheet][data-dragging]) { transition: none; user-select: none; }
3189
+ :where([data-sheet])::backdrop { background: var(--pm-color-overlay); }
3190
+ @media (forced-colors: active) { :where([data-sheet])::before { background: CanvasText; } }
3191
+ }
3192
+
3193
+ /* Indicator — a count or dot on the corner of an icon, button or avatar.
3194
+ <span class="pm-indicator"><button …>…</button><span class="pm-indicator-badge" aria-hidden="true">3</span></span> */
3195
+ @layer pm.components {
3196
+ :where(.pm-indicator) { position: relative; display: inline-flex; vertical-align: middle; }
3197
+ :where(.pm-indicator-badge) {
3198
+ --_s: 1.15rem;
3199
+ --_x: 35%;
3200
+ --_y: -35%;
3201
+ position: absolute;
3202
+ inset-block-start: 0;
3203
+ inset-inline-end: 0;
3204
+ z-index: 1;
3205
+ display: inline-grid;
3206
+ place-items: center;
3207
+ min-inline-size: var(--_s);
3208
+ block-size: var(--_s);
3209
+ padding-inline: 0.3em;
3210
+ border-radius: var(--pm-radius-full);
3211
+ background: var(--pm-tone-solid);
3212
+ color: var(--pm-tone-on-solid);
3213
+ /* A ring in the page colour separates the badge from what it sits on. */
3214
+ box-shadow: 0 0 0 2px var(--pm-color-bg-canvas);
3215
+ font-size: calc(var(--_s) * 0.62);
3216
+ font-weight: var(--pm-font-weight-semibold);
3217
+ font-variant-numeric: tabular-nums;
3218
+ line-height: 1;
3219
+ white-space: nowrap;
3220
+ pointer-events: none;
3221
+ translate: var(--_x) var(--_y);
3222
+ &:dir(rtl) { --_x: -35%; }
3223
+ &[hidden] { display: none; }
3224
+ &[data-dot] { --_s: 0.6rem; padding: 0; min-inline-size: var(--_s); }
3225
+ &[data-size="sm"] { --_s: 1rem; }
3226
+ &[data-size="lg"] { --_s: 1.35rem; }
3227
+ &[data-dot][data-size="sm"] { --_s: 0.5rem; }
3228
+ &[data-dot][data-size="lg"] { --_s: 0.75rem; }
3229
+ &[data-pulse]::after {
3230
+ content: "";
3231
+ position: absolute;
3232
+ inset: 0;
3233
+ border-radius: inherit;
3234
+ background: var(--pm-tone-solid);
3235
+ animation: pm-indicator-pulse 1.6s var(--pm-ease-out, ease-out) infinite;
3236
+ z-index: -1;
3237
+ }
3238
+ @media (prefers-reduced-motion: reduce) { &[data-pulse]::after { animation: none; } }
3239
+ @media (forced-colors: active) { border: 1px solid CanvasText; }
3240
+ }
3241
+ :where(.pm-indicator[data-placement="top-start"]) > :where(.pm-indicator-badge) { inset-inline: 0 auto; --_x: -35%; &:dir(rtl) { --_x: 35%; } }
3242
+ :where(.pm-indicator[data-placement="bottom-end"]) > :where(.pm-indicator-badge) { inset-block: auto 0; --_y: 35%; }
3243
+ :where(.pm-indicator[data-placement="bottom-start"]) > :where(.pm-indicator-badge) { inset-block: auto 0; inset-inline: 0 auto; --_y: 35%; --_x: -35%; &:dir(rtl) { --_x: 35%; } }
3244
+ @keyframes pm-indicator-pulse { from { opacity: 0.6; scale: 1; } to { opacity: 0; scale: 2.2; } }
3245
+ }
3246
+
3247
+ /* Pull to refresh — the content slides down and a circle with an arrow (then a spinner) appears above it. */
3248
+ @layer pm.components {
3249
+ :where(.pm-pull) { position: relative; }
3250
+ :where(.pm-pull-content) {
3251
+ translate: 0 var(--_pull, 0px);
3252
+ transition: translate var(--pm-duration-normal, 200ms) var(--pm-ease-out, ease-out);
3253
+ }
3254
+ :where(.pm-pull[data-pulling]) > :where(.pm-pull-content) { transition: none; }
3255
+ :where(.pm-pull-indicator) {
3256
+ position: absolute;
3257
+ inset-block-start: calc(var(--_pull, 0px) - 2.75rem);
3258
+ inset-inline-start: 50%;
3259
+ z-index: 1;
3260
+ display: grid;
3261
+ place-items: center;
3262
+ inline-size: 2.25rem;
3263
+ block-size: 2.25rem;
3264
+ margin-inline-start: -1.125rem;
3265
+ border: 1px solid var(--pm-color-border);
3266
+ border-radius: 50%;
3267
+ background: var(--pm-color-bg-surface);
3268
+ color: var(--pm-color-accent-text);
3269
+ box-shadow: var(--pm-shadow-md, 0 2px 8px rgb(0 0 0 / 0.15));
3270
+ opacity: var(--_progress, 0);
3271
+ transition: inset-block-start var(--pm-duration-normal, 200ms) var(--pm-ease-out, ease-out), opacity var(--pm-duration-fast, 120ms);
3272
+ }
3273
+ :where(.pm-pull[data-pulling]) > :where(.pm-pull-indicator) { transition: none; }
3274
+ :where(.pm-pull[data-refreshing]) > :where(.pm-pull-indicator) { opacity: 1; }
3275
+ :where(.pm-pull-arrow) { rotate: calc(var(--_progress, 0) * 180deg); transition: rotate var(--pm-duration-fast, 120ms); }
3276
+ :where(.pm-pull-spin) { animation: pm-pull-spin 0.8s linear infinite; }
3277
+ @keyframes pm-pull-spin { to { rotate: 360deg; } }
3278
+ @media (prefers-reduced-motion: reduce) {
3279
+ :where(.pm-pull-content, .pm-pull-indicator) { transition: none; }
3280
+ :where(.pm-pull-spin) { animation-duration: 2.4s; }
3281
+ }
3282
+ }
3283
+
3284
+ /* Chart and sparkline: dependency-free SVG. Colours come from the theme's roles, so every theme and mode works. */
3285
+ @layer pm.components {
3286
+ :where(.pm-chart) {
3287
+ --pm-chart-grid: var(--pm-color-border);
3288
+ --pm-chart-text: var(--pm-color-fg-muted);
3289
+ position: relative;
3290
+ display: grid;
3291
+ gap: var(--pm-space-3);
3292
+ min-inline-size: 0;
3293
+ color: var(--pm-color-fg);
3294
+ font-size: var(--pm-font-size-sm);
3295
+ & :where(.pm-chart-plot) { position: relative; min-inline-size: 0; border-radius: var(--pm-radius-md); touch-action: pan-y; outline: none; }
3296
+ & :where(.pm-chart-plot:focus-visible) { outline: 2px solid var(--pm-color-ring); outline-offset: 2px; }
3297
+ & :where(svg) { display: block; inline-size: 100%; direction: ltr; overflow: visible; }
3298
+ & :where(text) { fill: var(--pm-chart-text); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
3299
+ & :where(.pm-chart-grid) { stroke: var(--pm-chart-grid); stroke-width: 1; shape-rendering: crispEdges; }
3300
+ & :where(.pm-chart-zero) { stroke: var(--pm-color-border-strong); }
3301
+ & :where(.pm-chart-guide) { stroke: var(--pm-color-border-strong); stroke-width: 1; stroke-dasharray: 3 3; }
3302
+ & :where(.pm-chart-line) { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
3303
+ & :where(.pm-chart-area) { opacity: 0.16; stroke: none; }
3304
+ & :where(.pm-chart-dot) { stroke: var(--pm-color-bg-surface); stroke-width: 2; }
3305
+ & :where(.pm-chart-mark) { transition: opacity var(--pm-duration-fast); cursor: pointer; }
3306
+ & :where(.pm-chart-mark[data-dim]) { opacity: 0.45; }
3307
+ & :where(.pm-chart-slice) { stroke: var(--pm-color-bg-surface); stroke-width: 2; }
3308
+ & :where(.pm-chart-total) { fill: var(--pm-color-fg); font-family: var(--pm-font-display); font-size: 1.5rem; font-weight: var(--pm-font-weight-bold); }
3309
+ & :where(.pm-chart-empty) { display: grid; place-items: center; color: var(--pm-color-fg-muted); border: 1px dashed var(--pm-color-border); border-radius: var(--pm-radius-md); }
3310
+ & :where(.pm-chart-loading) { border-radius: var(--pm-radius-md); background: var(--pm-color-bg-muted); @media (prefers-reduced-motion: no-preference) { animation: pm-chart-pulse 1.4s ease-in-out infinite; } }
3311
+ @media (forced-colors: active) {
3312
+ & :where(.pm-chart-grid, .pm-chart-guide) { stroke: CanvasText; }
3313
+ & :where(.pm-chart-slice, .pm-chart-dot) { stroke: Canvas; }
3314
+ }
3315
+ }
3316
+ :where(.pm-chart-legend) {
3317
+ display: flex; flex-wrap: wrap; gap: var(--pm-space-1) var(--pm-space-4); margin: 0; padding: 0; list-style: none;
3318
+ color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-xs);
3319
+ & :where(li) { display: inline-flex; align-items: center; gap: var(--pm-space-2); }
3320
+ & :where(.pm-chart-swatch) { flex: none; inline-size: 0.65rem; block-size: 0.65rem; border-radius: 2px; background: var(--_c); forced-color-adjust: none; }
3321
+ & :where(strong) { color: var(--pm-color-fg); font-weight: var(--pm-font-weight-semibold); font-variant-numeric: tabular-nums; }
3322
+ }
3323
+ :where(.pm-chart-tip) {
3324
+ position: absolute; z-index: 1; inset-block-start: 0; inset-inline-start: 0; pointer-events: none;
3325
+ display: grid; gap: 2px; min-inline-size: 7rem; max-inline-size: 16rem; padding: var(--pm-space-2) var(--pm-space-3);
3326
+ border: 1px solid var(--pm-color-border); border-radius: var(--pm-radius-md);
3327
+ background: var(--pm-color-bg-overlay, var(--pm-color-bg-surface)); color: var(--pm-color-fg);
3328
+ box-shadow: var(--pm-elevation-3); font-size: var(--pm-font-size-xs); white-space: nowrap;
3329
+ & :where(.pm-chart-tip-title) { font-weight: var(--pm-font-weight-semibold); }
3330
+ & :where(.pm-chart-tip-row) { display: flex; align-items: center; gap: var(--pm-space-2); color: var(--pm-color-fg-muted); }
3331
+ & :where(.pm-chart-tip-row strong) { margin-inline-start: auto; padding-inline-start: var(--pm-space-3); color: var(--pm-color-fg); font-variant-numeric: tabular-nums; }
3332
+ }
3333
+ @keyframes pm-chart-pulse { 50% { opacity: 0.5; } }
3334
+
3335
+ /* ---------- Sparkline: <pm-sparkline values="3,5,4,8"> ---------- */
3336
+ :where(.pm-sparkline) {
3337
+ display: block; inline-size: var(--pm-sparkline-width, 6rem); block-size: var(--pm-sparkline-height, 1.75rem); overflow: visible; color: var(--pm-tone-solid);
3338
+ & :where(.pm-sparkline-line) { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
3339
+ & :where(.pm-sparkline-area) { fill: currentColor; opacity: 0.16; }
3340
+ & :where(.pm-sparkline-bar) { fill: currentColor; }
3341
+ @media (forced-colors: active) { color: CanvasText; }
3342
+ }
3343
+ }
3344
+
3345
+ /* Banner: a page-wide announcement bar — <div class="pm-banner" data-tone="info">…</div> */
3346
+ @layer pm.components {
3347
+ :where(.pm-banner) {
3348
+ display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: var(--pm-space-2) var(--pm-space-3);
3349
+ min-block-size: 2.75rem; padding: var(--pm-space-2) var(--pm-space-4);
3350
+ border-block-end: 1px solid var(--pm-tone-border);
3351
+ background: var(--pm-tone-soft); color: var(--pm-color-fg);
3352
+ font-size: var(--pm-font-size-sm); text-align: center;
3353
+ & :where(.pm-banner-icon) { display: inline-grid; place-items: center; color: var(--pm-tone-text); }
3354
+ & :where(.pm-banner-icon:empty) { display: none; }
3355
+ & :where(.pm-banner-body) { min-inline-size: 0; text-wrap: balance; }
3356
+ & :where(.pm-banner-body a) { color: var(--pm-tone-text-strong); font-weight: var(--pm-font-weight-semibold); text-underline-offset: 0.2em; }
3357
+ & :where(.pm-banner-actions) { display: inline-flex; align-items: center; gap: var(--pm-space-2); }
3358
+ & :where(.pm-banner-close) { margin-inline-start: auto; }
3359
+ }
3360
+ :where(.pm-banner[data-variant="solid"]) {
3361
+ background: var(--pm-tone-solid); border-color: transparent; color: var(--pm-tone-on-solid);
3362
+ & :where(.pm-banner-icon, .pm-banner-body a, .pm-banner-close) { color: inherit; }
3363
+ }
3364
+ /* Phones: text starts at the edge so two lines read naturally, close stays reachable. */
3365
+ @media (width < 40rem) { :where(.pm-banner) { justify-content: flex-start; text-align: start; } }
3366
+ }
3367
+
3368
+ /* Description list: label/value pairs — <dl class="pm-dl"><div><dt>Plan</dt><dd>Pro</dd></div></dl> */
3369
+ @layer pm.components {
3370
+ :where(.pm-dl) {
3371
+ --pm-dl-label: 11rem;
3372
+ display: grid; grid-template-columns: repeat(var(--pm-dl-columns, 1), minmax(0, 1fr)); gap: 0 var(--pm-space-8);
3373
+ margin: 0; min-inline-size: 0; font-size: var(--pm-font-size-sm); container-type: inline-size;
3374
+ }
3375
+ :where(.pm-dl > div, .pm-dl-item) {
3376
+ display: grid; grid-template-columns: min(var(--pm-dl-label), 42%) minmax(0, 1fr); gap: var(--pm-space-1) var(--pm-space-4); align-items: baseline;
3377
+ padding-block: calc(var(--pm-space-3) * var(--pm-density, 1)); min-inline-size: 0;
3378
+ }
3379
+ :where(.pm-dl dt, .pm-dl-label) { color: var(--pm-color-fg-muted); }
3380
+ :where(.pm-dl dd, .pm-dl-value) { margin: 0; min-inline-size: 0; color: var(--pm-color-fg); overflow-wrap: break-word; }
3381
+ :where(.pm-dl[data-divided] > div + div, .pm-dl-item[data-divided]) { border-block-start: 1px solid var(--pm-color-border); }
3382
+ :where(.pm-dl[data-layout="vertical"] > div, .pm-dl-item[data-layout="vertical"]) { grid-template-columns: minmax(0, 1fr); }
3383
+ :where(.pm-dl[data-layout="vertical"] dt, .pm-dl-item[data-layout="vertical"] .pm-dl-label) { font-size: var(--pm-font-size-xs); }
3384
+ /* Narrow containers (a small card, a phone): labels stack above values. */
3385
+ @container (width < 15rem) {
3386
+ :where(.pm-dl > div, .pm-dl-item) { grid-template-columns: minmax(0, 1fr); }
3387
+ }
3388
+ }
3389
+
3390
+ /* Image: fixed ratio, loading placeholder, fallback and optional zoom. `.pm-aspect` sets a ratio on any box. */
3391
+ @layer pm.components {
3392
+ :where(.pm-aspect) { aspect-ratio: var(--pm-ratio, 16 / 9); overflow: hidden; }
3393
+ :where(.pm-aspect > :is(img, video, iframe, picture)) { inline-size: 100%; block-size: 100%; object-fit: cover; }
3394
+ :where(.pm-image) {
3395
+ position: relative; display: block; overflow: hidden; inline-size: 100%;
3396
+ aspect-ratio: var(--pm-ratio, auto);
3397
+ border-radius: var(--pm-radius-md); background: var(--pm-color-bg-muted); color: var(--pm-color-fg-muted);
3398
+ & :where(img) { display: block; inline-size: 100%; block-size: 100%; object-fit: var(--pm-image-fit, cover); transition: opacity var(--pm-duration-normal, 0.2s); }
3399
+ &:where([data-state="loading"]) :where(img) { opacity: 0; }
3400
+ &:where([data-state="loading"]) { @media (prefers-reduced-motion: no-preference) { animation: pm-image-pulse 1.4s ease-in-out infinite; } }
3401
+ & :where(.pm-image-fallback) { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: var(--pm-space-1); padding: var(--pm-space-3); text-align: center; font-size: var(--pm-font-size-xs); }
3402
+ & :where(.pm-image-zoom) { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: inherit; }
3403
+ & :where(.pm-image-zoom:focus-visible) { outline: 2px solid var(--pm-color-ring); outline-offset: -2px; }
3404
+ }
3405
+ :where(.pm-lightbox) {
3406
+ inline-size: 100vw; block-size: 100dvh; max-inline-size: none; max-block-size: none; margin: 0; padding: var(--pm-space-4); border: 0;
3407
+ background: transparent; cursor: zoom-out;
3408
+ &:where([open]) { display: grid; place-items: center; }
3409
+ &::backdrop { background: rgb(0 0 0 / 0.85); }
3410
+ & :where(img) { max-inline-size: 100%; max-block-size: calc(100dvh - var(--pm-space-8)); object-fit: contain; border-radius: var(--pm-radius-md); }
3411
+ & :where(.pm-lightbox-close) { position: fixed; inset-block-start: var(--pm-space-3); inset-inline-end: var(--pm-space-3); color: #fff; }
3412
+ }
3413
+ @keyframes pm-image-pulse { 50% { opacity: 0.55; } }
3414
+ }
3415
+
3416
+ /* Meter: a measurement within a known range (disk use, password strength, score). Not for task progress. */
3417
+ @layer pm.components {
3418
+ :where(.pm-meter) {
3419
+ --_h: 0.5rem;
3420
+ display: grid; gap: var(--pm-space-2); min-inline-size: 0; font-size: var(--pm-font-size-sm);
3421
+ &:where([data-size="sm"]) { --_h: 0.25rem; }
3422
+ &:where([data-size="lg"]) { --_h: 0.75rem; }
3423
+ & :where(.pm-meter-head) { display: flex; justify-content: space-between; gap: var(--pm-space-3); color: var(--pm-color-fg); }
3424
+ & :where(.pm-meter-value) { color: var(--pm-color-fg-muted); font-variant-numeric: tabular-nums; }
3425
+ & :where(.pm-meter-track) { position: relative; block-size: var(--_h); border-radius: 999px; background: var(--pm-color-bg-muted); overflow: hidden; }
3426
+ & :where(.pm-meter-fill) {
3427
+ block-size: 100%; inline-size: var(--_pct, 0%); border-radius: inherit; background: var(--_fill, var(--pm-tone-solid));
3428
+ transition: inline-size var(--pm-duration-normal, 0.2s) var(--pm-ease-standard, ease);
3429
+ @media (prefers-reduced-motion: reduce) { transition: none; }
3430
+ }
3431
+ &:where([data-level="good"]) { --_fill: var(--pm-color-success-solid); }
3432
+ &:where([data-level="ok"]) { --_fill: var(--pm-color-warning-solid); }
3433
+ &:where([data-level="bad"]) { --_fill: var(--pm-color-danger-solid); }
3434
+ /* Segments: equal steps with gaps (password strength, ratings out of n). */
3435
+ &:where([data-segments]) :where(.pm-meter-track) {
3436
+ background: none; border-radius: 0;
3437
+ mask: repeating-linear-gradient(to right, #000 0 calc((100% - (var(--_n) - 1) * 3px) / var(--_n)), transparent 0 calc((100% - (var(--_n) - 1) * 3px) / var(--_n) + 3px));
3438
+ }
3439
+ &:where([data-segments]) :where(.pm-meter-track)::before { content: ""; position: absolute; inset: 0; background: var(--pm-color-bg-muted); }
3440
+ &:where([data-segments]) :where(.pm-meter-fill) { position: relative; border-radius: 0; }
3441
+ @media (forced-colors: active) {
3442
+ & :where(.pm-meter-track) { border: 1px solid CanvasText; }
3443
+ & :where(.pm-meter-fill) { background: Highlight; }
3444
+ }
3445
+ }
3446
+ }
3447
+
3448
+ /* Code block, QR code, virtual list, signature pad and tour. */
3449
+ @layer pm.components {
3450
+ /* ---------- Code block ---------- */
3451
+ :where(.pm-code) {
3452
+ --_bg: light-dark(var(--pm-neutral-12), var(--pm-neutral-2));
3453
+ --_fg: light-dark(var(--pm-neutral-1), var(--pm-neutral-12));
3454
+ --_dim: light-dark(var(--pm-neutral-7), var(--pm-neutral-11));
3455
+ position: relative; display: grid; min-inline-size: 0;
3456
+ border: 1px solid var(--pm-color-border); border-radius: var(--pm-radius-lg); overflow: hidden;
3457
+ background: var(--_bg); color: var(--_fg);
3458
+ & :where(.pm-code-bar) {
3459
+ display: flex; align-items: center; gap: var(--pm-space-1); min-block-size: 2.25rem; padding-inline: var(--pm-space-4) var(--pm-space-2);
3460
+ border-block-end: 1px solid color-mix(in oklab, var(--_fg) 14%, transparent);
3461
+ }
3462
+ & :where(.pm-code-label) { margin-inline-end: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--_dim); font-size: var(--pm-font-size-xs); font-weight: var(--pm-font-weight-semibold); letter-spacing: 0.04em; }
3463
+ & :where(.pm-code-btn) {
3464
+ min-block-size: 1.75rem; padding-inline: var(--pm-space-2); border: 0; border-radius: var(--pm-radius-sm); background: none; color: var(--_dim);
3465
+ font: inherit; font-size: var(--pm-font-size-xs); font-weight: var(--pm-font-weight-semibold); cursor: pointer;
3466
+ &:is(:hover, [aria-pressed="true"]) { color: var(--_fg); background: color-mix(in oklab, var(--_fg) 12%, transparent); }
3467
+ &:focus-visible { outline: 2px solid var(--_fg); outline-offset: -2px; }
3468
+ }
3469
+ & :where(pre) {
3470
+ margin: 0; padding: var(--pm-space-4); overflow: auto; background: none; color: inherit; tab-size: 2;
3471
+ font-family: var(--pm-font-mono); font-size: var(--pm-font-size-sm); line-height: 1.6;
3472
+ &:focus-visible { outline: 2px solid var(--_fg); outline-offset: -2px; }
3473
+ }
3474
+ & :where(code) { font: inherit; background: none; padding: 0; color: inherit; }
3475
+ &:where([data-wrap]) :where(pre) { white-space: pre-wrap; overflow-wrap: anywhere; }
3476
+ &:where([data-collapsed]) :where(pre) { max-block-size: var(--_max, 20rem); overflow: hidden; mask-image: linear-gradient(#000 70%, transparent); }
3477
+ & :where(.pm-code-more) { display: block; inline-size: 100%; min-block-size: 2.25rem; border-radius: 0; border-block-start: 1px solid color-mix(in oklab, var(--_fg) 14%, transparent); }
3478
+ /* Line numbers: one counter per line, kept out of selection and copying. */
3479
+ &:where([data-lines]) :where(.pm-code-line) { counter-increment: pm-line; }
3480
+ &:where([data-lines]) :where(code) { counter-reset: pm-line; }
3481
+ &:where([data-lines]) :where(.pm-code-line)::before {
3482
+ content: counter(pm-line); display: inline-block; inline-size: 2.5ch; margin-inline-end: var(--pm-space-4); color: var(--_dim); text-align: end; user-select: none; opacity: 0.7;
3483
+ }
3484
+ & :where(.t-c) { color: var(--_dim); font-style: italic; }
3485
+ & :where(.t-k) { color: light-dark(var(--pm-accent-7), var(--pm-accent-11)); }
3486
+ & :where(.t-s) { color: light-dark(var(--pm-success-7), var(--pm-success-11)); }
3487
+ & :where(.t-n, .t-f) { color: light-dark(var(--pm-warning-7), var(--pm-warning-11)); }
3488
+ & :where(.t-x) { color: light-dark(var(--pm-info-7), var(--pm-info-11)); }
3489
+ & :where(.t-a) { color: light-dark(var(--pm-secondary-7), var(--pm-secondary-11)); }
3490
+ & :where(.t-p) { color: var(--_dim); }
3491
+ @media (forced-colors: active) { & :where([class^="t-"]) { color: inherit; } }
3492
+ }
3493
+
3494
+ /* ---------- QR code: always dark on light, so scanners can read it in every theme ---------- */
3495
+ :where(.pm-qr) {
3496
+ display: inline-grid; justify-items: center; gap: var(--pm-space-2); margin: 0;
3497
+ & :where(svg) { display: block; inline-size: var(--_size, 10rem); block-size: auto; border-radius: var(--pm-radius-md); background: var(--pm-qr-bg, #fff); color: var(--pm-qr-fg, #000); }
3498
+ & :where(figcaption) { color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-xs); text-align: center; max-inline-size: var(--_size, 10rem); overflow-wrap: anywhere; }
3499
+ & :where(.pm-qr-error) { display: grid; place-items: center; inline-size: var(--_size, 10rem); aspect-ratio: 1; padding: var(--pm-space-3); border: 1px dashed var(--pm-color-border-strong); border-radius: var(--pm-radius-md); color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-xs); text-align: center; }
3500
+ }
3501
+
3502
+ /* ---------- Virtual list: only the visible rows are in the page ---------- */
3503
+ :where(.pm-vlist) {
3504
+ position: relative; overflow: auto; block-size: var(--_height, 20rem); overscroll-behavior: contain;
3505
+ border: 1px solid var(--pm-color-border); border-radius: var(--pm-radius-md); background: var(--pm-color-bg-surface);
3506
+ &:focus-visible { outline: 2px solid var(--pm-color-ring); outline-offset: 2px; }
3507
+ & :where(.pm-vlist-space) { position: relative; }
3508
+ & :where(.pm-vlist-row) {
3509
+ position: absolute; inset-inline: 0; display: flex; align-items: center; gap: var(--pm-space-3); padding-inline: var(--pm-space-4);
3510
+ border-block-end: 1px solid var(--pm-color-border); font-size: var(--pm-font-size-sm); overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
3511
+ }
3512
+ & :where(.pm-vlist-empty) { display: grid; place-items: center; block-size: 100%; color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-sm); }
3513
+ }
3514
+
3515
+ /* ---------- Signature pad ---------- */
3516
+ :where(.pm-signature) {
3517
+ position: relative; display: grid; border: 1px solid var(--pm-color-border-strong); border-radius: var(--pm-radius-md); background: var(--pm-color-bg-surface); overflow: hidden;
3518
+ &:where([data-invalid]) { border-color: var(--pm-color-danger-border-strong); }
3519
+ &:has(canvas:focus-visible) { outline: 2px solid var(--pm-color-ring); outline-offset: 2px; }
3520
+ & :where(canvas) { display: block; inline-size: 100%; block-size: var(--_height, 10rem); touch-action: none; cursor: crosshair; outline: none; }
3521
+ & :where(.pm-signature-line) { position: absolute; inset-inline: var(--pm-space-5); inset-block-end: 2.25rem; border-block-end: 1px dashed var(--pm-color-border-strong); pointer-events: none; }
3522
+ & :where(.pm-signature-hint) { position: absolute; inset-inline-start: var(--pm-space-5); inset-block-end: var(--pm-space-2); color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-xs); pointer-events: none; }
3523
+ & :where(.pm-signature-clear) { position: absolute; inset-inline-end: var(--pm-space-1); inset-block-start: var(--pm-space-1); }
3524
+ &:where([data-disabled]) { opacity: 0.6; & :where(canvas) { cursor: not-allowed; } }
3525
+ }
3526
+
3527
+ /* ---------- Tour: a card that points at one part of the page at a time ---------- */
3528
+ :where(.pm-tour-ring) {
3529
+ position: fixed; z-index: 2147483000; pointer-events: none; border-radius: var(--pm-radius-md);
3530
+ box-shadow: 0 0 0 3px var(--pm-color-accent-solid), 0 0 0 100vmax color-mix(in oklch, var(--pm-color-bg-inverse) 45%, transparent);
3531
+ @media (prefers-reduced-motion: no-preference) { transition: inset var(--pm-duration-normal) var(--pm-ease-out), inline-size var(--pm-duration-normal) var(--pm-ease-out), block-size var(--pm-duration-normal) var(--pm-ease-out); }
3532
+ }
3533
+ :where(.pm-tour-card) {
3534
+ position: fixed; inset: auto; margin: 0; inline-size: min(22rem, 100vw - 1.5rem); padding: var(--pm-space-4);
3535
+ border: 1px solid var(--pm-color-border); border-radius: var(--pm-radius-lg); background: var(--pm-color-bg-surface); color: var(--pm-color-fg); box-shadow: var(--pm-shadow-xl);
3536
+ &:is(:popover-open) { display: grid; gap: var(--pm-space-2); }
3537
+ & :where(.pm-tour-title) { margin: 0; font-size: var(--pm-font-size-md); font-weight: var(--pm-font-weight-semibold); }
3538
+ & :where(.pm-tour-text) { margin: 0; color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-sm); }
3539
+ & :where(.pm-tour-foot) { display: flex; align-items: center; gap: var(--pm-space-2); margin-block-start: var(--pm-space-2); }
3540
+ & :where(.pm-tour-count) { margin-inline-end: auto; color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-xs); font-variant-numeric: tabular-nums; }
3541
+ &::backdrop { background: transparent; }
3542
+ }
3543
+ }
3544
+
3545
+ /* Transfer list, cascader and tree select. */
3546
+ @layer pm.components {
3547
+ /* ---------- Shared: a button that looks like a field and opens a panel ---------- */
3548
+ :where(.pm-picker-trigger) {
3549
+ display: flex; align-items: center; gap: var(--pm-space-2); text-align: start; cursor: pointer;
3550
+ & > :where(.pm-picker-value) { flex: 1; min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
3551
+ & > :where(.pm-picker-value[data-placeholder]) { color: var(--pm-color-fg-muted); }
3552
+ &::after { content: ""; flex: none; inline-size: 0.45em; block-size: 0.45em; margin-block-start: -0.25em; border-block-end: 1.5px solid currentColor; border-inline-end: 1.5px solid currentColor; rotate: 45deg; opacity: 0.7; }
3553
+ &:where([aria-invalid="true"]) { --_border: var(--pm-color-danger-border-strong); }
3554
+ &:disabled { opacity: 0.55; cursor: not-allowed; }
3555
+ }
3556
+ :where(.pm-picker-count) { flex: none; padding: 0 var(--pm-space-1-5, 0.375rem); border-radius: var(--pm-radius-full); background: var(--pm-color-accent-soft); color: var(--pm-color-accent-text); font-size: var(--pm-font-size-xs); font-weight: var(--pm-font-weight-semibold); }
3557
+
3558
+ /* ---------- Cascader: one column per level ---------- */
3559
+ :where(.pm-cascader-panel) {
3560
+ display: flex; max-inline-size: min(40rem, 100vw - 1rem); overflow-x: auto; overscroll-behavior: contain;
3561
+ & > :where(.pm-listbox) { flex: none; inline-size: 11rem; --pm-listbox-max: 16rem; }
3562
+ & > :where(.pm-listbox + .pm-listbox) { border-inline-start: 1px solid var(--pm-color-border); }
3563
+ & :where(.pm-option[data-branch])::after { content: ""; flex: none; inline-size: 0.4em; block-size: 0.4em; border-block-start: 1.5px solid currentColor; border-inline-end: 1.5px solid currentColor; rotate: 45deg; opacity: 0.6; }
3564
+ & :where(.pm-option[data-branch]):dir(rtl)::after { rotate: -135deg; }
3565
+ & :where(.pm-option[data-open]) { background: var(--pm-color-bg-muted); }
3566
+ & :where(.pm-option[aria-selected="true"]) { color: var(--pm-color-accent-text); font-weight: var(--pm-font-weight-semibold); }
3567
+ }
3568
+
3569
+ /* ---------- Tree select ---------- */
3570
+ :where(.pm-tree-panel) {
3571
+ inline-size: max(100%, 16rem); max-inline-size: min(26rem, 100vw - 1rem);
3572
+ & :where(.pm-tree-search) { padding: var(--pm-space-2); border-block-end: 1px solid var(--pm-color-border); }
3573
+ & :where(.pm-option) { padding-inline-start: calc(var(--pm-space-2) + var(--_depth, 0) * 1.25rem); }
3574
+ & :where(.pm-tree-twist) {
3575
+ flex: none; display: grid; place-items: center; inline-size: 1.25rem; block-size: 1.25rem; border: 0; padding: 0; background: none; color: var(--pm-color-fg-muted); cursor: pointer; border-radius: var(--pm-radius-sm);
3576
+ &::before { content: ""; inline-size: 0.4em; block-size: 0.4em; border-block-end: 1.5px solid currentColor; border-inline-end: 1.5px solid currentColor; rotate: -45deg; transition: rotate var(--pm-duration-fast) var(--pm-ease-standard); }
3577
+ &:where([data-open])::before { rotate: 45deg; }
3578
+ &:where([data-leaf]) { visibility: hidden; }
3579
+ }
3580
+ & :where(.pm-tree-twist):dir(rtl)::before { rotate: 135deg; }
3581
+ & :where(.pm-tree-twist[data-open]):dir(rtl)::before { rotate: 45deg; }
3582
+ & :where(.pm-tree-box) {
3583
+ flex: none; display: grid; place-items: center; inline-size: 1rem; block-size: 1rem; border: 1.5px solid var(--pm-color-border-strong); border-radius: var(--pm-radius-xs);
3584
+ &::before { content: ""; inline-size: 0.7rem; block-size: 0.7rem; background: var(--pm-color-accent-on-solid); mask: var(--pm-check-mask) center / contain no-repeat; opacity: 0; }
3585
+ }
3586
+ & :where(.pm-option[aria-checked="true"], .pm-option[aria-checked="mixed"]) :where(.pm-tree-box) { background: var(--pm-color-accent-solid); border-color: var(--pm-color-accent-solid); &::before { opacity: 1; } }
3587
+ & :where(.pm-option[aria-checked="mixed"]) :where(.pm-tree-box)::before { mask-image: var(--pm-dash-mask); }
3588
+ & :where(.pm-option[aria-selected="true"]) { color: var(--pm-color-accent-text); font-weight: var(--pm-font-weight-semibold); }
3589
+ }
3590
+
3591
+ /* ---------- Transfer list ---------- */
3592
+ :where(.pm-transfer) {
3593
+ display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: var(--pm-space-3); align-items: stretch;
3594
+ & :where(.pm-transfer-pane) { display: grid; grid-template-rows: auto auto 1fr; min-inline-size: 0; border: 1px solid var(--pm-color-border-strong); border-radius: var(--pm-radius-md); background: var(--pm-color-bg-surface); overflow: hidden; }
3595
+ &:where([data-invalid]) :where(.pm-transfer-pane:last-child) { border-color: var(--pm-color-danger-border-strong); }
3596
+ & :where(.pm-transfer-head) { display: flex; align-items: center; gap: var(--pm-space-2); padding: var(--pm-space-2) var(--pm-space-3); border-block-end: 1px solid var(--pm-color-border); background: var(--pm-color-bg-subtle); font-size: var(--pm-font-size-sm); font-weight: var(--pm-font-weight-semibold); }
3597
+ & :where(.pm-transfer-count) { margin-inline-start: auto; color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-xs); font-weight: var(--pm-font-weight-regular, 400); font-variant-numeric: tabular-nums; }
3598
+ & :where(.pm-transfer-search) { padding: var(--pm-space-2); border-block-end: 1px solid var(--pm-color-border); }
3599
+ & :where(.pm-listbox) { --pm-listbox-max: var(--_height, 14rem); block-size: min(var(--_height, 14rem), 60vh); }
3600
+ & :where(.pm-listbox):focus-visible { outline: 2px solid var(--pm-color-ring); outline-offset: -2px; }
3601
+ & :where(.pm-transfer-actions) { display: grid; align-content: center; gap: var(--pm-space-2); }
3602
+ @container (width < 30rem) {
3603
+ grid-template-columns: minmax(0, 1fr);
3604
+ & :where(.pm-transfer-actions) { grid-auto-flow: column; justify-content: center; }
3605
+ & :where(.pm-transfer-actions .pm-button) { rotate: 90deg; }
3606
+ }
3607
+ }
3608
+ :where(.pm-transfer-wrap) { container-type: inline-size; }
3609
+ }
3610
+
3611
+ /* Scheduler: week and day calendar with timed events. */
3612
+ @layer pm.components {
3613
+ :where(.pm-scheduler) {
3614
+ --_hour: 3rem; --_gutter: 3.5rem;
3615
+ display: grid; grid-template-rows: auto 1fr; min-inline-size: 0; container-type: inline-size;
3616
+ border: 1px solid var(--pm-color-border); border-radius: var(--pm-radius-lg); background: var(--pm-color-bg-surface); overflow: hidden;
3617
+ & :where(.pm-scheduler-bar) { display: flex; flex-wrap: wrap; align-items: center; gap: var(--pm-space-2); padding: var(--pm-space-3); border-block-end: 1px solid var(--pm-color-border); }
3618
+ & :where(.pm-scheduler-title) { margin: 0 auto 0 var(--pm-space-2); font-size: var(--pm-font-size-md); font-weight: var(--pm-font-weight-semibold); }
3619
+ & :where(.pm-scheduler-views) { display: inline-flex; padding: 2px; border-radius: var(--pm-radius-md); background: var(--pm-color-bg-muted); }
3620
+ & :where(.pm-scheduler-views button) {
3621
+ min-block-size: 1.75rem; padding-inline: var(--pm-space-3); border: 0; border-radius: var(--pm-radius-sm); background: none; color: var(--pm-color-fg-muted); font: inherit; font-size: var(--pm-font-size-sm); cursor: pointer;
3622
+ &:where([aria-pressed="true"]) { background: var(--pm-color-bg-surface); color: var(--pm-color-fg); box-shadow: var(--pm-shadow-xs); }
3623
+ &:focus-visible { outline: 2px solid var(--pm-color-ring); outline-offset: 1px; }
3624
+ }
3625
+ & :where(.pm-scheduler-scroll) { overflow: auto; max-block-size: var(--_height, 32rem); overscroll-behavior: contain; }
3626
+ & :where(.pm-scheduler-scroll):focus-visible { outline: 2px solid var(--pm-color-ring); outline-offset: -2px; }
3627
+ & :where(.pm-scheduler-grid) { display: grid; grid-template-columns: var(--_gutter) repeat(var(--_days, 7), minmax(6.5rem, 1fr)); min-inline-size: max-content; inline-size: 100%; }
3628
+ & :where(.pm-scheduler-corner) { position: sticky; inset-block-start: 0; inset-inline-start: 0; z-index: 3; background: var(--pm-color-bg-surface); border-block-end: 1px solid var(--pm-color-border); }
3629
+ & :where(.pm-scheduler-day-head) {
3630
+ position: sticky; inset-block-start: 0; z-index: 2; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px var(--pm-space-1);
3631
+ padding: var(--pm-space-2); text-align: start;
3632
+ border-block-end: 1px solid var(--pm-color-border); border-inline-start: 1px solid var(--pm-color-border); background: var(--pm-color-bg-surface);
3633
+ & > :where(h3) { margin: 0; color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-xs); font-weight: var(--pm-font-weight-medium); }
3634
+ & > :where(h3 b) { display: block; color: var(--pm-color-fg); font-size: var(--pm-font-size-lg); font-weight: var(--pm-font-weight-semibold); }
3635
+ &:where([data-today]) :where(h3 b) { color: var(--pm-color-accent-text); }
3636
+ }
3637
+ & :where(.pm-scheduler-allday) { grid-column: 1 / -1; }
3638
+ & :where(.pm-scheduler-add) {
3639
+ display: inline-grid; place-items: center; inline-size: 1.75rem; block-size: 1.75rem; padding: 0; border: 0; border-radius: var(--pm-radius-sm);
3640
+ background: none; color: var(--pm-color-fg-muted); cursor: pointer;
3641
+ &:hover { background: var(--pm-color-bg-hover); color: var(--pm-color-fg); }
3642
+ &:focus-visible { outline: 2px solid var(--pm-color-ring); outline-offset: 1px; }
3643
+ @media (pointer: coarse) { inline-size: 2.25rem; block-size: 2.25rem; }
3644
+ }
3645
+ & :where(.pm-scheduler-allday) { display: grid; gap: 2px; min-block-size: 0.25rem; }
3646
+ & :where(.pm-scheduler-times) { position: sticky; inset-inline-start: 0; z-index: 1; background: var(--pm-color-bg-surface); }
3647
+ & :where(.pm-scheduler-times > span) { display: block; block-size: var(--_hour); padding-inline-end: var(--pm-space-2); color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-xs); text-align: end; translate: 0 -0.6em; font-variant-numeric: tabular-nums; }
3648
+ & :where(.pm-scheduler-times > span:first-child) { visibility: hidden; }
3649
+ & :where(.pm-scheduler-day) {
3650
+ position: relative; border-inline-start: 1px solid var(--pm-color-border); cursor: cell;
3651
+ background-image: linear-gradient(to bottom, var(--pm-color-border) 1px, transparent 1px); background-size: 100% var(--_hour);
3652
+ &:where([data-today]) { background-color: color-mix(in oklch, var(--pm-color-accent-soft) 35%, transparent); }
3653
+ }
3654
+ & :where(.pm-scheduler-day > ul) { margin: 0; padding: 0; list-style: none; }
3655
+ & :where(.pm-scheduler-now) { position: absolute; inset-inline: 0; z-index: 1; block-size: 0; border-block-start: 2px solid var(--pm-color-danger-solid); pointer-events: none; }
3656
+ & :where(.pm-scheduler-now)::before { content: ""; position: absolute; inset-inline-start: -4px; inset-block-start: -5px; inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--pm-color-danger-solid); }
3657
+ & :where(.pm-scheduler-event) {
3658
+ display: block; inline-size: 100%; min-block-size: 1.25rem; padding: 2px var(--pm-space-1-5, 0.375rem); overflow: hidden; text-align: start; cursor: pointer;
3659
+ border: 0; border-inline-start: 3px solid var(--pm-tone-solid); border-radius: var(--pm-radius-sm); background: var(--pm-tone-soft); color: var(--pm-tone-text-strong);
3660
+ font: inherit; font-size: var(--pm-font-size-xs); line-height: 1.3;
3661
+ &:hover { background: var(--pm-tone-soft-hover); }
3662
+ &:focus-visible { outline: 2px solid var(--pm-color-ring); outline-offset: 1px; z-index: 2; }
3663
+ & > :where(b) { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--pm-font-weight-semibold); }
3664
+ & > :where(span) { display: block; overflow: hidden; text-overflow: ellipsis; opacity: 0.85; white-space: nowrap; }
3665
+ }
3666
+ & :where(.pm-scheduler-day .pm-scheduler-event) { position: absolute; box-shadow: 0 0 0 1px var(--pm-color-bg-surface); }
3667
+ & :where(.pm-scheduler-empty) { padding: var(--pm-space-2) var(--pm-space-3); color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-xs); border-block-start: 1px solid var(--pm-color-border); }
3668
+ @container (width < 34rem) {
3669
+ & :where(.pm-scheduler-title) { flex-basis: 100%; order: -1; margin: 0; }
3670
+ }
3671
+ }
3672
+ }
3673
+
3674
+ /* Rich-text editor: toolbar + editable area. */
3675
+ @layer pm.components {
3676
+ :where(.pm-editor) { display: block; }
3677
+ :where(.pm-editor-box) {
3678
+ display: grid; border: 1px solid var(--pm-sf-control-border, var(--pm-color-border-strong)); border-radius: var(--pm-radius-md); background: var(--pm-sf-control-bg, var(--pm-color-bg-surface)); overflow: hidden;
3679
+ &:focus-within { outline: 2px solid var(--pm-color-ring); outline-offset: 0; border-color: var(--pm-color-ring); }
3680
+ &:where([data-invalid]) { border-color: var(--pm-color-danger-border-strong); }
3681
+ &:where([data-disabled]) { opacity: 0.6; }
3682
+ }
3683
+ :where(.pm-editor-toolbar) {
3684
+ display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: var(--pm-space-1); border-block-end: 1px solid var(--pm-color-border); background: var(--pm-color-bg-subtle);
3685
+ & > :where(button) {
3686
+ display: inline-grid; place-items: center; min-inline-size: 2rem; min-block-size: 2rem; padding: 0 var(--pm-space-1-5, 0.375rem);
3687
+ border: 0; border-radius: var(--pm-radius-sm); background: none; color: var(--pm-color-fg); font: inherit; font-size: var(--pm-font-size-sm); font-weight: var(--pm-font-weight-semibold); cursor: pointer;
3688
+ &::before { content: attr(data-glyph); }
3689
+ &:hover:not(:disabled) { background: var(--pm-color-bg-hover); }
3690
+ &:where([aria-pressed="true"]) { background: var(--pm-color-accent-soft); color: var(--pm-color-accent-text); }
3691
+ &:focus-visible { outline: 2px solid var(--pm-color-ring); outline-offset: -2px; }
3692
+ &:disabled { opacity: 0.45; cursor: not-allowed; }
3693
+ }
3694
+ & > :where(.pm-editor-sep) { inline-size: 1px; align-self: stretch; margin: var(--pm-space-1) var(--pm-space-1); background: var(--pm-color-border); }
3695
+ @media (pointer: coarse) { & > :where(button) { min-inline-size: 2.5rem; min-block-size: 2.5rem; } }
3696
+ }
3697
+ :where(.pm-editor-link) {
3698
+ display: flex; flex-wrap: wrap; align-items: center; gap: var(--pm-space-2); padding: var(--pm-space-2); border-block-end: 1px solid var(--pm-color-border); background: var(--pm-color-bg-subtle);
3699
+ & > :where(input) { flex: 1 1 12rem; }
3700
+ &:where([hidden]) { display: none; }
3701
+ }
3702
+ :where(.pm-editor-area) {
3703
+ min-block-size: var(--pm-editor-min, 8rem); max-block-size: var(--pm-editor-max, 24rem); overflow: auto; padding: var(--pm-space-3) var(--pm-space-4); outline: none;
3704
+ color: var(--pm-color-fg); font-size: var(--pm-font-size-sm); line-height: var(--pm-line-height-relaxed, 1.65); overflow-wrap: anywhere;
3705
+ &:where([data-empty])::before { content: attr(data-placeholder); color: var(--pm-color-fg-muted); pointer-events: none; float: inline-start; block-size: 0; }
3706
+ & :where(p, ul, ol, blockquote, pre, h2, h3) { margin: 0 0 var(--pm-space-2); }
3707
+ & :where(h2) { font-size: var(--pm-font-size-xl); line-height: 1.25; }
3708
+ & :where(h3) { font-size: var(--pm-font-size-lg); line-height: 1.3; }
3709
+ & :where(ul, ol) { padding-inline-start: 1.5em; }
3710
+ & :where(blockquote) { padding-inline-start: var(--pm-space-3); border-inline-start: 3px solid var(--pm-color-border-strong); color: var(--pm-color-fg-muted); }
3711
+ & :where(code) { padding: 0.1em 0.35em; border-radius: var(--pm-radius-xs); background: var(--pm-color-bg-muted); font-family: var(--pm-font-mono); font-size: 0.92em; }
3712
+ & :where(pre) { padding: var(--pm-space-3); border-radius: var(--pm-radius-md); background: var(--pm-color-bg-muted); font-family: var(--pm-font-mono); font-size: 0.92em; white-space: pre-wrap; }
3713
+ & :where(a) { color: var(--pm-color-accent-text); text-decoration: underline; text-underline-offset: 0.2em; }
3714
+ & > :where(:last-child) { margin-block-end: 0; }
3715
+ }
3716
+ }
3717
+
3718
+ /* Chat: message list, bubbles and composer, for support chat, team messaging and AI assistants. */
3719
+ @layer pm.components {
3720
+ :where(.pm-chat) {
3721
+ position: relative; display: flex; flex-direction: column; gap: var(--pm-space-3);
3722
+ min-block-size: 0; block-size: 100%; overflow-y: auto; overscroll-behavior: contain; padding: var(--pm-space-4);
3723
+ scrollbar-width: thin;
3724
+ &:focus-visible { outline: 2px solid var(--pm-color-ring); outline-offset: -2px; }
3725
+ }
3726
+ :where(.pm-chat-latest) { position: sticky; inset-block-end: 0; align-self: center; margin-block-start: auto; box-shadow: var(--pm-elevation-2); }
3727
+ :where(.pm-chat-day) { align-self: center; padding: 2px var(--pm-space-3); border-radius: 999px; background: var(--pm-color-bg-muted); color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-xs); }
3728
+
3729
+ :where(.pm-message) {
3730
+ display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px var(--pm-space-2); align-items: end;
3731
+ max-inline-size: min(100%, 42rem); font-size: var(--pm-font-size-sm);
3732
+ & :where(.pm-message-avatar) { grid-row: 1 / span 3; align-self: end; display: grid; }
3733
+ & :where(.pm-message-avatar:empty) { display: none; }
3734
+ & :where(.pm-message-meta) { grid-column: 2; display: flex; gap: var(--pm-space-2); align-items: baseline; color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-xs); }
3735
+ & :where(.pm-message-meta strong) { color: var(--pm-color-fg); font-weight: var(--pm-font-weight-semibold); }
3736
+ & :where(.pm-message-bubble) {
3737
+ grid-column: 2; justify-self: start; min-inline-size: 0; max-inline-size: 100%;
3738
+ padding: var(--pm-space-2) var(--pm-space-3);
3739
+ border-radius: var(--pm-radius-lg); border-end-start-radius: var(--pm-radius-xs, 4px);
3740
+ background: var(--pm-color-bg-muted); color: var(--pm-color-fg);
3741
+ line-height: var(--pm-line-height-normal); overflow-wrap: anywhere;
3742
+ }
3743
+ & :where(.pm-message-status) { grid-column: 2; color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-xs); }
3744
+ & :where(.pm-message-status[data-status="failed"]) { color: var(--pm-color-danger-text); }
3745
+ & :where(.pm-message-actions) { grid-column: 2; display: flex; gap: var(--pm-space-1); }
3746
+ }
3747
+ /* Own messages: on the end side, in the tone colour. */
3748
+ :where(.pm-message[data-from="me"]) {
3749
+ align-self: flex-end; grid-template-columns: minmax(0, 1fr) auto;
3750
+ & :where(.pm-message-avatar) { grid-column: 2; }
3751
+ & :where(.pm-message-meta, .pm-message-bubble, .pm-message-status, .pm-message-actions) { grid-column: 1; justify-self: end; }
3752
+ & :where(.pm-message-bubble) { background: var(--pm-tone-solid); color: var(--pm-tone-on-solid); border-end-start-radius: var(--pm-radius-lg); border-end-end-radius: var(--pm-radius-xs, 4px); }
3753
+ }
3754
+ /* Plain variant: no bubble, full width (AI answers, long text). */
3755
+ :where(.pm-message[data-variant="plain"]) { max-inline-size: 100%; }
3756
+ :where(.pm-message[data-variant="plain"]) :where(.pm-message-bubble) { padding: 0; background: none; color: var(--pm-color-fg); border-radius: 0; }
3757
+ :where(.pm-message-caret) { display: inline-block; inline-size: 0.5em; block-size: 1em; margin-inline-start: 2px; vertical-align: text-bottom; background: currentColor; border-radius: 1px; @media (prefers-reduced-motion: no-preference) { animation: pm-caret 1s steps(2) infinite; } }
3758
+ :where(.pm-message-typing) { display: inline-flex; gap: 4px; padding-block: 0.35em; }
3759
+ :where(.pm-message-typing > span) { inline-size: 6px; block-size: 6px; border-radius: 50%; background: currentColor; opacity: 0.45; @media (prefers-reduced-motion: no-preference) { animation: pm-typing 1.2s ease-in-out infinite; } }
3760
+ :where(.pm-message-typing > span:nth-child(2)) { animation-delay: 0.15s; }
3761
+ :where(.pm-message-typing > span:nth-child(3)) { animation-delay: 0.3s; }
3762
+ @keyframes pm-caret { 50% { opacity: 0; } }
3763
+ @keyframes pm-typing { 30% { opacity: 1; translate: 0 -3px; } 60% { translate: 0 0; } }
3764
+
3765
+ :where(.pm-composer) {
3766
+ display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: end; gap: var(--pm-space-2);
3767
+ padding: var(--pm-space-2); border: 1px solid var(--pm-color-border-strong); border-radius: var(--pm-radius-lg);
3768
+ background: var(--pm-color-bg-surface); font-size: var(--pm-font-size-sm);
3769
+ &:focus-within { border-color: var(--pm-tone-solid); outline: 2px solid var(--pm-color-ring); outline-offset: 1px; }
3770
+ &:where([data-disabled]) { opacity: 0.6; }
3771
+ & :where(textarea) {
3772
+ grid-column: 2; inline-size: 100%; min-block-size: 2.25rem; max-block-size: 12rem; padding: 0.4rem var(--pm-space-1); border: 0; outline: 0; resize: none;
3773
+ background: none; color: inherit; font: inherit; line-height: var(--pm-line-height-normal); field-sizing: content;
3774
+ }
3775
+ & :where(textarea)::placeholder { color: var(--pm-color-fg-muted); }
3776
+ & :where(.pm-composer-start, .pm-composer-end) { display: flex; align-items: center; gap: var(--pm-space-1); }
3777
+ & :where(.pm-composer-top) { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--pm-space-2); }
3778
+ & :where(.pm-composer-top:empty) { display: none; }
3779
+ }
3780
+ }
3781
+
3782
+ /* Small page helpers: back to top, floating action button, countdown, animated number, scroll area, marquee,
3783
+ disclosure, choice cards and the form error summary. */
3784
+ @layer pm.components {
3785
+ /* ---------- Floating action button: <button class="pm-button pm-fab" data-icon aria-label="New"> ---------- */
3786
+ :where(.pm-fab) {
3787
+ position: fixed; z-index: 30;
3788
+ inset-block-end: calc(var(--pm-fab-offset, var(--pm-space-6)) + env(safe-area-inset-bottom, 0px)); inset-inline-end: var(--pm-fab-offset, var(--pm-space-6));
3789
+ min-inline-size: 3.5rem; min-block-size: 3.5rem; border-radius: 999px; box-shadow: var(--pm-elevation-4);
3790
+ }
3791
+ :where(.pm-fab[data-position="start"]) { inset-inline: var(--pm-fab-offset, var(--pm-space-6)) auto; }
3792
+ :where(.pm-fab[data-position="center"]) { inset-inline: 50% auto; translate: -50% 0; }
3793
+ :where(.pm-fab[data-position="center"]:dir(rtl)) { translate: 50% 0; }
3794
+ /* Sits above a native tab bar. */
3795
+ @media (width < 40rem) { :where([mobile]:not([mobile="false"], [mobile="off"], [mobile="web"])) :where(.pm-fab) { --pm-fab-offset: var(--pm-space-4); inset-block-end: calc(4.5rem + env(safe-area-inset-bottom, 0px)); } }
3796
+
3797
+ :where(.pm-back-to-top) {
3798
+ transition: opacity var(--pm-duration-fast), translate var(--pm-duration-fast), visibility 0s;
3799
+ &:where([data-hidden]) { opacity: 0; translate: 0 0.5rem; visibility: hidden; pointer-events: none; transition: opacity var(--pm-duration-fast), translate var(--pm-duration-fast), visibility 0s var(--pm-duration-fast); }
3800
+ @media (prefers-reduced-motion: reduce) { transition: none; }
3801
+ /* Inside a scrolling panel: floats in the panel's bottom corner, over the last lines. */
3802
+ &:where([data-contained]) {
3803
+ position: sticky; display: flex; inline-size: 3rem; min-inline-size: 3rem; min-block-size: 3rem; inset: auto;
3804
+ inset-block-end: var(--pm-space-3); margin-block-start: -3rem; margin-inline: auto 0;
3805
+ }
3806
+ &:where([data-contained][data-position="start"]) { margin-inline: 0 auto; }
3807
+ &:where([data-contained][data-position="center"]) { margin-inline: auto; translate: none; }
3808
+ }
3809
+
3810
+ /* ---------- Sticky: stays in view while its section scrolls. <header class="pm-sticky"> ----------
3811
+ --pm-sticky-offset sets the gap from the top (e.g. below a fixed app bar). Where the browser supports scroll-state
3812
+ queries, a shadow appears only once it is actually stuck. */
3813
+ :where(.pm-sticky) {
3814
+ position: sticky; inset-block-start: var(--pm-sticky-offset, 0); z-index: 10; container-type: scroll-state;
3815
+ background: var(--pm-sticky-bg, var(--pm-color-bg-surface));
3816
+ &:where([data-edge="bottom"]) { inset-block: auto var(--pm-sticky-offset, 0); }
3817
+ }
3818
+ @container scroll-state(stuck: top) { :where(.pm-sticky-inner) { box-shadow: var(--pm-elevation-2); } }
3819
+ @container scroll-state(stuck: bottom) { :where(.pm-sticky-inner) { box-shadow: var(--pm-elevation-2); } }
3820
+
3821
+ /* ---------- Countdown ---------- */
3822
+ :where(.pm-countdown) {
3823
+ display: inline-flex; gap: var(--pm-space-3); font-variant-numeric: tabular-nums;
3824
+ & :where(.pm-countdown-unit) { display: grid; justify-items: center; gap: 2px; min-inline-size: 3ch; }
3825
+ & :where(.pm-countdown-value) { font-family: var(--pm-font-display); font-size: var(--pm-font-size-3xl); font-weight: var(--pm-font-weight-bold); line-height: 1; }
3826
+ & :where(.pm-countdown-label) { color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-xs); text-transform: uppercase; letter-spacing: var(--pm-tracking-wide); }
3827
+ &:where([data-size="sm"]) :where(.pm-countdown-value) { font-size: var(--pm-font-size-xl); }
3828
+ &:where([data-variant="inline"]) { gap: 0.35em; }
3829
+ &:where([data-variant="inline"]) :where(.pm-countdown-unit) { display: inline-flex; align-items: baseline; gap: 1px; min-inline-size: 0; }
3830
+ &:where([data-variant="inline"]) :where(.pm-countdown-value) { font: inherit; font-weight: var(--pm-font-weight-semibold); }
3831
+ &:where([data-variant="inline"]) :where(.pm-countdown-label) { text-transform: none; letter-spacing: 0; font-size: inherit; }
3832
+ }
3833
+ :where(.pm-format-number) { font-variant-numeric: tabular-nums; }
3834
+
3835
+ /* ---------- Scroll area: thin themed scrollbars and edge fades. <div class="pm-scroll-area" tabindex="0"> ---------- */
3836
+ :where(.pm-scroll-area) {
3837
+ overflow: auto; overscroll-behavior: contain; max-block-size: var(--pm-scroll-height, 20rem);
3838
+ scrollbar-width: thin; scrollbar-color: var(--pm-color-border-strong) transparent;
3839
+ &:focus-visible { outline: 2px solid var(--pm-color-ring); outline-offset: 2px; }
3840
+ }
3841
+ :where(.pm-scroll-area[data-fade]) {
3842
+ @supports (animation-timeline: scroll()) {
3843
+ mask-image: linear-gradient(to bottom, transparent, #000 var(--_top, 0px), #000 calc(100% - var(--_bottom, 1.5rem)), transparent);
3844
+ animation: pm-scroll-fade linear both; animation-timeline: scroll(self);
3845
+ }
3846
+ }
3847
+ @property --_top { syntax: "<length>"; inherits: false; initial-value: 0px; }
3848
+ @property --_bottom { syntax: "<length>"; inherits: false; initial-value: 1.5rem; }
3849
+ @keyframes pm-scroll-fade { 0% { --_top: 0px; --_bottom: 1.5rem; } 8%, 92% { --_top: 1.5rem; --_bottom: 1.5rem; } 100% { --_top: 1.5rem; --_bottom: 0px; } }
3850
+
3851
+ /* ---------- Marquee: <div class="pm-marquee" tabindex="0" role="group" aria-label="…"><div class="pm-marquee-track">items… items again…</div></div>
3852
+ tabindex lets keyboard users scroll the row when reduced motion turns it into a scroll area. ---------- */
3853
+ :where(.pm-marquee) {
3854
+ overflow: hidden; mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
3855
+ & > :where(.pm-marquee-track) {
3856
+ display: flex; inline-size: max-content; gap: var(--pm-marquee-gap, var(--pm-space-8)); padding-inline-end: var(--pm-marquee-gap, var(--pm-space-8));
3857
+ @media (prefers-reduced-motion: no-preference) { animation: pm-marquee var(--pm-marquee-duration, 30s) linear infinite; }
3858
+ }
3859
+ &:where(:hover, :focus-within) > :where(.pm-marquee-track) { animation-play-state: paused; }
3860
+ /* Reduced motion: a row the user scrolls themselves. */
3861
+ @media (prefers-reduced-motion: reduce) { overflow-x: auto; mask-image: none; }
3862
+ }
3863
+ @keyframes pm-marquee { to { translate: -50% 0; } }
3864
+
3865
+ /* ---------- Disclosure: native <details class="pm-details"> ---------- */
3866
+ :where(.pm-details) {
3867
+ border: 1px solid var(--pm-color-border); border-radius: var(--pm-radius-md); background: var(--pm-color-bg-surface);
3868
+ & > :where(summary) {
3869
+ display: flex; align-items: center; justify-content: space-between; gap: var(--pm-space-3); min-block-size: 2.75rem; padding: var(--pm-space-2) var(--pm-space-4);
3870
+ cursor: pointer; list-style: none; font-weight: var(--pm-font-weight-medium); border-radius: inherit;
3871
+ }
3872
+ & > :where(summary)::-webkit-details-marker { display: none; }
3873
+ & > :where(summary)::after { content: ""; flex: none; inline-size: 1em; block-size: 1em; background: currentColor; mask: var(--pm-chevron) center / contain no-repeat; transition: rotate var(--pm-duration-fast); }
3874
+ &:where([open]) > :where(summary)::after { rotate: 180deg; }
3875
+ & > :where(summary:focus-visible) { outline: 2px solid var(--pm-color-ring); outline-offset: -2px; }
3876
+ & > :where(:not(summary)) { padding: 0 var(--pm-space-4) var(--pm-space-4); }
3877
+ &::details-content { @media (prefers-reduced-motion: no-preference) { transition: block-size var(--pm-duration-normal, 0.2s), content-visibility var(--pm-duration-normal, 0.2s) allow-discrete; block-size: 0; overflow: clip; } }
3878
+ &:where([open])::details-content { block-size: auto; }
3879
+ }
3880
+
3881
+ /* ---------- Choice cards: radios and checkboxes as selectable cards ---------- */
3882
+ :where(.pm-check-label[data-card]) {
3883
+ display: flex; align-items: flex-start; gap: var(--pm-space-3); padding: var(--pm-space-3) var(--pm-space-4);
3884
+ border: 1px solid var(--pm-color-border-strong); border-radius: var(--pm-radius-md); background: var(--pm-color-bg-surface);
3885
+ transition: border-color var(--pm-duration-fast), background-color var(--pm-duration-fast);
3886
+ &:hover { background: var(--pm-color-bg-hover); }
3887
+ &:has(:checked) { border-color: var(--pm-tone-solid); background: var(--pm-tone-soft); box-shadow: inset 0 0 0 1px var(--pm-tone-solid); }
3888
+ &:has(:focus-visible) { outline: 2px solid var(--pm-color-ring); outline-offset: 2px; }
3889
+ &:has(:disabled) { opacity: 0.6; }
3890
+ & > :where(input) { margin-block-start: 0.15em; }
3891
+ & :where(.pm-check-text) { display: grid; gap: 2px; min-inline-size: 0; }
3892
+ & :where(.pm-check-desc) { color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-xs); font-weight: var(--pm-font-weight-regular); }
3893
+ @media (forced-colors: active) { &:has(:checked) { border-color: Highlight; box-shadow: inset 0 0 0 1px Highlight; } }
3894
+ }
3895
+ :where(.pm-choice-grid) { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: var(--pm-space-2); }
3896
+
3897
+ /* ---------- Form error summary ---------- */
3898
+ :where(.pm-form-summary) {
3899
+ padding: var(--pm-space-3) var(--pm-space-4); border: 1px solid var(--pm-color-danger-border); border-radius: var(--pm-radius-md);
3900
+ background: var(--pm-color-danger-soft); color: var(--pm-color-fg); font-size: var(--pm-font-size-sm);
3901
+ &:focus-visible { outline: 2px solid var(--pm-color-ring); outline-offset: 2px; }
3902
+ & :where(strong) { color: var(--pm-color-danger-text-strong, var(--pm-color-danger-text)); }
3903
+ & :where(ul) { margin: var(--pm-space-1) 0 0; padding-inline-start: 1.2em; display: grid; gap: 2px; }
3904
+ & :where(a) { color: var(--pm-color-danger-text); }
3905
+ }
3906
+ }
3907
+
3908
+ /* Typography: long-form prose and text utilities. Families, sizes, weights, leading, tracking and measure are
3909
+ tokens (--pm-font-*, --pm-font-size-*, --pm-font-weight-*, --pm-line-height-*, --pm-tracking-*, --pm-measure-*);
3910
+ switch every family at once with data-font="<pairing>" on any element. */
3911
+ @layer pm.components {
3912
+ /* ---------- Prose: <article class="pm-prose"> for Markdown/CMS output ---------- */
3913
+ :where(.pm-prose) {
3914
+ max-inline-size: var(--pm-prose-measure, var(--pm-measure-normal));
3915
+ font-family: var(--pm-font-body);
3916
+ font-size: var(--pm-prose-size, var(--pm-font-size-md));
3917
+ line-height: var(--pm-line-height-relaxed);
3918
+ color: var(--pm-color-fg);
3919
+ overflow-wrap: break-word;
3920
+ hyphens: auto;
3921
+
3922
+ & > :where(* + *) { margin-block-start: 1.1em; }
3923
+ & :where(h1, h2, h3, h4, h5, h6) {
3924
+ font-family: var(--pm-font-display);
3925
+ line-height: var(--pm-line-height-tight);
3926
+ letter-spacing: var(--pm-tracking-tight);
3927
+ text-wrap: balance;
3928
+ scroll-margin-block-start: 5rem;
3929
+ }
3930
+ & :where(h1) { font-size: var(--pm-font-size-4xl); font-weight: var(--pm-font-weight-bold); }
3931
+ & :where(h2) { font-size: var(--pm-font-size-2xl); font-weight: var(--pm-font-weight-bold); margin-block-start: 2em; }
3932
+ & :where(h3) { font-size: var(--pm-font-size-xl); font-weight: var(--pm-font-weight-semibold); margin-block-start: 1.6em; }
3933
+ & :where(h4, h5, h6) { font-size: var(--pm-font-size-lg); font-weight: var(--pm-font-weight-semibold); margin-block-start: 1.4em; }
3934
+ & :where(h1, h2, h3, h4, h5, h6) + :where(*) { margin-block-start: 0.6em; }
3935
+ & :where(p, li) { text-wrap: pretty; }
3936
+ & :where(.pm-lead, p.lead) { font-size: var(--pm-font-size-lg); color: var(--pm-color-fg-muted); }
3937
+ & :where(strong, b) { font-weight: var(--pm-font-weight-semibold); color: var(--pm-color-fg); }
3938
+ & :where(a) { color: var(--pm-color-accent-text); text-decoration-line: underline; text-underline-offset: 0.2em; }
3939
+ & :where(ul, ol) { padding-inline-start: 1.4em; }
3940
+ & :where(li + li, li > ul, li > ol) { margin-block-start: 0.4em; }
3941
+ & :where(li::marker) { color: var(--pm-color-fg-muted); }
3942
+ & :where(ol > li::marker) { font-variant-numeric: tabular-nums; }
3943
+ & :where(blockquote) {
3944
+ margin-inline: 0;
3945
+ padding-inline-start: 1em;
3946
+ border-inline-start: 3px solid var(--pm-color-accent-border);
3947
+ color: var(--pm-color-fg-muted);
3948
+ font-style: italic;
3949
+ }
3950
+ & :where(hr) { border: 0; border-block-start: 1px solid var(--pm-color-border); margin-block: 2.5em; }
3951
+ & :where(code):not(:where(pre *)) {
3952
+ padding: 0.12em 0.36em;
3953
+ border-radius: var(--pm-radius-xs, 4px);
3954
+ background: var(--pm-color-bg-muted);
3955
+ font-family: var(--pm-font-mono);
3956
+ font-size: 0.88em;
3957
+ }
3958
+ & :where(pre) {
3959
+ padding: 1em 1.2em;
3960
+ border: 1px solid var(--pm-color-border);
3961
+ border-radius: var(--pm-radius-lg);
3962
+ background: var(--pm-color-bg-subtle);
3963
+ font-family: var(--pm-font-mono);
3964
+ font-size: 0.85em;
3965
+ line-height: var(--pm-line-height-normal);
3966
+ overflow-x: auto;
3967
+ tab-size: 2;
3968
+ }
3969
+ & :where(kbd) {
3970
+ padding: 0.1em 0.4em;
3971
+ border: 1px solid var(--pm-color-border-strong);
3972
+ border-block-end-width: 2px;
3973
+ border-radius: var(--pm-radius-sm);
3974
+ font-family: var(--pm-font-sans);
3975
+ font-size: 0.85em;
3976
+ }
3977
+ & :where(mark) { background: var(--pm-color-warning-soft); color: inherit; padding-inline: 0.15em; border-radius: 2px; }
3978
+ & :where(abbr[title]) { text-decoration: underline dotted; cursor: help; }
3979
+ & :where(img, video, svg, canvas, iframe) { max-inline-size: 100%; block-size: auto; border-radius: var(--pm-radius-md); }
3980
+ & :where(figure) { margin-inline: 0; }
3981
+ & :where(figcaption) { margin-block-start: 0.6em; color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-sm); text-align: center; }
3982
+ & :where(table) { inline-size: 100%; border-collapse: collapse; font-size: 0.92em; font-variant-numeric: tabular-nums; }
3983
+ & :where(th, td) { padding: 0.55em 0.7em; border-block-end: 1px solid var(--pm-color-border); text-align: start; vertical-align: top; }
3984
+ & :where(th) { color: var(--pm-color-fg-muted); font-weight: var(--pm-font-weight-semibold); }
3985
+ & :where(dt) { font-weight: var(--pm-font-weight-semibold); }
3986
+ & :where(dd) { margin-inline-start: 1.2em; color: var(--pm-color-fg-muted); }
3987
+ & :where(details) { padding: 0.6em 0.9em; border: 1px solid var(--pm-color-border); border-radius: var(--pm-radius-md); }
3988
+ & :where(summary) { cursor: pointer; font-weight: var(--pm-font-weight-semibold); }
3989
+
3990
+ &:where([data-size="sm"]) { --pm-prose-size: var(--pm-font-size-sm); }
3991
+ &:where([data-size="lg"]) { --pm-prose-size: var(--pm-font-size-lg); }
3992
+ &:where([data-measure="narrow"]) { --pm-prose-measure: var(--pm-measure-narrow); }
3993
+ &:where([data-measure="wide"]) { --pm-prose-measure: var(--pm-measure-wide); }
3994
+ &:where([data-measure="none"]) { --pm-prose-measure: none; }
3995
+ /* Narrow screens: tables scroll inside the text column instead of widening the page. */
3996
+ @media (width < 40rem) { & :where(table) { display: block; overflow-x: auto; } }
3997
+ }
3998
+ }
3999
+
4000
+ @layer pm.utilities {
4001
+ /* ---------- Families ---------- */
4002
+ .pm-font-sans { font-family: var(--pm-font-sans); }
4003
+ .pm-font-serif { font-family: var(--pm-font-serif); }
4004
+ .pm-font-display { font-family: var(--pm-font-display); }
4005
+ .pm-font-mono { font-family: var(--pm-font-mono); }
4006
+ .pm-font-body { font-family: var(--pm-font-body); }
4007
+
4008
+ /* ---------- Sizes (fluid: larger steps shrink slightly on small screens) ---------- */
4009
+ .pm-text-2xs { font-size: calc(var(--pm-font-size-xs) * 0.9); }
4010
+ .pm-text-md { font-size: var(--pm-font-size-md); }
4011
+ .pm-text-lg { font-size: var(--pm-font-size-lg); }
4012
+ .pm-text-xl { font-size: var(--pm-font-size-xl); }
4013
+ .pm-text-2xl { font-size: var(--pm-font-size-2xl); line-height: var(--pm-line-height-snug); }
4014
+ .pm-text-3xl { font-size: var(--pm-font-size-3xl); line-height: var(--pm-line-height-tight); }
4015
+ .pm-text-4xl { font-size: var(--pm-font-size-4xl); line-height: var(--pm-line-height-tight); }
4016
+ .pm-text-5xl { font-size: var(--pm-font-size-5xl); line-height: var(--pm-line-height-tight); letter-spacing: var(--pm-tracking-tighter); }
4017
+ /* Headings by look, independent of the element (keep h1–h6 for document structure). */
4018
+ .pm-display { font-family: var(--pm-font-display); font-size: var(--pm-font-size-5xl); font-weight: var(--pm-font-weight-bold); line-height: 1.05; letter-spacing: var(--pm-tracking-tighter); text-wrap: balance; }
4019
+ .pm-heading { font-family: var(--pm-font-display); font-weight: var(--pm-font-weight-semibold); line-height: var(--pm-line-height-tight); letter-spacing: var(--pm-tracking-tight); text-wrap: balance; }
4020
+ .pm-lead { font-size: var(--pm-font-size-lg); line-height: var(--pm-line-height-relaxed); color: var(--pm-color-fg-muted); text-wrap: pretty; }
4021
+ .pm-eyebrow { font-size: var(--pm-font-size-xs); font-weight: var(--pm-font-weight-semibold); letter-spacing: var(--pm-tracking-widest); text-transform: uppercase; color: var(--pm-color-accent-text); }
4022
+ .pm-caption { font-size: var(--pm-font-size-xs); color: var(--pm-color-fg-muted); }
4023
+
4024
+ /* ---------- Weight, style, leading, tracking ---------- */
4025
+ .pm-weight-regular { font-weight: var(--pm-font-weight-regular); }
4026
+ .pm-weight-medium { font-weight: var(--pm-font-weight-medium); }
4027
+ .pm-weight-semibold { font-weight: var(--pm-font-weight-semibold); }
4028
+ .pm-weight-bold { font-weight: var(--pm-font-weight-bold); }
4029
+ .pm-italic { font-style: italic; }
4030
+ .pm-leading-tight { line-height: var(--pm-line-height-tight); }
4031
+ .pm-leading-snug { line-height: var(--pm-line-height-snug); }
4032
+ .pm-leading-normal { line-height: var(--pm-line-height-normal); }
4033
+ .pm-leading-relaxed { line-height: var(--pm-line-height-relaxed); }
4034
+ .pm-tracking-tight { letter-spacing: var(--pm-tracking-tight); }
4035
+ .pm-tracking-wide { letter-spacing: var(--pm-tracking-wide); }
4036
+ .pm-uppercase { text-transform: uppercase; letter-spacing: var(--pm-tracking-wider); }
4037
+
4038
+ /* ---------- Colour, alignment, wrapping ---------- */
4039
+ .pm-text-fg { color: var(--pm-color-fg); }
4040
+ .pm-text-accent { color: var(--pm-color-accent-text); }
4041
+ .pm-text-success { color: var(--pm-color-success-text); }
4042
+ .pm-text-warning { color: var(--pm-color-warning-text); }
4043
+ .pm-text-danger { color: var(--pm-color-danger-text); }
4044
+ .pm-text-start { text-align: start; }
4045
+ .pm-text-center { text-align: center; }
4046
+ .pm-text-end { text-align: end; }
4047
+ .pm-balance { text-wrap: balance; }
4048
+ .pm-pretty { text-wrap: pretty; }
4049
+ .pm-nowrap { white-space: nowrap; }
4050
+ .pm-measure { max-inline-size: var(--pm-measure-normal); }
4051
+ .pm-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-inline-size: 0; }
4052
+ .pm-line-clamp {
4053
+ display: -webkit-box;
4054
+ -webkit-box-orient: vertical;
4055
+ -webkit-line-clamp: var(--pm-lines, 2);
4056
+ line-clamp: var(--pm-lines, 2);
4057
+ overflow: hidden;
4058
+ }
4059
+ .pm-tabular { font-variant-numeric: tabular-nums; }
4060
+ .pm-slashed-zero { font-variant-numeric: slashed-zero; }
4061
+ }
4062
+
4063
+ /* Utilities: layout primitives, a11y helpers, motion presets, scroll-driven reveals. */
4064
+
4065
+ @layer pm.utilities {
4066
+ /* ---------- Layout primitives ---------- */
4067
+ .pm-stack { display: flex; flex-direction: column; gap: var(--pm-gap, var(--pm-space-4)); }
4068
+ .pm-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--pm-gap, var(--pm-space-2)); }
4069
+ .pm-grid {
4070
+ display: grid;
4071
+ gap: var(--pm-gap, var(--pm-space-4));
4072
+ grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--pm-grid-min, 16rem)), 1fr));
4073
+ }
4074
+ .pm-container { inline-size: min(100% - 2 * var(--pm-space-4), var(--pm-container, 72rem)); margin-inline: auto; }
4075
+ .pm-center { display: grid; place-items: center; }
4076
+ .pm-spacer { flex: 1; }
4077
+ .pm-divider { border: 0; border-block-start: 1px solid var(--pm-color-border); margin: 0; }
4078
+ .pm-muted { color: var(--pm-color-fg-muted); }
4079
+ .pm-text-sm { font-size: var(--pm-font-size-sm); }
4080
+ .pm-text-xs { font-size: var(--pm-font-size-xs); }
4081
+ .pm-gradient-text {
4082
+ background: linear-gradient(110deg in oklch, var(--pm-color-accent-text), var(--pm-color-secondary-text));
4083
+ background-clip: text;
4084
+ color: transparent;
4085
+ @media (forced-colors: active) { background: none; color: CanvasText; }
4086
+ }
4087
+
4088
+ /* ---------- Accessibility ---------- */
4089
+ .pm-visually-hidden:not(:focus, :active) {
4090
+ position: absolute;
4091
+ /* Explicit offsets: without them the box keeps its static position, which inside a horizontal scroller can lie
4092
+ outside the viewport and widen the page. */
4093
+ inset-block-start: 0;
4094
+ inset-inline-start: 0;
4095
+ inline-size: 1px;
4096
+ block-size: 1px;
4097
+ margin: -1px;
4098
+ padding: 0;
4099
+ border: 0;
4100
+ overflow: hidden;
4101
+ clip-path: inset(50%);
4102
+ white-space: nowrap;
4103
+ }
4104
+
4105
+ /* ---------- Motion presets: data-animate="fade|scale|slide-up|slide-down|blur|pop" ----------
4106
+ Entry animations play on insertion via @starting-style; spatial movement only without reduced motion. */
4107
+ [data-animate] {
4108
+ transition: opacity var(--pm-duration-slow) var(--pm-ease-standard);
4109
+ @starting-style { opacity: 0; }
4110
+ @media (prefers-reduced-motion: no-preference) {
4111
+ transition:
4112
+ opacity var(--pm-duration-slow) var(--pm-ease-standard),
4113
+ translate var(--pm-duration-slow) var(--pm-ease-spring),
4114
+ scale var(--pm-duration-slow) var(--pm-ease-spring),
4115
+ filter var(--pm-duration-slow) var(--pm-ease-standard);
4116
+ }
4117
+ }
4118
+ @media (prefers-reduced-motion: no-preference) {
4119
+ [data-animate="scale"] { @starting-style { scale: 0.95; } }
4120
+ [data-animate="pop"] { @starting-style { scale: 0.8; } }
4121
+ [data-animate="slide-up"] { @starting-style { translate: 0 1rem; } }
4122
+ [data-animate="slide-down"] { @starting-style { translate: 0 -1rem; } }
4123
+ [data-animate="blur"] { @starting-style { filter: blur(8px); } }
4124
+ /* Stagger children: uses sibling-index() where available, else a fixed nth-child ladder. */
4125
+ [data-stagger] > * { transition-delay: calc(var(--pm-stagger-i, 0) * 45ms); }
4126
+ [data-stagger] > :nth-child(2) { --pm-stagger-i: 1; }
4127
+ [data-stagger] > :nth-child(3) { --pm-stagger-i: 2; }
4128
+ [data-stagger] > :nth-child(4) { --pm-stagger-i: 3; }
4129
+ [data-stagger] > :nth-child(5) { --pm-stagger-i: 4; }
4130
+ [data-stagger] > :nth-child(6) { --pm-stagger-i: 5; }
4131
+ [data-stagger] > :nth-child(n + 7) { --pm-stagger-i: 6; }
4132
+ @supports (order: sibling-index()) {
4133
+ [data-stagger] > * { --pm-stagger-i: calc(sibling-index() - 1); }
4134
+ }
4135
+ }
4136
+
4137
+ /* ---------- Scroll-driven reveal (progressive; content is fully visible without support) ---------- */
4138
+ @supports (animation-timeline: view()) {
4139
+ @media (prefers-reduced-motion: no-preference) {
4140
+ [data-reveal] {
4141
+ animation: pm-reveal linear both;
4142
+ animation-timeline: view();
4143
+ animation-range: entry 0% entry 60%;
4144
+ }
4145
+ [data-parallax] {
4146
+ animation: pm-parallax linear both;
4147
+ animation-timeline: view();
4148
+ }
4149
+ }
4150
+ }
4151
+ @keyframes pm-reveal {
4152
+ from { opacity: 0; translate: 0 2rem; scale: 0.98; }
4153
+ }
4154
+ @keyframes pm-parallax {
4155
+ from { translate: 0 calc(var(--pm-parallax, 40px) * -1); }
4156
+ to { translate: 0 var(--pm-parallax, 40px); }
4157
+ }
4158
+
4159
+ /* View transitions: the theme switcher uses ::view-transition-new(root); keep its blend normal. */
4160
+ ::view-transition-old(root), ::view-transition-new(root) { mix-blend-mode: normal; }
4161
+ }
4162
+
4163
+ /* Page layout: split, switcher, scroll lanes and the app shell. Page-level only (never adopted by component
4164
+ shadow roots), so single-element bundles stay small. */
4165
+ /* Layout variables apply only where they are set: a gap or column size on an outer stack must not leak into the
4166
+ stacks, clusters and grids nested inside it. (Browsers without @property inherit them, as before.) */
4167
+ @property --pm-gap { syntax: "*"; inherits: false; }
4168
+ @property --pm-grid-min { syntax: "*"; inherits: false; }
4169
+ @property --pm-side { syntax: "*"; inherits: false; }
4170
+ @property --pm-split-min { syntax: "*"; inherits: false; }
4171
+ @property --pm-split-align { syntax: "*"; inherits: false; }
4172
+ @property --pm-switch-at { syntax: "*"; inherits: false; }
4173
+ @property --pm-col { syntax: "*"; inherits: false; }
4174
+ @layer pm.utilities {
4175
+ /* Two parts side by side that stack when there is no room (no media query): the first is a sidebar of
4176
+ --pm-side width, the rest takes the remaining space and wraps below once it would be narrower than --pm-split-min.
4177
+ data-side="end" puts the sidebar second (summaries, order totals). */
4178
+ .pm-split { display: flex; flex-wrap: wrap; align-items: var(--pm-split-align, flex-start); gap: var(--pm-gap, var(--pm-space-6)); }
4179
+ .pm-split > * { min-inline-size: 0; }
4180
+ .pm-split > :first-child { flex: 1 1 var(--pm-side, 18rem); }
4181
+ .pm-split > :last-child { flex: 999 1 0; min-inline-size: min(100%, var(--pm-split-min, 55%)); }
4182
+ .pm-split[data-side="end"] > :first-child { flex: 999 1 0; min-inline-size: min(100%, var(--pm-split-min, 55%)); }
4183
+ .pm-split[data-side="end"] > :last-child { flex: 1 1 var(--pm-side, 18rem); min-inline-size: 0; }
4184
+ /* Equal columns that become a single column below --pm-switch-at (container width, not viewport). */
4185
+ .pm-switcher { display: flex; flex-wrap: wrap; gap: var(--pm-gap, var(--pm-space-4)); }
4186
+ .pm-switcher > * { flex-grow: 1; flex-basis: calc((var(--pm-switch-at, 40rem) - 100%) * 999); min-inline-size: 0; }
4187
+ /* Horizontal lane of fixed-width columns or cards (boards, carousels of cards); give it tabindex="0" and a label. */
4188
+ .pm-scroll-x {
4189
+ display: grid;
4190
+ grid-auto-flow: column;
4191
+ grid-auto-columns: var(--pm-col, min(85%, 18rem));
4192
+ gap: var(--pm-gap, var(--pm-space-4));
4193
+ min-inline-size: 0;
4194
+ max-inline-size: 100%;
4195
+ overflow-x: auto;
4196
+ overscroll-behavior-x: contain;
4197
+ scroll-snap-type: x proximity;
4198
+ scroll-padding-inline: var(--pm-space-1);
4199
+ padding-block-end: var(--pm-space-2);
4200
+ & > * { scroll-snap-align: start; }
4201
+ &:focus-visible { outline: 2px solid var(--pm-color-ring); outline-offset: 2px; }
4202
+ }
4203
+
4204
+ /* ---------- App shell: <div class="pm-app" mobile> <aside class="pm-app-side">…<pm-nav></aside>
4205
+ <div class="pm-app-main"><header class="pm-app-bar">…</header><main class="pm-app-content">…</main></div></div>
4206
+ Sidebar on wide screens; on phones only the nav stays and pm-nav (with mobile) becomes the bottom tab bar. ---------- */
4207
+ .pm-app {
4208
+ display: grid;
4209
+ grid-template-columns: auto minmax(0, 1fr);
4210
+ min-block-size: 100dvh;
4211
+ background: var(--pm-color-bg-canvas);
4212
+ color: var(--pm-color-fg);
4213
+ }
4214
+ .pm-app-side {
4215
+ position: sticky;
4216
+ inset-block-start: 0;
4217
+ display: flex;
4218
+ flex-direction: column;
4219
+ gap: var(--pm-space-4);
4220
+ inline-size: var(--pm-app-side, 16rem);
4221
+ block-size: 100dvh;
4222
+ padding: var(--pm-space-4) var(--pm-space-3);
4223
+ overflow-y: auto;
4224
+ border-inline-end: 1px solid var(--pm-color-border);
4225
+ background: var(--pm-color-bg-subtle);
4226
+ }
4227
+ .pm-app-main { display: flex; flex-direction: column; min-inline-size: 0; }
4228
+ .pm-app-bar {
4229
+ position: sticky;
4230
+ inset-block-start: 0;
4231
+ z-index: var(--pm-z-sticky);
4232
+ display: flex;
4233
+ align-items: center;
4234
+ gap: var(--pm-space-2);
4235
+ min-block-size: 3.5rem;
4236
+ padding-inline: var(--pm-space-4);
4237
+ border-block-end: 1px solid var(--pm-color-border);
4238
+ background: color-mix(in oklab, var(--pm-color-bg-canvas) 88%, transparent);
4239
+ backdrop-filter: blur(12px);
4240
+ @supports not (backdrop-filter: blur(1px)) { background: var(--pm-color-bg-canvas); }
4241
+ }
4242
+ .pm-app-content { flex: 1; display: flex; flex-direction: column; gap: var(--pm-gap, var(--pm-space-6)); padding: var(--pm-space-6) var(--pm-space-4); inline-size: min(100%, var(--pm-container, 72rem)); margin-inline: auto; }
4243
+ .pm-app-content > * { min-inline-size: 0; }
4244
+ /* The sidebar may carry `popover` (so phones can open it as a drawer): on wide screens it stays in the page. */
4245
+ .pm-app-side:where([popover]) { inset: auto; inset-block-start: 0; margin: 0; border-width: 0; border-inline-end-width: 1px; color: inherit; }
4246
+ /* Menu button for the drawer: <pm-button class="pm-app-menu" popovertarget="app-side">; phones without a tab bar only. */
4247
+ .pm-app-menu { display: none; }
4248
+ @media (width < 40rem) {
4249
+ .pm-app { grid-template-columns: minmax(0, 1fr); }
4250
+ .pm-app-content { padding-block: var(--pm-space-4); }
4251
+ /* Native mobile (pm-nav became the bottom tab bar): only the nav stays. */
4252
+ .pm-app:has(pm-nav[data-bar]) .pm-app-side { display: contents; }
4253
+ .pm-app:has(pm-nav[data-bar]) .pm-app-side > :not(pm-nav) { display: none; }
4254
+ .pm-app:has(pm-nav[data-bar]) .pm-app-main { padding-block-end: calc(4.5rem + env(safe-area-inset-bottom)); }
4255
+ /* Responsive web: the sidebar is an off-canvas drawer, opened by .pm-app-menu. */
4256
+ .pm-app:not(:has(pm-nav[data-bar])) {
4257
+ & .pm-app-menu { display: inline-flex; }
4258
+ & .pm-app-side:not(:popover-open) { display: none; }
4259
+ & .pm-app-side:popover-open {
4260
+ position: fixed;
4261
+ inset-inline: 0 auto;
4262
+ inline-size: min(100% - 3rem, 20rem);
4263
+ max-block-size: none;
4264
+ background: var(--pm-color-bg-surface);
4265
+ box-shadow: var(--pm-elevation-4);
4266
+ &::backdrop { background: var(--pm-color-overlay); }
4267
+ @media (prefers-reduced-motion: no-preference) {
4268
+ transition: translate var(--pm-duration-moderate) var(--pm-ease-emphasized), display var(--pm-duration-moderate) allow-discrete, overlay var(--pm-duration-moderate) allow-discrete;
4269
+ @starting-style { translate: -100% 0; }
4270
+ &:dir(rtl) { @starting-style { translate: 100% 0; } }
4271
+ }
4272
+ }
4273
+ }
4274
+ }
4275
+ }