trebol 0.1.0 → 0.1.2

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 (160) hide show
  1. package/README.md +18 -3
  2. package/dist/cli.js +13790 -11417
  3. package/dist/fonts/OFL.txt +93 -0
  4. package/dist/fonts/inter-cyrillic-ext.woff2 +0 -0
  5. package/dist/fonts/inter-cyrillic.woff2 +0 -0
  6. package/dist/fonts/inter-greek-ext.woff2 +0 -0
  7. package/dist/fonts/inter-greek.woff2 +0 -0
  8. package/dist/fonts/inter-latin-ext.woff2 +0 -0
  9. package/dist/fonts/inter-latin.woff2 +0 -0
  10. package/dist/fonts/inter-vietnamese.woff2 +0 -0
  11. package/dist/lib/core/access.d.ts +10 -0
  12. package/dist/lib/core/access.js +210 -0
  13. package/dist/lib/core/base.d.ts +4 -0
  14. package/dist/lib/core/base.js +50 -0
  15. package/dist/lib/core/bitset.d.ts +9 -0
  16. package/dist/lib/core/bitset.js +75 -0
  17. package/dist/lib/core/boot.d.ts +18 -0
  18. package/dist/lib/core/boot.js +73 -0
  19. package/dist/lib/core/compare.d.ts +9 -0
  20. package/dist/lib/core/compare.js +156 -0
  21. package/dist/lib/core/ctx.d.ts +36 -0
  22. package/dist/lib/core/ctx.js +251 -0
  23. package/dist/lib/core/dec.d.ts +28 -0
  24. package/dist/lib/core/dec.js +158 -0
  25. package/dist/lib/core/errors.d.ts +15 -0
  26. package/dist/lib/core/errors.js +44 -0
  27. package/dist/lib/core/escapes.d.ts +14 -0
  28. package/dist/lib/core/escapes.js +80 -0
  29. package/dist/lib/core/eval.d.ts +220 -0
  30. package/dist/lib/core/eval.js +666 -0
  31. package/dist/lib/core/func.d.ts +68 -0
  32. package/dist/lib/core/func.js +129 -0
  33. package/dist/lib/core/hash.d.ts +5 -0
  34. package/dist/lib/core/hash.js +155 -0
  35. package/dist/lib/core/index.d.ts +18 -0
  36. package/dist/lib/core/index.js +20 -0
  37. package/dist/lib/core/int64.d.ts +22 -0
  38. package/dist/lib/core/int64.js +113 -0
  39. package/dist/lib/core/kinds.d.ts +67 -0
  40. package/dist/lib/core/kinds.js +134 -0
  41. package/dist/lib/core/lexer.d.ts +13 -0
  42. package/dist/lib/core/lexer.js +702 -0
  43. package/dist/lib/core/mezz.d.ts +1 -0
  44. package/dist/lib/core/mezz.js +360 -0
  45. package/dist/lib/core/mold.d.ts +20 -0
  46. package/dist/lib/core/mold.js +434 -0
  47. package/dist/lib/core/natives/control.d.ts +1 -0
  48. package/dist/lib/core/natives/control.js +374 -0
  49. package/dist/lib/core/natives/csv.d.ts +15 -0
  50. package/dist/lib/core/natives/csv.js +315 -0
  51. package/dist/lib/core/natives/data.d.ts +11 -0
  52. package/dist/lib/core/natives/data.js +367 -0
  53. package/dist/lib/core/natives/define.d.ts +17 -0
  54. package/dist/lib/core/natives/define.js +47 -0
  55. package/dist/lib/core/natives/encode.d.ts +3 -0
  56. package/dist/lib/core/natives/encode.js +187 -0
  57. package/dist/lib/core/natives/json.d.ts +5 -0
  58. package/dist/lib/core/natives/json.js +273 -0
  59. package/dist/lib/core/natives/math.d.ts +3 -0
  60. package/dist/lib/core/natives/math.js +500 -0
  61. package/dist/lib/core/natives/parse.d.ts +1 -0
  62. package/dist/lib/core/natives/parse.js +600 -0
  63. package/dist/lib/core/natives/series.d.ts +4 -0
  64. package/dist/lib/core/natives/series.js +519 -0
  65. package/dist/lib/core/natives/text.d.ts +1 -0
  66. package/dist/lib/core/natives/text.js +487 -0
  67. package/dist/lib/core/natives/xml.d.ts +9 -0
  68. package/dist/lib/core/natives/xml.js +242 -0
  69. package/dist/lib/core/series.d.ts +26 -0
  70. package/dist/lib/core/series.js +73 -0
  71. package/dist/lib/core/symbols.d.ts +9 -0
  72. package/dist/lib/core/symbols.js +44 -0
  73. package/dist/lib/core/values.d.ts +206 -0
  74. package/dist/lib/core/values.js +223 -0
  75. package/dist/lib/host/browser.d.ts +4 -0
  76. package/dist/lib/host/browser.js +4974 -0
  77. package/dist/lib/host/chart.d.ts +26 -0
  78. package/dist/lib/host/chart.js +158 -0
  79. package/dist/lib/host/compress.d.ts +1 -0
  80. package/dist/lib/host/compress.js +37 -0
  81. package/dist/lib/host/devlog.d.ts +11 -0
  82. package/dist/lib/host/devlog.js +13 -0
  83. package/dist/lib/host/devtools.d.ts +23 -0
  84. package/dist/lib/host/devtools.js +626 -0
  85. package/dist/lib/host/draw.d.ts +31 -0
  86. package/dist/lib/host/draw.js +348 -0
  87. package/dist/lib/host/fonts/OFL.txt +93 -0
  88. package/dist/lib/host/fonts/inter-cyrillic-ext.woff2 +0 -0
  89. package/dist/lib/host/fonts/inter-cyrillic.woff2 +0 -0
  90. package/dist/lib/host/fonts/inter-greek-ext.woff2 +0 -0
  91. package/dist/lib/host/fonts/inter-greek.woff2 +0 -0
  92. package/dist/lib/host/fonts/inter-latin-ext.woff2 +0 -0
  93. package/dist/lib/host/fonts/inter-latin.woff2 +0 -0
  94. package/dist/lib/host/fonts/inter-vietnamese.woff2 +0 -0
  95. package/dist/lib/host/fonts.d.ts +11 -0
  96. package/dist/lib/host/fonts.js +29 -0
  97. package/dist/lib/host/icons.d.ts +3 -0
  98. package/dist/lib/host/icons.js +97 -0
  99. package/dist/lib/host/index.d.ts +40 -0
  100. package/dist/lib/host/index.js +192 -0
  101. package/dist/lib/host/js.d.ts +5 -0
  102. package/dist/lib/host/js.js +130 -0
  103. package/dist/lib/host/locale.d.ts +40 -0
  104. package/dist/lib/host/locale.js +241 -0
  105. package/dist/lib/host/markdown.d.ts +30 -0
  106. package/dist/lib/host/markdown.js +161 -0
  107. package/dist/lib/host/modules.d.ts +14 -0
  108. package/dist/lib/host/modules.js +300 -0
  109. package/dist/lib/host/natives.d.ts +6 -0
  110. package/dist/lib/host/natives.js +98 -0
  111. package/dist/lib/host/net.d.ts +12 -0
  112. package/dist/lib/host/net.js +549 -0
  113. package/dist/lib/host/orbit.d.ts +121 -0
  114. package/dist/lib/host/orbit.js +374 -0
  115. package/dist/lib/host/page.d.ts +9 -0
  116. package/dist/lib/host/page.js +55 -0
  117. package/dist/lib/host/rows.d.ts +29 -0
  118. package/dist/lib/host/rows.js +109 -0
  119. package/dist/lib/host/scheduler.d.ts +51 -0
  120. package/dist/lib/host/scheduler.js +197 -0
  121. package/dist/lib/host/theme.d.ts +58 -0
  122. package/dist/lib/host/theme.js +1667 -0
  123. package/dist/lib/ui/i18n.trb +117 -0
  124. package/dist/lib/ui/test.trb +565 -0
  125. package/dist/lib/ui/ui.trb +1678 -0
  126. package/dist/trebol.js +1427 -138
  127. package/editors/vscode/README.md +15 -0
  128. package/editors/vscode/language-configuration.json +28 -0
  129. package/editors/vscode/package.json +42 -0
  130. package/editors/vscode/syntaxes/trebol.tmLanguage.json +237 -0
  131. package/package.json +23 -7
  132. package/src/core/boot.ts +1 -1
  133. package/src/core/func.ts +4 -0
  134. package/src/core/natives/control.ts +1 -1
  135. package/src/core/natives/series.ts +9 -1
  136. package/src/core/natives/text.ts +2 -0
  137. package/src/host/browser.ts +1235 -83
  138. package/src/host/devlog.ts +16 -0
  139. package/src/host/devtools.ts +641 -0
  140. package/src/host/fonts/OFL.txt +93 -0
  141. package/src/host/fonts/inter-cyrillic-ext.woff2 +0 -0
  142. package/src/host/fonts/inter-cyrillic.woff2 +0 -0
  143. package/src/host/fonts/inter-greek-ext.woff2 +0 -0
  144. package/src/host/fonts/inter-greek.woff2 +0 -0
  145. package/src/host/fonts/inter-latin-ext.woff2 +0 -0
  146. package/src/host/fonts/inter-latin.woff2 +0 -0
  147. package/src/host/fonts/inter-vietnamese.woff2 +0 -0
  148. package/src/host/fonts.ts +39 -0
  149. package/src/host/index.ts +5 -3
  150. package/src/host/js.ts +127 -0
  151. package/src/host/markdown.ts +9 -0
  152. package/src/host/modules.ts +41 -2
  153. package/src/host/net.ts +9 -1
  154. package/src/host/orbit.ts +432 -0
  155. package/src/host/rows.ts +30 -0
  156. package/src/host/scheduler.ts +62 -36
  157. package/src/host/theme.ts +270 -6
  158. package/src/ui/i18n.trb +10 -0
  159. package/src/ui/test.trb +565 -0
  160. package/src/ui/ui.trb +564 -90
