@gramlot/gramlot 0.3.41 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (358) hide show
  1. package/assets/icons/align-center.svg +4 -0
  2. package/assets/icons/align-justify.svg +4 -0
  3. package/assets/icons/align-left.svg +4 -0
  4. package/assets/icons/align-right.svg +4 -0
  5. package/assets/icons/applications.svg +4 -0
  6. package/assets/icons/archive.svg +4 -0
  7. package/assets/icons/attachment.svg +4 -0
  8. package/assets/icons/bold.svg +4 -0
  9. package/assets/icons/book.svg +4 -0
  10. package/assets/icons/bookmark.svg +4 -0
  11. package/assets/icons/calendar.svg +4 -0
  12. package/assets/icons/cancel.svg +4 -0
  13. package/assets/icons/chart.svg +4 -1
  14. package/assets/icons/chat.svg +4 -0
  15. package/assets/icons/clock.svg +4 -0
  16. package/assets/icons/code.svg +4 -0
  17. package/assets/icons/collapse.svg +4 -0
  18. package/assets/icons/columns.svg +4 -0
  19. package/assets/icons/confirm.svg +4 -0
  20. package/assets/icons/copy.svg +4 -0
  21. package/assets/icons/cut.svg +4 -0
  22. package/assets/icons/database.svg +4 -0
  23. package/assets/icons/delete.svg +4 -0
  24. package/assets/icons/detach.svg +4 -0
  25. package/assets/icons/document.svg +4 -0
  26. package/assets/icons/download.svg +4 -0
  27. package/assets/icons/duplicate.svg +4 -0
  28. package/assets/icons/edit.svg +4 -0
  29. package/assets/icons/eraser.svg +4 -0
  30. package/assets/icons/expand.svg +4 -0
  31. package/assets/icons/export.svg +4 -0
  32. package/assets/icons/eye.svg +4 -0
  33. package/assets/icons/filter.svg +4 -0
  34. package/assets/icons/first.svg +4 -0
  35. package/assets/icons/folder.svg +4 -0
  36. package/assets/icons/group.svg +4 -0
  37. package/assets/icons/help.svg +4 -0
  38. package/assets/icons/home.svg +4 -0
  39. package/assets/icons/horizontal-rule.svg +4 -0
  40. package/assets/icons/image.svg +4 -0
  41. package/assets/icons/import.svg +4 -0
  42. package/assets/icons/indent.svg +4 -0
  43. package/assets/icons/info.svg +4 -0
  44. package/assets/icons/inspector.svg +4 -0
  45. package/assets/icons/italic.svg +4 -0
  46. package/assets/icons/last.svg +4 -0
  47. package/assets/icons/layers.svg +4 -0
  48. package/assets/icons/link.svg +4 -0
  49. package/assets/icons/list-bulleted.svg +4 -0
  50. package/assets/icons/list-numbered.svg +4 -0
  51. package/assets/icons/list.svg +4 -0
  52. package/assets/icons/lock.svg +4 -0
  53. package/assets/icons/logout.svg +4 -0
  54. package/assets/icons/navigation.svg +4 -0
  55. package/assets/icons/new.svg +4 -0
  56. package/assets/icons/next.svg +4 -0
  57. package/assets/icons/open.svg +4 -0
  58. package/assets/icons/outdent.svg +4 -0
  59. package/assets/icons/palette.svg +4 -0
  60. package/assets/icons/panel-bottom.svg +4 -0
  61. package/assets/icons/panel-left.svg +4 -0
  62. package/assets/icons/panel-right.svg +4 -0
  63. package/assets/icons/panel-top.svg +4 -0
  64. package/assets/icons/paragraph.svg +4 -0
  65. package/assets/icons/paste.svg +4 -0
  66. package/assets/icons/pause.svg +4 -0
  67. package/assets/icons/pin.svg +4 -0
  68. package/assets/icons/play.svg +4 -0
  69. package/assets/icons/previous.svg +4 -0
  70. package/assets/icons/print.svg +4 -0
  71. package/assets/icons/redo.svg +4 -0
  72. package/assets/icons/refresh.svg +4 -0
  73. package/assets/icons/save.svg +4 -0
  74. package/assets/icons/search.svg +4 -0
  75. package/assets/icons/select-all.svg +4 -0
  76. package/assets/icons/send.svg +4 -0
  77. package/assets/icons/settings.svg +4 -0
  78. package/assets/icons/sort-ascending.svg +4 -0
  79. package/assets/icons/sort-descending.svg +4 -0
  80. package/assets/icons/stop.svg +4 -0
  81. package/assets/icons/strikethrough.svg +4 -0
  82. package/assets/icons/table.svg +4 -0
  83. package/assets/icons/tree.svg +4 -0
  84. package/assets/icons/underline.svg +4 -0
  85. package/assets/icons/undo.svg +4 -0
  86. package/assets/icons/unlock.svg +4 -0
  87. package/assets/icons/upload.svg +4 -0
  88. package/assets/icons/user.svg +4 -0
  89. package/assets/icons/warning.svg +4 -0
  90. package/assets/icons/zoom-in.svg +4 -0
  91. package/assets/icons/zoom-out.svg +4 -0
  92. package/dist/components/charts/__init__.py +1 -1
  93. package/dist/components/charts/assets/index.js +1 -1
  94. package/dist/components/charts/assets/libraries/vega.js +11 -11
  95. package/dist/components/charts/grammar.json +2032 -72
  96. package/dist/components/editors/__init__.py +1 -1
  97. package/dist/components/editors/assets/collection.js +1 -1
  98. package/dist/components/editors/assets/index.js +1 -1
  99. package/dist/components/editors/assets/libraries/codemirror.js +30 -31
  100. package/dist/components/editors/assets/libraries/jodit.js +453 -447
  101. package/dist/components/editors/commands.json +113 -1
  102. package/dist/components/editors/grammar.json +12 -5
  103. package/dist/components/grid/__init__.py +1 -1
  104. package/dist/components/grid/assets/index.js +1 -1
  105. package/dist/components/grid/commands.json +4 -6
  106. package/dist/components/grid/grammar.json +112 -0
  107. package/dist/components/inputs/__init__.py +1 -1
  108. package/dist/components/inputs/assets/index.js +1 -1
  109. package/dist/components/inputs/grammar.json +5165 -359
  110. package/dist/components/layout/__init__.py +1 -1
  111. package/dist/components/layout/assets/collection.js +1 -0
  112. package/dist/components/layout/assets/index.js +1 -1
  113. package/dist/components/layout/grammar.json +433 -4
  114. package/dist/components/tree/__init__.py +1 -1
  115. package/dist/components/tree/assets/index.js +1 -1
  116. package/dist/components/tree/grammar.json +51 -0
  117. package/dist/components/typst/__init__.py +1 -1
  118. package/dist/components/typst/assets/collection.js +6 -6
  119. package/dist/components/typst/assets/index.js +1 -1
  120. package/dist/components/uploads/__init__.py +1 -1
  121. package/dist/components/uploads/assets/index.js +1 -1
  122. package/dist/components/uploads/grammar.json +66 -0
  123. package/dist/declared-collections.js +1 -1
  124. package/dist/gramlot.js +5486 -2029
  125. package/dist/gramlot.min.js +361 -138
  126. package/dist/libraries.json +6 -4
  127. package/dist/standard-collections.js +1 -1
  128. package/dist/standard-grammar.js +1 -1
  129. package/package.json +6 -2
  130. package/src/binding/ask-dialog.js +17 -3
  131. package/src/binding/providers.js +3 -2
  132. package/src/binding/remote.js +41 -6
  133. package/src/binding/runtime.js +30 -3
  134. package/src/builder/gramlot-builder.d.ts +3 -1
  135. package/src/builder/gramlot-builder.js +77 -26
  136. package/src/builder/source.js +78 -15
  137. package/src/builder/xml-recipe.js +144 -0
  138. package/src/chat-file-types.js +13 -0
  139. package/src/chat.d.ts +1 -0
  140. package/src/chat.js +35 -25
  141. package/src/commands.d.ts +1 -1
  142. package/src/commands.js +1 -1
  143. package/src/components/border-container.js +64 -6
  144. package/src/components/buttons.js +26 -31
  145. package/src/components/chart-bar3d-options.js +0 -1
  146. package/src/components/chart-boxplot-options.js +1 -1
  147. package/src/components/chart-candlestick-options.js +1 -1
  148. package/src/components/chart-engines/echarts-options.js +6 -5
  149. package/src/components/chart-engines/echarts.js +27 -10
  150. package/src/components/chart-engines/plotly-map.js +1 -1
  151. package/src/components/chart-engines/plotly.js +21 -14
  152. package/src/components/chart-engines/uplot.js +17 -11
  153. package/src/components/chart-engines/vega.js +17 -11
  154. package/src/components/chart-funnel-options.js +1 -1
  155. package/src/components/chart-geographic-options.js +2 -2
  156. package/src/components/chart-heatmap-options.js +1 -1
  157. package/src/components/chart-map-bar3d-options.js +2 -2
  158. package/src/components/chart-map-options.js +2 -2
  159. package/src/components/chart-pane.js +5 -5
  160. package/src/components/chart-parallel-options.js +1 -1
  161. package/src/components/chart-radar-options.js +1 -1
  162. package/src/components/chart-renderer.js +6 -1
  163. package/src/components/chart-sankey-options.js +1 -1
  164. package/src/components/chart-spatial-options.js +6 -2
  165. package/src/components/chart-sunburst-options.js +13 -1
  166. package/src/components/chart-theme.js +14 -0
  167. package/src/components/chart-treemap-options.js +1 -1
  168. package/src/components/chart-type-data.js +24 -4
  169. package/src/components/charts.js +7 -6
  170. package/src/components/check-box-text-editor.js +1 -0
  171. package/src/components/check-box-text.js +2 -0
  172. package/src/components/check-box-tree.js +1 -1
  173. package/src/components/choice-editor.js +5 -4
  174. package/src/components/choice-field-styles.js +9 -1
  175. package/src/components/code-mirror-engine.js +19 -5
  176. package/src/components/code-mirror-gramlot.js +85 -0
  177. package/src/components/code-mirror.js +3 -2
  178. package/src/components/drawing.js +43 -14
  179. package/src/components/editor-commands.js +69 -0
  180. package/src/components/editor-options.js +1 -1
  181. package/src/components/editors.js +5 -3
  182. package/src/components/form-tray-pane.js +18 -0
  183. package/src/components/graphical-ranges.js +190 -0
  184. package/src/components/grid-check-sets.js +39 -3
  185. package/src/components/grid-footer.js +6 -1
  186. package/src/components/grid-header-interaction.js +3 -3
  187. package/src/components/grid-styles.js +30 -5
  188. package/src/components/grid-tools.js +15 -7
  189. package/src/components/grid.js +109 -15
  190. package/src/components/html-editor-commands.js +61 -0
  191. package/src/components/html-editor.js +18 -3
  192. package/src/components/inputs.js +94 -23
  193. package/src/components/jodit-engine.js +110 -7
  194. package/src/components/layout.js +3 -2
  195. package/src/components/menus.js +89 -26
  196. package/src/components/numeric-range.js +39 -0
  197. package/src/components/selected-container.js +123 -64
  198. package/src/components/tab-bar.js +389 -0
  199. package/src/components/toolbar-icon-style.js +22 -0
  200. package/src/components/toolbar-overflow.js +74 -12
  201. package/src/components/tray-base.js +528 -0
  202. package/src/components/tray-pane.js +41 -518
  203. package/src/components/tree.js +56 -4
  204. package/src/components/typed-editor.js +5 -2
  205. package/src/components/typst-preview.js +3 -3
  206. package/src/components/upload-blocks.js +88 -0
  207. package/src/components/upload-engine.js +21 -31
  208. package/src/components/uploader.js +168 -47
  209. package/src/editing-session.js +2 -1
  210. package/src/gramlot.js +6 -3
  211. package/src/handlers/dom-handler.d.ts +2 -0
  212. package/src/handlers/dom-handler.js +9 -0
  213. package/src/handlers/rpc-handler.d.ts +1 -1
  214. package/src/handlers/rpc-handler.js +2 -0
  215. package/src/handlers/source-handler.d.ts +5 -3
  216. package/src/handlers/source-handler.js +31 -13
  217. package/src/icons.js +84 -0
  218. package/src/ide-runtime.js +3 -1
  219. package/src/index-page-runtime.js +20 -5
  220. package/src/index-page-styles.js +1 -1
  221. package/src/index-theme.js +210 -3
  222. package/src/index.d.ts +7 -2
  223. package/src/index.js +7 -2
  224. package/src/libraries.js +4 -4
  225. package/src/object-extract.d.ts +7 -0
  226. package/src/object-extract.js +31 -0
  227. package/src/renderer/attributes.js +1 -1
  228. package/src/renderer/gramlot-renderer.d.ts +2 -2
  229. package/src/renderer/gramlot-renderer.js +4 -1
  230. package/src/server/chat-attachments.js +139 -0
  231. package/src/server/chat.d.ts +33 -0
  232. package/src/server/chat.js +168 -0
  233. package/src/server/database-selectors.d.ts +6 -0
  234. package/src/server/database-selectors.js +13 -0
  235. package/src/server/gramlot-file-server.js +6 -1
  236. package/src/server/gramlot-server.d.ts +19 -3
  237. package/src/server/gramlot-server.js +149 -19
  238. package/src/server/index-page.d.ts +10 -0
  239. package/src/server/index-page.js +92 -8
  240. package/src/server/index.d.ts +1 -1
  241. package/src/server/index.js +1 -1
  242. package/src/server/page-base.js +4 -0
  243. package/src/server/page-store.d.ts +21 -0
  244. package/src/server/page-store.js +219 -0
  245. package/src/server/page.d.ts +6 -1
  246. package/src/server/page.js +5 -1
  247. package/src/server/store-recipe.js +102 -0
  248. package/src/server/toolbar-icon-name.d.ts +93 -0
  249. package/src/server/upload.d.ts +2 -0
  250. package/src/server/upload.js +36 -18
  251. package/src/server/visual-editor.js +4 -2
  252. package/src/tree-store.d.ts +5 -1
  253. package/src/tree-store.js +11 -2
  254. package/src/view/choice-focus.js +17 -0
  255. package/src/view/html.js +21 -1
  256. package/src/view/labelbox.js +6 -1
  257. package/src/view/menu.js +9 -3
  258. package/src/visual-editor.d.ts +1 -0
  259. package/src/visual-editor.js +10 -5
  260. package/themes/gramlot-base/theme.css +60 -28
  261. package/themes/gramlot-compact/theme.css +2 -0
  262. package/themes/gramlot-index/icons/align-center.svg +4 -0
  263. package/themes/gramlot-index/icons/align-justify.svg +4 -0
  264. package/themes/gramlot-index/icons/align-left.svg +4 -0
  265. package/themes/gramlot-index/icons/align-right.svg +4 -0
  266. package/themes/gramlot-index/icons/applications.svg +4 -0
  267. package/themes/gramlot-index/icons/archive.svg +4 -0
  268. package/themes/gramlot-index/icons/attachment.svg +4 -0
  269. package/themes/gramlot-index/icons/bold.svg +4 -0
  270. package/themes/gramlot-index/icons/book.svg +4 -0
  271. package/themes/gramlot-index/icons/bookmark.svg +4 -0
  272. package/themes/gramlot-index/icons/calendar.svg +4 -0
  273. package/themes/gramlot-index/icons/cancel.svg +4 -0
  274. package/themes/gramlot-index/icons/chart.svg +4 -0
  275. package/themes/gramlot-index/icons/chat.svg +4 -0
  276. package/themes/gramlot-index/icons/clock.svg +4 -0
  277. package/themes/gramlot-index/icons/code.svg +4 -0
  278. package/themes/gramlot-index/icons/collapse.svg +4 -0
  279. package/themes/gramlot-index/icons/columns.svg +4 -0
  280. package/themes/gramlot-index/icons/confirm.svg +4 -0
  281. package/themes/gramlot-index/icons/copy.svg +4 -0
  282. package/themes/gramlot-index/icons/cut.svg +4 -0
  283. package/themes/gramlot-index/icons/database.svg +4 -0
  284. package/themes/gramlot-index/icons/delete.svg +4 -0
  285. package/themes/gramlot-index/icons/detach.svg +4 -0
  286. package/themes/gramlot-index/icons/document.svg +4 -0
  287. package/themes/gramlot-index/icons/download.svg +4 -0
  288. package/themes/gramlot-index/icons/duplicate.svg +4 -0
  289. package/themes/gramlot-index/icons/edit.svg +4 -0
  290. package/themes/gramlot-index/icons/eraser.svg +4 -0
  291. package/themes/gramlot-index/icons/expand.svg +4 -0
  292. package/themes/gramlot-index/icons/export.svg +4 -0
  293. package/themes/gramlot-index/icons/eye.svg +4 -0
  294. package/themes/gramlot-index/icons/filter.svg +4 -0
  295. package/themes/gramlot-index/icons/first.svg +4 -0
  296. package/themes/gramlot-index/icons/folder.svg +4 -0
  297. package/themes/gramlot-index/icons/group.svg +4 -0
  298. package/themes/gramlot-index/icons/help.svg +4 -0
  299. package/themes/gramlot-index/icons/home.svg +4 -0
  300. package/themes/gramlot-index/icons/horizontal-rule.svg +4 -0
  301. package/themes/gramlot-index/icons/image.svg +4 -0
  302. package/themes/gramlot-index/icons/import.svg +4 -0
  303. package/themes/gramlot-index/icons/indent.svg +4 -0
  304. package/themes/gramlot-index/icons/info.svg +4 -0
  305. package/themes/gramlot-index/icons/inspector.svg +4 -0
  306. package/themes/gramlot-index/icons/italic.svg +4 -0
  307. package/themes/gramlot-index/icons/last.svg +4 -0
  308. package/themes/gramlot-index/icons/layers.svg +4 -0
  309. package/themes/gramlot-index/icons/link.svg +4 -0
  310. package/themes/gramlot-index/icons/list-bulleted.svg +4 -0
  311. package/themes/gramlot-index/icons/list-numbered.svg +4 -0
  312. package/themes/gramlot-index/icons/list.svg +4 -0
  313. package/themes/gramlot-index/icons/lock.svg +4 -0
  314. package/themes/gramlot-index/icons/logout.svg +4 -0
  315. package/themes/gramlot-index/icons/navigation.svg +4 -0
  316. package/themes/gramlot-index/icons/new.svg +4 -0
  317. package/themes/gramlot-index/icons/next.svg +4 -0
  318. package/themes/gramlot-index/icons/open.svg +4 -0
  319. package/themes/gramlot-index/icons/outdent.svg +4 -0
  320. package/themes/gramlot-index/icons/palette.svg +4 -0
  321. package/themes/gramlot-index/icons/panel-bottom.svg +4 -0
  322. package/themes/gramlot-index/icons/panel-left.svg +4 -0
  323. package/themes/gramlot-index/icons/panel-right.svg +4 -0
  324. package/themes/gramlot-index/icons/panel-top.svg +4 -0
  325. package/themes/gramlot-index/icons/paragraph.svg +4 -0
  326. package/themes/gramlot-index/icons/paste.svg +4 -0
  327. package/themes/gramlot-index/icons/pause.svg +4 -0
  328. package/themes/gramlot-index/icons/pin.svg +4 -0
  329. package/themes/gramlot-index/icons/play.svg +4 -0
  330. package/themes/gramlot-index/icons/previous.svg +4 -0
  331. package/themes/gramlot-index/icons/print.svg +4 -0
  332. package/themes/gramlot-index/icons/redo.svg +4 -0
  333. package/themes/gramlot-index/icons/refresh.svg +4 -0
  334. package/themes/gramlot-index/icons/save.svg +4 -0
  335. package/themes/gramlot-index/icons/search.svg +4 -0
  336. package/themes/gramlot-index/icons/select-all.svg +4 -0
  337. package/themes/gramlot-index/icons/send.svg +4 -0
  338. package/themes/gramlot-index/icons/settings.svg +4 -0
  339. package/themes/gramlot-index/icons/sort-ascending.svg +4 -0
  340. package/themes/gramlot-index/icons/sort-descending.svg +4 -0
  341. package/themes/gramlot-index/icons/stop.svg +4 -0
  342. package/themes/gramlot-index/icons/strikethrough.svg +4 -0
  343. package/themes/gramlot-index/icons/table.svg +4 -0
  344. package/themes/gramlot-index/icons/tree.svg +4 -0
  345. package/themes/gramlot-index/icons/underline.svg +4 -0
  346. package/themes/gramlot-index/icons/undo.svg +4 -0
  347. package/themes/gramlot-index/icons/unlock.svg +4 -0
  348. package/themes/gramlot-index/icons/upload.svg +4 -0
  349. package/themes/gramlot-index/icons/user.svg +4 -0
  350. package/themes/gramlot-index/icons/warning.svg +4 -0
  351. package/themes/gramlot-index/icons/zoom-in.svg +4 -0
  352. package/themes/gramlot-index/icons/zoom-out.svg +4 -0
  353. package/themes/gramlot-index/icons.json +93 -0
  354. package/themes/gramlot-index/theme.css +24 -0
  355. package/themes/joanna/theme.css +2 -0
  356. package/themes/mela/theme.css +2 -0
  357. package/themes/mimi/theme.css +2 -0
  358. package/tools/gramlot-tools-inspector.js +11 -3
