@digithings-ai/ui 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (424) hide show
  1. package/README.md +48 -2
  2. package/package.json +143 -4
  3. package/src/components/NavShell.tsx +776 -0
  4. package/src/components/SocialRow.tsx +87 -0
  5. package/src/components/Spinner.tsx +27 -0
  6. package/src/components/StackLogo.tsx +40 -0
  7. package/src/components/Terminal.tsx +110 -0
  8. package/src/components/TerminalManifest.tsx +212 -0
  9. package/src/components/ThemeProvider.tsx +271 -0
  10. package/src/components/account/AuthCard.tsx +309 -0
  11. package/src/components/assistant-ui/elements/mermaid-diagram.aui.tsx +63 -0
  12. package/src/components/assistant-ui/elements/mermaid-diagram.tsx +340 -0
  13. package/src/components/brand/BrandWordmark.tsx +32 -0
  14. package/src/components/changelog/ReleaseRail.tsx +81 -0
  15. package/src/components/changelog/index.ts +1 -0
  16. package/src/components/chat/ChatCodeBlock.tsx +67 -0
  17. package/src/components/chat/ChatMarkdown.tsx +66 -0
  18. package/src/components/chat/ChatMarkdownSource.tsx +203 -0
  19. package/src/components/chat/ChatMermaidBlock.tsx +202 -0
  20. package/src/components/chat/ChatMessage.tsx +77 -0
  21. package/src/components/chat/ChatPlayback.tsx +422 -0
  22. package/src/components/chat/ChatStreamCursor.tsx +25 -0
  23. package/src/components/chat/ChatThinking.tsx +113 -0
  24. package/src/components/chat/ChatToolCall.tsx +190 -0
  25. package/src/components/chat/ChatTranscript.tsx +60 -0
  26. package/src/components/chat/ChatWidgetFrame.tsx +107 -0
  27. package/src/components/chat/DigichatBootLoader.tsx +683 -0
  28. package/src/components/chat/DigichatLauncher.tsx +361 -0
  29. package/src/components/chat/DigichatThread.tsx +118 -0
  30. package/src/components/chat/DigichatThreadList.tsx +54 -0
  31. package/src/components/chat/DigichatWordmark.tsx +24 -0
  32. package/src/components/chat/DotMatrix.tsx +650 -0
  33. package/src/components/chat/boot-lab.tsx +766 -0
  34. package/src/components/chat/boot-signal.ts +144 -0
  35. package/src/components/chat/chat-surfaces.ts +52 -0
  36. package/src/components/chat/connection-status.ts +40 -0
  37. package/src/components/chat/digichat-wordmark.ts +355 -0
  38. package/src/components/chat/disclosure-chevron.tsx +49 -0
  39. package/src/components/chat/followable-href.ts +9 -0
  40. package/src/components/chat/gallery-thread/action-icons.tsx +25 -0
  41. package/src/components/chat/gallery-thread/attachment.aui.tsx +262 -0
  42. package/src/components/chat/gallery-thread/block-caret.tsx +439 -0
  43. package/src/components/chat/gallery-thread/cn.ts +1 -0
  44. package/src/components/chat/gallery-thread/composer-keyboard.ts +106 -0
  45. package/src/components/chat/gallery-thread/composer-trigger-popover.aui.tsx +235 -0
  46. package/src/components/chat/gallery-thread/css.d.ts +6 -0
  47. package/src/components/chat/gallery-thread/file.tsx +238 -0
  48. package/src/components/chat/gallery-thread/follow-up-suggestions.aui.tsx +92 -0
  49. package/src/components/chat/gallery-thread/format-json-dump.ts +112 -0
  50. package/src/components/chat/gallery-thread/hooks/use-attachment-src.ts +46 -0
  51. package/src/components/chat/gallery-thread/hooks/use-copy-to-clipboard.ts +9 -0
  52. package/src/components/chat/gallery-thread/image.tsx +519 -0
  53. package/src/components/chat/gallery-thread/markdown-text.tsx +278 -0
  54. package/src/components/chat/gallery-thread/message-error.aui.tsx +105 -0
  55. package/src/components/chat/gallery-thread/message-timing.aui.tsx +143 -0
  56. package/src/components/chat/gallery-thread/private-work-step.tsx +188 -0
  57. package/src/components/chat/gallery-thread/reasoning.tsx +332 -0
  58. package/src/components/chat/gallery-thread/scroll-mode.ts +174 -0
  59. package/src/components/chat/gallery-thread/source.tsx +76 -0
  60. package/src/components/chat/gallery-thread/thread.aui.tsx +1619 -0
  61. package/src/components/chat/gallery-thread/tooltip-icon-button.tsx +53 -0
  62. package/src/components/chat/gallery-thread/typed-welcome-copy.tsx +18 -0
  63. package/src/components/chat/gallery-thread/ui/tooltip.tsx +22 -0
  64. package/src/components/chat/gallery-thread/work-chain-summary.tsx +48 -0
  65. package/src/components/chat/gallery-thread/work-chain.tsx +110 -0
  66. package/src/components/chat/gallery-thread/work-status.ts +66 -0
  67. package/src/components/chat/overlay-scrollbar.tsx +86 -0
  68. package/src/components/chat/sanitize-mermaid-svg.ts +38 -0
  69. package/src/components/chat/skins/SOURCE.md +36 -0
  70. package/src/components/chat/skins/base/attachment.aui.tsx +287 -0
  71. package/src/components/chat/skins/base/aui-default/README.md +45 -0
  72. package/src/components/chat/skins/base/aui-default/collapsible-root.tsx +19 -0
  73. package/src/components/chat/skins/base/aui-default/collapsible.tsx +21 -0
  74. package/src/components/chat/skins/base/aui-default/reasoning.aui.tsx +120 -0
  75. package/src/components/chat/skins/base/aui-default/reasoning.tsx +331 -0
  76. package/src/components/chat/skins/base/aui-default/surfaces.ts +7 -0
  77. package/src/components/chat/skins/base/aui-default/tool-fallback.aui.tsx +772 -0
  78. package/src/components/chat/skins/base/aui-default/tool-group.aui.tsx +241 -0
  79. package/src/components/chat/skins/base/docs-model-options.ts +6 -0
  80. package/src/components/chat/skins/base/elements/assistant-trace.aui.tsx +169 -0
  81. package/src/components/chat/skins/base/elements/composer-trigger-popover.aui.tsx +271 -0
  82. package/src/components/chat/skins/base/elements/directive-text.aui.tsx +29 -0
  83. package/src/components/chat/skins/base/elements/directive-text.tsx +76 -0
  84. package/src/components/chat/skins/base/elements/message-timing.aui.tsx +104 -0
  85. package/src/components/chat/skins/base/elements/model-selector.aui.tsx +140 -0
  86. package/src/components/chat/skins/base/elements/model-selector.tsx +720 -0
  87. package/src/components/chat/skins/base/elements/quote.aui.tsx +290 -0
  88. package/src/components/chat/skins/base/elements/work-chain.tsx +100 -0
  89. package/src/components/chat/skins/base/markdown-text.tsx +294 -0
  90. package/src/components/chat/skins/base/model.ts +1 -0
  91. package/src/components/chat/skins/base/thread.tsx +1050 -0
  92. package/src/components/chat/skins/base/tooltip-icon-button.tsx +56 -0
  93. package/src/components/chat/skins/base/ui/avatar.tsx +115 -0
  94. package/src/components/chat/skins/base/ui/badge.tsx +51 -0
  95. package/src/components/chat/skins/base/ui/button.tsx +67 -0
  96. package/src/components/chat/skins/base/ui/command.tsx +185 -0
  97. package/src/components/chat/skins/base/ui/dialog.tsx +168 -0
  98. package/src/components/chat/skins/base/ui/dot-matrix.tsx +267 -0
  99. package/src/components/chat/skins/base/ui/popover.tsx +97 -0
  100. package/src/components/chat/skins/base/ui/skeleton.tsx +20 -0
  101. package/src/components/chat/skins/base/ui/textarea.tsx +24 -0
  102. package/src/components/chat/skins/base/ui/tooltip.tsx +73 -0
  103. package/src/components/chat/skins/base-assistant-ui/config-provider.tsx +90 -0
  104. package/src/components/chat/skins/base-assistant-ui/defaults.ts +419 -0
  105. package/src/components/chat/skins/base-assistant-ui/index.tsx +44 -0
  106. package/src/components/chat/skins/chatgpt.tsx +448 -0
  107. package/src/components/chat/skins/claude.tsx +380 -0
  108. package/src/components/chat/skins/digichat-composer-toolbar.tsx +151 -0
  109. package/src/components/chat/skins/digichat-context-meter-shares.ts +158 -0
  110. package/src/components/chat/skins/digichat-context-meter.tsx +243 -0
  111. package/src/components/chat/skins/digichat-meter-tone.ts +26 -0
  112. package/src/components/chat/skins/digichat-usage-meter.tsx +103 -0
  113. package/src/components/chat/skins/digichat.tsx +144 -0
  114. package/src/components/chat/skins/expo-react-native.tsx +29 -0
  115. package/src/components/chat/skins/gemini.tsx +322 -0
  116. package/src/components/chat/skins/grok-icon.tsx +34 -0
  117. package/src/components/chat/skins/grok.tsx +369 -0
  118. package/src/components/chat/skins/index.ts +46 -0
  119. package/src/components/chat/skins/perplexity.tsx +462 -0
  120. package/src/components/chat/skins/product-page-assistant/assistant-modal.tsx +73 -0
  121. package/src/components/chat/skins/product-page-assistant/index.tsx +19 -0
  122. package/src/components/chat/skins/product-page-assistant/product-dashboard.tsx +164 -0
  123. package/src/components/chat/skins/react-ink.tsx +97 -0
  124. package/src/components/chat/skins/thread-skin-host-contract.ts +102 -0
  125. package/src/components/chat/skins/thread-skin-view.tsx +156 -0
  126. package/src/components/chat/skins/thread-skins.ts +143 -0
  127. package/src/components/chat/skins/tooltip-icon-button.tsx +35 -0
  128. package/src/components/chat/skins/ui/dropdown-menu.tsx +272 -0
  129. package/src/components/chat/skins/webpage-assistant/assistant-config.ts +238 -0
  130. package/src/components/chat/skins/webpage-assistant/assistant-modal.tsx +78 -0
  131. package/src/components/chat/skins/webpage-assistant/config-provider.tsx +132 -0
  132. package/src/components/chat/skins/webpage-assistant/docs-app.tsx +106 -0
  133. package/src/components/chat/skins/webpage-assistant/docs-article.tsx +109 -0
  134. package/src/components/chat/skins/webpage-assistant/docs-assistant.tsx +73 -0
  135. package/src/components/chat/skins/webpage-assistant/docs-nav.tsx +81 -0
  136. package/src/components/chat/skins/webpage-assistant/host-ui.ts +79 -0
  137. package/src/components/chat/skins/webpage-assistant/index.tsx +12 -0
  138. package/src/components/chat/skins/webpage-assistant/markdown-page.tsx +11 -0
  139. package/src/components/chat/skins/webpage-assistant/pages.ts +9 -0
  140. package/src/components/chat/skins/webpage-assistant/types.ts +178 -0
  141. package/src/components/chat/skins/webpage-assistant/use-mobile.ts +19 -0
  142. package/src/components/chat/stock/SOURCE.md +90 -0
  143. package/src/components/chat/stock/artifacts-panel.tsx +305 -0
  144. package/src/components/chat/stock/attachment.aui.tsx +280 -0
  145. package/src/components/chat/stock/chat-notice.tsx +143 -0
  146. package/src/components/chat/stock/chat-private-mode.tsx +64 -0
  147. package/src/components/chat/stock/deploy-ui-context.tsx +89 -0
  148. package/src/components/chat/stock/embed-chat-prefs.tsx +471 -0
  149. package/src/components/chat/stock/file.tsx +265 -0
  150. package/src/components/chat/stock/follow-up-suggestions.aui.tsx +83 -0
  151. package/src/components/chat/stock/image.tsx +531 -0
  152. package/src/components/chat/stock/index.ts +129 -0
  153. package/src/components/chat/stock/json-view.tsx +140 -0
  154. package/src/components/chat/stock/markdown-text.tsx +319 -0
  155. package/src/components/chat/stock/message-error.aui.tsx +96 -0
  156. package/src/components/chat/stock/message-export-menu.tsx +156 -0
  157. package/src/components/chat/stock/palette-row-preview.tsx +26 -0
  158. package/src/components/chat/stock/reasoning.aui.tsx +120 -0
  159. package/src/components/chat/stock/reasoning.tsx +335 -0
  160. package/src/components/chat/stock/skin-chrome.tsx +81 -0
  161. package/src/components/chat/stock/skin-credit.tsx +63 -0
  162. package/src/components/chat/stock/skin-palette-bridge.tsx +235 -0
  163. package/src/components/chat/stock/skin-palette-context.ts +16 -0
  164. package/src/components/chat/stock/skin-runtime.tsx +52 -0
  165. package/src/components/chat/stock/skin-slash-palette.tsx +393 -0
  166. package/src/components/chat/stock/skin-types.ts +217 -0
  167. package/src/components/chat/stock/stock-chat-prefs-host.tsx +501 -0
  168. package/src/components/chat/stock/stock-send-gate.tsx +94 -0
  169. package/src/components/chat/stock/stock-shape.tsx +39 -0
  170. package/src/components/chat/stock/thread.aui.tsx +645 -0
  171. package/src/components/chat/stock/tool-display.ts +6 -0
  172. package/src/components/chat/stock/tool-fallback.aui.tsx +866 -0
  173. package/src/components/chat/stock/tool-group.aui.tsx +244 -0
  174. package/src/components/chat/stock/tool-surface.ts +120 -0
  175. package/src/components/chat/stock/tooltip-icon-button.tsx +49 -0
  176. package/src/components/chat/stock/ui/avatar.tsx +108 -0
  177. package/src/components/chat/stock/ui/button.tsx +81 -0
  178. package/src/components/chat/stock/ui/collapsible.tsx +21 -0
  179. package/src/components/chat/stock/ui/dialog.tsx +163 -0
  180. package/src/components/chat/stock/ui/skeleton.tsx +13 -0
  181. package/src/components/chat/stock/ui/textarea.tsx +20 -0
  182. package/src/components/chat/stock/ui/tooltip.tsx +68 -0
  183. package/src/components/chat/stock/use-attachment-src.ts +42 -0
  184. package/src/components/chat/stock/use-copy-to-clipboard.ts +29 -0
  185. package/src/components/chat/strip-model-boilerplate.ts +42 -0
  186. package/src/components/chat/suggestion-cycle.tsx +230 -0
  187. package/src/components/chat/suggestion-scroll-row.tsx +81 -0
  188. package/src/components/chat/trace-grouping/chain-group-by.ts +44 -0
  189. package/src/components/chat/trace-grouping/chain-state.ts +141 -0
  190. package/src/components/chat/trace-grouping/index.ts +32 -0
  191. package/src/components/chat/trace-grouping/tool-row.ts +74 -0
  192. package/src/components/chat/trace-grouping/use-deploy-work-disclosure.ts +35 -0
  193. package/src/components/chat/trace-grouping/use-work-chain.ts +103 -0
  194. package/src/components/chat/trace-i18n/core.ts +48 -0
  195. package/src/components/chat/trace-i18n/index.tsx +23 -0
  196. package/src/components/chat/trace-i18n/locales/en.ts +24 -0
  197. package/src/components/chat/trace-i18n/locales/fr.ts +28 -0
  198. package/src/components/chat/trace-i18n/types.ts +35 -0
  199. package/src/components/chat/trace-spacing.ts +249 -0
  200. package/src/components/chat/transcript/activity-view.ts +375 -0
  201. package/src/components/chat/transcript/chat-export.ts +133 -0
  202. package/src/components/chat/transcript/index.ts +10 -0
  203. package/src/components/chat/transcript/save-file.ts +209 -0
  204. package/src/components/chat/transcript/transcript-markdown.ts +428 -0
  205. package/src/components/chat/transcript/types.ts +81 -0
  206. package/src/components/chat/turn-outcome.ts +52 -0
  207. package/src/components/chat/use-warmup-phase.ts +18 -0
  208. package/src/components/chat/work-status-lead.tsx +49 -0
  209. package/src/components/chrome.tsx +264 -0
  210. package/src/components/command-palette/CommandPalette.tsx +404 -0
  211. package/src/components/command-palette/index.ts +6 -0
  212. package/src/components/contact/ContactMailto.tsx +112 -0
  213. package/src/components/contact/index.ts +5 -0
  214. package/src/components/conviction/ConvictionMeter.tsx +40 -0
  215. package/src/components/conviction/SignedConvictionBadge.tsx +26 -0
  216. package/src/components/conviction/index.ts +7 -0
  217. package/src/components/data-layout/BentoGrid.tsx +52 -0
  218. package/src/components/data-layout/CardRail.tsx +150 -0
  219. package/src/components/data-layout/DotMatrixStat.tsx +65 -0
  220. package/src/components/data-layout/FeatureCell.tsx +80 -0
  221. package/src/components/data-layout/MediaFrame.tsx +125 -0
  222. package/src/components/data-layout/ModuleGrid.tsx +735 -0
  223. package/src/components/data-layout/Odometer.tsx +149 -0
  224. package/src/components/data-layout/ProductFrame.tsx +79 -0
  225. package/src/components/data-layout/TestimonialWall.tsx +139 -0
  226. package/src/components/data-layout/index.ts +19 -0
  227. package/src/components/data-layout/treemap.ts +368 -0
  228. package/src/components/deck/DeckStack.tsx +243 -0
  229. package/src/components/desk/DataTable.tsx +373 -0
  230. package/src/components/desk/KpiGrid.tsx +80 -0
  231. package/src/components/desk/Sparkline.tsx +63 -0
  232. package/src/components/desk/StateBlock.tsx +132 -0
  233. package/src/components/desk/index.ts +18 -0
  234. package/src/components/diagrams/ArchitectureDiagram.tsx +350 -0
  235. package/src/components/diagrams/ArchitectureTour.tsx +912 -0
  236. package/src/components/diagrams/TerminalSchematic.tsx +192 -0
  237. package/src/components/diagrams/architecture-svg.tsx +384 -0
  238. package/src/components/diagrams/index.ts +30 -0
  239. package/src/components/diagrams/mermaid-theme.ts +115 -0
  240. package/src/components/diagrams/tour-camera.ts +171 -0
  241. package/src/components/docs/CodeTabs.tsx +90 -0
  242. package/src/components/docs/CopyCommand.tsx +151 -0
  243. package/src/components/docs/DocsLayout.tsx +197 -0
  244. package/src/components/docs/DocsSearch.tsx +97 -0
  245. package/src/components/docs/Endpoint.tsx +135 -0
  246. package/src/components/document/DocumentFrame.tsx +43 -0
  247. package/src/components/document/GlyphList.tsx +51 -0
  248. package/src/components/document/PageTitle.tsx +44 -0
  249. package/src/components/document/Prose.tsx +38 -0
  250. package/src/components/document/Section.tsx +55 -0
  251. package/src/components/document/index.ts +13 -0
  252. package/src/components/effects-chrome/AnnouncementBar.tsx +88 -0
  253. package/src/components/effects-chrome/HorizontalScrollTrack.tsx +461 -0
  254. package/src/components/effects-chrome/Pipeline.tsx +226 -0
  255. package/src/components/effects-chrome/RotatingPrompts.tsx +116 -0
  256. package/src/components/effects-chrome/StackingPanels.tsx +101 -0
  257. package/src/components/effects-chrome/TabStrip.tsx +232 -0
  258. package/src/components/effects-chrome/ToastStack.tsx +201 -0
  259. package/src/components/effects-chrome/horizontal-track-core.ts +70 -0
  260. package/src/components/effects-chrome/index.ts +35 -0
  261. package/src/components/emblems.tsx +188 -0
  262. package/src/components/faviconTheme.ts +23 -0
  263. package/src/components/figure/Figure.tsx +38 -0
  264. package/src/components/figure/index.ts +2 -0
  265. package/src/components/finance-charts/DrawdownPlot.tsx +76 -0
  266. package/src/components/finance-charts/EquityCurve.tsx +71 -0
  267. package/src/components/finance-charts/PriceChart.tsx +119 -0
  268. package/src/components/finance-charts/chart-host.tsx +236 -0
  269. package/src/components/finance-charts/chart-scale.ts +93 -0
  270. package/src/components/finance-charts/demo-data.ts +88 -0
  271. package/src/components/finance-charts/index.ts +46 -0
  272. package/src/components/finance-charts/lw-chart.tsx +292 -0
  273. package/src/components/finance-composites/MarketBar.tsx +243 -0
  274. package/src/components/finance-composites/OrderBook.tsx +133 -0
  275. package/src/components/finance-composites/PerformanceDashboard.tsx +185 -0
  276. package/src/components/finance-composites/SortableTable.tsx +144 -0
  277. package/src/components/finance-composites/StockTicker.tsx +65 -0
  278. package/src/components/finance-composites/SyncedTearsheet.tsx +226 -0
  279. package/src/components/finance-composites/index.ts +28 -0
  280. package/src/components/finance-tearsheet/KpiStrip.tsx +49 -0
  281. package/src/components/finance-tearsheet/LiveBadge.tsx +29 -0
  282. package/src/components/finance-tearsheet/ReturnsMatrix.tsx +321 -0
  283. package/src/components/finance-tearsheet/StrategyTearsheet.tsx +99 -0
  284. package/src/components/finance-tearsheet/TearsheetCard.tsx +54 -0
  285. package/src/components/finance-tearsheet/TradeLogTable.tsx +73 -0
  286. package/src/components/finance-tearsheet/charts.tsx +2624 -0
  287. package/src/components/finance-tearsheet/demo-data.ts +177 -0
  288. package/src/components/finance-tearsheet/format.ts +41 -0
  289. package/src/components/finance-tearsheet/index.ts +120 -0
  290. package/src/components/finance-tearsheet/print.ts +52 -0
  291. package/src/components/finance-tearsheet/risk-bands.ts +48 -0
  292. package/src/components/finance-tearsheet/stats.ts +35 -0
  293. package/src/components/finance-tearsheet/strategy-sheet-model.ts +238 -0
  294. package/src/components/finance-tearsheet/types.ts +58 -0
  295. package/src/components/footer/FooterCells.tsx +109 -0
  296. package/src/components/footer/index.ts +6 -0
  297. package/src/components/graph.tsx +158 -0
  298. package/src/components/icons.tsx +98 -0
  299. package/src/components/landing/PixelWordmark.tsx +36 -0
  300. package/src/components/logos.ts +39 -0
  301. package/src/components/marquee/Marquee.tsx +204 -0
  302. package/src/components/metrics/PerfMetrics.tsx +68 -0
  303. package/src/components/metrics/StatCounter.tsx +104 -0
  304. package/src/components/page-geometry.tsx +177 -0
  305. package/src/components/pricing/Pricing.tsx +174 -0
  306. package/src/components/pricing/PricingMatrix.tsx +219 -0
  307. package/src/components/prose/index.ts +2 -0
  308. package/src/components/prose/prose.tsx +86 -0
  309. package/src/components/repo-activity/RepoActivity.tsx +599 -0
  310. package/src/components/repo-activity/RepoHeatmap.tsx +225 -0
  311. package/src/components/repo-activity/demo.ts +201 -0
  312. package/src/components/repo-activity/fetch.ts +211 -0
  313. package/src/components/repo-activity/heatmap.ts +123 -0
  314. package/src/components/repo-activity/index.ts +28 -0
  315. package/src/components/repo-activity/types.ts +99 -0
  316. package/src/components/stages/NumberedStages.tsx +116 -0
  317. package/src/components/symbols/marks.tsx +116 -0
  318. package/src/components/symbols/terminal-lockup.tsx +136 -0
  319. package/src/components/symbols/terminal-marks.tsx +226 -0
  320. package/src/components/terminal/ChatResponseLoader.tsx +67 -0
  321. package/src/components/terminal/ContainerBootLoader.tsx +82 -0
  322. package/src/components/terminal/TerminalStepCaret.tsx +202 -0
  323. package/src/components/themeInit.ts +24 -0
  324. package/src/components/typography/MotionReveal.tsx +108 -0
  325. package/src/components/typography/TypewriterReveal.tsx +101 -0
  326. package/src/components/typography/WordReveal.tsx +143 -0
  327. package/src/data/modules.ts +378 -0
  328. package/src/data/subsystems.ts +101 -0
  329. package/src/index.ts +587 -0
  330. package/src/lib/base-path.ts +60 -0
  331. package/src/lib/cx.ts +25 -0
  332. package/src/lib/gloomberb.ts +69 -0
  333. package/src/lib/record.ts +19 -0
  334. package/src/lib/stub-payload.ts +183 -0
  335. package/src/lib/useBodyScrollLock.ts +44 -0
  336. package/src/lib/utils.ts +6 -0
  337. package/src/motion/primitives.tsx +105 -0
  338. package/src/motion/scroll-glide.ts +62 -0
  339. package/src/motion/scrolly-core.ts +38 -0
  340. package/src/motion/scrolly.tsx +95 -0
  341. package/src/navigation/HashScrollManager.tsx +167 -0
  342. package/src/navigation/hashScroll.ts +78 -0
  343. package/src/replay/browser.ts +280 -0
  344. package/src/replay/chat-export-run.ts +121 -0
  345. package/src/replay/export-format.ts +25 -0
  346. package/src/replay/export-mount.ts +32 -0
  347. package/src/replay/filename.ts +54 -0
  348. package/src/replay/index.ts +21 -0
  349. package/src/replay/redact-dom.ts +178 -0
  350. package/src/replay/redact.ts +113 -0
  351. package/src/replay/snapshot.ts +659 -0
  352. package/src/styles/account-auth.css +339 -0
  353. package/src/styles/brand-wordmark.css +11 -0
  354. package/src/styles/card-rail.css +120 -0
  355. package/src/styles/chat-aui.css +1143 -0
  356. package/src/styles/chat-core.css +469 -0
  357. package/src/styles/chat-digichat.css +2531 -0
  358. package/src/styles/chat-math.css +70 -0
  359. package/src/styles/chat-skin-palette.css +138 -0
  360. package/src/styles/chat-stock-menu.css +37 -0
  361. package/src/styles/chat-widgets.css +190 -0
  362. package/src/styles/command-palette.css +372 -0
  363. package/src/styles/controls-core.css +2261 -0
  364. package/src/styles/controls-overlay.css +603 -0
  365. package/src/styles/data-layout.css +288 -0
  366. package/src/styles/deck.css +141 -0
  367. package/src/styles/diagrams.css +1860 -0
  368. package/src/styles/digichat-app-theme.css +250 -0
  369. package/src/styles/digichat-boot-loader.css +487 -0
  370. package/src/styles/digichat-launcher.css +377 -0
  371. package/src/styles/docs.css +165 -0
  372. package/src/styles/effects-chrome.css +888 -0
  373. package/src/styles/finance-composites.css +214 -0
  374. package/src/styles/finance-tearsheet-overlay.css +90 -0
  375. package/src/styles/finance-tearsheet.css +945 -0
  376. package/src/styles/marquee.css +168 -0
  377. package/src/styles/metrics.css +82 -0
  378. package/src/styles/nav-shell.css +551 -0
  379. package/src/styles/pricing.css +79 -0
  380. package/src/styles/repo-activity.css +575 -0
  381. package/src/styles/stages.css +69 -0
  382. package/src/styles/terminal-loaders.css +122 -0
  383. package/src/styles/terminal-manifest.css +228 -0
  384. package/src/styles/web-theme.css +1007 -0
  385. package/src/styles/word-reveal.css +204 -0
  386. package/src/theme/apply-theme.ts +214 -0
  387. package/src/theme/index.ts +27 -0
  388. package/src/theme/palette-registry.ts +855 -0
  389. package/src/theme/tui-prefs.ts +64 -0
  390. package/src/ui/alert.tsx +78 -0
  391. package/src/ui/avatar.tsx +104 -0
  392. package/src/ui/badge.tsx +75 -0
  393. package/src/ui/breadcrumb.tsx +61 -0
  394. package/src/ui/button.tsx +67 -0
  395. package/src/ui/card.tsx +139 -0
  396. package/src/ui/checkbox.tsx +27 -0
  397. package/src/ui/collapsible.tsx +32 -0
  398. package/src/ui/date-pager.tsx +325 -0
  399. package/src/ui/dialog.tsx +157 -0
  400. package/src/ui/dropdown-menu.tsx +267 -0
  401. package/src/ui/empty-state.tsx +165 -0
  402. package/src/ui/field.tsx +104 -0
  403. package/src/ui/form.tsx +36 -0
  404. package/src/ui/icon-button.tsx +36 -0
  405. package/src/ui/index.ts +34 -0
  406. package/src/ui/input.tsx +33 -0
  407. package/src/ui/kbd.tsx +30 -0
  408. package/src/ui/label.tsx +32 -0
  409. package/src/ui/pager.tsx +119 -0
  410. package/src/ui/pagination.tsx +126 -0
  411. package/src/ui/radio-group.tsx +51 -0
  412. package/src/ui/search-bar.tsx +85 -0
  413. package/src/ui/segmented-control.tsx +76 -0
  414. package/src/ui/select.tsx +257 -0
  415. package/src/ui/separator.tsx +24 -0
  416. package/src/ui/sheet.tsx +141 -0
  417. package/src/ui/skeleton.tsx +76 -0
  418. package/src/ui/slider.tsx +76 -0
  419. package/src/ui/switch.tsx +31 -0
  420. package/src/ui/table.tsx +179 -0
  421. package/src/ui/tabs.tsx +89 -0
  422. package/src/ui/tags-input.tsx +168 -0
  423. package/src/ui/textarea.tsx +17 -0
  424. package/src/ui/tooltip.tsx +71 -0