@@ -0,0 +1,1667 @@
1
+ // The theme: a handful of parameters from which every visual value is
2
+ // derived, compiled once into CSS custom properties plus a fixed stylesheet.
3
+ //
4
+ // Colors are computed in OKLCH. Each role has a fixed lightness per mode,
5
+ // chosen so text meets WCAG AA on the backgrounds it is used on; the hue
6
+ // comes from the theme (`base`, `accent`, `neutral`). `contrast()` checks it
7
+ // and the tests run it over every hue.
8
+ import { DRAW_COLORS } from "./draw.js";
9
+ export const DEFAULT_THEME = {
10
+ base: 250, accent: 30, neutral: 'neutral', density: 'normal', radius: 'soft', font: 'inter', headings: null, mode: 'auto',
11
+ color: 1, line: 1, depth: 'soft', icons: 'round', skin: 'modern',
12
+ };
13
+ /** The theme parameters that take a word, and the words each takes. */
14
+ export const THEME_WORDS = {
15
+ neutral: ['cool', 'neutral', 'warm'],
16
+ density: ['compact', 'normal', 'comfortable'],
17
+ radius: ['sharp', 'soft', 'round'],
18
+ mode: ['light', 'dark', 'auto'],
19
+ depth: ['flat', 'soft', 'lifted'],
20
+ icons: ['fine', 'round', 'sharp', 'bold'],
21
+ skin: ['modern', 'classic', 'cupertino', 'fusion', 'fluent'],
22
+ };
23
+ /** The looks: complete sets of parameters with a name. `theme [look: civic base: 200]` starts from one. */
24
+ export const LOOKS = {
25
+ minimal: {},
26
+ paper: { base: 40, accent: 150, neutral: 'warm', headings: 'serif', radius: 'sharp', depth: 'flat', icons: 'fine' },
27
+ civic: { base: 255, accent: 75, neutral: 'cool', font: 'system', radius: 'sharp', line: 2, depth: 'flat', icons: 'sharp' },
28
+ soft: { base: 175, accent: 30, density: 'comfortable', radius: 'round', depth: 'lifted', icons: 'round' },
29
+ ink: { color: 0, font: 'system', headings: 'mono', radius: 'sharp', line: 2, depth: 'flat', icons: 'bold' },
30
+ classic: { base: 240, accent: 45, color: 0.7, font: 'sans', density: 'compact', radius: 'sharp', depth: 'flat', icons: 'sharp', skin: 'classic' },
31
+ cupertino: { base: 255, accent: 330, font: 'system', radius: 'soft', depth: 'soft', icons: 'round', skin: 'cupertino' },
32
+ fusion: { base: 240, accent: 30, color: 0.8, font: 'noto', radius: 'sharp', depth: 'flat', icons: 'sharp', skin: 'fusion' },
33
+ fluent: { base: 250, accent: 25, font: 'segoe', radius: 'soft', depth: 'soft', icons: 'fine', skin: 'fluent' },
34
+ };
35
+ /** Skins whose greys take a hint of the base hue; the others are plain grey. */
36
+ const TINTED = new Set(['fluent']);
37
+ /** Lightness of the neutral roles, and of the primary, for the skins that change them: [light, dark]. */
38
+ const TONES = {
39
+ // a light window, group boxes a shade darker, controls lighter than the window in the dark
40
+ cupertino: { bg: [0.945, 0.23], surface: [1, 0.29], raised: [0.925, 0.26], border: [0.86, 0.37], 'border-strong': [0.76, 0.45], muted: [0.48, 0.74], primary: [0.52, 0.7] },
41
+ // group boxes are the window itself; in the dark, wells are darker and frames darker still
42
+ fusion: { bg: [0.95, 0.31], surface: [1, 0.25], raised: [0.95, 0.31], border: [0.84, 0.24], 'border-strong': [0.7, 0.2], muted: [0.46, 0.76], primary: [0.5, 0.72] },
43
+ // a calm window under white layers
44
+ fluent: { bg: [0.955, 0.2], surface: [0.995, 0.27], raised: [0.985, 0.24], border: [0.9, 0.33], 'border-strong': [0.78, 0.42], muted: [0.47, 0.74], primary: [0.48, 0.78] },
45
+ };
46
+ /** Roles every theme defines, for both modes. */
47
+ export const ROLES = [
48
+ 'bg', 'surface', 'raised', 'border', 'border-strong', 'text', 'muted',
49
+ 'primary', 'primary-hover', 'on-primary', 'accent', 'on-accent',
50
+ 'danger', 'on-danger', 'success', 'warning', 'focus',
51
+ ];
52
+ /** Text/background pairs that must reach WCAG AA (4.5:1). */
53
+ export const CONTRAST_PAIRS = [
54
+ ['text', 'bg'], ['text', 'surface'], ['text', 'raised'],
55
+ ['muted', 'bg'], ['muted', 'surface'],
56
+ ['on-primary', 'primary'], ['on-primary', 'primary-hover'], ['on-accent', 'accent'], ['on-danger', 'danger'],
57
+ ['danger', 'surface'], ['primary', 'surface'], ['success', 'surface'],
58
+ ];
59
+ const NEUTRAL_HUE = { cool: 255, neutral: 0, warm: 70 };
60
+ const NEUTRAL_CHROMA = { cool: 0.012, neutral: 0, warm: 0.01 };
61
+ /** The palette for one mode. Lightness values are fixed; hues come from the theme. */
62
+ export function palette(t, dark) {
63
+ const p = basePalette(t, dark);
64
+ const tones = TONES[t.skin];
65
+ if (tones === undefined)
66
+ return p;
67
+ const i = dark ? 1 : 0;
68
+ for (const role of ['bg', 'surface', 'raised', 'border', 'border-strong', 'muted']) {
69
+ const l = tones[role][i];
70
+ p[role] = { l, c: l >= 0.99 || !TINTED.has(t.skin) ? 0 : p.bg.c, h: p.bg.h };
71
+ }
72
+ p.primary = { ...p.primary, l: tones.primary[i] };
73
+ p['primary-hover'] = { ...p['primary-hover'], l: tones.primary[i] + (dark ? 0.05 : -0.05) };
74
+ return p;
75
+ }
76
+ function basePalette(t, dark) {
77
+ const nh = t.neutral === 'neutral' ? t.base : NEUTRAL_HUE[t.neutral];
78
+ const nc = (t.neutral === 'neutral' ? 0.006 : NEUTRAL_CHROMA[t.neutral]) * t.color;
79
+ // with no color, what stands out does so by being as dark or as light as the text
80
+ const ink = t.color === 0;
81
+ const n = (l, scale = 1) => ({ l, c: nc * scale, h: nh });
82
+ // what warns or confirms keeps its color in every look
83
+ const signal = (l, c, h) => ({ l, c, h });
84
+ const hue = (l, c, h) => ({ l, c: c * t.color, h });
85
+ // classic: a grey window (panels too: their edges set them apart), white wells for what is typed
86
+ if (t.skin === 'classic')
87
+ return {
88
+ bg: n(dark ? 0.33 : 0.85, 2),
89
+ surface: n(dark ? 0.25 : 1, dark ? 2 : 0),
90
+ raised: n(dark ? 0.33 : 0.85, 2),
91
+ border: n(dark ? 0.22 : 0.7, 2),
92
+ 'border-strong': n(dark ? 0.18 : 0.52, 2),
93
+ text: n(dark ? 0.95 : 0.18, dark ? 1 : 3),
94
+ muted: n(dark ? 0.8 : 0.38, 3),
95
+ primary: hue(dark ? 0.8 : 0.45, 0.12, t.base),
96
+ 'primary-hover': hue(dark ? 0.85 : 0.4, 0.12, t.base),
97
+ 'on-primary': n(dark ? 0.18 : 1, dark ? 2 : 0),
98
+ accent: hue(dark ? 0.8 : 0.48, 0.13, t.accent),
99
+ 'on-accent': n(dark ? 0.18 : 1, dark ? 2 : 0),
100
+ danger: signal(dark ? 0.75 : 0.5, dark ? 0.15 : 0.18, 25),
101
+ 'on-danger': n(dark ? 0.18 : 1, dark ? 2 : 0),
102
+ success: signal(dark ? 0.76 : 0.48, 0.13, 150),
103
+ warning: signal(dark ? 0.8 : 0.78, 0.14, 75),
104
+ focus: hue(dark ? 0.75 : 0.5, 0.15, t.base),
105
+ };
106
+ if (!dark) {
107
+ return {
108
+ bg: n(0.975, 1.2),
109
+ surface: n(1, 0),
110
+ raised: n(1, 0),
111
+ border: n(0.9, 1.5),
112
+ 'border-strong': n(0.8, 2),
113
+ text: n(0.24, 3),
114
+ muted: n(0.5, 3),
115
+ primary: hue(ink ? 0.24 : 0.5, 0.16, t.base),
116
+ 'primary-hover': hue(ink ? 0.36 : 0.45, 0.15, t.base),
117
+ 'on-primary': n(1, 0),
118
+ accent: hue(0.5, 0.15, t.accent),
119
+ 'on-accent': n(1, 0),
120
+ danger: signal(0.52, 0.18, 25),
121
+ 'on-danger': n(1, 0),
122
+ success: signal(0.52, 0.13, 150),
123
+ warning: signal(0.78, 0.14, 75),
124
+ focus: hue(0.62, 0.17, t.base),
125
+ };
126
+ }
127
+ return {
128
+ bg: n(0.16, 2),
129
+ surface: n(0.2, 2),
130
+ raised: n(0.23, 2),
131
+ border: n(0.32, 2),
132
+ 'border-strong': n(0.42, 2),
133
+ text: n(0.94, 1),
134
+ muted: n(0.72, 2),
135
+ primary: hue(ink ? 0.94 : 0.74, 0.13, t.base),
136
+ 'primary-hover': hue(ink ? 0.84 : 0.8, 0.11, t.base),
137
+ 'on-primary': n(0.18, 2),
138
+ accent: hue(0.74, 0.13, t.accent),
139
+ 'on-accent': n(0.18, 2),
140
+ danger: signal(0.72, 0.15, 25),
141
+ 'on-danger': n(0.18, 2),
142
+ success: signal(0.74, 0.13, 150),
143
+ warning: signal(0.8, 0.13, 75),
144
+ focus: hue(0.72, 0.15, t.base),
145
+ };
146
+ }
147
+ // --- color math --------------------------------------------------------------------
148
+ /** Linear sRGB of an OKLCH color, clamped to the gamut. */
149
+ export function toLinearRgb({ l, c, h }) {
150
+ const a = c * Math.cos((h * Math.PI) / 180);
151
+ const b = c * Math.sin((h * Math.PI) / 180);
152
+ const l_ = (l + 0.3963377774 * a + 0.2158037573 * b) ** 3;
153
+ const m_ = (l - 0.1055613458 * a - 0.0638541728 * b) ** 3;
154
+ const s_ = (l - 0.0894841775 * a - 1.291485548 * b) ** 3;
155
+ const clamp = (x) => Math.min(1, Math.max(0, x));
156
+ return [
157
+ clamp(4.0767416621 * l_ - 3.3077115913 * m_ + 0.2309699292 * s_),
158
+ clamp(-1.2684380046 * l_ + 2.6097574011 * m_ - 0.3413193965 * s_),
159
+ clamp(-0.0041960863 * l_ - 0.7034186147 * m_ + 1.707614701 * s_),
160
+ ];
161
+ }
162
+ export function luminance(c) {
163
+ const [r, g, b] = toLinearRgb(c);
164
+ return 0.2126 * r + 0.7152 * g + 0.0722 * b;
165
+ }
166
+ /** WCAG contrast ratio between two colors. */
167
+ export function contrast(x, y) {
168
+ const a = luminance(x);
169
+ const b = luminance(y);
170
+ return (Math.max(a, b) + 0.05) / (Math.min(a, b) + 0.05);
171
+ }
172
+ const encode = (x) => (x <= 0.0031308 ? 12.92 * x : 1.055 * x ** (1 / 2.4) - 0.055);
173
+ const decode = (x) => (x <= 0.04045 ? x / 12.92 : ((x + 0.055) / 1.055) ** 2.4);
174
+ /** Luminance of `c` at `alpha` over a pixel of gray `px` (0 black, 1 white), blended as browsers do. */
175
+ export function luminanceOver(c, alpha, px) {
176
+ const [r, g, b] = toLinearRgb(c).map(x => decode(alpha * encode(x) + (1 - alpha) * px));
177
+ return 0.2126 * r + 0.7152 * g + 0.0722 * b;
178
+ }
179
+ /** The worst contrast of `fg` on the background at `alpha` over any image: a black or a white one. */
180
+ export function contrastOverImage(fg, bg, alpha) {
181
+ const t = luminance(fg);
182
+ return Math.min(...[0, 1].map(px => {
183
+ const b = luminanceOver(bg, alpha, px);
184
+ return (Math.max(t, b) + 0.05) / (Math.min(t, b) + 0.05);
185
+ }));
186
+ }
187
+ /**
188
+ * The alpha of the veil over a backdrop: the least that keeps text AA on any image. Muted text would
189
+ * need a veil almost opaque, so on a backdrop it takes the color of the text.
190
+ */
191
+ export function scrimAlpha(p) {
192
+ let alpha = 0.5;
193
+ while (alpha < 1 && contrastOverImage(p.text, p.bg, alpha) < 4.6)
194
+ alpha = Math.round((alpha + 0.01) * 100) / 100;
195
+ return alpha;
196
+ }
197
+ const css = (c, alpha) => `oklch(${(c.l * 100).toFixed(1)}% ${c.c.toFixed(3)} ${c.h.toFixed(1)}${alpha === undefined ? '' : ` / ${alpha}`})`;
198
+ // --- tokens ------------------------------------------------------------------------
199
+ const SPACE = [0, 4, 8, 12, 16, 24, 32, 48];
200
+ const CONTROL = { classic: 34, cupertino: 30, fusion: 30, fluent: 32 };
201
+ const DENSITY = { compact: 0.85, normal: 1, comfortable: 1.2 };
202
+ const RADIUS = { sharp: 2, soft: 8, round: 16 };
203
+ const ICONS = {
204
+ fine: { stroke: 1.5, cap: 'round', join: 'round' },
205
+ round: { stroke: 2, cap: 'round', join: 'round' },
206
+ sharp: { stroke: 2, cap: 'square', join: 'miter' },
207
+ bold: { stroke: 2.75, cap: 'butt', join: 'miter' },
208
+ };
209
+ const FONTS = {
210
+ inter: 'Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
211
+ sans: '"Helvetica Neue", Helvetica, Arial, sans-serif',
212
+ noto: '"Noto Sans", "DejaVu Sans", Ubuntu, Cantarell, "Segoe UI", Roboto, sans-serif',
213
+ segoe: '"Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", ui-sans-serif, system-ui, sans-serif',
214
+ system: 'ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
215
+ serif: 'ui-serif, Georgia, Cambria, "Times New Roman", serif',
216
+ mono: 'ui-monospace, SFMono-Regular, Menlo, Consolas, monospace',
217
+ };
218
+ function colorVars(t, dark) {
219
+ const p = palette(t, dark);
220
+ const lines = ROLES.map(r => ` --tb-${r}: ${css(p[r])};`);
221
+ lines.push(` --tb-focus-ring: ${css(p.focus, dark ? 0.5 : 0.35)};`);
222
+ lines.push(` --tb-danger-soft: ${css(p.danger, dark ? 0.16 : 0.08)};`);
223
+ lines.push(` --tb-primary-soft: ${css(p.primary, dark ? 0.16 : 0.08)};`);
224
+ lines.push(` --tb-overlay: ${css(n0(p), dark ? 0.6 : 0.4)};`);
225
+ lines.push(` --tb-scrim: ${css(p.bg, scrimAlpha(p))};`);
226
+ const shadow = dark ? '0 0 0 1px oklch(100% 0 0 / 0.06)' : `0 1px 2px ${css(n0(p), 0.06)}`;
227
+ const k = t.depth === 'lifted' ? 2 : 1;
228
+ // a flat look has no shadows, but what floats over the page still needs one
229
+ lines.push(` --tb-shadow-1: ${t.depth === 'flat' ? 'none' : `${shadow}, 0 ${k}px ${3 * k}px ${css(n0(p), dark ? 0.4 : 0.08)}`};`);
230
+ lines.push(` --tb-shadow-2: ${t.depth === 'flat' ? 'none' : `${shadow}, 0 ${4 * k}px ${12 * k}px ${css(n0(p), dark ? 0.5 : 0.08)}`};`);
231
+ lines.push(` --tb-shadow-3: ${shadow}, 0 ${12 * k}px ${32 * k}px ${css(n0(p), dark ? 0.6 : 0.12)};`);
232
+ const g = (l) => css({ l, c: p.bg.c, h: p.bg.h });
233
+ if (t.skin === 'classic') {
234
+ // the two edges of what stands out or sinks in, and the faces of buttons and bars
235
+ lines.push(` --tb-bevel-hi: ${g(dark ? 0.5 : 1)};`, ` --tb-bevel-lo: ${g(dark ? 0.15 : 0.55)};`);
236
+ lines.push(` --tb-face-hi: ${g(dark ? 0.47 : 0.97)};`, ` --tb-face-lo: ${g(dark ? 0.36 : 0.8)};`);
237
+ }
238
+ // the chosen segment of a segmented control
239
+ if (t.skin === 'cupertino')
240
+ lines.push(` --tb-segment: ${g(dark ? 0.47 : 1)};`);
241
+ if (t.skin === 'fusion')
242
+ lines.push(` --tb-face-hi: ${g(dark ? 0.37 : 0.99)};`, ` --tb-face-lo: ${g(dark ? 0.32 : 0.91)};`);
243
+ // focus is drawn in the color of the text, and what is hovered or chosen is a shade of it
244
+ if (t.skin === 'fluent')
245
+ lines.push(` --tb-focus-ring: ${css(p.text)};`, ` --tb-subtle: ${css(p.text, dark ? 0.08 : 0.06)};`);
246
+ // Red's color words, for drawings and charts: each one light enough, or dark enough, for this mode
247
+ for (const [name, c] of Object.entries(DRAW_COLORS))
248
+ lines.push(` --tb-c-${name}: ${css({ l: dark ? c.dark : c.light, c: c.c, h: c.h })};`);
249
+ lines.push(` color-scheme: ${dark ? 'dark' : 'light'};`);
250
+ return lines.join('\n');
251
+ }
252
+ const n0 = (p) => ({ l: 0.2, c: p.text.c, h: p.text.h });
253
+ function sizeVars(t) {
254
+ const k = DENSITY[t.density];
255
+ const lines = SPACE.map((px, i) => ` --tb-space-${i}: ${Math.round(px * k)}px;`);
256
+ const r = RADIUS[t.radius];
257
+ lines.push(` --tb-radius: ${r}px;`, ` --tb-radius-lg: ${Math.round(r * 1.5)}px;`);
258
+ // a skin's controls are small, as on a desktop; a touch screen still gets 44px (below)
259
+ const control = CONTROL[t.skin];
260
+ lines.push(` --tb-control: ${control !== undefined ? Math.round(control * k) : Math.max(40, Math.round(44 * k))}px;`);
261
+ lines.push(` --tb-font: ${FONTS[t.font] ?? `"${t.font}", ${FONTS['system']}`};`);
262
+ lines.push(` --tb-headings: ${t.headings === null ? 'var(--tb-font)' : FONTS[t.headings] ?? `"${t.headings}", ${FONTS['system']}`};`);
263
+ lines.push(` --tb-mono: ${FONTS['mono']};`);
264
+ lines.push(` --tb-line: ${t.line}px;`);
265
+ const icon = ICONS[t.icons];
266
+ lines.push(` --tb-icon-stroke: ${icon.stroke};`, ` --tb-icon-cap: ${icon.cap};`, ` --tb-icon-join: ${icon.join};`);
267
+ lines.push(' --tb-ease: cubic-bezier(0.2, 0, 0, 1);', ' --tb-fast: 150ms;');
268
+ return lines.join('\n');
269
+ }
270
+ /** The full stylesheet for a theme: tokens, then the fixed component rules. */
271
+ export function themeCss(t) {
272
+ const light = colorVars(t, false);
273
+ const dark = colorVars(t, true);
274
+ let colors;
275
+ if (t.mode === 'light')
276
+ colors = `:root {\n${light}\n}`;
277
+ else if (t.mode === 'dark')
278
+ colors = `:root {\n${dark}\n}`;
279
+ // an embedding page (the documentation's live examples) may force one: <html data-tb-scheme="dark">
280
+ else
281
+ colors = `:root {\n${light}\n}\n@media (prefers-color-scheme: dark) {\n:root:not([data-tb-scheme="light"]) {\n${dark}\n}\n}\n:root[data-tb-scheme="dark"] {\n${dark}\n}`;
282
+ return `:root {\n${sizeVars(t)}\n}\n${colors}\n${COMPONENTS}${SKINS[t.skin]}`;
283
+ }
284
+ /** Component rules. Only token variables appear here, never raw values of color. */
285
+ const COMPONENTS = String.raw `
286
+ *, *::before, *::after { box-sizing: border-box; }
287
+ html, body { margin: 0; }
288
+ body {
289
+ background: var(--tb-bg);
290
+ color: var(--tb-text);
291
+ font-family: var(--tb-font);
292
+ font-size: 15px;
293
+ line-height: 1.5;
294
+ font-variant-numeric: tabular-nums;
295
+ -webkit-font-smoothing: antialiased;
296
+ text-rendering: optimizeLegibility;
297
+ }
298
+ .tb-view {
299
+ max-width: 720px;
300
+ margin: 0 auto;
301
+ padding: var(--tb-space-7) var(--tb-space-5);
302
+ display: flex;
303
+ flex-direction: column;
304
+ gap: var(--tb-space-5);
305
+ }
306
+ .tb-view:has(> .tb-split) { max-width: 1120px; }
307
+ .tb-view.tb-small { max-width: 480px; font-size: inherit; }
308
+ .tb-view.tb-large { max-width: 1120px; }
309
+ .tb-view.tb-fill { max-width: none; }
310
+ .tb-column { display: flex; flex-direction: column; gap: var(--tb-space-4); min-width: 0; }
311
+ .tb-screens, .tb-screen { display: flex; flex-direction: column; gap: var(--tb-space-4); min-width: 0; }
312
+ .tb-screen:focus { outline: none; }
313
+ /* entering a screen focuses its title for screen readers; it is not a control, so no ring */
314
+ .tb-screen :is(h1, h2)[tabindex="-1"]:focus { outline: none; }
315
+ .tb-screens[aria-busy] { cursor: progress; }
316
+ .tb-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--tb-space-3); }
317
+ .tb-row:where(:not(.tb-top, .tb-middle, .tb-bottom)):has(> .tb-field) { align-items: flex-end; }
318
+ /* with fields, a text beside them sits on the line of the controls, not on their labels */
319
+ .tb-row:where(:not(.tb-top, .tb-middle, .tb-bottom)):has(> .tb-field) > :is(.tb-text, .tb-heading) { margin-bottom: max(0px, calc((var(--tb-control) - 1lh) / 2)); }
320
+ .tb-row.tb-top { align-items: flex-start; }
321
+ .tb-row.tb-middle { align-items: center; }
322
+ .tb-row.tb-bottom { align-items: flex-end; }
323
+ .tb-row.tb-center { justify-content: center; }
324
+ .tb-row.tb-right { justify-content: flex-end; }
325
+ .tb-row.tb-spread { justify-content: space-between; }
326
+ .tb-fill { flex: 1 1 0; min-width: 0; }
327
+ .tb-view:has(.tb-desktop) { min-height: 100dvh; box-sizing: border-box; }
328
+ .tb-view:has(.tb-desktop) .tb-screens, .tb-screen:has(> .tb-desktop) { flex: 1 1 auto; }
329
+ .tb-view:has(.tb-fit) .tb-screens, .tb-screen:has(> .tb-fit) { flex: 1 1 auto; min-height: 0; }
330
+ .tb-view:has(.tb-fit) { height: 100dvh; box-sizing: border-box; }
331
+ .tb-fit { flex: 1 1 auto; min-height: 0; }
332
+ .tb-fit > * { min-height: 0; overflow: auto; }
333
+ .tb-fit > * > * { flex-shrink: 0; }
334
+ .tb-desktop {
335
+ flex: 1 1 auto;
336
+ min-height: 240px;
337
+ display: flex;
338
+ flex-wrap: wrap;
339
+ align-content: flex-start;
340
+ gap: var(--tb-space-3);
341
+ padding: var(--tb-space-5);
342
+ border-radius: var(--tb-radius);
343
+ background-color: color-mix(in oklch, var(--tb-primary) 9%, var(--tb-bg));
344
+ background-size: cover;
345
+ background-position: center;
346
+ }
347
+ /* an image behind what holds it, under a veil that keeps text on it AA; muted text needs the text's color there */
348
+ :has(> .tb-backdrop) { position: relative; isolation: isolate; --tb-muted: var(--tb-text); }
349
+ .tb-backdrop { position: absolute; inset: 0; z-index: -1; border-radius: inherit; background-size: cover; background-position: center; pointer-events: none; }
350
+ .tb-backdrop::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--tb-scrim); }
351
+ /* the backdrop of the view or of a screen is the window's */
352
+ :is(.tb-view, .tb-screen) > .tb-backdrop { position: fixed; border-radius: 0; }
353
+ .tb-tile {
354
+ font: inherit;
355
+ font-size: 13px;
356
+ width: 112px;
357
+ min-height: 96px;
358
+ padding: var(--tb-space-3) var(--tb-space-2);
359
+ border: 1px solid transparent;
360
+ border-radius: var(--tb-radius);
361
+ background: transparent;
362
+ color: var(--tb-text);
363
+ cursor: pointer;
364
+ display: flex;
365
+ flex-direction: column;
366
+ align-items: center;
367
+ gap: var(--tb-space-2);
368
+ text-align: center;
369
+ overflow-wrap: anywhere;
370
+ transition: background var(--tb-fast) var(--tb-ease), border-color var(--tb-fast) var(--tb-ease);
371
+ }
372
+ .tb-tile:hover { background: var(--tb-surface); border-color: var(--tb-border); }
373
+ .tb-tile:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--tb-focus-ring); }
374
+ .tb-tile > svg { flex: none; width: 36px; height: 36px; color: var(--tb-primary); }
375
+ .tb-tile-linked { position: relative; }
376
+ .tb-tile-linked::after {
377
+ content: '';
378
+ position: absolute;
379
+ top: calc(var(--tb-space-3) + 21px);
380
+ left: calc(50% - 22px);
381
+ width: 16px;
382
+ height: 16px;
383
+ border-radius: 3px;
384
+ background: var(--tb-text);
385
+ outline: 2px solid var(--tb-bg);
386
+ -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M0 0h16v16H0z M6 4v2h2.6L4 10.6 5.4 12 10 7.4V10h2V4z' fill-rule='evenodd'/%3E%3C/svg%3E");
387
+ mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M0 0h16v16H0z M6 4v2h2.6L4 10.6 5.4 12 10 7.4V10h2V4z' fill-rule='evenodd'/%3E%3C/svg%3E");
388
+ }
389
+ .tb-grid { --tb-tracks: initial; --tb-cols: 2; display: grid; gap: var(--tb-space-4); grid-template-columns: var(--tb-tracks, repeat(var(--tb-cols), minmax(0, 1fr))); }
390
+ .tb-panel {
391
+ background: var(--tb-raised);
392
+ border: var(--tb-line) solid var(--tb-border);
393
+ border-radius: var(--tb-radius-lg);
394
+ box-shadow: var(--tb-shadow-1);
395
+ padding: var(--tb-space-6);
396
+ display: flex;
397
+ flex-direction: column;
398
+ gap: var(--tb-space-5);
399
+ }
400
+ .tb-panel.tb-small { width: 100%; max-width: 420px; font-size: inherit; }
401
+ .tb-panel.tb-primary { border-color: var(--tb-primary); box-shadow: inset 0 0 0 1px var(--tb-primary), var(--tb-shadow-1); }
402
+ .tb-panel.tb-accent { border-color: var(--tb-accent); }
403
+ .tb-panel.tb-danger { border-color: var(--tb-danger); }
404
+ .tb-panel.tb-success { border-color: var(--tb-success); }
405
+ .tb-panel.tb-warning { border-color: var(--tb-warning); }
406
+ .tb-panel:focus-visible, .tb-column:focus-visible, .tb-row:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--tb-focus-ring); }
407
+ .tb-panel.tb-primary:focus-visible { box-shadow: inset 0 0 0 1px var(--tb-primary), 0 0 0 3px var(--tb-focus-ring); }
408
+ .tb-panel > .tb-panel-title { margin: 0; font-family: var(--tb-headings); font-size: 17px; line-height: 1.35; font-weight: 600; letter-spacing: -0.01em; }
409
+ .tb-divider { border: 0; border-top: var(--tb-line) solid var(--tb-border); margin: var(--tb-space-2) 0; width: 100%; }
410
+
411
+ .tb-title { margin: 0; font-family: var(--tb-headings); font-size: 28px; line-height: 1.2; font-weight: 650; letter-spacing: -0.02em; }
412
+ .tb-heading { margin: 0; font-family: var(--tb-headings); font-size: 20px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; }
413
+ .tb-text { margin: 0; }
414
+ .tb-small { font-size: 13px; }
415
+ .tb-muted { color: var(--tb-muted); }
416
+ .tb-text.tb-danger { color: var(--tb-danger); }
417
+ .tb-text.tb-success { color: var(--tb-success); }
418
+ .tb-text.tb-primary { color: var(--tb-primary); }
419
+
420
+ /* forms: labels and controls aligned in two columns */
421
+ .tb-form {
422
+ display: grid;
423
+ grid-template-columns: minmax(120px, max-content) minmax(0, 1fr);
424
+ column-gap: var(--tb-space-5);
425
+ row-gap: var(--tb-space-4);
426
+ align-items: start;
427
+ /* a narrow form (in a grid cell, beside another panel) stacks like one on a phone; see @container below */
428
+ container-type: inline-size;
429
+ contain-intrinsic-inline-size: 30rem;
430
+ }
431
+ /* a panel in a form (a section) keeps the form's two columns */
432
+ .tb-form > .tb-panel, .tb-form > .tb-panel > .tb-panel { display: grid; grid-template-columns: subgrid; row-gap: var(--tb-space-4); align-items: start; }
433
+ :is(.tb-form, .tb-form > .tb-panel, .tb-form > .tb-panel > .tb-panel) > * { grid-column: 1 / -1; }
434
+ :is(.tb-form, .tb-form > .tb-panel, .tb-form > .tb-panel > .tb-panel) > .tb-field { display: contents; }
435
+ :is(.tb-form, .tb-form > .tb-panel, .tb-form > .tb-panel > .tb-panel) > .tb-field > .tb-label { grid-column: 1; padding-top: calc((var(--tb-control) - 1.5em) / 2); }
436
+ :is(.tb-form, .tb-form > .tb-panel, .tb-form > .tb-panel > .tb-panel) > .tb-field > .tb-control { grid-column: 2; }
437
+ :is(.tb-form, .tb-form > .tb-panel, .tb-form > .tb-panel > .tb-panel) > .tb-actions, :is(.tb-form, .tb-form > .tb-panel, .tb-form > .tb-panel > .tb-panel) > .tb-check-row { grid-column: 2; }
438
+ .tb-field { display: flex; flex-direction: column; gap: var(--tb-space-2); min-width: 0; }
439
+ @container (max-width: 420px) {
440
+ :is(.tb-form, .tb-form > .tb-panel, .tb-form > .tb-panel > .tb-panel) > .tb-field { display: flex; }
441
+ :is(.tb-form, .tb-form > .tb-panel, .tb-form > .tb-panel > .tb-panel) > .tb-field > .tb-label, :is(.tb-form, .tb-form > .tb-panel, .tb-form > .tb-panel > .tb-panel) > .tb-field > .tb-control,
442
+ :is(.tb-form, .tb-form > .tb-panel, .tb-form > .tb-panel > .tb-panel) > .tb-actions, :is(.tb-form, .tb-form > .tb-panel, .tb-form > .tb-panel > .tb-panel) > .tb-check-row { grid-column: 1 / -1; padding-top: 0; }
443
+ }
444
+ .tb-rows { display: flex; flex-direction: column; gap: var(--tb-space-3); align-items: stretch; }
445
+ .tb-rows > .tb-button { align-self: flex-start; }
446
+ .tb-entry { display: flex; gap: var(--tb-space-3); align-items: flex-start; }
447
+ .tb-entry > * { flex: 1 1 0; min-width: 0; }
448
+ .tb-entry > .tb-button { flex: none; }
449
+ /* the labels of the first row are the headers of the others */
450
+ .tb-entry:not(:first-child) .tb-field > .tb-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
451
+ .tb-entry:first-child:has(.tb-label:not(:empty)) > .tb-button { margin-top: calc(14px * 1.5 + var(--tb-space-2)); }
452
+ .tb-rich { display: flex; flex-direction: column; gap: var(--tb-space-1); }
453
+ .tb-rich-tools { display: flex; flex-wrap: wrap; gap: var(--tb-space-1); }
454
+ .tb-rich-tools[hidden], .tb-rich-link[hidden] { display: none; }
455
+ .tb-rich-tool { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--tb-radius); background: transparent; color: var(--tb-muted); cursor: pointer; }
456
+ .tb-rich-tool:hover { background: var(--tb-primary-soft); color: var(--tb-text); }
457
+ .tb-rich-tool:focus-visible { outline: 2px solid var(--tb-primary); outline-offset: 1px; }
458
+ .tb-rich-tool .tb-icon { width: 18px; height: 18px; }
459
+ .tb-rich-link { display: flex; gap: var(--tb-space-2); align-items: center; }
460
+ .tb-input.tb-rich-box { padding: var(--tb-space-2) var(--tb-space-3); min-height: calc(var(--tb-control) * 2.5); overflow-wrap: anywhere; cursor: text; }
461
+ .tb-input.tb-rich-box[aria-readonly="true"] { background: color-mix(in srgb, var(--tb-muted) 12%, transparent); border-color: transparent; cursor: default; }
462
+ .tb-input.tb-rich-box[aria-disabled="true"] { opacity: 0.45; }
463
+ .tb-rich-box:focus { outline: none; border-color: var(--tb-primary); box-shadow: 0 0 0 3px var(--tb-focus-ring); }
464
+ .tb-rich-box > :first-child { margin-top: 0; }
465
+ .tb-rich-box > :last-child { margin-bottom: 0; }
466
+ .tb-rich-box p, .tb-rich-box ul, .tb-rich-box ol { margin: 0 0 var(--tb-space-2); }
467
+ .tb-rich-box ul, .tb-rich-box ol { padding-left: var(--tb-space-5); }
468
+ .tb-rich-box h1, .tb-rich-box h2, .tb-rich-box h3 { margin: var(--tb-space-3) 0 var(--tb-space-2); line-height: 1.3; font-weight: 600; }
469
+ .tb-rich-box h1 { font-size: 22px; }
470
+ .tb-rich-box h2 { font-size: 18px; }
471
+ .tb-rich-box h3 { font-size: 16px; }
472
+ .tb-rich-box a { color: var(--tb-primary); }
473
+ .tb-control { display: flex; flex-direction: column; gap: var(--tb-space-1); min-width: 0; }
474
+ .tb-label { font-weight: 550; font-size: 14px; color: var(--tb-text); }
475
+ .tb-required::after { content: " *"; color: var(--tb-muted); font-weight: 400; }
476
+ .tb-input {
477
+ font: inherit;
478
+ color: var(--tb-text);
479
+ background: var(--tb-surface);
480
+ border: var(--tb-line) solid var(--tb-border-strong);
481
+ border-radius: var(--tb-radius);
482
+ min-height: var(--tb-control);
483
+ padding: 0 var(--tb-space-3);
484
+ width: 100%;
485
+ transition: border-color var(--tb-fast) var(--tb-ease), box-shadow var(--tb-fast) var(--tb-ease);
486
+ }
487
+ textarea.tb-input { padding: var(--tb-space-2) var(--tb-space-3); min-height: calc(var(--tb-control) * 2.5); resize: vertical; }
488
+ select.tb-input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--tb-muted) 50%), linear-gradient(135deg, var(--tb-muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: var(--tb-space-6); }
489
+ .tb-input::placeholder { color: var(--tb-muted); opacity: 0.8; }
490
+ .tb-input:hover { border-color: var(--tb-muted); }
491
+ .tb-input:focus { outline: none; border-color: var(--tb-primary); box-shadow: 0 0 0 3px var(--tb-focus-ring); }
492
+ .tb-input[readonly] { background: color-mix(in srgb, var(--tb-muted) 12%, transparent); border-color: transparent; color: var(--tb-muted); cursor: default; }
493
+ .tb-input[readonly]:focus { border-color: var(--tb-muted); box-shadow: none; }
494
+ .tb-invalid .tb-input { border-color: var(--tb-danger); }
495
+ .tb-invalid .tb-input:focus { box-shadow: 0 0 0 3px var(--tb-danger-soft); }
496
+ .tb-error { color: var(--tb-danger); font-size: 13px; min-height: 0; }
497
+ .tb-error:empty { display: none; }
498
+ .tb-hint { color: var(--tb-muted); font-size: 13px; }
499
+ .tb-pending .tb-input { background-image: linear-gradient(90deg, transparent, var(--tb-primary-soft), transparent); background-size: 200% 100%; animation: tb-pending 1.2s linear infinite; }
500
+ @keyframes tb-pending { from { background-position: 200% 0; } to { background-position: -200% 0; } }
501
+
502
+ .tb-check-row { display: flex; }
503
+ .tb-check { display: inline-flex; align-items: center; gap: var(--tb-space-3); min-height: var(--tb-control); cursor: pointer; }
504
+ .tb-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--tb-primary); cursor: pointer; }
505
+ .tb-check input:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--tb-focus-ring); border-radius: 4px; }
506
+ .tb-check input[type="radio"]:focus-visible { border-radius: 50%; }
507
+ .tb-radios { display: flex; flex-wrap: wrap; column-gap: var(--tb-space-5); }
508
+ .tb-radio-group { flex-basis: 100%; }
509
+ .tb-radio-title { display: block; margin-top: var(--tb-space-2); font-size: 13px; font-weight: 600; color: var(--tb-muted); }
510
+ .tb-switch input {
511
+ appearance: none;
512
+ width: 36px;
513
+ height: 20px;
514
+ flex: none;
515
+ border-radius: 10px;
516
+ background: var(--tb-muted);
517
+ position: relative;
518
+ transition: background var(--tb-fast) var(--tb-ease);
519
+ }
520
+ .tb-switch input::before {
521
+ content: "";
522
+ position: absolute;
523
+ top: 2px;
524
+ left: 2px;
525
+ width: 16px;
526
+ height: 16px;
527
+ border-radius: 50%;
528
+ background: var(--tb-surface);
529
+ box-shadow: var(--tb-shadow-1);
530
+ transition: transform var(--tb-fast) var(--tb-ease);
531
+ }
532
+ .tb-switch input:checked { background: var(--tb-primary); }
533
+ .tb-switch input:checked::before { transform: translateX(16px); }
534
+ .tb-switch input:focus-visible { border-radius: 10px; }
535
+ .tb-check input:disabled, .tb-check input:disabled + span { opacity: 0.45; cursor: not-allowed; }
536
+
537
+ .tb-actions { display: flex; flex-wrap: wrap; gap: var(--tb-space-3); padding-top: var(--tb-space-2); }
538
+ .tb-button {
539
+ font: inherit;
540
+ font-weight: 600;
541
+ font-size: 14px;
542
+ min-height: var(--tb-control);
543
+ padding: 0 var(--tb-space-5);
544
+ border-radius: var(--tb-radius);
545
+ border: var(--tb-line) solid var(--tb-border-strong);
546
+ background: var(--tb-surface);
547
+ color: var(--tb-text);
548
+ cursor: pointer;
549
+ display: inline-flex;
550
+ align-items: center;
551
+ justify-content: center;
552
+ gap: var(--tb-space-2);
553
+ transition: background var(--tb-fast) var(--tb-ease), border-color var(--tb-fast) var(--tb-ease), box-shadow var(--tb-fast) var(--tb-ease), opacity var(--tb-fast) var(--tb-ease);
554
+ }
555
+ .tb-button.tb-small { font-size: 13px; padding: 0 var(--tb-space-3); gap: var(--tb-space-1); }
556
+ .tb-button:hover { background: var(--tb-bg); border-color: var(--tb-muted); }
557
+ .tb-button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--tb-focus-ring); }
558
+ .tb-button.tb-primary { background: var(--tb-primary); border-color: var(--tb-primary); color: var(--tb-on-primary); box-shadow: var(--tb-shadow-1); }
559
+ .tb-button.tb-primary:hover { background: var(--tb-primary-hover); border-color: var(--tb-primary-hover); }
560
+ .tb-button.tb-accent { background: var(--tb-accent); border-color: var(--tb-accent); color: var(--tb-on-accent); }
561
+ .tb-button.tb-danger { background: var(--tb-danger); border-color: var(--tb-danger); color: var(--tb-on-danger); }
562
+ .tb-button:disabled, .tb-button[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
563
+ .tb-button.tb-primary[aria-disabled="true"]:hover { background: var(--tb-primary); border-color: var(--tb-primary); }
564
+ .tb-button.tb-has-icon:not(:has(> span:not(:empty))) { padding: 0; width: var(--tb-control); }
565
+ /* a button that opens a menu: a chevron after its text, or alone after its icon */
566
+ .tb-menu-chevron { transition: transform var(--tb-fast) var(--tb-ease); }
567
+ .tb-button .tb-menu-chevron { width: 16px; height: 16px; margin-inline-end: calc(var(--tb-space-1) * -1); }
568
+ [aria-expanded="true"] > .tb-menu-chevron { transform: rotate(180deg); }
569
+ .tb-button.tb-has-icon[aria-haspopup]:not(:has(> span:not(:empty))) { width: auto; padding: 0 var(--tb-space-2); gap: 2px; }
570
+
571
+ .tb-icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: var(--tb-icon-stroke); stroke-linecap: var(--tb-icon-cap); stroke-linejoin: var(--tb-icon-join); }
572
+ .tb-button .tb-icon { width: 18px; height: 18px; }
573
+ .tb-icon-face { display: inline-flex; align-self: flex-start; color: var(--tb-text); }
574
+ .tb-icon-face .tb-icon { width: 24px; height: 24px; }
575
+ .tb-icon-face.tb-small .tb-icon { width: 18px; height: 18px; }
576
+ .tb-icon-face.tb-large .tb-icon { width: 32px; height: 32px; }
577
+ .tb-icon-face.tb-muted { color: var(--tb-muted); }
578
+ .tb-icon-face.tb-primary { color: var(--tb-primary); }
579
+ .tb-icon-face.tb-accent { color: var(--tb-accent); }
580
+ .tb-icon-face.tb-danger { color: var(--tb-danger); }
581
+ .tb-icon-face.tb-success { color: var(--tb-success); }
582
+ .tb-icon-face.tb-warning { color: var(--tb-warning); }
583
+ .tb-input-icon { position: relative; display: flex; }
584
+ .tb-input-icon > .tb-icon { position: absolute; left: var(--tb-space-3); top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--tb-muted); pointer-events: none; }
585
+ .tb-input-icon > .tb-input { padding-left: calc(var(--tb-space-3) + 26px); }
586
+ .tb-upload { display: flex; flex-wrap: wrap; align-items: center; gap: var(--tb-space-3); padding: var(--tb-space-3); border: 1px dashed var(--tb-border-strong); border-radius: var(--tb-radius); background: var(--tb-surface); transition: border-color var(--tb-fast) var(--tb-ease), background var(--tb-fast) var(--tb-ease); }
587
+ .tb-upload.tb-drop-over { border-color: var(--tb-primary); background: var(--tb-primary-soft); }
588
+ .tb-invalid .tb-upload { border-color: var(--tb-danger); }
589
+ .tb-upload-hint { color: var(--tb-muted); font-size: 0.9em; }
590
+ .tb-upload[hidden] { display: none; }
591
+ .tb-upload[hidden] + .tb-upload-list { margin-top: 0; }
592
+ .tb-upload-list { list-style: none; margin: var(--tb-space-2) 0 0; padding: 0; display: grid; gap: var(--tb-space-1); }
593
+ .tb-upload-list li { display: flex; align-items: center; gap: var(--tb-space-2); min-height: 36px; padding: 0 var(--tb-space-1) 0 var(--tb-space-3); border: var(--tb-line) solid var(--tb-border); border-radius: var(--tb-radius); background: var(--tb-surface); }
594
+ .tb-upload-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
595
+ a.tb-upload-name { color: var(--tb-primary); text-decoration: none; }
596
+ a.tb-upload-name:hover { text-decoration: underline; }
597
+ .tb-upload-thumb { width: 32px; height: 32px; margin: var(--tb-space-1) 0; object-fit: cover; border-radius: var(--tb-radius); flex: none; }
598
+ .tb-upload-size { color: var(--tb-muted); font-size: 0.9em; font-variant-numeric: tabular-nums; }
599
+ .tb-upload-remove { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: var(--tb-radius); background: transparent; color: var(--tb-muted); cursor: pointer; }
600
+ .tb-upload-remove:hover:not(:disabled) { background: var(--tb-danger-soft); color: var(--tb-danger); }
601
+ .tb-upload-remove:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--tb-focus-ring); }
602
+ .tb-upload-remove .tb-icon { width: 16px; height: 16px; }
603
+ .tb-date { position: relative; display: flex; }
604
+ .tb-date > .tb-input { padding-right: calc(var(--tb-control) + var(--tb-space-1)); }
605
+ .tb-date-button { position: absolute; right: 1px; top: 1px; bottom: 1px; width: var(--tb-control); display: grid; place-items: center; padding: 0; border: 0; border-radius: var(--tb-radius); background: transparent; color: var(--tb-muted); cursor: pointer; }
606
+ .tb-date-button:hover:not(:disabled) { color: var(--tb-text); }
607
+ .tb-date-button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--tb-focus-ring); }
608
+ .tb-date-button:disabled { cursor: default; opacity: 0.5; }
609
+ .tb-date-button .tb-icon { width: 18px; height: 18px; }
610
+ .tb-tree-wrap { min-width: 0; }
611
+ .tb-tree, .tb-tree ul { list-style: none; margin: 0; padding: 0; }
612
+ .tb-tree li { outline: none; }
613
+ .tb-tree-row {
614
+ display: flex;
615
+ align-items: center;
616
+ gap: var(--tb-space-1);
617
+ min-height: calc(var(--tb-control) - 8px);
618
+ padding: 0 var(--tb-space-2) 0 calc(var(--tb-level, 0) * 20px + var(--tb-space-1));
619
+ border-radius: var(--tb-radius);
620
+ cursor: pointer;
621
+ user-select: none;
622
+ transition: background var(--tb-fast) var(--tb-ease);
623
+ }
624
+ .tb-tree-row:hover { background: var(--tb-bg); }
625
+ .tb-tree li:focus-visible > .tb-tree-row { box-shadow: inset 0 0 0 2px var(--tb-focus); }
626
+ .tb-tree li.tb-selected > .tb-tree-row { background: var(--tb-primary-soft); font-weight: 550; }
627
+ .tb-tree-toggle { display: inline-flex; flex: none; width: 20px; height: 20px; align-items: center; justify-content: center; color: var(--tb-muted); border-radius: var(--tb-radius); }
628
+ .tb-tree-toggle .tb-icon { width: 16px; height: 16px; transition: transform var(--tb-fast) var(--tb-ease); }
629
+ .tb-tree li:not([aria-expanded]) > .tb-tree-row > .tb-tree-toggle { visibility: hidden; }
630
+ .tb-tree li[aria-expanded="true"] > .tb-tree-row > .tb-tree-toggle .tb-icon { transform: rotate(90deg); }
631
+ .tb-tree-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
632
+ .tb-tree-row.tb-drop-over { box-shadow: inset 0 0 0 2px var(--tb-primary); }
633
+
634
+ .tb-toolbar {
635
+ display: flex;
636
+ flex-wrap: wrap;
637
+ align-items: center;
638
+ gap: var(--tb-space-1);
639
+ padding: var(--tb-space-1);
640
+ background: var(--tb-surface);
641
+ border: var(--tb-line) solid var(--tb-border);
642
+ border-radius: var(--tb-radius-lg);
643
+ }
644
+ .tb-toolbar > .tb-button:not(.tb-primary, .tb-accent, .tb-danger) { border-color: transparent; background: transparent; }
645
+ .tb-toolbar > .tb-button:not(.tb-primary, .tb-accent, .tb-danger):hover { background: var(--tb-bg); }
646
+ .tb-toolbar > .tb-button { padding: 0 var(--tb-space-3); }
647
+ .tb-toolbar > .tb-divider { width: 0; height: calc(var(--tb-control) - 12px); margin: 0 var(--tb-space-1); border-top: 0; border-left: var(--tb-line) solid var(--tb-border); }
648
+
649
+ .tb-breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: var(--tb-space-1); margin: 0; padding: 0; list-style: none; font-size: 14px; }
650
+ .tb-breadcrumb li { display: inline-flex; align-items: center; gap: var(--tb-space-1); min-width: 0; }
651
+ .tb-breadcrumb li + li::before { content: "›" / ""; color: var(--tb-muted); padding: 0 var(--tb-space-1); }
652
+ .tb-crumb { font: inherit; color: var(--tb-muted); background: none; border: 0; padding: var(--tb-space-1); border-radius: var(--tb-radius); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 24ch; }
653
+ button.tb-crumb { cursor: pointer; }
654
+ button.tb-crumb:hover { color: var(--tb-text); text-decoration: underline; text-underline-offset: 3px; }
655
+ button.tb-crumb:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--tb-focus-ring); }
656
+ .tb-crumb[aria-current] { color: var(--tb-text); font-weight: 600; }
657
+ .tb-crumb-more { display: none !important; }
658
+
659
+ .tb-link { display: inline-flex; align-items: center; gap: var(--tb-space-1); color: var(--tb-primary); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
660
+
661
+ .tb-hidden { display: none !important; }
662
+ /* read by screen readers, not shown */
663
+ .tb-sr-only { position: absolute; top: 0; left: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
664
+ @media (min-width: 641px) { .tb-narrow-only { display: none !important; } }
665
+
666
+ .tb-scroll {
667
+ display: flex;
668
+ flex-direction: column;
669
+ gap: var(--tb-space-4);
670
+ min-width: 0;
671
+ max-height: 400px;
672
+ overflow: auto;
673
+ overscroll-behavior: contain;
674
+ padding: var(--tb-space-3);
675
+ border: var(--tb-line) solid var(--tb-border);
676
+ border-radius: var(--tb-radius);
677
+ }
678
+ .tb-scroll.tb-small { max-height: 240px; font-size: inherit; }
679
+ .tb-scroll.tb-large { max-height: 640px; }
680
+ .tb-scroll:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--tb-focus-ring); }
681
+
682
+ .tb-image { display: block; max-width: 100%; height: auto; border-radius: var(--tb-radius); object-fit: cover; }
683
+ .tb-image.tb-round { aspect-ratio: 1; border-radius: 50%; }
684
+ .tb-video { display: block; width: 100%; max-width: 100%; height: auto; aspect-ratio: auto 16 / 9; border-radius: var(--tb-radius); }
685
+ .tb-audio { display: block; width: 100%; max-width: 480px; }
686
+ :is(.tb-video, .tb-audio).tb-small { width: 320px; }
687
+ :is(.tb-video, .tb-audio).tb-medium { width: 480px; }
688
+ .tb-video.tb-large { width: 720px; }
689
+ :is(.tb-video, .tb-audio).tb-fill { max-width: none; }
690
+ :is(.tb-video, .tb-audio):focus-visible { outline: none; box-shadow: 0 0 0 3px var(--tb-focus-ring); }
691
+ .tb-canvas { display: block; max-width: 100%; }
692
+ .tb-canvas > svg { display: block; max-width: 100%; height: auto; overflow: visible; }
693
+ .tb-canvas.tb-fill > svg { width: 100%; }
694
+ .tb-chart { display: flex; flex-direction: column; gap: var(--tb-space-2); align-self: stretch; width: 100%; margin: 0; min-width: 0; }
695
+ .tb-chart-caption { font-weight: 600; }
696
+ .tb-chart-plot { width: 100%; min-width: 0; }
697
+ .tb-chart-plot > svg { display: block; width: 100%; height: auto; overflow: visible; }
698
+ .tb-chart-legend { display: flex; flex-wrap: wrap; gap: var(--tb-space-1) var(--tb-space-4); margin: 0; padding: 0; list-style: none; color: var(--tb-muted); font-size: 13px; }
699
+ .tb-chart-key { display: inline-flex; align-items: center; gap: var(--tb-space-2); }
700
+ .tb-chart-swatch { width: 12px; height: 12px; border-radius: 3px; background: var(--tb-swatch); }
701
+ .tb-chart-empty { margin: 0; color: var(--tb-muted); }
702
+ .tb-chart-caption[hidden], .tb-chart-plot[hidden], .tb-chart-legend[hidden], .tb-chart-empty[hidden] { display: none; }
703
+ .tb-orbit { position: relative; align-self: stretch; width: 100%; min-width: 0; height: 480px; border-radius: var(--tb-radius);
704
+ background: radial-gradient(ellipse at 50% 45%, color-mix(in oklch, var(--tb-primary) 7%, transparent) 0%, transparent 70%); }
705
+ .tb-orbit.tb-small { height: 320px; }
706
+ .tb-orbit.tb-large { height: 640px; }
707
+ .tb-orbit.tb-fit { height: auto; min-height: 320px; }
708
+ .tb-orbit > svg { display: block; position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; user-select: none; touch-action: none; outline: none; }
709
+ .tb-orbit > svg.tb-orbit-panning { cursor: grabbing; }
710
+ .tb-orbit > svg:focus-visible { box-shadow: inset 0 0 0 3px var(--tb-focus-ring); border-radius: var(--tb-radius); }
711
+ .tb-orbit-node { cursor: pointer; outline: none; }
712
+ .tb-orbit-focus { cursor: default; }
713
+ .tb-orbit-body { vector-effect: non-scaling-stroke; transition: stroke-width .2s; }
714
+ .tb-orbit-node:hover .tb-orbit-body, .tb-orbit-node:focus-visible .tb-orbit-body { stroke-width: 3; }
715
+ .tb-orbit-node:focus-visible .tb-orbit-body { stroke: var(--tb-focus); }
716
+ .tb-orbit-halo { opacity: .55; transition: opacity .25s; pointer-events: none; }
717
+ .tb-orbit-node:hover .tb-orbit-halo, .tb-orbit-node:focus-visible .tb-orbit-halo { opacity: 1; }
718
+ .tb-orbit-node text { pointer-events: none; fill: var(--tb-text); text-anchor: middle; dominant-baseline: middle; font-family: var(--tb-font); }
719
+ .tb-orbit-node .tb-orbit-count { fill: var(--tb-muted); }
720
+ .tb-orbit-line, .tb-orbit-step { fill: none; vector-effect: non-scaling-stroke; pointer-events: none; }
721
+ .tb-orbit-line { stroke-width: 1; }
722
+ .tb-orbit-step { stroke-linecap: round; }
723
+ .tb-orbit-spin { animation: tb-orbit-spin 60s linear infinite; }
724
+ .tb-orbit-spin.tb-orbit-rev { animation-direction: reverse; animation-duration: 90s; }
725
+ .tb-orbit-spin.tb-orbit-fast { animation-duration: 24s; }
726
+ @keyframes tb-orbit-spin { to { transform: rotate(360deg); } }
727
+ .tb-orbit-now { animation: tb-orbit-pulse 1.8s ease-in-out infinite; }
728
+ @keyframes tb-orbit-pulse { 50% { opacity: .35; } }
729
+ .tb-orbit-edge { fill: none; pointer-events: none; }
730
+ .tb-orbit-edge-solid, .tb-orbit-edge-dashed { stroke: var(--tb-accent); stroke-width: 1.4; stroke-opacity: .7; }
731
+ .tb-orbit-edge-dashed { stroke-dasharray: 5 5; }
732
+ .tb-orbit-edge-faint { stroke: var(--tb-muted); stroke-width: 1; stroke-opacity: .35; }
733
+ .tb-orbit-edge-trail { stroke: var(--tb-muted); stroke-width: 1; stroke-opacity: .5; stroke-dasharray: 2 6; }
734
+ .tb-orbit-label { font-size: 11px; font-family: var(--tb-font); fill: var(--tb-muted); text-anchor: middle; pointer-events: none;
735
+ paint-order: stroke; stroke: var(--tb-bg); stroke-width: 3px; letter-spacing: .02em; }
736
+ .tb-orbit-label.tb-orbit-later { visibility: hidden; }
737
+ .tb-orbit-label.tb-orbit-later.tb-orbit-shown { visibility: visible; }
738
+ .tb-image.tb-small { width: 96px; }
739
+ .tb-image.tb-medium { width: 240px; }
740
+ .tb-image.tb-large { width: 480px; }
741
+ .tb-image.tb-fill { width: 100%; }
742
+
743
+ .tb-progress-wrap { display: flex; flex-direction: column; gap: var(--tb-space-2); min-width: 0; }
744
+ .tb-progress-label { font-size: 14px; font-weight: 550; }
745
+ .tb-progress-label[hidden] { display: none; }
746
+ .tb-progress { height: 8px; border-radius: 4px; background: var(--tb-border); overflow: hidden; }
747
+ .tb-upload-progress { height: 6px; }
748
+ .tb-widget { display: block; width: 100%; min-width: 0; }
749
+ .tb-photo { display: flex; flex-wrap: wrap; align-items: center; gap: var(--tb-space-4); margin: calc(-1 * var(--tb-space-2)); padding: var(--tb-space-2); border: 1px dashed transparent; border-radius: var(--tb-radius-lg); transition: border-color var(--tb-fast) var(--tb-ease), background var(--tb-fast) var(--tb-ease); }
750
+ .tb-photo.tb-drop-over { border-color: var(--tb-primary); background: var(--tb-primary-soft); }
751
+ .tb-photo-frame { flex: none; width: 96px; height: 96px; display: grid; place-items: center; overflow: hidden; border: var(--tb-line) solid var(--tb-border); border-radius: var(--tb-radius-lg); background: var(--tb-bg); color: var(--tb-muted); }
752
+ .tb-photo-frame.tb-photo-pick { cursor: pointer; }
753
+ .tb-photo-frame.tb-round { border-radius: 50%; }
754
+ .tb-photo-frame > img { display: block; width: 100%; height: 100%; object-fit: cover; }
755
+ .tb-photo-frame > .tb-icon { width: 32px; height: 32px; }
756
+ .tb-invalid .tb-photo-frame { border-color: var(--tb-danger); }
757
+ .tb-photo-actions { display: flex; flex-wrap: wrap; gap: var(--tb-space-2); }
758
+ .tb-photo-actions[hidden], .tb-photo-remove[hidden] { display: none; }
759
+ .tb-upload-progress[hidden] { display: none; }
760
+ .tb-progress-bar { height: 100%; width: 0; border-radius: inherit; background: var(--tb-primary); transition: width 300ms var(--tb-ease); }
761
+ .tb-success .tb-progress-bar { background: var(--tb-success); }
762
+ .tb-warning .tb-progress-bar { background: var(--tb-warning); }
763
+ .tb-danger .tb-progress-bar { background: var(--tb-danger); }
764
+ .tb-accent .tb-progress-bar { background: var(--tb-accent); }
765
+ .tb-indeterminate .tb-progress-bar { width: 35%; animation: tb-indeterminate 1.4s var(--tb-ease) infinite; }
766
+ @keyframes tb-indeterminate { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
767
+
768
+ /* tables: rows become cards on narrow screens */
769
+ .tb-table-wrap, .tb-list-wrap { min-width: 0; }
770
+ .tb-table-wrap {
771
+ overflow-x: auto;
772
+ background: var(--tb-surface);
773
+ border: var(--tb-line) solid var(--tb-border);
774
+ border-radius: var(--tb-radius-lg);
775
+ box-shadow: var(--tb-shadow-1);
776
+ }
777
+ .tb-table { width: 100%; border-collapse: collapse; font-size: 14px; }
778
+ .tb-table th {
779
+ text-align: left;
780
+ font-size: 13px;
781
+ font-weight: 600;
782
+ color: var(--tb-muted);
783
+ white-space: nowrap;
784
+ padding: var(--tb-space-3) var(--tb-space-4);
785
+ background: var(--tb-bg);
786
+ border-bottom: var(--tb-line) solid var(--tb-border);
787
+ }
788
+ .tb-table td { padding: var(--tb-space-3) var(--tb-space-4); border-bottom: var(--tb-line) solid var(--tb-border); height: var(--tb-control); }
789
+ .tb-table tbody tr:last-child td { border-bottom: 0; }
790
+ .tb-table .tb-num { text-align: right; font-variant-numeric: tabular-nums; }
791
+ .tb-table-wrap:has(tbody:empty) thead { display: none; }
792
+ /* the room of the rows a long table does not draw */
793
+ .tb-table .tb-room[hidden] { display: none; }
794
+ .tb-table.tb-fixed { table-layout: fixed; }
795
+ .tb-table .tb-room :is(tr, td) { padding: 0; border: 0; margin: 0; background: none; box-shadow: none; }
796
+ .tb-table th:has(> .tb-sort) { padding: 0; }
797
+ .tb-sort {
798
+ display: flex;
799
+ align-items: center;
800
+ gap: var(--tb-space-1);
801
+ width: 100%;
802
+ padding: var(--tb-space-3) var(--tb-space-4);
803
+ border: 0;
804
+ background: none;
805
+ font: inherit;
806
+ color: inherit;
807
+ text-align: inherit;
808
+ cursor: pointer;
809
+ border-radius: 0;
810
+ }
811
+ .tb-sort:hover, th[aria-sort] > .tb-sort { color: var(--tb-text); }
812
+ .tb-sort:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--tb-focus); }
813
+ .tb-sort svg { width: 14px; height: 14px; flex: none; }
814
+ .tb-sort .tb-sort-idle { opacity: 0; transition: opacity var(--tb-fast) var(--tb-ease); }
815
+ .tb-sort:hover .tb-sort-idle, .tb-sort:focus-visible .tb-sort-idle { opacity: 0.5; }
816
+ .tb-table tfoot[hidden] { display: none !important; }
817
+ .tb-table tfoot td {
818
+ font-weight: 600;
819
+ background: var(--tb-bg);
820
+ border-top: var(--tb-line) solid var(--tb-border);
821
+ border-bottom: 0;
822
+ }
823
+ .tb-selectable tbody:not(.tb-room) tr:not(.tb-group-head, .tb-group-foot), .tb-selectable .tb-list > li:not(.tb-group-head, .tb-group-foot) { cursor: pointer; transition: background var(--tb-fast) var(--tb-ease); }
824
+ .tb-selectable tbody:not(.tb-room) tr:not(.tb-group-head, .tb-group-foot):hover, .tb-selectable .tb-list > li:not(.tb-group-head, .tb-group-foot):hover { background: var(--tb-bg); }
825
+ .tb-selectable tbody tr:focus-visible, .tb-selectable .tb-list > li:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--tb-focus); }
826
+ .tb-table tr.tb-selected, .tb-list > li.tb-selected { background: var(--tb-primary-soft); }
827
+ /* the head and foot of a group in the rows: a title the width of the row, and its subtotals */
828
+ .tb-table .tb-group-head > th { font-size: 14px; color: var(--tb-text); white-space: normal; background: var(--tb-bg); border-top: var(--tb-line) solid var(--tb-border); }
829
+ .tb-table .tb-group-head.tb-level-2 > th { font-weight: 500; background: var(--tb-surface); }
830
+ .tb-table .tb-group-foot > td { font-weight: 600; background: var(--tb-bg); }
831
+ .tb-table .tb-level-2 > :first-child, .tb-list > .tb-level-2 { padding-left: calc(var(--tb-space-4) + var(--tb-space-5)); }
832
+ .tb-list > li.tb-group-head { font-weight: 600; background: var(--tb-bg); }
833
+ .tb-list > li.tb-group-foot { font-weight: 600; }
834
+ .tb-empty { margin: 0; padding: var(--tb-space-6) var(--tb-space-4); text-align: center; color: var(--tb-muted); }
835
+ .tb-empty[hidden] { display: none; }
836
+
837
+ .tb-list {
838
+ list-style: none;
839
+ margin: 0;
840
+ padding: 0;
841
+ background: var(--tb-surface);
842
+ border: var(--tb-line) solid var(--tb-border);
843
+ border-radius: var(--tb-radius-lg);
844
+ box-shadow: var(--tb-shadow-1);
845
+ overflow: hidden;
846
+ }
847
+ .tb-list:empty { display: none; }
848
+ .tb-list > li {
849
+ display: flex;
850
+ align-items: center;
851
+ gap: var(--tb-space-3);
852
+ min-height: var(--tb-control);
853
+ padding: var(--tb-space-3) var(--tb-space-4);
854
+ border-bottom: var(--tb-line) solid var(--tb-border);
855
+ }
856
+ .tb-list > li:last-child { border-bottom: 0; }
857
+ .tb-list-texts { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; }
858
+ .tb-list-primary { font-weight: 550; }
859
+ /* the picture of a row, in a column of images or at the start of a list's item */
860
+ .tb-thumb { display: block; flex: none; width: 40px; height: 40px; object-fit: cover; border-radius: var(--tb-radius); background: var(--tb-bg); }
861
+ .tb-thumb.tb-round { border-radius: 50%; }
862
+ .tb-table td.tb-thumb-cell { width: 1%; padding-top: var(--tb-space-1); padding-bottom: var(--tb-space-1); }
863
+ .tb-list-secondary { color: var(--tb-muted); font-size: 13px; }
864
+ .tb-list-secondary:empty { display: none; }
865
+
866
+ /* dialogs: centered window, full screen when narrow */
867
+ .tb-dialog {
868
+ border: 0;
869
+ padding: 0;
870
+ width: min(560px, calc(100vw - 32px));
871
+ max-height: calc(100vh - 64px);
872
+ background: var(--tb-raised);
873
+ color: var(--tb-text);
874
+ border-radius: var(--tb-radius-lg);
875
+ box-shadow: var(--tb-shadow-3);
876
+ }
877
+ .tb-dialog[open] { display: flex; flex-direction: column; animation: tb-rise 180ms var(--tb-ease); }
878
+ .tb-dialog::backdrop { background: var(--tb-overlay); }
879
+ .tb-dialog-head {
880
+ display: flex;
881
+ align-items: center;
882
+ justify-content: space-between;
883
+ gap: var(--tb-space-3);
884
+ padding: var(--tb-space-4) var(--tb-space-4) 0 var(--tb-space-6);
885
+ }
886
+ .tb-dialog-title { margin: 0; font-size: 17px; line-height: 1.35; font-weight: 600; letter-spacing: -0.01em; }
887
+ .tb-dialog-close {
888
+ font: inherit;
889
+ font-size: 22px;
890
+ line-height: 1;
891
+ width: var(--tb-control);
892
+ height: var(--tb-control);
893
+ flex: none;
894
+ border: 0;
895
+ border-radius: var(--tb-radius);
896
+ background: transparent;
897
+ color: var(--tb-muted);
898
+ cursor: pointer;
899
+ }
900
+ .tb-dialog-close:hover { background: var(--tb-bg); color: var(--tb-text); }
901
+ .tb-dialog-close:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--tb-focus-ring); }
902
+ .tb-dialog-body {
903
+ display: flex;
904
+ flex-direction: column;
905
+ gap: var(--tb-space-4);
906
+ padding: var(--tb-space-4) var(--tb-space-6) var(--tb-space-6);
907
+ overflow: auto;
908
+ }
909
+ .tb-dialog.tb-confirm { width: min(420px, calc(100vw - 32px)); }
910
+ .tb-dialog.tb-confirm > .tb-dialog-body { padding-top: var(--tb-space-6); gap: var(--tb-space-6); }
911
+ .tb-confirm-question { margin: 0; font-size: 15px; line-height: 1.5; }
912
+ @keyframes tb-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
913
+
914
+ /* tabs */
915
+ .tb-tabs { display: flex; flex-direction: column; gap: var(--tb-space-5); min-width: 0; }
916
+ .tb-tablist { display: flex; gap: var(--tb-space-1); box-shadow: inset 0 -1px 0 var(--tb-border); overflow-x: auto; scrollbar-width: none; }
917
+ .tb-tab {
918
+ font: inherit;
919
+ font-size: 14px;
920
+ font-weight: 550;
921
+ min-height: var(--tb-control);
922
+ padding: 0 var(--tb-space-4);
923
+ border: 0;
924
+ border-bottom: 2px solid transparent;
925
+ background: transparent;
926
+ color: var(--tb-muted);
927
+ cursor: pointer;
928
+ white-space: nowrap;
929
+ transition: color var(--tb-fast) var(--tb-ease), border-color var(--tb-fast) var(--tb-ease);
930
+ }
931
+ .tb-tab:hover { color: var(--tb-text); }
932
+ .tb-tab[aria-selected="true"] { color: var(--tb-primary); border-bottom-color: var(--tb-primary); }
933
+ .tb-tab:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--tb-focus-ring); border-radius: var(--tb-radius) var(--tb-radius) 0 0; }
934
+ .tb-tab-panel { display: flex; flex-direction: column; gap: var(--tb-space-4); min-width: 0; }
935
+ .tb-tab-panel[hidden] { display: none; }
936
+
937
+ /* split: two panes and a handle; one pane at a time when narrow */
938
+ .tb-split { display: grid; grid-template-columns: minmax(0, var(--tb-split, 40%)) auto minmax(0, 1fr); align-items: start; }
939
+ .tb-split-pane { display: flex; flex-direction: column; gap: var(--tb-space-4); min-width: 0; }
940
+ .tb-split-pane:focus { outline: none; }
941
+ .tb-split-handle {
942
+ align-self: stretch;
943
+ width: var(--tb-space-5);
944
+ cursor: col-resize;
945
+ touch-action: none;
946
+ display: flex;
947
+ justify-content: center;
948
+ border-radius: var(--tb-radius);
949
+ }
950
+ .tb-split-handle::before { content: ""; width: 1px; background: var(--tb-border); transition: background var(--tb-fast) var(--tb-ease), width var(--tb-fast) var(--tb-ease); }
951
+ .tb-split-handle:hover::before { width: 3px; background: var(--tb-border-strong); }
952
+ .tb-split-handle:focus-visible { outline: none; }
953
+ .tb-split-handle:focus-visible::before { width: 3px; background: var(--tb-focus); }
954
+ .tb-split-back { display: none; }
955
+
956
+ /* the calendar of a date field: in the top layer, placed by the host */
957
+ .tb-calendar {
958
+ position: fixed;
959
+ inset: auto;
960
+ margin: 0;
961
+ padding: var(--tb-space-3);
962
+ background: var(--tb-raised);
963
+ color: var(--tb-text);
964
+ border: var(--tb-line) solid var(--tb-border);
965
+ border-radius: var(--tb-radius-lg);
966
+ box-shadow: var(--tb-shadow-3);
967
+ animation: tb-pop 120ms var(--tb-ease);
968
+ }
969
+ .tb-calendar-head { display: flex; align-items: center; gap: var(--tb-space-2); margin-bottom: var(--tb-space-2); }
970
+ .tb-calendar-month { flex: 1; margin: 0; font-size: 1em; font-weight: 600; text-align: center; }
971
+ .tb-calendar-month::first-letter { text-transform: uppercase; }
972
+ .tb-calendar-step { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: var(--tb-radius); background: transparent; color: var(--tb-muted); cursor: pointer; }
973
+ .tb-calendar-step:hover { background: var(--tb-bg); color: var(--tb-text); }
974
+ .tb-calendar-step:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--tb-focus-ring); }
975
+ .tb-calendar-step .tb-icon { width: 18px; height: 18px; }
976
+ .tb-calendar-grid { border-collapse: collapse; }
977
+ .tb-calendar-grid th { width: 36px; height: 28px; font-size: 0.8em; font-weight: 500; color: var(--tb-muted); text-transform: uppercase; }
978
+ .tb-calendar-day { width: 36px; height: 36px; padding: 0; text-align: center; border-radius: var(--tb-radius); cursor: pointer; font-variant-numeric: tabular-nums; transition: background var(--tb-fast) var(--tb-ease); }
979
+ .tb-calendar-day:hover { background: var(--tb-bg); }
980
+ .tb-calendar-day:focus { outline: none; box-shadow: inset 0 0 0 2px var(--tb-focus); }
981
+ .tb-calendar-other { color: var(--tb-muted); }
982
+ .tb-calendar-day[aria-current="date"] { font-weight: 700; color: var(--tb-primary); }
983
+ .tb-calendar-day[aria-selected="true"] { background: var(--tb-primary); color: var(--tb-on-primary); }
984
+ .tb-calendar-day[aria-disabled="true"] { color: var(--tb-border-strong); background: transparent; cursor: default; text-decoration: line-through; }
985
+
986
+ /* menus: in the top layer, placed by the host */
987
+ .tb-lookup { display: flex; flex-wrap: wrap; align-items: center; gap: var(--tb-space-1); }
988
+ .tb-lookup .tb-input { flex: 1; min-width: 8em; width: auto; }
989
+ .tb-lookup-chosen { list-style: none; margin: 0; padding: 0; display: contents; }
990
+ .tb-lookup-chip { display: inline-flex; align-items: center; gap: var(--tb-space-1); min-height: 32px; padding: 0 var(--tb-space-1) 0 var(--tb-space-3); border: var(--tb-line) solid var(--tb-border); border-radius: var(--tb-radius); background: var(--tb-surface); }
991
+ .tb-lookup-chip:not(:has(button)) { padding-right: var(--tb-space-3); }
992
+ .tb-lookup-list {
993
+ position: fixed;
994
+ inset: auto;
995
+ margin: 0;
996
+ padding: var(--tb-space-1);
997
+ list-style: none;
998
+ max-height: 280px;
999
+ overflow-y: auto;
1000
+ color: var(--tb-text);
1001
+ background: var(--tb-raised);
1002
+ border: var(--tb-line) solid var(--tb-border);
1003
+ border-radius: var(--tb-radius-lg);
1004
+ box-shadow: var(--tb-shadow-3);
1005
+ }
1006
+ .tb-lookup-option { padding: var(--tb-space-2) var(--tb-space-3); border-radius: var(--tb-radius); cursor: pointer; }
1007
+ .tb-lookup-option:hover, .tb-lookup-option[aria-selected="true"] { background: var(--tb-primary-soft); }
1008
+ .tb-lookup-none { padding: var(--tb-space-2) var(--tb-space-3); color: var(--tb-muted); }
1009
+
1010
+ .tb-menu {
1011
+ position: fixed;
1012
+ inset: auto;
1013
+ margin: 0;
1014
+ min-width: 180px;
1015
+ max-width: min(320px, calc(100vw - 16px));
1016
+ max-height: calc(100vh - 16px);
1017
+ overflow-y: auto;
1018
+ padding: var(--tb-space-1);
1019
+ background: var(--tb-raised);
1020
+ color: var(--tb-text);
1021
+ border: var(--tb-line) solid var(--tb-border);
1022
+ border-radius: var(--tb-radius);
1023
+ box-shadow: var(--tb-shadow-3);
1024
+ animation: tb-pop 120ms var(--tb-ease);
1025
+ }
1026
+ .tb-menu-item {
1027
+ display: flex;
1028
+ align-items: center;
1029
+ gap: var(--tb-space-3);
1030
+ width: 100%;
1031
+ min-height: 36px;
1032
+ padding: 0 var(--tb-space-3);
1033
+ border: 0;
1034
+ border-radius: calc(var(--tb-radius) - 2px);
1035
+ background: transparent;
1036
+ color: inherit;
1037
+ font: inherit;
1038
+ font-size: 14px;
1039
+ text-align: left;
1040
+ cursor: pointer;
1041
+ }
1042
+ .tb-menu-item > span:not(.tb-menu-gap) { flex: 1; }
1043
+ .tb-menu-item svg { width: 16px; height: 16px; flex: none; color: var(--tb-muted); }
1044
+ .tb-menu-gap { width: 16px; flex: none; }
1045
+ .tb-menu-item:focus { outline: none; background: var(--tb-primary-soft); }
1046
+ .tb-menu-item[aria-expanded="true"] { background: var(--tb-bg); }
1047
+ .tb-menu-divider { height: 1px; margin: var(--tb-space-1) calc(-1 * var(--tb-space-1)); background: var(--tb-border); }
1048
+ @keyframes tb-pop { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }
1049
+
1050
+ /* drag and drop */
1051
+ .tb-drag-active, .tb-drag-active * { user-select: none; cursor: grabbing !important; }
1052
+ .tb-dragging { opacity: 0.4; }
1053
+ .tb-drop-zone { min-height: var(--tb-control); }
1054
+ .tb-drop-over { outline: 2px dashed var(--tb-focus-ring); outline-offset: 4px; border-radius: var(--tb-radius); }
1055
+ .tb-drop-line {
1056
+ position: fixed;
1057
+ height: 2px;
1058
+ border-radius: 1px;
1059
+ background: var(--tb-primary);
1060
+ pointer-events: none;
1061
+ z-index: 2147483647;
1062
+ }
1063
+ .tb-drop-line.tb-across { width: 2px; }
1064
+ .tb-drag-ghost {
1065
+ position: fixed;
1066
+ left: 0;
1067
+ top: 0;
1068
+ max-width: 240px;
1069
+ overflow: hidden;
1070
+ text-overflow: ellipsis;
1071
+ white-space: nowrap;
1072
+ padding: var(--tb-space-2) var(--tb-space-3);
1073
+ background: var(--tb-raised);
1074
+ color: var(--tb-text);
1075
+ border: var(--tb-line) solid var(--tb-border);
1076
+ border-radius: var(--tb-radius);
1077
+ box-shadow: var(--tb-shadow-3);
1078
+ font-size: 14px;
1079
+ font-weight: 500;
1080
+ pointer-events: none;
1081
+ z-index: 2147483647;
1082
+ }
1083
+
1084
+ /* toasts */
1085
+ .tb-toasts {
1086
+ position: fixed;
1087
+ inset: auto 0 var(--tb-space-5) 0;
1088
+ margin: 0 auto;
1089
+ width: max-content;
1090
+ max-width: calc(100vw - 32px);
1091
+ padding: 0;
1092
+ border: 0;
1093
+ background: transparent;
1094
+ overflow: visible;
1095
+ display: flex;
1096
+ flex-direction: column;
1097
+ align-items: center;
1098
+ gap: var(--tb-space-2);
1099
+ }
1100
+ .tb-toast {
1101
+ display: flex;
1102
+ align-items: center;
1103
+ gap: var(--tb-space-3);
1104
+ padding: var(--tb-space-3) var(--tb-space-5);
1105
+ min-height: var(--tb-control);
1106
+ background: var(--tb-text);
1107
+ color: var(--tb-bg);
1108
+ border-radius: var(--tb-radius);
1109
+ box-shadow: var(--tb-shadow-3);
1110
+ font-size: 14px;
1111
+ font-weight: 500;
1112
+ cursor: pointer;
1113
+ animation: tb-rise 180ms var(--tb-ease);
1114
+ }
1115
+ .tb-toast.tb-success::before, .tb-toast.tb-warning::before, .tb-toast.tb-primary::before {
1116
+ content: "";
1117
+ width: 8px;
1118
+ height: 8px;
1119
+ border-radius: 50%;
1120
+ flex: none;
1121
+ background: var(--tb-primary);
1122
+ }
1123
+ .tb-toast.tb-success::before { background: var(--tb-success); }
1124
+ .tb-toast.tb-warning::before { background: var(--tb-warning); }
1125
+ .tb-toast.tb-danger { background: var(--tb-danger); color: var(--tb-on-danger); }
1126
+
1127
+ /* under trebol dev, the errors the app does not catch */
1128
+ .tb-dev-errors {
1129
+ position: fixed;
1130
+ inset: var(--tb-space-4) var(--tb-space-4) auto;
1131
+ width: auto;
1132
+ max-width: 960px;
1133
+ max-height: calc(100vh - 2 * var(--tb-space-4));
1134
+ margin: 0 auto;
1135
+ overflow: auto;
1136
+ box-sizing: border-box;
1137
+ padding: var(--tb-space-4) var(--tb-space-5);
1138
+ border: 1px solid var(--tb-border);
1139
+ border-left: 4px solid var(--tb-danger);
1140
+ border-radius: var(--tb-radius);
1141
+ background: var(--tb-surface);
1142
+ color: var(--tb-text);
1143
+ box-shadow: var(--tb-shadow-3);
1144
+ font-family: var(--tb-font);
1145
+ }
1146
+ .tb-dev-errors header {
1147
+ display: flex;
1148
+ align-items: center;
1149
+ justify-content: space-between;
1150
+ gap: var(--tb-space-3);
1151
+ margin-bottom: var(--tb-space-3);
1152
+ font-weight: 600;
1153
+ }
1154
+ .tb-dev-errors pre {
1155
+ margin: 0 0 var(--tb-space-3);
1156
+ white-space: pre-wrap;
1157
+ overflow-wrap: anywhere;
1158
+ font: 13px/1.6 ui-monospace, Menlo, Consolas, monospace;
1159
+ }
1160
+
1161
+ /* under trebol dev, the dev tools: Faces, Console, Log */
1162
+ .tb-dev-tools {
1163
+ position: fixed;
1164
+ inset: auto 0 0 0;
1165
+ width: 100%;
1166
+ max-width: none;
1167
+ margin: 0;
1168
+ padding: 0;
1169
+ box-sizing: border-box;
1170
+ flex-direction: column;
1171
+ border: 0;
1172
+ border-top: 1px solid var(--tb-border-strong);
1173
+ background: var(--tb-surface);
1174
+ color: var(--tb-text);
1175
+ box-shadow: var(--tb-shadow-3);
1176
+ font: 13px/1.5 var(--tb-font);
1177
+ }
1178
+ .tb-dev-tools:popover-open { display: flex; }
1179
+ .tb-dev-tools :is(pre, code, .tb-dev-in, .tb-dev-node, .tb-dev-detail dd, .tb-dev-text) {
1180
+ font-family: ui-monospace, Menlo, Consolas, monospace;
1181
+ font-size: 12px;
1182
+ }
1183
+ .tb-dev-grip { height: 6px; margin-top: -3px; cursor: ns-resize; flex: none; touch-action: none; }
1184
+ .tb-dev-tools header {
1185
+ display: flex;
1186
+ align-items: center;
1187
+ gap: var(--tb-space-2);
1188
+ padding: 0 var(--tb-space-3) 0 0;
1189
+ border-bottom: 1px solid var(--tb-border);
1190
+ flex: none;
1191
+ }
1192
+ .tb-dev-tabs { display: flex; }
1193
+ .tb-dev-space { flex: 1; }
1194
+ .tb-dev-tab, .tb-dev-button, .tb-dev-node, .tb-dev-opener {
1195
+ font: inherit;
1196
+ color: inherit;
1197
+ cursor: pointer;
1198
+ }
1199
+ .tb-dev-tab {
1200
+ padding: var(--tb-space-2) var(--tb-space-4);
1201
+ border: 0;
1202
+ border-bottom: 2px solid transparent;
1203
+ background: transparent;
1204
+ color: var(--tb-muted);
1205
+ }
1206
+ .tb-dev-tab[aria-selected="true"] { color: var(--tb-text); border-bottom-color: var(--tb-primary); font-weight: 600; }
1207
+ .tb-dev-button {
1208
+ padding: 2px var(--tb-space-3);
1209
+ border: 1px solid var(--tb-border-strong);
1210
+ border-radius: var(--tb-radius);
1211
+ background: var(--tb-bg);
1212
+ }
1213
+ .tb-dev-button[aria-pressed="true"] { background: var(--tb-primary); color: var(--tb-on-primary); border-color: var(--tb-primary); }
1214
+ .tb-dev-tools :is(button, a, textarea):focus-visible { outline: 2px solid var(--tb-focus); outline-offset: -2px; }
1215
+ .tb-dev-body { flex: 1; min-height: 0; display: flex; }
1216
+ .tb-dev-pane { flex: 1; min-width: 0; min-height: 0; }
1217
+ .tb-dev-pane[hidden] { display: none; }
1218
+ .tb-dev-faces { display: grid; grid-template-columns: minmax(200px, 2fr) 3fr; }
1219
+ .tb-dev-tree { overflow: auto; border-right: 1px solid var(--tb-border); padding: var(--tb-space-1) 0; }
1220
+ .tb-dev-node {
1221
+ display: block;
1222
+ width: 100%;
1223
+ padding: 1px var(--tb-space-2);
1224
+ border: 0;
1225
+ background: transparent;
1226
+ text-align: left;
1227
+ white-space: nowrap;
1228
+ overflow: hidden;
1229
+ text-overflow: ellipsis;
1230
+ }
1231
+ .tb-dev-node:hover { background: var(--tb-primary-soft); }
1232
+ .tb-dev-node[aria-current="true"] { background: var(--tb-primary); color: var(--tb-on-primary); }
1233
+ .tb-dev-unseen { color: var(--tb-muted); }
1234
+ .tb-dev-detail { overflow: auto; padding: var(--tb-space-3) var(--tb-space-4); }
1235
+ .tb-dev-detail h3 { margin: 0 0 var(--tb-space-1); font-size: 14px; }
1236
+ .tb-dev-detail dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px var(--tb-space-4); margin: var(--tb-space-3) 0 0; }
1237
+ .tb-dev-detail dt { color: var(--tb-muted); }
1238
+ .tb-dev-detail dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
1239
+ .tb-dev-place { margin: 0; }
1240
+ .tb-dev-place a { color: var(--tb-primary); }
1241
+ .tb-dev-hint { margin: 0; color: var(--tb-muted); }
1242
+ .tb-dev-console { display: flex; flex-direction: column; }
1243
+ .tb-dev-out { flex: 1; overflow: auto; padding: var(--tb-space-2) var(--tb-space-3); }
1244
+ .tb-dev-out pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
1245
+ .tb-dev-said-in { color: var(--tb-muted); }
1246
+ .tb-dev-said-error { color: var(--tb-danger); }
1247
+ .tb-dev-face { padding: 2px var(--tb-space-3); color: var(--tb-muted); border-top: 1px solid var(--tb-border); }
1248
+ .tb-dev-prompt { display: flex; align-items: flex-start; gap: var(--tb-space-2); padding: var(--tb-space-1) var(--tb-space-3) var(--tb-space-2); }
1249
+ .tb-dev-sign { font: 12px/20px ui-monospace, Menlo, Consolas, monospace; color: var(--tb-primary); }
1250
+ textarea.tb-dev-in { flex: 1; resize: none; border: 0; padding: 0; background: transparent; color: var(--tb-text); line-height: 20px; outline: none; }
1251
+ .tb-dev-log { display: flex; flex-direction: column; }
1252
+ .tb-dev-bar { display: flex; justify-content: flex-end; padding: var(--tb-space-1) var(--tb-space-3); flex: none; }
1253
+ ol.tb-dev-entries { flex: 1; margin: 0; overflow: auto; list-style: none; padding: 0 var(--tb-space-3) var(--tb-space-2); }
1254
+ ol.tb-dev-entries li { display: grid; grid-template-columns: max-content 5.5em 1fr; gap: var(--tb-space-3); padding: 1px 0; border-bottom: 1px solid var(--tb-border); }
1255
+ ol.tb-dev-entries time { color: var(--tb-muted); font-variant-numeric: tabular-nums; }
1256
+ .tb-dev-kind { color: var(--tb-muted); }
1257
+ ol.tb-dev-entries .tb-dev-text { overflow-wrap: anywhere; }
1258
+ ol.tb-dev-entries :is(.tb-dev-error, .tb-dev-failed) .tb-dev-kind, ol.tb-dev-entries :is(.tb-dev-error, .tb-dev-failed) .tb-dev-text { color: var(--tb-danger); }
1259
+ ol.tb-dev-entries .tb-dev-warning .tb-dev-kind { color: var(--tb-warning); }
1260
+ .tb-dev-opener {
1261
+ position: fixed;
1262
+ inset: auto var(--tb-space-3) var(--tb-space-3) auto;
1263
+ margin: 0;
1264
+ padding: 2px var(--tb-space-3);
1265
+ border: 1px solid var(--tb-border-strong);
1266
+ border-radius: 999px;
1267
+ background: var(--tb-surface);
1268
+ box-shadow: var(--tb-shadow-1);
1269
+ font: 600 12px/1.6 var(--tb-font);
1270
+ opacity: 0.7;
1271
+ }
1272
+ .tb-dev-opener:hover, .tb-dev-opener:focus-visible { opacity: 1; }
1273
+ .tb-dev-outline {
1274
+ position: fixed;
1275
+ margin: 0;
1276
+ padding: 0;
1277
+ box-sizing: border-box;
1278
+ border: 2px solid var(--tb-primary);
1279
+ border-radius: 2px;
1280
+ background: transparent;
1281
+ pointer-events: none;
1282
+ }
1283
+ .tb-dev-outline.tb-dev-pointed { border-style: dashed; background: color-mix(in srgb, var(--tb-primary) 12%, transparent); }
1284
+ .tb-dev-picking, .tb-dev-picking * { cursor: crosshair !important; }
1285
+ @media (max-width: 640px) {
1286
+ .tb-dev-faces { grid-template-columns: 1fr; grid-template-rows: 2fr 3fr; }
1287
+ .tb-dev-tree { border-right: 0; border-bottom: 1px solid var(--tb-border); }
1288
+ ol.tb-dev-entries li { grid-template-columns: max-content 1fr; }
1289
+ ol.tb-dev-entries time { display: none; }
1290
+ }
1291
+
1292
+ @media (max-width: 640px) {
1293
+ .tb-wide-only { display: none !important; }
1294
+ .tb-view:has(.tb-fit) { height: auto; }
1295
+ .tb-fit > * { overflow: visible; }
1296
+ .tb-split { display: block; }
1297
+ .tb-split-handle { display: none; }
1298
+ .tb-split[data-pane="1"] > .tb-split-pane:last-child, .tb-split[data-pane="2"] > .tb-split-pane:first-child { display: none; }
1299
+ .tb-split-back { display: inline-flex; align-self: flex-start; padding: 0 var(--tb-space-3); border: 0; background: transparent; color: var(--tb-primary); }
1300
+ .tb-view { padding: var(--tb-space-5) var(--tb-space-4); }
1301
+ .tb-form { grid-template-columns: minmax(0, 1fr); }
1302
+ :is(.tb-form, .tb-form > .tb-panel, .tb-form > .tb-panel > .tb-panel) > .tb-field { display: flex; }
1303
+ :is(.tb-form, .tb-form > .tb-panel, .tb-form > .tb-panel > .tb-panel) > .tb-field > .tb-label, :is(.tb-form, .tb-form > .tb-panel, .tb-form > .tb-panel > .tb-panel) > .tb-field > .tb-control,
1304
+ :is(.tb-form, .tb-form > .tb-panel, .tb-form > .tb-panel > .tb-panel) > .tb-actions, :is(.tb-form, .tb-form > .tb-panel, .tb-form > .tb-panel > .tb-panel) > .tb-check-row { grid-column: 1; padding-top: 0; }
1305
+ .tb-row:has(> .tb-field) { flex-direction: column; align-items: stretch; }
1306
+ .tb-row:has(> .tb-field) > :is(.tb-text, .tb-heading) { margin-bottom: 0; }
1307
+ .tb-entry { flex-direction: column; align-items: stretch; padding: var(--tb-space-3); border: var(--tb-line) solid var(--tb-border); border-radius: var(--tb-radius); }
1308
+ .tb-entry > * { flex: none; }
1309
+ .tb-entry:not(:first-child) .tb-field > .tb-label { position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; }
1310
+ .tb-entry > .tb-button, .tb-entry:first-child:has(.tb-label:not(:empty)) > .tb-button { align-self: flex-end; margin-top: 0; }
1311
+ .tb-grid { grid-template-columns: minmax(0, 1fr); }
1312
+ .tb-actions > .tb-button { flex: 1 1 auto; }
1313
+ .tb-table-wrap { overflow: visible; background: none; border: 0; box-shadow: none; }
1314
+ .tb-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
1315
+ .tb-table, .tb-table tbody, .tb-table tfoot, .tb-table tr, .tb-table td { display: block; }
1316
+ .tb-table tfoot { margin-top: var(--tb-space-3); }
1317
+ .tb-table tfoot tr { background: var(--tb-bg); }
1318
+ .tb-table tfoot td { background: none; }
1319
+ .tb-table tfoot td:empty { display: none; }
1320
+ .tb-table tbody { display: flex; flex-direction: column; gap: var(--tb-space-3); }
1321
+ .tb-table tr {
1322
+ padding: var(--tb-space-3) var(--tb-space-4);
1323
+ background: var(--tb-surface);
1324
+ border: var(--tb-line) solid var(--tb-border);
1325
+ border-radius: var(--tb-radius-lg);
1326
+ box-shadow: var(--tb-shadow-1);
1327
+ }
1328
+ .tb-table td, .tb-table tbody tr:last-child td, .tb-table tfoot td {
1329
+ display: flex;
1330
+ justify-content: space-between;
1331
+ gap: var(--tb-space-4);
1332
+ height: auto;
1333
+ padding: var(--tb-space-1) 0;
1334
+ border: 0;
1335
+ text-align: right;
1336
+ }
1337
+ .tb-table td::before { content: attr(data-label); color: var(--tb-muted); font-weight: 500; text-align: left; }
1338
+ .tb-table td.tb-thumb-cell { width: auto; justify-content: flex-start; }
1339
+ .tb-table td.tb-thumb-cell::before { content: none; }
1340
+ .tb-table tr.tb-group-head { padding: var(--tb-space-3) 0 0; background: none; border: 0; box-shadow: none; }
1341
+ .tb-table .tb-group-head > th, .tb-table .tb-group-head.tb-level-2 > th { display: block; padding: 0; background: none; border: 0; }
1342
+ .tb-table .tb-level-2 > :first-child { padding-left: 0; }
1343
+ .tb-table tr.tb-group-head.tb-level-2, .tb-table tr.tb-group-foot.tb-level-2 { margin-left: var(--tb-space-4); }
1344
+ .tb-table tr.tb-group-foot { background: var(--tb-bg); }
1345
+ .tb-table .tb-group-foot > td { background: none; }
1346
+ .tb-table .tb-group-foot > td:empty { display: none; }
1347
+ .tb-toolbar > .tb-button.tb-has-icon { padding: 0; width: var(--tb-control); }
1348
+ .tb-toolbar > .tb-button.tb-has-icon > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
1349
+ .tb-crumb-middle { display: none !important; }
1350
+ .tb-crumb-more { display: inline-flex !important; }
1351
+ .tb-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
1352
+ .tb-dialog.tb-confirm { width: calc(100vw - 32px); height: fit-content; max-height: calc(100dvh - 32px); margin: auto; border-radius: var(--tb-radius-lg); }
1353
+ }
1354
+ @media print {
1355
+ .tb-toasts, .tb-dialog:not([open]) { display: none !important; }
1356
+ /* print-page/only: the face alone, at the top of the page, with what holds it out of sight */
1357
+ .tb-print-only body * { visibility: hidden; }
1358
+ .tb-print-only .tb-print-target, .tb-print-only .tb-print-target * { visibility: visible; }
1359
+ .tb-print-only .tb-print-target { position: absolute; inset: 0 0 auto 0; margin: 0; box-shadow: none; }
1360
+ }
1361
+ @media (pointer: coarse) { :root { --tb-control: 44px; } }
1362
+ @media (prefers-reduced-motion: reduce) {
1363
+ * { transition: none !important; animation: none !important; }
1364
+ .tb-indeterminate .tb-progress-bar { width: 100%; opacity: 0.35; }
1365
+ }
1366
+ `;
1367
+ /** What a skin changes on top of the component rules: '' for the modern one. */
1368
+ const SKINS = {
1369
+ modern: '',
1370
+ classic: String.raw `
1371
+ /* classic: controls in relief on a grey window, sunken wells for what is typed, title bars on dialogs */
1372
+ :root {
1373
+ --tb-raise: inset 1px 1px 0 var(--tb-bevel-hi), inset -1px -1px 0 var(--tb-bevel-lo);
1374
+ --tb-sink: inset 1px 1px 0 var(--tb-bevel-lo), inset -1px -1px 0 var(--tb-bevel-hi);
1375
+ --tb-drop: 3px 3px 0 color-mix(in oklch, var(--tb-bevel-lo) 60%, transparent);
1376
+ --tb-ring: 0 0 0 2px var(--tb-focus);
1377
+ --tb-face: linear-gradient(var(--tb-face-hi), var(--tb-face-lo));
1378
+ }
1379
+ body { font-size: 14px; -webkit-font-smoothing: auto; }
1380
+ .tb-title { font-weight: 700; letter-spacing: 0; color: var(--tb-primary); text-shadow: 1px 1px 0 var(--tb-bevel-hi); }
1381
+ .tb-heading, .tb-panel > .tb-panel-title, .tb-dialog-title { font-weight: 700; letter-spacing: 0; }
1382
+ .tb-label { font-weight: 700; font-size: 13px; }
1383
+ .tb-divider { border-top: 1px solid var(--tb-bevel-lo); border-bottom: 1px solid var(--tb-bevel-hi); }
1384
+
1385
+ .tb-panel { border: 1px solid var(--tb-border-strong); border-radius: var(--tb-radius); box-shadow: var(--tb-raise); padding: var(--tb-space-5); }
1386
+ .tb-panel.tb-primary { box-shadow: var(--tb-raise); }
1387
+ .tb-panel:focus-visible, .tb-panel.tb-primary:focus-visible { box-shadow: var(--tb-raise), var(--tb-ring); }
1388
+ .tb-tile:hover { background: var(--tb-face); border-color: var(--tb-border-strong); box-shadow: var(--tb-raise); }
1389
+
1390
+ /* buttons: a face lit from the top left; pressed, it sinks */
1391
+ .tb-button { font-size: 13px; font-weight: 700; padding: 0 var(--tb-space-4); border: 1px solid var(--tb-border-strong); background: var(--tb-face); box-shadow: var(--tb-raise); transition: none; }
1392
+ .tb-button:hover { background: linear-gradient(var(--tb-bevel-hi), var(--tb-face-hi)); border-color: var(--tb-border-strong); }
1393
+ .tb-button:active:not(:disabled, [aria-disabled="true"]) { background: linear-gradient(var(--tb-face-lo), var(--tb-face-hi)); box-shadow: var(--tb-sink); }
1394
+ .tb-button:focus-visible { box-shadow: var(--tb-raise), var(--tb-ring); }
1395
+ .tb-button:disabled, .tb-button[aria-disabled="true"] { box-shadow: var(--tb-raise); }
1396
+ .tb-button.tb-primary { --tb-tint: var(--tb-primary); }
1397
+ .tb-button.tb-accent { --tb-tint: var(--tb-accent); }
1398
+ .tb-button.tb-danger { --tb-tint: var(--tb-danger); }
1399
+ .tb-button:is(.tb-primary, .tb-accent, .tb-danger), .tb-button:is(.tb-primary, .tb-accent, .tb-danger):hover, .tb-button.tb-primary[aria-disabled="true"]:hover {
1400
+ background: linear-gradient(color-mix(in oklch, var(--tb-tint) 85%, var(--tb-bevel-hi)), var(--tb-tint));
1401
+ border-color: color-mix(in oklch, var(--tb-tint) 50%, var(--tb-border-strong));
1402
+ box-shadow: inset 1px 1px 0 color-mix(in oklch, var(--tb-bevel-hi) 45%, transparent), inset -1px -1px 0 color-mix(in oklch, var(--tb-bevel-lo) 60%, transparent);
1403
+ }
1404
+ .tb-button:is(.tb-primary, .tb-accent, .tb-danger):hover:not(:disabled, [aria-disabled="true"]) { filter: brightness(1.08); }
1405
+ .tb-button:is(.tb-primary, .tb-accent, .tb-danger):active:not(:disabled, [aria-disabled="true"]) { background: var(--tb-tint); box-shadow: inset 1px 1px 0 color-mix(in oklch, var(--tb-bevel-lo) 60%, transparent); }
1406
+ .tb-button:is(.tb-primary, .tb-accent, .tb-danger):focus-visible { box-shadow: var(--tb-raise), var(--tb-ring); }
1407
+ .tb-toolbar { background: var(--tb-face); border: 1px solid var(--tb-border-strong); border-radius: var(--tb-radius); box-shadow: var(--tb-raise); }
1408
+ .tb-toolbar > .tb-button:not(.tb-primary, .tb-accent, .tb-danger) { box-shadow: none; }
1409
+ .tb-toolbar > .tb-button:not(.tb-primary, .tb-accent, .tb-danger):hover { background: var(--tb-face); border-color: var(--tb-border-strong); box-shadow: var(--tb-raise); }
1410
+ .tb-toolbar > .tb-button:not(.tb-primary, .tb-accent, .tb-danger):focus-visible { box-shadow: var(--tb-ring); }
1411
+ .tb-toolbar > .tb-divider { border-left-color: var(--tb-bevel-lo); border-right: 1px solid var(--tb-bevel-hi); border-bottom: 0; }
1412
+ .tb-rich-tool:hover { background: var(--tb-face); box-shadow: var(--tb-raise); color: var(--tb-text); }
1413
+
1414
+ /* what is typed sits in a sunken well; a choice is a button that drops a list */
1415
+ .tb-input { border: 1px solid var(--tb-border-strong); box-shadow: var(--tb-sink); transition: none; }
1416
+ .tb-input:focus, .tb-rich-box:focus { border-color: var(--tb-focus); box-shadow: var(--tb-sink), 0 0 0 1px var(--tb-focus); }
1417
+ .tb-invalid .tb-input:focus { box-shadow: var(--tb-sink), 0 0 0 1px var(--tb-danger); }
1418
+ .tb-input[readonly], .tb-input.tb-rich-box[aria-readonly="true"] { background: var(--tb-bg); border-color: var(--tb-border); box-shadow: none; color: var(--tb-text); }
1419
+ select.tb-input {
1420
+ font-weight: 700;
1421
+ font-size: 13px;
1422
+ background-image: linear-gradient(45deg, transparent 50%, var(--tb-text) 50%), linear-gradient(135deg, var(--tb-text) 50%, transparent 50%), var(--tb-face);
1423
+ background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%, 0 0;
1424
+ background-size: 5px 5px, 5px 5px, 100% 100%;
1425
+ box-shadow: var(--tb-raise);
1426
+ }
1427
+ select.tb-input:focus { box-shadow: var(--tb-raise), var(--tb-ring); }
1428
+ .tb-switch input, .tb-switch input:focus-visible { border-radius: var(--tb-radius); box-shadow: var(--tb-sink); }
1429
+ .tb-switch input:focus-visible { box-shadow: var(--tb-sink), var(--tb-ring); }
1430
+ .tb-switch input::before { border-radius: var(--tb-radius); background: var(--tb-face); box-shadow: var(--tb-raise), 0 0 0 1px var(--tb-border-strong); }
1431
+ .tb-upload { box-shadow: var(--tb-sink); }
1432
+ .tb-date-button { top: 1px; right: 1px; bottom: 1px; width: calc(var(--tb-control) - 2px); border-left: 1px solid var(--tb-border-strong); border-radius: 0; background: var(--tb-face); box-shadow: var(--tb-raise); color: var(--tb-text); }
1433
+ .tb-scroll { background: var(--tb-surface); border-color: var(--tb-border-strong); box-shadow: var(--tb-sink); }
1434
+ .tb-scroll:focus-visible { box-shadow: var(--tb-sink), var(--tb-ring); }
1435
+
1436
+ /* progress: a sunken trough filled with blocks */
1437
+ .tb-progress { height: 18px; padding: 2px; border: 1px solid var(--tb-border-strong); border-radius: var(--tb-radius); background: var(--tb-surface); box-shadow: var(--tb-sink); }
1438
+ .tb-progress-bar { --tb-bar: var(--tb-primary); border-radius: 0; background: repeating-linear-gradient(90deg, var(--tb-bar) 0 10px, transparent 10px 12px); }
1439
+ .tb-success .tb-progress-bar { --tb-bar: var(--tb-success); background: repeating-linear-gradient(90deg, var(--tb-bar) 0 10px, transparent 10px 12px); }
1440
+ .tb-warning .tb-progress-bar { --tb-bar: var(--tb-warning); background: repeating-linear-gradient(90deg, var(--tb-bar) 0 10px, transparent 10px 12px); }
1441
+ .tb-danger .tb-progress-bar { --tb-bar: var(--tb-danger); background: repeating-linear-gradient(90deg, var(--tb-bar) 0 10px, transparent 10px 12px); }
1442
+ .tb-accent .tb-progress-bar { --tb-bar: var(--tb-accent); background: repeating-linear-gradient(90deg, var(--tb-bar) 0 10px, transparent 10px 12px); }
1443
+
1444
+ /* tables and lists: a sunken frame, buttons for headers, what is chosen in the primary color */
1445
+ .tb-table-wrap, .tb-list { border: 1px solid; border-color: var(--tb-bevel-lo) var(--tb-bevel-hi) var(--tb-bevel-hi) var(--tb-bevel-lo); border-radius: var(--tb-radius); box-shadow: none; }
1446
+ .tb-table th { color: var(--tb-text); font-weight: 700; padding: var(--tb-space-2) var(--tb-space-3); background: var(--tb-face); border-bottom: 1px solid var(--tb-border-strong); box-shadow: var(--tb-raise); }
1447
+ .tb-sort { padding: var(--tb-space-2) var(--tb-space-3); }
1448
+ .tb-table tfoot td { background: var(--tb-bg); border-top-color: var(--tb-border-strong); }
1449
+ @media (min-width: 641px) {
1450
+ .tb-table td { padding: var(--tb-space-2) var(--tb-space-3); border-right: 1px solid var(--tb-border); }
1451
+ .tb-table th { border-right: 1px solid var(--tb-border-strong); }
1452
+ .tb-table tr > :last-child { border-right: 0; }
1453
+ }
1454
+ .tb-selectable :is(tbody > tr, .tb-list > li).tb-selected, .tb-tree li.tb-selected > .tb-tree-row { background: var(--tb-primary); color: var(--tb-on-primary); }
1455
+ .tb-list > li.tb-selected .tb-list-secondary, .tb-tree li.tb-selected > .tb-tree-row .tb-tree-toggle { color: inherit; }
1456
+ .tb-selectable tbody tr.tb-selected:focus-visible, .tb-selectable .tb-list > li.tb-selected:focus-visible { box-shadow: inset 0 0 0 2px var(--tb-focus), inset 0 0 0 3px var(--tb-on-primary); }
1457
+ .tb-tree-row { border-radius: 0; }
1458
+
1459
+ /* tabs: raised tabs on a line; the chosen one is taller and opens onto what it shows */
1460
+ .tb-tablist { gap: 2px; padding: 0 var(--tb-space-2); box-shadow: inset 0 -1px 0 var(--tb-border-strong); }
1461
+ .tb-tab { font-size: 13px; font-weight: 700; min-height: calc(var(--tb-control) - 4px); margin-top: 4px; border: 1px solid var(--tb-border-strong); border-bottom: 0; border-radius: var(--tb-radius) var(--tb-radius) 0 0; background: var(--tb-face); color: var(--tb-muted); box-shadow: inset 1px 1px 0 var(--tb-bevel-hi); }
1462
+ .tb-tab[aria-selected="true"] { margin-top: 0; min-height: var(--tb-control); background: var(--tb-bg); color: var(--tb-text); }
1463
+
1464
+ /* what floats: raised, with a hard shadow; the item under the pointer or the keys in the primary color */
1465
+ .tb-menu, .tb-lookup-list, .tb-calendar { border: 1px solid var(--tb-border-strong); border-radius: var(--tb-radius); box-shadow: var(--tb-raise), var(--tb-drop); animation: none; }
1466
+ .tb-menu-item, .tb-lookup-option { border-radius: 0; }
1467
+ .tb-menu-item:focus, .tb-lookup-option:hover, .tb-lookup-option[aria-selected="true"] { background: var(--tb-primary); color: var(--tb-on-primary); }
1468
+ .tb-menu-item:focus svg { color: inherit; }
1469
+ .tb-menu-divider { background: var(--tb-bevel-lo); box-shadow: 0 1px 0 var(--tb-bevel-hi); }
1470
+ .tb-calendar-step, .tb-upload-remove { background: var(--tb-face); border: 1px solid var(--tb-border-strong); box-shadow: var(--tb-raise); color: var(--tb-text); }
1471
+ .tb-toast { background: var(--tb-raised); color: var(--tb-text); border: 1px solid var(--tb-border-strong); border-radius: var(--tb-radius); box-shadow: var(--tb-raise), var(--tb-drop); font-weight: 700; }
1472
+ .tb-drag-ghost { border-color: var(--tb-border-strong); box-shadow: var(--tb-raise), var(--tb-drop); }
1473
+
1474
+ /* dialogs: a window with a title bar */
1475
+ .tb-dialog { border: 1px solid var(--tb-border-strong); border-radius: var(--tb-radius); box-shadow: var(--tb-raise), var(--tb-drop); animation: none; }
1476
+ .tb-dialog-head { margin: 3px 3px 0; padding: var(--tb-space-1) var(--tb-space-1) var(--tb-space-1) var(--tb-space-4); background: linear-gradient(90deg, var(--tb-primary), color-mix(in oklch, var(--tb-primary) 60%, var(--tb-bevel-hi))); color: var(--tb-on-primary); }
1477
+ .tb-dialog-title { font-size: 14px; }
1478
+ .tb-dialog-close, .tb-dialog-close:hover { width: 24px; height: 24px; font-size: 16px; border: 1px solid var(--tb-border-strong); background: var(--tb-face); color: var(--tb-text); box-shadow: var(--tb-raise); }
1479
+ .tb-dialog-close:focus-visible { box-shadow: var(--tb-raise), var(--tb-ring); }
1480
+ .tb-dialog-body { padding-top: var(--tb-space-5); }
1481
+ `,
1482
+ cupertino: String.raw `
1483
+ /* cupertino: recalls the Mac: small controls on a light window, labels to the right, segmented tabs, translucent menus */
1484
+ body { font-size: 13px; }
1485
+ .tb-title { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
1486
+ .tb-heading { font-size: 17px; font-weight: 700; }
1487
+ .tb-panel { border-radius: 10px; border-color: var(--tb-border); box-shadow: none; padding: var(--tb-space-5); }
1488
+ .tb-panel > .tb-panel-title { font-size: 13px; font-weight: 700; }
1489
+ .tb-label { font-size: 13px; font-weight: 400; }
1490
+ :is(.tb-form, .tb-form > .tb-panel, .tb-form > .tb-panel > .tb-panel) > .tb-field > .tb-label { text-align: right; }
1491
+ @container (max-width: 420px) { :is(.tb-form, .tb-form > .tb-panel, .tb-form > .tb-panel > .tb-panel) > .tb-field > .tb-label { text-align: left; } }
1492
+ .tb-button { font-size: 13px; font-weight: 400; padding: 0 var(--tb-space-4); border: 0; border-radius: 6px; background: var(--tb-surface); box-shadow: 0 0 0 1px var(--tb-border), var(--tb-shadow-1); }
1493
+ .tb-button:hover { background: var(--tb-surface); }
1494
+ .tb-button:active:not(:disabled, [aria-disabled="true"]) { background: var(--tb-border); }
1495
+ .tb-button:focus-visible { box-shadow: 0 0 0 1px var(--tb-border), 0 0 0 4px var(--tb-focus-ring); }
1496
+ .tb-button.tb-primary, .tb-button.tb-primary:hover, .tb-button.tb-primary[aria-disabled="true"]:hover { background: linear-gradient(color-mix(in oklch, var(--tb-primary) 85%, var(--tb-on-primary)), var(--tb-primary)); box-shadow: var(--tb-shadow-1); }
1497
+ .tb-button.tb-primary:active:not(:disabled, [aria-disabled="true"]) { background: var(--tb-primary-hover); }
1498
+ .tb-button.tb-primary:focus-visible { box-shadow: 0 0 0 4px var(--tb-focus-ring); }
1499
+ .tb-toolbar { background: transparent; border: 0; padding: 0; }
1500
+ .tb-toolbar > .tb-button:not(.tb-primary, .tb-accent, .tb-danger) { box-shadow: none; }
1501
+ .tb-toolbar > .tb-button:not(.tb-primary, .tb-accent, .tb-danger):hover { background: var(--tb-border); }
1502
+ .tb-toolbar > .tb-button:not(.tb-primary, .tb-accent, .tb-danger):focus-visible { box-shadow: 0 0 0 3px var(--tb-focus-ring); }
1503
+ .tb-input { border-radius: 5px; border-color: var(--tb-border-strong); }
1504
+ /* a choice is a pop-up button: the arrow in a small square of the primary color */
1505
+ select.tb-input {
1506
+ border: 0;
1507
+ border-radius: 6px;
1508
+ box-shadow: 0 0 0 1px var(--tb-border), var(--tb-shadow-1);
1509
+ background-image: linear-gradient(45deg, transparent 50%, var(--tb-on-primary) 50%), linear-gradient(135deg, var(--tb-on-primary) 50%, transparent 50%), linear-gradient(var(--tb-primary), var(--tb-primary));
1510
+ background-position: calc(100% - 15px) 45%, calc(100% - 11px) 45%, calc(100% - 4px) 50%;
1511
+ background-size: 4px 4px, 4px 4px, 20px calc(100% - 8px);
1512
+ padding-right: 34px;
1513
+ }
1514
+ select.tb-input:focus { box-shadow: 0 0 0 1px var(--tb-border), 0 0 0 4px var(--tb-focus-ring); }
1515
+ .tb-tablist { align-self: center; gap: 0; padding: 2px; border-radius: 7px; background: var(--tb-border); box-shadow: none; }
1516
+ .tb-tab { min-height: 24px; padding: 0 var(--tb-space-4); border: 0; border-radius: 5px; font-size: 13px; font-weight: 400; color: var(--tb-text); }
1517
+ .tb-tab[aria-selected="true"] { background: var(--tb-segment); color: var(--tb-text); box-shadow: var(--tb-shadow-1); }
1518
+ .tb-tab:focus-visible { box-shadow: 0 0 0 3px var(--tb-focus-ring); border-radius: 5px; }
1519
+ .tb-table-wrap { border-radius: 8px; box-shadow: none; }
1520
+ .tb-table th { background: var(--tb-surface); color: var(--tb-text); font-size: 12px; font-weight: 400; padding: 6px var(--tb-space-3); }
1521
+ .tb-sort { padding: 6px var(--tb-space-3); }
1522
+ @media (min-width: 641px) {
1523
+ .tb-table th:not(:last-child) { box-shadow: inset -1px 0 0 var(--tb-border); }
1524
+ .tb-table td { height: auto; padding: 6px var(--tb-space-3); border-bottom: 0; }
1525
+ .tb-table tbody tr:nth-child(even) { background: var(--tb-bg); }
1526
+ }
1527
+ .tb-list { padding: 4px; box-shadow: none; }
1528
+ .tb-list > li { border-bottom: 0; border-radius: 6px; }
1529
+ .tb-selectable :is(tbody > tr, .tb-list > li).tb-selected, .tb-tree li.tb-selected > .tb-tree-row { background: var(--tb-primary); color: var(--tb-on-primary); }
1530
+ .tb-list > li.tb-selected .tb-list-secondary, .tb-tree li.tb-selected > .tb-tree-row .tb-tree-toggle { color: inherit; }
1531
+ .tb-tree-row { border-radius: 6px; }
1532
+ .tb-menu, .tb-lookup-list { padding: 5px; border-radius: 8px; background: color-mix(in oklch, var(--tb-raised) 82%, transparent); -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6); animation: none; }
1533
+ .tb-menu-item { min-height: 24px; border-radius: 5px; font-size: 13px; }
1534
+ .tb-menu-item:focus, .tb-lookup-option:hover, .tb-lookup-option[aria-selected="true"] { background: var(--tb-primary); color: var(--tb-on-primary); }
1535
+ .tb-menu-item:focus svg { color: inherit; }
1536
+ .tb-calendar { border-radius: 10px; }
1537
+ /* dialogs: a sheet with its title centred, closed by a red dot on the left */
1538
+ .tb-dialog { border: 1px solid var(--tb-border); border-radius: 12px; }
1539
+ .tb-dialog-head { position: relative; justify-content: center; padding: var(--tb-space-3) var(--tb-space-6) 0; }
1540
+ .tb-dialog-title { font-size: 13px; font-weight: 700; }
1541
+ .tb-dialog-close, .tb-dialog-close:hover { position: absolute; left: 12px; top: 12px; width: 14px; height: 14px; border-radius: 50%; background: var(--tb-danger); color: transparent; font-size: 12px; line-height: 14px; }
1542
+ .tb-dialog-close:hover { color: var(--tb-on-danger); }
1543
+ .tb-toast { border-radius: 10px; background: color-mix(in oklch, var(--tb-text) 80%, transparent); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
1544
+ .tb-scroll { border-radius: 8px; background: var(--tb-surface); }
1545
+ `,
1546
+ fusion: String.raw `
1547
+ /* fusion: recalls Qt: group boxes with their title on the frame, buttons with a gentle gradient, tab widgets in a frame */
1548
+ .tb-title { font-size: 24px; font-weight: 600; letter-spacing: 0; }
1549
+ .tb-heading { font-size: 18px; font-weight: 600; letter-spacing: 0; }
1550
+ .tb-label { font-weight: 400; }
1551
+ .tb-panel { position: relative; margin-top: var(--tb-space-2); padding: var(--tb-space-5) var(--tb-space-4) var(--tb-space-4); background: transparent; border: 1px solid var(--tb-border-strong); border-radius: 3px; box-shadow: none; }
1552
+ .tb-panel > .tb-panel-title { position: absolute; top: 0; left: var(--tb-space-3); transform: translateY(-50%); padding: 0 var(--tb-space-1); background: var(--tb-bg); font-size: 14px; font-weight: 600; line-height: 1.2; }
1553
+ .tb-dialog .tb-panel > .tb-panel-title { background: var(--tb-raised); }
1554
+ .tb-button { font-weight: 400; padding: 0 var(--tb-space-4); border: 1px solid var(--tb-border-strong); border-radius: 3px; background: linear-gradient(var(--tb-face-hi), var(--tb-face-lo)); box-shadow: none; transition: none; }
1555
+ .tb-button:hover { background: linear-gradient(var(--tb-face-hi), var(--tb-face-hi)); border-color: var(--tb-border-strong); }
1556
+ .tb-button:active:not(:disabled, [aria-disabled="true"]) { background: var(--tb-face-lo); box-shadow: inset 0 1px 2px var(--tb-border-strong); }
1557
+ .tb-button:focus-visible { border-color: var(--tb-focus); box-shadow: 0 0 0 2px var(--tb-focus-ring); }
1558
+ /* the default button is framed in the primary color; danger and accent color their text */
1559
+ .tb-button.tb-primary, .tb-button.tb-primary:hover, .tb-button.tb-primary[aria-disabled="true"]:hover { background: linear-gradient(color-mix(in oklch, var(--tb-primary) 12%, var(--tb-face-hi)), color-mix(in oklch, var(--tb-primary) 22%, var(--tb-face-lo))); border-color: var(--tb-primary); color: var(--tb-text); font-weight: 600; box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--tb-primary) 35%, transparent); }
1560
+ .tb-button.tb-primary:hover:not(:disabled, [aria-disabled="true"]) { background: linear-gradient(color-mix(in oklch, var(--tb-primary) 8%, var(--tb-face-hi)), color-mix(in oklch, var(--tb-primary) 14%, var(--tb-face-hi))); }
1561
+ .tb-button.tb-primary:focus-visible { box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--tb-primary) 35%, transparent), 0 0 0 2px var(--tb-focus-ring); }
1562
+ .tb-button.tb-danger, .tb-button.tb-accent { background: linear-gradient(var(--tb-face-hi), var(--tb-face-lo)); color: var(--tb-danger); border-color: var(--tb-border-strong); }
1563
+ .tb-button.tb-accent { color: var(--tb-accent); }
1564
+ .tb-toolbar { padding: 2px; background: linear-gradient(var(--tb-face-hi), var(--tb-face-lo)); border-color: var(--tb-border); border-radius: 0; }
1565
+ .tb-toolbar > .tb-button:not(.tb-primary, .tb-accent, .tb-danger):hover { background: var(--tb-face-hi); border-color: var(--tb-border-strong); }
1566
+ .tb-input { border-radius: 2px; border-color: var(--tb-border-strong); box-shadow: inset 0 1px 1px var(--tb-border); }
1567
+ .tb-input:focus, .tb-rich-box:focus { border-color: var(--tb-focus); box-shadow: 0 0 0 1px var(--tb-focus); }
1568
+ .tb-invalid .tb-input:focus { box-shadow: 0 0 0 1px var(--tb-danger); }
1569
+ .tb-input[readonly] { box-shadow: none; }
1570
+ select.tb-input {
1571
+ border-radius: 3px;
1572
+ background-image: linear-gradient(45deg, transparent 50%, var(--tb-text) 50%), linear-gradient(135deg, var(--tb-text) 50%, transparent 50%), linear-gradient(var(--tb-face-hi), var(--tb-face-lo));
1573
+ background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%, 0 0;
1574
+ background-size: 5px 5px, 5px 5px, 100% 100%;
1575
+ box-shadow: none;
1576
+ }
1577
+ select.tb-input:focus { box-shadow: 0 0 0 2px var(--tb-focus-ring); }
1578
+ /* tabs: a tab widget, the chosen tab open onto a framed page */
1579
+ .tb-tabs { gap: 0; }
1580
+ .tb-tablist { position: relative; z-index: 1; gap: 0; margin-bottom: -1px; padding-left: 2px; box-shadow: none; }
1581
+ .tb-tab { min-height: 30px; margin: 3px -1px 0 0; padding: 0 var(--tb-space-4); border: 1px solid var(--tb-border-strong); border-radius: 3px 3px 0 0; background: linear-gradient(var(--tb-face-hi), var(--tb-face-lo)); color: var(--tb-text); font-weight: 400; }
1582
+ .tb-tab[aria-selected="true"] { margin-top: 0; min-height: 33px; background: var(--tb-bg); border-bottom-color: var(--tb-bg); color: var(--tb-text); }
1583
+ .tb-tab-panel { padding: var(--tb-space-4); border: 1px solid var(--tb-border-strong); border-radius: 0 3px 3px 3px; }
1584
+ .tb-table-wrap, .tb-list { border-color: var(--tb-border-strong); border-radius: 2px; box-shadow: none; }
1585
+ .tb-table th { color: var(--tb-text); font-weight: 400; padding: 4px var(--tb-space-3); background: linear-gradient(var(--tb-face-hi), var(--tb-face-lo)); border-bottom: 1px solid var(--tb-border-strong); }
1586
+ .tb-sort { padding: 4px var(--tb-space-3); }
1587
+ @media (min-width: 641px) {
1588
+ .tb-table th { border-right: 1px solid var(--tb-border-strong); }
1589
+ .tb-table td { height: 30px; padding: 4px var(--tb-space-3); border-right: 1px solid var(--tb-border); }
1590
+ .tb-table tr > :last-child { border-right: 0; }
1591
+ }
1592
+ .tb-list > li { padding: var(--tb-space-2) var(--tb-space-3); }
1593
+ .tb-selectable :is(tbody > tr, .tb-list > li).tb-selected, .tb-tree li.tb-selected > .tb-tree-row { background: var(--tb-primary); color: var(--tb-on-primary); }
1594
+ .tb-list > li.tb-selected .tb-list-secondary, .tb-tree li.tb-selected > .tb-tree-row .tb-tree-toggle { color: inherit; }
1595
+ .tb-tree-row { border-radius: 0; }
1596
+ .tb-progress { height: 20px; border: 1px solid var(--tb-border-strong); border-radius: 3px; background: var(--tb-surface); }
1597
+ .tb-progress-bar { border-radius: 2px; background-image: repeating-linear-gradient(-45deg, transparent 0 6px, color-mix(in oklch, var(--tb-surface) 22%, transparent) 6px 12px); }
1598
+ .tb-menu, .tb-lookup-list, .tb-calendar { padding: 2px; border-color: var(--tb-border-strong); border-radius: 2px; box-shadow: var(--tb-shadow-2); animation: none; }
1599
+ .tb-menu-item, .tb-lookup-option { min-height: 28px; border-radius: 0; }
1600
+ .tb-menu-item:focus, .tb-lookup-option:hover, .tb-lookup-option[aria-selected="true"] { background: var(--tb-primary); color: var(--tb-on-primary); }
1601
+ .tb-menu-item:focus svg { color: inherit; }
1602
+ .tb-dialog { border: 1px solid var(--tb-border-strong); border-radius: 3px; }
1603
+ .tb-dialog-head { padding: 4px 4px 4px var(--tb-space-4); background: linear-gradient(var(--tb-face-hi), var(--tb-face-lo)); border-bottom: 1px solid var(--tb-border-strong); }
1604
+ .tb-dialog-title { font-size: 14px; font-weight: 600; }
1605
+ .tb-dialog-close { width: 28px; height: 28px; font-size: 18px; border-radius: 3px; }
1606
+ .tb-dialog-body { padding-top: var(--tb-space-5); }
1607
+ /* a toast is a tooltip */
1608
+ .tb-toast { background: color-mix(in oklch, var(--tb-warning) 22%, var(--tb-surface)); color: var(--tb-text); border: 1px solid var(--tb-border-strong); border-radius: 2px; box-shadow: var(--tb-shadow-2); font-weight: 400; }
1609
+ .tb-scroll { background: var(--tb-surface); border-color: var(--tb-border-strong); border-radius: 2px; }
1610
+ `,
1611
+ fluent: String.raw `
1612
+ /* fluent: recalls Windows 11: white layers on a calm window, a darker stroke under controls, accent pills for what is chosen */
1613
+ .tb-title { font-size: 28px; font-weight: 600; letter-spacing: 0; }
1614
+ .tb-heading { font-size: 20px; font-weight: 600; letter-spacing: 0; }
1615
+ .tb-panel > .tb-panel-title { font-size: 16px; font-weight: 600; letter-spacing: 0; }
1616
+ .tb-label { font-weight: 400; }
1617
+ .tb-panel { border-color: var(--tb-border); border-radius: 8px; box-shadow: none; }
1618
+ .tb-button { font-weight: 400; border: 1px solid var(--tb-border); border-bottom-color: var(--tb-border-strong); border-radius: 4px; box-shadow: none; }
1619
+ .tb-button:hover { background: var(--tb-bg); border-color: var(--tb-border); border-bottom-color: var(--tb-border-strong); }
1620
+ .tb-button:active:not(:disabled, [aria-disabled="true"]) { color: var(--tb-muted); }
1621
+ .tb-button:focus-visible { box-shadow: 0 0 0 1px var(--tb-surface), 0 0 0 3px var(--tb-focus-ring); }
1622
+ .tb-button.tb-primary { border-color: color-mix(in oklch, var(--tb-primary) 88%, var(--tb-on-primary)); border-bottom-color: color-mix(in oklch, var(--tb-primary) 70%, var(--tb-text)); box-shadow: none; }
1623
+ .tb-button.tb-primary:focus-visible { box-shadow: 0 0 0 1px var(--tb-surface), 0 0 0 3px var(--tb-focus-ring); }
1624
+ .tb-toolbar { background: var(--tb-raised); border-color: var(--tb-border); border-radius: 8px; }
1625
+ .tb-toolbar > .tb-button:not(.tb-primary, .tb-accent, .tb-danger):hover { background: var(--tb-subtle); }
1626
+ /* a field: a quiet frame with a darker line under it, which turns into the accent while typing */
1627
+ .tb-input { border-color: var(--tb-border); border-radius: 4px; box-shadow: inset 0 -1px 0 var(--tb-muted); }
1628
+ .tb-input:hover { border-color: var(--tb-border); }
1629
+ .tb-input:focus, .tb-rich-box:focus { border-color: var(--tb-border); box-shadow: inset 0 -2px 0 var(--tb-primary); }
1630
+ .tb-invalid .tb-input, .tb-invalid .tb-input:focus { box-shadow: inset 0 -2px 0 var(--tb-danger); }
1631
+ .tb-input[readonly] { box-shadow: none; }
1632
+ select.tb-input { border-bottom-color: var(--tb-border-strong); box-shadow: none; }
1633
+ select.tb-input:focus { box-shadow: 0 0 0 1px var(--tb-surface), 0 0 0 3px var(--tb-focus-ring); }
1634
+ .tb-switch input { width: 40px; border: 1px solid var(--tb-muted); background: transparent; }
1635
+ .tb-switch input::before { top: 3px; left: 3px; width: 12px; height: 12px; background: var(--tb-muted); box-shadow: none; }
1636
+ .tb-switch input:checked { border-color: var(--tb-primary); }
1637
+ .tb-switch input:checked::before { transform: translateX(20px); background: var(--tb-on-primary); }
1638
+ .tb-switch input:focus-visible { box-shadow: 0 0 0 1px var(--tb-surface), 0 0 0 3px var(--tb-focus-ring); }
1639
+ /* tabs: plain words; a short pill of the accent under the chosen one */
1640
+ .tb-tablist { gap: var(--tb-space-1); box-shadow: none; }
1641
+ .tb-tab { position: relative; border-bottom: 0; border-radius: 4px; font-weight: 400; color: var(--tb-muted); }
1642
+ .tb-tab:hover { background: var(--tb-subtle); }
1643
+ .tb-tab[aria-selected="true"] { color: var(--tb-text); font-weight: 600; }
1644
+ .tb-tab[aria-selected="true"]::after { content: ""; position: absolute; left: calc(50% - 8px); bottom: 3px; width: 16px; height: 3px; border-radius: 2px; background: var(--tb-primary); }
1645
+ .tb-tab:focus-visible { box-shadow: 0 0 0 3px var(--tb-focus-ring); }
1646
+ /* what is chosen: a shade of the text, and a pill of the accent at its left */
1647
+ .tb-table-wrap { border-radius: 8px; box-shadow: none; }
1648
+ .tb-table th { background: var(--tb-surface); color: var(--tb-text); }
1649
+ .tb-list { padding: 4px; border-radius: 8px; box-shadow: none; }
1650
+ .tb-list > li { position: relative; border-bottom: 0; border-radius: 4px; }
1651
+ .tb-tree-row { position: relative; border-radius: 4px; }
1652
+ .tb-selectable :is(tbody > tr, .tb-list > li).tb-selected, .tb-tree li.tb-selected > .tb-tree-row { background: var(--tb-subtle); }
1653
+ .tb-tree li.tb-selected > .tb-tree-row { font-weight: 400; }
1654
+ .tb-list > li.tb-selected::before, .tb-tree li.tb-selected > .tb-tree-row::before { content: ""; position: absolute; left: 0; top: calc(50% - 8px); width: 3px; height: 16px; border-radius: 2px; background: var(--tb-primary); }
1655
+ .tb-selectable tbody > tr.tb-selected > td:first-child { box-shadow: inset 3px 0 0 var(--tb-primary); }
1656
+ .tb-selectable :is(tbody > tr, .tb-list > li):hover { background: var(--tb-subtle); }
1657
+ .tb-progress { height: 3px; border-radius: 2px; background: linear-gradient(var(--tb-muted), var(--tb-muted)) center / 100% 1px no-repeat; }
1658
+ .tb-menu, .tb-lookup-list, .tb-calendar { padding: 4px; border-radius: 8px; }
1659
+ .tb-menu-item, .tb-lookup-option { min-height: 32px; border-radius: 4px; }
1660
+ .tb-menu-item:focus, .tb-lookup-option:hover, .tb-lookup-option[aria-selected="true"] { background: var(--tb-subtle); }
1661
+ .tb-dialog { border: 1px solid var(--tb-border); border-radius: 8px; }
1662
+ .tb-dialog-head { padding: var(--tb-space-5) var(--tb-space-3) 0 var(--tb-space-6); }
1663
+ .tb-dialog-title { font-size: 20px; font-weight: 600; letter-spacing: 0; }
1664
+ .tb-toast { background: var(--tb-raised); color: var(--tb-text); border: 1px solid var(--tb-border); border-radius: 8px; font-weight: 400; }
1665
+ .tb-scroll { border-radius: 8px; }
1666
+ `,
1667
+ };