@@ -190,9 +190,11 @@ export class IdeLogic {
190
190
  }
191
191
  previewPane[html ? 'htmlPreview' : 'markdownPreview']({value:`^.documents.${key}.content`,flex:'1',min_height:0,
192
192
  ...(markdown ? {allowHtml:`^.documents.${key}.allowHtml`} : {})});
193
+ // htmlEditor is a frame: the identity, view and history subscription belong to its canvas.
194
+ const editorAttrs = {nodeId:`${context.editorPrefix}_rich_editor_${key}`,editorView:'rich',selfsubscribe_historyChanged:'ideHistoryChanged'};
193
195
  views.contentPane({title:'Rich text',pageName:'rich',height:'100%'})[html ? 'htmlEditor' : 'markdownEditor']({
194
196
  datapath:`.documents.${key}`,value:'^.content',readonly:'^.readonly',height:'100%',
195
- nodeId:`${context.editorPrefix}_rich_editor_${key}`,editorView:'rich',selfsubscribe_historyChanged:'ideHistoryChanged'});
197
+ ...(html ? Object.fromEntries(Object.entries(editorAttrs).map(([name, value]) => [`canvas_${name}`, value])) : editorAttrs)});
196
198
  target.dataController({func:'ideSave',documentKey:key,[`subscribe_${context.editorPrefix}_rich_editor_${key}_save`]:true});
197
199
  }
198
200
  }
@@ -1,6 +1,12 @@
1
1
  /* @ts-self-types="./index-page-runtime.d.ts" */
2
2
  import {Bag} from '@genrojs/bag';
3
3
 
4
+ // Built-in texts by language of the page locale; English when the language has none.
5
+ const TEXTS = {
6
+ en: {openFailed:'Page could not be opened', callbackFailed:'Page load callback failed'},
7
+ it: {openFailed:'Impossibile aprire la pagina', callbackFailed:'Errore nella callback di caricamento della pagina'},
8
+ };
9
+
4
10
  /** Coordinate a declared navigation Bag and tabContainer through Source and Data.
5
11
  * Region contents, drawer presentation, themes and application controls belong to the Page.
6
12
  */