@@ -0,0 +1,945 @@
1
+ /* ==========================================================================
2
+ @digithings-ai/ui — finance-tearsheet family CSS (#1463)
3
+ The print-grade tearsheet grammar (.ts-*): SVG charts, KPI strip, returns
4
+ matrix, trade log, library card, live badge — promoted from
5
+ @digithings-ai/design/tearsheet/styles.css (screen grammar, now deprecated in
6
+ favour of this sheet) + apps/digiquant-web/app/globals.css (the
7
+ @media print grammar, canon §17). Consumes the [data-theme] semantic
8
+ tokens so the whole surface works in light AND dark; positive P&L wears
9
+ --up, negative --down — the money colors NEVER follow a livery.
10
+
11
+ Import PLAINLY (no layer(...)) — this sheet manages its own layering per
12
+ the cascade contract (MIGRATION.md):
13
+ - single-class visual defaults sit in @layer components so call-site
14
+ utilities can override them;
15
+ - state / structural / responsive rules (hover, [hidden], [open],
16
+ descendant sizing, compound SVG paint classes, media queries) stay
17
+ UNLAYERED on purpose — they must keep beating plain utilities;
18
+ - the @media print grammar is UNLAYERED and is THE differentiator of
19
+ this family: the PDF pipeline (runTearsheetPrint) flushSync-re-renders
20
+ the same chart instances and calls window.print(), so screen and
21
+ print share one render tree. Every pane ([hidden] included) opens in
22
+ print; scroll clamps release; rows avoid page breaks.
23
+
24
+ Wiring (consuming app globals.css):
25
+ @import "tailwindcss";
26
+ @import "@digithings-ai/design/tokens.css";
27
+ @import "@digithings-ai/ui/styles/web-theme.css";
28
+ @import "@digithings-ai/ui/styles/finance-tearsheet.css";
29
+ @source "<path-to>/packages/ui/src/components/finance-tearsheet";
30
+ App-local print resets for the app's own layout shells (e.g. digiquant's
31
+ .wrap / .dq-subpage) stay app-side, after this import.
32
+ ========================================================================== */
33
+
34
+ /* ---- page scaffold, header, chips ---- */
35
+ @layer components {
36
+ .ts-page {
37
+ --ts-page-pad-top: clamp(1.6rem, 4vw, 2.8rem);
38
+ --ts-page-pad-bottom: clamp(3rem, 6vw, 5rem);
39
+ padding-top: var(--ts-page-pad-top);
40
+ padding-bottom: var(--ts-page-pad-bottom);
41
+ position: relative; z-index: 1;
42
+ }
43
+
44
+ .ts-status { --ts-status-fs: 0.9rem; color: var(--ink-soft); font-family: var(--font-mono); font-size: var(--ts-status-fs); padding: var(--space-7, 4rem) 0; text-align: center; }
45
+ .ts-status-error { color: var(--down); }
46
+
47
+ .ts-header { --ts-header-gap: var(--space-4, 1.5rem); --ts-header-pb: 1.4rem; display: flex; justify-content: space-between; align-items: flex-end; gap: var(--ts-header-gap); flex-wrap: wrap; margin-bottom: var(--space-5, 2rem); padding-bottom: var(--ts-header-pb); border-bottom: 1px solid var(--hair); }
48
+ .ts-back { --ts-back-fs: 0.8rem; --ts-back-mb: 0.9rem; display: inline-block; color: var(--ink-soft); font-family: var(--font-mono); font-size: var(--ts-back-fs); letter-spacing: 0.02em; margin-bottom: var(--ts-back-mb); }
49
+ .ts-kicker { --ts-kicker-fs: 0.7rem; --ts-kicker-mb: 0.45rem; display: block; font-family: var(--font-mono); font-size: var(--ts-kicker-fs); letter-spacing: 0.16em; text-transform: uppercase; color: color-mix(in srgb, var(--accent) 70%, var(--ink)); margin-bottom: var(--ts-kicker-mb); }
50
+ .ts-h1 { --ts-h1-mb: 0.85rem; font-family: var(--font-sans); font-size: clamp(1.7rem, 3.6vw, 2.6rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; color: var(--ink); margin: 0 0 var(--ts-h1-mb); }
51
+ .ts-meta { --ts-meta-gap: 0.55rem; display: flex; align-items: center; gap: var(--ts-meta-gap); flex-wrap: wrap; }
52
+ .ts-meta-text { color: var(--ink-mute); font-size: 0.85rem; font-family: var(--font-mono); }
53
+ }
54
+
55
+ .ts-back:hover { color: var(--accent); }
56
+
57
+ /* ---- KPI strip ---- */
58
+ @layer components {
59
+ .ts-kpis {
60
+ --ts-kpi-min: 11.625rem; /* 186px grid floor */
61
+ --ts-kpi-gap: 0.9rem;
62
+ --ts-kpi-mb: 1.4rem;
63
+ display: grid; grid-template-columns: repeat(auto-fit, minmax(var(--ts-kpi-min), 1fr)); gap: var(--ts-kpi-gap); margin-bottom: var(--ts-kpi-mb);
64
+ }
65
+ .ts-kpis-primary {
66
+ grid-template-columns: repeat(6, minmax(0, 1fr));
67
+ gap: clamp(0.35rem, 0.9vw, 0.65rem);
68
+ }
69
+ .ts-kpi {
70
+ --ts-kpi-pad-block: clamp(0.6rem, 1.1vw, 0.9rem);
71
+ --ts-kpi-pad-inline: clamp(0.5rem, 1vw, 0.85rem);
72
+ --ts-kpi-row-gap: 0.2rem;
73
+ min-width: 0; border: 1px solid var(--hair); border-radius: var(--r-md); background: var(--surface); padding: var(--ts-kpi-pad-block) var(--ts-kpi-pad-inline); display: flex; flex-direction: column; gap: var(--ts-kpi-row-gap);
74
+ }
75
+ .ts-kpi-label { font-size: 0.7rem; color: var(--ink-mute); letter-spacing: 0.1em; text-transform: uppercase; font-family: var(--font-mono); }
76
+ .ts-kpi-value { font-family: var(--font-mono); font-size: clamp(1.2rem, 1.05rem + 0.9vw, 1.65rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; color: var(--ink); overflow-wrap: anywhere; }
77
+ .ts-kpi-sub { font-size: 0.76rem; color: var(--ink-mute); overflow-wrap: anywhere; }
78
+ .is-pos { color: var(--up); }
79
+ .is-neg { color: var(--down); }
80
+ }
81
+
82
+ .ts-kpis-primary .ts-kpi-label { font-size: clamp(0.52rem, 0.45rem + 0.28vw, 0.62rem); letter-spacing: 0.06em; }
83
+ .ts-kpis-primary .ts-kpi-value { font-size: clamp(0.82rem, 0.62rem + 0.7vw, 1.1rem); }
84
+
85
+ /* ---- panels, legends, tabs ---- */
86
+ @layer components {
87
+ .ts-panel {
88
+ --ts-panel-pad: 1.25rem 1.3rem 1.35rem;
89
+ --ts-panel-mb: 1.1rem;
90
+ border: 1px solid var(--hair); border-radius: 0; background: var(--surface); padding: var(--ts-panel-pad); margin-bottom: var(--ts-panel-mb);
91
+ }
92
+ .ts-panel-head {
93
+ --ts-panel-head-gap: 0.75rem;
94
+ --ts-panel-head-mb: 0.75rem;
95
+ --ts-panel-head-pb: 0.55rem;
96
+ display: flex; justify-content: space-between; align-items: center; gap: var(--ts-panel-head-gap); margin-bottom: var(--ts-panel-head-mb); padding-bottom: var(--ts-panel-head-pb); border-bottom: 1px solid var(--hair); flex-wrap: wrap;
97
+ }
98
+ .ts-panel-chart-main { padding-bottom: var(--space-3, 1rem); }
99
+ .ts-panel-tools {
100
+ --ts-tools-gap: 0.55rem;
101
+ --ts-tool-fs: 0.68rem; /* Reset button label */
102
+ --ts-tool-pad: 0.2rem 0.55rem;
103
+ display: inline-flex; align-items: center; gap: var(--ts-tools-gap); flex-wrap: wrap; justify-content: flex-end;
104
+ }
105
+ .ts-chart-legend {
106
+ /* legend swatch geometry — the overlay sheet reads these too */
107
+ --ts-legend-gap: 0.65rem;
108
+ --ts-legend-fs: 0.68rem;
109
+ --ts-legend-item-gap: 0.35rem;
110
+ --ts-legend-line-w: 1.125rem; /* 18px */
111
+ --ts-legend-stroke-w: 2px;
112
+ --ts-swatch-w: 0.75rem; /* 12px */
113
+ --ts-swatch-h: 0.5625rem; /* 9px */
114
+ --ts-marker-half: 0.375rem; /* 6px triangle half-base */
115
+ --ts-marker-h: 0.625rem; /* 10px triangle height */
116
+ display: inline-flex; align-items: center; gap: var(--ts-legend-gap); flex-wrap: wrap; font-family: var(--font-mono); font-size: var(--ts-legend-fs); color: var(--ink-mute); letter-spacing: 0.04em;
117
+ }
118
+ .ts-chart-legend-item { display: inline-flex; align-items: center; gap: var(--ts-legend-item-gap); white-space: nowrap; }
119
+ .ts-chart-legend-swatch { display: inline-block; flex-shrink: 0; }
120
+ .ts-chart-legend-line { width: var(--ts-legend-line-w); height: 0; border-top: var(--ts-legend-stroke-w) solid var(--accent); }
121
+ .ts-chart-legend-bar-up { width: var(--ts-swatch-w); height: var(--ts-swatch-h); background: var(--up); opacity: 0.82; border-radius: 0; }
122
+ .ts-chart-legend-bar-down { width: var(--ts-swatch-w); height: var(--ts-swatch-h); background: var(--down); opacity: 0.82; border-radius: 0; }
123
+ .ts-chart-legend-marker-buy { width: 0; height: 0; border-inline-start: var(--ts-marker-half) solid transparent; border-inline-end: var(--ts-marker-half) solid transparent; border-bottom: var(--ts-marker-h) solid var(--accent); filter: drop-shadow(0 1px 2px color-mix(in srgb, var(--bg) 60%, transparent)); }
124
+ .ts-chart-legend-marker-sell { width: 0; height: 0; border-inline-start: var(--ts-marker-half) solid transparent; border-inline-end: var(--ts-marker-half) solid transparent; border-top: var(--ts-marker-h) solid var(--down); filter: drop-shadow(0 1px 2px color-mix(in srgb, var(--bg) 60%, transparent)); }
125
+ .ts-chart-legend-bar-open {
126
+ width: var(--ts-swatch-w);
127
+ height: var(--ts-swatch-h);
128
+ border-radius: 0;
129
+ background: color-mix(in srgb, var(--accent) 35%, var(--surface));
130
+ border: var(--ts-legend-stroke-w) solid var(--accent);
131
+ opacity: 0.85;
132
+ }
133
+
134
+ .ts-mode-bar { display: flex; justify-content: flex-start; margin-bottom: var(--space-3, 1rem); }
135
+ .ts-tab-stack { margin-bottom: 1.1rem; }
136
+ .ts-tab-content { min-height: 26.25rem; } /* 420px canvas floor */
137
+ .ts-tab-content-charts { position: relative; }
138
+ .ts-tab-content-tables { min-height: auto; }
139
+ .ts-tab-pane { animation: ts-tab-in 0.18s var(--ease); }
140
+ .ts-advanced-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--space-3, 1rem); align-items: start; }
141
+ .ts-panel-label { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-mute); letter-spacing: 0.12em; text-transform: uppercase; }
142
+ .ts-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
143
+ }
144
+
145
+ .ts-panel-chart-main .ts-panel-head { margin-bottom: 0.65rem; }
146
+ .ts-tab-stack .ts-panel-head { margin-bottom: 0.65rem; }
147
+ .ts-tab-pane[hidden] { display: none; }
148
+ @keyframes ts-tab-in {
149
+ from { opacity: 0; transform: translateY(4px); }
150
+ to { opacity: 1; transform: translateY(0); }
151
+ }
152
+ @media (prefers-reduced-motion: reduce) {
153
+ .ts-tab-pane { animation: none; }
154
+ /* The live dot pulses forever, which is precisely the kind of unbounded
155
+ motion this query exists to stop. The dot itself stays — it still reads as
156
+ the status mark next to "example" / "live" — only the pulse is dropped. */
157
+ .ts-live-dot { animation: none; }
158
+ }
159
+ .ts-metrics-table th[scope="row"] { font-weight: 500; color: var(--ink-soft); white-space: nowrap; }
160
+ .ts-metrics-table th[scope="col"] { font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-mute); }
161
+ @media (max-width: 900px) {
162
+ .ts-advanced-grid { grid-template-columns: 1fr; }
163
+ }
164
+ @media (max-width: 1100px) {
165
+ .ts-kpis-primary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
166
+ }
167
+ @media (max-width: 640px) {
168
+ .ts-kpis-primary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
169
+ .ts-kpis-primary .ts-kpi-label { letter-spacing: 0.04em; }
170
+ .ts-kpis-primary .ts-kpi-value { font-size: clamp(0.78rem, 2.8vw, 0.95rem); }
171
+ .ts-tab-content .ts-chart { height: var(--ts-chart-h-sm, clamp(200px, 58vw, 360px)); }
172
+ .ts-svg .ts-axis { font-size: var(--ts-axis-fs-sm, 9px); }
173
+ }
174
+
175
+ /* ---- SVG chart surfaces + hover tip ---- */
176
+ @layer components {
177
+ .ts-chart {
178
+ /* chart + tooltip geometry */
179
+ --ts-chart-h: clamp(220px, 52vw, 440px);
180
+ --ts-chart-h-sm: clamp(200px, 58vw, 360px);
181
+ --ts-tip-max-w: 20rem;
182
+ --ts-tip-gutter: 2rem;
183
+ --ts-tip-pad: 0.45rem 0.6rem;
184
+ --ts-tip-fs: 0.68rem;
185
+ --ts-tip-dx: 12px;
186
+ --ts-tip-dy: 8px;
187
+ --ts-tip-row-gap: 0.35rem;
188
+ --ts-tip-title-gap: 0.45rem;
189
+ --ts-tip-signal-fs: 0.62rem;
190
+ --ts-tip-dl-gap: 0.22rem;
191
+ --ts-tip-kv-gap: 0.65rem;
192
+ --ts-tip-dt-fs: 0.6rem;
193
+ --ts-axis-fs: 11px;
194
+ --ts-axis-fs-sm: 9px;
195
+ --ts-svg-empty-fs: 13px;
196
+ --ts-legend-label-fs: 10px;
197
+ width: 100%; overflow: hidden;
198
+ }
199
+ .ts-chart-wrap { position: relative; width: 100%; height: 100%; }
200
+ .ts-chart-tip {
201
+ position: absolute;
202
+ z-index: 30;
203
+ width: max-content;
204
+ min-width: 0;
205
+ max-width: min(var(--ts-tip-max-w), calc(100vw - var(--ts-tip-gutter)));
206
+ padding: var(--ts-tip-pad);
207
+ border-radius: var(--r-sm);
208
+ border: 1px solid var(--hair);
209
+ background: var(--surface);
210
+ color: var(--ink-soft);
211
+ font-family: var(--font-mono);
212
+ font-size: var(--ts-tip-fs);
213
+ letter-spacing: 0.02em;
214
+ line-height: 1.35;
215
+ white-space: normal;
216
+ text-align: start;
217
+ box-shadow: 0 10px 28px -18px rgba(0, 0, 0, 0.45); /* neutral shade, theme-agnostic */
218
+ pointer-events: none;
219
+ transform: translate(var(--ts-tip-dx), calc(-100% - var(--ts-tip-dy)));
220
+ }
221
+ .ts-chart-tip-body { display: flex; flex-direction: column; gap: var(--ts-tip-row-gap); }
222
+ .ts-chart-tip-title { display: flex; align-items: center; gap: var(--ts-tip-title-gap); flex-wrap: wrap; }
223
+ .ts-chart-tip-signal { color: var(--ink-mute); font-size: var(--ts-tip-signal-fs); letter-spacing: 0.04em; }
224
+ .ts-chart-tip-dl { margin: 0; display: grid; gap: var(--ts-tip-dl-gap); }
225
+ .ts-svg { width: 100%; height: 100%; display: block; overflow: hidden; }
226
+ /* Drag-pan now runs on Pointer Events (mouse + single-finger touch) — the
227
+ browser's own touch-scroll gesture must not compete with it, or a drag
228
+ starting on this element pans the page instead of (or as well as) the
229
+ chart. Scoped to .is-interactive only: a static/non-interactive chart
230
+ has no pointerdown handler and should keep ordinary page-scroll touch
231
+ behavior. */
232
+ .ts-svg.is-interactive { touch-action: pan-y; }
233
+ .ts-grid { stroke: var(--hair); stroke-width: 1; }
234
+ .ts-grid-zero { stroke: var(--hair-2); }
235
+ .ts-axis { fill: var(--ink-mute); font-family: var(--font-mono); font-size: var(--ts-axis-fs); }
236
+ .ts-svg-empty { fill: var(--ink-mute); font-family: var(--font-mono); font-size: var(--ts-svg-empty-fs); }
237
+ .ts-legend-label { fill: var(--ink-mute); font-family: var(--font-mono); font-size: var(--ts-legend-label-fs); }
238
+ .ts-line { stroke-width: 2; }
239
+ .ts-area { opacity: 0.14; stroke: none; }
240
+ .ts-contribution-segment { opacity: 0.78; }
241
+ .ts-portfolio-return-line { stroke-width: 2.5; vector-effect: non-scaling-stroke; }
242
+ .ts-portfolio-return-dot { fill: var(--surface); stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
243
+ .ts-benchmark-return-line { stroke: var(--ink-soft); stroke-width: 1.5; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
244
+ .ts-contribution-axis { font-size: var(--ts-axis-fs-sm); }
245
+ }
246
+
247
+ .ts-tab-content .ts-chart { height: var(--ts-chart-h, clamp(220px, 52vw, 440px)); }
248
+ .ts-chart-tip.is-flip-x { transform: translate(calc(-100% - var(--ts-tip-dx)), calc(-100% - var(--ts-tip-dy))); }
249
+ .ts-chart-tip.is-flip-y { transform: translate(var(--ts-tip-dx), var(--ts-tip-dy)); }
250
+ .ts-chart-tip.is-flip-x.is-flip-y { transform: translate(calc(-100% - var(--ts-tip-dx)), var(--ts-tip-dy)); }
251
+ .ts-chart-tip-dl > div { display: flex; gap: var(--ts-tip-kv-gap); justify-content: space-between; align-items: baseline; }
252
+ .ts-chart-tip-dl dt { color: var(--ink-mute); font-size: var(--ts-tip-dt-fs); text-transform: uppercase; letter-spacing: 0.06em; flex-shrink: 0; }
253
+ .ts-chart-tip-dl dd { margin: 0; color: var(--ink); text-align: end; white-space: nowrap; }
254
+ .ts-tone-accent.ts-line { stroke: var(--accent); }
255
+ .ts-tone-accent.ts-area { fill: var(--accent); }
256
+ .ts-tone-up.ts-line { stroke: var(--up); }
257
+ .ts-tone-up.ts-area { fill: var(--up); }
258
+ .ts-tone-down.ts-line { stroke: var(--down); }
259
+ .ts-tone-down.ts-area { fill: var(--down); }
260
+ .ts-bar.ts-tone-up { fill: var(--up); opacity: 0.82; }
261
+ .ts-bar.ts-tone-down { fill: var(--down); opacity: 0.82; }
262
+ .ts-bar.ts-bar-open {
263
+ opacity: 0.52;
264
+ stroke: var(--accent);
265
+ stroke-width: 2;
266
+ vector-effect: non-scaling-stroke;
267
+ paint-order: stroke fill;
268
+ }
269
+ .ts-bar.ts-bar-open.ts-tone-down { stroke: color-mix(in srgb, var(--down) 70%, var(--accent)); }
270
+
271
+ /* Candlestick price chart — up uses brand teal (--accent), down uses accent red (--down) */
272
+ @layer components {
273
+ .ts-candle-wick { stroke-width: 1.2; vector-effect: non-scaling-stroke; }
274
+ .ts-marker-layer { pointer-events: none; }
275
+ .ts-marker-wrap { filter: drop-shadow(0 2px 5px color-mix(in srgb, var(--bg) 72%, transparent)); }
276
+ .ts-marker-halo {
277
+ fill: var(--bg);
278
+ stroke: var(--bg);
279
+ stroke-width: 4.5;
280
+ stroke-linejoin: round;
281
+ vector-effect: non-scaling-stroke;
282
+ paint-order: stroke fill;
283
+ }
284
+ .ts-marker {
285
+ stroke: var(--surface);
286
+ stroke-width: 2;
287
+ stroke-linejoin: round;
288
+ vector-effect: non-scaling-stroke;
289
+ paint-order: stroke fill;
290
+ }
291
+ .ts-marker-buy { fill: var(--accent); }
292
+ .ts-marker-sell { fill: var(--down); }
293
+ .ts-panel-hint { margin-inline-start: auto; }
294
+ }
295
+
296
+ .ts-candle-up .ts-candle-wick { stroke: var(--up); }
297
+ .ts-candle-up .ts-candle-body { fill: var(--up); }
298
+ .ts-candle-down .ts-candle-wick { stroke: var(--down); }
299
+ .ts-candle-down .ts-candle-body { fill: var(--down); }
300
+ .ts-marker-wrap-buy .ts-marker { stroke: color-mix(in srgb, var(--accent) 55%, var(--surface)); }
301
+ .ts-marker-wrap-sell .ts-marker { stroke: color-mix(in srgb, var(--down) 55%, var(--surface)); }
302
+
303
+ /* ---- panel-head tool cluster: legend + Reset + scale/period toggles ---- */
304
+ @layer components {
305
+ .ts-scale { --ts-scale-gap: var(--space-2, 0.5rem); display: inline-flex; align-items: center; gap: var(--ts-scale-gap); font-family: var(--font-mono); font-size: 0.7rem; color: var(--ink-mute); letter-spacing: 0.08em; text-transform: uppercase; }
306
+ .ts-select { background: var(--surface-2); border: 1px solid var(--hair); color: var(--ink); font-family: var(--font-mono); font-size: 0.78rem; padding: 0.2rem 0.5rem; border-radius: var(--r-sm); }
307
+ .ts-hint { font-family: var(--font-mono); font-size: 0.66rem; color: var(--ink-mute); letter-spacing: 0.04em; opacity: 0.8; }
308
+ .ts-reset { font-family: var(--font-mono); font-size: var(--ts-tool-fs, 0.68rem); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); background: var(--accent-weak); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); border-radius: var(--r-sm); padding: var(--ts-tool-pad, 0.2rem 0.55rem); cursor: pointer; transition: background 0.18s var(--ease); }
309
+ .ts-reset-chart {
310
+ --ts-reset-inset: 0.5rem;
311
+ --ts-reset-size: 1.85rem;
312
+ position: absolute;
313
+ top: var(--ts-reset-inset);
314
+ inset-inline-end: var(--ts-reset-inset);
315
+ z-index: 6;
316
+ text-transform: none;
317
+ letter-spacing: 0;
318
+ padding: 0.38rem;
319
+ line-height: 0;
320
+ width: var(--ts-reset-size);
321
+ height: var(--ts-reset-size);
322
+ display: inline-flex;
323
+ align-items: center;
324
+ justify-content: center;
325
+ background: color-mix(in srgb, var(--surface) 88%, transparent);
326
+ backdrop-filter: blur(6px);
327
+ }
328
+
329
+ /* Segmented toggle (Linear/Log, Log $/%, Monthly/Quarterly/Annual). */
330
+ .ts-seg { --ts-seg-fs: 0.74rem; --ts-seg-pad: 0.22rem 0.62rem; display: inline-flex; border: 1px solid var(--hair); border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); }
331
+ .ts-seg-btn { font-family: var(--font-mono); font-size: var(--ts-seg-fs, 0.74rem); color: var(--ink-mute); background: transparent; border: none; border-inline-start: 1px solid var(--hair); padding: var(--ts-seg-pad, 0.22rem 0.62rem); cursor: pointer; transition: color 0.18s var(--ease), background 0.18s var(--ease); }
332
+ .ts-chart-controls { --ts-controls-gap: 0.55rem; display: inline-flex; align-items: center; gap: var(--ts-controls-gap); flex-wrap: wrap; }
333
+ }
334
+
335
+ .ts-reset:hover { background: color-mix(in srgb, var(--accent) 24%, transparent); }
336
+ .ts-reset-chart svg { display: block; }
337
+ .ts-seg-btn:first-child { border-inline-start: none; }
338
+ .ts-seg-btn:hover { color: var(--ink); }
339
+ .ts-seg-btn.is-active { color: color-mix(in srgb, var(--accent) 70%, var(--ink)); background: var(--accent-weak); }
340
+ /* .ts-seg's own overflow:hidden (it clips square button corners to the
341
+ pill's rounded border-radius) leaves almost no clearance around each
342
+ button — the global :focus-visible rule's positive outline-offset (3px)
343
+ plus its 2px width need ~5px to render at all, and gets clipped away
344
+ here. An inset (negative-offset) ring instead draws entirely inside the
345
+ button's own border box, so it can never be clipped by the parent
346
+ regardless of how tight that clearance is — the standard fix for a
347
+ focus ring inside a clipped, rounded container. */
348
+ .ts-seg-btn:focus-visible {
349
+ outline: 2px solid var(--accent);
350
+ outline-offset: -2px;
351
+ border-radius: 0;
352
+ }
353
+ .ts-seg-static .ts-seg-btn { pointer-events: none; cursor: default; }
354
+ .ts-seg-compact .ts-seg-btn { font-size: 0.68rem; padding: 0.2rem 0.48rem; letter-spacing: 0.02em; }
355
+
356
+ /* ---- returns matrix — CSS-grid calendar heatmap of period returns ---- */
357
+ @layer components {
358
+ .ts-matrix {
359
+ /* matrix geometry; --ts-matrix-fill-* are the filled-cell variant */
360
+ --ts-matrix-gap: 2px;
361
+ --ts-matrix-fill-gap: 3px;
362
+ --ts-matrix-head-pad: 0.3rem 0.2rem;
363
+ --ts-matrix-cell-pad: 0.4rem 0.25rem;
364
+ --ts-matrix-fill-cell-pad: clamp(0.35rem, 1vw, 0.7rem) 0.4rem;
365
+ --ts-matrix-fill-head-pad: clamp(0.35rem, 0.8vw, 0.55rem) 0.3rem;
366
+ --ts-matrix-fill-cell-min-h: 2.1rem;
367
+ display: grid; gap: var(--ts-matrix-gap); font-family: var(--font-mono); font-size: 0.74rem;
368
+ }
369
+ .ts-matrix-wrap { flex: 1; display: flex; flex-direction: column; min-height: 0; }
370
+ .ts-matrix-corner { background: transparent; }
371
+ .ts-matrix-head { color: var(--ink-mute); font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; text-align: center; padding: var(--ts-matrix-head-pad); }
372
+ .ts-matrix-year-head { color: var(--ink-soft); }
373
+ .ts-matrix-rowlabel { color: var(--ink-soft); font-size: 0.72rem; display: flex; align-items: center; padding: 0 0.5rem 0 0.1rem; white-space: nowrap; }
374
+ .ts-matrix-cell { color: var(--heat-ink); text-align: center; padding: var(--ts-matrix-cell-pad); border-radius: var(--r-sm); border: 1px solid var(--hair); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
375
+ /* The cell background is an --up/--down wash over --surface; at the top of
376
+ the 14–72% range the dark canvas wash is bright enough that neither
377
+ --ink nor --heat-ink clears AA on it. `.is-strong` (set by ReturnsMatrix
378
+ when |value| lands in that band for the up tone) switches to
379
+ --heat-ink-strong. Worst step 4.60:1 (dark, up 57%); light theme aliases
380
+ both heat inks to --ink, whose worst step is 5.22:1. */
381
+ .ts-matrix-cell.is-strong { color: var(--heat-ink-strong); }
382
+ .ts-matrix-fill { width: 100%; align-content: stretch; font-size: clamp(0.72rem, 0.95vw, 0.9rem); gap: var(--ts-matrix-fill-gap); }
383
+ .ts-matrix-year { font-weight: 600; border-color: var(--hair-2); }
384
+ }
385
+
386
+ .ts-matrix-fill .ts-matrix-cell { display: flex; align-items: center; justify-content: center; min-height: var(--ts-matrix-fill-cell-min-h, 2.1rem); padding: var(--ts-matrix-fill-cell-pad, clamp(0.35rem, 1vw, 0.7rem) 0.4rem); }
387
+ .ts-matrix-fill .ts-matrix-head { padding: var(--ts-matrix-fill-head-pad, clamp(0.35rem, 0.8vw, 0.55rem) 0.3rem); font-size: clamp(0.62rem, 0.85vw, 0.72rem); }
388
+ .ts-matrix-fill .ts-matrix-rowlabel { font-size: clamp(0.68rem, 0.9vw, 0.82rem); }
389
+ .ts-matrix-cell.is-empty { color: var(--ink-mute); border-style: dashed; opacity: 0.5; }
390
+
391
+ /* ---- tables: trade log, breakdowns, pivot statistics ---- */
392
+ @layer components {
393
+ .ts-table-wrap { width: 100%; overflow-x: auto; }
394
+ .ts-table {
395
+ /* table geometry, inherited by thead/th/td rules below */
396
+ --ts-table-fs: 0.88rem;
397
+ --ts-table-cell-pad: 0.55rem 0.8rem;
398
+ --ts-table-head-fs: 0.7rem;
399
+ --ts-pivot-min-w: 32.5rem; /* 520px pivot floor */
400
+ width: 100%; border-collapse: collapse; font-size: var(--ts-table-fs);
401
+ }
402
+ .ts-table-scroll {
403
+ --ts-table-scroll-h: 32.5rem; /* 520px scroll cap */
404
+ max-height: var(--ts-table-scroll-h);
405
+ overflow-y: auto;
406
+ }
407
+ .ts-num { text-align: end; }
408
+ .ts-breakdown-wrap { max-height: var(--ts-table-scroll-h, 32.5rem); }
409
+
410
+ /* Pivot statistics table */
411
+ .ts-pivot-stats { display: flex; flex-direction: column; }
412
+ .ts-pivot-wrap { max-height: min(70vh, 640px); }
413
+ .ts-pivot-table { min-width: max(100%, var(--ts-pivot-min-w, 32.5rem)); }
414
+ .ts-pivot-col { min-width: 5.5rem; }
415
+ .ts-pivot-print-title {
416
+ margin: 0 0 0.5rem;
417
+ font-family: var(--font-mono);
418
+ font-size: 0.72rem;
419
+ font-weight: 500;
420
+ letter-spacing: 0.06em;
421
+ text-transform: uppercase;
422
+ color: var(--ink-mute);
423
+ }
424
+ .ts-tab-pane-matrix { min-height: min(70vh, 520px); display: flex; flex-direction: column; flex: 1; }
425
+
426
+ .ts-dir { display: inline-block; padding: 0.05rem 0.55rem; border: 1px solid currentColor; border-radius: 0; font-size: 0.72rem; font-family: var(--font-mono); }
427
+ .ts-dir-long { color: var(--up); }
428
+ .ts-dir-short { color: var(--down); }
429
+ }
430
+
431
+ .ts-table th, .ts-table td { text-align: start; padding: var(--ts-table-cell-pad, 0.55rem 0.8rem); border-bottom: 1px solid var(--hair); white-space: nowrap; }
432
+ .ts-table thead th { position: sticky; top: 0; background: var(--surface); color: var(--ink-mute); font-family: var(--font-mono); font-size: var(--ts-table-head-fs, 0.7rem); letter-spacing: 0.08em; text-transform: uppercase; z-index: 1; }
433
+ .ts-table tbody th[scope="row"] { color: var(--ink-soft); font-weight: 400; }
434
+ .ts-table td { color: var(--ink); font-family: var(--font-mono); }
435
+ .ts-breakdown td { text-align: end; }
436
+ .ts-breakdown th:first-child, .ts-breakdown td:first-child { text-align: start; }
437
+ .ts-breakdown tbody th[scope="row"] { color: var(--ink-soft); font-weight: 500; white-space: nowrap; }
438
+ .ts-pivot-seg .ts-seg-btn { font-size: 0.68rem; padding: 0.18rem 0.52rem; }
439
+ .ts-pivot-table td { text-align: end; }
440
+ .ts-pivot-metric-col {
441
+ position: sticky;
442
+ inset-inline-start: 0;
443
+ z-index: 1;
444
+ text-align: start !important;
445
+ font-weight: 500;
446
+ color: var(--ink-soft);
447
+ white-space: nowrap;
448
+ background: linear-gradient(90deg, var(--surface) 85%, transparent);
449
+ box-shadow: 4px 0 12px -8px color-mix(in srgb, var(--ink) 12%, transparent);
450
+ }
451
+ .ts-pivot-table thead .ts-pivot-metric-col { background: var(--surface); }
452
+ .ts-pivot-table th[scope="col"] {
453
+ font-size: 0.68rem;
454
+ letter-spacing: 0.06em;
455
+ text-transform: lowercase;
456
+ color: var(--ink-mute);
457
+ white-space: nowrap;
458
+ }
459
+ .ts-pivot-print-block + .ts-pivot-print-block { margin-top: 1.25rem; }
460
+ .ts-tab-pane-matrix .ts-table-wrap { flex: 1; display: flex; flex-direction: column; }
461
+
462
+ /* ---- current / open position ---- */
463
+ @layer components {
464
+ .ts-position {
465
+ /* position card geometry */
466
+ --ts-position-pad: 1rem 1.15rem 1.1rem;
467
+ --ts-position-mb: 1.1rem;
468
+ --ts-position-head-gap: 0.75rem;
469
+ --ts-position-head-mb: 0.85rem;
470
+ --ts-position-head-pb: 0.55rem;
471
+ --ts-position-body-gap: 1rem;
472
+ --ts-position-stat-gap: 1.25rem;
473
+ border: 1px solid var(--hair);
474
+ border-radius: var(--r-md);
475
+ background: linear-gradient(180deg, var(--surface), var(--surface-2));
476
+ padding: var(--ts-position-pad);
477
+ margin-bottom: var(--ts-position-mb);
478
+ }
479
+ .ts-position-live {
480
+ border-color: color-mix(in srgb, var(--accent) 35%, var(--hair));
481
+ box-shadow: 0 20px 48px -40px color-mix(in srgb, var(--accent) 55%, transparent);
482
+ }
483
+ .ts-position-head {
484
+ display: flex;
485
+ justify-content: space-between;
486
+ align-items: baseline;
487
+ gap: var(--ts-position-head-gap);
488
+ margin-bottom: var(--ts-position-head-mb);
489
+ padding-bottom: var(--ts-position-head-pb);
490
+ border-bottom: 1px solid var(--hair);
491
+ }
492
+ .ts-position-asof {
493
+ font-family: var(--font-mono);
494
+ font-size: 0.72rem;
495
+ color: var(--ink-mute);
496
+ }
497
+ .ts-position-body {
498
+ display: flex;
499
+ align-items: center;
500
+ gap: var(--ts-position-body-gap);
501
+ flex-wrap: wrap;
502
+ }
503
+ .ts-position-main {
504
+ display: flex;
505
+ flex-direction: column;
506
+ gap: 0.2rem;
507
+ min-width: 0;
508
+ flex: 1 1 12rem;
509
+ }
510
+ .ts-position-signal {
511
+ font-family: var(--font-mono);
512
+ font-size: 0.78rem;
513
+ letter-spacing: 0.06em;
514
+ text-transform: uppercase;
515
+ color: var(--accent);
516
+ }
517
+ .ts-position-entry {
518
+ font-family: var(--font-mono);
519
+ font-size: 0.92rem;
520
+ color: var(--ink);
521
+ }
522
+ .ts-position-stats {
523
+ display: flex;
524
+ gap: var(--ts-position-stat-gap);
525
+ flex-wrap: wrap;
526
+ margin-inline-start: auto;
527
+ }
528
+ .ts-position-flat-msg {
529
+ margin: 0;
530
+ font-family: var(--font-mono);
531
+ font-size: 0.88rem;
532
+ color: var(--ink-soft);
533
+ }
534
+ .ts-position-asset { color: var(--ink); }
535
+ .ts-trade-open { background: color-mix(in srgb, var(--accent) 6%, transparent); }
536
+ .ts-trade-unrealized { display: inline-flex; align-items: baseline; gap: 0.35rem; flex-wrap: wrap; justify-content: flex-end; }
537
+ .ts-trade-unrealized-tag {
538
+ font-size: 0.62rem;
539
+ letter-spacing: 0.06em;
540
+ text-transform: uppercase;
541
+ color: var(--ink-mute);
542
+ font-family: var(--font-mono);
543
+ }
544
+ }
545
+
546
+ .ts-position-stats div { display: flex; flex-direction: column; gap: 0.15rem; min-width: 5.5rem; }.ts-position-stats dt {
547
+ font-family: var(--font-mono);
548
+ font-size: 0.62rem;
549
+ letter-spacing: 0.08em;
550
+ text-transform: uppercase;
551
+ color: var(--ink-mute);
552
+ }
553
+ .ts-position-stats dd {
554
+ margin: 0;
555
+ font-family: var(--font-mono);
556
+ font-size: 1.05rem;
557
+ font-weight: 600;
558
+ color: var(--ink);
559
+ }
560
+ .ts-trade-open td { border-color: color-mix(in srgb, var(--accent) 18%, var(--hair)); }
561
+
562
+ /* ---- per-asset strategy notes — plain text, collapsible ---- */
563
+ @layer components {
564
+ .ts-strategy-notes {
565
+ --ts-notes-mt: var(--space-4, 1.5rem);
566
+ --ts-notes-pt: 1.1rem;
567
+ --ts-notes-gap: 0.65rem;
568
+ --ts-notes-chevron: 0.4rem;
569
+ width: 100%;
570
+ margin-top: var(--ts-notes-mt);
571
+ padding-top: var(--ts-notes-pt);
572
+ border-top: 1px solid var(--hair);
573
+ }
574
+ .ts-strategy-notes-summary {
575
+ display: flex;
576
+ align-items: center;
577
+ justify-content: space-between;
578
+ gap: var(--space-3, 1rem);
579
+ cursor: pointer;
580
+ list-style: none;
581
+ user-select: none;
582
+ padding: 0.15rem 0;
583
+ }
584
+ .ts-strategy-notes-label {
585
+ font-family: var(--font-mono);
586
+ font-size: 0.72rem;
587
+ letter-spacing: 0.08em;
588
+ text-transform: uppercase;
589
+ color: var(--ink-mute);
590
+ }
591
+ .ts-strategy-notes-chevron {
592
+ flex-shrink: 0;
593
+ width: var(--ts-notes-chevron);
594
+ height: var(--ts-notes-chevron);
595
+ border-inline-end: 1.5px solid var(--ink-mute);
596
+ border-bottom: 1.5px solid var(--ink-mute);
597
+ transform: rotate(45deg);
598
+ margin-top: -0.12rem;
599
+ transition: transform 0.2s var(--ease), border-color 0.18s var(--ease);
600
+ }
601
+ .ts-strategy-notes-body {
602
+ padding: 0.65rem 0 0.2rem;
603
+ display: flex;
604
+ flex-direction: column;
605
+ gap: var(--ts-notes-gap);
606
+ }
607
+ .ts-strategy-notes-meta {
608
+ list-style: none;
609
+ margin: 0.15rem 0 0;
610
+ padding: 0.75rem 0 0;
611
+ border-top: 1px solid var(--hair);
612
+ display: flex;
613
+ flex-direction: column;
614
+ gap: 0.4rem;
615
+ }
616
+ }
617
+
618
+ .ts-strategy-notes-summary::-webkit-details-marker { display: none; }
619
+ .ts-strategy-notes[open] .ts-strategy-notes-chevron {
620
+ transform: rotate(-135deg);
621
+ margin-top: 0.15rem;
622
+ border-color: var(--accent);
623
+ }
624
+ .ts-strategy-notes-body p {
625
+ margin: 0;
626
+ font-size: 0.88rem;
627
+ line-height: 1.58;
628
+ color: var(--ink-soft);
629
+ max-width: none;
630
+ }
631
+ .ts-strategy-notes-meta li {
632
+ position: relative;
633
+ padding-inline-start: 1em;
634
+ font-family: var(--font-mono);
635
+ font-size: 0.72rem;
636
+ line-height: 1.45;
637
+ color: var(--ink-mute);
638
+ }
639
+ .ts-strategy-notes-meta li::before {
640
+ content: "·";
641
+ position: absolute;
642
+ inset-inline-start: 0;
643
+ color: var(--accent);
644
+ }
645
+
646
+ /* ---- library head + strategy cards ---- */
647
+ @layer components {
648
+ .ts-lib-head { --ts-lib-head-max: 42.5rem; --ts-lib-head-mb: 2.6rem; text-align: center; max-width: var(--ts-lib-head-max); margin: 0 auto var(--ts-lib-head-mb); }
649
+ .ts-lib-lede { color: var(--ink-soft); font-size: 1.02rem; line-height: 1.6; margin: 0.9rem auto 0; }
650
+ .ts-lib-grid { --ts-lib-card-min: 16.25rem; --ts-lib-gap: 0.85rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--ts-lib-card-min), 1fr)); gap: var(--ts-lib-gap); margin-bottom: 0.5rem; }
651
+ .ts-lib-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-3, 1rem); margin-bottom: var(--space-3, 1rem); }
652
+ .ts-card-kind { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
653
+ .ts-card { --ts-card-gap: 0.7rem; --ts-card-pad: 1rem 1.05rem; display: flex; flex-direction: column; gap: var(--ts-card-gap); border: 1px solid var(--hair); border-radius: var(--r-md); background: transparent; padding: var(--ts-card-pad); transition: transform 0.25s var(--ease), border-color 0.25s var(--ease); }
654
+ .ts-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.65rem; }
655
+ .ts-card-title { display: flex; align-items: center; gap: 0.65rem; min-width: 0; flex: 1; }
656
+ .ts-card-title-text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
657
+ .ts-card-symbol { font-family: var(--font-mono); font-size: 0.76rem; color: var(--ink-mute); letter-spacing: 0.02em; }
658
+ .asset-logo { display: block; flex-shrink: 0; object-fit: contain; }
659
+ .ts-h1-with-logo { display: flex; align-items: center; gap: 0.75rem; }
660
+ .ts-position-logo { vertical-align: middle; }
661
+ .ts-card-name { color: var(--ink); font-family: var(--font-mono); font-size: 0.95rem; letter-spacing: -0.01em; }
662
+ .ts-card-period { color: var(--ink-mute); font-size: 0.68rem; font-family: var(--font-mono); }
663
+ .ts-card-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem 0.75rem; }
664
+ .ts-card-kpi { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
665
+ .ts-card-kpi-label { font-size: 0.6rem; color: var(--ink-mute); letter-spacing: 0.08em; text-transform: uppercase; font-family: var(--font-mono); }
666
+ .ts-card-kpi-value { font-size: 0.9rem; color: var(--ink); font-family: var(--font-mono); overflow-wrap: anywhere; }
667
+ }
668
+
669
+ .ts-lib-head .ts-h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2rem, 4.4vw, 3rem); letter-spacing: -0.015em; margin-top: 0.6rem; }
670
+ .ts-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, transparent); transform: translateY(-2px); }
671
+ .ts-position-asset,
672
+ .ts-position-asset-dd { display: inline-flex; align-items: center; gap: 0.4rem; }
673
+
674
+ /* ---- live badge — nightly-refreshed metrics, teal pulse ---- */
675
+ @layer components {
676
+ .ts-live-badge {
677
+ --ts-live-gap: 0.38rem;
678
+ --ts-live-fs: 0.68rem;
679
+ --ts-live-dot: 7px;
680
+ display: inline-flex;
681
+ align-items: center;
682
+ gap: var(--ts-live-gap);
683
+ font-family: var(--font-mono);
684
+ font-size: var(--ts-live-fs);
685
+ letter-spacing: 0.08em;
686
+ text-transform: lowercase;
687
+ /* The shared accent-as-small-text recipe, not the raw accent: at 0.68rem
688
+ the raw module accent fails AA on paper in light theme (4.14 for
689
+ accent-digiquant on white). See contrast.contract.test.ts. */
690
+ color: color-mix(in srgb, var(--accent) 70%, var(--ink));
691
+ user-select: none;
692
+ flex-shrink: 0;
693
+ }
694
+ .ts-live-dot {
695
+ width: var(--ts-live-dot, 7px);
696
+ height: var(--ts-live-dot, 7px);
697
+ border-radius: 50%;
698
+ background: var(--accent);
699
+ box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent);
700
+ animation: ts-live-pulse 2.4s ease-out infinite;
701
+ }
702
+ .ts-card-live { margin-inline-start: auto; }
703
+ }
704
+
705
+ @keyframes ts-live-pulse {
706
+ 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 52%, transparent); }
707
+ 70% { box-shadow: 0 0 0 var(--ts-live-dot, 7px) color-mix(in srgb, var(--accent) 0%, transparent); }
708
+ 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); }
709
+ }
710
+ .ts-meta .ts-live-badge { margin-inline-end: 0.15rem; }
711
+
712
+ @media (max-width: 820px) {
713
+ .ts-grid-2 { grid-template-columns: 1fr; }
714
+ }
715
+
716
+ /* ==========================================================================
717
+ PRINT — the family's differentiator (canon §17), promoted from
718
+ apps/digiquant-web/app/globals.css. Screen and print share ONE render
719
+ tree: runTearsheetPrint pins the light theme + tags html.ts-printing, the
720
+ charts re-render at full span, and this block turns the tabbed screen
721
+ layout into a flowing paper document. UNLAYERED on purpose.
722
+ ========================================================================== */
723
+
724
+ /* Screen: print chrome hidden until export. */
725
+ .ts-print-brand,
726
+ .ts-print-footer,
727
+ .ts-print-heading { display: none; }
728
+
729
+ @media print {
730
+ @page {
731
+ size: auto;
732
+ margin: 12mm 14mm;
733
+ }
734
+
735
+ /* Print pins the LIGHT theme as literals: print cannot rely on data-theme
736
+ (a dark-mode visitor must still get paper-white output), so each value
737
+ below mirrors its :root[data-theme="light"] token from tokens.css —
738
+ named per line. Paper deviations are deliberate: pure #ffffff instead of
739
+ the off-white canvas, and opaque hairlines instead of alpha ones (alpha
740
+ borders dither on some print engines). Everything else in this @media
741
+ block consumes these pinned custom properties, never raw literals. */
742
+ :root[data-theme],
743
+ :root[data-theme="dark"],
744
+ :root[data-theme="light"],
745
+ html.ts-printing {
746
+ color-scheme: light;
747
+ --bg: #ffffff; /* --bg light = #FBFBF9; paper stays pure white */
748
+ --surface: #ffffff; /* --surface light = #FFFFFF */
749
+ --surface-2: #ffffff; /* --surface-2 light = #F4F4F1; flattened to paper */
750
+ --hair: #dddddd; /* --hair light = rgba(10,15,20,.10), opaque for print */
751
+ --hair-2: #cccccc; /* --hair-2 light = rgba(10,15,20,.18), opaque for print */
752
+ --ink: #14181b; /* --ink light */
753
+ --ink-soft: #5c636a; /* --ink-soft light */
754
+ --ink-mute: #666c73; /* --ink-mute light (WCAG AA fix 2026-08-11) */
755
+ --accent: #0c7c71; /* --accent light (WCAG 1.4.3 fix, #2280) */
756
+ --accent-weak: rgba(12, 124, 113, 0.1); /* --accent-weak light (.12 → .1 on paper) */
757
+ --on-accent: #ffffff; /* --on-accent light */
758
+ --up: #0c7c71; /* --up light (paper phosphor) */
759
+ --down: #b2452e; /* --down light (WCAG AA fix 2026-09, canon-audit S2) */
760
+ --warn: #8f6220; /* --warn light (WCAG AA fix 2026-09, canon-audit S2) */
761
+ --heat-ink: #14181b; /* --heat-ink light (== --ink); pinned so dark-theme print never keeps white cell text */
762
+ --heat-ink-strong: #14181b; /* --heat-ink-strong light */
763
+ }
764
+
765
+ html, body {
766
+ background: var(--bg) !important;
767
+ color: var(--ink) !important;
768
+ }
769
+ body {
770
+ -webkit-print-color-adjust: exact;
771
+ print-color-adjust: exact;
772
+ color-adjust: exact;
773
+ }
774
+
775
+ /* chrome dies in print (canon §17): nav, footer, decorative layers,
776
+ toolbars, and toggles — the print brand/footer elements replace them.
777
+ App-local shells (layout wraps, subpage paddings) get their own print
778
+ resets app-side. */
779
+ .grain,
780
+ .glow,
781
+ .site-nav,
782
+ .nav-shell,
783
+ .footer,
784
+ .ts-header-actions,
785
+ .ts-back,
786
+ .ts-scale,
787
+ .ts-charts-toolbar,
788
+ .ts-panel-head,
789
+ .ts-panel-tools,
790
+ .ts-seg,
791
+ .ts-reset,
792
+ .ts-hint,
793
+ .ts-mode-bar,
794
+ .nav-toggle,
795
+ .theme-toggle {
796
+ display: none !important;
797
+ }
798
+ .ts-strategy-notes {
799
+ break-inside: avoid;
800
+ page-break-inside: avoid;
801
+ margin-top: 1rem;
802
+ }
803
+ .ts-strategy-notes-summary { display: none !important; }
804
+ .ts-strategy-notes-body {
805
+ display: flex !important;
806
+ padding-top: 0;
807
+ }
808
+ .ts-strategy-notes-body::before {
809
+ content: "Notes";
810
+ display: block;
811
+ font-family: var(--font-mono);
812
+ font-size: 0.72rem;
813
+ font-weight: 500;
814
+ letter-spacing: 0.06em;
815
+ text-transform: uppercase;
816
+ color: var(--ink-mute);
817
+ margin-bottom: 0.35rem;
818
+ }
819
+ .ts-live-badge {
820
+ display: none !important;
821
+ }
822
+
823
+ .ts-print-brand {
824
+ display: flex !important;
825
+ align-items: center;
826
+ gap: 0.55rem;
827
+ margin-bottom: 1.1rem;
828
+ padding-bottom: 0.75rem;
829
+ border-bottom: 1px solid var(--hair);
830
+ }
831
+ .ts-print-brand-word {
832
+ font-family: var(--font-mono);
833
+ font-size: 0.95rem;
834
+ font-weight: 600;
835
+ letter-spacing: -0.02em;
836
+ color: var(--ink);
837
+ text-transform: lowercase;
838
+ }
839
+ .ts-print-brand-link {
840
+ margin-inline-start: auto;
841
+ font-family: var(--font-mono);
842
+ font-size: 0.78rem;
843
+ color: var(--accent);
844
+ text-decoration: none;
845
+ }
846
+
847
+ .ts-print-footer {
848
+ display: flex !important;
849
+ flex-wrap: wrap;
850
+ align-items: center;
851
+ gap: 0.45rem 1rem;
852
+ margin-top: 1.6rem;
853
+ padding-top: 0.85rem;
854
+ border-top: 1px solid var(--hair);
855
+ font-family: var(--font-mono);
856
+ font-size: 0.72rem;
857
+ color: var(--ink-mute);
858
+ }
859
+ .ts-print-footer-brand {
860
+ font-weight: 600;
861
+ color: var(--ink);
862
+ text-transform: lowercase;
863
+ }
864
+ .ts-print-footer a {
865
+ color: var(--accent);
866
+ text-decoration: none;
867
+ }
868
+ .ts-print-footer-note { margin-inline-start: auto; }
869
+
870
+ .ts-print-heading {
871
+ display: block !important;
872
+ font-family: var(--font-mono);
873
+ font-size: 0.72rem;
874
+ font-weight: 600;
875
+ letter-spacing: 0.12em;
876
+ text-transform: uppercase;
877
+ color: var(--ink-mute);
878
+ margin: 0 0 0.65rem;
879
+ }
880
+ .ts-tab-stack > .ts-print-heading:first-child {
881
+ font-size: 0.78rem;
882
+ color: var(--ink);
883
+ margin-top: 0;
884
+ margin-bottom: 0.85rem;
885
+ padding-bottom: 0.35rem;
886
+ border-bottom: 1px solid var(--hair);
887
+ }
888
+
889
+ .ts-tab-stack[hidden] { display: block !important; }
890
+ .ts-tab-pane[hidden] { display: block !important; min-height: auto; }
891
+ .ts-tab-content { min-height: auto; }
892
+ .ts-tab-pane {
893
+ break-inside: avoid;
894
+ page-break-inside: avoid;
895
+ margin-bottom: 1.25rem;
896
+ padding-bottom: 0.35rem;
897
+ }
898
+ .ts-tab-pane-matrix { break-inside: auto; page-break-inside: auto; }
899
+
900
+ .ts-page { padding: 0; }
901
+ .ts-header {
902
+ margin-bottom: 1.1rem;
903
+ padding-bottom: 0.85rem;
904
+ border-bottom: 1px solid var(--hair);
905
+ }
906
+ .ts-h1 { font-size: 1.55rem; }
907
+
908
+ .ts-panel,
909
+ .ts-kpi,
910
+ .ts-card,
911
+ .ts-position {
912
+ break-inside: avoid;
913
+ page-break-inside: avoid;
914
+ box-shadow: none !important;
915
+ background: var(--surface) !important;
916
+ border: 1px solid var(--hair) !important;
917
+ }
918
+ .ts-position-live { border-color: var(--hair) !important; }
919
+ .ts-trade-open { background: var(--surface) !important; }
920
+
921
+ .ts-grid-2 { grid-template-columns: 1fr 1fr; }
922
+ .ts-table-scroll,
923
+ .ts-breakdown-wrap,
924
+ .ts-pivot-wrap {
925
+ max-height: none !important;
926
+ overflow: visible !important;
927
+ }
928
+ .ts-table thead th {
929
+ position: static;
930
+ background: var(--surface) !important;
931
+ }
932
+ .ts-table th,
933
+ .ts-table td {
934
+ border-color: var(--hair) !important;
935
+ }
936
+ .ts-trades tr { break-inside: avoid; page-break-inside: avoid; }
937
+
938
+ .ts-matrix-cell {
939
+ border-color: var(--hair) !important;
940
+ background: var(--surface) !important;
941
+ }
942
+
943
+ .ts-svg.is-interactive { pointer-events: none; }
944
+ a { color: inherit; text-decoration: none; }
945
+ }