@@ -11,10 +17,13 @@ export function mountIndexPage(renderer, root, onSelection = () => {}, prepareEn
11
17
  // other node is read at its address when it is used.
12
18
  if (typeof state !== 'string' || !state) throw new TypeError('IndexPage state must be a Data path');
13
19
  const data = renderer.binding.gramlot.data;
20
+ const language = renderer.binding.gramlot.locale.split('-')[0].toLowerCase();
21
+ const texts = TEXTS[language] ?? TEXTS.en;
14
22
  const read = name => data.getItem(`${state}.${name}`);
15
23
  const write = (name, value) => data.setItem(`${state}.${name}`, value);
16
24
  const navigation = () => read('navigation');
17
25
  if (!(navigation() instanceof Bag)) throw new TypeError('IndexPage navigation must be a Bag');
26
+ const releaseTheme = renderer.binding.gramlot.dom.mountIndexTheme(state);
18
27
  const tabs = () => root.value.getNode('frame.center.tabs');
19
28
  const builder = root.builder;
20
29
  const entries = new Map();
@@ -33,7 +42,7 @@ export function mountIndexPage(renderer, root, onSelection = () => {}, prepareEn
33
42
  }
34
43
  const notifyLoad = (entry, status, error) => {
35
44
  try { onLoad(entry.url, status, error); }
36
- catch (callbackError) { renderer.binding.reportError(callbackError, 'Page load callback failed'); }
45
+ catch (callbackError) { renderer.binding.reportError(callbackError, texts.callbackFailed); }
37
46
  };
38
47
  const finishLoad = (entry, status, error) => {
39
48
  if (!entry.loading) return;
@@ -55,7 +64,7 @@ export function mountIndexPage(renderer, root, onSelection = () => {}, prepareEn
55
64
  // Includes validation and preparation errors before the asynchronous load starts.
56
65
  function requestSelection(path) {
57
66
  void select(path).catch(error => {
58
- if (!context.disposed) renderer.binding.reportError(error, 'Page could not be opened');
67
+ if (!context.disposed) renderer.binding.reportError(error, texts.openFailed);
59
68
  });
60
69
  }
61
70
  async function select(path) {
@@ -73,9 +82,14 @@ export function mountIndexPage(renderer, root, onSelection = () => {}, prepareEn
73
82
  }
74
83
  while (tabs().value !== null && tabs().value.getNode(`page${context.sequence}`)) context.sequence++;
75
84
  const paneLabel = `page${context.sequence++}`;
76
- const title = node.attr.title ?? node.label;
85
+ const baseTitle = node.attr.title ?? node.label;
86
+ const titles = new Set([...entries.values()].map(entry => entry.title));
87
+ let title = baseTitle;
88
+ for (let suffix = 1; titles.has(title); suffix++) title = `${baseTitle} (${suffix})`;
77
89
  builder.wrapSource(tabs()).contentPane({node_label: paneLabel,
78
- title, pageName: url, height: '100%', closable: true});
90
+ title, pageName: url, height: '100%', closable: true,
91
+ detachable: node.attr.detachable ?? true,
92
+ badge: `^${state}.navigation.${path}?badge`, badge_color: `^${state}.navigation.${path}?badge_color`});
79
93
  const previous = read('active');
80
94
  entry = createRecord({url, path, title, paneLabel, loading: true});
81
95
  entries.set(url, entry);
@@ -98,7 +112,7 @@ export function mountIndexPage(renderer, root, onSelection = () => {}, prepareEn
98
112
  } catch (error) {
99
113
  if (context.disposed || entries.get(url) !== entry) return;
100
114
  try {
101
- renderer.binding.reportError(error, 'Page could not be opened');
115
+ renderer.binding.reportError(error, texts.openFailed);
102
116
  entries.delete(url);
103
117
  forget(paneLabel);
104
118
  if (entry.pane) tabs().value.popNode(paneLabel);
@@ -164,6 +178,7 @@ export function mountIndexPage(renderer, root, onSelection = () => {}, prepareEn
164
178
  const dispose = () => {
165
179
  if (context.disposed) return;
166
180
  context.disposed = true;
181
+ releaseTheme();
167
182
  for (const registration of registrations) registration.close();
168
183
  source.unsubscribe(sourceSubscription, {any: true});
169
184
  for (const entry of entries.values()) if (entry.loading) {
@@ -1,3 +1,3 @@
1
1
  // Generated from canonical themes; edit themes/, not this file.
2
- export const appearanceStyles = {"base":"","compact":"/* gramlot-compact: professional density profile; load after Base. */\n@layer gramlot.tokens {\n :root {\n color-scheme: light;\n --gramlot-background: #f3f5f7;\n --gramlot-surface: #ffffff;\n --gramlot-header-background: #303946;\n --gramlot-header-color: #ffffff;\n --gramlot-surface-subtle: #e9edf2;\n --gramlot-ink: #202936;\n --gramlot-text-secondary: #526174;\n --gramlot-border: #ccd3dc;\n --gramlot-border-control: #7b899b;\n --gramlot-action: #235db2;\n --gramlot-action-hover: #194987;\n --gramlot-selected: #e3edfb;\n --gramlot-field-background: #ffffff;\n --gramlot-field-readonly-background: #e9edf2;\n --gramlot-label-color: #526174;\n --gramlot-focus-ring: #235db2;\n --gramlot-brand-blue: #235db2;\n --gramlot-brand-yellow: #235db2;\n --gramlot-navigation: #202936;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #aa2637;\n --gramlot-error-background: #fff0f1;\n --gramlot-success: #236747;\n --gramlot-success-background: #e9f4ec;\n --gramlot-warning: #735313;\n --gramlot-warning-background: #fff5da;\n --gramlot-field-height: 28px;\n --gramlot-field-padding: 2px 7px;\n --gramlot-field-line-height: 1.3;\n --gramlot-field-font-size: 1rem;\n --gramlot-button-padding: 2px 7px;\n --gramlot-button-gap: 4px;\n --gramlot-button-background: var(--gramlot-surface);\n --gramlot-button-hover: var(--gramlot-selected);\n --gramlot-label-size: 1em;\n --gramlot-label-gap: 3px;\n --gramlot-radius-sm: 4px;\n --gramlot-radius: 4px;\n --gramlot-radius-lg: 6px;\n --gramlot-window-radius: 6px;\n --gramlot-toolbar-gap: 2px;\n --gramlot-tree-row-height: var(--gramlot-field-height);\n --gramlot-space-1: 3px;\n --gramlot-space-2: 4px;\n --gramlot-space-3: 8px;\n --gramlot-space-4: 8px;\n --gramlot-space-6: 12px;\n --gramlot-space-8: 16px;\n --gramlot-space-12: 24px;\n --gramlot-tab-height: 28px;\n --gramlot-tab-padding: 2px 7px;\n --gramlot-tab-radius: 4px;\n --gramlot-tab-gap: 2px;\n --gramlot-tab-strip-padding: 2px;\n --gramlot-tab-background: var(--gramlot-surface-subtle);\n --gramlot-tab-selected-background: var(--gramlot-surface);\n --gramlot-tab-selected-color: var(--gramlot-action);\n --gramlot-tab-border: var(--gramlot-border);\n --gramlot-shadow: 0 2px 8px rgb(0 0 0 / 10%);\n }\n @media (prefers-color-scheme: dark) {\n :root:not([data-theme=\"light\"]) {\n color-scheme: dark;\n --gramlot-background: #171c24;\n --gramlot-surface: #222a35;\n --gramlot-header-background: #354152;\n --gramlot-header-color: #edf1f7;\n --gramlot-surface-subtle: #2b3543;\n --gramlot-ink: #edf1f7;\n --gramlot-text-secondary: #b8c4d4;\n --gramlot-border: #435064;\n --gramlot-border-control: #7f90a7;\n --gramlot-action: #9dbff4;\n --gramlot-action-hover: #c1d6ff;\n --gramlot-selected: #314766;\n --gramlot-field-background: #222a35;\n --gramlot-field-readonly-background: #2b3543;\n --gramlot-label-color: #b8c4d4;\n --gramlot-focus-ring: #9dbff4;\n --gramlot-brand-blue: #9dbff4;\n --gramlot-brand-yellow: #9dbff4;\n --gramlot-navigation: #171c24;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n }\n :root[data-theme=\"dark\"] {\n color-scheme: dark;\n --gramlot-background: #171c24;\n --gramlot-surface: #222a35;\n --gramlot-header-background: #354152;\n --gramlot-header-color: #edf1f7;\n --gramlot-surface-subtle: #2b3543;\n --gramlot-ink: #edf1f7;\n --gramlot-text-secondary: #b8c4d4;\n --gramlot-border: #435064;\n --gramlot-border-control: #7f90a7;\n --gramlot-action: #9dbff4;\n --gramlot-action-hover: #c1d6ff;\n --gramlot-selected: #314766;\n --gramlot-field-background: #222a35;\n --gramlot-field-readonly-background: #2b3543;\n --gramlot-label-color: #b8c4d4;\n --gramlot-focus-ring: #9dbff4;\n --gramlot-brand-blue: #9dbff4;\n --gramlot-brand-yellow: #9dbff4;\n --gramlot-navigation: #171c24;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n}\n@layer gramlot.base {\n html { font-size: 13px; }\n body { line-height: 1.4; }\n :where(h1,h2,h3,h4,h5,h6,p,ul,ol,dl,blockquote,pre,figure) { margin-block: 0 var(--gramlot-space-3); }\n h1 { font-size: 1.4rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }\n :where(h1,h2,h3) { letter-spacing: -.015em; }\n pre { padding: var(--gramlot-space-3); }\n hr { margin-block: var(--gramlot-space-6); }\n}\n@layer gramlot.components {\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button) {\n min-block-size: var(--gramlot-field-height); padding: var(--gramlot-button-padding);\n font-size: 1rem; line-height: 1.3; font-weight: 500;\n background: var(--gramlot-button-background); color: var(--gramlot-ink); border-color: var(--gramlot-border-control);\n }\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button):hover:not(:disabled) {\n background: var(--gramlot-selected); color: var(--gramlot-action-hover); border-color: var(--gramlot-action);\n }\n :where(label) { font-size: 1em; font-weight: 400; color: var(--gramlot-label-color); margin-block-end: var(--gramlot-label-gap); }\n :where(input[readonly],textarea[readonly]) { background: var(--gramlot-field-readonly-background); }\n :where(.button--quiet,button.quiet) { background: transparent; color: var(--gramlot-action); border-color: transparent; }\n :where(.button--quiet,button.quiet):hover:not(:disabled) { background: var(--gramlot-selected); border-color: transparent; }\n :where(textarea) { min-block-size: 4.5rem; }\n :where(input[type=\"color\"]) { min-block-size: var(--gramlot-field-height); }\n :where(input[type=\"file\"])::file-selector-button { padding: var(--gramlot-field-padding); }\n :where(fieldset,details) { padding: var(--gramlot-space-3); margin-block-end: var(--gramlot-space-3); }\n :where(table) { font-size: 1rem; }\n :where(th,td) { padding: var(--gramlot-field-padding); height: var(--gramlot-field-height); vertical-align: middle; }\n :where(details[open]>summary) { margin-block-end: var(--gramlot-space-3); }\n :where(dialog) { padding: var(--gramlot-space-4); }\n}\n@layer gramlot.utilities {\n .example-page { inline-size: min(100% - 2 * var(--gramlot-space-4),var(--gramlot-page-width)); padding-block: var(--gramlot-space-4); }\n .card { padding: var(--gramlot-space-4); box-shadow: none; }\n}\n\n/* Resident Bag grid: shared palette and theme density. */\n:root {\n --gramlot-grid-row-height: 32px;\n --gramlot-grid-header-height: 30px;\n --gramlot-grid-group-height: 22px;\n --gramlot-grid-cell-padding: .25rem .65rem;\n}\n","mimi":"/* gramlot-compact: professional density profile; load after Base. */\n@layer gramlot.tokens {\n :root {\n color-scheme: light;\n --gramlot-background: #f3f5f7;\n --gramlot-surface: #ffffff;\n --gramlot-header-background: #303946;\n --gramlot-header-color: #ffffff;\n --gramlot-surface-subtle: #e9edf2;\n --gramlot-ink: #202936;\n --gramlot-text-secondary: #526174;\n --gramlot-border: #ccd3dc;\n --gramlot-border-control: #7b899b;\n --gramlot-action: #235db2;\n --gramlot-action-hover: #194987;\n --gramlot-selected: #e3edfb;\n --gramlot-field-background: #ffffff;\n --gramlot-field-readonly-background: #e9edf2;\n --gramlot-label-color: #526174;\n --gramlot-focus-ring: #235db2;\n --gramlot-brand-blue: #235db2;\n --gramlot-brand-yellow: #235db2;\n --gramlot-navigation: #202936;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #aa2637;\n --gramlot-error-background: #fff0f1;\n --gramlot-success: #236747;\n --gramlot-success-background: #e9f4ec;\n --gramlot-warning: #735313;\n --gramlot-warning-background: #fff5da;\n --gramlot-field-height: 28px;\n --gramlot-field-padding: 2px 7px;\n --gramlot-field-line-height: 1.3;\n --gramlot-field-font-size: 1rem;\n --gramlot-button-padding: 2px 7px;\n --gramlot-button-gap: 4px;\n --gramlot-button-background: var(--gramlot-surface);\n --gramlot-button-hover: var(--gramlot-selected);\n --gramlot-label-size: 1em;\n --gramlot-label-gap: 3px;\n --gramlot-radius-sm: 4px;\n --gramlot-radius: 4px;\n --gramlot-radius-lg: 6px;\n --gramlot-window-radius: 6px;\n --gramlot-toolbar-gap: 2px;\n --gramlot-tree-row-height: var(--gramlot-field-height);\n --gramlot-space-1: 3px;\n --gramlot-space-2: 4px;\n --gramlot-space-3: 8px;\n --gramlot-space-4: 8px;\n --gramlot-space-6: 12px;\n --gramlot-space-8: 16px;\n --gramlot-space-12: 24px;\n --gramlot-tab-height: 28px;\n --gramlot-tab-padding: 2px 7px;\n --gramlot-tab-radius: 4px;\n --gramlot-tab-gap: 2px;\n --gramlot-tab-strip-padding: 2px;\n --gramlot-tab-background: var(--gramlot-surface-subtle);\n --gramlot-tab-selected-background: var(--gramlot-surface);\n --gramlot-tab-selected-color: var(--gramlot-action);\n --gramlot-tab-border: var(--gramlot-border);\n --gramlot-shadow: 0 2px 8px rgb(0 0 0 / 10%);\n }\n @media (prefers-color-scheme: dark) {\n :root:not([data-theme=\"light\"]) {\n color-scheme: dark;\n --gramlot-background: #171c24;\n --gramlot-surface: #222a35;\n --gramlot-header-background: #354152;\n --gramlot-header-color: #edf1f7;\n --gramlot-surface-subtle: #2b3543;\n --gramlot-ink: #edf1f7;\n --gramlot-text-secondary: #b8c4d4;\n --gramlot-border: #435064;\n --gramlot-border-control: #7f90a7;\n --gramlot-action: #9dbff4;\n --gramlot-action-hover: #c1d6ff;\n --gramlot-selected: #314766;\n --gramlot-field-background: #222a35;\n --gramlot-field-readonly-background: #2b3543;\n --gramlot-label-color: #b8c4d4;\n --gramlot-focus-ring: #9dbff4;\n --gramlot-brand-blue: #9dbff4;\n --gramlot-brand-yellow: #9dbff4;\n --gramlot-navigation: #171c24;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n }\n :root[data-theme=\"dark\"] {\n color-scheme: dark;\n --gramlot-background: #171c24;\n --gramlot-surface: #222a35;\n --gramlot-header-background: #354152;\n --gramlot-header-color: #edf1f7;\n --gramlot-surface-subtle: #2b3543;\n --gramlot-ink: #edf1f7;\n --gramlot-text-secondary: #b8c4d4;\n --gramlot-border: #435064;\n --gramlot-border-control: #7f90a7;\n --gramlot-action: #9dbff4;\n --gramlot-action-hover: #c1d6ff;\n --gramlot-selected: #314766;\n --gramlot-field-background: #222a35;\n --gramlot-field-readonly-background: #2b3543;\n --gramlot-label-color: #b8c4d4;\n --gramlot-focus-ring: #9dbff4;\n --gramlot-brand-blue: #9dbff4;\n --gramlot-brand-yellow: #9dbff4;\n --gramlot-navigation: #171c24;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n}\n@layer gramlot.base {\n html { font-size: 13px; }\n body { line-height: 1.4; }\n :where(h1,h2,h3,h4,h5,h6,p,ul,ol,dl,blockquote,pre,figure) { margin-block: 0 var(--gramlot-space-3); }\n h1 { font-size: 1.4rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }\n :where(h1,h2,h3) { letter-spacing: -.015em; }\n pre { padding: var(--gramlot-space-3); }\n hr { margin-block: var(--gramlot-space-6); }\n}\n@layer gramlot.components {\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button) {\n min-block-size: var(--gramlot-field-height); padding: var(--gramlot-button-padding);\n font-size: 1rem; line-height: 1.3; font-weight: 500;\n background: var(--gramlot-button-background); color: var(--gramlot-ink); border-color: var(--gramlot-border-control);\n }\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button):hover:not(:disabled) {\n background: var(--gramlot-selected); color: var(--gramlot-action-hover); border-color: var(--gramlot-action);\n }\n :where(label) { font-size: 1em; font-weight: 400; color: var(--gramlot-label-color); margin-block-end: var(--gramlot-label-gap); }\n :where(input[readonly],textarea[readonly]) { background: var(--gramlot-field-readonly-background); }\n :where(.button--quiet,button.quiet) { background: transparent; color: var(--gramlot-action); border-color: transparent; }\n :where(.button--quiet,button.quiet):hover:not(:disabled) { background: var(--gramlot-selected); border-color: transparent; }\n :where(textarea) { min-block-size: 4.5rem; }\n :where(input[type=\"color\"]) { min-block-size: var(--gramlot-field-height); }\n :where(input[type=\"file\"])::file-selector-button { padding: var(--gramlot-field-padding); }\n :where(fieldset,details) { padding: var(--gramlot-space-3); margin-block-end: var(--gramlot-space-3); }\n :where(table) { font-size: 1rem; }\n :where(th,td) { padding: var(--gramlot-field-padding); height: var(--gramlot-field-height); vertical-align: middle; }\n :where(details[open]>summary) { margin-block-end: var(--gramlot-space-3); }\n :where(dialog) { padding: var(--gramlot-space-4); }\n}\n@layer gramlot.utilities {\n .example-page { inline-size: min(100% - 2 * var(--gramlot-space-4),var(--gramlot-page-width)); padding-block: var(--gramlot-space-4); }\n .card { padding: var(--gramlot-space-4); box-shadow: none; }\n}\n\n/* Resident Bag grid: shared palette and theme density. */\n:root {\n --gramlot-grid-row-height: 32px;\n --gramlot-grid-header-height: 30px;\n --gramlot-grid-group-height: 22px;\n --gramlot-grid-cell-padding: .25rem .65rem;\n}\n\n/* mimi: professional density profile; load after Base and Compact. */\n@layer gramlot.tokens {\n :root {\n color-scheme: light;\n --gramlot-background: #edf1ef;\n --gramlot-surface: #fbfcfb;\n --gramlot-header-background: #30473c;\n --gramlot-header-color: #fbfcfb;\n --gramlot-surface-subtle: #e2e9e5;\n --gramlot-ink: #24332e;\n --gramlot-text-secondary: #52655d;\n --gramlot-border: #c4d0c9;\n --gramlot-border-control: #768a7e;\n --gramlot-action: #176b61;\n --gramlot-action-hover: #105247;\n --gramlot-selected: #dceee8;\n --gramlot-field-background: #fbfcfb;\n --gramlot-field-readonly-background: #e2e9e5;\n --gramlot-label-color: #52655d;\n --gramlot-focus-ring: #176b61;\n --gramlot-brand-blue: #176b61;\n --gramlot-brand-yellow: #176b61;\n --gramlot-navigation: #24332e;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #aa2637;\n --gramlot-error-background: #fff0f1;\n --gramlot-success: #236747;\n --gramlot-success-background: #e9f4ec;\n --gramlot-warning: #735313;\n --gramlot-warning-background: #fff5da;\n --gramlot-field-height: 24px;\n --gramlot-field-padding: 1px 5px;\n --gramlot-field-line-height: 1.3;\n --gramlot-field-font-size: 1rem;\n --gramlot-button-padding: 1px 5px;\n --gramlot-button-gap: 4px;\n --gramlot-button-background: var(--gramlot-surface);\n --gramlot-button-hover: var(--gramlot-selected);\n --gramlot-label-size: 1em;\n --gramlot-label-gap: 3px;\n --gramlot-radius-sm: 3px;\n --gramlot-radius: 3px;\n --gramlot-radius-lg: 5px;\n --gramlot-window-radius: 5px;\n --gramlot-toolbar-gap: 2px;\n --gramlot-tree-row-height: var(--gramlot-field-height);\n --gramlot-space-1: 3px;\n --gramlot-space-2: 3px;\n --gramlot-space-3: 6px;\n --gramlot-space-4: 6px;\n --gramlot-space-6: 9px;\n --gramlot-space-8: 12px;\n --gramlot-space-12: 18px;\n --gramlot-tab-height: 24px;\n --gramlot-tab-padding: 1px 5px;\n --gramlot-tab-radius: 3px;\n --gramlot-tab-gap: 2px;\n --gramlot-tab-strip-padding: 2px;\n --gramlot-tab-background: var(--gramlot-surface-subtle);\n --gramlot-tab-selected-background: var(--gramlot-surface);\n --gramlot-tab-selected-color: var(--gramlot-action);\n --gramlot-tab-border: var(--gramlot-border);\n --gramlot-shadow: 0 2px 8px rgb(0 0 0 / 10%);\n }\n @media (prefers-color-scheme: dark) {\n :root:not([data-theme=\"light\"]) {\n color-scheme: dark;\n --gramlot-background: #17201d;\n --gramlot-surface: #202c27;\n --gramlot-header-background: #334d40;\n --gramlot-header-color: #ebf3ee;\n --gramlot-surface-subtle: #2a3932;\n --gramlot-ink: #ebf3ee;\n --gramlot-text-secondary: #b6c9be;\n --gramlot-border: #40594a;\n --gramlot-border-control: #7c9987;\n --gramlot-action: #8ad8c4;\n --gramlot-action-hover: #b0eadc;\n --gramlot-selected: #2d4c40;\n --gramlot-field-background: #202c27;\n --gramlot-field-readonly-background: #2a3932;\n --gramlot-label-color: #b6c9be;\n --gramlot-focus-ring: #8ad8c4;\n --gramlot-brand-blue: #8ad8c4;\n --gramlot-brand-yellow: #8ad8c4;\n --gramlot-navigation: #17201d;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n }\n :root[data-theme=\"dark\"] {\n color-scheme: dark;\n --gramlot-background: #17201d;\n --gramlot-surface: #202c27;\n --gramlot-header-background: #334d40;\n --gramlot-header-color: #ebf3ee;\n --gramlot-surface-subtle: #2a3932;\n --gramlot-ink: #ebf3ee;\n --gramlot-text-secondary: #b6c9be;\n --gramlot-border: #40594a;\n --gramlot-border-control: #7c9987;\n --gramlot-action: #8ad8c4;\n --gramlot-action-hover: #b0eadc;\n --gramlot-selected: #2d4c40;\n --gramlot-field-background: #202c27;\n --gramlot-field-readonly-background: #2a3932;\n --gramlot-label-color: #b6c9be;\n --gramlot-focus-ring: #8ad8c4;\n --gramlot-brand-blue: #8ad8c4;\n --gramlot-brand-yellow: #8ad8c4;\n --gramlot-navigation: #17201d;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n}\n@layer gramlot.base {\n html { font-size: 12.5px; }\n body { line-height: 1.4; }\n :where(h1,h2,h3,h4,h5,h6,p,ul,ol,dl,blockquote,pre,figure) { margin-block: 0 var(--gramlot-space-3); }\n h1 { font-size: 1.4rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }\n :where(h1,h2,h3) { letter-spacing: -.015em; }\n pre { padding: var(--gramlot-space-3); }\n hr { margin-block: var(--gramlot-space-6); }\n}\n@layer gramlot.components {\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button) {\n min-block-size: var(--gramlot-field-height); padding: var(--gramlot-button-padding);\n font-size: 1rem; line-height: 1.3; font-weight: 500;\n background: var(--gramlot-button-background); color: var(--gramlot-ink); border-color: var(--gramlot-border-control);\n }\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button):hover:not(:disabled) {\n background: var(--gramlot-selected); color: var(--gramlot-action-hover); border-color: var(--gramlot-action);\n }\n :where(label) { font-size: 1em; font-weight: 400; color: var(--gramlot-label-color); margin-block-end: var(--gramlot-label-gap); }\n :where(input[readonly],textarea[readonly]) { background: var(--gramlot-field-readonly-background); }\n :where(.button--quiet,button.quiet) { background: transparent; color: var(--gramlot-action); border-color: transparent; }\n :where(.button--quiet,button.quiet):hover:not(:disabled) { background: var(--gramlot-selected); border-color: transparent; }\n :where(textarea) { min-block-size: 4.5rem; }\n :where(input[type=\"color\"]) { min-block-size: var(--gramlot-field-height); }\n :where(input[type=\"file\"])::file-selector-button { padding: var(--gramlot-field-padding); }\n :where(fieldset,details) { padding: var(--gramlot-space-3); margin-block-end: var(--gramlot-space-3); }\n :where(table) { font-size: 1rem; }\n :where(th,td) { padding: var(--gramlot-field-padding); height: var(--gramlot-field-height); vertical-align: middle; }\n :where(details[open]>summary) { margin-block-end: var(--gramlot-space-3); }\n :where(dialog) { padding: var(--gramlot-space-4); }\n}\n@layer gramlot.utilities {\n .example-page { inline-size: min(100% - 2 * var(--gramlot-space-4),var(--gramlot-page-width)); padding-block: var(--gramlot-space-4); }\n .card { padding: var(--gramlot-space-4); box-shadow: none; }\n}\n\n/* Resident Bag grid: shared palette and theme density. */\n:root {\n --gramlot-grid-row-height: 24px;\n --gramlot-grid-header-height: 24px;\n --gramlot-grid-group-height: 20px;\n --gramlot-grid-cell-padding: 2px 6px;\n}\n","joanna":"/* gramlot-compact: professional density profile; load after Base. */\n@layer gramlot.tokens {\n :root {\n color-scheme: light;\n --gramlot-background: #f3f5f7;\n --gramlot-surface: #ffffff;\n --gramlot-header-background: #303946;\n --gramlot-header-color: #ffffff;\n --gramlot-surface-subtle: #e9edf2;\n --gramlot-ink: #202936;\n --gramlot-text-secondary: #526174;\n --gramlot-border: #ccd3dc;\n --gramlot-border-control: #7b899b;\n --gramlot-action: #235db2;\n --gramlot-action-hover: #194987;\n --gramlot-selected: #e3edfb;\n --gramlot-field-background: #ffffff;\n --gramlot-field-readonly-background: #e9edf2;\n --gramlot-label-color: #526174;\n --gramlot-focus-ring: #235db2;\n --gramlot-brand-blue: #235db2;\n --gramlot-brand-yellow: #235db2;\n --gramlot-navigation: #202936;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #aa2637;\n --gramlot-error-background: #fff0f1;\n --gramlot-success: #236747;\n --gramlot-success-background: #e9f4ec;\n --gramlot-warning: #735313;\n --gramlot-warning-background: #fff5da;\n --gramlot-field-height: 28px;\n --gramlot-field-padding: 2px 7px;\n --gramlot-field-line-height: 1.3;\n --gramlot-field-font-size: 1rem;\n --gramlot-button-padding: 2px 7px;\n --gramlot-button-gap: 4px;\n --gramlot-button-background: var(--gramlot-surface);\n --gramlot-button-hover: var(--gramlot-selected);\n --gramlot-label-size: 1em;\n --gramlot-label-gap: 3px;\n --gramlot-radius-sm: 4px;\n --gramlot-radius: 4px;\n --gramlot-radius-lg: 6px;\n --gramlot-window-radius: 6px;\n --gramlot-toolbar-gap: 2px;\n --gramlot-tree-row-height: var(--gramlot-field-height);\n --gramlot-space-1: 3px;\n --gramlot-space-2: 4px;\n --gramlot-space-3: 8px;\n --gramlot-space-4: 8px;\n --gramlot-space-6: 12px;\n --gramlot-space-8: 16px;\n --gramlot-space-12: 24px;\n --gramlot-tab-height: 28px;\n --gramlot-tab-padding: 2px 7px;\n --gramlot-tab-radius: 4px;\n --gramlot-tab-gap: 2px;\n --gramlot-tab-strip-padding: 2px;\n --gramlot-tab-background: var(--gramlot-surface-subtle);\n --gramlot-tab-selected-background: var(--gramlot-surface);\n --gramlot-tab-selected-color: var(--gramlot-action);\n --gramlot-tab-border: var(--gramlot-border);\n --gramlot-shadow: 0 2px 8px rgb(0 0 0 / 10%);\n }\n @media (prefers-color-scheme: dark) {\n :root:not([data-theme=\"light\"]) {\n color-scheme: dark;\n --gramlot-background: #171c24;\n --gramlot-surface: #222a35;\n --gramlot-header-background: #354152;\n --gramlot-header-color: #edf1f7;\n --gramlot-surface-subtle: #2b3543;\n --gramlot-ink: #edf1f7;\n --gramlot-text-secondary: #b8c4d4;\n --gramlot-border: #435064;\n --gramlot-border-control: #7f90a7;\n --gramlot-action: #9dbff4;\n --gramlot-action-hover: #c1d6ff;\n --gramlot-selected: #314766;\n --gramlot-field-background: #222a35;\n --gramlot-field-readonly-background: #2b3543;\n --gramlot-label-color: #b8c4d4;\n --gramlot-focus-ring: #9dbff4;\n --gramlot-brand-blue: #9dbff4;\n --gramlot-brand-yellow: #9dbff4;\n --gramlot-navigation: #171c24;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n }\n :root[data-theme=\"dark\"] {\n color-scheme: dark;\n --gramlot-background: #171c24;\n --gramlot-surface: #222a35;\n --gramlot-header-background: #354152;\n --gramlot-header-color: #edf1f7;\n --gramlot-surface-subtle: #2b3543;\n --gramlot-ink: #edf1f7;\n --gramlot-text-secondary: #b8c4d4;\n --gramlot-border: #435064;\n --gramlot-border-control: #7f90a7;\n --gramlot-action: #9dbff4;\n --gramlot-action-hover: #c1d6ff;\n --gramlot-selected: #314766;\n --gramlot-field-background: #222a35;\n --gramlot-field-readonly-background: #2b3543;\n --gramlot-label-color: #b8c4d4;\n --gramlot-focus-ring: #9dbff4;\n --gramlot-brand-blue: #9dbff4;\n --gramlot-brand-yellow: #9dbff4;\n --gramlot-navigation: #171c24;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n}\n@layer gramlot.base {\n html { font-size: 13px; }\n body { line-height: 1.4; }\n :where(h1,h2,h3,h4,h5,h6,p,ul,ol,dl,blockquote,pre,figure) { margin-block: 0 var(--gramlot-space-3); }\n h1 { font-size: 1.4rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }\n :where(h1,h2,h3) { letter-spacing: -.015em; }\n pre { padding: var(--gramlot-space-3); }\n hr { margin-block: var(--gramlot-space-6); }\n}\n@layer gramlot.components {\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button) {\n min-block-size: var(--gramlot-field-height); padding: var(--gramlot-button-padding);\n font-size: 1rem; line-height: 1.3; font-weight: 500;\n background: var(--gramlot-button-background); color: var(--gramlot-ink); border-color: var(--gramlot-border-control);\n }\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button):hover:not(:disabled) {\n background: var(--gramlot-selected); color: var(--gramlot-action-hover); border-color: var(--gramlot-action);\n }\n :where(label) { font-size: 1em; font-weight: 400; color: var(--gramlot-label-color); margin-block-end: var(--gramlot-label-gap); }\n :where(input[readonly],textarea[readonly]) { background: var(--gramlot-field-readonly-background); }\n :where(.button--quiet,button.quiet) { background: transparent; color: var(--gramlot-action); border-color: transparent; }\n :where(.button--quiet,button.quiet):hover:not(:disabled) { background: var(--gramlot-selected); border-color: transparent; }\n :where(textarea) { min-block-size: 4.5rem; }\n :where(input[type=\"color\"]) { min-block-size: var(--gramlot-field-height); }\n :where(input[type=\"file\"])::file-selector-button { padding: var(--gramlot-field-padding); }\n :where(fieldset,details) { padding: var(--gramlot-space-3); margin-block-end: var(--gramlot-space-3); }\n :where(table) { font-size: 1rem; }\n :where(th,td) { padding: var(--gramlot-field-padding); height: var(--gramlot-field-height); vertical-align: middle; }\n :where(details[open]>summary) { margin-block-end: var(--gramlot-space-3); }\n :where(dialog) { padding: var(--gramlot-space-4); }\n}\n@layer gramlot.utilities {\n .example-page { inline-size: min(100% - 2 * var(--gramlot-space-4),var(--gramlot-page-width)); padding-block: var(--gramlot-space-4); }\n .card { padding: var(--gramlot-space-4); box-shadow: none; }\n}\n\n/* Resident Bag grid: shared palette and theme density. */\n:root {\n --gramlot-grid-row-height: 32px;\n --gramlot-grid-header-height: 30px;\n --gramlot-grid-group-height: 22px;\n --gramlot-grid-cell-padding: .25rem .65rem;\n}\n\n/* joanna: professional density profile; load after Base and Compact. */\n@layer gramlot.tokens {\n :root {\n color-scheme: light;\n --gramlot-background: #f5f4f2;\n --gramlot-surface: #ffffff;\n --gramlot-header-background: #3f4249;\n --gramlot-header-color: #ffffff;\n --gramlot-surface-subtle: #eeece8;\n --gramlot-ink: #292c31;\n --gramlot-text-secondary: #5d636c;\n --gramlot-border: #d5d2cc;\n --gramlot-border-control: #858990;\n --gramlot-action: #245fb4;\n --gramlot-action-hover: #194880;\n --gramlot-selected: #e6eef9;\n --gramlot-field-background: #ffffff;\n --gramlot-field-readonly-background: #eeece8;\n --gramlot-label-color: #5d636c;\n --gramlot-focus-ring: #245fb4;\n --gramlot-brand-blue: #245fb4;\n --gramlot-brand-yellow: #245fb4;\n --gramlot-navigation: #292c31;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #aa2637;\n --gramlot-error-background: #fff0f1;\n --gramlot-success: #236747;\n --gramlot-success-background: #e9f4ec;\n --gramlot-warning: #735313;\n --gramlot-warning-background: #fff5da;\n --gramlot-field-height: 32px;\n --gramlot-field-padding: 3px 9px;\n --gramlot-field-line-height: 1.3;\n --gramlot-field-font-size: 1rem;\n --gramlot-button-padding: 3px 9px;\n --gramlot-button-gap: 4px;\n --gramlot-button-background: var(--gramlot-surface);\n --gramlot-button-hover: var(--gramlot-selected);\n --gramlot-label-size: 1em;\n --gramlot-label-gap: 3px;\n --gramlot-radius-sm: 6px;\n --gramlot-radius: 6px;\n --gramlot-radius-lg: 8px;\n --gramlot-window-radius: 8px;\n --gramlot-toolbar-gap: 2px;\n --gramlot-tree-row-height: var(--gramlot-field-height);\n --gramlot-space-1: 3px;\n --gramlot-space-2: 5px;\n --gramlot-space-3: 10px;\n --gramlot-space-4: 10px;\n --gramlot-space-6: 15px;\n --gramlot-space-8: 20px;\n --gramlot-space-12: 30px;\n --gramlot-tab-height: 32px;\n --gramlot-tab-padding: 3px 9px;\n --gramlot-tab-radius: 6px;\n --gramlot-tab-gap: 2px;\n --gramlot-tab-strip-padding: 2px;\n --gramlot-tab-background: var(--gramlot-surface-subtle);\n --gramlot-tab-selected-background: var(--gramlot-surface);\n --gramlot-tab-selected-color: var(--gramlot-action);\n --gramlot-tab-border: var(--gramlot-border);\n --gramlot-shadow: 0 2px 8px rgb(0 0 0 / 10%);\n }\n @media (prefers-color-scheme: dark) {\n :root:not([data-theme=\"light\"]) {\n color-scheme: dark;\n --gramlot-background: #1b1c20;\n --gramlot-surface: #25272c;\n --gramlot-header-background: #41444c;\n --gramlot-header-color: #f3f2ef;\n --gramlot-surface-subtle: #303239;\n --gramlot-ink: #f3f2ef;\n --gramlot-text-secondary: #c4c3c0;\n --gramlot-border: #454951;\n --gramlot-border-control: #858c99;\n --gramlot-action: #abcbff;\n --gramlot-action-hover: #cedfff;\n --gramlot-selected: #324765;\n --gramlot-field-background: #25272c;\n --gramlot-field-readonly-background: #303239;\n --gramlot-label-color: #c4c3c0;\n --gramlot-focus-ring: #abcbff;\n --gramlot-brand-blue: #abcbff;\n --gramlot-brand-yellow: #abcbff;\n --gramlot-navigation: #1b1c20;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n }\n :root[data-theme=\"dark\"] {\n color-scheme: dark;\n --gramlot-background: #1b1c20;\n --gramlot-surface: #25272c;\n --gramlot-header-background: #41444c;\n --gramlot-header-color: #f3f2ef;\n --gramlot-surface-subtle: #303239;\n --gramlot-ink: #f3f2ef;\n --gramlot-text-secondary: #c4c3c0;\n --gramlot-border: #454951;\n --gramlot-border-control: #858c99;\n --gramlot-action: #abcbff;\n --gramlot-action-hover: #cedfff;\n --gramlot-selected: #324765;\n --gramlot-field-background: #25272c;\n --gramlot-field-readonly-background: #303239;\n --gramlot-label-color: #c4c3c0;\n --gramlot-focus-ring: #abcbff;\n --gramlot-brand-blue: #abcbff;\n --gramlot-brand-yellow: #abcbff;\n --gramlot-navigation: #1b1c20;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n}\n@layer gramlot.base {\n html { font-size: 14px; }\n body { line-height: 1.4; }\n :where(h1,h2,h3,h4,h5,h6,p,ul,ol,dl,blockquote,pre,figure) { margin-block: 0 var(--gramlot-space-3); }\n h1 { font-size: 1.4rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }\n :where(h1,h2,h3) { letter-spacing: -.015em; }\n pre { padding: var(--gramlot-space-3); }\n hr { margin-block: var(--gramlot-space-6); }\n}\n@layer gramlot.components {\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button) {\n min-block-size: var(--gramlot-field-height); padding: var(--gramlot-button-padding);\n font-size: 1rem; line-height: 1.3; font-weight: 500;\n background: var(--gramlot-button-background); color: var(--gramlot-ink); border-color: var(--gramlot-border-control);\n }\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button):hover:not(:disabled) {\n background: var(--gramlot-selected); color: var(--gramlot-action-hover); border-color: var(--gramlot-action);\n }\n :where(label) { font-size: 1em; font-weight: 400; color: var(--gramlot-label-color); margin-block-end: var(--gramlot-label-gap); }\n :where(input[readonly],textarea[readonly]) { background: var(--gramlot-field-readonly-background); }\n :where(.button--quiet,button.quiet) { background: transparent; color: var(--gramlot-action); border-color: transparent; }\n :where(.button--quiet,button.quiet):hover:not(:disabled) { background: var(--gramlot-selected); border-color: transparent; }\n :where(textarea) { min-block-size: 4.5rem; }\n :where(input[type=\"color\"]) { min-block-size: var(--gramlot-field-height); }\n :where(input[type=\"file\"])::file-selector-button { padding: var(--gramlot-field-padding); }\n :where(fieldset,details) { padding: var(--gramlot-space-3); margin-block-end: var(--gramlot-space-3); }\n :where(table) { font-size: 1rem; }\n :where(th,td) { padding: var(--gramlot-field-padding); height: var(--gramlot-field-height); vertical-align: middle; }\n :where(details[open]>summary) { margin-block-end: var(--gramlot-space-3); }\n :where(dialog) { padding: var(--gramlot-space-4); }\n}\n@layer gramlot.utilities {\n .example-page { inline-size: min(100% - 2 * var(--gramlot-space-4),var(--gramlot-page-width)); padding-block: var(--gramlot-space-4); }\n .card { padding: var(--gramlot-space-4); box-shadow: none; }\n}\n\n/* Resident Bag grid: shared palette and theme density. */\n:root {\n --gramlot-grid-row-height: 26px;\n --gramlot-grid-header-height: 26px;\n --gramlot-grid-group-height: 22px;\n --gramlot-grid-cell-padding: 3px 8px;\n}\n","mela":"/* gramlot-compact: professional density profile; load after Base. */\n@layer gramlot.tokens {\n :root {\n color-scheme: light;\n --gramlot-background: #f3f5f7;\n --gramlot-surface: #ffffff;\n --gramlot-header-background: #303946;\n --gramlot-header-color: #ffffff;\n --gramlot-surface-subtle: #e9edf2;\n --gramlot-ink: #202936;\n --gramlot-text-secondary: #526174;\n --gramlot-border: #ccd3dc;\n --gramlot-border-control: #7b899b;\n --gramlot-action: #235db2;\n --gramlot-action-hover: #194987;\n --gramlot-selected: #e3edfb;\n --gramlot-field-background: #ffffff;\n --gramlot-field-readonly-background: #e9edf2;\n --gramlot-label-color: #526174;\n --gramlot-focus-ring: #235db2;\n --gramlot-brand-blue: #235db2;\n --gramlot-brand-yellow: #235db2;\n --gramlot-navigation: #202936;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #aa2637;\n --gramlot-error-background: #fff0f1;\n --gramlot-success: #236747;\n --gramlot-success-background: #e9f4ec;\n --gramlot-warning: #735313;\n --gramlot-warning-background: #fff5da;\n --gramlot-field-height: 28px;\n --gramlot-field-padding: 2px 7px;\n --gramlot-field-line-height: 1.3;\n --gramlot-field-font-size: 1rem;\n --gramlot-button-padding: 2px 7px;\n --gramlot-button-gap: 4px;\n --gramlot-button-background: var(--gramlot-surface);\n --gramlot-button-hover: var(--gramlot-selected);\n --gramlot-label-size: 1em;\n --gramlot-label-gap: 3px;\n --gramlot-radius-sm: 4px;\n --gramlot-radius: 4px;\n --gramlot-radius-lg: 6px;\n --gramlot-window-radius: 6px;\n --gramlot-toolbar-gap: 2px;\n --gramlot-tree-row-height: var(--gramlot-field-height);\n --gramlot-space-1: 3px;\n --gramlot-space-2: 4px;\n --gramlot-space-3: 8px;\n --gramlot-space-4: 8px;\n --gramlot-space-6: 12px;\n --gramlot-space-8: 16px;\n --gramlot-space-12: 24px;\n --gramlot-tab-height: 28px;\n --gramlot-tab-padding: 2px 7px;\n --gramlot-tab-radius: 4px;\n --gramlot-tab-gap: 2px;\n --gramlot-tab-strip-padding: 2px;\n --gramlot-tab-background: var(--gramlot-surface-subtle);\n --gramlot-tab-selected-background: var(--gramlot-surface);\n --gramlot-tab-selected-color: var(--gramlot-action);\n --gramlot-tab-border: var(--gramlot-border);\n --gramlot-shadow: 0 2px 8px rgb(0 0 0 / 10%);\n }\n @media (prefers-color-scheme: dark) {\n :root:not([data-theme=\"light\"]) {\n color-scheme: dark;\n --gramlot-background: #171c24;\n --gramlot-surface: #222a35;\n --gramlot-header-background: #354152;\n --gramlot-header-color: #edf1f7;\n --gramlot-surface-subtle: #2b3543;\n --gramlot-ink: #edf1f7;\n --gramlot-text-secondary: #b8c4d4;\n --gramlot-border: #435064;\n --gramlot-border-control: #7f90a7;\n --gramlot-action: #9dbff4;\n --gramlot-action-hover: #c1d6ff;\n --gramlot-selected: #314766;\n --gramlot-field-background: #222a35;\n --gramlot-field-readonly-background: #2b3543;\n --gramlot-label-color: #b8c4d4;\n --gramlot-focus-ring: #9dbff4;\n --gramlot-brand-blue: #9dbff4;\n --gramlot-brand-yellow: #9dbff4;\n --gramlot-navigation: #171c24;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n }\n :root[data-theme=\"dark\"] {\n color-scheme: dark;\n --gramlot-background: #171c24;\n --gramlot-surface: #222a35;\n --gramlot-header-background: #354152;\n --gramlot-header-color: #edf1f7;\n --gramlot-surface-subtle: #2b3543;\n --gramlot-ink: #edf1f7;\n --gramlot-text-secondary: #b8c4d4;\n --gramlot-border: #435064;\n --gramlot-border-control: #7f90a7;\n --gramlot-action: #9dbff4;\n --gramlot-action-hover: #c1d6ff;\n --gramlot-selected: #314766;\n --gramlot-field-background: #222a35;\n --gramlot-field-readonly-background: #2b3543;\n --gramlot-label-color: #b8c4d4;\n --gramlot-focus-ring: #9dbff4;\n --gramlot-brand-blue: #9dbff4;\n --gramlot-brand-yellow: #9dbff4;\n --gramlot-navigation: #171c24;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n}\n@layer gramlot.base {\n html { font-size: 13px; }\n body { line-height: 1.4; }\n :where(h1,h2,h3,h4,h5,h6,p,ul,ol,dl,blockquote,pre,figure) { margin-block: 0 var(--gramlot-space-3); }\n h1 { font-size: 1.4rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }\n :where(h1,h2,h3) { letter-spacing: -.015em; }\n pre { padding: var(--gramlot-space-3); }\n hr { margin-block: var(--gramlot-space-6); }\n}\n@layer gramlot.components {\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button) {\n min-block-size: var(--gramlot-field-height); padding: var(--gramlot-button-padding);\n font-size: 1rem; line-height: 1.3; font-weight: 500;\n background: var(--gramlot-button-background); color: var(--gramlot-ink); border-color: var(--gramlot-border-control);\n }\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button):hover:not(:disabled) {\n background: var(--gramlot-selected); color: var(--gramlot-action-hover); border-color: var(--gramlot-action);\n }\n :where(label) { font-size: 1em; font-weight: 400; color: var(--gramlot-label-color); margin-block-end: var(--gramlot-label-gap); }\n :where(input[readonly],textarea[readonly]) { background: var(--gramlot-field-readonly-background); }\n :where(.button--quiet,button.quiet) { background: transparent; color: var(--gramlot-action); border-color: transparent; }\n :where(.button--quiet,button.quiet):hover:not(:disabled) { background: var(--gramlot-selected); border-color: transparent; }\n :where(textarea) { min-block-size: 4.5rem; }\n :where(input[type=\"color\"]) { min-block-size: var(--gramlot-field-height); }\n :where(input[type=\"file\"])::file-selector-button { padding: var(--gramlot-field-padding); }\n :where(fieldset,details) { padding: var(--gramlot-space-3); margin-block-end: var(--gramlot-space-3); }\n :where(table) { font-size: 1rem; }\n :where(th,td) { padding: var(--gramlot-field-padding); height: var(--gramlot-field-height); vertical-align: middle; }\n :where(details[open]>summary) { margin-block-end: var(--gramlot-space-3); }\n :where(dialog) { padding: var(--gramlot-space-4); }\n}\n@layer gramlot.utilities {\n .example-page { inline-size: min(100% - 2 * var(--gramlot-space-4),var(--gramlot-page-width)); padding-block: var(--gramlot-space-4); }\n .card { padding: var(--gramlot-space-4); box-shadow: none; }\n}\n\n/* Resident Bag grid: shared palette and theme density. */\n:root {\n --gramlot-grid-row-height: 32px;\n --gramlot-grid-header-height: 30px;\n --gramlot-grid-group-height: 22px;\n --gramlot-grid-cell-padding: .25rem .65rem;\n}\n\n/* Mela: Apple-inspired desktop and touch appearance; load after Base and Compact. */\n@layer gramlot.tokens {\n :root {\n color-scheme: light;\n --gramlot-font-ui: -apple-system, BlinkMacSystemFont, \"Helvetica Neue\", system-ui, sans-serif;\n --gramlot-font-code: ui-monospace, SFMono-Regular, Menlo, monospace;\n --gramlot-tree-hover-background: var(--gramlot-surface-subtle);\n --gramlot-tree-selected-background: var(--gramlot-selected);\n --gramlot-tree-selected-color: var(--gramlot-ink);\n --gramlot-window-backdrop: rgb(0 0 0 / 24%);\n --gramlot-background: #f2f2f7;\n --gramlot-surface: #ffffff;\n --gramlot-header-background: #38383d;\n --gramlot-header-color: #ffffff;\n --gramlot-surface-subtle: #eaeaed;\n --gramlot-ink: #1d1d1f;\n --gramlot-text-secondary: #636366;\n --gramlot-border: #d9d9de;\n --gramlot-border-control: #8a8a8e;\n --gramlot-action: #0066cc;\n --gramlot-action-hover: #004c99;\n --gramlot-selected: #dceaff;\n --gramlot-field-background: #ffffff;\n --gramlot-field-readonly-background: #eaeaed;\n --gramlot-label-color: #636366;\n --gramlot-focus-ring: #0066cc;\n --gramlot-brand-blue: #0066cc;\n --gramlot-brand-yellow: #0066cc;\n --gramlot-navigation: #eaeaed;\n --gramlot-navigation-text: #1d1d1f;\n --gramlot-error: #b42318;\n --gramlot-error-background: #fff0ee;\n --gramlot-success: #20783d;\n --gramlot-success-background: #eaf7ed;\n --gramlot-warning: #805500;\n --gramlot-warning-background: #fff5dc;\n --gramlot-field-height: 28px;\n --gramlot-field-padding: 3px 8px;\n --gramlot-field-line-height: 1.3;\n --gramlot-field-font-size: 1rem;\n --gramlot-button-padding: 3px 9px;\n --gramlot-button-gap: 4px;\n --gramlot-button-background: #0066cc;\n --gramlot-button-color: #ffffff;\n --gramlot-chrome-background: var(--gramlot-surface);\n --gramlot-button-hover: #004c99;\n --gramlot-label-size: 1em;\n --gramlot-label-gap: 4px;\n --gramlot-radius-sm: 6px;\n --gramlot-radius: 8px;\n --gramlot-radius-lg: 10px;\n --gramlot-window-radius: 12px;\n --gramlot-toolbar-gap: 3px;\n --gramlot-tree-row-height: var(--gramlot-field-height);\n --gramlot-space-1: 3px;\n --gramlot-space-2: 4px;\n --gramlot-space-3: 8px;\n --gramlot-space-4: 12px;\n --gramlot-space-6: 16px;\n --gramlot-space-8: 20px;\n --gramlot-space-12: 28px;\n --gramlot-tab-height: 28px;\n --gramlot-tab-padding: 3px 10px;\n --gramlot-tab-radius: 6px;\n --gramlot-tab-gap: 3px;\n --gramlot-tab-strip-padding: 3px;\n --gramlot-tab-background: var(--gramlot-surface-subtle);\n --gramlot-tab-selected-background: var(--gramlot-surface);\n --gramlot-tab-selected-color: var(--gramlot-action);\n --gramlot-tab-border: var(--gramlot-border);\n --gramlot-shadow: 0 8px 28px rgb(0 0 0 / 16%);\n }\n @media (prefers-color-scheme: dark) {\n :root:not([data-theme=\"light\"]) {\n color-scheme: dark;\n --gramlot-background: #000000;\n --gramlot-surface: #1c1c1e;\n --gramlot-header-background: #323236;\n --gramlot-header-color: #f5f5f7;\n --gramlot-surface-subtle: #38383a;\n --gramlot-ink: #f5f5f7;\n --gramlot-text-secondary: #bdbdc4;\n --gramlot-border: #48484c;\n --gramlot-border-control: #74747c;\n --gramlot-action: #70b7ff;\n --gramlot-action-hover: #abd5ff;\n --gramlot-selected: #244367;\n --gramlot-field-background: #1c1c1e;\n --gramlot-field-readonly-background: #38383a;\n --gramlot-label-color: #bdbdc4;\n --gramlot-focus-ring: #70b7ff;\n --gramlot-brand-blue: #70b7ff;\n --gramlot-brand-yellow: #70b7ff;\n --gramlot-navigation: #1c1c1e;\n --gramlot-navigation-text: #f5f5f7;\n --gramlot-error: #ffb4ab;\n --gramlot-error-background: #492926;\n --gramlot-success: #8ddb9d;\n --gramlot-success-background: #263e2c;\n --gramlot-warning: #f5d581;\n --gramlot-warning-background: #433a26;\n }\n }\n :root[data-theme=\"dark\"] {\n color-scheme: dark;\n --gramlot-background: #000000;\n --gramlot-surface: #1c1c1e;\n --gramlot-header-background: #323236;\n --gramlot-header-color: #f5f5f7;\n --gramlot-surface-subtle: #38383a;\n --gramlot-ink: #f5f5f7;\n --gramlot-text-secondary: #bdbdc4;\n --gramlot-border: #48484c;\n --gramlot-border-control: #74747c;\n --gramlot-action: #70b7ff;\n --gramlot-action-hover: #abd5ff;\n --gramlot-selected: #244367;\n --gramlot-field-background: #1c1c1e;\n --gramlot-field-readonly-background: #38383a;\n --gramlot-label-color: #bdbdc4;\n --gramlot-focus-ring: #70b7ff;\n --gramlot-brand-blue: #70b7ff;\n --gramlot-brand-yellow: #70b7ff;\n --gramlot-navigation: #1c1c1e;\n --gramlot-navigation-text: #f5f5f7;\n --gramlot-error: #ffb4ab;\n --gramlot-error-background: #492926;\n --gramlot-success: #8ddb9d;\n --gramlot-success-background: #263e2c;\n --gramlot-warning: #f5d581;\n --gramlot-warning-background: #433a26;\n }\n}\n@layer gramlot.base {\n html { font-size: 13px; }\n body { line-height: 1.4; }\n :where(h1,h2,h3,h4,h5,h6,p,ul,ol,dl,blockquote,pre,figure) { margin-block: 0 var(--gramlot-space-3); }\n h1 { font-size: 1.4rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }\n :where(h1,h2,h3) { letter-spacing: -.015em; }\n pre { padding: var(--gramlot-space-3); }\n hr { margin-block: var(--gramlot-space-6); }\n}\n@layer gramlot.components {\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button) {\n min-block-size: var(--gramlot-field-height); padding: var(--gramlot-button-padding);\n font-size: 1rem; line-height: 1.3; font-weight: 500;\n background: var(--gramlot-button-background); color: #ffffff; border-color: transparent;\n }\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button):hover:not(:disabled) {\n background: #004c99; color: #ffffff; border-color: transparent;\n }\n gramlot-button.button--secondary,gramlot-toggle-button.button--secondary,gramlot-drop-down-button.button--secondary { background:transparent; border-color:transparent; }\n :where(.button--secondary,button.secondary) { background:var(--gramlot-selected); color:var(--gramlot-action); border-color:transparent; }\n :where(.button--secondary,button.secondary):hover:not(:disabled) { background:var(--gramlot-selected); color:var(--gramlot-action-hover); border-color:var(--gramlot-action); }\n :where(button,.button):active:not(:disabled) { transform:none; filter:brightness(.9); }\n :where(label) { font-size: 1em; font-weight: 400; color: var(--gramlot-label-color); margin-block-end: var(--gramlot-label-gap); }\n :where(input[readonly],textarea[readonly]) { background: var(--gramlot-field-readonly-background); }\n :where(.button--quiet,button.quiet) { background: transparent; color: var(--gramlot-action); border-color: transparent; }\n :where(.button--quiet,button.quiet):hover:not(:disabled) { background: var(--gramlot-selected); border-color: transparent; }\n :where(textarea) { min-block-size: 4.5rem; }\n :where(input[type=\"color\"]) { min-block-size: var(--gramlot-field-height); }\n :where(input[type=\"file\"])::file-selector-button { padding: var(--gramlot-field-padding); }\n :where(fieldset,details) { padding: var(--gramlot-space-3); margin-block-end: var(--gramlot-space-3); }\n :where(table) { font-size: 1rem; }\n :where(th,td) { padding: var(--gramlot-field-padding); height: var(--gramlot-field-height); vertical-align: middle; }\n :where(details[open]>summary) { margin-block-end: var(--gramlot-space-3); }\n :where(dialog) { padding: var(--gramlot-space-4); }\n}\n@layer gramlot.utilities {\n .example-page { inline-size: min(100% - 2 * var(--gramlot-space-4),var(--gramlot-page-width)); padding-block: var(--gramlot-space-4); }\n .card { padding: var(--gramlot-space-4); box-shadow: none; }\n}\n\n/* Responsive density changes appearance only; Source owns layout and modality. */\n@layer gramlot.tokens {\n @media (max-width: 640px), (pointer: coarse) {\n :root {\n --gramlot-field-height: 44px;\n --gramlot-touch-target: 44px;\n --gramlot-field-font-size: 16px;\n --gramlot-field-padding: 8px 12px;\n --gramlot-button-padding: 8px 12px;\n --gramlot-tab-height: 44px;\n --gramlot-radius-sm: 9px;\n --gramlot-radius: 12px;\n --gramlot-radius-lg: 14px;\n --gramlot-window-radius: 16px;\n --gramlot-space-4: 16px;\n }\n }\n}\n@layer gramlot.base {\n @media (max-width: 640px), (pointer: coarse) {\n html { font-size: 17px; }\n @supports (font: -apple-system-body) { html { font: -apple-system-body; } }\n body { line-height:1.4; }\n h1 { font-size:2rem; font-weight:700; letter-spacing:-.025em; }\n h2 { font-size:1.3rem; font-weight:650; }\n h3 { font-size:1.05rem; font-weight:600; }\n }\n}\n\n/* Touch presentation follows the existing density setting; minimums grow with text. */\n@layer gramlot.touch {\n @media (max-width:640px), (pointer:coarse) {\n :root:not([data-gramlot-touch=\"off\"]) {\n --gramlot-field-height:max(44px,2.65rem); --gramlot-field-font-size:max(16px,1rem);\n --gramlot-field-padding:.55rem .75rem; --gramlot-button-padding:.6rem 1rem;\n --gramlot-label-size:.88rem; --gramlot-label-gap:.4rem;\n --gramlot-tree-row-height:max(44px,2.65rem); --gramlot-tab-height:max(44px,2.65rem);\n }\n :where(button,.button,summary,[role=\"tab\"],a) { min-block-size:44px; }\n :where(nav a,.actions a) { display:inline-flex; align-items:center; }\n :where(label:has(input[type=\"checkbox\"]),label:has(input[type=\"radio\"])) { min-block-size:44px; display:inline-flex; align-items:center; gap:.6rem; }\n }\n}\n/* Content stays opaque. Materials are confined to navigation controls. */\n@layer gramlot.components {\n :where([role=\"toolbar\"]) { --gramlot-button-padding:4px 6px; background:var(--gramlot-surface); color:var(--gramlot-ink); }\n @supports (backdrop-filter:blur(16px)) {\n :where([role=\"toolbar\"]) { background:color-mix(in srgb,var(--gramlot-surface) 92%,transparent); backdrop-filter:blur(16px) saturate(1.2); }\n }\n @media (prefers-reduced-transparency:reduce), (prefers-contrast:more) {\n :where([role=\"toolbar\"]) { background:var(--gramlot-surface); backdrop-filter:none; }\n }\n @media (prefers-contrast:more) {\n :where(input,select,textarea,button,.button) { border:2px solid currentColor; }\n :where(a) { text-decoration:underline; }\n }\n @media (prefers-reduced-motion:reduce) {\n :where(button,.button) { transition:none; transform:none; }\n }\n @media (forced-colors:active) {\n :where(button,.button) { background:ButtonFace; color:ButtonText; border-color:ButtonText; filter:none; }\n :where([role=\"toolbar\"]) { background:Canvas; color:CanvasText; backdrop-filter:none; }\n }\n}\n"};
2
+ export const appearanceStyles = {"base":"","compact":"/* gramlot-compact: professional density profile; load after Base. */\n@layer gramlot.tokens {\n :root {\n --gramlot-choice-background: var(--gramlot-field-background);\n --gramlot-choice-border-width: 1px;\n color-scheme: light;\n --gramlot-background: #f3f5f7;\n --gramlot-surface: #ffffff;\n --gramlot-header-background: #303946;\n --gramlot-header-color: #ffffff;\n --gramlot-surface-subtle: #e9edf2;\n --gramlot-ink: #202936;\n --gramlot-text-secondary: #526174;\n --gramlot-border: #ccd3dc;\n --gramlot-border-control: #7b899b;\n --gramlot-action: #235db2;\n --gramlot-action-hover: #194987;\n --gramlot-selected: #e3edfb;\n --gramlot-field-background: #ffffff;\n --gramlot-field-readonly-background: #e9edf2;\n --gramlot-label-color: #526174;\n --gramlot-focus-ring: #235db2;\n --gramlot-brand-blue: #235db2;\n --gramlot-brand-yellow: #235db2;\n --gramlot-navigation: #202936;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #aa2637;\n --gramlot-error-background: #fff0f1;\n --gramlot-success: #236747;\n --gramlot-success-background: #e9f4ec;\n --gramlot-warning: #735313;\n --gramlot-warning-background: #fff5da;\n --gramlot-field-height: 28px;\n --gramlot-field-padding: 2px 7px;\n --gramlot-field-line-height: 1.3;\n --gramlot-field-font-size: 1rem;\n --gramlot-button-padding: 2px 7px;\n --gramlot-button-gap: 4px;\n --gramlot-button-background: var(--gramlot-surface);\n --gramlot-button-hover: var(--gramlot-selected);\n --gramlot-label-size: 1em;\n --gramlot-label-gap: 3px;\n --gramlot-radius-sm: 4px;\n --gramlot-radius: 4px;\n --gramlot-radius-lg: 6px;\n --gramlot-window-radius: 6px;\n --gramlot-toolbar-gap: 2px;\n --gramlot-tree-row-height: var(--gramlot-field-height);\n --gramlot-space-1: 3px;\n --gramlot-space-2: 4px;\n --gramlot-space-3: 8px;\n --gramlot-space-4: 8px;\n --gramlot-space-6: 12px;\n --gramlot-space-8: 16px;\n --gramlot-space-12: 24px;\n --gramlot-tab-height: 28px;\n --gramlot-tab-padding: 2px 7px;\n --gramlot-tab-radius: 4px;\n --gramlot-tab-gap: 2px;\n --gramlot-tab-strip-padding: 2px;\n --gramlot-tab-background: var(--gramlot-surface-subtle);\n --gramlot-tab-selected-background: var(--gramlot-surface);\n --gramlot-tab-selected-color: var(--gramlot-action);\n --gramlot-tab-border: var(--gramlot-border);\n --gramlot-shadow: 0 2px 8px rgb(0 0 0 / 10%);\n }\n @media (prefers-color-scheme: dark) {\n :root:not([data-theme=\"light\"]) {\n color-scheme: dark;\n --gramlot-background: #171c24;\n --gramlot-surface: #222a35;\n --gramlot-header-background: #354152;\n --gramlot-header-color: #edf1f7;\n --gramlot-surface-subtle: #2b3543;\n --gramlot-ink: #edf1f7;\n --gramlot-text-secondary: #b8c4d4;\n --gramlot-border: #435064;\n --gramlot-border-control: #7f90a7;\n --gramlot-action: #9dbff4;\n --gramlot-action-hover: #c1d6ff;\n --gramlot-selected: #314766;\n --gramlot-field-background: #222a35;\n --gramlot-field-readonly-background: #2b3543;\n --gramlot-label-color: #b8c4d4;\n --gramlot-focus-ring: #9dbff4;\n --gramlot-brand-blue: #9dbff4;\n --gramlot-brand-yellow: #9dbff4;\n --gramlot-navigation: #171c24;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n }\n :root[data-theme=\"dark\"] {\n color-scheme: dark;\n --gramlot-background: #171c24;\n --gramlot-surface: #222a35;\n --gramlot-header-background: #354152;\n --gramlot-header-color: #edf1f7;\n --gramlot-surface-subtle: #2b3543;\n --gramlot-ink: #edf1f7;\n --gramlot-text-secondary: #b8c4d4;\n --gramlot-border: #435064;\n --gramlot-border-control: #7f90a7;\n --gramlot-action: #9dbff4;\n --gramlot-action-hover: #c1d6ff;\n --gramlot-selected: #314766;\n --gramlot-field-background: #222a35;\n --gramlot-field-readonly-background: #2b3543;\n --gramlot-label-color: #b8c4d4;\n --gramlot-focus-ring: #9dbff4;\n --gramlot-brand-blue: #9dbff4;\n --gramlot-brand-yellow: #9dbff4;\n --gramlot-navigation: #171c24;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n}\n@layer gramlot.base {\n html { font-size: 13px; }\n body { line-height: 1.4; }\n :where(h1,h2,h3,h4,h5,h6,p,ul,ol,dl,blockquote,pre,figure) { margin-block: 0 var(--gramlot-space-3); }\n h1 { font-size: 1.4rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }\n :where(h1,h2,h3) { letter-spacing: -.015em; }\n pre { padding: var(--gramlot-space-3); }\n hr { margin-block: var(--gramlot-space-6); }\n}\n@layer gramlot.components {\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button) {\n min-block-size: var(--gramlot-field-height); padding: var(--gramlot-button-padding);\n font-size: 1rem; line-height: 1.3; font-weight: 500;\n background: var(--gramlot-button-background); color: var(--gramlot-ink); border-color: var(--gramlot-border-control);\n }\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button):hover:not(:disabled) {\n background: var(--gramlot-selected); color: var(--gramlot-action-hover); border-color: var(--gramlot-action);\n }\n :where(label) { font-size: 1em; font-weight: 400; color: var(--gramlot-label-color); margin-block-end: var(--gramlot-label-gap); }\n :where(input[readonly],textarea[readonly]) { background: var(--gramlot-field-readonly-background); }\n :where(.button--quiet,button.quiet) { background: transparent; color: var(--gramlot-action); border-color: transparent; }\n :where(.button--quiet,button.quiet):hover:not(:disabled) { background: var(--gramlot-selected); border-color: transparent; }\n :where(textarea) { min-block-size: 4.5rem; }\n :where(input[type=\"color\"]) { min-block-size: var(--gramlot-field-height); }\n :where(input[type=\"file\"])::file-selector-button { padding: var(--gramlot-field-padding); }\n :where(fieldset,details) { padding: var(--gramlot-space-3); margin-block-end: var(--gramlot-space-3); }\n :where(table) { font-size: 1rem; }\n :where(th,td) { padding: var(--gramlot-field-padding); height: var(--gramlot-field-height); vertical-align: middle; }\n :where(details[open]>summary) { margin-block-end: var(--gramlot-space-3); }\n :where(dialog) { padding: var(--gramlot-space-4); }\n}\n@layer gramlot.utilities {\n .example-page { inline-size: min(100% - 2 * var(--gramlot-space-4),var(--gramlot-page-width)); padding-block: var(--gramlot-space-4); }\n .card { padding: var(--gramlot-space-4); box-shadow: none; }\n}\n\n/* Resident Bag grid: shared palette and theme density. */\n:root {\n --gramlot-grid-row-height: 32px;\n --gramlot-grid-header-height: 30px;\n --gramlot-grid-group-height: 22px;\n --gramlot-grid-cell-padding: .25rem .65rem;\n}\n","mimi":"/* gramlot-compact: professional density profile; load after Base. */\n@layer gramlot.tokens {\n :root {\n --gramlot-choice-background: var(--gramlot-field-background);\n --gramlot-choice-border-width: 1px;\n color-scheme: light;\n --gramlot-background: #f3f5f7;\n --gramlot-surface: #ffffff;\n --gramlot-header-background: #303946;\n --gramlot-header-color: #ffffff;\n --gramlot-surface-subtle: #e9edf2;\n --gramlot-ink: #202936;\n --gramlot-text-secondary: #526174;\n --gramlot-border: #ccd3dc;\n --gramlot-border-control: #7b899b;\n --gramlot-action: #235db2;\n --gramlot-action-hover: #194987;\n --gramlot-selected: #e3edfb;\n --gramlot-field-background: #ffffff;\n --gramlot-field-readonly-background: #e9edf2;\n --gramlot-label-color: #526174;\n --gramlot-focus-ring: #235db2;\n --gramlot-brand-blue: #235db2;\n --gramlot-brand-yellow: #235db2;\n --gramlot-navigation: #202936;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #aa2637;\n --gramlot-error-background: #fff0f1;\n --gramlot-success: #236747;\n --gramlot-success-background: #e9f4ec;\n --gramlot-warning: #735313;\n --gramlot-warning-background: #fff5da;\n --gramlot-field-height: 28px;\n --gramlot-field-padding: 2px 7px;\n --gramlot-field-line-height: 1.3;\n --gramlot-field-font-size: 1rem;\n --gramlot-button-padding: 2px 7px;\n --gramlot-button-gap: 4px;\n --gramlot-button-background: var(--gramlot-surface);\n --gramlot-button-hover: var(--gramlot-selected);\n --gramlot-label-size: 1em;\n --gramlot-label-gap: 3px;\n --gramlot-radius-sm: 4px;\n --gramlot-radius: 4px;\n --gramlot-radius-lg: 6px;\n --gramlot-window-radius: 6px;\n --gramlot-toolbar-gap: 2px;\n --gramlot-tree-row-height: var(--gramlot-field-height);\n --gramlot-space-1: 3px;\n --gramlot-space-2: 4px;\n --gramlot-space-3: 8px;\n --gramlot-space-4: 8px;\n --gramlot-space-6: 12px;\n --gramlot-space-8: 16px;\n --gramlot-space-12: 24px;\n --gramlot-tab-height: 28px;\n --gramlot-tab-padding: 2px 7px;\n --gramlot-tab-radius: 4px;\n --gramlot-tab-gap: 2px;\n --gramlot-tab-strip-padding: 2px;\n --gramlot-tab-background: var(--gramlot-surface-subtle);\n --gramlot-tab-selected-background: var(--gramlot-surface);\n --gramlot-tab-selected-color: var(--gramlot-action);\n --gramlot-tab-border: var(--gramlot-border);\n --gramlot-shadow: 0 2px 8px rgb(0 0 0 / 10%);\n }\n @media (prefers-color-scheme: dark) {\n :root:not([data-theme=\"light\"]) {\n color-scheme: dark;\n --gramlot-background: #171c24;\n --gramlot-surface: #222a35;\n --gramlot-header-background: #354152;\n --gramlot-header-color: #edf1f7;\n --gramlot-surface-subtle: #2b3543;\n --gramlot-ink: #edf1f7;\n --gramlot-text-secondary: #b8c4d4;\n --gramlot-border: #435064;\n --gramlot-border-control: #7f90a7;\n --gramlot-action: #9dbff4;\n --gramlot-action-hover: #c1d6ff;\n --gramlot-selected: #314766;\n --gramlot-field-background: #222a35;\n --gramlot-field-readonly-background: #2b3543;\n --gramlot-label-color: #b8c4d4;\n --gramlot-focus-ring: #9dbff4;\n --gramlot-brand-blue: #9dbff4;\n --gramlot-brand-yellow: #9dbff4;\n --gramlot-navigation: #171c24;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n }\n :root[data-theme=\"dark\"] {\n color-scheme: dark;\n --gramlot-background: #171c24;\n --gramlot-surface: #222a35;\n --gramlot-header-background: #354152;\n --gramlot-header-color: #edf1f7;\n --gramlot-surface-subtle: #2b3543;\n --gramlot-ink: #edf1f7;\n --gramlot-text-secondary: #b8c4d4;\n --gramlot-border: #435064;\n --gramlot-border-control: #7f90a7;\n --gramlot-action: #9dbff4;\n --gramlot-action-hover: #c1d6ff;\n --gramlot-selected: #314766;\n --gramlot-field-background: #222a35;\n --gramlot-field-readonly-background: #2b3543;\n --gramlot-label-color: #b8c4d4;\n --gramlot-focus-ring: #9dbff4;\n --gramlot-brand-blue: #9dbff4;\n --gramlot-brand-yellow: #9dbff4;\n --gramlot-navigation: #171c24;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n}\n@layer gramlot.base {\n html { font-size: 13px; }\n body { line-height: 1.4; }\n :where(h1,h2,h3,h4,h5,h6,p,ul,ol,dl,blockquote,pre,figure) { margin-block: 0 var(--gramlot-space-3); }\n h1 { font-size: 1.4rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }\n :where(h1,h2,h3) { letter-spacing: -.015em; }\n pre { padding: var(--gramlot-space-3); }\n hr { margin-block: var(--gramlot-space-6); }\n}\n@layer gramlot.components {\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button) {\n min-block-size: var(--gramlot-field-height); padding: var(--gramlot-button-padding);\n font-size: 1rem; line-height: 1.3; font-weight: 500;\n background: var(--gramlot-button-background); color: var(--gramlot-ink); border-color: var(--gramlot-border-control);\n }\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button):hover:not(:disabled) {\n background: var(--gramlot-selected); color: var(--gramlot-action-hover); border-color: var(--gramlot-action);\n }\n :where(label) { font-size: 1em; font-weight: 400; color: var(--gramlot-label-color); margin-block-end: var(--gramlot-label-gap); }\n :where(input[readonly],textarea[readonly]) { background: var(--gramlot-field-readonly-background); }\n :where(.button--quiet,button.quiet) { background: transparent; color: var(--gramlot-action); border-color: transparent; }\n :where(.button--quiet,button.quiet):hover:not(:disabled) { background: var(--gramlot-selected); border-color: transparent; }\n :where(textarea) { min-block-size: 4.5rem; }\n :where(input[type=\"color\"]) { min-block-size: var(--gramlot-field-height); }\n :where(input[type=\"file\"])::file-selector-button { padding: var(--gramlot-field-padding); }\n :where(fieldset,details) { padding: var(--gramlot-space-3); margin-block-end: var(--gramlot-space-3); }\n :where(table) { font-size: 1rem; }\n :where(th,td) { padding: var(--gramlot-field-padding); height: var(--gramlot-field-height); vertical-align: middle; }\n :where(details[open]>summary) { margin-block-end: var(--gramlot-space-3); }\n :where(dialog) { padding: var(--gramlot-space-4); }\n}\n@layer gramlot.utilities {\n .example-page { inline-size: min(100% - 2 * var(--gramlot-space-4),var(--gramlot-page-width)); padding-block: var(--gramlot-space-4); }\n .card { padding: var(--gramlot-space-4); box-shadow: none; }\n}\n\n/* Resident Bag grid: shared palette and theme density. */\n:root {\n --gramlot-grid-row-height: 32px;\n --gramlot-grid-header-height: 30px;\n --gramlot-grid-group-height: 22px;\n --gramlot-grid-cell-padding: .25rem .65rem;\n}\n\n/* mimi: professional density profile; load after Base and Compact. */\n@layer gramlot.tokens {\n :root {\n --gramlot-choice-background: var(--gramlot-field-background);\n --gramlot-choice-border-width: 1px;\n color-scheme: light;\n --gramlot-background: #edf1ef;\n --gramlot-surface: #fbfcfb;\n --gramlot-header-background: #30473c;\n --gramlot-header-color: #fbfcfb;\n --gramlot-surface-subtle: #e2e9e5;\n --gramlot-ink: #24332e;\n --gramlot-text-secondary: #52655d;\n --gramlot-border: #c4d0c9;\n --gramlot-border-control: #768a7e;\n --gramlot-action: #176b61;\n --gramlot-action-hover: #105247;\n --gramlot-selected: #dceee8;\n --gramlot-field-background: #fbfcfb;\n --gramlot-field-readonly-background: #e2e9e5;\n --gramlot-label-color: #52655d;\n --gramlot-focus-ring: #176b61;\n --gramlot-brand-blue: #176b61;\n --gramlot-brand-yellow: #176b61;\n --gramlot-navigation: #24332e;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #aa2637;\n --gramlot-error-background: #fff0f1;\n --gramlot-success: #236747;\n --gramlot-success-background: #e9f4ec;\n --gramlot-warning: #735313;\n --gramlot-warning-background: #fff5da;\n --gramlot-field-height: 24px;\n --gramlot-field-padding: 1px 5px;\n --gramlot-field-line-height: 1.3;\n --gramlot-field-font-size: 1rem;\n --gramlot-button-padding: 1px 5px;\n --gramlot-button-gap: 4px;\n --gramlot-button-background: var(--gramlot-surface);\n --gramlot-button-hover: var(--gramlot-selected);\n --gramlot-label-size: 1em;\n --gramlot-label-gap: 3px;\n --gramlot-radius-sm: 3px;\n --gramlot-radius: 3px;\n --gramlot-radius-lg: 5px;\n --gramlot-window-radius: 5px;\n --gramlot-toolbar-gap: 2px;\n --gramlot-tree-row-height: var(--gramlot-field-height);\n --gramlot-space-1: 3px;\n --gramlot-space-2: 3px;\n --gramlot-space-3: 6px;\n --gramlot-space-4: 6px;\n --gramlot-space-6: 9px;\n --gramlot-space-8: 12px;\n --gramlot-space-12: 18px;\n --gramlot-tab-height: 24px;\n --gramlot-tab-padding: 1px 5px;\n --gramlot-tab-radius: 3px;\n --gramlot-tab-gap: 2px;\n --gramlot-tab-strip-padding: 2px;\n --gramlot-tab-background: var(--gramlot-surface-subtle);\n --gramlot-tab-selected-background: var(--gramlot-surface);\n --gramlot-tab-selected-color: var(--gramlot-action);\n --gramlot-tab-border: var(--gramlot-border);\n --gramlot-shadow: 0 2px 8px rgb(0 0 0 / 10%);\n }\n @media (prefers-color-scheme: dark) {\n :root:not([data-theme=\"light\"]) {\n color-scheme: dark;\n --gramlot-background: #17201d;\n --gramlot-surface: #202c27;\n --gramlot-header-background: #334d40;\n --gramlot-header-color: #ebf3ee;\n --gramlot-surface-subtle: #2a3932;\n --gramlot-ink: #ebf3ee;\n --gramlot-text-secondary: #b6c9be;\n --gramlot-border: #40594a;\n --gramlot-border-control: #7c9987;\n --gramlot-action: #8ad8c4;\n --gramlot-action-hover: #b0eadc;\n --gramlot-selected: #2d4c40;\n --gramlot-field-background: #202c27;\n --gramlot-field-readonly-background: #2a3932;\n --gramlot-label-color: #b6c9be;\n --gramlot-focus-ring: #8ad8c4;\n --gramlot-brand-blue: #8ad8c4;\n --gramlot-brand-yellow: #8ad8c4;\n --gramlot-navigation: #17201d;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n }\n :root[data-theme=\"dark\"] {\n color-scheme: dark;\n --gramlot-background: #17201d;\n --gramlot-surface: #202c27;\n --gramlot-header-background: #334d40;\n --gramlot-header-color: #ebf3ee;\n --gramlot-surface-subtle: #2a3932;\n --gramlot-ink: #ebf3ee;\n --gramlot-text-secondary: #b6c9be;\n --gramlot-border: #40594a;\n --gramlot-border-control: #7c9987;\n --gramlot-action: #8ad8c4;\n --gramlot-action-hover: #b0eadc;\n --gramlot-selected: #2d4c40;\n --gramlot-field-background: #202c27;\n --gramlot-field-readonly-background: #2a3932;\n --gramlot-label-color: #b6c9be;\n --gramlot-focus-ring: #8ad8c4;\n --gramlot-brand-blue: #8ad8c4;\n --gramlot-brand-yellow: #8ad8c4;\n --gramlot-navigation: #17201d;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n}\n@layer gramlot.base {\n html { font-size: 12.5px; }\n body { line-height: 1.4; }\n :where(h1,h2,h3,h4,h5,h6,p,ul,ol,dl,blockquote,pre,figure) { margin-block: 0 var(--gramlot-space-3); }\n h1 { font-size: 1.4rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }\n :where(h1,h2,h3) { letter-spacing: -.015em; }\n pre { padding: var(--gramlot-space-3); }\n hr { margin-block: var(--gramlot-space-6); }\n}\n@layer gramlot.components {\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button) {\n min-block-size: var(--gramlot-field-height); padding: var(--gramlot-button-padding);\n font-size: 1rem; line-height: 1.3; font-weight: 500;\n background: var(--gramlot-button-background); color: var(--gramlot-ink); border-color: var(--gramlot-border-control);\n }\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button):hover:not(:disabled) {\n background: var(--gramlot-selected); color: var(--gramlot-action-hover); border-color: var(--gramlot-action);\n }\n :where(label) { font-size: 1em; font-weight: 400; color: var(--gramlot-label-color); margin-block-end: var(--gramlot-label-gap); }\n :where(input[readonly],textarea[readonly]) { background: var(--gramlot-field-readonly-background); }\n :where(.button--quiet,button.quiet) { background: transparent; color: var(--gramlot-action); border-color: transparent; }\n :where(.button--quiet,button.quiet):hover:not(:disabled) { background: var(--gramlot-selected); border-color: transparent; }\n :where(textarea) { min-block-size: 4.5rem; }\n :where(input[type=\"color\"]) { min-block-size: var(--gramlot-field-height); }\n :where(input[type=\"file\"])::file-selector-button { padding: var(--gramlot-field-padding); }\n :where(fieldset,details) { padding: var(--gramlot-space-3); margin-block-end: var(--gramlot-space-3); }\n :where(table) { font-size: 1rem; }\n :where(th,td) { padding: var(--gramlot-field-padding); height: var(--gramlot-field-height); vertical-align: middle; }\n :where(details[open]>summary) { margin-block-end: var(--gramlot-space-3); }\n :where(dialog) { padding: var(--gramlot-space-4); }\n}\n@layer gramlot.utilities {\n .example-page { inline-size: min(100% - 2 * var(--gramlot-space-4),var(--gramlot-page-width)); padding-block: var(--gramlot-space-4); }\n .card { padding: var(--gramlot-space-4); box-shadow: none; }\n}\n\n/* Resident Bag grid: shared palette and theme density. */\n:root {\n --gramlot-grid-row-height: 24px;\n --gramlot-grid-header-height: 24px;\n --gramlot-grid-group-height: 20px;\n --gramlot-grid-cell-padding: 2px 6px;\n}\n","joanna":"/* gramlot-compact: professional density profile; load after Base. */\n@layer gramlot.tokens {\n :root {\n --gramlot-choice-background: var(--gramlot-field-background);\n --gramlot-choice-border-width: 1px;\n color-scheme: light;\n --gramlot-background: #f3f5f7;\n --gramlot-surface: #ffffff;\n --gramlot-header-background: #303946;\n --gramlot-header-color: #ffffff;\n --gramlot-surface-subtle: #e9edf2;\n --gramlot-ink: #202936;\n --gramlot-text-secondary: #526174;\n --gramlot-border: #ccd3dc;\n --gramlot-border-control: #7b899b;\n --gramlot-action: #235db2;\n --gramlot-action-hover: #194987;\n --gramlot-selected: #e3edfb;\n --gramlot-field-background: #ffffff;\n --gramlot-field-readonly-background: #e9edf2;\n --gramlot-label-color: #526174;\n --gramlot-focus-ring: #235db2;\n --gramlot-brand-blue: #235db2;\n --gramlot-brand-yellow: #235db2;\n --gramlot-navigation: #202936;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #aa2637;\n --gramlot-error-background: #fff0f1;\n --gramlot-success: #236747;\n --gramlot-success-background: #e9f4ec;\n --gramlot-warning: #735313;\n --gramlot-warning-background: #fff5da;\n --gramlot-field-height: 28px;\n --gramlot-field-padding: 2px 7px;\n --gramlot-field-line-height: 1.3;\n --gramlot-field-font-size: 1rem;\n --gramlot-button-padding: 2px 7px;\n --gramlot-button-gap: 4px;\n --gramlot-button-background: var(--gramlot-surface);\n --gramlot-button-hover: var(--gramlot-selected);\n --gramlot-label-size: 1em;\n --gramlot-label-gap: 3px;\n --gramlot-radius-sm: 4px;\n --gramlot-radius: 4px;\n --gramlot-radius-lg: 6px;\n --gramlot-window-radius: 6px;\n --gramlot-toolbar-gap: 2px;\n --gramlot-tree-row-height: var(--gramlot-field-height);\n --gramlot-space-1: 3px;\n --gramlot-space-2: 4px;\n --gramlot-space-3: 8px;\n --gramlot-space-4: 8px;\n --gramlot-space-6: 12px;\n --gramlot-space-8: 16px;\n --gramlot-space-12: 24px;\n --gramlot-tab-height: 28px;\n --gramlot-tab-padding: 2px 7px;\n --gramlot-tab-radius: 4px;\n --gramlot-tab-gap: 2px;\n --gramlot-tab-strip-padding: 2px;\n --gramlot-tab-background: var(--gramlot-surface-subtle);\n --gramlot-tab-selected-background: var(--gramlot-surface);\n --gramlot-tab-selected-color: var(--gramlot-action);\n --gramlot-tab-border: var(--gramlot-border);\n --gramlot-shadow: 0 2px 8px rgb(0 0 0 / 10%);\n }\n @media (prefers-color-scheme: dark) {\n :root:not([data-theme=\"light\"]) {\n color-scheme: dark;\n --gramlot-background: #171c24;\n --gramlot-surface: #222a35;\n --gramlot-header-background: #354152;\n --gramlot-header-color: #edf1f7;\n --gramlot-surface-subtle: #2b3543;\n --gramlot-ink: #edf1f7;\n --gramlot-text-secondary: #b8c4d4;\n --gramlot-border: #435064;\n --gramlot-border-control: #7f90a7;\n --gramlot-action: #9dbff4;\n --gramlot-action-hover: #c1d6ff;\n --gramlot-selected: #314766;\n --gramlot-field-background: #222a35;\n --gramlot-field-readonly-background: #2b3543;\n --gramlot-label-color: #b8c4d4;\n --gramlot-focus-ring: #9dbff4;\n --gramlot-brand-blue: #9dbff4;\n --gramlot-brand-yellow: #9dbff4;\n --gramlot-navigation: #171c24;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n }\n :root[data-theme=\"dark\"] {\n color-scheme: dark;\n --gramlot-background: #171c24;\n --gramlot-surface: #222a35;\n --gramlot-header-background: #354152;\n --gramlot-header-color: #edf1f7;\n --gramlot-surface-subtle: #2b3543;\n --gramlot-ink: #edf1f7;\n --gramlot-text-secondary: #b8c4d4;\n --gramlot-border: #435064;\n --gramlot-border-control: #7f90a7;\n --gramlot-action: #9dbff4;\n --gramlot-action-hover: #c1d6ff;\n --gramlot-selected: #314766;\n --gramlot-field-background: #222a35;\n --gramlot-field-readonly-background: #2b3543;\n --gramlot-label-color: #b8c4d4;\n --gramlot-focus-ring: #9dbff4;\n --gramlot-brand-blue: #9dbff4;\n --gramlot-brand-yellow: #9dbff4;\n --gramlot-navigation: #171c24;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n}\n@layer gramlot.base {\n html { font-size: 13px; }\n body { line-height: 1.4; }\n :where(h1,h2,h3,h4,h5,h6,p,ul,ol,dl,blockquote,pre,figure) { margin-block: 0 var(--gramlot-space-3); }\n h1 { font-size: 1.4rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }\n :where(h1,h2,h3) { letter-spacing: -.015em; }\n pre { padding: var(--gramlot-space-3); }\n hr { margin-block: var(--gramlot-space-6); }\n}\n@layer gramlot.components {\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button) {\n min-block-size: var(--gramlot-field-height); padding: var(--gramlot-button-padding);\n font-size: 1rem; line-height: 1.3; font-weight: 500;\n background: var(--gramlot-button-background); color: var(--gramlot-ink); border-color: var(--gramlot-border-control);\n }\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button):hover:not(:disabled) {\n background: var(--gramlot-selected); color: var(--gramlot-action-hover); border-color: var(--gramlot-action);\n }\n :where(label) { font-size: 1em; font-weight: 400; color: var(--gramlot-label-color); margin-block-end: var(--gramlot-label-gap); }\n :where(input[readonly],textarea[readonly]) { background: var(--gramlot-field-readonly-background); }\n :where(.button--quiet,button.quiet) { background: transparent; color: var(--gramlot-action); border-color: transparent; }\n :where(.button--quiet,button.quiet):hover:not(:disabled) { background: var(--gramlot-selected); border-color: transparent; }\n :where(textarea) { min-block-size: 4.5rem; }\n :where(input[type=\"color\"]) { min-block-size: var(--gramlot-field-height); }\n :where(input[type=\"file\"])::file-selector-button { padding: var(--gramlot-field-padding); }\n :where(fieldset,details) { padding: var(--gramlot-space-3); margin-block-end: var(--gramlot-space-3); }\n :where(table) { font-size: 1rem; }\n :where(th,td) { padding: var(--gramlot-field-padding); height: var(--gramlot-field-height); vertical-align: middle; }\n :where(details[open]>summary) { margin-block-end: var(--gramlot-space-3); }\n :where(dialog) { padding: var(--gramlot-space-4); }\n}\n@layer gramlot.utilities {\n .example-page { inline-size: min(100% - 2 * var(--gramlot-space-4),var(--gramlot-page-width)); padding-block: var(--gramlot-space-4); }\n .card { padding: var(--gramlot-space-4); box-shadow: none; }\n}\n\n/* Resident Bag grid: shared palette and theme density. */\n:root {\n --gramlot-grid-row-height: 32px;\n --gramlot-grid-header-height: 30px;\n --gramlot-grid-group-height: 22px;\n --gramlot-grid-cell-padding: .25rem .65rem;\n}\n\n/* joanna: professional density profile; load after Base and Compact. */\n@layer gramlot.tokens {\n :root {\n --gramlot-choice-background: var(--gramlot-field-background);\n --gramlot-choice-border-width: 1px;\n color-scheme: light;\n --gramlot-background: #f5f4f2;\n --gramlot-surface: #ffffff;\n --gramlot-header-background: #3f4249;\n --gramlot-header-color: #ffffff;\n --gramlot-surface-subtle: #eeece8;\n --gramlot-ink: #292c31;\n --gramlot-text-secondary: #5d636c;\n --gramlot-border: #d5d2cc;\n --gramlot-border-control: #858990;\n --gramlot-action: #245fb4;\n --gramlot-action-hover: #194880;\n --gramlot-selected: #e6eef9;\n --gramlot-field-background: #ffffff;\n --gramlot-field-readonly-background: #eeece8;\n --gramlot-label-color: #5d636c;\n --gramlot-focus-ring: #245fb4;\n --gramlot-brand-blue: #245fb4;\n --gramlot-brand-yellow: #245fb4;\n --gramlot-navigation: #292c31;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #aa2637;\n --gramlot-error-background: #fff0f1;\n --gramlot-success: #236747;\n --gramlot-success-background: #e9f4ec;\n --gramlot-warning: #735313;\n --gramlot-warning-background: #fff5da;\n --gramlot-field-height: 32px;\n --gramlot-field-padding: 3px 9px;\n --gramlot-field-line-height: 1.3;\n --gramlot-field-font-size: 1rem;\n --gramlot-button-padding: 3px 9px;\n --gramlot-button-gap: 4px;\n --gramlot-button-background: var(--gramlot-surface);\n --gramlot-button-hover: var(--gramlot-selected);\n --gramlot-label-size: 1em;\n --gramlot-label-gap: 3px;\n --gramlot-radius-sm: 6px;\n --gramlot-radius: 6px;\n --gramlot-radius-lg: 8px;\n --gramlot-window-radius: 8px;\n --gramlot-toolbar-gap: 2px;\n --gramlot-tree-row-height: var(--gramlot-field-height);\n --gramlot-space-1: 3px;\n --gramlot-space-2: 5px;\n --gramlot-space-3: 10px;\n --gramlot-space-4: 10px;\n --gramlot-space-6: 15px;\n --gramlot-space-8: 20px;\n --gramlot-space-12: 30px;\n --gramlot-tab-height: 32px;\n --gramlot-tab-padding: 3px 9px;\n --gramlot-tab-radius: 6px;\n --gramlot-tab-gap: 2px;\n --gramlot-tab-strip-padding: 2px;\n --gramlot-tab-background: var(--gramlot-surface-subtle);\n --gramlot-tab-selected-background: var(--gramlot-surface);\n --gramlot-tab-selected-color: var(--gramlot-action);\n --gramlot-tab-border: var(--gramlot-border);\n --gramlot-shadow: 0 2px 8px rgb(0 0 0 / 10%);\n }\n @media (prefers-color-scheme: dark) {\n :root:not([data-theme=\"light\"]) {\n color-scheme: dark;\n --gramlot-background: #1b1c20;\n --gramlot-surface: #25272c;\n --gramlot-header-background: #41444c;\n --gramlot-header-color: #f3f2ef;\n --gramlot-surface-subtle: #303239;\n --gramlot-ink: #f3f2ef;\n --gramlot-text-secondary: #c4c3c0;\n --gramlot-border: #454951;\n --gramlot-border-control: #858c99;\n --gramlot-action: #abcbff;\n --gramlot-action-hover: #cedfff;\n --gramlot-selected: #324765;\n --gramlot-field-background: #25272c;\n --gramlot-field-readonly-background: #303239;\n --gramlot-label-color: #c4c3c0;\n --gramlot-focus-ring: #abcbff;\n --gramlot-brand-blue: #abcbff;\n --gramlot-brand-yellow: #abcbff;\n --gramlot-navigation: #1b1c20;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n }\n :root[data-theme=\"dark\"] {\n color-scheme: dark;\n --gramlot-background: #1b1c20;\n --gramlot-surface: #25272c;\n --gramlot-header-background: #41444c;\n --gramlot-header-color: #f3f2ef;\n --gramlot-surface-subtle: #303239;\n --gramlot-ink: #f3f2ef;\n --gramlot-text-secondary: #c4c3c0;\n --gramlot-border: #454951;\n --gramlot-border-control: #858c99;\n --gramlot-action: #abcbff;\n --gramlot-action-hover: #cedfff;\n --gramlot-selected: #324765;\n --gramlot-field-background: #25272c;\n --gramlot-field-readonly-background: #303239;\n --gramlot-label-color: #c4c3c0;\n --gramlot-focus-ring: #abcbff;\n --gramlot-brand-blue: #abcbff;\n --gramlot-brand-yellow: #abcbff;\n --gramlot-navigation: #1b1c20;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n}\n@layer gramlot.base {\n html { font-size: 14px; }\n body { line-height: 1.4; }\n :where(h1,h2,h3,h4,h5,h6,p,ul,ol,dl,blockquote,pre,figure) { margin-block: 0 var(--gramlot-space-3); }\n h1 { font-size: 1.4rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }\n :where(h1,h2,h3) { letter-spacing: -.015em; }\n pre { padding: var(--gramlot-space-3); }\n hr { margin-block: var(--gramlot-space-6); }\n}\n@layer gramlot.components {\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button) {\n min-block-size: var(--gramlot-field-height); padding: var(--gramlot-button-padding);\n font-size: 1rem; line-height: 1.3; font-weight: 500;\n background: var(--gramlot-button-background); color: var(--gramlot-ink); border-color: var(--gramlot-border-control);\n }\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button):hover:not(:disabled) {\n background: var(--gramlot-selected); color: var(--gramlot-action-hover); border-color: var(--gramlot-action);\n }\n :where(label) { font-size: 1em; font-weight: 400; color: var(--gramlot-label-color); margin-block-end: var(--gramlot-label-gap); }\n :where(input[readonly],textarea[readonly]) { background: var(--gramlot-field-readonly-background); }\n :where(.button--quiet,button.quiet) { background: transparent; color: var(--gramlot-action); border-color: transparent; }\n :where(.button--quiet,button.quiet):hover:not(:disabled) { background: var(--gramlot-selected); border-color: transparent; }\n :where(textarea) { min-block-size: 4.5rem; }\n :where(input[type=\"color\"]) { min-block-size: var(--gramlot-field-height); }\n :where(input[type=\"file\"])::file-selector-button { padding: var(--gramlot-field-padding); }\n :where(fieldset,details) { padding: var(--gramlot-space-3); margin-block-end: var(--gramlot-space-3); }\n :where(table) { font-size: 1rem; }\n :where(th,td) { padding: var(--gramlot-field-padding); height: var(--gramlot-field-height); vertical-align: middle; }\n :where(details[open]>summary) { margin-block-end: var(--gramlot-space-3); }\n :where(dialog) { padding: var(--gramlot-space-4); }\n}\n@layer gramlot.utilities {\n .example-page { inline-size: min(100% - 2 * var(--gramlot-space-4),var(--gramlot-page-width)); padding-block: var(--gramlot-space-4); }\n .card { padding: var(--gramlot-space-4); box-shadow: none; }\n}\n\n/* Resident Bag grid: shared palette and theme density. */\n:root {\n --gramlot-grid-row-height: 26px;\n --gramlot-grid-header-height: 26px;\n --gramlot-grid-group-height: 22px;\n --gramlot-grid-cell-padding: 3px 8px;\n}\n","mela":"/* gramlot-compact: professional density profile; load after Base. */\n@layer gramlot.tokens {\n :root {\n --gramlot-choice-background: var(--gramlot-field-background);\n --gramlot-choice-border-width: 1px;\n color-scheme: light;\n --gramlot-background: #f3f5f7;\n --gramlot-surface: #ffffff;\n --gramlot-header-background: #303946;\n --gramlot-header-color: #ffffff;\n --gramlot-surface-subtle: #e9edf2;\n --gramlot-ink: #202936;\n --gramlot-text-secondary: #526174;\n --gramlot-border: #ccd3dc;\n --gramlot-border-control: #7b899b;\n --gramlot-action: #235db2;\n --gramlot-action-hover: #194987;\n --gramlot-selected: #e3edfb;\n --gramlot-field-background: #ffffff;\n --gramlot-field-readonly-background: #e9edf2;\n --gramlot-label-color: #526174;\n --gramlot-focus-ring: #235db2;\n --gramlot-brand-blue: #235db2;\n --gramlot-brand-yellow: #235db2;\n --gramlot-navigation: #202936;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #aa2637;\n --gramlot-error-background: #fff0f1;\n --gramlot-success: #236747;\n --gramlot-success-background: #e9f4ec;\n --gramlot-warning: #735313;\n --gramlot-warning-background: #fff5da;\n --gramlot-field-height: 28px;\n --gramlot-field-padding: 2px 7px;\n --gramlot-field-line-height: 1.3;\n --gramlot-field-font-size: 1rem;\n --gramlot-button-padding: 2px 7px;\n --gramlot-button-gap: 4px;\n --gramlot-button-background: var(--gramlot-surface);\n --gramlot-button-hover: var(--gramlot-selected);\n --gramlot-label-size: 1em;\n --gramlot-label-gap: 3px;\n --gramlot-radius-sm: 4px;\n --gramlot-radius: 4px;\n --gramlot-radius-lg: 6px;\n --gramlot-window-radius: 6px;\n --gramlot-toolbar-gap: 2px;\n --gramlot-tree-row-height: var(--gramlot-field-height);\n --gramlot-space-1: 3px;\n --gramlot-space-2: 4px;\n --gramlot-space-3: 8px;\n --gramlot-space-4: 8px;\n --gramlot-space-6: 12px;\n --gramlot-space-8: 16px;\n --gramlot-space-12: 24px;\n --gramlot-tab-height: 28px;\n --gramlot-tab-padding: 2px 7px;\n --gramlot-tab-radius: 4px;\n --gramlot-tab-gap: 2px;\n --gramlot-tab-strip-padding: 2px;\n --gramlot-tab-background: var(--gramlot-surface-subtle);\n --gramlot-tab-selected-background: var(--gramlot-surface);\n --gramlot-tab-selected-color: var(--gramlot-action);\n --gramlot-tab-border: var(--gramlot-border);\n --gramlot-shadow: 0 2px 8px rgb(0 0 0 / 10%);\n }\n @media (prefers-color-scheme: dark) {\n :root:not([data-theme=\"light\"]) {\n color-scheme: dark;\n --gramlot-background: #171c24;\n --gramlot-surface: #222a35;\n --gramlot-header-background: #354152;\n --gramlot-header-color: #edf1f7;\n --gramlot-surface-subtle: #2b3543;\n --gramlot-ink: #edf1f7;\n --gramlot-text-secondary: #b8c4d4;\n --gramlot-border: #435064;\n --gramlot-border-control: #7f90a7;\n --gramlot-action: #9dbff4;\n --gramlot-action-hover: #c1d6ff;\n --gramlot-selected: #314766;\n --gramlot-field-background: #222a35;\n --gramlot-field-readonly-background: #2b3543;\n --gramlot-label-color: #b8c4d4;\n --gramlot-focus-ring: #9dbff4;\n --gramlot-brand-blue: #9dbff4;\n --gramlot-brand-yellow: #9dbff4;\n --gramlot-navigation: #171c24;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n }\n :root[data-theme=\"dark\"] {\n color-scheme: dark;\n --gramlot-background: #171c24;\n --gramlot-surface: #222a35;\n --gramlot-header-background: #354152;\n --gramlot-header-color: #edf1f7;\n --gramlot-surface-subtle: #2b3543;\n --gramlot-ink: #edf1f7;\n --gramlot-text-secondary: #b8c4d4;\n --gramlot-border: #435064;\n --gramlot-border-control: #7f90a7;\n --gramlot-action: #9dbff4;\n --gramlot-action-hover: #c1d6ff;\n --gramlot-selected: #314766;\n --gramlot-field-background: #222a35;\n --gramlot-field-readonly-background: #2b3543;\n --gramlot-label-color: #b8c4d4;\n --gramlot-focus-ring: #9dbff4;\n --gramlot-brand-blue: #9dbff4;\n --gramlot-brand-yellow: #9dbff4;\n --gramlot-navigation: #171c24;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n}\n@layer gramlot.base {\n html { font-size: 13px; }\n body { line-height: 1.4; }\n :where(h1,h2,h3,h4,h5,h6,p,ul,ol,dl,blockquote,pre,figure) { margin-block: 0 var(--gramlot-space-3); }\n h1 { font-size: 1.4rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }\n :where(h1,h2,h3) { letter-spacing: -.015em; }\n pre { padding: var(--gramlot-space-3); }\n hr { margin-block: var(--gramlot-space-6); }\n}\n@layer gramlot.components {\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button) {\n min-block-size: var(--gramlot-field-height); padding: var(--gramlot-button-padding);\n font-size: 1rem; line-height: 1.3; font-weight: 500;\n background: var(--gramlot-button-background); color: var(--gramlot-ink); border-color: var(--gramlot-border-control);\n }\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button):hover:not(:disabled) {\n background: var(--gramlot-selected); color: var(--gramlot-action-hover); border-color: var(--gramlot-action);\n }\n :where(label) { font-size: 1em; font-weight: 400; color: var(--gramlot-label-color); margin-block-end: var(--gramlot-label-gap); }\n :where(input[readonly],textarea[readonly]) { background: var(--gramlot-field-readonly-background); }\n :where(.button--quiet,button.quiet) { background: transparent; color: var(--gramlot-action); border-color: transparent; }\n :where(.button--quiet,button.quiet):hover:not(:disabled) { background: var(--gramlot-selected); border-color: transparent; }\n :where(textarea) { min-block-size: 4.5rem; }\n :where(input[type=\"color\"]) { min-block-size: var(--gramlot-field-height); }\n :where(input[type=\"file\"])::file-selector-button { padding: var(--gramlot-field-padding); }\n :where(fieldset,details) { padding: var(--gramlot-space-3); margin-block-end: var(--gramlot-space-3); }\n :where(table) { font-size: 1rem; }\n :where(th,td) { padding: var(--gramlot-field-padding); height: var(--gramlot-field-height); vertical-align: middle; }\n :where(details[open]>summary) { margin-block-end: var(--gramlot-space-3); }\n :where(dialog) { padding: var(--gramlot-space-4); }\n}\n@layer gramlot.utilities {\n .example-page { inline-size: min(100% - 2 * var(--gramlot-space-4),var(--gramlot-page-width)); padding-block: var(--gramlot-space-4); }\n .card { padding: var(--gramlot-space-4); box-shadow: none; }\n}\n\n/* Resident Bag grid: shared palette and theme density. */\n:root {\n --gramlot-grid-row-height: 32px;\n --gramlot-grid-header-height: 30px;\n --gramlot-grid-group-height: 22px;\n --gramlot-grid-cell-padding: .25rem .65rem;\n}\n\n/* Mela: Apple-inspired desktop and touch appearance; load after Base and Compact. */\n@layer gramlot.tokens {\n :root {\n --gramlot-choice-background: var(--gramlot-field-background);\n --gramlot-choice-border-width: 1px;\n color-scheme: light;\n --gramlot-font-ui: -apple-system, BlinkMacSystemFont, \"Helvetica Neue\", system-ui, sans-serif;\n --gramlot-font-code: ui-monospace, SFMono-Regular, Menlo, monospace;\n --gramlot-tree-hover-background: var(--gramlot-surface-subtle);\n --gramlot-tree-selected-background: var(--gramlot-selected);\n --gramlot-tree-selected-color: var(--gramlot-ink);\n --gramlot-window-backdrop: rgb(0 0 0 / 24%);\n --gramlot-background: #f2f2f7;\n --gramlot-surface: #ffffff;\n --gramlot-header-background: #38383d;\n --gramlot-header-color: #ffffff;\n --gramlot-surface-subtle: #eaeaed;\n --gramlot-ink: #1d1d1f;\n --gramlot-text-secondary: #636366;\n --gramlot-border: #d9d9de;\n --gramlot-border-control: #8a8a8e;\n --gramlot-action: #0066cc;\n --gramlot-action-hover: #004c99;\n --gramlot-selected: #dceaff;\n --gramlot-field-background: #ffffff;\n --gramlot-field-readonly-background: #eaeaed;\n --gramlot-label-color: #636366;\n --gramlot-focus-ring: #0066cc;\n --gramlot-brand-blue: #0066cc;\n --gramlot-brand-yellow: #0066cc;\n --gramlot-navigation: #eaeaed;\n --gramlot-navigation-text: #1d1d1f;\n --gramlot-error: #b42318;\n --gramlot-error-background: #fff0ee;\n --gramlot-success: #20783d;\n --gramlot-success-background: #eaf7ed;\n --gramlot-warning: #805500;\n --gramlot-warning-background: #fff5dc;\n --gramlot-field-height: 28px;\n --gramlot-field-padding: 3px 8px;\n --gramlot-field-line-height: 1.3;\n --gramlot-field-font-size: 1rem;\n --gramlot-button-padding: 3px 9px;\n --gramlot-button-gap: 4px;\n --gramlot-button-background: #0066cc;\n --gramlot-button-color: #ffffff;\n --gramlot-chrome-background: var(--gramlot-surface);\n --gramlot-button-hover: #004c99;\n --gramlot-label-size: 1em;\n --gramlot-label-gap: 4px;\n --gramlot-radius-sm: 6px;\n --gramlot-radius: 8px;\n --gramlot-radius-lg: 10px;\n --gramlot-window-radius: 12px;\n --gramlot-toolbar-gap: 3px;\n --gramlot-tree-row-height: var(--gramlot-field-height);\n --gramlot-space-1: 3px;\n --gramlot-space-2: 4px;\n --gramlot-space-3: 8px;\n --gramlot-space-4: 12px;\n --gramlot-space-6: 16px;\n --gramlot-space-8: 20px;\n --gramlot-space-12: 28px;\n --gramlot-tab-height: 28px;\n --gramlot-tab-padding: 3px 10px;\n --gramlot-tab-radius: 6px;\n --gramlot-tab-gap: 3px;\n --gramlot-tab-strip-padding: 3px;\n --gramlot-tab-background: var(--gramlot-surface-subtle);\n --gramlot-tab-selected-background: var(--gramlot-surface);\n --gramlot-tab-selected-color: var(--gramlot-action);\n --gramlot-tab-border: var(--gramlot-border);\n --gramlot-shadow: 0 8px 28px rgb(0 0 0 / 16%);\n }\n @media (prefers-color-scheme: dark) {\n :root:not([data-theme=\"light\"]) {\n color-scheme: dark;\n --gramlot-background: #000000;\n --gramlot-surface: #1c1c1e;\n --gramlot-header-background: #323236;\n --gramlot-header-color: #f5f5f7;\n --gramlot-surface-subtle: #38383a;\n --gramlot-ink: #f5f5f7;\n --gramlot-text-secondary: #bdbdc4;\n --gramlot-border: #48484c;\n --gramlot-border-control: #74747c;\n --gramlot-action: #70b7ff;\n --gramlot-action-hover: #abd5ff;\n --gramlot-selected: #244367;\n --gramlot-field-background: #1c1c1e;\n --gramlot-field-readonly-background: #38383a;\n --gramlot-label-color: #bdbdc4;\n --gramlot-focus-ring: #70b7ff;\n --gramlot-brand-blue: #70b7ff;\n --gramlot-brand-yellow: #70b7ff;\n --gramlot-navigation: #1c1c1e;\n --gramlot-navigation-text: #f5f5f7;\n --gramlot-error: #ffb4ab;\n --gramlot-error-background: #492926;\n --gramlot-success: #8ddb9d;\n --gramlot-success-background: #263e2c;\n --gramlot-warning: #f5d581;\n --gramlot-warning-background: #433a26;\n }\n }\n :root[data-theme=\"dark\"] {\n color-scheme: dark;\n --gramlot-background: #000000;\n --gramlot-surface: #1c1c1e;\n --gramlot-header-background: #323236;\n --gramlot-header-color: #f5f5f7;\n --gramlot-surface-subtle: #38383a;\n --gramlot-ink: #f5f5f7;\n --gramlot-text-secondary: #bdbdc4;\n --gramlot-border: #48484c;\n --gramlot-border-control: #74747c;\n --gramlot-action: #70b7ff;\n --gramlot-action-hover: #abd5ff;\n --gramlot-selected: #244367;\n --gramlot-field-background: #1c1c1e;\n --gramlot-field-readonly-background: #38383a;\n --gramlot-label-color: #bdbdc4;\n --gramlot-focus-ring: #70b7ff;\n --gramlot-brand-blue: #70b7ff;\n --gramlot-brand-yellow: #70b7ff;\n --gramlot-navigation: #1c1c1e;\n --gramlot-navigation-text: #f5f5f7;\n --gramlot-error: #ffb4ab;\n --gramlot-error-background: #492926;\n --gramlot-success: #8ddb9d;\n --gramlot-success-background: #263e2c;\n --gramlot-warning: #f5d581;\n --gramlot-warning-background: #433a26;\n }\n}\n@layer gramlot.base {\n html { font-size: 13px; }\n body { line-height: 1.4; }\n :where(h1,h2,h3,h4,h5,h6,p,ul,ol,dl,blockquote,pre,figure) { margin-block: 0 var(--gramlot-space-3); }\n h1 { font-size: 1.4rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }\n :where(h1,h2,h3) { letter-spacing: -.015em; }\n pre { padding: var(--gramlot-space-3); }\n hr { margin-block: var(--gramlot-space-6); }\n}\n@layer gramlot.components {\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button) {\n min-block-size: var(--gramlot-field-height); padding: var(--gramlot-button-padding);\n font-size: 1rem; line-height: 1.3; font-weight: 500;\n background: var(--gramlot-button-background); color: #ffffff; border-color: transparent;\n }\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button):hover:not(:disabled) {\n background: #004c99; color: #ffffff; border-color: transparent;\n }\n gramlot-button.button--secondary,gramlot-toggle-button.button--secondary,gramlot-drop-down-button.button--secondary { background:transparent; border-color:transparent; }\n :where(.button--secondary,button.secondary) { background:var(--gramlot-selected); color:var(--gramlot-action); border-color:transparent; }\n :where(.button--secondary,button.secondary):hover:not(:disabled) { background:var(--gramlot-selected); color:var(--gramlot-action-hover); border-color:var(--gramlot-action); }\n :where(button,.button):active:not(:disabled) { transform:none; filter:brightness(.9); }\n :where(label) { font-size: 1em; font-weight: 400; color: var(--gramlot-label-color); margin-block-end: var(--gramlot-label-gap); }\n :where(input[readonly],textarea[readonly]) { background: var(--gramlot-field-readonly-background); }\n :where(.button--quiet,button.quiet) { background: transparent; color: var(--gramlot-action); border-color: transparent; }\n :where(.button--quiet,button.quiet):hover:not(:disabled) { background: var(--gramlot-selected); border-color: transparent; }\n :where(textarea) { min-block-size: 4.5rem; }\n :where(input[type=\"color\"]) { min-block-size: var(--gramlot-field-height); }\n :where(input[type=\"file\"])::file-selector-button { padding: var(--gramlot-field-padding); }\n :where(fieldset,details) { padding: var(--gramlot-space-3); margin-block-end: var(--gramlot-space-3); }\n :where(table) { font-size: 1rem; }\n :where(th,td) { padding: var(--gramlot-field-padding); height: var(--gramlot-field-height); vertical-align: middle; }\n :where(details[open]>summary) { margin-block-end: var(--gramlot-space-3); }\n :where(dialog) { padding: var(--gramlot-space-4); }\n}\n@layer gramlot.utilities {\n .example-page { inline-size: min(100% - 2 * var(--gramlot-space-4),var(--gramlot-page-width)); padding-block: var(--gramlot-space-4); }\n .card { padding: var(--gramlot-space-4); box-shadow: none; }\n}\n\n/* Responsive density changes appearance only; Source owns layout and modality. */\n@layer gramlot.tokens {\n @media (max-width: 640px), (pointer: coarse) {\n :root {\n --gramlot-field-height: 44px;\n --gramlot-touch-target: 44px;\n --gramlot-field-font-size: 16px;\n --gramlot-field-padding: 8px 12px;\n --gramlot-button-padding: 8px 12px;\n --gramlot-tab-height: 44px;\n --gramlot-radius-sm: 9px;\n --gramlot-radius: 12px;\n --gramlot-radius-lg: 14px;\n --gramlot-window-radius: 16px;\n --gramlot-space-4: 16px;\n }\n }\n}\n@layer gramlot.base {\n @media (max-width: 640px), (pointer: coarse) {\n html { font-size: 17px; }\n @supports (font: -apple-system-body) { html { font: -apple-system-body; } }\n body { line-height:1.4; }\n h1 { font-size:2rem; font-weight:700; letter-spacing:-.025em; }\n h2 { font-size:1.3rem; font-weight:650; }\n h3 { font-size:1.05rem; font-weight:600; }\n }\n}\n\n/* Touch presentation follows the existing density setting; minimums grow with text. */\n@layer gramlot.touch {\n @media (max-width:640px), (pointer:coarse) {\n :root:not([data-gramlot-touch=\"off\"]) {\n --gramlot-field-height:max(44px,2.65rem); --gramlot-field-font-size:max(16px,1rem);\n --gramlot-field-padding:.55rem .75rem; --gramlot-button-padding:.6rem 1rem;\n --gramlot-label-size:.88rem; --gramlot-label-gap:.4rem;\n --gramlot-tree-row-height:max(44px,2.65rem); --gramlot-tab-height:max(44px,2.65rem);\n }\n :where(button,.button,summary,[role=\"tab\"],a) { min-block-size:44px; }\n :where(nav a,.actions a) { display:inline-flex; align-items:center; }\n :where(label:has(input[type=\"checkbox\"]),label:has(input[type=\"radio\"])) { min-block-size:44px; display:inline-flex; align-items:center; gap:.6rem; }\n }\n}\n/* Content stays opaque. Materials are confined to navigation controls. */\n@layer gramlot.components {\n :where([role=\"toolbar\"]) { --gramlot-button-padding:4px 6px; background:var(--gramlot-surface); color:var(--gramlot-ink); }\n @supports (backdrop-filter:blur(16px)) {\n :where([role=\"toolbar\"]) { background:color-mix(in srgb,var(--gramlot-surface) 92%,transparent); backdrop-filter:blur(16px) saturate(1.2); }\n }\n @media (prefers-reduced-transparency:reduce), (prefers-contrast:more) {\n :where([role=\"toolbar\"]) { background:var(--gramlot-surface); backdrop-filter:none; }\n }\n @media (prefers-contrast:more) {\n :where(input,select,textarea,button,.button) { border:2px solid currentColor; }\n :where(a) { text-decoration:underline; }\n }\n @media (prefers-reduced-motion:reduce) {\n :where(button,.button) { transition:none; transform:none; }\n }\n @media (forced-colors:active) {\n :where(button,.button) { background:ButtonFace; color:ButtonText; border-color:ButtonText; filter:none; }\n :where([role=\"toolbar\"]) { background:Canvas; color:CanvasText; backdrop-filter:none; }\n }\n}\n"};
3
3
  export const paletteStyles = {"default":"","compact":"/* Color-only override: load after the chosen appearance profile. */\n@layer gramlot.tokens {\n :root {\n color-scheme: light;\n --gramlot-background: #f3f5f7;\n --gramlot-surface: #ffffff;\n --gramlot-header-background: #303946;\n --gramlot-header-color: #ffffff;\n --gramlot-surface-subtle: #e9edf2;\n --gramlot-ink: #202936;\n --gramlot-text-secondary: #526174;\n --gramlot-border: #ccd3dc;\n --gramlot-border-control: #7b899b;\n --gramlot-action: #235db2;\n --gramlot-action-hover: #194987;\n --gramlot-selected: #e3edfb;\n --gramlot-field-background: #ffffff;\n --gramlot-field-readonly-background: #e9edf2;\n --gramlot-label-color: #526174;\n --gramlot-focus-ring: #235db2;\n --gramlot-brand-blue: #235db2;\n --gramlot-brand-yellow: #235db2;\n --gramlot-navigation: #202936;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #aa2637;\n --gramlot-error-background: #fff0f1;\n --gramlot-success: #236747;\n --gramlot-success-background: #e9f4ec;\n --gramlot-warning: #735313;\n --gramlot-warning-background: #fff5da;\n }\n @media (prefers-color-scheme: dark) {\n :root:not([data-theme=\"light\"]) {\n color-scheme: dark;\n --gramlot-background: #171c24;\n --gramlot-surface: #222a35;\n --gramlot-header-background: #354152;\n --gramlot-header-color: #edf1f7;\n --gramlot-surface-subtle: #2b3543;\n --gramlot-ink: #edf1f7;\n --gramlot-text-secondary: #b8c4d4;\n --gramlot-border: #435064;\n --gramlot-border-control: #7f90a7;\n --gramlot-action: #9dbff4;\n --gramlot-action-hover: #c1d6ff;\n --gramlot-selected: #314766;\n --gramlot-field-background: #222a35;\n --gramlot-field-readonly-background: #2b3543;\n --gramlot-label-color: #b8c4d4;\n --gramlot-focus-ring: #9dbff4;\n --gramlot-brand-blue: #9dbff4;\n --gramlot-brand-yellow: #9dbff4;\n --gramlot-navigation: #171c24;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n }\n :root[data-theme=\"dark\"] {\n color-scheme: dark;\n --gramlot-background: #171c24;\n --gramlot-surface: #222a35;\n --gramlot-header-background: #354152;\n --gramlot-header-color: #edf1f7;\n --gramlot-surface-subtle: #2b3543;\n --gramlot-ink: #edf1f7;\n --gramlot-text-secondary: #b8c4d4;\n --gramlot-border: #435064;\n --gramlot-border-control: #7f90a7;\n --gramlot-action: #9dbff4;\n --gramlot-action-hover: #c1d6ff;\n --gramlot-selected: #314766;\n --gramlot-field-background: #222a35;\n --gramlot-field-readonly-background: #2b3543;\n --gramlot-label-color: #b8c4d4;\n --gramlot-focus-ring: #9dbff4;\n --gramlot-brand-blue: #9dbff4;\n --gramlot-brand-yellow: #9dbff4;\n --gramlot-navigation: #171c24;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n}\n","mimi":"/* Color-only override: load after the chosen appearance profile. */\n@layer gramlot.tokens {\n :root {\n color-scheme: light;\n --gramlot-background: #edf1ef;\n --gramlot-surface: #fbfcfb;\n --gramlot-header-background: #30473c;\n --gramlot-header-color: #fbfcfb;\n --gramlot-surface-subtle: #e2e9e5;\n --gramlot-ink: #24332e;\n --gramlot-text-secondary: #52655d;\n --gramlot-border: #c4d0c9;\n --gramlot-border-control: #768a7e;\n --gramlot-action: #176b61;\n --gramlot-action-hover: #105247;\n --gramlot-selected: #dceee8;\n --gramlot-field-background: #fbfcfb;\n --gramlot-field-readonly-background: #e2e9e5;\n --gramlot-label-color: #52655d;\n --gramlot-focus-ring: #176b61;\n --gramlot-brand-blue: #176b61;\n --gramlot-brand-yellow: #176b61;\n --gramlot-navigation: #24332e;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #aa2637;\n --gramlot-error-background: #fff0f1;\n --gramlot-success: #236747;\n --gramlot-success-background: #e9f4ec;\n --gramlot-warning: #735313;\n --gramlot-warning-background: #fff5da;\n }\n @media (prefers-color-scheme: dark) {\n :root:not([data-theme=\"light\"]) {\n color-scheme: dark;\n --gramlot-background: #17201d;\n --gramlot-surface: #202c27;\n --gramlot-header-background: #334d40;\n --gramlot-header-color: #ebf3ee;\n --gramlot-surface-subtle: #2a3932;\n --gramlot-ink: #ebf3ee;\n --gramlot-text-secondary: #b6c9be;\n --gramlot-border: #40594a;\n --gramlot-border-control: #7c9987;\n --gramlot-action: #8ad8c4;\n --gramlot-action-hover: #b0eadc;\n --gramlot-selected: #2d4c40;\n --gramlot-field-background: #202c27;\n --gramlot-field-readonly-background: #2a3932;\n --gramlot-label-color: #b6c9be;\n --gramlot-focus-ring: #8ad8c4;\n --gramlot-brand-blue: #8ad8c4;\n --gramlot-brand-yellow: #8ad8c4;\n --gramlot-navigation: #17201d;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n }\n :root[data-theme=\"dark\"] {\n color-scheme: dark;\n --gramlot-background: #17201d;\n --gramlot-surface: #202c27;\n --gramlot-header-background: #334d40;\n --gramlot-header-color: #ebf3ee;\n --gramlot-surface-subtle: #2a3932;\n --gramlot-ink: #ebf3ee;\n --gramlot-text-secondary: #b6c9be;\n --gramlot-border: #40594a;\n --gramlot-border-control: #7c9987;\n --gramlot-action: #8ad8c4;\n --gramlot-action-hover: #b0eadc;\n --gramlot-selected: #2d4c40;\n --gramlot-field-background: #202c27;\n --gramlot-field-readonly-background: #2a3932;\n --gramlot-label-color: #b6c9be;\n --gramlot-focus-ring: #8ad8c4;\n --gramlot-brand-blue: #8ad8c4;\n --gramlot-brand-yellow: #8ad8c4;\n --gramlot-navigation: #17201d;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n}\n","joanna":"/* Color-only override: load after the chosen appearance profile. */\n@layer gramlot.tokens {\n :root {\n color-scheme: light;\n --gramlot-background: #f5f4f2;\n --gramlot-surface: #ffffff;\n --gramlot-header-background: #3f4249;\n --gramlot-header-color: #ffffff;\n --gramlot-surface-subtle: #eeece8;\n --gramlot-ink: #292c31;\n --gramlot-text-secondary: #5d636c;\n --gramlot-border: #d5d2cc;\n --gramlot-border-control: #858990;\n --gramlot-action: #245fb4;\n --gramlot-action-hover: #194880;\n --gramlot-selected: #e6eef9;\n --gramlot-field-background: #ffffff;\n --gramlot-field-readonly-background: #eeece8;\n --gramlot-label-color: #5d636c;\n --gramlot-focus-ring: #245fb4;\n --gramlot-brand-blue: #245fb4;\n --gramlot-brand-yellow: #245fb4;\n --gramlot-navigation: #292c31;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #aa2637;\n --gramlot-error-background: #fff0f1;\n --gramlot-success: #236747;\n --gramlot-success-background: #e9f4ec;\n --gramlot-warning: #735313;\n --gramlot-warning-background: #fff5da;\n }\n @media (prefers-color-scheme: dark) {\n :root:not([data-theme=\"light\"]) {\n color-scheme: dark;\n --gramlot-background: #1b1c20;\n --gramlot-surface: #25272c;\n --gramlot-header-background: #41444c;\n --gramlot-header-color: #f3f2ef;\n --gramlot-surface-subtle: #303239;\n --gramlot-ink: #f3f2ef;\n --gramlot-text-secondary: #c4c3c0;\n --gramlot-border: #454951;\n --gramlot-border-control: #858c99;\n --gramlot-action: #abcbff;\n --gramlot-action-hover: #cedfff;\n --gramlot-selected: #324765;\n --gramlot-field-background: #25272c;\n --gramlot-field-readonly-background: #303239;\n --gramlot-label-color: #c4c3c0;\n --gramlot-focus-ring: #abcbff;\n --gramlot-brand-blue: #abcbff;\n --gramlot-brand-yellow: #abcbff;\n --gramlot-navigation: #1b1c20;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n }\n :root[data-theme=\"dark\"] {\n color-scheme: dark;\n --gramlot-background: #1b1c20;\n --gramlot-surface: #25272c;\n --gramlot-header-background: #41444c;\n --gramlot-header-color: #f3f2ef;\n --gramlot-surface-subtle: #303239;\n --gramlot-ink: #f3f2ef;\n --gramlot-text-secondary: #c4c3c0;\n --gramlot-border: #454951;\n --gramlot-border-control: #858c99;\n --gramlot-action: #abcbff;\n --gramlot-action-hover: #cedfff;\n --gramlot-selected: #324765;\n --gramlot-field-background: #25272c;\n --gramlot-field-readonly-background: #303239;\n --gramlot-label-color: #c4c3c0;\n --gramlot-focus-ring: #abcbff;\n --gramlot-brand-blue: #abcbff;\n --gramlot-brand-yellow: #abcbff;\n --gramlot-navigation: #1b1c20;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n}\n"};
@@ -1,5 +1,212 @@
1
- /** The same bounded parent/frame theme messages serve hosted and local-file pages. */
1
+ import {appearanceStyles, paletteStyles} from './index-page-styles.js';
2
+
2
3
  export const THEME_READY = 'index:theme-ready';
3
4
  export const THEME_SET = 'index:theme-set';
4
- export const THEMES = new Set(['light', 'dark']);
5
- export const APPEARANCES = new Set(['base', 'compact', 'mimi', 'joanna', 'mela']);
5
+ const THEME_CHANGE = 'index:theme-change';
6
+ export const THEMES = new Set(['auto', 'light', 'dark']);
7
+ export const APPEARANCES = new Set(Object.keys(appearanceStyles));
8
+
9
+ const defaults = {theme:'auto', appearance:'base', palette:'default'};
10
+ const choices = {theme:THEMES, appearance:APPEARANCES, palette:new Set(Object.keys(paletteStyles))};
11
+ const valid = (key, value) => Object.hasOwn(choices, key) && choices[key].has(value);
12
+ // The server serves each static theme by path; query parameters and fragments do not select another file.
13
+ const stylesheetUrl = link => link.href.split(/[?#]/, 1)[0];
14
+ const complete = values => values && Object.keys(defaults).every(key => valid(key, values[key]));
15
+
16
+ /** Document presentation. An index keeps its selection in its Source-scoped Data.
17
+ * Ordinary framed pages receive the same styles and relay them to their owned descendants.
18
+ */
19
+ export class PageTheme {
20
+ #app; #document; #window; #origin; #style; #original; #current; #inherited = false;
21
+ #indexes = new Set(); #projecting = false;
22
+ #overlays; #baseUrl; #suspended = new Map(); #baseSheet; #styleObserver;
23
+
24
+ constructor(app) {
25
+ this.#app = app;
26
+ this.#document = app.src.renderer.destination.ownerDocument;
27
+ this.#window = this.#document.defaultView;
28
+ this.#origin = this.#window.location.origin;
29
+ this.#original = this.#document.documentElement.getAttribute('data-theme');
30
+ const directory = this.#document.documentElement.getAttribute('data-gramlot-theme-root')
31
+ ?? (this.#window.location.protocol === 'file:' ? 'themes/' : '/themes/');
32
+ if (URL.canParse(directory, this.#document.baseURI)) {
33
+ const root = new URL(directory, this.#document.baseURI);
34
+ this.#baseUrl = new URL('gramlot-base/theme.css', root).href;
35
+ this.#overlays = new Set([
36
+ 'gramlot-compact/theme.css', 'mimi/theme.css', 'joanna/theme.css', 'mela/theme.css',
37
+ 'palettes/compact.css', 'palettes/mimi.css', 'palettes/joanna.css',
38
+ ].map(path => new URL(path, root).href));
39
+ }
40
+ this.#window.addEventListener('message', this.#receive);
41
+ app.abort.signal.addEventListener('abort', () => this.dispose(), {once:true});
42
+ if (this.#framed) this.#post(this.#window.parent, {type:THEME_READY, devices:app.devices});
43
+ else this.#window.addEventListener('storage', this.#storage);
44
+ }
45
+ get #framed() { return this.#window.parent !== this.#window; }
46
+ #post(peer, message) {
47
+ // file: has an opaque origin. Being an owned frame and the matching WindowProxy are still required.
48
+ if (this.#origin === 'null' && this.#window.location.protocol !== 'file:') return;
49
+ peer.postMessage(message, this.#window.location.protocol === 'file:' ? '*' : this.#origin);
50
+ }
51
+ #frames() {
52
+ return [...this.#document.getElementsByTagName('iframe')].filter(frame => {
53
+ if (!frame.isConnected || !frame.contentWindow) return false;
54
+ if (frame.hasAttribute('sandbox') && !frame.getAttribute('sandbox').split(/\s+/).includes('allow-same-origin')) return false;
55
+ const src = frame.getAttribute('src') || this.#document.baseURI;
56
+ if (!URL.canParse(src, this.#document.baseURI)) return false;
57
+ const url = new URL(src, this.#document.baseURI);
58
+ if (!frame.hasAttribute('srcdoc') && url.href !== 'about:blank' && url.origin !== this.#origin) return false;
59
+ const node = this.#app.dom.getBaseSourceNode(frame);
60
+ return node && this.#app.dom.getDomNode(node) === frame;
61
+ });
62
+ }
63
+ #receive = event => {
64
+ if (event.origin !== this.#origin || !event.source || !event.data) return;
65
+ const message = event.data;
66
+ if (this.#framed && event.source === this.#window.parent && message.type === THEME_SET && complete(message)) {
67
+ this.#inherited = true;
68
+ this.#ownProfiles();
69
+ this.#apply(message);
70
+ return;
71
+ }
72
+ if (message.type !== THEME_READY && message.type !== THEME_CHANGE) return;
73
+ if (!this.#frames().some(frame => frame.contentWindow === event.source)) return;
74
+ if (message.type === THEME_READY && this.#current) this.#post(event.source, {type:THEME_SET, ...this.#current});
75
+ if (message.type === THEME_CHANGE && valid(message.key, message.value) && (this.#indexes.size || this.#inherited)) {
76
+ this.#change(message.key, message.value);
77
+ }
78
+ };
79
+ #change(key, value) {
80
+ if (!this.#current || !valid(key, value) || this.#current[key] === value) return;
81
+ this.#ownProfiles();
82
+ this.#apply({...this.#current, [key]:value});
83
+ if (this.#framed) this.#post(this.#window.parent, {type:THEME_CHANGE, key, value});
84
+ else this.#save();
85
+ }
86
+ // Only links to an exact framework profile/palette at the server's declared theme root
87
+ // can compete with the index preference. Page styles and inline styles remain authored.
88
+ #ownProfiles() {
89
+ if (!this.#overlays || this.#styleObserver) return;
90
+ this.#syncLinks();
91
+ this.#styleObserver = new this.#window.MutationObserver(records => {
92
+ if (records.some(record => record.target.localName === 'link' ||
93
+ [...record.addedNodes, ...record.removedNodes].some(node => node.localName === 'link'))) this.#syncLinks();
94
+ });
95
+ this.#styleObserver.observe(this.#document.head,{childList:true,subtree:true,attributes:true,attributeFilter:['href','rel','media']});
96
+ }
97
+ #syncLinks() {
98
+ const links = [...this.#document.head.querySelectorAll('link[rel~=stylesheet][href]')];
99
+ const overlays = links.filter(link => this.#overlays.has(stylesheetUrl(link)));
100
+ for (const link of this.#suspended.keys()) {
101
+ if (!overlays.includes(link)) this.#restoreLink(link);
102
+ }
103
+ for (const link of overlays) {
104
+ if (link.media === 'not all' || link.disabled || link.hasAttribute('disabled')) continue;
105
+ // media also suppresses a stylesheet whose fetch is still in flight.
106
+ this.#suspended.set(link, link.getAttribute('media'));
107
+ link.media = 'not all';
108
+ }
109
+ // A host can serve a named profile as its only theme. Restore Base at the
110
+ // same cascade position, using the host's published Base resource.
111
+ const first = overlays.find(link => this.#suspended.has(link));
112
+ if (first && !links.some(link => link !== this.#baseSheet && stylesheetUrl(link) === this.#baseUrl && !link.disabled)) {
113
+ if (!this.#baseSheet) {
114
+ this.#baseSheet = this.#document.createElement('link');
115
+ this.#baseSheet.rel = 'stylesheet';
116
+ this.#baseSheet.href = this.#baseUrl;
117
+ first.before(this.#baseSheet);
118
+ }
119
+ } else if (this.#baseSheet) {
120
+ this.#baseSheet.remove();
121
+ this.#baseSheet = null;
122
+ }
123
+ }
124
+ #restoreLink(link) {
125
+ const media = this.#suspended.get(link);
126
+ this.#suspended.delete(link);
127
+ if (media === null) link.removeAttribute('media');
128
+ else link.setAttribute('media', media);
129
+ }
130
+ #apply({theme, appearance, palette}) {
131
+ this.#current = {theme, appearance, palette};
132
+ const html = this.#document.documentElement;
133
+ if (theme === 'auto') html.removeAttribute('data-theme');
134
+ else html.setAttribute('data-theme', theme);
135
+ const css = appearanceStyles[appearance] + '\n' + paletteStyles[palette];
136
+ if (css.trim() && !this.#style) {
137
+ this.#style = this.#document.createElement('style');
138
+ this.#document.head.append(this.#style);
139
+ }
140
+ if (this.#style) this.#style.textContent = css;
141
+ this.#projecting = true;
142
+ try {
143
+ for (const {path} of this.#indexes) for (const [key,value] of Object.entries(this.#current)) {
144
+ if (this.#app.data.getItem(`${path}.${key}`) !== value) this.#app.data.setItem(`${path}.${key}`, value);
145
+ }
146
+ } finally { this.#projecting = false; }
147
+ for (const frame of this.#frames()) this.#post(frame.contentWindow, {type:THEME_SET, ...this.#current});
148
+ }
149
+ #storage = event => {
150
+ if (!event.key || ![...this.#indexes].some(index => index.key === event.key)) return;
151
+ const value = this.#read(event.key);
152
+ if (value) { this.#ownProfiles(); this.#apply(value); }
153
+ };
154
+ #read(key) {
155
+ try {
156
+ const value = JSON.parse(this.#window.localStorage.getItem(key));
157
+ return complete(value) ? value : null;
158
+ } catch (error) { if (error.name !== 'SecurityError' && !(error instanceof SyntaxError)) throw error; return null; }
159
+ }
160
+ #save() {
161
+ try {
162
+ const value = JSON.stringify(this.#current);
163
+ for (const key of new Set([...this.#indexes].map(index => index.key))) {
164
+ this.#window.localStorage.setItem(key, value);
165
+ }
166
+ }
167
+ catch (error) { if (!['SecurityError','QuotaExceededError'].includes(error.name)) throw error; }
168
+ }
169
+ /** An explicit local appearance does not override a choice already received from the index. */
170
+ setFrameAppearance(appearance) {
171
+ if (!APPEARANCES.has(appearance)) throw new TypeError('Unknown frame appearance');
172
+ if (this.#inherited || this.#indexes.size) return;
173
+ this.#apply({theme:THEMES.has(this.#original) ? this.#original : 'auto', palette:'default', appearance});
174
+ }
175
+ mount(path) {
176
+ const group = this.#app.data.getItem(`${path}.themeGroup`);
177
+ const key = 'gramlot.index.theme:' + (group == null ? this.#window.location.pathname : `group:${group}`);
178
+ const entry = {path, key};
179
+ this.#indexes.add(entry);
180
+ const initial = {};
181
+ for (const key of Object.keys(defaults)) {
182
+ const value = this.#app.data.getItem(`${path}.${key}`);
183
+ initial[key] = valid(key, value) ? value : defaults[key];
184
+ if (key === 'theme' && value == null && THEMES.has(this.#original)) initial.theme = this.#original;
185
+ }
186
+ const saved = this.#framed ? null : this.#read(key);
187
+ if (saved) this.#ownProfiles();
188
+ this.#apply(saved ?? this.#current ?? initial);
189
+ const registrations = Object.keys(defaults).map(key => this.#app.src.binding.router.register({
190
+ path:`${path}.${key}`, recipient:{receive:() => {
191
+ if (!this.#projecting) this.#change(key, this.#app.data.getItem(`${path}.${key}`));
192
+ }},
193
+ }));
194
+ return () => {
195
+ for (const registration of registrations) registration.close();
196
+ this.#indexes.delete(entry);
197
+ };
198
+ }
199
+ dispose() {
200
+ this.#window.removeEventListener('message', this.#receive);
201
+ this.#window.removeEventListener('storage', this.#storage);
202
+ this.#styleObserver?.disconnect();
203
+ this.#baseSheet?.remove();
204
+ this.#style?.remove();
205
+ for (const link of this.#suspended.keys()) this.#restoreLink(link);
206
+ if (this.#current) {
207
+ if (this.#original === null) this.#document.documentElement.removeAttribute('data-theme');
208
+ else this.#document.documentElement.setAttribute('data-theme', this.#original);
209
+ }
210
+ this.#indexes.clear();
211
+ }
212
+ }
package/src/index.d.ts CHANGED
@@ -38,6 +38,7 @@ export {IndexPage} from "./server/index-page.js";
38
38
  export {IndexLogic, mountIndexPage} from "./index-page-runtime.js";
39
39
 
40
40
  export {parseDateExpression} from '@genrojs/toolbox';
41
+ export {objectExtract} from './object-extract.js';
41
42
  export type {DateExpressionOptions, DateExpressionResult, DateExpressionErrorCode} from '@genrojs/toolbox';
42
43
 
43
44
  export {FramePage} from "./server/frame-page.js";
@@ -57,11 +58,11 @@ export type {DeviceDatabase, DeviceOrientation, DeviceMotionEvent, DeviceProvide
57
58
 
58
59
  export {MobileEnvironment} from './mobile-environment.js';
59
60
 
60
- export {chatRender, chatSend, chatCompleted, chatReset, chatResize, chatPickAttachments, chatRenderAttachments, chatRemoveAttachment} from './chat.js';
61
+ export {chatRender, chatSend, chatDraftKey, chatCompleted, chatReset, chatResize, chatPickAttachments, chatRenderAttachments, chatRemoveAttachment} from './chat.js';
61
62
 
62
63
  // Preserve fluent Source identity across separately prepared collection bundles.
63
64
  export {sourceTarget} from '@genrojs/builders';
64
- export {TreeStore, TreeStoreResolver, TreeStoreLogic} from './tree-store.js';
65
+ export {treeStore, TreeStore, TreeStoreResolver, TreeStoreLogic} from './tree-store.js';
65
66
  export {UploadTarget} from './server/upload.js';
66
67
 
67
68
  export {VisualEditorLogic, visualEditorScope} from './visual-editor.js';
@@ -89,3 +90,7 @@ export interface LibraryEntry {
89
90
  export declare const libraries: Readonly<Record<string, LibraryEntry>>;
90
91
  /** The library `name` for a component of `document`: from jsDelivr when the document says `cdn`, else the local copy. */
91
92
  export declare function loadLibrary(name: string, document: Document, localImport: () => Promise<unknown>): Promise<unknown>;
93
+
94
+ export {PageStore} from './server/page-store.js';
95
+
96
+ export {ChatPane, ChatPageStore} from './server/chat.js';