@titan-design/react-ui 0.12.1 → 0.14.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 (531) hide show
  1. package/README.md +60 -47
  2. package/dist/bodymap.js +856 -736
  3. package/dist/bodymap.js.map +1 -1
  4. package/dist/bodymap.mjs +858 -738
  5. package/dist/bodymap.mjs.map +1 -1
  6. package/dist/index.d.mts +1431 -237
  7. package/dist/index.d.ts +1431 -237
  8. package/dist/index.js +6506 -4781
  9. package/dist/index.js.map +1 -1
  10. package/dist/index.mjs +6280 -4642
  11. package/dist/index.mjs.map +1 -1
  12. package/dist/{pages-B1hqnGIC.d.ts → pages-CsjsUn0G.d.ts} +51 -16
  13. package/dist/{pages-CvsFqNtx.d.mts → pages-ZbT_pD_U.d.mts} +51 -16
  14. package/dist/pages.d.mts +1 -1
  15. package/dist/pages.d.ts +1 -1
  16. package/dist/pages.js +1919 -1937
  17. package/dist/pages.js.map +1 -1
  18. package/dist/pages.mjs +1927 -1945
  19. package/dist/pages.mjs.map +1 -1
  20. package/dist/theme/index.d.mts +225 -140
  21. package/dist/theme/index.d.ts +225 -140
  22. package/dist/theme/index.js +298 -319
  23. package/dist/theme/index.js.map +1 -1
  24. package/dist/theme/index.mjs +283 -315
  25. package/dist/theme/index.mjs.map +1 -1
  26. package/dist/theme/tokens-css.js +145 -24
  27. package/dist/theme/tokens-css.js.map +1 -1
  28. package/dist/theme/tokens-css.mjs +145 -24
  29. package/dist/theme/tokens-css.mjs.map +1 -1
  30. package/dist/theme/tokens.d.mts +128 -11
  31. package/dist/theme/tokens.d.ts +128 -11
  32. package/dist/theme/tokens.js +126 -26
  33. package/dist/theme/tokens.js.map +1 -1
  34. package/dist/theme/tokens.mjs +124 -27
  35. package/dist/theme/tokens.mjs.map +1 -1
  36. package/docs/audits/2026-09-08-critique-addenda.md +51 -0
  37. package/docs/audits/2026-09-08-library-critique.md +212 -0
  38. package/docs/library-roadmap.md +99 -0
  39. package/docs/render-testing-pattern.md +130 -0
  40. package/package.json +1 -1
  41. package/src/arch/Architecture.stories.tsx +3 -1
  42. package/src/arch/arch-graph.freshness.test.ts +52 -0
  43. package/src/arch/arch-graph.json +4989 -1583
  44. package/src/components/custom/ActiveWork/CoChangeChip.stories.tsx +44 -0
  45. package/src/components/custom/ActiveWork/CoChangeChip.test.tsx +29 -0
  46. package/src/components/custom/ActiveWork/CoChangeChip.tsx +48 -0
  47. package/src/components/custom/ActiveWork/Eyebrow.stories.tsx +25 -0
  48. package/src/components/custom/ActiveWork/Eyebrow.test.tsx +16 -0
  49. package/src/components/custom/ActiveWork/Eyebrow.tsx +26 -0
  50. package/src/components/custom/ActiveWork/FileActivityDetail.stories.tsx +50 -0
  51. package/src/components/custom/ActiveWork/FileActivityDetail.test.tsx +66 -0
  52. package/src/components/custom/ActiveWork/FileActivityDetail.tsx +202 -0
  53. package/src/components/custom/ActiveWork/FileActivityRow.stories.tsx +70 -0
  54. package/src/components/custom/ActiveWork/FileActivityRow.test.tsx +67 -0
  55. package/src/components/custom/ActiveWork/FileActivityRow.tsx +130 -0
  56. package/src/components/custom/ActiveWork/FileHistoryExplorer.stories.tsx +84 -0
  57. package/src/components/custom/ActiveWork/FileHistoryExplorer.test.tsx +99 -0
  58. package/src/components/custom/ActiveWork/FileHistoryExplorer.tsx +138 -0
  59. package/src/components/custom/ActiveWork/FilePathLabel.stories.tsx +39 -0
  60. package/src/components/custom/ActiveWork/FilePathLabel.test.tsx +53 -0
  61. package/src/components/custom/ActiveWork/FilePathLabel.tsx +63 -0
  62. package/src/components/custom/ActiveWork/InitiativeBrief.stories.tsx +50 -0
  63. package/src/components/custom/ActiveWork/InitiativeBrief.test.tsx +62 -0
  64. package/src/components/custom/ActiveWork/InitiativeBrief.tsx +182 -0
  65. package/src/components/custom/ActiveWork/InitiativeCard.stories.tsx +73 -0
  66. package/src/components/custom/ActiveWork/InitiativeCard.test.tsx +68 -0
  67. package/src/components/custom/ActiveWork/InitiativeCard.tsx +136 -0
  68. package/src/components/custom/ActiveWork/InitiativeHeader.stories.tsx +59 -0
  69. package/src/components/custom/ActiveWork/InitiativeHeader.test.tsx +40 -0
  70. package/src/components/custom/ActiveWork/InitiativeHeader.tsx +73 -0
  71. package/src/components/custom/ActiveWork/InitiativeReader.stories.tsx +145 -0
  72. package/src/components/custom/ActiveWork/OpenLoops.stories.tsx +58 -0
  73. package/src/components/custom/ActiveWork/OpenLoops.test.tsx +61 -0
  74. package/src/components/custom/ActiveWork/OpenLoops.tsx +107 -0
  75. package/src/components/custom/ActiveWork/PortfolioOverview.stories.tsx +101 -0
  76. package/src/components/custom/ActiveWork/PortfolioOverview.test.tsx +81 -0
  77. package/src/components/custom/ActiveWork/PortfolioOverview.tsx +83 -0
  78. package/src/components/custom/ActiveWork/README.md +305 -0
  79. package/src/components/custom/ActiveWork/SessionDetail.stories.tsx +71 -0
  80. package/src/components/custom/ActiveWork/SessionDetail.test.tsx +84 -0
  81. package/src/components/custom/ActiveWork/SessionDetail.tsx +180 -0
  82. package/src/components/custom/ActiveWork/SessionList.stories.tsx +69 -0
  83. package/src/components/custom/ActiveWork/SessionList.test.tsx +78 -0
  84. package/src/components/custom/ActiveWork/SessionList.tsx +103 -0
  85. package/src/components/custom/ActiveWork/SessionListItem.stories.tsx +64 -0
  86. package/src/components/custom/ActiveWork/SessionListItem.test.tsx +62 -0
  87. package/src/components/custom/ActiveWork/SessionListItem.tsx +152 -0
  88. package/src/components/custom/ActiveWork/SessionReader.stories.tsx +113 -0
  89. package/src/components/custom/ActiveWork/SeverityLabel.stories.tsx +51 -0
  90. package/src/components/custom/ActiveWork/SeverityLabel.test.tsx +68 -0
  91. package/src/components/custom/ActiveWork/SeverityLabel.tsx +97 -0
  92. package/src/components/custom/ActiveWork/TaskRow.stories.tsx +63 -0
  93. package/src/components/custom/ActiveWork/TaskRow.test.tsx +112 -0
  94. package/src/components/custom/ActiveWork/TaskRow.tsx +176 -0
  95. package/src/components/custom/ActiveWork/TaskTable.stories.tsx +123 -0
  96. package/src/components/custom/ActiveWork/TaskTable.test.tsx +233 -0
  97. package/src/components/custom/ActiveWork/TaskTable.tsx +321 -0
  98. package/src/components/custom/ActiveWork/active-work-depth.test.tsx +102 -0
  99. package/src/components/custom/ActiveWork/file-history-fixture.ts +91 -0
  100. package/src/components/custom/ActiveWork/format-time.test.ts +23 -0
  101. package/src/components/custom/ActiveWork/format-time.ts +32 -0
  102. package/src/components/custom/ActiveWork/index.ts +19 -0
  103. package/src/components/custom/ActiveWork/initiative-fixture.ts +104 -0
  104. package/src/components/custom/ActiveWork/session-fixture.ts +267 -0
  105. package/src/components/custom/ActiveWork/session-linkers.ts +56 -0
  106. package/src/components/custom/ActiveWork/task-list-fixture.ts +97 -0
  107. package/src/components/custom/CircularTimer/CircularTimer.stories.tsx +12 -6
  108. package/src/components/custom/DateTime/DateTime.stories.tsx +2 -1
  109. package/src/components/custom/DateTime/DateTime.test.tsx +3 -1
  110. package/src/components/custom/EmptyState/EmptyState.stories.tsx +22 -9
  111. package/src/components/custom/EmptyState/EmptyState.test.tsx +7 -13
  112. package/src/components/custom/EmptyState/EmptyState.tsx +4 -18
  113. package/src/components/custom/Fatigue/DualGhostSpark.stories.tsx +4 -3
  114. package/src/components/custom/Fatigue/FatigueLights.stories.tsx +2 -2
  115. package/src/components/custom/Fatigue/GhostSpark.stories.tsx +4 -3
  116. package/src/components/custom/Fatigue/LiveFatigueCard.stories.tsx +2 -2
  117. package/src/components/custom/Fatigue/LiveFatigueCard.tsx +8 -4
  118. package/src/components/custom/Fatigue/LiveFatiguePanel.stories.tsx +116 -6
  119. package/src/components/custom/Fatigue/LiveFatiguePanel.test.tsx +134 -0
  120. package/src/components/custom/Fatigue/LiveFatiguePanel.tsx +54 -83
  121. package/src/components/custom/Fatigue/README.md +40 -3
  122. package/src/components/custom/Fatigue/RomProgressionChart.stories.tsx +2 -2
  123. package/src/components/custom/Fatigue/SilverRedPalette.stories.tsx +2 -1
  124. package/src/components/custom/Fatigue/VelocityHero.stories.tsx +4 -3
  125. package/src/components/custom/Fatigue/VerdictHero.stories.tsx +2 -2
  126. package/src/components/custom/Fatigue/fatigue-mock.test.ts +0 -5
  127. package/src/components/custom/Fatigue/fatigue-mock.ts +2 -10
  128. package/src/components/custom/Fatigue/fatigue-tokens.ts +12 -0
  129. package/src/components/custom/Fatigue/index.ts +17 -5
  130. package/src/components/custom/Fatigue/panel-layout.test.ts +149 -0
  131. package/src/components/custom/Fatigue/panel-layout.ts +185 -0
  132. package/src/components/custom/Gauge/Gauge.stories.tsx +6 -3
  133. package/src/components/custom/Gauge/Gauge.test.tsx +1 -1
  134. package/src/components/custom/Gauge/Gauge.tsx +7 -2
  135. package/src/components/custom/Metric/Metric.stories.tsx +10 -1
  136. package/src/components/custom/Metric/Metric.test.tsx +1 -3
  137. package/src/components/custom/Metric/Metric.tsx +5 -20
  138. package/src/components/custom/Prose/MarkdownProse.stories.tsx +88 -0
  139. package/src/components/custom/Prose/MarkdownProse.test.tsx +87 -0
  140. package/src/components/custom/Prose/MarkdownProse.tsx +201 -0
  141. package/src/components/custom/Prose/README.md +58 -0
  142. package/src/components/custom/Prose/index.ts +1 -0
  143. package/src/components/custom/Scatter/Scatter.stories.tsx +55 -14
  144. package/src/components/custom/Scatter/Scatter.test.tsx +2 -2
  145. package/src/components/custom/Scatter/Scatter.tsx +122 -18
  146. package/src/components/custom/Sidebar/Sidebar.stories.tsx +41 -8
  147. package/src/components/custom/Sidebar/Sidebar.test.tsx +5 -1
  148. package/src/components/custom/Sidebar/Sidebar.tsx +16 -33
  149. package/src/components/custom/Table/Table.stories.tsx +99 -16
  150. package/src/components/custom/Table/Table.test.tsx +273 -86
  151. package/src/components/custom/Table/Table.tsx +159 -67
  152. package/src/components/custom/Table/column-fit.test.ts +75 -0
  153. package/src/components/custom/Table/column-fit.ts +116 -0
  154. package/src/components/custom/Table/index.ts +9 -0
  155. package/src/components/custom/TimerReadout/TimerReadout.stories.tsx +8 -6
  156. package/src/components/custom/Treemap/Treemap.stories.tsx +15 -12
  157. package/src/components/custom/Treemap/Treemap.test.tsx +1 -1
  158. package/src/components/custom/Treemap/Treemap.tsx +11 -3
  159. package/src/components/custom/Typography/Typography.stories.tsx +28 -1
  160. package/src/components/custom/Typography/Typography.test.tsx +34 -0
  161. package/src/components/custom/Typography/Typography.tsx +6 -0
  162. package/src/components/custom/Typography/index.ts +1 -8
  163. package/src/components/custom/Workout/ActiveWorkoutPage.stories.tsx +11 -2
  164. package/src/components/custom/Workout/BaseBadge.stories.tsx +27 -11
  165. package/src/components/custom/Workout/BaseBadge.test.tsx +31 -11
  166. package/src/components/custom/Workout/BaseBadge.tsx +6 -2
  167. package/src/components/custom/Workout/BodyMap.stories.tsx +4 -1
  168. package/src/components/custom/Workout/BodyMap.tsx +8 -4
  169. package/src/components/custom/Workout/BodyMapDetailPanel.stories.tsx +28 -6
  170. package/src/components/custom/Workout/BodyMapDetailPanel.test.tsx +11 -15
  171. package/src/components/custom/Workout/BodyMapDetailPanel.tsx +50 -12
  172. package/src/components/custom/Workout/CapacityBandChart.stories.tsx +12 -9
  173. package/src/components/custom/Workout/CapacityBandChart.test.tsx +24 -51
  174. package/src/components/custom/Workout/CapacityBandChart.tsx +144 -111
  175. package/src/components/custom/Workout/DeviationBar.stories.tsx +1 -1
  176. package/src/components/custom/Workout/DeviationBar.test.tsx +10 -4
  177. package/src/components/custom/Workout/DeviationBar.tsx +24 -16
  178. package/src/components/custom/Workout/DualVelocityStrip.stories.tsx +183 -0
  179. package/src/components/custom/Workout/DualVelocityStrip.test.tsx +32 -18
  180. package/src/components/custom/Workout/ExerciseCard.stories.tsx +12 -11
  181. package/src/components/custom/Workout/ExerciseCard.test.tsx +52 -22
  182. package/src/components/custom/Workout/ExerciseCard.tsx +99 -183
  183. package/src/components/custom/Workout/ExerciseCardHeading.stories.tsx +95 -12
  184. package/src/components/custom/Workout/ExerciseCardHeading.test.tsx +189 -1
  185. package/src/components/custom/Workout/ExerciseCardHeading.tsx +167 -18
  186. package/src/components/custom/Workout/ExerciseDetailPage.stories.tsx +9 -1
  187. package/src/components/custom/Workout/ExerciseDetailPage.tsx +3 -2
  188. package/src/components/custom/Workout/ExerciseHeading.stories.tsx +8 -8
  189. package/src/components/custom/Workout/ExerciseHeading.tsx +194 -46
  190. package/src/components/custom/Workout/ExerciseIndicator.stories.tsx +12 -9
  191. package/src/components/custom/Workout/ExerciseIndicator.test.tsx +27 -11
  192. package/src/components/custom/Workout/ExerciseIndicator.tsx +14 -15
  193. package/src/components/custom/Workout/FatigueMeter.stories.tsx +5 -5
  194. package/src/components/custom/Workout/InputBar.stories.tsx +4 -5
  195. package/src/components/custom/Workout/InputBar.tsx +4 -2
  196. package/src/components/custom/Workout/IntensityBar.stories.tsx +1 -1
  197. package/src/components/custom/Workout/IntensityBar.test.tsx +5 -1
  198. package/src/components/custom/Workout/IntensityBar.tsx +8 -3
  199. package/src/components/custom/Workout/LiveAuraFrame.stories.tsx +5 -4
  200. package/src/components/custom/Workout/MesoCard.stories.tsx +4 -1
  201. package/src/components/custom/Workout/MesoCard.test.tsx +7 -18
  202. package/src/components/custom/Workout/MesoCard.tsx +14 -10
  203. package/src/components/custom/Workout/MesoProgressBar.stories.tsx +1 -1
  204. package/src/components/custom/Workout/MesoProgressBar.test.tsx +18 -11
  205. package/src/components/custom/Workout/MesoProgressBar.tsx +15 -13
  206. package/src/components/custom/Workout/MesoStatusCard.stories.tsx +2 -1
  207. package/src/components/custom/Workout/MesoStatusCard.test.tsx +14 -44
  208. package/src/components/custom/Workout/MesoStatusCard.tsx +20 -33
  209. package/src/components/custom/Workout/MetricTiles.stories.tsx +3 -2
  210. package/src/components/custom/Workout/MuscleGroupChip.stories.tsx +2 -8
  211. package/src/components/custom/Workout/MuscleGroupChip.test.tsx +23 -31
  212. package/src/components/custom/Workout/MuscleGroupChip.tsx +28 -67
  213. package/src/components/custom/Workout/PlaceholderStrip.stories.tsx +9 -4
  214. package/src/components/custom/Workout/PlaceholderStrip.test.tsx +17 -10
  215. package/src/components/custom/Workout/PlaceholderStrip.tsx +9 -8
  216. package/src/components/custom/Workout/PrBadge.stories.tsx +2 -1
  217. package/src/components/custom/Workout/PrBadge.test.tsx +3 -9
  218. package/src/components/custom/Workout/PrBadge.tsx +13 -17
  219. package/src/components/custom/Workout/PrHistoryModal.stories.tsx +16 -3
  220. package/src/components/custom/Workout/PrHistoryModal.test.tsx +13 -36
  221. package/src/components/custom/Workout/PrHistoryModal.tsx +8 -4
  222. package/src/components/custom/Workout/ProgramPlanningPage.stories.tsx +6 -1
  223. package/src/components/custom/Workout/README.md +68 -17
  224. package/src/components/custom/Workout/ReadinessCheck.stories.tsx +3 -2
  225. package/src/components/custom/Workout/ReadinessCheck.test.tsx +12 -18
  226. package/src/components/custom/Workout/ReadinessCheck.tsx +22 -4
  227. package/src/components/custom/Workout/RestTimer.stories.tsx +16 -4
  228. package/src/components/custom/Workout/RestTimer.tsx +4 -2
  229. package/src/components/custom/Workout/ScheduleTiles.stories.tsx +3 -2
  230. package/src/components/custom/Workout/ScheduleTiles.test.tsx +3 -4
  231. package/src/components/custom/Workout/ScheduleTiles.tsx +4 -7
  232. package/src/components/custom/Workout/SegmentedBar.stories.tsx +21 -17
  233. package/src/components/custom/Workout/SegmentedBar.tsx +10 -5
  234. package/src/components/custom/Workout/SegmentedProgressBar.stories.tsx +5 -5
  235. package/src/components/custom/Workout/SessionHeader.stories.tsx +6 -6
  236. package/src/components/custom/Workout/SessionHeader.tsx +12 -12
  237. package/src/components/custom/Workout/SessionRail.stories.tsx +12 -11
  238. package/src/components/custom/Workout/SessionRail.tsx +7 -9
  239. package/src/components/custom/Workout/SetBar.stories.tsx +10 -6
  240. package/src/components/custom/Workout/SetBar.test.tsx +49 -4
  241. package/src/components/custom/Workout/SetBar.tsx +38 -12
  242. package/src/components/custom/Workout/SetRow.stories.tsx +3 -2
  243. package/src/components/custom/Workout/SetRow.test.tsx +16 -2
  244. package/src/components/custom/Workout/SetRow.tsx +61 -23
  245. package/src/components/custom/Workout/SetStrip.stories.tsx +63 -7
  246. package/src/components/custom/Workout/SetStrip.test.tsx +25 -0
  247. package/src/components/custom/Workout/SetStrip.tsx +24 -4
  248. package/src/components/custom/Workout/SetTableHeader.stories.tsx +6 -6
  249. package/src/components/custom/Workout/SetTableHeader.tsx +9 -12
  250. package/src/components/custom/Workout/SetsRepsLoad.stories.tsx +7 -7
  251. package/src/components/custom/Workout/SetsRepsLoad.tsx +24 -12
  252. package/src/components/custom/Workout/Sparkline.stories.tsx +14 -11
  253. package/src/components/custom/Workout/Sparkline.test.tsx +37 -19
  254. package/src/components/custom/Workout/Sparkline.tsx +14 -18
  255. package/src/components/custom/Workout/StatusDot.stories.tsx +1 -1
  256. package/src/components/custom/Workout/StatusDot.test.tsx +44 -5
  257. package/src/components/custom/Workout/StatusDot.tsx +93 -63
  258. package/src/components/custom/Workout/StatusPill.stories.tsx +1 -1
  259. package/src/components/custom/Workout/StatusPill.test.tsx +6 -15
  260. package/src/components/custom/Workout/StatusPill.tsx +27 -38
  261. package/src/components/custom/Workout/StrengthTrendChart.stories.tsx +11 -4
  262. package/src/components/custom/Workout/StrengthTrendChart.test.tsx +15 -37
  263. package/src/components/custom/Workout/StrengthTrendChart.tsx +39 -36
  264. package/src/components/custom/Workout/SupersetWrapper.stories.tsx +27 -64
  265. package/src/components/custom/Workout/SupersetWrapper.test.tsx +16 -14
  266. package/src/components/custom/Workout/SupersetWrapper.tsx +17 -21
  267. package/src/components/custom/Workout/TempoDisplay.stories.tsx +26 -10
  268. package/src/components/custom/Workout/TempoDisplay.test.tsx +18 -4
  269. package/src/components/custom/Workout/TempoDisplay.tsx +2 -0
  270. package/src/components/custom/Workout/TrainingStatusPage.stories.tsx +9 -1
  271. package/src/components/custom/Workout/VelocityStrip.compact.stories.tsx +4 -1
  272. package/src/components/custom/Workout/VelocityStrip.dual.stories.tsx +10 -6
  273. package/src/components/custom/Workout/VelocityStrip.expanded.stories.tsx +5 -2
  274. package/src/components/custom/Workout/VelocityStrip.hero.stories.tsx +44 -1
  275. package/src/components/custom/Workout/VelocityStrip.stories.tsx +12 -6
  276. package/src/components/custom/Workout/VelocityStrip.test.tsx +48 -6
  277. package/src/components/custom/Workout/VelocityStrip.tsx +26 -14
  278. package/src/components/custom/Workout/VolumeLandmarkBar.stories.tsx +6 -7
  279. package/src/components/custom/Workout/VolumeLandmarkBar.tsx +15 -6
  280. package/src/components/custom/Workout/WeekRow.stories.tsx +4 -1
  281. package/src/components/custom/Workout/WeekRow.test.tsx +18 -15
  282. package/src/components/custom/Workout/WeekRow.tsx +23 -16
  283. package/src/components/custom/Workout/WeightBadge.stories.tsx +2 -1
  284. package/src/components/custom/Workout/WeightBadge.test.tsx +50 -19
  285. package/src/components/custom/Workout/WeightBadge.tsx +28 -27
  286. package/src/components/custom/Workout/WorkoutCard.stories.tsx +6 -1
  287. package/src/components/custom/Workout/WorkoutCard.test.tsx +18 -0
  288. package/src/components/custom/Workout/WorkoutCard.tsx +35 -57
  289. package/src/components/custom/Workout/WorkoutPill.stories.tsx +5 -2
  290. package/src/components/custom/Workout/WorkoutPill.test.tsx +39 -7
  291. package/src/components/custom/Workout/WorkoutPill.tsx +88 -57
  292. package/src/components/custom/Workout/ZoneTrack.stories.tsx +10 -7
  293. package/src/components/custom/Workout/ZoneTrack.tsx +10 -9
  294. package/src/components/custom/Workout/exerciseRowState.ts +29 -0
  295. package/src/components/custom/Workout/index.ts +17 -2
  296. package/src/components/custom/Workout/metricText.stories.tsx +15 -13
  297. package/src/components/custom/Workout/metricText.tsx +8 -2
  298. package/src/components/custom/Workout/setHeadingKit.tsx +219 -36
  299. package/src/components/custom/Workout/velocity-story-kit.tsx +2 -2
  300. package/src/components/custom/charts/README.md +66 -0
  301. package/src/components/custom/charts/SetBarChart.test.tsx +46 -1
  302. package/src/components/custom/charts/SetBarChart.tsx +56 -9
  303. package/src/components/custom/charts/SparkBars.stories.tsx +55 -0
  304. package/src/components/custom/charts/SparkBars.test.tsx +69 -0
  305. package/src/components/custom/charts/SparkBars.tsx +85 -0
  306. package/src/components/custom/charts/flatBarGeometry.test.ts +41 -0
  307. package/src/components/custom/charts/flatBarGeometry.ts +32 -0
  308. package/src/components/custom/charts/index.ts +3 -0
  309. package/src/components/custom/index.ts +3 -0
  310. package/src/components/custom/stepper/Stepper.stories.tsx +13 -10
  311. package/src/components/custom/stepper/Stepper.test.tsx +1 -7
  312. package/src/components/custom/stepper/Stepper.tsx +21 -34
  313. package/src/components/icons/icons.stories.tsx +1 -1
  314. package/src/components/icons/icons.tsx +51 -0
  315. package/src/components/shell/AppShell.stories.tsx +150 -0
  316. package/src/components/shell/AppShell.test.tsx +70 -0
  317. package/src/components/shell/AppShell.tsx +90 -0
  318. package/src/components/shell/BrandLockup.stories.tsx +66 -5
  319. package/src/components/shell/BrandLockup.test.tsx +34 -1
  320. package/src/components/shell/BrandLockup.tsx +27 -11
  321. package/src/components/shell/NavItem.stories.tsx +4 -4
  322. package/src/components/shell/NavItem.test.tsx +17 -0
  323. package/src/components/shell/NavItem.tsx +17 -5
  324. package/src/components/shell/README.md +89 -26
  325. package/src/components/shell/SideNav.stories.tsx +38 -7
  326. package/src/components/shell/SideNav.test.tsx +16 -8
  327. package/src/components/shell/SideNav.tsx +17 -17
  328. package/src/components/shell/TopBar.stories.tsx +44 -19
  329. package/src/components/shell/TopBar.test.tsx +34 -12
  330. package/src/components/shell/TopBar.tsx +61 -40
  331. package/src/components/shell/brands.tsx +66 -0
  332. package/src/components/shell/index.ts +9 -8
  333. package/src/components/shell/{DeviceIndicator.stories.tsx → workout/DeviceIndicator.stories.tsx} +2 -2
  334. package/src/components/shell/{DeviceIndicator.tsx → workout/DeviceIndicator.tsx} +2 -2
  335. package/src/components/shell/{DeviceMenu.stories.tsx → workout/DeviceMenu.stories.tsx} +2 -2
  336. package/src/components/shell/{DeviceMenu.tsx → workout/DeviceMenu.tsx} +3 -3
  337. package/src/components/shell/{DeviceRow.stories.tsx → workout/DeviceRow.stories.tsx} +2 -2
  338. package/src/components/shell/{DeviceRow.tsx → workout/DeviceRow.tsx} +3 -3
  339. package/src/components/shell/{SessionStatePill.stories.tsx → workout/SessionStatePill.stories.tsx} +2 -2
  340. package/src/components/shell/{SessionStatePill.tsx → workout/SessionStatePill.tsx} +5 -3
  341. package/src/components/shell/workout/WorkoutShell.stories.tsx +71 -0
  342. package/src/components/shell/{DashboardShell.test.tsx → workout/WorkoutShell.test.tsx} +19 -8
  343. package/src/components/shell/workout/WorkoutShell.tsx +77 -0
  344. package/src/components/shell/workout/WorkoutTopBar.stories.tsx +58 -0
  345. package/src/components/shell/workout/WorkoutTopBar.test.tsx +39 -0
  346. package/src/components/shell/workout/WorkoutTopBar.tsx +52 -0
  347. package/src/components/shell/workout/index.ts +9 -0
  348. package/src/components/shell/workout/workoutNavItems.tsx +16 -0
  349. package/src/components/ui/README.md +110 -0
  350. package/src/components/ui/alert/Alert.stories.tsx +15 -5
  351. package/src/components/ui/alert/Alert.tsx +24 -3
  352. package/src/components/ui/autocomplete/Autocomplete.stories.tsx +11 -13
  353. package/src/components/ui/autocomplete/Autocomplete.test.tsx +7 -25
  354. package/src/components/ui/autocomplete/Autocomplete.tsx +21 -28
  355. package/src/components/ui/avatar/Avatar.stories.tsx +1 -1
  356. package/src/components/ui/avatar/Avatar.tsx +2 -10
  357. package/src/components/ui/badge/Badge.stories.tsx +83 -28
  358. package/src/components/ui/badge/Badge.test.tsx +19 -3
  359. package/src/components/ui/badge/Badge.tsx +48 -55
  360. package/src/components/ui/breadcrumbs/Breadcrumbs.stories.tsx +1 -1
  361. package/src/components/ui/breadcrumbs/Breadcrumbs.tsx +4 -16
  362. package/src/components/ui/button/Button.stories.tsx +46 -12
  363. package/src/components/ui/button/Button.tsx +44 -37
  364. package/src/components/ui/card/Card.stories.tsx +90 -94
  365. package/src/components/ui/card/Card.test.tsx +80 -6
  366. package/src/components/ui/card/Card.tsx +150 -203
  367. package/src/components/ui/checkbox/Checkbox.stories.tsx +1 -1
  368. package/src/components/ui/checkbox/Checkbox.tsx +7 -27
  369. package/src/components/ui/chip/Chip.stories.tsx +37 -13
  370. package/src/components/ui/chip/Chip.test.tsx +10 -6
  371. package/src/components/ui/chip/Chip.tsx +76 -91
  372. package/src/components/ui/collapse/Collapse.stories.tsx +23 -23
  373. package/src/components/ui/collapse/Collapse.tsx +6 -11
  374. package/src/components/ui/data-row/DataRow.stories.tsx +14 -3
  375. package/src/components/ui/data-row/DataRow.test.tsx +5 -15
  376. package/src/components/ui/data-row/DataRow.tsx +18 -7
  377. package/src/components/ui/divider/Divider.stories.tsx +1 -1
  378. package/src/components/ui/divider/Divider.tsx +1 -5
  379. package/src/components/ui/drawer/Drawer.stories.tsx +5 -16
  380. package/src/components/ui/drawer/Drawer.tsx +13 -27
  381. package/src/components/ui/floating-overlay-depth.test.tsx +143 -0
  382. package/src/components/ui/form-field/FormField.stories.tsx +6 -20
  383. package/src/components/ui/form-field/FormField.test.tsx +1 -5
  384. package/src/components/ui/form-field/FormField.tsx +10 -46
  385. package/src/components/ui/help-tip/HelpTip.stories.tsx +8 -19
  386. package/src/components/ui/help-tip/HelpTip.test.tsx +1 -3
  387. package/src/components/ui/help-tip/HelpTip.tsx +21 -22
  388. package/src/components/ui/help-tip/index.ts +7 -1
  389. package/src/components/ui/icon-box/IconBox.stories.tsx +1 -1
  390. package/src/components/ui/icon-box/IconBox.test.tsx +1 -7
  391. package/src/components/ui/icon-box/IconBox.tsx +10 -18
  392. package/src/components/ui/indicator/Indicator.stories.tsx +5 -4
  393. package/src/components/ui/indicator/Indicator.tsx +20 -14
  394. package/src/components/ui/input/Input.stories.tsx +3 -11
  395. package/src/components/ui/input/Input.test.tsx +2 -10
  396. package/src/components/ui/input/Input.tsx +10 -25
  397. package/src/components/ui/input/index.ts +7 -1
  398. package/src/components/ui/link/Link.stories.tsx +19 -7
  399. package/src/components/ui/list-item/ListItem.stories.tsx +17 -5
  400. package/src/components/ui/list-item/ListItem.tsx +2 -9
  401. package/src/components/ui/menu/Menu.stories.tsx +21 -15
  402. package/src/components/ui/menu/Menu.test.tsx +2 -11
  403. package/src/components/ui/menu/Menu.tsx +12 -14
  404. package/src/components/ui/menu/index.ts +8 -1
  405. package/src/components/ui/modal/Modal.stories.tsx +2 -2
  406. package/src/components/ui/modal/Modal.tsx +31 -19
  407. package/src/components/ui/pill/Pill.stories.tsx +111 -23
  408. package/src/components/ui/pill/Pill.test.tsx +101 -3
  409. package/src/components/ui/pill/Pill.tsx +168 -49
  410. package/src/components/ui/pill/index.ts +1 -1
  411. package/src/components/ui/popover/Popover.stories.tsx +6 -8
  412. package/src/components/ui/popover/Popover.test.tsx +1 -6
  413. package/src/components/ui/popover/Popover.tsx +20 -15
  414. package/src/components/ui/popover/index.ts +7 -1
  415. package/src/components/ui/progress/Progress.stories.tsx +3 -12
  416. package/src/components/ui/progress/Progress.test.tsx +1 -5
  417. package/src/components/ui/progress/Progress.tsx +9 -6
  418. package/src/components/ui/radio/Radio.stories.tsx +42 -21
  419. package/src/components/ui/radio/Radio.test.tsx +6 -2
  420. package/src/components/ui/radio/Radio.tsx +23 -22
  421. package/src/components/ui/section/Section.stories.tsx +12 -21
  422. package/src/components/ui/section/Section.test.tsx +1 -6
  423. package/src/components/ui/section/Section.tsx +1 -3
  424. package/src/components/ui/section/index.ts +1 -5
  425. package/src/components/ui/select/Select.stories.tsx +3 -13
  426. package/src/components/ui/select/Select.test.tsx +2 -11
  427. package/src/components/ui/select/Select.tsx +16 -15
  428. package/src/components/ui/skeleton/Skeleton.stories.tsx +3 -11
  429. package/src/components/ui/skeleton/Skeleton.tsx +3 -14
  430. package/src/components/ui/skeleton/index.ts +1 -7
  431. package/src/components/ui/spinner/Spinner.stories.tsx +1 -1
  432. package/src/components/ui/spinner/Spinner.tsx +4 -5
  433. package/src/components/ui/stack/Stack.stories.tsx +8 -8
  434. package/src/components/ui/stack/Stack.tsx +1 -1
  435. package/src/components/ui/surface/Surface.stories.tsx +92 -33
  436. package/src/components/ui/surface/Surface.test.tsx +88 -28
  437. package/src/components/ui/surface/Surface.tsx +37 -87
  438. package/src/components/ui/surface/SurfaceContext.ts +22 -62
  439. package/src/components/ui/surface/index.ts +8 -0
  440. package/src/components/ui/surface/resolveSurface.ts +98 -0
  441. package/src/components/ui/surface/surface.contract.test.ts +6 -1
  442. package/src/components/ui/switch/Switch.stories.tsx +1 -1
  443. package/src/components/ui/switch/Switch.tsx +7 -6
  444. package/src/components/ui/tabs/Tabs.stories.tsx +1 -1
  445. package/src/components/ui/tabs/Tabs.tsx +8 -21
  446. package/src/components/ui/tabs/index.ts +1 -7
  447. package/src/components/ui/tile/Tile.stories.tsx +1 -1
  448. package/src/components/ui/tile/Tile.tsx +3 -0
  449. package/src/components/ui/toast/Toast.stories.tsx +1 -1
  450. package/src/components/ui/toast/Toast.test.tsx +2 -8
  451. package/src/components/ui/toast/Toast.tsx +49 -57
  452. package/src/components/ui/toast/index.ts +0 -1
  453. package/src/components/ui/toolbar-button/ToolbarButton.stories.tsx +92 -71
  454. package/src/components/ui/toolbar-button/ToolbarButton.test.tsx +3 -18
  455. package/src/components/ui/toolbar-button/ToolbarButton.tsx +38 -49
  456. package/src/components/ui/tooltip/Tooltip.stories.tsx +12 -3
  457. package/src/components/ui/tooltip/Tooltip.test.tsx +21 -3
  458. package/src/components/ui/tooltip/Tooltip.tsx +55 -36
  459. package/src/components/ui/tooltip/index.ts +1 -1
  460. package/src/components/ui/trigger/TriggerSurface.test.tsx +215 -0
  461. package/src/components/ui/trigger/TriggerSurface.tsx +81 -0
  462. package/src/components/ui/trigger/index.ts +2 -0
  463. package/src/stories/PresetShowcase.stories.tsx +101 -48
  464. package/src/test/no-device-internals.test.ts +3 -3
  465. package/src/test/no-raw-color.test.ts +39 -0
  466. package/src/theme/Alpha.stories.tsx +103 -0
  467. package/src/theme/ChoosingTokens.stories.tsx +48 -0
  468. package/src/theme/ColorPalettes.stories.tsx +62 -45
  469. package/src/theme/ColorPrimitives.stories.tsx +35 -35
  470. package/src/theme/Depth.stories.tsx +132 -65
  471. package/src/theme/DepthCalibration.stories.tsx +23 -21
  472. package/src/theme/ProposedTokensVW82.stories.tsx +414 -0
  473. package/src/theme/ThemeProvider.test.tsx +4 -4
  474. package/src/theme/barrel.ts +7 -6
  475. package/src/theme/color-stories.coverage.test.ts +1 -1
  476. package/src/theme/color-utils.ts +41 -29
  477. package/src/theme/config.completeness.test.ts +1 -1
  478. package/src/theme/config.ts +40 -0
  479. package/src/theme/elevation.test.ts +82 -56
  480. package/src/theme/elevation.ts +77 -561
  481. package/src/theme/global.css +45 -5
  482. package/src/theme/grey-ramp.test.ts +24 -8
  483. package/src/theme/lift.test.ts +39 -0
  484. package/src/theme/lift.ts +102 -0
  485. package/src/theme/materials.test.ts +5 -2
  486. package/src/theme/materials.ts +38 -4
  487. package/src/theme/native-theming-guard.test.ts +5 -5
  488. package/src/theme/presets/apply.ts +4 -0
  489. package/src/theme/presets/audiobook.ts +5 -2
  490. package/src/theme/presets/default.ts +4 -0
  491. package/src/theme/presets/index.ts +14 -1
  492. package/src/theme/presets/types.ts +1 -1
  493. package/src/theme/semantic-contrast.test.ts +13 -4
  494. package/src/theme/status-distinctness.test.ts +66 -0
  495. package/src/theme/subtle-tone-weight.test.ts +163 -0
  496. package/src/theme/surface-planes.test.ts +37 -0
  497. package/src/theme/surface-planes.ts +68 -0
  498. package/src/theme/tailwind-var-opacity.test.ts +163 -0
  499. package/src/theme/token-export-guard.test.ts +1 -3
  500. package/src/theme/tokens/primitives.test.ts +15 -7
  501. package/src/theme/tokens/primitives.ts +98 -33
  502. package/src/theme/tokens/semantic-hex-guard.test.ts +322 -0
  503. package/src/theme/tokens/semantic.ts +124 -54
  504. package/src/theme/wash-ladder.test.ts +58 -0
  505. package/src/theme/workout-tokens.ts +1 -7
  506. package/src/types/jest-axe.d.ts +2 -6
  507. package/src/types/raw-md.d.ts +5 -0
  508. package/src/utils/colors.alpha-adoption.test.ts +408 -0
  509. package/src/utils/colors.ts +4 -4
  510. package/src/utils/form.ts +1 -3
  511. package/src/utils/index.ts +2 -7
  512. package/src/utils/number-format.ts +17 -0
  513. package/src/utils/workout-format.ts +15 -6
  514. package/src/web-jsx/jsx-runtime.ts +1 -5
  515. package/tailwind.config.js +55 -9
  516. package/src/components/custom/Workout/ExerciseCardUnified.stories.tsx +0 -151
  517. package/src/components/custom/Workout/RowInventory.stories.tsx +0 -408
  518. package/src/components/custom/Workout/S3FullRail.stories.tsx +0 -46
  519. package/src/components/custom/Workout/S3SessionPace.stories.tsx +0 -95
  520. package/src/components/custom/Workout/S3SessionRailHeading.stories.tsx +0 -61
  521. package/src/components/custom/Workout/S3SetTypes.stories.tsx +0 -176
  522. package/src/components/custom/Workout/S3WorkoutExpansion.stories.tsx +0 -240
  523. package/src/components/shell/DashboardShell.stories.tsx +0 -65
  524. package/src/components/shell/DashboardShell.tsx +0 -75
  525. package/src/components/shell/SessionRailSpecimen.stories.tsx +0 -753
  526. package/src/theme/elevation.stories.tsx +0 -346
  527. package/src/utils/useTheme.ts +0 -72
  528. /package/src/components/shell/{DeviceIndicator.test.tsx → workout/DeviceIndicator.test.tsx} +0 -0
  529. /package/src/components/shell/{DeviceMenu.test.tsx → workout/DeviceMenu.test.tsx} +0 -0
  530. /package/src/components/shell/{DeviceRow.test.tsx → workout/DeviceRow.test.tsx} +0 -0
  531. /package/src/components/shell/{SessionStatePill.test.tsx → workout/SessionStatePill.test.tsx} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/cn.ts","../src/theme/tokens/primitives.ts","../src/theme/tokens/semantic.ts","../src/theme/resolve-color.ts","../src/theme/workout-tokens.ts","../src/components/custom/Workout/muscleTaxonomy.ts","../src/web-jsx/jsx-runtime.ts","../src/components/custom/Workout/BodyMap.tsx","../src/components/ui/indicator/Indicator.tsx","../src/components/ui/badge/Badge.tsx","../src/components/custom/Workout/Sparkline.tsx","../src/components/custom/Workout/BodyMapDetailPanel.tsx","../src/theme/color-utils.ts","../src/theme/elevation.ts","../src/utils/useTheme.ts","../src/components/ui/card/Card.tsx","../src/components/custom/Workout/StatusDot.tsx","../src/theme/extracted-colors-dataviz.ts","../src/components/custom/Workout/MesoStatusCard.tsx","../src/components/custom/Workout/TrainingStatusPage.tsx"],"names":["MuscleGroup","SimpleMuscleGroup","cn","reactJsx","reactJsxs","View","sizeStyles","Text","BRAND_PRIMARY","useState","Animated","useEffect","Easing","Pressable","Platform","useMemo","t","clamp01","Fragment"],"mappings":";;;;;;;;AAWO,SAAS,MAAM,MAAA,EAA8B;AAClD,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;;;ACEO,IAAM,eAAA,GAAkB;AAAA,EAC7B,KAAA,EAAO,SAGT,CAAA;AAiCO,IAAM,QAAA,GAAW;AAAA,EACtB,EAAA,EAAI,SAAA;AAAA;AAAA,EACJ,GAAA,EAAK,SAAA;AAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA;AAAA,EACL,GAAA,EAAK;AAAA;AACP,CAAA;AA0BO,IAAM,cAAA,GAAiB;AAAA,EAC5B,GAAA,EAAK;AAAA,IACH,EAAA,EAAI,SAAA;AAAA,IAKJ,GAAA,EAAK,SAAA;AAAA,IACL,GAAA,EAAK,SAAA;AAAA;AAAA,IACL,GAAA,EAAK,SAIP,CAAA;AAAA,EACA,MAAA,EAAQ;AAAA,IAGN,GAAA,EAAK,SAAA;AAAA,IACL,GAAA,EAAK,SAAA;AAAA,IACL,G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ClB,cAAc,MAAA,CAAO,YAAA;AAAA,YACrB,aAAa,MAAA,CAAO,WAAA;AAAA,YACpB,eAAe,MAAA,CAAO,aAAA;AAAA,YACtB,uBAAuB,MAAA,CAAO,qBAAA;AAAA,YAC9B,mBAAmB,MAAA,CAAO,iBAAA;AAAA,YAC1B,MAAA,EAAM,IAAA;AAAA,YACN,OAAA,EAAS,MAAM,WAAA,CAAY,IAAI;AAAA;AAAA;AACjC;AAAA;AAAA,GAEJ;AAEJ","file":"bodymap.mjs","sourcesContent":["import { clsx, type ClassValue } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\n/**\n * Utility function to merge Tailwind CSS classes with proper conflict resolution.\n * Combines clsx for conditional classes with tailwind-merge for deduplication.\n *\n * @example\n * cn('p-4 bg-red-500', isActive && 'bg-blue-500', className)\n * // If isActive is true, returns 'p-4 bg-blue-500' (not 'p-4 bg-red-500 bg-blue-500')\n */\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs))\n}\n","/**\n * Primitive Design Tokens\n *\n * Raw values with no semantic meaning. These are the foundation of the design system\n * and should rarely be used directly in components. Use semantic tokens instead.\n */\n\n/**\n * Absolute colour keywords.\n *\n * This used to hold five scales — `blue`, `red`, `redVivid`, `neutral` and\n * `charcoal`. All five are gone (TD-07.14): the greys folded into `greyRamp`\n * below and the chromatics into the OKLCH `primitiveRamps`. What is left has no\n * scale because these three are not colours you tune, they are keywords.\n */\nexport const primitiveColors = {\n white: '#FFFFFF',\n black: '#000000',\n transparent: 'transparent',\n} as const\n\n/**\n * Unified warm-neutral grey ramp (TD-07.14)\n *\n * The ONE achromatic scale. Regenerate with `scripts/generate-grey-ramp.mjs` —\n * preserve the generator, not just the hexes.\n *\n * The surface planes ARE steps here rather than a parallel object: `850` is\n * overlay, `975` is the bezel. That is the whole point of the ramp. `grey`,\n * `neutral`, `surfaceRampDark` and `backgroundFrameDark` all resolve into it,\n * which is why every plane step below is byte-identical to the value that\n * shipped in v0.10.0 — the surfaces do not move, only their names.\n *\n * TWO THINGS ABOUT THE NUMBERING, both deliberate and both previously re-derived\n * from scratch more than once because they were never written down:\n *\n * 1. `975` sits BELOW the standard grid. `canonL` — the median L* of the seven\n * chromatic `primitiveRamps` at each step — ends at L*10.3, which is step\n * `950`. The bezel is L*3.8, darker than the grid's last rung, so there is\n * simply no step number left for it and `975` extends past the end.\n * 2. `850`/`875` are quarter-steps because overlay/raised/elevated are only\n * ~2.7 L* apart and all three collide on `900` at normal resolution. `800`\n * is a generated bridge between `700` (L*37.9) and overlay (L*22.7) so the\n * spacing stays even across the join.\n *\n * There is no `inset`. It was retired, not renamed: at ΔE 1.10 from `975` it was\n * an imperceptible duplicate of the frame, which is exactly why `<Surface pressed>`\n * (surface − 1) kept collapsing into it. `975` is the floor.\n *\n * Spec, generator and the rejected v1/v2 cuts:\n * sources/design/foundations/warm-grey-ramp/\n */\nexport const greyRamp = {\n 50: '#F9F6F3', // L*97.0 W6\n 100: '#EDEAE7', // L*92.8 W6\n 200: '#D4D1CE', // L*84.0 W6 — warm silver\n 300: '#BDBAB7', // L*75.7 W6\n 400: '#A29F9D', // L*65.7 W5\n 500: '#888684', // L*56.0 W4\n 600: '#72716F', // L*47.7 W3\n 700: '#5A5958', // L*37.9 W2\n 800: '#424140', // L*27.6 W2 — generated bridge\n 850: '#373635', // L*22.7 W2 — surface overlay\n 875: '#31302F', // L*19.9 W2 — surface raised\n 900: '#2C2A28', // L*17.2 W4 — surface elevated\n 925: '#252321', // L*13.9 W4 — surface base\n 950: '#1C1916', // L*9.0 W6 — background base / shell\n 975: '#100D0A', // L*3.8 W6 — background frame / bezel\n} as const\n\n/**\n * The surface planes, as ramp steps — the mapping `<Surface level>` resolves through.\n *\n * Ordered darkest -> lightest, which is the order `pressedLevel()` walks.\n */\nexport const SURFACE_PLANE_STEPS = {\n frame: 975,\n background: 950,\n base: 925,\n elevated: 900,\n raised: 875,\n overlay: 850,\n} as const\n\n/**\n * Derived tonal ramps (TD-05.09 color foundations)\n *\n * Seven OKLCH-generated hue ramps, 11 perceptual lightness steps each (50 -> 950).\n * Built with hue-torsion + a chroma arc, anchored through existing brand/semantic\n * hexes. `pin` marks the step each ramp flows through its anchor.\n * This is the single source of truth for chromatic hexes — the categorical palette\n * below references these steps rather than duplicating values.\n * See sources/design/foundations.\n */\nexport const primitiveRamps = {\n red: {\n 50: '#FFF4F4',\n 100: '#FFE3E5',\n 200: '#FFC2C5',\n 300: '#FF9A9D',\n 400: '#F77175',\n 500: '#E05254',\n 600: '#D14343', // pin\n 700: '#A4221C',\n 800: '#7E1002',\n 900: '#5A0900',\n 950: '#3D0400',\n },\n orange: {\n 50: '#FFF5ED',\n 100: '#FFE6D4',\n 200: '#FFC7A2',\n 300: '#FFA063',\n 400: '#FF7900', // pin\n 500: '#DA5F00',\n 600: '#B94A00',\n 700: '#983804',\n 800: '#6F290F',\n 900: '#4E1C0C',\n 950: '#331107',\n },\n amber: {\n 50: '#FFF7DD',\n 100: '#FFEAA9',\n 200: '#FFD352',\n 300: '#F9B415', // pin\n 400: '#E08C00',\n 500: '#C27400',\n 600: '#A45E00',\n 700: '#814D14',\n 800: '#5B3A1A',\n 900: '#442503',\n 950: '#301500',\n },\n green: {\n 50: '#E3FFEE',\n 100: '#B5FFD2',\n 200: '#58F69E',\n 300: '#2ED573', // pin\n 400: '#21C05D',\n 500: '#22A444',\n 600: '#298732',\n 700: '#2B6B25',\n 800: '#264D1C',\n 900: '#1B3515',\n 950: '#11220D',\n },\n cyan: {\n 50: '#E6FBFF',\n 100: '#C2F6FF',\n 200: '#62EAFF',\n 300: '#22D3EE', // pin\n 400: '#01B5D1',\n 500: '#2697B7',\n 600: '#307B9B',\n 700: '#2A617F',\n 800: '#22465F',\n 900: '#0B3149',\n 950: '#001F36',\n },\n blue: {\n 50: '#EFF8FF',\n 100: '#D9EFFF',\n 200: '#ACDBFF',\n 300: '#78C2FF',\n 400: '#3CA8FF',\n 500: '#2196F3', // pin\n 600: '#1072CB',\n 700: '#135AA8',\n 800: '#14407E',\n 900: '#112C5A',\n 950: '#091B3C',\n },\n magenta: {\n 50: '#FFF3F9',\n 100: '#FFE2F1',\n 200: '#FFBDE2',\n 300: '#FF8FD5',\n 400: '#ED69C3',\n 500: '#D548AF',\n 600: '#BA2996',\n 700: '#9C0D7A', // pin\n 800: '#77005A',\n 900: '#56003F',\n 950: '#3B0029',\n },\n} as const\n\n/**\n * Categorical (qualitative) palette — an ordered, CVD-safe series expressed as\n * references into {@link primitiveRamps} (one source of truth; the palette moves\n * with the ramps).\n *\n * Design: a single canonical hue order (blue, magenta, red, orange, green, cyan,\n * amber), with steps chosen vivid-midtone-first and fanned lighter/darker as the\n * series grows to preserve separation. The sequence is nested-stable — a chart\n * with N series uses the first N colors, and the series index is stable as N\n * changes. Colorblind-safe worst-case deuteranopia/protanopia floor 8 holds\n * through {@link CATEGORICAL_CVD_SAFE_MAX} colors; the 7th is an extended color\n * that should be paired with a legend or other secondary encoding.\n *\n * Two variants: `default` (vivid, sits on neutral/light surfaces, legible under\n * black text) and `dark` (deeper shades legible under white text on a fill). A\n * separate \"light\" variant was dropped — the vivid `default` picks already clear\n * black-text contrast, so it doubles as the light-context palette.\n */\nexport const categoricalPalette = {\n default: [\n primitiveRamps.blue[500],\n primitiveRamps.magenta[500],\n primitiveRamps.red[500],\n primitiveRamps.orange[400],\n primitiveRamps.green[300],\n primitiveRamps.cyan[300],\n primitiveRamps.amber[600], // extended (7th) — pair with a legend\n ],\n dark: [\n primitiveRamps.blue[600],\n primitiveRamps.magenta[600],\n primitiveRamps.red[500],\n primitiveRamps.orange[600],\n primitiveRamps.green[800],\n primitiveRamps.cyan[800],\n primitiveRamps.amber[500], // extended (7th) — pair with a legend\n ],\n} as const\n\n/** Largest series count that holds the CVD floor without a legend. */\nexport const CATEGORICAL_CVD_SAFE_MAX = 6\n\n/**\n * Categorical palette variant.\n * - `default` : vivid; neutral/light surfaces, legible under black text\n * - `dark` : deeper shades, legible under white text on a filled swatch\n */\nexport type CategoricalVariant = keyof typeof categoricalPalette\n\n/**\n * Get a color from the ordered categorical palette by series index.\n * The palette is nested-stable, so the color for a given index does not change\n * with the total series count; `index` simply wraps past the end.\n *\n * @param index - 0-based series index (wraps past the end)\n * @param variant - `default` (black-text / light surfaces) or `dark` (white text)\n * @returns The hex color string\n */\nexport function getCategoricalColor(index: number, variant: CategoricalVariant = 'default'): string {\n const palette = categoricalPalette[variant]\n index = Math.max(0, Math.floor(index))\n return palette[index % palette.length]\n}\n\n/**\n * Diverging status scale (BodyMap training-status: under → optimal → over) as\n * references into {@link primitiveRamps}. A true diverging shape — `optimal` is\n * the lightest center, the extremes go darker — so the signal reads in lightness\n * (colorblind-robust; worst-case deut/protanopia min ΔE ~10.9) and the direction\n * reads in the blue↔red axis (the CVD-safe hue pair).\n *\n * Tuned so every stop is dark enough for the fill yet light enough that BLACK\n * text clears 4.5:1 on all five — no per-cell white/black flipping. The value\n * valley is symmetric: the two mid-arms (maintenance / approaching) sit at equal\n * lightness (both ~0.53 relative luminance), the ends darker.\n */\nexport const divergingScale = [\n primitiveRamps.blue[500], // under\n primitiveRamps.cyan[300], // maintenance\n primitiveRamps.green[200], // optimal (light center)\n primitiveRamps.amber[300], // approaching\n primitiveRamps.red[600], // over\n] as const\n\n/**\n * Sequential \"effort\" scale (low → high intensity: green → yellow → orange → red)\n * as references into {@link primitiveRamps}. A 6-stop ordinal palette; the\n * velocity/RPE strip sub-samples it. Every adjacent pair clears the CVD floor\n * (min deut/protan ΔE ≥ 4.5), and within that the hue walk is kept smooth —\n * the amber-200 → amber-300 → orange-400 run steps the yellow→orange transition\n * gradually rather than lurching. Order encodes magnitude, so it tolerates the\n * green↔red CVD pair. Stops 0–3 take black text; the dark reds take white.\n */\nexport const sequentialEffort = [\n primitiveRamps.green[300],\n primitiveRamps.amber[200],\n primitiveRamps.amber[300],\n primitiveRamps.orange[400],\n primitiveRamps.red[600],\n primitiveRamps.red[700],\n] as const\n\n/**\n * Best-contrast text color (black or white) for a solid fill — for labels sitting\n * on categorical/diverging/effort swatches. Uses the WCAG relative-luminance ratio.\n */\nexport function bestTextColor(hex: string): '#000000' | '#FFFFFF' {\n const [r, g, b] = [0, 2, 4].map((i) => {\n const c = parseInt(hex.replace('#', '').slice(i, i + 2), 16) / 255\n return c >= 0.04045 ? ((c + 0.055) / 1.055) ** 2.4 : c / 12.92\n })\n const l = 0.2126 * r + 0.7152 * g + 0.0722 * b\n return (l + 0.05) / 0.05 >= 1.05 / (l + 0.05) ? '#000000' : '#FFFFFF'\n}\n\n/**\n * Discrete rainbow palette for data visualization\n * Based on Paul Tol's color schemes: https://personal.sron.nl/~pault/#fig:scheme_rainbow_discrete\n */\nexport const discreteRainbow = [\n '#E8ECFB',\n '#D9CCE3',\n '#D1BBD7',\n '#CAACCB',\n '#BA8DB4',\n '#AE76A3',\n '#AA6F9E',\n '#994F88',\n '#882E72',\n '#1965B0',\n '#437DBF',\n '#5289C7',\n '#6195CF',\n '#7BAFDE',\n '#4EB265',\n '#90C987',\n '#CAE0AB',\n '#F7F056',\n '#F7CB45',\n '#F6C141',\n '#F4A736',\n '#F1932D',\n '#EE8026',\n '#E8601C',\n '#E65518',\n '#DC050C',\n '#A5170E',\n '#72190E',\n '#42150A',\n] as const\n\n/**\n * Palette indices for discrete rainbow colors at different palette sizes.\n * For a given palette size (index + 1), returns the indices of colors to use.\n */\nconst discreteRainbowPalettes: number[][] = [\n [10],\n [10, 26],\n [10, 18, 26],\n [10, 15, 18, 26],\n [10, 14, 15, 18, 26],\n [10, 14, 15, 17, 18, 26],\n [9, 10, 14, 15, 17, 18, 26],\n [9, 10, 14, 15, 17, 18, 23, 26],\n [9, 10, 14, 15, 17, 18, 23, 26, 28],\n [9, 10, 14, 15, 17, 18, 21, 24, 26, 28],\n [9, 10, 12, 14, 15, 17, 18, 21, 24, 26, 28],\n [3, 6, 9, 10, 12, 14, 15, 17, 18, 21, 24, 26],\n [3, 6, 9, 10, 12, 14, 15, 16, 17, 18, 21, 24, 26],\n [3, 6, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26],\n [3, 6, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26, 28],\n [3, 5, 7, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26, 28],\n [3, 5, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26, 28],\n [3, 5, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26, 27, 28],\n [2, 4, 5, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26, 27, 28],\n [2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 20, 22, 24, 26, 27, 28],\n [2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 21, 23, 25, 26, 27, 28],\n [2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 21, 23, 25, 26, 27, 28, 29],\n [1, 2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 21, 23, 25, 26, 27, 28, 29],\n]\n\n/**\n * Get a color from the discrete rainbow palette for a given index and palette size.\n * Colors are optimized for visual distinction at each palette size.\n *\n * @param index - The index of the color in the series (0-based)\n * @param size - The total number of colors needed (1-23)\n * @returns The hex color string\n */\nexport function getDiscreteRainbowColor(index: number, size: number): string {\n index = Math.max(0, index)\n size = Math.min(Math.max(1, size), discreteRainbowPalettes.length)\n\n const palette = discreteRainbowPalettes[size - 1]\n if (index >= palette.length) index = index % palette.length\n\n return discreteRainbow[palette[index] - 1]\n}\n\nexport const primitiveTypography = {\n fontFamilies: {\n sans: ['Inter', '-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Helvetica', 'Arial', 'sans-serif'],\n body: ['Nunito Sans', 'sans-serif'],\n heading: ['Space Grotesk', 'sans-serif'],\n mono: ['SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', 'Droid Sans Mono', 'Source Code Pro', 'monospace'],\n },\n fontSizes: {\n xs: '0.75rem', // 12px\n sm: '0.875rem', // 14px\n base: '1rem', // 16px\n lg: '1.125rem', // 18px\n xl: '1.5rem', // 24px\n '2xl': '2rem', // 32px\n '3xl': '2.25rem', // 36px\n '4xl': '3rem', // 48px\n '5xl': '3.5rem', // 56px\n },\n fontWeights: {\n normal: 400,\n medium: 500,\n semibold: 600,\n bold: 700,\n },\n lineHeights: {\n none: 1,\n tight: 1.375,\n snug: 1.5,\n normal: 1.57,\n relaxed: 1.66,\n loose: 1.75,\n },\n letterSpacing: {\n tighter: '-0.05em',\n tight: '-0.025em',\n normal: '0em',\n wide: '0.025em',\n wider: '0.05em',\n widest: '0.5px',\n },\n} as const\n\nexport const primitiveSpacing = {\n 0: '0',\n px: '1px',\n 0.5: '0.125rem', // 2px\n 1: '0.25rem', // 4px\n 1.5: '0.375rem', // 6px\n 2: '0.5rem', // 8px\n 2.5: '0.625rem', // 10px\n 3: '0.75rem', // 12px\n 3.5: '0.875rem', // 14px\n 4: '1rem', // 16px\n 5: '1.25rem', // 20px\n 6: '1.5rem', // 24px\n 7: '1.75rem', // 28px\n 8: '2rem', // 32px\n 9: '2.25rem', // 36px\n 10: '2.5rem', // 40px\n 11: '2.75rem', // 44px\n 12: '3rem', // 48px\n 14: '3.5rem', // 56px\n 16: '4rem', // 64px\n 20: '5rem', // 80px\n 24: '6rem', // 96px\n 28: '7rem', // 112px\n 32: '8rem', // 128px\n} as const\n\nexport const primitiveBorderRadius = {\n none: '0',\n sm: '4px',\n DEFAULT: '8px',\n md: '8px',\n lg: '12px',\n xl: '16px',\n '2xl': '24px',\n full: '9999px',\n} as const\n\nexport const primitiveBreakpoints = {\n xs: 0,\n sm: 600,\n md: 1000,\n lg: 1200,\n xl: 1920,\n} as const\n\nexport const primitiveZIndex = {\n hide: -1,\n auto: 'auto',\n base: 0,\n docked: 10,\n dropdown: 1000,\n sticky: 1100,\n drawer: 1100,\n banner: 1200,\n appBar: 1200,\n overlay: 1300,\n modal: 1400,\n popover: 1500,\n skipLink: 1600,\n toast: 1700,\n tooltip: 1800,\n} as const\n","/**\n * Semantic Design Tokens\n *\n * Meaningful tokens following DTCG (Design Tokens Community Group) naming conventions.\n * Pattern: {category}-{intent}-{variant?}-{state?}\n *\n * Categories:\n * - brand-* : Brand colors (primary, secondary, accent)\n * - status-* : Feedback colors (success, error, warning, info)\n * - result-* : Outcome indicators (improve, degrade, inconclusive, neutral)\n * - data-* : Data visualization colors (chart series)\n * - on-* : Text on colored backgrounds\n * - surface-* : Elevated containers (NOT \"paper\")\n * - background-* : Page backgrounds\n * - text-* : Text colors\n * - border-* : Border colors\n * - interactive-* : Hover/focus/active/disabled states\n */\n\nimport { primitiveColors as p, primitiveRamps as ramp, greyRamp, discreteRainbow } from './primitives'\n\n/**\n * GREY MAPPING (TD-07.14) — how the old cool scales resolved onto `greyRamp`.\n *\n * Every grey below came off `grey` (pure R=G=B) or `neutral` (cool, R−B\n * down to −26). They were snapped by NEAREST L*, not by matching step numbers,\n * because the two old scales were numbered incompatibly: `grey` ran\n * INVERTED and compressed (0 = #6E6E6E lightest, 900 = #101010 darkest), so\n * `grey[400]` and `greyRamp[400]` have nothing to do with each other.\n *\n * grey 200→800 300→900 400→925 500→950\n * neutral 50→50 100→100 300→200 400→400 500→600 600→700 900→950\n *\n * Surfaces move ΔE 1.9–4.8 — at or near imperceptible. The TEXT roles move\n * further (8.6–12.8), and that is the intended part of the change: they are\n * picking up the warmth the surfaces already had.\n *\n * Light gets its own column because strict L*-nearest collapsed `neutral[50]`\n * and `[100]` onto one step, flattening surface-elevated into surface-raised.\n * Light is still deferred as a design question — there is no `surfaceRampLight`.\n *\n * `border-default`, `-subtle` and `-strong` are GONE, replaced by `hairline-*`.\n * Once the planes became ramp steps, every value dark enough to read as a\n * border was also a plane's fill. Alpha composites instead of colliding.\n *\n * `text-tertiary` on dark is the one role that ignores L*-nearest; see it.\n */\n\n// Light mode semantic colors (default)\nexport const semanticColorsLight = {\n // Brand colors (brand-*)\n 'brand-primary': ramp.orange[400],\n 'brand-primary-light': ramp.orange[300],\n 'brand-primary-dark': ramp.orange[500],\n 'brand-primary-subtle': 'rgba(255, 121, 0, 0.08)',\n 'brand-primary-hover': ramp.orange[500],\n 'brand-primary-active': ramp.orange[600],\n\n 'brand-secondary': ramp.cyan[600],\n 'brand-secondary-light': ramp.cyan[500],\n 'brand-secondary-dark': ramp.cyan[700],\n 'brand-secondary-subtle': 'rgba(48, 123, 155, 0.08)',\n 'brand-secondary-hover': ramp.cyan[700],\n 'brand-secondary-active': ramp.cyan[800],\n\n // Text on brand backgrounds (on-*)\n 'on-brand-primary': p.white,\n 'on-brand-secondary': p.white,\n\n // Status colors (status-*)\n 'status-success': ramp.green[300],\n 'status-success-light': ramp.green[200],\n 'status-success-dark': ramp.green[600],\n 'status-success-subtle': ramp.green[50],\n\n // Live-session accent — its OWN role, decoupled from success so the two can diverge\n 'status-live': ramp.green[300],\n 'status-live-muted': ramp.green[500],\n\n 'status-error': ramp.red[600],\n 'status-error-light': ramp.red[500],\n 'status-error-dark': ramp.red[700],\n 'status-error-subtle': ramp.red[50],\n\n 'status-error-vivid': ramp.red[600], // vivid alert red\n 'status-error-vivid-light': ramp.red[500],\n 'status-error-vivid-dark': ramp.red[700],\n 'status-error-vivid-subtle': 'rgba(255, 71, 87, 0.12)',\n\n 'status-warning': ramp.amber[300],\n 'status-warning-light': ramp.amber[200],\n 'status-warning-dark': ramp.amber[500],\n 'status-warning-subtle': ramp.amber[50],\n\n 'status-info': ramp.blue[500],\n 'status-info-light': ramp.blue[300],\n 'status-info-dark': ramp.blue[600],\n 'status-info-subtle': ramp.blue[50],\n\n // Text on status backgrounds (on-status-*)\n 'on-status-success': p.white,\n 'on-status-error': p.white,\n 'on-status-warning': p.white,\n 'on-status-info': p.white,\n\n // Result/outcome indicators (result-*)\n 'result-improve': '#4caf50', // Green - positive outcome\n 'result-improve-light': 'rgba(76, 175, 80, 0.12)',\n 'result-improve-dark': '#248a24',\n 'result-degrade': '#ef5350', // Red - negative outcome\n 'result-degrade-light': 'rgba(239, 83, 80, 0.12)',\n 'result-degrade-dark': '#b30000',\n 'result-inconclusive': '#9E9A97', // Gray - no clear result\n 'result-inconclusive-light': 'rgba(158, 154, 151, 0.12)',\n 'result-neutral': greyRamp[600], // Neutral baseline\n\n // Text on result backgrounds (on-result-*)\n 'on-result-improve': p.white,\n 'on-result-degrade': p.white,\n 'on-result-inconclusive': p.white,\n\n // Data visualization colors (data-*)\n // First 10 colors from discrete rainbow optimized for charts\n 'data-1': discreteRainbow[9], // Blue\n 'data-2': discreteRainbow[14], // Green\n 'data-3': discreteRainbow[17], // Yellow\n 'data-4': discreteRainbow[25], // Red\n 'data-5': discreteRainbow[8], // Purple\n 'data-6': discreteRainbow[20], // Orange\n 'data-7': discreteRainbow[13], // Light Blue\n 'data-8': discreteRainbow[15], // Light Green\n 'data-9': discreteRainbow[3], // Lavender\n 'data-10': discreteRainbow[22], // Dark Orange\n\n // Text colors (text-*)\n 'text-primary': '#121828',\n 'text-secondary': '#65748B',\n 'text-tertiary': greyRamp[400],\n 'text-disabled': 'rgba(55, 65, 81, 0.48)',\n 'text-inverse': p.white,\n 'text-link': ramp.blue[600],\n 'text-link-hover': ramp.blue[700],\n\n // Surface colors (surface-*) - for elevated containers\n 'surface-base': p.white,\n 'surface-elevated': greyRamp[50], // slightly off-white for elevated cards\n 'surface-raised': greyRamp[100], // light gray for raised cards\n 'surface-overlay': p.white,\n 'surface-input': greyRamp[50], // Input field background (filled variant)\n\n // Background colors (background-*)\n 'background-base': '#EBEBEB',\n 'background-default': p.white,\n 'background-subtle': greyRamp[50],\n // Frame/bezel chrome — top bar + side nav shell, one step below\n // `background-base`. Placeholder pairing for light mode, which is deferred.\n 'background-frame': greyRamp[400],\n\n // Border colors (border-*)\n 'border-prominent': greyRamp[400], // high-visibility divider\n 'border-focus': ramp.blue[600],\n 'border-input': greyRamp[200], // Input field border\n 'border-input-hover': greyRamp[400], // Input field border on hover\n 'border-input-focus': ramp.blue[600], // Input field border on focus\n 'border-input-error': ramp.red[600], // Input field border on error\n\n // Alpha hairline separators (surface-independent — composite toward black on\n // light surfaces, mirroring the dark-mode white-alpha family). See §4/S-2.\n 'hairline-subtle': 'rgba(0, 0, 0, 0.06)',\n 'hairline-default': 'rgba(0, 0, 0, 0.09)',\n 'hairline-strong': 'rgba(0, 0, 0, 0.14)',\n\n // Interactive states (interactive-*)\n 'interactive-hover': 'rgba(55, 65, 81, 0.04)',\n 'interactive-focus': 'rgba(55, 65, 81, 0.12)',\n 'interactive-active': 'rgba(55, 65, 81, 0.16)',\n 'interactive-selected': 'rgba(55, 65, 81, 0.08)',\n 'interactive-disabled': 'rgba(55, 65, 81, 0.12)',\n 'interactive-disabled-text': 'rgba(55, 65, 81, 0.26)',\n\n // Divider\n 'divider': '#E8E9EB',\n\n // Avatar default\n 'avatar-background': greyRamp[600],\n 'avatar-text': p.white,\n} as const\n\n// Dark mode semantic colors\nexport const semanticColorsDark = {\n // Brand colors stay the same in dark mode\n 'brand-primary': ramp.orange[400],\n 'brand-primary-light': ramp.orange[300],\n 'brand-primary-dark': ramp.orange[500],\n 'brand-primary-subtle': 'rgba(255, 121, 0, 0.12)',\n 'brand-primary-hover': ramp.orange[300],\n 'brand-primary-active': ramp.orange[200],\n\n 'brand-secondary': ramp.cyan[600],\n 'brand-secondary-light': ramp.cyan[500],\n 'brand-secondary-dark': ramp.cyan[700],\n 'brand-secondary-subtle': 'rgba(48, 123, 155, 0.12)',\n 'brand-secondary-hover': ramp.cyan[500],\n 'brand-secondary-active': ramp.cyan[400],\n\n // Text on brand backgrounds\n 'on-brand-primary': p.white,\n 'on-brand-secondary': p.white,\n\n // Status colors\n 'status-success': ramp.green[300],\n 'status-success-light': ramp.green[200],\n 'status-success-dark': ramp.green[600],\n 'status-success-subtle': 'rgba(46, 213, 115, 0.12)',\n\n // Live-session accent — its OWN role, decoupled from success so the two can diverge\n 'status-live': ramp.green[300],\n 'status-live-muted': ramp.green[500],\n\n 'status-error': ramp.red[600],\n 'status-error-light': ramp.red[500],\n 'status-error-dark': ramp.red[700],\n 'status-error-subtle': 'rgba(209, 67, 67, 0.12)',\n\n 'status-error-vivid': ramp.red[600],\n 'status-error-vivid-light': ramp.red[500],\n 'status-error-vivid-dark': ramp.red[700],\n 'status-error-vivid-subtle': 'rgba(255, 71, 87, 0.12)',\n\n 'status-warning': ramp.amber[300],\n 'status-warning-light': ramp.amber[200],\n 'status-warning-dark': ramp.amber[500],\n 'status-warning-subtle': 'rgba(249, 180, 21, 0.12)',\n\n 'status-info': ramp.blue[500],\n 'status-info-light': ramp.blue[300],\n 'status-info-dark': ramp.blue[600],\n 'status-info-subtle': 'rgba(33, 150, 243, 0.12)',\n\n // Text on status backgrounds\n 'on-status-success': p.white,\n 'on-status-error': p.white,\n 'on-status-warning': p.white,\n 'on-status-info': p.white,\n\n // Result/outcome indicators (result-*)\n 'result-improve': '#4caf50',\n 'result-improve-light': 'rgba(76, 175, 80, 0.16)',\n 'result-improve-dark': '#248a24',\n 'result-degrade': '#ef5350',\n 'result-degrade-light': 'rgba(239, 83, 80, 0.16)',\n 'result-degrade-dark': '#b30000',\n 'result-inconclusive': '#9E9A97',\n 'result-inconclusive-light': 'rgba(158, 154, 151, 0.16)',\n 'result-neutral': greyRamp[400],\n\n // Text on result backgrounds\n 'on-result-improve': p.white,\n 'on-result-degrade': p.white,\n 'on-result-inconclusive': p.white,\n\n // Data visualization colors (same in dark mode for consistency)\n 'data-1': discreteRainbow[9],\n 'data-2': discreteRainbow[14],\n 'data-3': discreteRainbow[17],\n 'data-4': discreteRainbow[25],\n 'data-5': discreteRainbow[8],\n 'data-6': discreteRainbow[20],\n 'data-7': discreteRainbow[13],\n 'data-8': discreteRainbow[15],\n 'data-9': discreteRainbow[3],\n 'data-10': discreteRainbow[22],\n\n // Text colors - inverted for dark mode\n 'text-primary': greyRamp[50],\n 'text-secondary': greyRamp[400],\n // Deliberately ONE step lighter than the L*-nearest match (`greyRamp[600]`).\n // The colour this replaced failed WCAG large-text outright on the three\n // lightest planes — 2.96 / 2.72 / 2.49 against elevated / raised / overlay —\n // and `600` carried that failure forward almost exactly (2.93 / 2.70 / 2.47).\n // `500` clears 3:1 everywhere (3.32–5.34). Contrast beats colour fidelity for\n // text roles; borders and surfaces still use strict L*-nearest. See\n // semantic-contrast.test.ts, which fails if this is moved back down.\n 'text-tertiary': greyRamp[500],\n 'text-disabled': 'rgba(255, 255, 255, 0.38)',\n 'text-inverse': greyRamp[950],\n 'text-link': '#828DF8',\n 'text-link-hover': ramp.blue[400],\n\n // Surface colors - dark backgrounds — warm-tapered DERIVED ramp (TD-surface-tokens,\n // S-1, re-spaced S-3). Shipped verbatim from `deriveSurfaceRamp()` — see\n // `surfaceRampDark` in primitives.ts for the full derivation note. `surface-overlay`\n // and `surface-elevated` are distinct (were both #191919 pre-S-1); `surface-input`\n // tracks one plane above `surface-base`, same relative position as before the remap.\n // `background-base` backs `Surface level=\"background\"` (SurfaceContext.SURFACE_LEVEL_TOKEN),\n // so it takes the ramp's shell role. The deepest plane is `background-frame`,\n // which is also the `SurfaceLevel` floor a pressed surface clamps at.\n 'surface-base': greyRamp[925], // main surface (#252321, L*13.9)\n 'surface-elevated': greyRamp[900], // elevated surface (#2C2A28, L*17.2 — nav/rail)\n 'surface-raised': greyRamp[875], // raised surface (#31302F, L*19.9 — cards)\n 'surface-overlay': greyRamp[850], // overlay surface (#373635, L*22.7 — hero/popover)\n 'surface-input': greyRamp[900], // input surface (#2C2A28 — one plane above base)\n\n // Background colors — same ramp, the frame/shell end of it.\n 'background-base': greyRamp[950], // shell (#1C1916, L*9 — Surface level=\"background\")\n 'background-default': greyRamp[925], // main background (#252321, L*13.9 — matches surface-base)\n 'background-subtle': greyRamp[900], // subtle background (#2C2A28, L*17.2 — matches surface-elevated)\n // Frame/bezel chrome — the top bar + side nav shell, one step BELOW\n // `background-base`. It used to be described as sitting OUTSIDE the ramp; it\n // is simply the ramp's last step now, and the floor `<Surface pressed>` clamps at.\n 'background-frame': greyRamp[975], // frame / bezel (#100D0A, L*3.8)\n\n // Border colors — solid dark borders are RETIRED (TD-07.14). Not a preference — a structural\n // consequence of one ramp. Every step from 850 to 975 is now a surface plane,\n // so a solid border dark enough to read as a border necessarily equals some\n // plane's fill, which is exactly the collision `surface.contract.test.ts` R2\n // forbids. The only non-plane steps left in that band are 800 and 700, and\n // borders there jump from L*~10-25 to L*~28-38 — a restyle, not a migration.\n //\n // So separation moves to the alpha hairlines, which dark mode already called\n // \"the primary separation cue\". Being alpha, they composite against whatever\n // plane they land on and cannot collide with any of them — the problem stops\n // existing rather than being re-solved per plane. The three solid tokens were\n // deleted outright; consumers point at the `hairline-*` family below.\n //\n // `border-prominent` stays SOLID: it is the one border meant to be seen\n // outright (4 call sites, high-visibility dividers), and grey-800 is not a\n // plane, so it keeps its job without collision.\n 'border-prominent': greyRamp[800], // high-visibility divider\n 'border-focus': '#828DF8',\n 'border-input': greyRamp[700],\n 'border-input-hover': greyRamp[600],\n 'border-input-focus': '#828DF8',\n 'border-input-error': ramp.red[500],\n\n // Alpha hairline separators — the primary separation cue (§4/S-2). Self-\n // normalizing: composites toward white by ~the same amount on ANY plane, so\n // one family works at every elevation instead of per-surface border tokens.\n // Shadows are demoted to floating-overlay use only (not shipped as a fill\n // separator here — see elevation.ts, follow-up S-4).\n //\n // RETUNED on the wall (VW-99, S-6). The original .06/.09/.14 were set at a\n // desk. On the panel at ~3 m `subtle` rendered but was indiscernible, and\n // `default` — the load-bearing one, with no solid-border fallback since\n // TD-07.14 — went weak on the lightest plane. `strong` read cleanly with room\n // to spare, which is what made raising the whole family viable.\n //\n // Each tier steps up onto the next MEASURED-GOOD rung rather than an\n // interpolated one: the new `subtle` is the old `default`, and the new\n // `default` is the old `strong` — a value just confirmed legible on all four\n // planes. Spacing goes 1 : 1.56 : 2.33, against the original 1 : 1.5 : 2.33.\n //\n // RUN 2 (VW-99): all three tiers were seen on all four planes — the retune\n // worked — but `subtle` was still \"a bit hard to read\", so the whole family\n // took a further +.01. That is a comfort margin on a passing row, not a fix\n // for a failing one, which is why it is a flat offset: the 1 : 1.56 : 2.33\n // spacing that the run validated is preserved rather than re-derived.\n //\n // Keep these to TWO decimals. react-native-web quantises alpha to 8 bits, so\n // a 3-decimal value silently rounds on the way to the DOM (.135 renders as\n // .13) — the token would say one thing and paint another.\n //\n // DARK ONLY. The light family above composites toward BLACK on light planes,\n // which this run says nothing about — do not mirror these numbers into it\n // without its own verification.\n 'hairline-subtle': 'rgba(255, 255, 255, 0.10)',\n 'hairline-default': 'rgba(255, 255, 255, 0.15)',\n 'hairline-strong': 'rgba(255, 255, 255, 0.22)',\n\n // Interactive states\n 'interactive-hover': 'rgba(255, 255, 255, 0.04)',\n 'interactive-focus': 'rgba(255, 255, 255, 0.12)',\n 'interactive-active': 'rgba(255, 255, 255, 0.16)',\n 'interactive-selected': 'rgba(255, 255, 255, 0.08)',\n 'interactive-disabled': 'rgba(255, 255, 255, 0.12)',\n 'interactive-disabled-text': 'rgba(255, 255, 255, 0.26)',\n\n // Divider\n 'divider': 'rgba(255, 255, 255, 0.09)',\n\n // Avatar default\n 'avatar-background': greyRamp[700],\n 'avatar-text': p.white,\n} as const\n\n// Typography tokens matching existing app\nexport const semanticTypography = {\n // Headings (Space Grotesk)\n h1: {\n fontFamily: 'heading',\n fontSize: '3.5rem',\n fontWeight: 700,\n lineHeight: 1.375,\n },\n h2: {\n fontFamily: 'heading',\n fontSize: '3rem',\n fontWeight: 700,\n lineHeight: 1.375,\n },\n h3: {\n fontFamily: 'heading',\n fontSize: '2.25rem',\n fontWeight: 700,\n lineHeight: 1.375,\n },\n h4: {\n fontFamily: 'heading',\n fontSize: '2rem',\n fontWeight: 700,\n lineHeight: 1.375,\n },\n h5: {\n fontFamily: 'heading',\n fontSize: '1.5rem',\n fontWeight: 600,\n lineHeight: 1.375,\n },\n h6: {\n fontFamily: 'heading',\n fontSize: '1.125rem',\n fontWeight: 600,\n lineHeight: 1.375,\n },\n\n // Body text (Nunito Sans)\n body1: {\n fontFamily: 'body',\n fontSize: '1rem',\n fontWeight: 400,\n lineHeight: 1.5,\n },\n body2: {\n fontFamily: 'body',\n fontSize: '0.875rem',\n fontWeight: 400,\n lineHeight: 1.57,\n },\n subtitle1: {\n fontFamily: 'body',\n fontSize: '1rem',\n fontWeight: 500,\n lineHeight: 1.75,\n },\n subtitle2: {\n fontFamily: 'body',\n fontSize: '0.875rem',\n fontWeight: 500,\n lineHeight: 1.57,\n },\n caption: {\n fontFamily: 'body',\n fontSize: '0.75rem',\n fontWeight: 400,\n lineHeight: 1.66,\n },\n overline: {\n fontFamily: 'body',\n fontSize: '0.75rem',\n fontWeight: 600,\n lineHeight: 2.5,\n letterSpacing: '0.5px',\n textTransform: 'uppercase' as const,\n },\n button: {\n fontFamily: 'sans',\n fontSize: '0.875rem',\n fontWeight: 600,\n lineHeight: 1.75,\n },\n} as const\n\n// Button size tokens\nexport const buttonSizes = {\n sm: {\n paddingX: '16px',\n paddingY: '6px',\n fontSize: '0.875rem',\n },\n md: {\n paddingX: '20px',\n paddingY: '8px',\n fontSize: '0.875rem',\n },\n lg: {\n paddingX: '24px',\n paddingY: '11px',\n fontSize: '1rem',\n },\n} as const\n\n// Export type for theme mode\nexport type ThemeMode = 'light' | 'dark'\n\n// Helper to get semantic colors based on mode\nexport function getSemanticColors(mode: ThemeMode) {\n return mode === 'dark' ? semanticColorsDark : semanticColorsLight\n}\n","import { Platform } from 'react-native'\nimport { getSemanticColors, type ThemeMode } from './tokens/semantic'\n\ntype ColorToken = keyof ReturnType<typeof getSemanticColors>\n\n/**\n * Resolve a semantic color token for an inline style where a nativewind\n * className can't apply — gradients (`backgroundImage`), per-edge borders\n * (`borderTopColor`, …), SVG attributes, and conditional hex/token mixes.\n *\n * The companion to className color tokens: on **web** it returns the CSS\n * variable (`var(--color-…)`), so the dashboard's light/dark switching keeps\n * working exactly as `global.css` intends; on **native** it returns the\n * resolved hex from `getSemanticColors` (mobile is dark-only). This is why\n * these spots stay theme-correct on web while also rendering on-device.\n */\nexport function resolveColor(token: ColorToken, mode: ThemeMode = 'dark'): string {\n return Platform.OS === 'web' ? `var(--color-${token})` : getSemanticColors(mode)[token]\n}\n","/**\n * Workout-specific tokens not yet in the main Tailwind config.\n * Use these inline instead of Tailwind classes.\n */\nimport { divergingScale, sequentialEffort, primitiveRamps as ramp } from './tokens/primitives'\n\nexport const WORKOUT_TOKENS = {\n // Canonical 4-band performance scale — the single source for BOTH the\n // VelocityStrip zone bars and the SetRow RPE color (TD-03.43). The direction\n // is intentionally inverted between the two consumers: for velocity, green =\n // fastest/best; for RPE, green = easiest. This is the [0,2,3,4] subsample of\n // the canonical `sequentialEffort` primitive: an EVEN hue walk across the ramp\n // (green → gold → orange → red). The earlier [0,1,2,4] spent two of its four\n // bands on adjacent yellows (amber-200 + amber-300) and skipped orange, reading\n // yellow-heavy with an abrupt jump to red; sampling amber-300 + orange-400\n // instead gives four cleanly separable bands that hold at 3px strip scale.\n // Consumed inline (RN).\n scale: {\n green: sequentialEffort[0], // green-300\n yellow: sequentialEffort[2], // amber-300 (gold)\n orange: sequentialEffort[3], // orange-400 (true orange)\n red: sequentialEffort[4], // red-600\n },\n\n // BodyMap volume heatmap — the canonical `divergingScale` (under → optimal →\n // over): a true diverging shape with a light green center, cool-blue under-\n // trained end and warm-red over-reaching end (colorblind-robust in lightness).\n heatmap: {\n none: '#E0E0E0', // no training data\n under: divergingScale[0], // below MEV\n maintenance: divergingScale[1], // MEV to MAV\n productive: divergingScale[2], // optimal center — MAV to MRV\n approaching: divergingScale[3], // near MRV\n over: divergingScale[4], // over MRV\n },\n\n // Badge border-radius (rounded-sm is 4px, we need 2px)\n badgeRadius: 2,\n\n // Surface and border colors were removed here: those flip with the theme, so\n // components use the CSS custom properties (var(--color-surface-*/border-*))\n // directly. Only theme-independent data-viz values remain below.\n\n // Intensity bar specific — over-target tiers deepen along the red ramp.\n intensity: {\n track: '#333333',\n over1: ramp.red[600], // matches status-error\n over2: ramp.red[700],\n over3: ramp.red[800],\n targetLine: 'rgba(33, 150, 243, 0.5)',\n atTargetGlow:\n '0 0 5px 1px rgba(33, 150, 243, 0.35), 0 0 10px 3px rgba(33, 150, 243, 0.15)',\n },\n\n // Placeholder strip\n placeholder: {\n fill: '#3A3A3A',\n },\n\n // Deviation bar\n deviation: {\n track: '#333333',\n },\n} as const\n","/**\n * Muscle grouping taxonomy for volume tracking, exercise mapping, and the\n * BodyMap visualization. Ported from the Voltras muscle-taxonomy design doc.\n *\n * Level 2 (15 groups) is the primary volume-tracking unit; SimpleMuscleGroup\n * (8 groups) is the beginner-facing aggregation. MUSCLE_TO_SVG_SLUGS maps each\n * group to react-native-body-highlighter slugs using the closest-slug approach\n * (Phase 1: combined colors, no sub-region splitting — deltoids is a single\n * slug, lats and upper back share `upper-back`).\n */\nimport { WORKOUT_TOKENS } from '../../../theme/workout-tokens'\n\n/**\n * Full muscle group taxonomy for volume tracking and exercise mapping.\n * 15 groups — the primary unit for volume accounting.\n */\nexport enum MuscleGroup {\n // Push\n CHEST = 'chest',\n FRONT_DELTS = 'front_delts',\n SIDE_DELTS = 'side_delts',\n TRICEPS = 'triceps',\n\n // Pull\n LATS = 'lats',\n UPPER_BACK = 'upper_back',\n REAR_DELTS = 'rear_delts',\n BICEPS = 'biceps',\n FOREARMS = 'forearms',\n\n // Legs\n QUADS = 'quads',\n HAMSTRINGS = 'hamstrings',\n GLUTES = 'glutes',\n CALVES = 'calves',\n\n // Core\n ABS = 'abs',\n OBLIQUES = 'obliques',\n}\n\n/**\n * Simplified muscle group view for beginners. Maps to one or more MuscleGroup.\n */\nexport enum SimpleMuscleGroup {\n CHEST = 'chest',\n BACK = 'back',\n SHOULDERS = 'shoulders',\n BICEPS = 'biceps',\n TRICEPS = 'triceps',\n LEGS = 'legs',\n CORE = 'core',\n FOREARMS = 'forearms',\n}\n\n/** Mapping from simplified groups to the full taxonomy. */\nexport const SIMPLE_TO_DETAILED: Record<SimpleMuscleGroup, MuscleGroup[]> = {\n [SimpleMuscleGroup.CHEST]: [MuscleGroup.CHEST],\n [SimpleMuscleGroup.BACK]: [MuscleGroup.LATS, MuscleGroup.UPPER_BACK],\n [SimpleMuscleGroup.SHOULDERS]: [\n MuscleGroup.FRONT_DELTS,\n MuscleGroup.SIDE_DELTS,\n MuscleGroup.REAR_DELTS,\n ],\n [SimpleMuscleGroup.BICEPS]: [MuscleGroup.BICEPS],\n [SimpleMuscleGroup.TRICEPS]: [MuscleGroup.TRICEPS],\n [SimpleMuscleGroup.LEGS]: [\n MuscleGroup.QUADS,\n MuscleGroup.HAMSTRINGS,\n MuscleGroup.GLUTES,\n MuscleGroup.CALVES,\n ],\n [SimpleMuscleGroup.CORE]: [MuscleGroup.ABS, MuscleGroup.OBLIQUES],\n [SimpleMuscleGroup.FOREARMS]: [MuscleGroup.FOREARMS],\n}\n\n/** Reverse map: detailed MuscleGroup -> its SimpleMuscleGroup. */\nexport const DETAILED_TO_SIMPLE: Record<MuscleGroup, SimpleMuscleGroup> = Object.entries(\n SIMPLE_TO_DETAILED\n).reduce(\n (acc, [simple, groups]) => {\n for (const group of groups) {\n acc[group] = simple as SimpleMuscleGroup\n }\n return acc\n },\n {} as Record<MuscleGroup, SimpleMuscleGroup>\n)\n\n/** Movement category for training split organization. */\nexport type MovementCategory = 'push' | 'pull' | 'legs' | 'core'\n\nexport const MUSCLE_TO_CATEGORY: Record<MuscleGroup, MovementCategory> = {\n [MuscleGroup.CHEST]: 'push',\n [MuscleGroup.FRONT_DELTS]: 'push',\n [MuscleGroup.SIDE_DELTS]: 'push',\n [MuscleGroup.TRICEPS]: 'push',\n [MuscleGroup.LATS]: 'pull',\n [MuscleGroup.UPPER_BACK]: 'pull',\n [MuscleGroup.REAR_DELTS]: 'pull',\n [MuscleGroup.BICEPS]: 'pull',\n [MuscleGroup.FOREARMS]: 'pull',\n [MuscleGroup.QUADS]: 'legs',\n [MuscleGroup.HAMSTRINGS]: 'legs',\n [MuscleGroup.GLUTES]: 'legs',\n [MuscleGroup.CALVES]: 'legs',\n [MuscleGroup.ABS]: 'core',\n [MuscleGroup.OBLIQUES]: 'core',\n}\n\n/**\n * react-native-body-highlighter slug(s) per muscle group. Phase 1 uses the\n * closest available slug; deltoids share one path and lats/upper-back share\n * `upper-back` (see doc Level 4 \"Recommended approach\").\n */\nexport const MUSCLE_TO_SVG_SLUGS: Record<MuscleGroup, string[]> = {\n [MuscleGroup.CHEST]: ['chest'],\n [MuscleGroup.FRONT_DELTS]: ['deltoids'],\n [MuscleGroup.SIDE_DELTS]: ['deltoids'],\n [MuscleGroup.REAR_DELTS]: ['deltoids'],\n [MuscleGroup.TRICEPS]: ['triceps'],\n [MuscleGroup.LATS]: ['upper-back'],\n [MuscleGroup.UPPER_BACK]: ['upper-back', 'trapezius'],\n [MuscleGroup.BICEPS]: ['biceps'],\n [MuscleGroup.FOREARMS]: ['forearm'],\n [MuscleGroup.QUADS]: ['quadriceps'],\n [MuscleGroup.HAMSTRINGS]: ['hamstring'],\n [MuscleGroup.GLUTES]: ['gluteal'],\n [MuscleGroup.CALVES]: ['calves'],\n [MuscleGroup.ABS]: ['abs'],\n [MuscleGroup.OBLIQUES]: ['obliques'],\n}\n\n/** Human-readable name per muscle group (used in a11y labels). */\nexport const MUSCLE_DISPLAY_NAMES: Record<MuscleGroup, string> = {\n [MuscleGroup.CHEST]: 'Chest',\n [MuscleGroup.FRONT_DELTS]: 'Front Delts',\n [MuscleGroup.SIDE_DELTS]: 'Side Delts',\n [MuscleGroup.REAR_DELTS]: 'Rear Delts',\n [MuscleGroup.TRICEPS]: 'Triceps',\n [MuscleGroup.LATS]: 'Lats',\n [MuscleGroup.UPPER_BACK]: 'Upper Back',\n [MuscleGroup.BICEPS]: 'Biceps',\n [MuscleGroup.FOREARMS]: 'Forearms',\n [MuscleGroup.QUADS]: 'Quads',\n [MuscleGroup.HAMSTRINGS]: 'Hamstrings',\n [MuscleGroup.GLUTES]: 'Glutes',\n [MuscleGroup.CALVES]: 'Calves',\n [MuscleGroup.ABS]: 'Abs',\n [MuscleGroup.OBLIQUES]: 'Obliques',\n}\n\n/** Human-readable name per simple group. */\nexport const SIMPLE_DISPLAY_NAMES: Record<SimpleMuscleGroup, string> = {\n [SimpleMuscleGroup.CHEST]: 'Chest',\n [SimpleMuscleGroup.BACK]: 'Back',\n [SimpleMuscleGroup.SHOULDERS]: 'Shoulders',\n [SimpleMuscleGroup.BICEPS]: 'Biceps',\n [SimpleMuscleGroup.TRICEPS]: 'Triceps',\n [SimpleMuscleGroup.LEGS]: 'Legs',\n [SimpleMuscleGroup.CORE]: 'Core',\n [SimpleMuscleGroup.FOREARMS]: 'Forearms',\n}\n\n/** Volume landmarks per muscle group (weekly working sets). */\nexport interface VolumeLandmarks {\n mev: number // Minimum Effective Volume\n mav: number // Maximum Adaptive Volume\n mrv: number // Maximum Recoverable Volume\n}\n\nexport const DEFAULT_VOLUME_LANDMARKS: Record<MuscleGroup, VolumeLandmarks> = {\n [MuscleGroup.CHEST]: { mev: 8, mav: 14, mrv: 20 },\n [MuscleGroup.LATS]: { mev: 8, mav: 14, mrv: 20 },\n [MuscleGroup.UPPER_BACK]: { mev: 6, mav: 12, mrv: 18 },\n [MuscleGroup.FRONT_DELTS]: { mev: 2, mav: 6, mrv: 10 },\n [MuscleGroup.SIDE_DELTS]: { mev: 6, mav: 14, mrv: 22 },\n [MuscleGroup.REAR_DELTS]: { mev: 6, mav: 12, mrv: 18 },\n [MuscleGroup.BICEPS]: { mev: 4, mav: 10, mrv: 18 },\n [MuscleGroup.TRICEPS]: { mev: 4, mav: 8, mrv: 14 },\n [MuscleGroup.FOREARMS]: { mev: 2, mav: 6, mrv: 12 },\n [MuscleGroup.QUADS]: { mev: 6, mav: 12, mrv: 18 },\n [MuscleGroup.HAMSTRINGS]: { mev: 4, mav: 10, mrv: 16 },\n [MuscleGroup.GLUTES]: { mev: 4, mav: 10, mrv: 16 },\n [MuscleGroup.CALVES]: { mev: 6, mav: 10, mrv: 16 },\n [MuscleGroup.ABS]: { mev: 0, mav: 8, mrv: 16 },\n [MuscleGroup.OBLIQUES]: { mev: 0, mav: 6, mrv: 12 },\n}\n\n/** Weekly-volume status relative to MEV/MAV/MRV landmarks. */\nexport type VolumeStatus = 'under' | 'maintenance' | 'productive' | 'over'\n\n/** Readable label per status for a11y descriptions. */\nexport const VOLUME_STATUS_LABELS: Record<VolumeStatus, string> = {\n under: 'under-trained',\n maintenance: 'maintenance',\n productive: 'productive',\n over: 'over-reaching',\n}\n\n/** Severity ranking — higher wins when several groups share an SVG slug. */\nconst STATUS_SEVERITY: Record<VolumeStatus, number> = {\n under: 1,\n maintenance: 2,\n productive: 3,\n over: 4,\n}\n\n/**\n * Maps a volume status (and intensity, 0-1) to a heatmap fill color. The\n * `approaching` token is used when a productive muscle nears its MRV.\n */\nexport function getHeatmapColor(status: VolumeStatus | null | undefined, intensity = 0): string {\n const heatmap = WORKOUT_TOKENS.heatmap\n switch (status) {\n case 'under':\n return heatmap.under\n case 'maintenance':\n return heatmap.maintenance\n case 'productive':\n return intensity >= 0.85 ? heatmap.approaching : heatmap.productive\n case 'over':\n return heatmap.over\n default:\n return heatmap.none\n }\n}\n\n/** True when one status is at least as severe as another. */\nexport function isMoreSevere(a: VolumeStatus, b: VolumeStatus): boolean {\n return STATUS_SEVERITY[a] >= STATUS_SEVERITY[b]\n}\n\n/**\n * Representative MuscleGroup for each SVG slug, used to resolve taps on shared\n * paths (e.g. `deltoids`, `upper-back`) back to a single group.\n */\nexport const SLUG_TO_PRIMARY_MUSCLE: Record<string, MuscleGroup> = {\n chest: MuscleGroup.CHEST,\n deltoids: MuscleGroup.SIDE_DELTS,\n triceps: MuscleGroup.TRICEPS,\n 'upper-back': MuscleGroup.LATS,\n trapezius: MuscleGroup.UPPER_BACK,\n biceps: MuscleGroup.BICEPS,\n forearm: MuscleGroup.FOREARMS,\n quadriceps: MuscleGroup.QUADS,\n hamstring: MuscleGroup.HAMSTRINGS,\n gluteal: MuscleGroup.GLUTES,\n calves: MuscleGroup.CALVES,\n abs: MuscleGroup.ABS,\n obliques: MuscleGroup.OBLIQUES,\n}\n","/**\n * Custom JSX runtime for titan-design's web distribution.\n *\n * Converts className props to $$css style objects at build time,\n * eliminating the need for NativeWind's runtime interopComponents\n * Map lookup. RNW's styleq recognizes $$css objects and applies\n * their values as CSS class names on DOM elements.\n *\n * This file is NOT used by source builds (specimen, storybook,\n * native Metro). It is only inlined into the dist by tsup via\n * an esbuild onResolve plugin.\n */\nimport {\n jsx as reactJsx,\n jsxs as reactJsxs,\n Fragment,\n} from 'react/jsx-runtime'\nimport type { StyleProp } from 'react-native'\n\ntype JsxFn = typeof reactJsx\n\nfunction wrapJsx(fn: JsxFn): JsxFn {\n return function (type, props: Record<string, any>, ...rest) {\n if (props && typeof props.className === 'string' && props.className) {\n const cn = props.className\n const cssStyle = { $$css: true, [cn]: cn } as unknown as StyleProp<any>\n const existing = props.style\n props = {\n ...props,\n style: existing ? [cssStyle, existing] : cssStyle,\n }\n delete props.className\n }\n return fn(type, props, ...rest)\n } as JsxFn\n}\n\nconst jsx = wrapJsx(reactJsx)\nconst jsxs = wrapJsx(reactJsxs)\n\nexport { jsx, jsxs, Fragment }\n","// Font mapping: font-heading=Space Grotesk, font-body=Nunito Sans (UI), font-sans=Inter (body)\nimport { useEffect, useMemo, useState } from 'react'\nimport { View, Text, Pressable, Animated, Easing, type ViewProps } from 'react-native'\nimport BodyHighlighter, { type ExtendedBodyPart, type Slug } from 'react-native-body-highlighter'\nimport { cn } from '../../../utils/cn'\nimport { resolveColor } from '../../../theme/resolve-color'\nimport { getSemanticColors } from '../../../theme/tokens/semantic'\nimport {\n MuscleGroup,\n SimpleMuscleGroup,\n MUSCLE_TO_SVG_SLUGS,\n MUSCLE_DISPLAY_NAMES,\n SIMPLE_DISPLAY_NAMES,\n DETAILED_TO_SIMPLE,\n SLUG_TO_PRIMARY_MUSCLE,\n VOLUME_STATUS_LABELS,\n getHeatmapColor,\n isMoreSevere,\n type VolumeStatus,\n} from './muscleTaxonomy'\n\n/**\n * react-native-body-highlighter is published as a CommonJS default export; the\n * interop keeps it working whether the bundler unwraps the default or not.\n */\nconst Body = ((BodyHighlighter as unknown as { default?: typeof BodyHighlighter }).default ??\n BodyHighlighter) as typeof BodyHighlighter\n\nconst BRAND_PRIMARY = getSemanticColors('dark')['brand-primary']\n\nconst OUTLINE_FILL = 'rgba(255,255,255,0.08)'\nconst OUTLINE_BORDER = 'rgba(255,255,255,0.12)'\nconst BODY_SCALE = 0.8 // 200x400 intrinsic -> ~160x320 px\n\nexport interface BodyMapData {\n muscleGroup: MuscleGroup\n /** Intensity 0-1 for heatmap color. */\n intensity: number\n /** Volume status for tooltip / heatmap token. */\n volumeStatus: VolumeStatus\n /** Weekly effective sets. */\n weeklySets: number\n}\n\nexport interface BodyMapProps extends ViewProps {\n /** Muscle group intensity data. */\n data: BodyMapData[]\n /** Which view to show. */\n view: 'front' | 'back'\n /** Toggle between front/back. */\n onViewChange?: (view: 'front' | 'back') => void\n /** Called when a muscle group is tapped. */\n onMusclePress?: (muscleGroup: MuscleGroup) => void\n /** Currently highlighted muscle (from external selection). */\n highlightedMuscle?: MuscleGroup | null\n /** Show simplified (8 groups) or detailed (15 groups). */\n mode?: 'simple' | 'detailed'\n className?: string\n}\n\ninterface LegendEntry {\n key: string\n name: string\n status: VolumeStatus\n intensity: number\n sets: number\n /** Detailed group reported to onMusclePress. */\n muscle: MuscleGroup\n}\n\n/** Build the per-slug heatmap fill list, combining groups that share a slug. */\nfunction buildSlugParts(data: BodyMapData[]): ExtendedBodyPart[] {\n const bySlug = new Map<string, { status: VolumeStatus; intensity: number }>()\n for (const d of data) {\n for (const slug of MUSCLE_TO_SVG_SLUGS[d.muscleGroup] ?? []) {\n const existing = bySlug.get(slug)\n if (!existing || isMoreSevere(d.volumeStatus, existing.status)) {\n bySlug.set(slug, { status: d.volumeStatus, intensity: d.intensity })\n }\n }\n }\n return Array.from(bySlug.entries()).map(([slug, v]) => ({\n slug: slug as Slug,\n color: getHeatmapColor(v.status, v.intensity),\n }))\n}\n\n/** Collapse data into per-simple-group legend entries (summed sets). */\nfunction buildSimpleLegend(data: BodyMapData[]): LegendEntry[] {\n const bySimple = new Map<SimpleMuscleGroup, LegendEntry>()\n for (const d of data) {\n const simple = DETAILED_TO_SIMPLE[d.muscleGroup]\n const existing = bySimple.get(simple)\n if (!existing) {\n bySimple.set(simple, {\n key: simple,\n name: SIMPLE_DISPLAY_NAMES[simple],\n status: d.volumeStatus,\n intensity: d.intensity,\n sets: d.weeklySets,\n muscle: d.muscleGroup,\n })\n continue\n }\n existing.sets += d.weeklySets\n existing.intensity = Math.max(existing.intensity, d.intensity)\n if (isMoreSevere(d.volumeStatus, existing.status)) {\n existing.status = d.volumeStatus\n existing.muscle = d.muscleGroup\n }\n }\n return Array.from(bySimple.values())\n}\n\n/** One legend entry per data row, named by detailed group. */\nfunction buildDetailedLegend(data: BodyMapData[]): LegendEntry[] {\n return data.map((d) => ({\n key: d.muscleGroup,\n name: MUSCLE_DISPLAY_NAMES[d.muscleGroup],\n status: d.volumeStatus,\n intensity: d.intensity,\n sets: d.weeklySets,\n muscle: d.muscleGroup,\n }))\n}\n\n/**\n * Interactive SVG body map with tappable muscle groups and a volume heatmap.\n * Renders the front or back view (toggle via onViewChange), colors each muscle\n * by its weekly-volume status, and exposes an accessible muscle legend wired to\n * onMusclePress. Phase 1 uses react-native-body-highlighter's combined slugs\n * (deltoids as one path, lats/upper-back shared); swipe between views and the\n * delt/lat SVG split are follow-ups.\n *\n * @example\n * <BodyMap\n * data={[{ muscleGroup: MuscleGroup.CHEST, intensity: 0.7, volumeStatus: 'productive', weeklySets: 12 }]}\n * view=\"front\"\n * onViewChange={setView}\n * onMusclePress={setSelected}\n * highlightedMuscle={selected}\n * />\n */\nexport function BodyMap({\n data,\n view,\n onViewChange,\n onMusclePress,\n highlightedMuscle,\n mode = 'detailed',\n className,\n ...props\n}: BodyMapProps) {\n const slugParts = useMemo(() => buildSlugParts(data), [data])\n const legend = useMemo(\n () => (mode === 'simple' ? buildSimpleLegend(data) : buildDetailedLegend(data)),\n [data, mode]\n )\n\n const [highlight] = useState(() => new Animated.Value(highlightedMuscle ? 1 : 0))\n useEffect(() => {\n const animation = Animated.timing(highlight, {\n toValue: highlightedMuscle ? 1 : 0,\n duration: 250,\n easing: Easing.out(Easing.ease),\n useNativeDriver: false,\n })\n animation.start()\n return () => animation.stop()\n }, [highlightedMuscle, highlight])\n\n const scale = highlight.interpolate({ inputRange: [0, 1], outputRange: [1, 1.02] })\n const glowColor = highlightedMuscle\n ? getHeatmapColor(\n data.find((d) => d.muscleGroup === highlightedMuscle)?.volumeStatus,\n data.find((d) => d.muscleGroup === highlightedMuscle)?.intensity ?? 0\n )\n : null\n\n const handleBodyPress = (part: ExtendedBodyPart) => {\n if (!onMusclePress || !part.slug) return\n const fromData = data.find((d) =>\n (MUSCLE_TO_SVG_SLUGS[d.muscleGroup] ?? []).includes(part.slug as string)\n )\n const muscle = fromData?.muscleGroup ?? SLUG_TO_PRIMARY_MUSCLE[part.slug]\n if (muscle) onMusclePress(muscle)\n }\n\n return (\n <View className={cn(className)} testID=\"body-map\" {...props}>\n <ViewToggle view={view} onViewChange={onViewChange} />\n\n <Animated.View\n style={[\n {\n width: 200 * BODY_SCALE,\n alignSelf: 'center',\n transform: [{ scale }],\n },\n glowColor ? { boxShadow: `0 0 14px 2px ${glowColor}` } : undefined,\n ]}\n // The SVG is decorative; the accessible muscle legend below is the\n // screen-reader / keyboard interface.\n aria-hidden\n accessibilityElementsHidden\n importantForAccessibility=\"no-hide-descendants\"\n testID=\"body-map-svg\"\n >\n <Body\n side={view}\n data={slugParts}\n scale={BODY_SCALE}\n gender=\"male\"\n defaultFill={OUTLINE_FILL}\n border={OUTLINE_BORDER}\n onBodyPartPress={handleBodyPress}\n />\n </Animated.View>\n\n {legend.length === 0 ? (\n <Text\n className=\"text-text-secondary\"\n style={{\n marginTop: 8,\n fontSize: 12,\n textAlign: 'center',\n fontFamily: 'Inter, sans-serif',\n }}\n testID=\"body-map-empty\"\n >\n No training data\n </Text>\n ) : (\n <View\n className=\"flex-row flex-wrap\"\n style={{ marginTop: 10, gap: 6, justifyContent: 'center' }}\n testID=\"body-map-legend\"\n >\n {legend.map((entry) => (\n <MuscleButton\n key={entry.key}\n entry={entry}\n highlighted={highlightedMuscle === entry.muscle}\n onMusclePress={onMusclePress}\n />\n ))}\n </View>\n )}\n </View>\n )\n}\n\ninterface ViewToggleProps {\n view: 'front' | 'back'\n onViewChange?: (view: 'front' | 'back') => void\n}\n\nfunction ViewToggle({ view, onViewChange }: ViewToggleProps) {\n return (\n <View\n className=\"flex-row self-center\"\n style={{ gap: 4, marginBottom: 8 }}\n testID=\"body-map-view-toggle\"\n >\n {(['front', 'back'] as const).map((side) => {\n const active = view === side\n return (\n <Pressable\n key={side}\n onPress={() => onViewChange?.(side)}\n accessibilityRole=\"button\"\n accessibilityLabel={`Show ${side} view`}\n aria-pressed={active}\n disabled={!onViewChange}\n style={{\n paddingHorizontal: 12,\n paddingVertical: 4,\n borderRadius: 9999,\n backgroundColor: active ? 'rgba(255,121,0,0.16)' : 'transparent',\n borderWidth: 1,\n borderColor: active ? BRAND_PRIMARY : resolveColor('hairline-strong'),\n }}\n testID={`body-map-toggle-${side}`}\n >\n <Text\n style={{\n fontSize: 12,\n fontFamily: 'Inter, sans-serif',\n fontWeight: active ? '700' : '500',\n color: active ? BRAND_PRIMARY : resolveColor('text-secondary'),\n textTransform: 'capitalize',\n }}\n >\n {side}\n </Text>\n </Pressable>\n )\n })}\n </View>\n )\n}\n\ninterface MuscleButtonProps {\n entry: LegendEntry\n highlighted: boolean\n onMusclePress?: (muscleGroup: MuscleGroup) => void\n}\n\nfunction MuscleButton({ entry, highlighted, onMusclePress }: MuscleButtonProps) {\n const dotColor = getHeatmapColor(entry.status, entry.intensity)\n const label = `${entry.name}, ${VOLUME_STATUS_LABELS[entry.status]}, ${entry.sets} sets this week`\n return (\n <Pressable\n onPress={() => onMusclePress?.(entry.muscle)}\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n aria-pressed={highlighted}\n className=\"bg-surface-raised\"\n style={{\n flexDirection: 'row',\n alignItems: 'center',\n gap: 5,\n paddingHorizontal: 8,\n paddingVertical: 3,\n borderRadius: 9999,\n borderWidth: 1,\n borderColor: highlighted ? BRAND_PRIMARY : resolveColor('hairline-default'),\n }}\n testID={`body-map-muscle-${entry.key}`}\n >\n <View\n style={{ width: 7, height: 7, borderRadius: 9999, backgroundColor: dotColor }}\n accessibilityElementsHidden\n testID={`body-map-muscle-dot-${entry.key}`}\n />\n <Text\n className=\"text-text-primary\"\n style={{\n fontSize: 11,\n fontFamily: 'Inter, sans-serif',\n fontWeight: '500',\n }}\n accessibilityElementsHidden\n >\n {entry.name}\n </Text>\n </Pressable>\n )\n}\n","import { View, type ViewProps } from 'react-native'\nimport { cn } from '../../../utils/cn'\n\nexport type IndicatorSize = 'xs' | 'sm' | 'md' | 'lg'\nexport type IndicatorColor =\n | 'default'\n | 'primary'\n | 'success'\n | 'live'\n | 'error'\n | 'warning'\n | 'info'\n | 'error-vivid'\n\n/** How a pulsing indicator animates: a subtle opacity fade, or an expanding ring. */\nexport type IndicatorPulse = 'opacity' | 'ping'\n\nexport interface IndicatorProps extends ViewProps {\n /** Dot size */\n size?: IndicatorSize\n /** Semantic color */\n color?: IndicatorColor\n /** Custom hex color (overrides color prop) */\n customColor?: string\n /** Add a glow shadow effect */\n glow?: boolean\n /** Add a ring border */\n ring?: boolean\n /** Animate for live/active status. `true` = opacity fade; `'ping'` = expanding ring. */\n pulse?: boolean | IndicatorPulse\n /** Additional className */\n className?: string\n}\n\nconst sizeStyles: Record<IndicatorSize, string> = {\n xs: 'w-1 h-1',\n sm: 'w-1.5 h-1.5',\n md: 'w-2 h-2',\n lg: 'w-2.5 h-2.5',\n}\n\nconst colorStyles: Record<IndicatorColor, string> = {\n default: 'bg-text-tertiary',\n primary: 'bg-brand-primary',\n success: 'bg-status-success',\n live: 'bg-status-live',\n error: 'bg-status-error',\n warning: 'bg-status-warning',\n info: 'bg-status-info',\n 'error-vivid': 'bg-status-error-vivid',\n}\n\nexport function Indicator({\n size = 'sm',\n color = 'default',\n customColor,\n glow = false,\n ring = false,\n pulse = false,\n className,\n style,\n ...props\n}: IndicatorProps) {\n const pulseMode: IndicatorPulse | false = pulse === true ? 'opacity' : pulse || false\n const colorClass = !customColor ? colorStyles[color] : undefined\n const colorStyle = customColor ? { backgroundColor: customColor } : undefined\n\n // Expanding-ring pulse: a ping layer behind the solid dot (for live/active status).\n if (pulseMode === 'ping') {\n return (\n <View className={cn('relative', sizeStyles[size], className)} style={style} {...props}>\n <View\n className={cn('absolute inset-0 rounded-full animate-ping', colorClass)}\n style={colorStyle}\n />\n <View\n className={cn(\n 'relative rounded-full',\n sizeStyles[size],\n colorClass,\n ring && 'border-2 border-background-base'\n )}\n style={colorStyle}\n />\n </View>\n )\n }\n\n const dynamicStyle = {\n ...(typeof style === 'object' ? style : {}),\n ...(colorStyle ?? {}),\n ...(glow && customColor ? { boxShadow: `0 0 6px ${customColor}` } : {}),\n }\n\n return (\n <View\n className={cn(\n 'rounded-full shrink-0',\n sizeStyles[size],\n colorClass,\n pulseMode === 'opacity' && 'animate-pulse',\n ring && 'border-2 border-background-base',\n glow &&\n !customColor &&\n (color === 'success' || color === 'live') &&\n 'shadow-[0_0_6px_rgba(46,213,115,0.6)]',\n glow && !customColor && color === 'error' && 'shadow-[0_0_6px_rgba(239,68,68,0.6)]',\n glow && !customColor && color === 'warning' && 'shadow-[0_0_6px_rgba(245,158,11,0.6)]',\n glow && !customColor && color === 'primary' && 'shadow-[0_0_6px_rgba(255,121,0,0.6)]',\n glow && !customColor && color === 'error-vivid' && 'shadow-[0_0_6px_rgba(255,71,87,0.6)]',\n className\n )}\n style={Object.keys(dynamicStyle).length > 0 ? dynamicStyle : style}\n {...props}\n />\n )\n}\n","import React from 'react'\nimport { View, Text, type ViewProps } from 'react-native'\nimport { cn } from '../../../utils/cn'\nimport { Indicator, type IndicatorColor } from '../indicator'\n\nexport type BadgeVariant = 'solid' | 'subtle' | 'outline'\nexport type BadgeColor = 'default' | 'primary' | 'secondary' | 'success' | 'error' | 'warning' | 'info'\nexport type BadgeSize = 'sm' | 'md' | 'lg'\n\nexport interface BadgeProps extends ViewProps {\n /** Visual variant */\n variant?: BadgeVariant\n /** Color scheme */\n color?: BadgeColor\n /** Size */\n size?: BadgeSize\n /** Show a leading indicator dot */\n dot?: boolean\n /** Color for the dot indicator (defaults to match badge color) */\n dotColor?: IndicatorColor\n /** Additional className */\n className?: string\n children?: React.ReactNode\n}\n\nconst variantColorStyles: Record<BadgeVariant, Record<BadgeColor, string>> = {\n solid: {\n default: 'bg-hairline-strong text-text-inverse',\n primary: 'bg-brand-primary text-text-inverse',\n secondary: 'bg-brand-secondary text-text-inverse',\n success: 'bg-status-success text-text-inverse',\n error: 'bg-status-error text-text-inverse',\n warning: 'bg-status-warning text-text-inverse',\n info: 'bg-status-info text-text-inverse',\n },\n subtle: {\n default: 'bg-surface-raised text-text-secondary',\n primary: 'bg-brand-primary-subtle text-brand-primary',\n secondary: 'bg-brand-secondary-subtle text-brand-secondary',\n success: 'bg-status-success-subtle text-status-success',\n error: 'bg-status-error-subtle text-status-error',\n warning: 'bg-status-warning-subtle text-status-warning',\n info: 'bg-status-info-subtle text-status-info',\n },\n outline: {\n default: 'border border-hairline-strong text-text-secondary',\n primary: 'border border-brand-primary text-brand-primary',\n secondary: 'border border-brand-secondary text-brand-secondary',\n success: 'border border-status-success text-status-success',\n error: 'border border-status-error text-status-error',\n warning: 'border border-status-warning text-status-warning',\n info: 'border border-status-info text-status-info',\n },\n}\n\nconst sizeStyles: Record<BadgeSize, string> = {\n sm: 'px-1.5 py-0.5 text-xs',\n md: 'px-2 py-0.5 text-xs',\n lg: 'px-2.5 py-1 text-sm',\n}\n\n/**\n * Badge component for status indicators and labels.\n *\n * @example\n * <Badge color=\"success\">Active</Badge>\n * <Badge variant=\"outline\" color=\"warning\">Pending</Badge>\n */\nexport function Badge({\n variant = 'subtle',\n color = 'default',\n size = 'md',\n dot,\n dotColor,\n className,\n children,\n ...props\n}: BadgeProps) {\n return (\n <View\n className={cn(\n 'inline-flex items-center justify-center rounded-full font-medium',\n variantColorStyles[variant][color],\n sizeStyles[size],\n className\n )}\n {...props}\n >\n {dot && (\n <Indicator\n size=\"xs\"\n color={dotColor ?? (color === 'default' || color === 'secondary' ? 'default' : color as IndicatorColor)}\n className=\"mr-0.5\"\n />\n )}\n {typeof children === 'string' ? (\n <Text className=\"text-inherit font-medium\">{children}</Text>\n ) : (\n children\n )}\n </View>\n )\n}\n\nexport interface BadgeTextProps {\n children: React.ReactNode\n className?: string\n}\n\n/**\n * Text component for Badge content.\n */\nexport function BadgeText({ children, className }: BadgeTextProps) {\n return (\n <Text className={cn('text-inherit font-medium', className)}>\n {children}\n </Text>\n )\n}\n","// Font mapping: font-heading=Space Grotesk, font-body=Nunito Sans (UI), font-sans=Inter (body)\nimport React from 'react'\nimport { View, Text, type ViewProps } from 'react-native'\nimport { cn } from '../../../utils/cn'\nimport { getSemanticColors } from '../../../theme/tokens/semantic'\n\nconst BRAND_PRIMARY = getSemanticColors('dark')['brand-primary']\n\nexport interface SparklineProps extends ViewProps {\n data: number[]\n width?: number\n height?: number\n color?: string\n showDots?: boolean\n referenceLines?: Array<{\n value: number\n color: string\n dashed?: boolean\n label?: string\n }>\n highlightLast?: boolean\n className?: string\n}\n\nfunction normalizeData(\n data: number[],\n height: number,\n): number[] {\n if (data.length === 0) return []\n const min = Math.min(...data)\n const max = Math.max(...data)\n const range = max - min || 1\n return data.map((v) => height - ((v - min) / range) * height)\n}\n\nfunction normalizeValue(\n value: number,\n data: number[],\n height: number,\n): number {\n const min = Math.min(...data)\n const max = Math.max(...data)\n const range = max - min || 1\n return height - ((value - min) / range) * height\n}\n\nexport function Sparkline({\n data,\n width = 80,\n height = 30,\n color,\n showDots = false,\n referenceLines,\n highlightLast = false,\n className,\n ...props\n}: SparklineProps) {\n if (data.length === 0) {\n return (\n <View\n style={{ width, height }}\n className={className}\n testID=\"sparkline-empty\"\n accessibilityLabel=\"Sparkline chart, no data\"\n {...props}\n />\n )\n }\n\n const resolvedColor = color ?? BRAND_PRIMARY\n const normalized = normalizeData(data, height)\n const stepX = data.length > 1 ? width / (data.length - 1) : 0\n\n const dotSize = 3\n const highlightSize = 6\n\n return (\n <View\n style={{ width, height, position: 'relative' }}\n className={cn(className)}\n accessibilityRole=\"image\"\n accessibilityLabel={`Sparkline chart with ${data.length} data points`}\n testID=\"sparkline\"\n {...props}\n >\n {referenceLines?.map((line, i) => {\n const y = normalizeValue(line.value, data, height)\n return (\n <View\n key={`ref-${i}`}\n style={[\n {\n position: 'absolute',\n top: y,\n left: 0,\n right: 0,\n opacity: 0.6,\n },\n line.dashed\n ? {\n height: 0,\n borderStyle: 'dashed',\n borderTopWidth: 1,\n borderTopColor: line.color,\n }\n : {\n height: 1,\n backgroundColor: line.color,\n },\n ]}\n accessibilityElementsHidden\n testID={`sparkline-reference-${i}`}\n >\n {line.label && (\n <Text\n style={{\n position: 'absolute',\n right: 0,\n top: -10,\n fontSize: 7,\n color: line.color,\n opacity: 1,\n }}\n testID={`sparkline-reference-label-${i}`}\n >\n {line.label}\n </Text>\n )}\n </View>\n )\n })}\n\n {/* Line segments connecting data points */}\n {normalized.map((y, i) => {\n if (i === 0) return null\n const prevY = normalized[i - 1]\n const x1 = (i - 1) * stepX\n const x2 = i * stepX\n const dx = x2 - x1\n const dy = y - prevY\n const length = Math.sqrt(dx * dx + dy * dy)\n const angle = Math.atan2(dy, dx) * (180 / Math.PI)\n return (\n <View\n key={`line-${i}`}\n style={{\n position: 'absolute',\n left: x1,\n top: prevY,\n width: length,\n height: 1.5,\n backgroundColor: resolvedColor,\n transformOrigin: '0 0',\n transform: [{ rotate: `${angle}deg` }],\n }}\n accessibilityElementsHidden\n testID={`sparkline-segment-${i}`}\n />\n )\n })}\n\n {/* Data point dots */}\n {(showDots || highlightLast) &&\n normalized.map((y, i) => {\n const isLast = i === data.length - 1\n const shouldShow = showDots || (highlightLast && isLast)\n if (!shouldShow) return null\n\n const size = highlightLast && isLast ? highlightSize : dotSize\n return (\n <View\n key={`dot-${i}`}\n style={{\n position: 'absolute',\n left: i * stepX - size / 2,\n top: y - size / 2,\n width: size,\n height: size,\n borderRadius: size / 2,\n backgroundColor: resolvedColor,\n }}\n accessibilityElementsHidden\n testID={`sparkline-dot-${i}`}\n />\n )\n })}\n </View>\n )\n}\n","// Font mapping: font-heading=Space Grotesk, font-body=Nunito Sans (UI), font-sans=Inter (body)\nimport { useEffect, useState } from 'react'\nimport {\n View,\n Text,\n Pressable,\n ScrollView,\n Animated,\n Easing,\n type ViewProps,\n type ViewStyle,\n} from 'react-native'\nimport { Badge, type BadgeColor } from '../../ui/badge'\nimport { Sparkline } from './Sparkline'\nimport {\n MuscleGroup,\n VOLUME_STATUS_LABELS,\n type VolumeLandmarks,\n type VolumeStatus,\n} from './muscleTaxonomy'\nimport { getSemanticColors } from '../../../theme/tokens/semantic'\n\nconst t = getSemanticColors('dark')\n\nconst BRAND_PRIMARY = t['brand-primary']\n\n/** Volume track gradient: status-info -> status-success -> status-error. */\nconst VOLUME_GRADIENT = `linear-gradient(90deg, ${t['status-info']} 0%, ${t['status-success']} 50%, ${t['status-error']} 100%)`\n\n/** Sheet slides up from this offset (px) and the backdrop fades to this opacity. */\nconst SLIDE_OFFSET = 400\nconst BACKDROP_OPACITY = 0.4\n\n/** Volume status -> Badge color scheme. */\nconst STATUS_BADGE_COLOR: Record<VolumeStatus, BadgeColor> = {\n under: 'info',\n maintenance: 'warning',\n productive: 'success',\n over: 'error',\n}\n\nexport interface ContributingExercise {\n /** Exercise name. */\n name: string\n /** Working sets contributed this week. */\n sets: number\n /** Effective-set multiplier toward this muscle (0-1). */\n contributionWeight: number\n}\n\nexport interface UpcomingExercise {\n /** Exercise name. */\n name: string\n /** Workout the exercise belongs to. */\n workoutName: string\n /** Planned sets. */\n sets: number\n}\n\nexport interface BodyMapDetailPanelProps extends ViewProps {\n /** Muscle group whose volume detail is shown. */\n muscleGroup: MuscleGroup\n /** Human-readable muscle name for the title and a11y label. */\n displayName: string\n /** Weekly effective sets logged for this muscle. */\n weeklySets: number\n /** Volume landmarks (weekly working sets). */\n landmarks: VolumeLandmarks\n /** Weekly-volume status relative to the landmarks. */\n volumeStatus: VolumeStatus\n /** Last trained label, e.g. \"2 days ago\". */\n lastTrained?: string\n /** Volume sparkline data (last 4-8 weeks). */\n weeklyHistory?: number[]\n /** Exercises contributing to this muscle's volume. */\n contributingExercises?: ContributingExercise[]\n /** Upcoming exercises targeting this muscle. */\n upcomingExercises?: UpcomingExercise[]\n /** Whether the bottom sheet is visible. */\n isOpen?: boolean\n /** Alias for `isOpen` (spec wording: \"isOpen/visible\"). `isOpen` wins when both are set. */\n visible?: boolean\n /** Dismiss the panel (backdrop, handle, or close button). */\n onClose: () => void\n /** Navigate to a filtered exercise list. */\n onViewExercises?: () => void\n}\n\nfunction clamp01(value: number): number {\n if (value < 0) return 0\n if (value > 1) return 1\n return value\n}\n\n/** Marker position (0-1) of current sets between MEV (left) and MRV (right). */\nfunction markerFraction(weeklySets: number, { mev, mrv }: VolumeLandmarks): number {\n const span = mrv - mev\n if (span <= 0) return weeklySets >= mrv ? 1 : 0\n return clamp01((weeklySets - mev) / span)\n}\n\n/**\n * Slide-up bottom-sheet panel with detailed weekly-volume info for a tapped\n * muscle group: a MEV|current|MRV gradient progress bar, the big weekly set\n * count against MRV, an optional volume sparkline, and the contributing /\n * upcoming exercise lists. Composes the titan `Badge` and Workout `Sparkline`.\n *\n * Controlled via `isOpen` (or the `visible` alias); renders nothing when closed\n * and animates in on open — sheet translateY 400->0 (400ms ease-out) and a\n * backdrop fade 0->0.4 (RN Animated, useNativeDriver:false). Backdrop, handle,\n * and the header close button all call `onClose`.\n *\n * @example\n * <BodyMapDetailPanel\n * muscleGroup={MuscleGroup.CHEST}\n * displayName=\"Chest\"\n * weeklySets={14}\n * landmarks={{ mev: 8, mav: 14, mrv: 20 }}\n * volumeStatus=\"productive\"\n * lastTrained=\"2 days ago\"\n * weeklyHistory={[8, 10, 12, 14]}\n * isOpen={open}\n * onClose={() => setOpen(false)}\n * />\n */\nexport function BodyMapDetailPanel({\n muscleGroup,\n displayName,\n weeklySets,\n landmarks,\n volumeStatus,\n lastTrained,\n weeklyHistory,\n contributingExercises,\n upcomingExercises,\n isOpen,\n visible,\n onClose,\n onViewExercises,\n ...props\n}: BodyMapDetailPanelProps) {\n const open = isOpen ?? visible ?? false\n\n const [translateY] = useState(() => new Animated.Value(SLIDE_OFFSET))\n const [backdrop] = useState(() => new Animated.Value(0))\n\n useEffect(() => {\n if (!open) return\n const animation = Animated.parallel([\n Animated.timing(translateY, {\n toValue: 0,\n duration: 400,\n easing: Easing.out(Easing.ease),\n useNativeDriver: false,\n }),\n Animated.timing(backdrop, {\n toValue: BACKDROP_OPACITY,\n duration: 300,\n easing: Easing.out(Easing.ease),\n useNativeDriver: false,\n }),\n ])\n animation.start()\n return () => animation.stop()\n }, [open, translateY, backdrop])\n\n if (!open) return null\n\n const dialogLabel = `${displayName} volume details`\n const markerLeft = markerFraction(weeklySets, landmarks) * 100\n const hasContributing = (contributingExercises?.length ?? 0) > 0\n const hasUpcoming = (upcomingExercises?.length ?? 0) > 0\n\n return (\n <View\n style={{ position: 'absolute', top: 0, left: 0, right: 0, bottom: 0, justifyContent: 'flex-end' }}\n testID=\"body-map-detail-panel-root\"\n >\n <Animated.View\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: '#000000',\n opacity: backdrop,\n }}\n testID=\"body-map-detail-panel-backdrop-anim\"\n >\n <Pressable\n onPress={onClose}\n accessibilityRole=\"button\"\n accessibilityLabel={`Close ${displayName} details`}\n style={{ flex: 1 }}\n testID=\"body-map-detail-panel-backdrop\"\n />\n </Animated.View>\n\n <Animated.View\n accessibilityRole={'dialog' as ViewProps['accessibilityRole']}\n accessibilityLabel={dialogLabel}\n aria-label={dialogLabel}\n className=\"bg-surface-elevated\"\n style={{\n borderTopLeftRadius: 16,\n borderTopRightRadius: 16,\n maxHeight: '88%',\n transform: [{ translateY }],\n }}\n testID=\"body-map-detail-panel\"\n {...props}\n >\n <Pressable\n onPress={onClose}\n accessibilityRole=\"button\"\n accessibilityLabel={`Close ${displayName} details`}\n hitSlop={12}\n style={{ alignSelf: 'center', paddingVertical: 8 }}\n testID=\"body-map-detail-panel-handle\"\n >\n <View\n className=\"bg-hairline-strong\"\n style={{ width: 40, height: 4, borderRadius: 2 }}\n accessibilityElementsHidden\n />\n </Pressable>\n\n <ScrollView\n style={{ paddingHorizontal: 16 }}\n contentContainerStyle={{ paddingBottom: 20 }}\n testID=\"body-map-detail-panel-scroll\"\n >\n <View\n className=\"flex-row items-center justify-between\"\n style={{ gap: 8, paddingTop: 4, paddingBottom: 4 }}\n testID=\"body-map-detail-panel-header\"\n >\n <View className=\"flex-row items-center\" style={{ gap: 8, flexShrink: 1 }}>\n <Text\n accessibilityRole=\"header\"\n className=\"text-text-primary\"\n style={{\n fontSize: 16,\n fontFamily: '\"Space Grotesk\", sans-serif',\n fontWeight: '700',\n }}\n testID=\"body-map-detail-panel-title\"\n >\n {displayName}\n </Text>\n <Badge\n variant=\"subtle\"\n color={STATUS_BADGE_COLOR[volumeStatus]}\n size=\"sm\"\n testID=\"body-map-detail-panel-status-badge\"\n >\n {VOLUME_STATUS_LABELS[volumeStatus]}\n </Badge>\n </View>\n <Pressable\n onPress={onClose}\n accessibilityRole=\"button\"\n accessibilityLabel={`Close ${displayName} details`}\n hitSlop={8}\n style={{ padding: 4, margin: -4 }}\n testID=\"body-map-detail-panel-close\"\n >\n <Text className=\"text-text-secondary\" style={{ fontSize: 22, lineHeight: 22 }}>{'×'}</Text>\n </Pressable>\n </View>\n\n {lastTrained != null && (\n <Text\n className=\"text-text-secondary\"\n style={{ fontSize: 12, fontFamily: 'Inter, sans-serif' }}\n testID=\"body-map-detail-panel-last-trained\"\n >\n {`Last trained ${lastTrained}`}\n </Text>\n )}\n\n <View style={{ marginTop: 16 }} testID=\"body-map-detail-panel-volume\">\n <View\n className=\"flex-row items-center justify-between\"\n style={{ marginBottom: 6 }}\n accessibilityElementsHidden\n >\n <Text className=\"text-text-tertiary\" style={{ fontSize: 10, fontFamily: 'Inter, sans-serif', fontWeight: '600' }}>\n {`MEV ${landmarks.mev}`}\n </Text>\n <Text className=\"text-text-tertiary\" style={{ fontSize: 10, fontFamily: 'Inter, sans-serif', fontWeight: '600' }}>\n {`MRV ${landmarks.mrv}`}\n </Text>\n </View>\n <View\n style={{ height: 14, justifyContent: 'center' }}\n accessibilityRole=\"progressbar\"\n accessibilityValue={{ min: landmarks.mev, max: landmarks.mrv, now: weeklySets }}\n accessibilityLabel={`${weeklySets} weekly sets, between MEV ${landmarks.mev} and MRV ${landmarks.mrv}`}\n aria-valuenow={weeklySets}\n aria-valuemin={landmarks.mev}\n aria-valuemax={landmarks.mrv}\n testID=\"body-map-detail-panel-volume-bar\"\n >\n <View\n style={{ height: 8, borderRadius: 4, backgroundImage: VOLUME_GRADIENT } as ViewStyle}\n accessibilityElementsHidden\n />\n <View\n className=\"border-text-primary bg-surface-elevated\"\n style={{\n position: 'absolute',\n left: `${markerLeft}%`,\n marginLeft: -7,\n width: 14,\n height: 14,\n borderRadius: 7,\n borderWidth: 2,\n boxShadow: '0 0 4px rgba(0,0,0,0.5)',\n }}\n accessibilityElementsHidden\n testID=\"body-map-detail-panel-volume-marker\"\n />\n </View>\n </View>\n\n <View className=\"flex-row items-baseline\" style={{ marginTop: 14, gap: 4 }}>\n <Text\n className=\"text-text-primary\"\n style={{\n fontSize: 24,\n fontFamily: '\"Space Grotesk\", sans-serif',\n fontWeight: '700',\n }}\n testID=\"body-map-detail-panel-set-count\"\n >\n {weeklySets}\n </Text>\n <Text\n className=\"text-text-secondary\"\n style={{ fontSize: 12, fontFamily: 'Inter, sans-serif' }}\n testID=\"body-map-detail-panel-mrv-suffix\"\n >\n {`/ ${landmarks.mrv} MRV`}\n </Text>\n </View>\n\n {weeklyHistory != null && weeklyHistory.length > 0 && (\n <View style={{ marginTop: 14 }} testID=\"body-map-detail-panel-sparkline\">\n <Text\n className=\"text-text-tertiary\"\n style={{\n fontSize: 10,\n fontFamily: 'Inter, sans-serif',\n fontWeight: '600',\n marginBottom: 6,\n }}\n accessibilityElementsHidden\n >\n {'VOLUME TREND'}\n </Text>\n <Sparkline data={weeklyHistory} width={80} height={30} highlightLast />\n </View>\n )}\n\n {hasContributing && (\n <View style={{ marginTop: 16 }} testID=\"body-map-detail-panel-contributing\">\n <Text\n className=\"text-text-tertiary\"\n style={{\n fontSize: 10,\n fontFamily: 'Inter, sans-serif',\n fontWeight: '600',\n marginBottom: 8,\n }}\n >\n {'CONTRIBUTING EXERCISES'}\n </Text>\n {contributingExercises!.map((exercise, index) => (\n <View\n key={`${exercise.name}-${index}`}\n className=\"flex-row items-center justify-between bg-surface-raised border-hairline\"\n style={{\n gap: 10,\n paddingVertical: 8,\n paddingHorizontal: 12,\n marginBottom: 6,\n borderRadius: 8,\n borderWidth: 1,\n }}\n testID={`body-map-detail-panel-contributing-${index}`}\n >\n <Text\n className=\"text-text-primary\"\n style={{ flex: 1, fontSize: 13, fontFamily: 'Inter, sans-serif', fontWeight: '600' }}\n testID={`body-map-detail-panel-contributing-${index}-name`}\n >\n {exercise.name}\n </Text>\n <Text\n className=\"text-text-secondary\"\n style={{ fontSize: 12, fontFamily: 'Inter, sans-serif' }}\n testID={`body-map-detail-panel-contributing-${index}-detail`}\n >\n {`${exercise.sets} sets · ${Math.round(exercise.contributionWeight * 100)}%`}\n </Text>\n </View>\n ))}\n </View>\n )}\n\n {hasUpcoming && (\n <View style={{ marginTop: 16 }} testID=\"body-map-detail-panel-upcoming\">\n <Text\n className=\"text-text-tertiary\"\n style={{\n fontSize: 10,\n fontFamily: 'Inter, sans-serif',\n fontWeight: '600',\n marginBottom: 8,\n }}\n >\n {'UPCOMING'}\n </Text>\n {upcomingExercises!.map((exercise, index) => (\n <View\n key={`${exercise.name}-${index}`}\n className=\"flex-row items-center justify-between\"\n style={{ gap: 10, paddingVertical: 6 }}\n testID={`body-map-detail-panel-upcoming-${index}`}\n >\n <Text\n className=\"text-text-primary\"\n style={{ flex: 1, fontSize: 13, fontFamily: 'Inter, sans-serif', fontWeight: '600' }}\n testID={`body-map-detail-panel-upcoming-${index}-name`}\n >\n {exercise.name}\n </Text>\n <Text\n className=\"text-text-tertiary\"\n style={{ fontSize: 12, fontFamily: 'Inter, sans-serif' }}\n testID={`body-map-detail-panel-upcoming-${index}-detail`}\n >\n {`${exercise.workoutName} · ${exercise.sets} sets`}\n </Text>\n </View>\n ))}\n </View>\n )}\n\n {onViewExercises != null && (\n <Pressable\n onPress={onViewExercises}\n accessibilityRole=\"button\"\n accessibilityLabel={`View ${displayName} exercises`}\n style={{\n marginTop: 16,\n paddingVertical: 10,\n borderRadius: 8,\n alignItems: 'center',\n backgroundColor: 'rgba(255,121,0,0.12)',\n borderWidth: 1,\n borderColor: 'rgba(255,121,0,0.3)',\n }}\n testID=\"body-map-detail-panel-view-exercises\"\n >\n <Text style={{ fontSize: 13, fontFamily: 'Inter, sans-serif', fontWeight: '700', color: BRAND_PRIMARY }}>\n {'View exercises'}\n </Text>\n </Pressable>\n )}\n </ScrollView>\n </Animated.View>\n </View>\n )\n}\n","/**\n * Colour math shared by the depth system.\n *\n * This file used to be `shadows.ts` and shipped a neumorphic shadow builder —\n * dual opposing shadows, dark bottom-right and light top-left. That was removed\n * in TD-07.16. Neumorphism needs a mid-tone background (roughly 75-90%\n * lightness) so BOTH shadows have somewhere to fall; our surfaces sit near 10%,\n * which leaves the dark half nothing to fall onto. It collapsed to a one-sided\n * rim light and read as noise on the wall.\n *\n * Inline depth is a hairline now (`hairline-*`, self-normalising alpha), texture\n * is `materials.ts`, and drop-shadow survives only for genuinely FLOATING\n * things — see `elevation.ts`.\n *\n * What is left here is the HSV/hex maths that `elevation.ts` still uses to\n * derive rim and shadow tints from whatever surface colour it is handed.\n */\n\n// ============================================================================\n// Color Math Utilities\n// ============================================================================\n\n/**\n * Parse a hex color to RGB values (0-255).\n * Supports both #RGB and #RRGGBB formats.\n */\nexport function hexToRgb(hex: string): { r: number; g: number; b: number } | null {\n const cleaned = hex.replace('#', '')\n \n let r: number, g: number, b: number\n \n if (cleaned.length === 3) {\n r = parseInt(cleaned[0] + cleaned[0], 16)\n g = parseInt(cleaned[1] + cleaned[1], 16)\n b = parseInt(cleaned[2] + cleaned[2], 16)\n } else if (cleaned.length === 6) {\n r = parseInt(cleaned.slice(0, 2), 16)\n g = parseInt(cleaned.slice(2, 4), 16)\n b = parseInt(cleaned.slice(4, 6), 16)\n } else {\n return null\n }\n \n return { r, g, b }\n}\n\n/**\n * Convert RGB (0-255) to HSV (h: 0-360, s: 0-1, v: 0-1).\n */\nexport function rgbToHsv(r: number, g: number, b: number): { h: number; s: number; v: number } {\n const rNorm = r / 255\n const gNorm = g / 255\n const bNorm = b / 255\n \n const max = Math.max(rNorm, gNorm, bNorm)\n const min = Math.min(rNorm, gNorm, bNorm)\n const delta = max - min\n \n // Value\n const v = max\n \n // Saturation\n const s = max === 0 ? 0 : delta / max\n \n // Hue\n let h = 0\n if (delta !== 0) {\n if (max === rNorm) {\n h = 60 * (((gNorm - bNorm) / delta) % 6)\n } else if (max === gNorm) {\n h = 60 * ((bNorm - rNorm) / delta + 2)\n } else {\n h = 60 * ((rNorm - gNorm) / delta + 4)\n }\n }\n if (h < 0) h += 360\n \n return { h, s, v }\n}\n\n/**\n * Convert HSV (h: 0-360, s: 0-1, v: 0-1) to RGB (0-255).\n */\nexport function hsvToRgb(h: number, s: number, v: number): { r: number; g: number; b: number } {\n const c = v * s\n const x = c * (1 - Math.abs((h / 60) % 2 - 1))\n const m = v - c\n \n let rPrime: number, gPrime: number, bPrime: number\n\n if (h >= 0 && h < 60) {\n rPrime = c; gPrime = x; bPrime = 0\n } else if (h >= 60 && h < 120) {\n rPrime = x; gPrime = c; bPrime = 0\n } else if (h >= 120 && h < 180) {\n rPrime = 0; gPrime = c; bPrime = x\n } else if (h >= 180 && h < 240) {\n rPrime = 0; gPrime = x; bPrime = c\n } else if (h >= 240 && h < 300) {\n rPrime = x; gPrime = 0; bPrime = c\n } else {\n rPrime = c; gPrime = 0; bPrime = x\n }\n \n return {\n r: Math.round((rPrime + m) * 255),\n g: Math.round((gPrime + m) * 255),\n b: Math.round((bPrime + m) * 255),\n }\n}\n\n/**\n * Convert RGB values to hex string.\n */\nexport function rgbToHex(r: number, g: number, b: number): string {\n const toHex = (n: number) => {\n const clamped = Math.max(0, Math.min(255, Math.round(n)))\n return clamped.toString(16).padStart(2, '0')\n }\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`\n}\n\n/**\n * Lighten a color by increasing its HSV Value component.\n * \n * @param hex - The hex color to lighten\n * @param amount - Amount to increase V by (0-1)\n */\nexport function lighten(hex: string, amount: number = 0.1): string {\n const rgb = hexToRgb(hex)\n if (!rgb) return hex\n \n const hsv = rgbToHsv(rgb.r, rgb.g, rgb.b)\n const newV = Math.min(1, hsv.v + amount)\n \n const newRgb = hsvToRgb(hsv.h, hsv.s, newV)\n return rgbToHex(newRgb.r, newRgb.g, newRgb.b)\n}\n\n/**\n * Darken a color by decreasing its HSV Value component.\n * \n * @param hex - The hex color to darken\n * @param amount - Amount to decrease V by (0-1)\n */\nexport function darken(hex: string, amount: number = 0.1): string {\n const rgb = hexToRgb(hex)\n if (!rgb) return hex\n \n const hsv = rgbToHsv(rgb.r, rgb.g, rgb.b)\n const newV = Math.max(0, hsv.v - amount)\n \n const newRgb = hsvToRgb(hsv.h, hsv.s, newV)\n return rgbToHex(newRgb.r, newRgb.g, newRgb.b)\n}\n\n/**\n * Get hover colors for a button based on its background color.\n * Automatically adapts intensity based on the color's luminance.\n * \n * @param bgColor - The button's background color (hex)\n * @param intensity - How strong the hover effect should be ('subtle' | 'medium' | 'strong')\n */\nexport function getHoverColors(\n bgColor: string, \n intensity: 'subtle' | 'medium' | 'strong' = 'medium'\n): { raised: string; pressed: string } {\n const amounts = {\n subtle: 0.01,\n medium: 0.02,\n strong: 0.03,\n }\n \n const amount = amounts[intensity]\n \n return {\n raised: lighten(bgColor, amount), // Raised hover: lighten (lifting up)\n pressed: darken(bgColor, amount), // Pressed hover: darken (pressing down)\n }\n}\n\n/**\n * Check if a color is considered \"dark\" (for choosing text color).\n * Uses HSV Value component for simplicity.\n */\nexport function isDark(hex: string): boolean {\n const rgb = hexToRgb(hex)\n if (!rgb) return true\n const hsv = rgbToHsv(rgb.r, rgb.g, rgb.b)\n return hsv.v < 0.6\n}\n\n/**\n * Shadow strength tiers. Retained because `elevation.ts` keys its level table on\n * them; the neumorphic shadow BUILDERS that used to live here are gone.\n */\nexport type ShadowIntensity = 'subtle' | 'medium' | 'strong'\n","/**\n * Elevation System\n *\n * A unified depth system where each elevation level corresponds to:\n * - Calculated surface color (derived from base using lighten)\n * - Shadow intensity and style (raised/pressed)\n * - Dynamically calculated shadow colors (derived from surface color)\n * - Semantic name for reference\n *\n * Elevation range: -2 (deep inset) to +5 (floating overlay)\n *\n * Negative elevations: Inset/pressed elements (sunken into surface)\n * Zero elevation: Base surface (background/page level)\n * Positive elevations: Raised elements (floating above surface)\n *\n * All colors are calculated dynamically from a base surface color,\n * allowing for custom surfaces and consistent color relationships.\n *\n * Lighting Model: Light source from upper-right corner\n * - Raised elements are always lighter than base (consistent across themes)\n * - Base colors must allow sufficient lightening in both themes\n */\n\nimport { Platform, type ViewStyle } from 'react-native'\nimport { lighten, darken, hexToRgb, rgbToHsv, hsvToRgb, rgbToHex } from './color-utils'\nimport { semanticColorsLight, semanticColorsDark } from './tokens/semantic'\n\nexport type ElevationLevel = -2 | -1 | 0 | 1 | 2 | 3 | 4 | 5\n\nexport interface ElevationConfig {\n /** Semantic name for this elevation level */\n name: string\n /** Amount to lighten base color (0-1) */\n colorAdjustment: number\n /** Shadow intensity */\n shadowIntensity: 'subtle' | 'medium' | 'strong'\n /** Shadow style: raised (floating) or pressed (inset) */\n shadowStyle: 'raised' | 'pressed'\n /** Description of use case */\n description: string\n}\n\nexport const elevationSystem: Record<ElevationLevel, ElevationConfig> = {\n // Deep inset (recessed input fields, deeply pressed buttons)\n [-2]: {\n name: 'deep-inset',\n colorAdjustment: 0,\n shadowIntensity: 'strong',\n shadowStyle: 'pressed',\n description: 'Deeply recessed elements (e.g., input fields, deeply pressed buttons)',\n },\n\n // Shallow inset (pressed buttons, sunken panels)\n [-1]: {\n name: 'inset',\n colorAdjustment: 0,\n shadowIntensity: 'medium',\n shadowStyle: 'pressed',\n description: 'Shallow inset elements (e.g., pressed buttons, sunken panels within cards)',\n },\n\n // Base level (page background, default surface)\n [0]: {\n name: 'base',\n colorAdjustment: 0,\n shadowIntensity: 'subtle',\n shadowStyle: 'raised',\n description: 'Base surface level (page background, default containers)',\n },\n\n // Level 1: Subtle elevation (outline cards, subtle containers)\n [1]: {\n name: 'subtle',\n // The whole ladder was re-spaced in TD-07.16. It used to run\n // 0.01/0.02/0.04/0.06/0.08, where the first step was ~2 RGB values — under\n // the perceptual floor, so level 1 existed in the type system and nowhere on\n // screen. With drop-shadow now gated off below FLOATING_ELEVATION_MIN, TONE\n // is the only thing separating 0-3, so every step has to actually land.\n // Even 0.025 spacing, verified in elevation.test.ts as ΔL* > 1 per step.\n colorAdjustment: 0.025,\n shadowIntensity: 'subtle',\n shadowStyle: 'raised',\n description: 'Subtle elevation (outline cards, subtle containers)',\n },\n\n // Level 2: Standard elevation (default cards, buttons)\n [2]: {\n name: 'standard',\n colorAdjustment: 0.05,\n shadowIntensity: 'medium',\n shadowStyle: 'raised',\n description: 'Standard elevation (default cards, raised buttons)',\n },\n\n // Level 3: Prominent elevation (important cards, modals)\n [3]: {\n name: 'prominent',\n colorAdjustment: 0.075,\n shadowIntensity: 'strong',\n shadowStyle: 'raised',\n description: 'Prominent elevation (important cards, modals, dropdowns)',\n },\n\n // Level 4: High elevation (overlays, popovers)\n [4]: {\n name: 'high',\n colorAdjustment: 0.10,\n shadowIntensity: 'strong',\n shadowStyle: 'raised',\n description: 'High elevation (overlays, popovers, tooltips)',\n },\n\n // Level 5: Floating (toasts, floating action buttons)\n [5]: {\n name: 'floating',\n colorAdjustment: 0.13,\n shadowIntensity: 'strong',\n shadowStyle: 'raised',\n description: 'Floating elevation (toasts, floating action buttons, highest z-index)',\n },\n}\n\n/**\n * Calculate rim light color from the BASE color.\n * Creates a consistent bright highlight with opacity that scales with elevation.\n *\n * The rim light represents light hitting the edge of raised elements from a\n * consistent light source. Uses ABSOLUTE HSV value (not relative lightening)\n * for consistent intensity across all surface colors.\n *\n * For colored surfaces: preserves hue/saturation, sets value to fixed bright level\n * For gray surfaces: uses white with appropriate opacity\n *\n * @param baseColor - The base surface color (hex)\n * @param level - Elevation level (used to scale opacity)\n */\nfunction calculateRimLightColor(baseColor: string, level: ElevationLevel): string {\n const rgb = hexToRgb(baseColor)\n if (!rgb) {\n return 'rgba(255, 255, 255, 0.5)'\n }\n\n const hsv = rgbToHsv(rgb.r, rgb.g, rgb.b)\n const isLight = hsv.v > 0.6\n const isSaturated = hsv.s > 0.3 // Colored (not gray)\n\n // Opacity scales with elevation to compensate for lighter surfaces at higher levels\n // Range: +0% at level 1 to +20% at level 5\n const absLevel = Math.abs(level)\n const opacityBoost = Math.max(0, (absLevel - 1) * 0.05) // +5% per level above 1 (0% to 20%)\n\n if (isSaturated) {\n // For colored surfaces, preserve hue and saturation but set value to fixed bright level\n // This ensures consistent rim light intensity across all colored surfaces\n const rimLightValue = 0.95 // Fixed bright value for rim light\n const rimLightRgb = hsvToRgb(hsv.h, hsv.s * 0.3, rimLightValue) // Reduce saturation for brighter appearance\n\n // Base opacity + elevation boost, capped at 1.0\n const baseOpacity = isLight ? 0.9 : 0.5\n const finalOpacity = Math.min(1, baseOpacity + opacityBoost)\n return `rgba(${rimLightRgb.r}, ${rimLightRgb.g}, ${rimLightRgb.b}, ${finalOpacity.toFixed(2)})`\n } else {\n // For gray/neutral surfaces, use white with appropriate opacity\n const baseOpacity = isLight ? 0.9 : 0.12\n const finalOpacity = Math.min(1, baseOpacity + opacityBoost)\n return `rgba(255, 255, 255, ${finalOpacity.toFixed(2)})`\n }\n}\n\n/**\n * Calculate dark shadow colors from the surface color.\n * The dark shadow is cast BY the element, so it should match the surface color.\n *\n * Uses ABSOLUTE HSV value (not relative darkening) for consistent shadow intensity\n * across all surface colors - simulating a consistent light source.\n *\n * For colored surfaces: preserves hue/saturation, sets value to fixed dark level\n * For gray surfaces: uses black with appropriate opacity\n */\nfunction calculateDarkShadowColors(surfaceColor: string): {\n dark: string\n darker: string\n} {\n const rgb = hexToRgb(surfaceColor)\n if (!rgb) {\n return {\n dark: 'rgba(0, 0, 0, 0.3)',\n darker: 'rgba(0, 0, 0, 0.4)',\n }\n }\n\n const hsv = rgbToHsv(rgb.r, rgb.g, rgb.b)\n const isLight = hsv.v > 0.6\n const isSaturated = hsv.s > 0.3\n\n if (isSaturated) {\n // For colored surfaces, preserve hue and saturation but set value to fixed dark level\n // This ensures consistent shadow intensity across all colored surfaces\n const darkShadowValue = 0.15 // Fixed dark value for shadows\n const darkShadowRgb = hsvToRgb(hsv.h, hsv.s, darkShadowValue)\n\n if (isLight) {\n return {\n dark: `rgba(${darkShadowRgb.r}, ${darkShadowRgb.g}, ${darkShadowRgb.b}, 0.3)`,\n darker: `rgba(${darkShadowRgb.r}, ${darkShadowRgb.g}, ${darkShadowRgb.b}, 0.4)`,\n }\n } else {\n return {\n dark: `rgba(${darkShadowRgb.r}, ${darkShadowRgb.g}, ${darkShadowRgb.b}, 0.5)`,\n darker: `rgba(${darkShadowRgb.r}, ${darkShadowRgb.g}, ${darkShadowRgb.b}, 0.6)`,\n }\n }\n } else {\n // For gray surfaces, use standard black shadows\n if (isLight) {\n return {\n dark: 'rgba(0, 0, 0, 0.2)',\n darker: 'rgba(0, 0, 0, 0.3)',\n }\n } else {\n return {\n dark: 'rgba(0, 0, 0, 0.5)',\n darker: 'rgba(0, 0, 0, 0.6)',\n }\n }\n }\n}\n\n/**\n * Get rim light size config.\n * Fixed 1px offset and blur for a consistent, crisp rim highlight.\n * Opacity scaling (in calculateRimLightColor) handles elevation differences.\n */\nfunction getRimLightConfig(): { offset: number; blur: number } {\n return {\n offset: 1, // Fixed 1px for crisp rim\n blur: 1, // Tight blur for crisp edge\n }\n}\n\n/**\n * Get elevation configuration for a given level\n */\nexport function getElevationConfig(level: ElevationLevel): ElevationConfig {\n return elevationSystem[level]\n}\n\n// Simple cache for elevation surface colors\nconst elevationSurfaceCache = new Map<string, string>()\nconst MAX_CACHE_SIZE = 100\n\nfunction getCacheKey(baseColor: string, level: ElevationLevel, theme: 'light' | 'dark'): string {\n return `${baseColor}-${level}-${theme}`\n}\n\nfunction calculateElevationSurface(\n baseColor: string,\n level: ElevationLevel,\n theme: 'light' | 'dark'\n): string {\n const config = elevationSystem[level]\n\n if (config.colorAdjustment === 0) {\n return baseColor\n }\n\n // For raised elevations (positive), always lighten (consistent lighting model)\n // Light source is from upper-right, so raised elements are always lighter\n // For inset elevations (negative), we keep base color (shadow creates depth)\n if (level < 0) {\n return baseColor // Inset elements use base color\n }\n\n // Always lighten for raised elements (consistent across themes)\n // Base colors must be chosen to allow sufficient lightening in dark mode\n return lighten(baseColor, config.colorAdjustment)\n}\n\n/**\n * Calculate surface color for an elevation level from a base color.\n * Results are cached to avoid redundant calculations.\n *\n * @param baseColor - Base surface color (hex)\n * @param level - Elevation level\n * @param theme - Current theme ('light' or 'dark')\n * @returns Calculated surface color (hex)\n */\nexport function getElevationSurface(\n baseColor: string,\n level: ElevationLevel,\n theme: 'light' | 'dark'\n): string {\n const cacheKey = getCacheKey(baseColor, level, theme)\n\n // Check cache\n if (elevationSurfaceCache.has(cacheKey)) {\n return elevationSurfaceCache.get(cacheKey)!\n }\n\n // Calculate\n const result = calculateElevationSurface(baseColor, level, theme)\n\n // Cache result (with size limit to prevent memory leaks)\n if (elevationSurfaceCache.size >= MAX_CACHE_SIZE) {\n // Remove oldest entry (simple FIFO)\n const firstKey = elevationSurfaceCache.keys().next().value!\n elevationSurfaceCache.delete(firstKey)\n }\n elevationSurfaceCache.set(cacheKey, result)\n\n return result\n}\n\n// Cache for shadow styles (less frequently used, smaller cache)\nconst elevationShadowCache = new Map<string, ViewStyle>()\nconst MAX_SHADOW_CACHE_SIZE = 50\n\nfunction getShadowCacheKey(\n baseColor: string,\n level: ElevationLevel,\n theme: 'light' | 'dark',\n isHovered: boolean\n): string {\n return `${baseColor}-${level}-${theme}-${isHovered}`\n}\n\nfunction calculateElevationShadow(\n baseColor: string,\n level: ElevationLevel,\n theme: 'light' | 'dark',\n isHovered: boolean = false\n): ViewStyle {\n const config = elevationSystem[level]\n\n // Base level has no shadow\n if (level === 0) {\n return {}\n }\n\n // Calculate the actual elevated surface color\n const elevatedSurfaceColor = calculateElevationSurface(baseColor, level, theme)\n\n // Rim light: calculated from BASE color (consistent across all elevations)\n // This represents a consistent light source - only size changes with elevation\n const rimLightColor = calculateRimLightColor(baseColor, level)\n\n // Dark shadow: calculated from ELEVATED surface color\n // The shadow is cast by the element, so it should match the surface\n const darkShadowColors = calculateDarkShadowColors(elevatedSurfaceColor)\n\n // Get shadow intensity config (for dark shadow)\n const intensityConfig = {\n subtle: { offset: 1, blur: 2 },\n medium: { offset: 2, blur: 4 },\n strong: { offset: 2, blur: 5 },\n }\n\n const { offset, blur } = intensityConfig[config.shadowIntensity]\n\n // Get rim light config (scales with elevation level)\n const rimConfig = getRimLightConfig()\n\n if (config.shadowStyle === 'pressed') {\n // Inset shadow (pressed elements)\n if (isHovered) {\n // Reduce shadow depth for hover\n const hoverOffset = Math.max(1, Math.round(offset / 2))\n const hoverBlur = Math.max(1, Math.round(blur / 2))\n return Platform.select({\n web: {\n boxShadow: `inset ${hoverOffset}px ${hoverOffset}px ${hoverBlur}px ${darkShadowColors.darker}, inset -${rimConfig.offset}px -${rimConfig.offset}px ${rimConfig.blur}px ${rimLightColor}`,\n } as any,\n default: {\n shadowOpacity: 0,\n elevation: 0,\n },\n }) as ViewStyle\n }\n\n return Platform.select({\n web: {\n boxShadow: `inset ${offset}px ${offset}px ${blur}px ${darkShadowColors.darker}, inset -${rimConfig.offset}px -${rimConfig.offset}px ${rimConfig.blur}px ${rimLightColor}`,\n } as any,\n default: {\n shadowOpacity: 0,\n elevation: 0,\n },\n }) as ViewStyle\n } else {\n // Raised shadow (floating elements)\n if (isHovered) {\n // Reduce shadow depth for hover\n const hoverOffset = Math.max(1, Math.round(offset / 2))\n const hoverBlur = Math.max(1, Math.round(blur / 2))\n return Platform.select({\n web: {\n boxShadow: `${hoverOffset}px ${hoverOffset}px ${hoverBlur}px ${darkShadowColors.dark}, -${rimConfig.offset}px -${rimConfig.offset}px ${rimConfig.blur}px ${rimLightColor}`,\n } as any,\n default: {\n shadowColor: '#000',\n shadowOffset: { width: hoverOffset, height: hoverOffset },\n shadowOpacity: 0.2,\n shadowRadius: hoverBlur / 2,\n elevation: hoverOffset,\n },\n }) as ViewStyle\n }\n\n return Platform.select({\n web: {\n boxShadow: `${offset}px ${offset}px ${blur}px ${darkShadowColors.dark}, -${rimConfig.offset}px -${rimConfig.offset}px ${rimConfig.blur}px ${rimLightColor}`,\n } as any,\n default: {\n shadowColor: '#000',\n shadowOffset: { width: offset, height: offset },\n shadowOpacity: 0.3,\n shadowRadius: blur / 2,\n elevation: offset,\n },\n }) as ViewStyle\n }\n}\n\n/**\n * Get shadow style for an elevation level, calculated dynamically from surface color.\n * Results are cached to avoid redundant calculations.\n *\n * @param baseColor - Base surface color (hex)\n * @param level - Elevation level\n * @param theme - Current theme ('light' or 'dark')\n * @param isHovered - Whether element is hovered\n * @returns ViewStyle with shadow properties\n */\n/**\n * The lowest elevation that still casts an outward shadow.\n *\n * On a near-black surface a drop-shadow is inert: at levels 1-3 the shadow is\n * dark-on-dark and contributes nothing a viewer can see, while still costing a\n * composite layer. Material dropped shadow-as-hierarchy for the same reason.\n * Inline hierarchy is the hairline's job (`hairline-*`), which composites by a\n * constant amount over any plane.\n *\n * At 4+ the element is genuinely FLOATING over a backdrop — menu, popover,\n * toast — where a large soft shadow describes separation from the page rather\n * than a rank in a stack. Those should also carry a hairline ring.\n */\nexport const FLOATING_ELEVATION_MIN: ElevationLevel = 4\n\nexport function getElevationShadow(\n baseColor: string,\n level: ElevationLevel,\n theme: 'light' | 'dark',\n isHovered: boolean = false\n): ViewStyle {\n const cacheKey = getShadowCacheKey(baseColor, level, theme, isHovered)\n\n // Check cache\n if (elevationShadowCache.has(cacheKey)) {\n return elevationShadowCache.get(cacheKey)!\n }\n\n // Calculate shadow. Outward drop-shadow is gated to FLOATING levels only —\n // see FLOATING_ELEVATION_MIN. Inset levels keep theirs; a recess reads from\n // the inner shadow, which is a different mechanism from a cast shadow.\n const result =\n level > 0 && level < FLOATING_ELEVATION_MIN\n ? {}\n : calculateElevationShadow(baseColor, level, theme, isHovered)\n\n // Cache result\n if (elevationShadowCache.size >= MAX_SHADOW_CACHE_SIZE) {\n const firstKey = elevationShadowCache.keys().next().value!\n elevationShadowCache.delete(firstKey)\n }\n elevationShadowCache.set(cacheKey, result)\n\n return result\n}\n\n/**\n * Elevation level backing a `<Surface pressed>` recess: the shallow `inset`\n * (-1) step. Pressed exposes ONE level of depth — pressed-2 is intentionally\n * not surfaced (the deeper `-2` deep-inset stays available to `elevation`).\n */\nexport const PRESSED_ELEVATION_LEVEL: ElevationLevel = -1\n\n/**\n * Inner-shadow recess for a pressed (sunken) surface, tuned to the well's own\n * fill colour so the rim/shadow tints track the darker fill. Composes WITH the\n * darker pressed fill: on web it adds an inset boxShadow; on the native path\n * (no inset-shadow support) it's a no-op and the recess reads via the fill\n * alone — so a pressed surface stays legibly sunken with or without the shadow.\n *\n * @param fillColor - The pressed surface's own fill (one ramp step down).\n * @param theme - Current theme ('light' or 'dark').\n */\nexport function getPressedRecessShadow(fillColor: string, theme: 'light' | 'dark'): ViewStyle {\n return getElevationShadow(fillColor, PRESSED_ELEVATION_LEVEL, theme)\n}\n\n/**\n * Get base surface color from theme.\n * This is the foundation color that all elevations are calculated from.\n *\n * IMPORTANT: Base colors must be chosen to allow sufficient lightening.\n *\n * **Light Mode**: Cannot use `#FFFFFF` (white) - cannot lighten white!\n * - Use `#F3F4F6` (neutral[100]) - can lighten to `#FAFAFA` → `#FFFFFF`\n * - This allows raised elevations to be lighter (closer to white)\n *\n * **Dark Mode**: Need lighter base to allow sufficient lightening\n * - Use `surface-elevated` (#2A2827, TD-surface-tokens ramp) - allows further lightening\n *\n * Can be overridden to use custom base colors for special cases.\n */\nexport function getBaseSurfaceColor(theme: 'light' | 'dark'): string {\n // Use semantic token values so elevation colors stay in sync with the token pipeline.\n // Light mode: surface-raised (#F3F4F6 / neutral[100]) - NOT white, so we can lighten it\n // Dark mode: surface-elevated (#2A2827, TD-surface-tokens ramp) - allows sufficient lightening\n\n return theme === 'light'\n ? semanticColorsLight['surface-raised']\n : semanticColorsDark['surface-elevated']\n}\n\n/**\n * Component-specific elevation ranges\n * Defines which elevation levels each component type can use\n */\nexport const componentElevationRanges = {\n button: {\n allowed: [2] as const,\n default: 2 as const,\n hover: 3 as const,\n },\n card: {\n allowed: [1, 2, 3] as const,\n default: 2 as const,\n hover: 3 as const,\n },\n input: {\n allowed: [-2, -1, 0] as const,\n default: -1 as const,\n },\n overlay: {\n allowed: [4, 5] as const,\n default: 4 as const,\n },\n} as const\n\nexport type ComponentType = keyof typeof componentElevationRanges\n\n/**\n * Validate and clamp elevation to component's allowed range\n */\nexport function getValidatedElevation(\n component: ComponentType,\n requested: ElevationLevel\n): ElevationLevel {\n const range = componentElevationRanges[component]\n if ((range.allowed as readonly ElevationLevel[]).includes(requested)) {\n return requested\n }\n // Clamp to nearest allowed elevation\n const sorted = [...range.allowed].sort((a, b) => a - b)\n if (requested < sorted[0]) return sorted[0]\n if (requested > sorted[sorted.length - 1]) return sorted[sorted.length - 1]\n // Find closest\n return sorted.reduce((prev, curr) =>\n Math.abs(curr - requested) < Math.abs(prev - requested) ? curr : prev\n ) as ElevationLevel\n}\n\n// =============================================================================\n// Glow Shadow Support\n// =============================================================================\n\nexport type GlowIntensity = 'subtle' | 'medium' | 'strong'\n\nconst glowConfig: Record<GlowIntensity, { blur: number; spread: number; opacity: number }> = {\n subtle: { blur: 12, spread: 0, opacity: 0.25 },\n medium: { blur: 20, spread: 2, opacity: 0.4 },\n strong: { blur: 30, spread: 4, opacity: 0.55 },\n}\n\n/**\n * Get a glow shadow style for emphasis/active states.\n *\n * Creates a colored radial glow around an element, useful for:\n * - Active recording indicators (orange glow)\n * - Success states (green glow)\n * - Error/danger indicators (red glow)\n * - Focus rings and attention-drawing elements\n *\n * @param color - Glow color (hex string, e.g. '#FF7900')\n * @param intensity - Glow intensity level\n * @returns ViewStyle with platform-specific shadow properties\n */\nexport function getGlowShadow(color: string, intensity: GlowIntensity = 'medium'): ViewStyle {\n const config = glowConfig[intensity]\n const rgb = hexToRgb(color)\n if (!rgb) return {}\n\n return Platform.select({\n web: {\n boxShadow: `0 0 ${config.blur}px ${config.spread}px rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${config.opacity})`,\n } as any,\n default: {\n shadowColor: color,\n shadowOffset: { width: 0, height: 0 },\n shadowOpacity: config.opacity,\n shadowRadius: config.blur / 2,\n elevation: 0,\n },\n }) as ViewStyle\n}\n","import { useSyncExternalStore } from 'react'\n\n/**\n * Utility function to detect the current theme.\n * Checks for the 'light' class on the html element (set by Storybook's theme addon).\n * \n * NOTE: This function reads the theme at call time. For reactive theme detection\n * that re-renders when the theme changes, use the `useTheme` hook instead.\n * \n * @returns 'light' if light theme is active, 'dark' otherwise\n */\nexport function getTheme(): 'light' | 'dark' {\n if (typeof document === 'undefined') return 'dark'\n return document.documentElement.classList.contains('light') ? 'light' : 'dark'\n}\n\n// Subscribers for theme changes\nlet listeners: Array<() => void> = []\n\nfunction subscribe(listener: () => void) {\n listeners = [...listeners, listener]\n \n // Set up MutationObserver to watch for class changes on html element\n if (typeof document !== 'undefined' && listeners.length === 1) {\n const observer = new MutationObserver((mutations) => {\n for (const mutation of mutations) {\n if (mutation.type === 'attributes' && mutation.attributeName === 'class') {\n // Notify all listeners when class changes\n listeners.forEach(l => l())\n }\n }\n })\n \n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['class'],\n })\n \n // Store observer for cleanup\n ;(subscribe as any)._observer = observer\n }\n \n return () => {\n listeners = listeners.filter(l => l !== listener)\n \n // Clean up observer when no more listeners\n if (listeners.length === 0 && (subscribe as any)._observer) {\n ;(subscribe as any)._observer.disconnect()\n ;(subscribe as any)._observer = null\n }\n }\n}\n\nfunction getSnapshot(): 'light' | 'dark' {\n return getTheme()\n}\n\nfunction getServerSnapshot(): 'light' | 'dark' {\n return 'dark'\n}\n\n/**\n * React hook for reactive theme detection.\n * Automatically re-renders when the theme changes (via class changes on html element).\n * \n * Uses useSyncExternalStore for proper React 18 concurrent mode support.\n * \n * @returns 'light' if light theme is active, 'dark' otherwise\n */\nexport function useTheme(): 'light' | 'dark' {\n return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot)\n}\n","import React, { useMemo, useState } from 'react'\nimport { View, Text, Pressable, type ViewProps } from 'react-native'\nimport { cn } from '../../../utils/cn'\nimport { \n getElevationSurface, \n getElevationShadow, \n getBaseSurfaceColor,\n getValidatedElevation,\n type ElevationLevel \n} from '../../../theme'\nimport { useTheme } from '../../../utils/useTheme'\n\nexport type CardVariant = 'elevated' | 'outline' | 'filled' | 'accent' | 'subtle'\nexport type CardElevation = 1 | 2 | 3 // subtle, standard, prominent\n\nexport interface CardProps extends ViewProps {\n /** Visual variant */\n variant?: CardVariant\n /** Elevation level (1=subtle, 2=standard, 3=prominent) */\n elevation?: CardElevation\n /** Whether the card is interactive (hoverable/pressable) */\n isInteractive?: boolean\n /** Whether the card is in a loading state (renders skeleton) */\n isLoading?: boolean\n /** Callback when card is pressed (makes card interactive) */\n onPress?: () => void\n /** Custom border color (hex, rgb, or CSS color). Useful for status cards. */\n borderColor?: string\n /** Custom background color (hex, rgb, or CSS color). Useful for colored cards. */\n bgColor?: string\n /** Accent stripe color for accent variant (CSS color or hex) */\n accentColor?: string\n /** Accent stripe width for accent variant in pixels (default: 3) */\n accentWidth?: number\n /** Additional className */\n className?: string\n children?: React.ReactNode\n /** Show header skeleton when loading (default: true) */\n skeletonHasHeader?: boolean\n /** Show footer skeleton when loading (default: false) */\n skeletonHasFooter?: boolean\n /** Number of content lines in skeleton when loading (default: 3) */\n skeletonContentLines?: number\n}\n\nconst variantStyles: Record<CardVariant, string> = {\n elevated: '', // Will be set dynamically via elevation system\n outline: 'border-2 border-hairline-strong', // Thicker border with stronger contrast\n filled: '', // Will be set dynamically via elevation system\n accent: 'border border-hairline',\n subtle: 'border border-hairline-subtle',\n}\n\n/**\n * Card component for containing related content.\n *\n * @example\n * <Card>\n * <CardHeader>\n * <CardTitle>Card Title</CardTitle>\n * <CardDescription>Card description</CardDescription>\n * </CardHeader>\n * <CardContent>\n * <Text>Card content goes here</Text>\n * </CardContent>\n * <CardFooter>\n * <Button>Action</Button>\n * </CardFooter>\n * </Card>\n *\n * // Interactive card\n * <Card isInteractive onPress={() => console.log('pressed')}>\n * <CardContent>Click me</CardContent>\n * </Card>\n */\nexport function Card({\n variant = 'elevated',\n elevation = 2,\n isInteractive = false,\n isLoading = false,\n onPress,\n borderColor,\n bgColor,\n accentColor,\n accentWidth,\n className,\n children,\n style,\n skeletonHasHeader = true,\n skeletonHasFooter = false,\n skeletonContentLines = 3,\n ...props\n}: CardProps) {\n const isClickable = isInteractive || !!onPress\n const [isHovered, setIsHovered] = useState(false)\n const theme = useTheme()\n\n // Get elevation level (validate and clamp to card's allowed range)\n const elevationLevel = useMemo(() => {\n const validated = getValidatedElevation('card', elevation as ElevationLevel)\n // Map variant to elevation if needed\n if (variant === 'outline' || variant === 'accent' || variant === 'subtle') {\n return 1 as ElevationLevel // These border variants use subtle elevation\n }\n return validated\n }, [variant, elevation])\n\n // Get base surface color for theme\n const baseColor = useMemo(() => getBaseSurfaceColor(theme), [theme])\n\n // Calculate surface color and shadow from elevation\n const surfaceColor = useMemo(() => {\n // Outline variant in light mode uses a specific off-white for clear visibility\n if ((variant === 'outline' || variant === 'accent') && theme === 'light') {\n return '#FAFAFA' // Matches --color-surface-elevated in light mode\n }\n // Subtle variant uses the base surface color without elevation lift\n if (variant === 'subtle') {\n return getElevationSurface(baseColor, 0 as ElevationLevel, theme)\n }\n return getElevationSurface(baseColor, elevationLevel, theme)\n }, [baseColor, elevationLevel, theme, variant])\n\n const shadowStyle = useMemo(() => {\n // Only apply hover shadow if card is actually clickable\n const shouldHover = isHovered && isClickable\n return getElevationShadow(baseColor, elevationLevel, theme, shouldHover)\n }, [baseColor, elevationLevel, theme, isHovered, isClickable])\n\n // Render skeleton content when loading, otherwise render children\n const cardContent = isLoading ? (\n <>\n {skeletonHasHeader && (\n <CardHeader>\n <View className=\"h-5 w-1/3 bg-interactive-disabled rounded\" />\n <View className=\"mt-2 h-4 w-2/3 bg-interactive-disabled rounded\" />\n </CardHeader>\n )}\n <CardContent>\n {Array.from({ length: skeletonContentLines }).map((_, i) => (\n <View\n key={i}\n className={cn(\n 'h-4 bg-interactive-disabled rounded',\n i < skeletonContentLines - 1 ? 'mb-2 w-full' : 'w-4/5'\n )}\n />\n ))}\n </CardContent>\n {skeletonHasFooter && (\n <CardFooter>\n <View className=\"h-9 w-24 bg-interactive-disabled rounded\" />\n </CardFooter>\n )}\n </>\n ) : (\n children\n )\n\n const baseClassName = cn(\n 'rounded-lg overflow-hidden relative',\n // Apply variant styles, but only use default border color if no custom borderColor\n variant === 'outline'\n ? borderColor\n ? 'border-2' // Just the border width, color via style\n : variantStyles[variant] // Full variant styles including color\n : variantStyles[variant],\n // Remove Tailwind shadow classes - we're using elevation shadows via style prop\n isClickable && 'web:cursor-pointer web:transition-all web:duration-150',\n isClickable && 'web:hover:-translate-y-0.5 active:scale-[0.99]',\n isLoading && 'pointer-events-none animate-pulse',\n className\n )\n\n // Accent variant: left stripe via borderLeft override\n const accentStyle = useMemo(() => variant === 'accent' ? {\n borderLeftWidth: accentWidth ?? 3,\n borderLeftColor: accentColor ?? 'var(--color-brand-primary)',\n } : {}, [variant, accentWidth, accentColor])\n\n // Merge styles: background color from elevation + shadow style + custom colors + custom style\n const mergedStyle = useMemo(() => {\n const elevationStyle: Record<string, any> = {\n backgroundColor: bgColor || surfaceColor,\n borderRadius: 8,\n overflow: 'hidden' as const,\n ...shadowStyle,\n ...accentStyle,\n }\n\n // Add custom border color if provided\n if (borderColor) {\n elevationStyle.borderColor = borderColor\n }\n\n if (!style) return elevationStyle\n // User style takes precedence over elevation defaults (e.g. maxWidth, custom bg)\n return [elevationStyle, style]\n }, [style, surfaceColor, shadowStyle, borderColor, bgColor, accentStyle])\n\n if (isClickable) {\n return (\n <Pressable\n onPress={onPress}\n onHoverIn={() => setIsHovered(true)}\n onHoverOut={() => setIsHovered(false)}\n accessibilityRole=\"button\"\n className={baseClassName}\n style={mergedStyle}\n {...props}\n >\n {cardContent}\n </Pressable>\n )\n }\n\n return (\n <View className={baseClassName} style={mergedStyle} {...props}>\n {cardContent}\n </View>\n )\n}\n\nexport interface CardHeaderProps {\n children?: React.ReactNode\n className?: string\n}\n\n/**\n * Header section of a Card.\n */\nexport function CardHeader({ children, className }: CardHeaderProps) {\n return (\n <View className={cn('px-6 py-6', className)}>\n {children}\n </View>\n )\n}\n\nexport interface CardTitleProps {\n children?: React.ReactNode\n className?: string\n}\n\n/**\n * Title for CardHeader.\n */\nexport function CardTitle({ children, className }: CardTitleProps) {\n return (\n <Text\n accessibilityRole=\"header\"\n className={cn('text-lg font-semibold text-text-primary font-heading', className)}\n >\n {children}\n </Text>\n )\n}\n\nexport interface CardDescriptionProps {\n children?: React.ReactNode\n className?: string\n}\n\n/**\n * Description for CardHeader.\n */\nexport function CardDescription({ children, className }: CardDescriptionProps) {\n return (\n <Text className={cn('mt-1.5 text-sm text-text-secondary', className)}>\n {children}\n </Text>\n )\n}\n\nexport interface CardContentProps {\n children?: React.ReactNode\n className?: string\n}\n\n/**\n * Content section of a Card.\n */\nexport function CardContent({ children, className }: CardContentProps) {\n return (\n <View className={cn('px-6 py-4', className)}>\n {children}\n </View>\n )\n}\n\nexport interface CardFooterProps {\n children?: React.ReactNode\n className?: string\n}\n\n/**\n * Footer section of a Card.\n */\nexport function CardFooter({ children, className }: CardFooterProps) {\n return (\n <View className={cn('px-6 py-4 flex-row items-center gap-2', className)}>\n {children}\n </View>\n )\n}\n\nexport interface CardSkeletonProps {\n /** Whether to show header skeleton */\n hasHeader?: boolean\n /** Whether to show footer skeleton */\n hasFooter?: boolean\n /** Number of content lines */\n contentLines?: number\n /** Additional className */\n className?: string\n}\n\n/**\n * Skeleton placeholder for Card loading state.\n */\nexport function CardSkeleton({\n hasHeader = true,\n hasFooter = false,\n contentLines = 3,\n className,\n}: CardSkeletonProps) {\n return (\n <Card variant=\"elevated\" elevation={2} className={cn('animate-pulse', className)}>\n {hasHeader && (\n <CardHeader>\n <View className=\"h-5 w-1/3 bg-interactive-disabled rounded\" />\n <View className=\"mt-2 h-4 w-2/3 bg-interactive-disabled rounded\" />\n </CardHeader>\n )}\n <CardContent>\n {Array.from({ length: contentLines }).map((_, i) => (\n <View\n key={i}\n className={cn(\n 'h-4 bg-interactive-disabled rounded',\n i < contentLines - 1 ? 'mb-2 w-full' : 'w-4/5'\n )}\n />\n ))}\n </CardContent>\n {hasFooter && (\n <CardFooter>\n <View className=\"h-9 w-24 bg-interactive-disabled rounded\" />\n </CardFooter>\n )}\n </Card>\n )\n}\n\nexport interface CardInsetProps extends ViewProps {\n /** Elevation level for inset (-2=deep, -1=shallow) */\n elevation?: -2 | -1\n /** Additional className */\n className?: string\n children?: React.ReactNode\n}\n\n/**\n * Inset element within a Card. Applies pressed neumorphic shadow\n * to create a sunken/recessed appearance.\n * \n * @example\n * <Card elevation={2}>\n * <CardContent>\n * <CardInset elevation={-1}>\n * <Text>This content appears inset/sunken</Text>\n * </CardInset>\n * </CardContent>\n * </Card>\n */\nexport function CardInset({\n elevation = -1,\n className,\n children,\n style,\n ...props\n}: CardInsetProps) {\n const theme = useTheme()\n const baseColor = useMemo(() => getBaseSurfaceColor(theme), [theme])\n const surfaceColor = useMemo(() => {\n return getElevationSurface(baseColor, elevation as ElevationLevel, theme)\n }, [baseColor, elevation, theme])\n const shadowStyle = useMemo(() => {\n return getElevationShadow(baseColor, elevation as ElevationLevel, theme)\n }, [baseColor, elevation, theme])\n \n return (\n <View\n className={cn('rounded', className)}\n style={[{ backgroundColor: surfaceColor }, shadowStyle, style]}\n {...props}\n >\n {children}\n </View>\n )\n}\n","// Font mapping: font-heading=Space Grotesk, font-body=Nunito Sans (UI), font-sans=Inter (body)\nimport { View, Text, type ViewProps } from 'react-native'\nimport { getSemanticColors } from '../../../theme/tokens/semantic'\nimport { greyRamp } from '../../../theme/tokens/primitives'\n\nconst t = getSemanticColors('dark')\n\nexport type StatusDotVariant =\n | 'success'\n | 'warning'\n | 'error'\n | 'neutral'\n | 'on-track'\n | 'deviation'\n | 'future'\n\nexport interface StatusDotProps extends ViewProps {\n variant: StatusDotVariant\n /** Center glyph. Only rendered at size=\"md\"; the 8px \"sm\" dot is too small to fit one. */\n icon?: 'check' | 'exclamation' | 'dash'\n size?: 'sm' | 'md'\n /** Adds a subtle glow effect in the variant color */\n glow?: boolean\n label?: string\n className?: string\n}\n\nconst solidVariantColors: Record<string, string> = {\n success: t['status-success'],\n warning: t['status-warning'],\n error: t['status-error'],\n neutral: greyRamp[500],\n}\n\nconst ringVariantStyles: Record<string, Record<string, unknown>> = {\n 'on-track': {\n backgroundColor: 'rgba(46,213,115,0.15)',\n borderWidth: 1,\n borderColor: 'rgba(46,213,115,0.3)',\n },\n deviation: {\n backgroundColor: 'rgba(245,158,11,0.15)',\n borderWidth: 1,\n borderColor: 'rgba(245,158,11,0.25)',\n },\n future: {\n backgroundColor: 'rgba(107,114,128,0.1)',\n borderWidth: 1,\n borderStyle: 'dashed',\n borderColor: 'rgba(107,114,128,0.2)',\n },\n}\n\nconst glowStyles: Record<StatusDotVariant, Record<string, unknown>> = {\n success: { boxShadow: '0 0 4px rgba(46,213,115,0.4)' },\n warning: { boxShadow: '0 0 4px rgba(245,158,11,0.4)' },\n error: { boxShadow: '0 0 4px rgba(239,68,68,0.4)' },\n neutral: { boxShadow: '0 0 4px rgba(107,114,128,0.4)' },\n 'on-track': { boxShadow: '0 0 4px rgba(46,213,115,0.4)' },\n deviation: { boxShadow: '0 0 4px rgba(245,158,11,0.4)' },\n future: { boxShadow: '0 0 4px rgba(107,114,128,0.4)' },\n}\n\nconst iconChars: Record<string, string> = {\n check: '\\u2713',\n exclamation: '!',\n dash: '\\u2014',\n}\n\n/** Color-matched icon colors: dark on solid bg, light on transparent bg */\nconst iconColors: Record<StatusDotVariant, string> = {\n success: '#0A5C52',\n warning: '#6B4000',\n error: '#5C1A1A',\n neutral: greyRamp[200],\n 'on-track': t['status-success'],\n deviation: t['status-warning'],\n future: greyRamp[500],\n}\n\nconst sizeDimensions = {\n sm: { size: 8, showIcon: false },\n md: { size: 18, showIcon: true },\n}\n\nfunction isSolidVariant(variant: StatusDotVariant): boolean {\n return variant in solidVariantColors\n}\n\nexport function StatusDot({\n variant,\n icon,\n size = 'sm',\n glow,\n label,\n className,\n ...props\n}: StatusDotProps) {\n const config = sizeDimensions[size]\n const solid = isSolidVariant(variant)\n const ring = ringVariantStyles[variant]\n\n const glowStyle = glow ? glowStyles[variant] : null\n\n const dot = (\n <View\n style={[\n {\n width: config.size,\n height: config.size,\n borderRadius: 9999,\n alignItems: 'center',\n justifyContent: 'center',\n flexShrink: 0,\n },\n solid ? { backgroundColor: solidVariantColors[variant] } : undefined,\n ring ? (ring as Record<string, unknown>) : undefined,\n glowStyle ? (glowStyle as Record<string, unknown>) : undefined,\n ]}\n accessibilityRole=\"image\"\n accessibilityLabel={`${variant} status`}\n testID=\"status-dot\"\n >\n {config.showIcon && icon && (\n <Text\n style={{\n fontSize: 11,\n lineHeight: 11,\n fontWeight: '900',\n color: iconColors[variant],\n }}\n accessibilityElementsHidden\n >\n {iconChars[icon]}\n </Text>\n )}\n </View>\n )\n\n if (label) {\n return (\n <View\n className={className}\n style={{ flexDirection: 'row', alignItems: 'center', gap: 6 }}\n accessibilityLabel={`${variant} status: ${label}`}\n {...props}\n >\n <View accessibilityElementsHidden>{dot}</View>\n <Text\n style={{ fontSize: 12, lineHeight: 16, color: greyRamp[400] }}\n accessibilityElementsHidden\n >\n {label}\n </Text>\n </View>\n )\n }\n\n return (\n <View className={className} {...props}>\n {dot}\n </View>\n )\n}\n","/**\n * Data-viz / status / brand fills, sourced from the color foundations.\n */\n\nimport { categoricalPalette, primitiveRamps as ramp } from './tokens/primitives'\n\n/**\n * Titan categorical fallback palette shared by Treemap and Scatter — the\n * canonical {@link categoricalPalette} (ordered, nested-stable, CVD-safe).\n * Components index into it modulo length, so the 7-color series is sufficient.\n */\nexport const DATAVIZ_CATEGORICAL_PALETTE = categoricalPalette.default\n\n/**\n * MesoCard / MesoStatusCard 3px top-accent gradient stops (dark → primary →\n * light), on the orange ramp that brand-primary (orange-400) lives in.\n */\nexport const MESO_ACCENT_GRADIENT_DARK = ramp.orange[500]\nexport const MESO_ACCENT_GRADIENT_LIGHT = ramp.orange[300]\n\nexport const WORKOUT_PILL_DELOAD = ramp.magenta[600]\n","// Font mapping: font-heading=Space Grotesk, font-body=Nunito Sans (UI), font-sans=Inter (body)\nimport { Fragment, type ReactNode } from 'react'\nimport { View, Text, type ViewProps, type ViewStyle } from 'react-native'\nimport { Card } from '../../ui/card'\nimport { StatusDot } from './StatusDot'\nimport { resolveColor } from '../../../theme/resolve-color'\nimport { getSemanticColors } from '../../../theme/tokens/semantic'\nimport {\n MESO_ACCENT_GRADIENT_DARK,\n MESO_ACCENT_GRADIENT_LIGHT,\n} from '../../../theme/extracted-colors-dataviz'\n\nconst t = getSemanticColors('dark')\n\nconst BRAND_PRIMARY = t['brand-primary']\nconst BRAND_PRIMARY_DARK = MESO_ACCENT_GRADIENT_DARK\nconst BRAND_PRIMARY_LIGHT = MESO_ACCENT_GRADIENT_LIGHT\n\nconst SUCCESS = t['status-success']\nconst WARNING = t['status-warning']\nconst ERROR = t['status-error']\n\n/** Gradient stops for the 3px top accent: dark -> primary -> light (matches MesoCard). */\nconst ACCENT_STOPS = [BRAND_PRIMARY_DARK, BRAND_PRIMARY, BRAND_PRIMARY_LIGHT]\n\n/**\n * Card surface gradient: elevated -> raised at 135deg. Uses resolved dark-theme\n * hexes (a gradient string can't carry a className token, and var() renders\n * black on native).\n */\nconst CARD_GRADIENT = `linear-gradient(135deg, ${resolveColor('surface-elevated')} 0%, ${resolveColor('surface-raised')} 100%)`\n\n/** Gauge track gradient (teal -> amber -> red) at 0.25 alpha. */\nconst GAUGE_GRADIENT =\n 'linear-gradient(90deg, rgba(46,213,115,0.25) 0%, rgba(249,180,21,0.25) 50%, rgba(209,67,67,0.25) 100%)'\n\nexport type MesoStatusBadgeVariant = 'success' | 'warning' | 'error'\n\nconst STATUS_VARIANTS: Record<\n MesoStatusBadgeVariant,\n { bg: string; border: string; text: string }\n> = {\n success: { bg: 'rgba(46,213,115,0.15)', border: 'rgba(46,213,115,0.3)', text: SUCCESS },\n warning: { bg: 'rgba(249,180,21,0.15)', border: 'rgba(249,180,21,0.3)', text: WARNING },\n error: { bg: 'rgba(209,67,67,0.15)', border: 'rgba(209,67,67,0.25)', text: ERROR },\n}\n\nexport interface MesoStatusBadge {\n /** Short status label, e.g. \"On Track\". */\n label: string\n /** Color treatment for the badge. */\n variant: MesoStatusBadgeVariant\n}\n\nexport interface MesoStatusMetric {\n /** Cell label, e.g. \"Prescribed\". */\n label: string\n /** Cell value, e.g. \"3×8 @ RPE 8\". */\n value: string\n}\n\nexport interface MesoStatusGauge {\n /** Gauge label, e.g. \"Intensity\". */\n label: string\n /** Fill position 0-1; the 14px marker sits at this level. */\n level: number\n /** Optional right-aligned sublabel, e.g. \"Prescribed\". */\n sublabel?: string\n}\n\nexport interface MesoStatusCoaching {\n /** Coaching recommendation copy. */\n text: string\n /** Substrings within `text` to render in bold. */\n highlights?: string[]\n}\n\nexport interface MesoStatusNextTarget {\n /** Leading glyph/emoji, e.g. \"→\" or \"🎯\". */\n icon: string\n /** Next-session target copy. */\n text: string\n}\n\nexport interface MesoStatusCardProps extends ViewProps {\n /** Mesocycle name, e.g. \"Hypertrophy Block\". */\n mesoName: string\n /** Context line, e.g. \"Week 6 of 8 · Upper/Lower\". */\n mesoSubtitle: string\n /** Status pill in the header. */\n statusBadge: MesoStatusBadge\n /** Prescription-vs-actual metrics rendered as a 2x2 grid. */\n metrics: MesoStatusMetric[]\n /** Intensity / volume gauges stacked vertically. */\n gauges: MesoStatusGauge[]\n /** Optional coaching recommendation box. */\n coaching?: MesoStatusCoaching\n /** Optional next-session target box. */\n nextTarget?: MesoStatusNextTarget\n className?: string\n}\n\nfunction clamp01(value: number): number {\n if (!Number.isFinite(value)) return 0\n if (value < 0) return 0\n if (value > 1) return 1\n return value\n}\n\n/** Marker fill color by gauge zone: teal 0-0.4, amber 0.4-0.7, red 0.7-1.0. */\nfunction getGaugeZoneColor(level: number): string {\n if (level >= 0.7) return ERROR\n if (level >= 0.4) return WARNING\n return SUCCESS\n}\n\n/** Splits `text` into nodes, bolding any segment that exactly matches a highlight. */\nfunction renderCoachingText(text: string, highlights?: string[]): ReactNode {\n if (!highlights || highlights.length === 0) return text\n const escaped = highlights\n .filter(Boolean)\n .map((h) => h.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'))\n if (escaped.length === 0) return text\n const regex = new RegExp(`(${escaped.join('|')})`, 'g')\n return text.split(regex).map((part, index) =>\n highlights.includes(part) ? (\n <Text\n key={`${part}-${index}`}\n className=\"text-text-primary\"\n style={{ fontWeight: '700' }}\n >\n {part}\n </Text>\n ) : (\n <Fragment key={`t-${index}`}>{part}</Fragment>\n ),\n )\n}\n\nfunction StatusPill({ badge }: { badge: MesoStatusBadge }) {\n const colors = STATUS_VARIANTS[badge.variant]\n return (\n <View\n className=\"flex-row items-center\"\n style={{\n gap: 5,\n paddingVertical: 3,\n paddingHorizontal: 8,\n borderRadius: 4,\n borderWidth: 1,\n backgroundColor: colors.bg,\n borderColor: colors.border,\n }}\n testID=\"meso-status-card-badge\"\n >\n <View accessibilityElementsHidden>\n <StatusDot variant={badge.variant} size=\"sm\" />\n </View>\n <Text\n style={{\n fontSize: 10,\n fontFamily: 'Inter, sans-serif',\n fontWeight: '700',\n letterSpacing: 0.3,\n color: colors.text,\n }}\n >\n {badge.label}\n </Text>\n </View>\n )\n}\n\nfunction MetricCell({ metric }: { metric: MesoStatusMetric }) {\n return (\n <View style={{ width: '48%' }} testID=\"meso-status-card-metric\">\n <Text\n className=\"text-text-tertiary\"\n style={{\n fontSize: 10,\n fontFamily: 'Inter, sans-serif',\n fontWeight: '600',\n letterSpacing: 0.5,\n textTransform: 'uppercase',\n }}\n >\n {metric.label}\n </Text>\n <Text\n className=\"text-text-primary\"\n style={{\n marginTop: 2,\n fontSize: 13,\n fontFamily: 'Inter, sans-serif',\n fontWeight: '600',\n }}\n >\n {metric.value}\n </Text>\n </View>\n )\n}\n\nfunction Gauge({ gauge }: { gauge: MesoStatusGauge }) {\n const level = clamp01(gauge.level)\n const percentage = Math.round(level * 100)\n const markerColor = getGaugeZoneColor(level)\n return (\n <View\n style={{ gap: 6 }}\n accessibilityRole=\"progressbar\"\n accessibilityValue={{ min: 0, max: 100, now: percentage }}\n accessibilityLabel={`${gauge.label}: ${percentage}%`}\n aria-valuenow={percentage}\n aria-valuemin={0}\n aria-valuemax={100}\n testID=\"meso-status-card-gauge\"\n >\n <View\n className=\"flex-row items-center justify-between\"\n accessibilityElementsHidden\n >\n <Text\n className=\"text-text-secondary\"\n style={{\n fontSize: 10,\n fontFamily: 'Inter, sans-serif',\n fontWeight: '500',\n letterSpacing: 0.5,\n textTransform: 'uppercase',\n }}\n >\n {gauge.label}\n </Text>\n {gauge.sublabel != null && (\n <Text\n className=\"text-text-tertiary\"\n style={{\n fontSize: 10,\n fontFamily: 'Inter, sans-serif',\n fontWeight: '500',\n }}\n >\n {gauge.sublabel}\n </Text>\n )}\n </View>\n\n <View\n style={\n {\n height: 8,\n borderRadius: 4,\n position: 'relative',\n backgroundImage: GAUGE_GRADIENT,\n } as ViewStyle\n }\n accessibilityElementsHidden\n >\n <View\n style={{\n position: 'absolute',\n left: '50%',\n top: 0,\n bottom: 0,\n width: 1,\n marginLeft: -0.5,\n backgroundColor: 'rgba(255,255,255,0.3)',\n }}\n testID=\"meso-status-card-gauge-center\"\n />\n <View\n className=\"border-text-primary\"\n style={{\n position: 'absolute',\n left: `${percentage}%`,\n top: -3,\n marginLeft: -7,\n width: 14,\n height: 14,\n borderRadius: 9999,\n borderWidth: 2,\n backgroundColor: markerColor,\n boxShadow: '0 0 4px rgba(0,0,0,0.5)',\n }}\n testID=\"meso-status-card-gauge-marker\"\n />\n </View>\n </View>\n )\n}\n\n/**\n * Mesocycle context card for a specific exercise: prescription vs actual\n * metrics, intensity/volume gauges, and coaching guidance. Composes the titan\n * `Card` plus the Workout `StatusDot`, and renders the §25 gauge (8px track,\n * 50% center line, 14px marker) inline since that visual differs from the\n * IntensityBar/DeviationBar primitives.\n *\n * @example\n * <MesoStatusCard\n * mesoName=\"Hypertrophy Block\"\n * mesoSubtitle=\"Week 6 of 8 · Upper/Lower\"\n * statusBadge={{ label: 'On Track', variant: 'success' }}\n * metrics={[\n * { label: 'Prescribed', value: '3×8 @ RPE 8' },\n * { label: 'Actual', value: '3×8 @ 185 lbs' },\n * ]}\n * gauges={[{ label: 'Intensity', level: 0.7, sublabel: 'Actual' }]}\n * coaching={{ text: 'Add load next session.', highlights: ['Add load'] }}\n * nextTarget={{ icon: '→', text: '190 lbs × 8' }}\n * />\n */\nexport function MesoStatusCard({\n mesoName,\n mesoSubtitle,\n statusBadge,\n metrics,\n gauges,\n coaching,\n nextTarget,\n className,\n ...props\n}: MesoStatusCardProps) {\n return (\n <Card\n variant=\"outline\"\n elevation={1}\n borderColor={BRAND_PRIMARY_DARK}\n className={className}\n style={\n {\n borderColor: BRAND_PRIMARY_DARK,\n borderWidth: 1,\n backgroundImage: CARD_GRADIENT,\n } as ViewStyle\n }\n role=\"article\"\n aria-label={`Mesocycle status for ${mesoName}`}\n testID=\"meso-status-card\"\n {...props}\n >\n <View\n className=\"flex-row\"\n style={{ position: 'absolute', top: 0, left: 0, right: 0, height: 3, zIndex: 1 }}\n accessibilityElementsHidden\n testID=\"meso-status-card-accent\"\n >\n {ACCENT_STOPS.map((color) => (\n <View key={color} style={{ flex: 1, backgroundColor: color }} />\n ))}\n </View>\n\n <View style={{ padding: 14, gap: 14 }} testID=\"meso-status-card-body\">\n <View testID=\"meso-status-card-header\">\n <View\n className=\"flex-row items-center justify-between\"\n style={{ gap: 8 }}\n >\n <Text\n className=\"text-text-primary\"\n style={{\n flexShrink: 1,\n fontSize: 15,\n fontFamily: '\"Space Grotesk\", sans-serif',\n fontWeight: '700',\n }}\n testID=\"meso-status-card-name\"\n >\n {mesoName}\n </Text>\n <StatusPill badge={statusBadge} />\n </View>\n <Text\n className=\"text-text-secondary\"\n style={{\n marginTop: 4,\n fontSize: 12,\n fontFamily: 'Inter, sans-serif',\n }}\n testID=\"meso-status-card-subtitle\"\n >\n {mesoSubtitle}\n </Text>\n </View>\n\n {metrics.length > 0 && (\n <View\n className=\"flex-row flex-wrap\"\n style={{ gap: 8 }}\n testID=\"meso-status-card-metrics\"\n >\n {metrics.map((metric, index) => (\n <MetricCell key={`${metric.label}-${index}`} metric={metric} />\n ))}\n </View>\n )}\n\n {gauges.length > 0 && (\n <View style={{ gap: 12 }} testID=\"meso-status-card-gauges\">\n {gauges.map((gauge, index) => (\n <Gauge key={`${gauge.label}-${index}`} gauge={gauge} />\n ))}\n </View>\n )}\n\n {coaching != null && (\n <View\n style={{\n backgroundColor: 'rgba(249,180,21,0.06)',\n borderWidth: 1,\n borderColor: 'rgba(249,180,21,0.15)',\n borderRadius: 8,\n paddingVertical: 10,\n paddingHorizontal: 12,\n }}\n testID=\"meso-status-card-coaching\"\n >\n <Text\n className=\"text-text-secondary\"\n style={{\n fontSize: 12,\n lineHeight: 17,\n fontFamily: 'Inter, sans-serif',\n }}\n >\n {renderCoachingText(coaching.text, coaching.highlights)}\n </Text>\n </View>\n )}\n\n {nextTarget != null && (\n <View\n className=\"flex-row items-center\"\n style={{\n gap: 8,\n backgroundColor: 'rgba(46,213,115,0.06)',\n borderWidth: 1,\n borderColor: 'rgba(46,213,115,0.2)',\n borderRadius: 8,\n paddingVertical: 10,\n paddingHorizontal: 12,\n }}\n testID=\"meso-status-card-next-target\"\n >\n <Text style={{ fontSize: 14, color: SUCCESS }} accessibilityElementsHidden>\n {nextTarget.icon}\n </Text>\n <Text\n style={{\n flexShrink: 1,\n fontSize: 12,\n fontFamily: 'Inter, sans-serif',\n fontWeight: '600',\n color: SUCCESS,\n }}\n >\n {nextTarget.text}\n </Text>\n </View>\n )}\n </View>\n </Card>\n )\n}\n","// Font mapping: font-heading=Space Grotesk, font-body=Nunito Sans (UI), font-sans=Inter (body)\nimport { useMemo, useState } from 'react'\nimport { View, Text, type ViewProps } from 'react-native'\nimport { BodyMap, type BodyMapData } from './BodyMap'\nimport {\n BodyMapDetailPanel,\n type ContributingExercise,\n type UpcomingExercise,\n} from './BodyMapDetailPanel'\nimport { MesoStatusCard, type MesoStatusCardProps } from './MesoStatusCard'\nimport {\n MuscleGroup,\n VOLUME_STATUS_LABELS,\n getHeatmapColor,\n type VolumeLandmarks,\n type VolumeStatus,\n} from './muscleTaxonomy'\n\n/** Volume statuses in display order for the legend and summary cards. */\nconst STATUS_ORDER: VolumeStatus[] = ['under', 'maintenance', 'productive', 'over']\n\n/** One muscle's full volume picture — feeds the body maps and the detail panel. */\nexport interface TrainingStatusMuscle {\n /** Detailed muscle group (drives the SVG heatmap + panel identity). */\n muscleGroup: MuscleGroup\n /** Human-readable name for the legend, summary, and panel title. */\n displayName: string\n /** Which body-map view the muscle belongs to. */\n side: 'front' | 'back'\n /** Heatmap intensity 0-1. */\n intensity: number\n /** Weekly-volume status relative to the landmarks. */\n volumeStatus: VolumeStatus\n /** Weekly effective sets logged. */\n weeklySets: number\n /** Volume landmarks (weekly working sets). */\n landmarks: VolumeLandmarks\n /** Last trained label, e.g. \"2 days ago\". */\n lastTrained?: string\n /** Weekly volume history for the panel sparkline. */\n weeklyHistory?: number[]\n /** Exercises contributing to this muscle's volume. */\n contributingExercises?: ContributingExercise[]\n /** Upcoming exercises targeting this muscle. */\n upcomingExercises?: UpcomingExercise[]\n}\n\n/** Derived, page-level roll-up of the tracked muscles. */\nexport interface TrainingStatusSummary {\n /** Total weekly effective sets across all tracked muscles. */\n totalWeeklySets: number\n /** Number of muscles being tracked. */\n trackedMuscles: number\n /** Count of muscles per volume status. */\n statusCounts: Record<VolumeStatus, number>\n}\n\nexport interface TrainingStatusPageProps extends ViewProps {\n /** Page heading. */\n title?: string\n /** Mesocycle context banner shown at the top. */\n meso: MesoStatusCardProps\n /** Muscles tracked this week. */\n muscles: TrainingStatusMuscle[]\n className?: string\n}\n\n/** Roll up per-muscle rows into the page summary (pure, testable). */\nexport function deriveTrainingSummary(muscles: TrainingStatusMuscle[]): TrainingStatusSummary {\n const statusCounts: Record<VolumeStatus, number> = {\n under: 0,\n maintenance: 0,\n productive: 0,\n over: 0,\n }\n let totalWeeklySets = 0\n for (const muscle of muscles) {\n totalWeeklySets += muscle.weeklySets\n statusCounts[muscle.volumeStatus] += 1\n }\n return { totalWeeklySets, trackedMuscles: muscles.length, statusCounts }\n}\n\n/** Project the muscle rows for one side into `BodyMap` heatmap data. */\nexport function toBodyMapData(\n muscles: TrainingStatusMuscle[],\n side: 'front' | 'back'\n): BodyMapData[] {\n return muscles\n .filter((muscle) => muscle.side === side)\n .map(({ muscleGroup, intensity, volumeStatus, weeklySets }) => ({\n muscleGroup,\n intensity,\n volumeStatus,\n weeklySets,\n }))\n}\n\nconst SUMMARY_CARDS: Array<{\n key: keyof TrainingStatusSummary['statusCounts'] | 'total'\n label: string\n}> = [\n { key: 'total', label: 'Weekly Sets' },\n { key: 'productive', label: 'Productive' },\n { key: 'under', label: 'Under' },\n { key: 'over', label: 'Over' },\n]\n\nfunction SummaryCards({ summary }: { summary: TrainingStatusSummary }) {\n return (\n <View className=\"flex-row flex-wrap\" style={{ gap: 8 }} testID=\"training-status-page-summary\">\n {SUMMARY_CARDS.map(({ key, label }) => {\n const value = key === 'total' ? summary.totalWeeklySets : summary.statusCounts[key]\n return (\n <View\n key={key}\n className=\"bg-surface-elevated border-hairline\"\n style={{\n flexGrow: 1,\n flexBasis: '46%',\n padding: 12,\n borderRadius: 10,\n borderWidth: 1,\n }}\n testID={`training-status-page-summary-${key}`}\n >\n <Text\n className=\"text-text-primary\"\n style={{\n fontSize: 22,\n fontFamily: '\"Space Grotesk\", sans-serif',\n fontWeight: '700',\n }}\n >\n {value}\n </Text>\n <Text\n className=\"text-text-tertiary\"\n style={{\n marginTop: 2,\n fontSize: 11,\n fontFamily: 'Inter, sans-serif',\n fontWeight: '600',\n letterSpacing: 0.4,\n textTransform: 'uppercase',\n }}\n >\n {label}\n </Text>\n </View>\n )\n })}\n </View>\n )\n}\n\nfunction StatusLegend() {\n return (\n <View\n className=\"flex-row flex-wrap\"\n style={{ gap: 10, justifyContent: 'center' }}\n testID=\"training-status-page-legend\"\n >\n {STATUS_ORDER.map((status) => (\n <View\n key={status}\n className=\"flex-row items-center\"\n style={{ gap: 5 }}\n testID={`training-status-page-legend-${status}`}\n >\n <View\n style={{\n width: 8,\n height: 8,\n borderRadius: 9999,\n backgroundColor: getHeatmapColor(status, 0.6),\n }}\n accessibilityElementsHidden\n />\n <Text\n className=\"text-text-secondary\"\n style={{\n fontSize: 11,\n fontFamily: 'Inter, sans-serif',\n textTransform: 'capitalize',\n }}\n >\n {VOLUME_STATUS_LABELS[status]}\n </Text>\n </View>\n ))}\n </View>\n )\n}\n\ninterface BodyMapColumnProps {\n side: 'front' | 'back'\n muscles: TrainingStatusMuscle[]\n selected: MuscleGroup | null\n onSelect: (muscle: MuscleGroup) => void\n}\n\nfunction BodyMapColumn({ side, muscles, selected, onSelect }: BodyMapColumnProps) {\n const data = useMemo(() => toBodyMapData(muscles, side), [muscles, side])\n return (\n <View style={{ flexGrow: 1, flexBasis: '46%' }} testID={`training-status-page-bodymap-${side}`}>\n <BodyMap\n data={data}\n view={side}\n onMusclePress={onSelect}\n highlightedMuscle={selected}\n mode=\"detailed\"\n />\n </View>\n )\n}\n\n/**\n * TrainingStatusPage — a body-map training dashboard that composes the\n * mesocycle context banner (`MesoStatusCard`), side-by-side front/back\n * `BodyMap`s with a shared heatmap legend, per-status summary cards, and a\n * tap-to-detail `BodyMapDetailPanel`. Tapping any muscle (SVG or legend chip)\n * opens the slide-up panel for that group; the summary is derived from the\n * supplied muscle rows.\n *\n * @example\n * <TrainingStatusPage meso={meso} muscles={muscles} />\n */\nexport function TrainingStatusPage({\n title = 'Training Status',\n meso,\n muscles,\n className,\n ...props\n}: TrainingStatusPageProps) {\n const [selected, setSelected] = useState<MuscleGroup | null>(null)\n const summary = useMemo(() => deriveTrainingSummary(muscles), [muscles])\n const active = selected != null ? (muscles.find((m) => m.muscleGroup === selected) ?? null) : null\n\n return (\n <View\n className={['bg-background-base', className].filter(Boolean).join(' ')}\n style={{ position: 'relative', width: 390 }}\n accessibilityRole={'main' as ViewProps['accessibilityRole']}\n aria-label={title}\n testID=\"training-status-page\"\n {...props}\n >\n <View style={{ padding: 16, gap: 16 }} testID=\"training-status-page-content\">\n <Text\n accessibilityRole=\"header\"\n className=\"text-text-primary\"\n style={{\n fontSize: 20,\n fontFamily: '\"Space Grotesk\", sans-serif',\n fontWeight: '700',\n }}\n testID=\"training-status-page-title\"\n >\n {title}\n </Text>\n\n <MesoStatusCard {...meso} />\n\n <SummaryCards summary={summary} />\n\n <View\n className=\"bg-surface-elevated border-hairline\"\n style={{\n borderWidth: 1,\n borderRadius: 12,\n padding: 12,\n gap: 12,\n }}\n testID=\"training-status-page-bodymaps\"\n >\n <View className=\"flex-row\" style={{ gap: 8 }}>\n <BodyMapColumn\n side=\"front\"\n muscles={muscles}\n selected={selected}\n onSelect={setSelected}\n />\n <BodyMapColumn\n side=\"back\"\n muscles={muscles}\n selected={selected}\n onSelect={setSelected}\n />\n </View>\n <StatusLegend />\n </View>\n </View>\n\n {active != null && (\n <BodyMapDetailPanel\n muscleGroup={active.muscleGroup}\n displayName={active.displayName}\n weeklySets={active.weeklySets}\n landmarks={active.landmarks}\n volumeStatus={active.volumeStatus}\n lastTrained={active.lastTrained}\n weeklyHistory={active.weeklyHistory}\n contributingExercises={active.contributingExercises}\n upcomingExercises={active.upcomingExercises}\n isOpen\n onClose={() => setSelected(null)}\n />\n )}\n </View>\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/utils/cn.ts","../src/theme/tokens/primitives.ts","../src/theme/tokens/semantic.ts","../src/theme/resolve-color.ts","../src/theme/color-utils.ts","../src/utils/colors.ts","../src/theme/materials.ts","../src/theme/lift.ts","../src/theme/surface-planes.ts","../src/theme/elevation.ts","../src/theme/workout-tokens.ts","../src/components/custom/Workout/muscleTaxonomy.ts","../src/web-jsx/jsx-runtime.ts","../src/components/custom/Workout/BodyMap.tsx","../src/components/ui/indicator/Indicator.tsx","../src/components/ui/pill/Pill.tsx","../src/components/ui/badge/Badge.tsx","../src/components/custom/Typography/Typography.tsx","../src/components/custom/Workout/Sparkline.tsx","../src/components/custom/Workout/BodyMapDetailPanel.tsx","../src/components/ui/surface/SurfaceContext.ts","../src/components/ui/surface/resolveSurface.ts","../src/components/ui/card/Card.tsx","../src/components/custom/Workout/StatusDot.tsx","../src/theme/extracted-colors-dataviz.ts","../src/components/custom/Workout/MesoStatusCard.tsx","../src/components/custom/Workout/TrainingStatusPage.tsx"],"names":["alpha","Platform","MuscleGroup","SimpleMuscleGroup","cn","reactJsx","reactJsxs","View","sizeStyles","Fragment","Text","Pressable","colorToTone","colorStyles","t","BRAND_PRIMARY","useState","Animated","useEffect","Easing","useMemo","glowColors","clamp01"],"mappings":";;;;;;;;AAW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AAAA,sBACA,QAAA,EAAU;AAAA;AAAA,mBACZ;AAAA,kCACA,GAAA;AAAA,oBAAC,aAAA;AAAA,oBAAA;AAAA,sBACC,IAAA,EAAK,MAAA;AAAA,sBACL,OAAA;AAAA,sBACA,QAAA;AAAA,sBACA,QAAA,EAAU;AAAA;AAAA;AACZ,iBAAA,EACF,CAAA;AAAA,oCACC,YAAA,EAAA,EAAa;AAAA;AAAA;AAAA;AAChB,SAAA,EACF,CAAA;AAAA,QAEC,UAAU,IAAA,oBACT,GAAA;AAAA,UAAC,kBAAA;AAAA,UAAA;AAAA,YACC,aAAa,MAAA,CAAO,WAAA;AAAA,YACpB,aAAa,MAAA,CAAO,WAAA;AAAA,YACpB,YAAY,MAAA,CAAO,UAAA;AAAA,YACnB,WAAW,MAAA,CAAO,SAAA;AAAA,YAClB,cAAc,MAAA,CAAO,YAAA;AAAA,YACrB,aAAa,MAAA,CAAO,WAAA;AAAA,YACpB,eAAe,MAAA,CAAO,aAAA;AAAA,YACtB,uBAAuB,MAAA,CAAO,qBAAA;AAAA,YAC9B,mBAAmB,MAAA,CAAO,iBAAA;AAAA,YAC1B,MAAA,EAAM,IAAA;AAAA,YACN,OAAA,EAAS,MAAM,WAAA,CAAY,IAAI;AAAA;AAAA;AACjC;AAAA;AAAA,GAEJ;AAEJ","file":"bodymap.mjs","sourcesContent":["import { clsx, type ClassValue } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\n/**\n * Utility function to merge Tailwind CSS classes with proper conflict resolution.\n * Combines clsx for conditional classes with tailwind-merge for deduplication.\n *\n * @example\n * cn('p-4 bg-red-500', isActive && 'bg-blue-500', className)\n * // If isActive is true, returns 'p-4 bg-blue-500' (not 'p-4 bg-red-500 bg-blue-500')\n */\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs))\n}\n","/**\n * Primitive Design Tokens\n *\n * Raw values with no semantic meaning. These are the foundation of the design system\n * and should rarely be used directly in components. Use semantic tokens instead.\n */\n\n/**\n * Absolute colour keywords.\n *\n * This used to hold five scales — `blue`, `red`, `redVivid`, `neutral` and\n * `charcoal`. All five are gone (TD-07.14): the greys folded into `greyRamp`\n * below and the chromatics into the OKLCH `primitiveRamps`. What is left has no\n * scale because these three are not colours you tune, they are keywords.\n */\nexport const primitiveColors = {\n white: '#FFFFFF',\n black: '#000000',\n transparent: 'transparent',\n} as const\n\n/**\n * The vivid alert red: the one chromatic anchor outside the OKLCH ramps.\n *\n * It survived the TD-07.14 fold of the old `redVivid` scale only as the\n * `-rgb`, `-subtle` and glow encodings of `status-error-vivid`, while the token\n * itself was pinned to `red[600]` and collapsed onto `status-error`. Owning it\n * here means the semantic layer references a primitive instead of carrying a\n * literal. The red ramp has no step this saturated, and adding one means\n * regenerating the ramp, so it stays a pin.\n */\nexport const alertRedVivid = '#FF4757' as const\n\n/**\n * Result/outcome palette anchors (VW-83): Material-style green/red/grey chosen\n * for the result-improve/-degrade/-inconclusive tokens. No `primitiveRamps` step\n * matches any of these exactly (the ramps are OKLCH-generated with a different\n * hue/chroma arc), so they are pinned by name here rather than left as raw hex\n * in semantic.ts — same pattern as {@link alertRedVivid}.\n */\nexport const resultPaletteColors = {\n improve: '#4caf50',\n improveDark: '#248a24',\n degrade: '#ef5350',\n degradeDark: '#b30000',\n inconclusive: '#9E9A97',\n} as const\n\n/**\n * One-off semantic literals (VW-83) with no exact `greyRamp`/`primitiveRamps`\n * match, pinned by name instead of left as raw hex in semantic.ts.\n */\nexport const semanticPins = {\n // Cool navy-black; darker and more blue-shifted than any warm greyRamp step.\n textPrimaryLight: '#121828',\n // Cool blue-grey; outside greyRamp's warm (R>=G>=B) scale.\n textSecondaryLight: '#65748B',\n // Pure neutral grey (R=G=B); no warm greyRamp step lands on it exactly.\n backgroundBaseLight: '#EBEBEB',\n // Near-neutral grey, kept one step off backgroundBaseLight by design.\n dividerLight: '#E8E9EB',\n // Periwinkle/indigo; more purple than any primitiveRamps.blue step. Shared by\n // dark-mode text-link, border-focus and border-input-focus.\n focusIndigoDark: '#828DF8',\n} as const\n\n/**\n * Unified warm-neutral grey ramp (TD-07.14)\n *\n * The ONE achromatic scale. Regenerate with `scripts/generate-grey-ramp.mjs` —\n * preserve the generator, not just the hexes.\n *\n * The surface planes ARE steps here rather than a parallel object: `850` is\n * overlay, `975` is the bezel. That is the whole point of the ramp. `grey`,\n * `neutral`, `surfaceRampDark` and `backgroundFrameDark` all resolve into it,\n * which is why every plane step below is byte-identical to the value that\n * shipped in v0.10.0 — the surfaces do not move, only their names.\n *\n * TWO THINGS ABOUT THE NUMBERING, both deliberate and both previously re-derived\n * from scratch more than once because they were never written down:\n *\n * 1. `975` sits BELOW the standard grid. `canonL` — the median L* of the seven\n * chromatic `primitiveRamps` at each step — ends at L*10.3, which is step\n * `950`. The bezel is L*3.8, darker than the grid's last rung, so there is\n * simply no step number left for it and `975` extends past the end.\n * 2. `850`/`875` are quarter-steps because overlay/raised/elevated are only\n * ~2.7 L* apart and all three collide on `900` at normal resolution. `800`\n * is a generated bridge between `700` (L*37.9) and overlay (L*22.7) so the\n * spacing stays even across the join.\n *\n * There is no `inset`. It was retired, not renamed: at ΔE 1.10 from `975` it was\n * an imperceptible duplicate of the frame, which is exactly why `<Surface pressed>`\n * (surface − 1) kept collapsing into it. `975` is the floor.\n *\n * Spec, generator and the rejected v1/v2 cuts:\n * sources/design/foundations/warm-grey-ramp/\n */\nexport const greyRamp = {\n 50: '#F9F6F3', // L*97.0 W6\n 100: '#EDEAE7', // L*92.8 W6\n 200: '#D4D1CE', // L*84.0 W6 — warm silver\n 300: '#BDBAB7', // L*75.7 W6\n 400: '#A29F9D', // L*65.7 W5\n 500: '#888684', // L*56.0 W4\n 600: '#72716F', // L*47.7 W3\n 700: '#5A5958', // L*37.9 W2\n 800: '#424140', // L*27.6 W2 — generated bridge\n 850: '#373635', // L*22.7 W2 — surface overlay\n 875: '#31302F', // L*19.9 W2 — surface raised\n 900: '#2C2A28', // L*17.2 W4 — surface elevated\n 925: '#252321', // L*13.9 W4 — surface base\n 950: '#1C1916', // L*9.0 W6 — background base / shell\n 975: '#100D0A', // L*3.8 W6 — background frame / bezel\n} as const\n\n/**\n * The surface planes, as ramp steps — the mapping `<Surface level>` resolves through.\n *\n * Ordered darkest -> lightest, which is the order `pressedLevel()` walks.\n */\nexport const SURFACE_PLANE_STEPS = {\n frame: 975,\n background: 950,\n base: 925,\n elevated: 900,\n raised: 875,\n overlay: 850,\n} as const\n\n/**\n * Derived tonal ramps (TD-05.09 color foundations)\n *\n * Seven OKLCH-generated hue ramps, 11 perceptual lightness steps each (50 -> 950).\n * Built with hue-torsion + a chroma arc, anchored through existing brand/semantic\n * hexes. `pin` marks the step each ramp flows through its anchor.\n * This is the single source of truth for chromatic hexes — the categorical palette\n * below references these steps rather than duplicating values.\n * See sources/design/foundations.\n */\nexport const primitiveRamps = {\n red: {\n 50: '#FFF4F4',\n 100: '#FFE3E5',\n 200: '#FFC2C5',\n 300: '#FF9A9D',\n 400: '#F77175',\n 500: '#E05254',\n 600: '#D14343', // pin\n 700: '#A4221C',\n 800: '#7E1002',\n 900: '#5A0900',\n 950: '#3D0400',\n },\n orange: {\n 50: '#FFF5ED',\n 100: '#FFE6D4',\n 200: '#FFC7A2',\n 300: '#FFA063',\n 400: '#FF7900', // pin\n 500: '#DA5F00',\n 600: '#B94A00',\n 700: '#983804',\n 800: '#6F290F',\n 900: '#4E1C0C',\n 950: '#331107',\n },\n amber: {\n 50: '#FFF7DD',\n 100: '#FFEAA9',\n 200: '#FFD352',\n 300: '#F9B415', // pin\n 400: '#E08C00',\n 500: '#C27400',\n 600: '#A45E00',\n 700: '#814D14',\n 800: '#5B3A1A',\n 900: '#442503',\n 950: '#301500',\n },\n green: {\n 50: '#E3FFEE',\n 100: '#B5FFD2',\n 200: '#58F69E',\n 300: '#2ED573', // pin\n 400: '#21C05D',\n 500: '#22A444',\n 600: '#298732',\n 700: '#2B6B25',\n 800: '#264D1C',\n 900: '#1B3515',\n 950: '#11220D',\n },\n cyan: {\n 50: '#E6FBFF',\n 100: '#C2F6FF',\n 200: '#62EAFF',\n 300: '#22D3EE', // pin\n 400: '#01B5D1',\n 500: '#2697B7',\n 600: '#307B9B',\n 700: '#2A617F',\n 800: '#22465F',\n 900: '#0B3149',\n 950: '#001F36',\n },\n blue: {\n 50: '#EFF8FF',\n 100: '#D9EFFF',\n 200: '#ACDBFF',\n 300: '#78C2FF',\n 400: '#3CA8FF',\n 500: '#2196F3', // pin\n 600: '#1072CB',\n 700: '#135AA8',\n 800: '#14407E',\n 900: '#112C5A',\n 950: '#091B3C',\n },\n magenta: {\n 50: '#FFF3F9',\n 100: '#FFE2F1',\n 200: '#FFBDE2',\n 300: '#FF8FD5',\n 400: '#ED69C3',\n 500: '#D548AF',\n 600: '#BA2996',\n 700: '#9C0D7A', // pin\n 800: '#77005A',\n 900: '#56003F',\n 950: '#3B0029',\n },\n} as const\n\n/**\n * Categorical (qualitative) palette — an ordered, CVD-safe series expressed as\n * references into {@link primitiveRamps} (one source of truth; the palette moves\n * with the ramps).\n *\n * Design: a single canonical hue order (blue, magenta, red, orange, green, cyan,\n * amber), with steps chosen vivid-midtone-first and fanned lighter/darker as the\n * series grows to preserve separation. The sequence is nested-stable — a chart\n * with N series uses the first N colors, and the series index is stable as N\n * changes. Colorblind-safe worst-case deuteranopia/protanopia floor 8 holds\n * through {@link CATEGORICAL_CVD_SAFE_MAX} colors; the 7th is an extended color\n * that should be paired with a legend or other secondary encoding.\n *\n * Two variants: `default` (vivid, sits on neutral/light surfaces, legible under\n * black text) and `dark` (deeper shades legible under white text on a fill). A\n * separate \"light\" variant was dropped — the vivid `default` picks already clear\n * black-text contrast, so it doubles as the light-context palette.\n */\nexport const categoricalPalette = {\n default: [\n primitiveRamps.blue[500],\n primitiveRamps.magenta[500],\n primitiveRamps.red[500],\n primitiveRamps.orange[400],\n primitiveRamps.green[300],\n primitiveRamps.cyan[300],\n primitiveRamps.amber[600], // extended (7th) — pair with a legend\n ],\n dark: [\n primitiveRamps.blue[600],\n primitiveRamps.magenta[600],\n primitiveRamps.red[500],\n primitiveRamps.orange[600],\n primitiveRamps.green[800],\n primitiveRamps.cyan[800],\n primitiveRamps.amber[500], // extended (7th) — pair with a legend\n ],\n} as const\n\n/** Largest series count that holds the CVD floor without a legend. */\nexport const CATEGORICAL_CVD_SAFE_MAX = 6\n\n/**\n * Categorical palette variant.\n * - `default` : vivid; neutral/light surfaces, legible under black text\n * - `dark` : deeper shades, legible under white text on a filled swatch\n */\nexport type CategoricalVariant = keyof typeof categoricalPalette\n\n/**\n * Get a color from the ordered categorical palette by series index.\n * The palette is nested-stable, so the color for a given index does not change\n * with the total series count; `index` simply wraps past the end.\n *\n * @param index - 0-based series index (wraps past the end)\n * @param variant - `default` (black-text / light surfaces) or `dark` (white text)\n * @returns The hex color string\n */\nexport function getCategoricalColor(\n index: number,\n variant: CategoricalVariant = 'default'\n): string {\n const palette = categoricalPalette[variant]\n index = Math.max(0, Math.floor(index))\n return palette[index % palette.length]\n}\n\n/**\n * Diverging status scale (BodyMap training-status: under → optimal → over) as\n * references into {@link primitiveRamps}. A true diverging shape — `optimal` is\n * the lightest center, the extremes go darker — so the signal reads in lightness\n * (colorblind-robust; worst-case deut/protanopia min ΔE ~10.9) and the direction\n * reads in the blue↔red axis (the CVD-safe hue pair).\n *\n * Tuned so every stop is dark enough for the fill yet light enough that BLACK\n * text clears 4.5:1 on all five — no per-cell white/black flipping. The value\n * valley is symmetric: the two mid-arms (maintenance / approaching) sit at equal\n * lightness (both ~0.53 relative luminance), the ends darker.\n */\nexport const divergingScale = [\n primitiveRamps.blue[500], // under\n primitiveRamps.cyan[300], // maintenance\n primitiveRamps.green[200], // optimal (light center)\n primitiveRamps.amber[300], // approaching\n primitiveRamps.red[600], // over\n] as const\n\n/**\n * Sequential \"effort\" scale (low → high intensity: green → yellow → orange → red)\n * as references into {@link primitiveRamps}. A 6-stop ordinal palette; the\n * velocity/RPE strip sub-samples it. Every adjacent pair clears the CVD floor\n * (min deut/protan ΔE ≥ 4.5), and within that the hue walk is kept smooth —\n * the amber-200 → amber-300 → orange-400 run steps the yellow→orange transition\n * gradually rather than lurching. Order encodes magnitude, so it tolerates the\n * green↔red CVD pair. Stops 0–3 take black text; the dark reds take white.\n */\nexport const sequentialEffort = [\n primitiveRamps.green[300],\n primitiveRamps.amber[200],\n primitiveRamps.amber[300],\n primitiveRamps.orange[400],\n primitiveRamps.red[600],\n primitiveRamps.red[700],\n] as const\n\n/**\n * Best-contrast text color (black or white) for a solid fill — for labels sitting\n * on categorical/diverging/effort swatches. Uses the WCAG relative-luminance ratio.\n */\nexport function bestTextColor(hex: string): '#000000' | '#FFFFFF' {\n const [r, g, b] = [0, 2, 4].map((i) => {\n const c = parseInt(hex.replace('#', '').slice(i, i + 2), 16) / 255\n return c >= 0.04045 ? ((c + 0.055) / 1.055) ** 2.4 : c / 12.92\n })\n const l = 0.2126 * r + 0.7152 * g + 0.0722 * b\n return (l + 0.05) / 0.05 >= 1.05 / (l + 0.05) ? '#000000' : '#FFFFFF'\n}\n\n/**\n * Discrete rainbow palette for data visualization\n * Based on Paul Tol's color schemes: https://personal.sron.nl/~pault/#fig:scheme_rainbow_discrete\n */\nexport const discreteRainbow = [\n '#E8ECFB',\n '#D9CCE3',\n '#D1BBD7',\n '#CAACCB',\n '#BA8DB4',\n '#AE76A3',\n '#AA6F9E',\n '#994F88',\n '#882E72',\n '#1965B0',\n '#437DBF',\n '#5289C7',\n '#6195CF',\n '#7BAFDE',\n '#4EB265',\n '#90C987',\n '#CAE0AB',\n '#F7F056',\n '#F7CB45',\n '#F6C141',\n '#F4A736',\n '#F1932D',\n '#EE8026',\n '#E8601C',\n '#E65518',\n '#DC050C',\n '#A5170E',\n '#72190E',\n '#42150A',\n] as const\n\n/**\n * Palette indices for discrete rainbow colors at different palette sizes.\n * For a given palette size (index + 1), returns the indices of colors to use.\n */\nconst discreteRainbowPalettes: number[][] = [\n [10],\n [10, 26],\n [10, 18, 26],\n [10, 15, 18, 26],\n [10, 14, 15, 18, 26],\n [10, 14, 15, 17, 18, 26],\n [9, 10, 14, 15, 17, 18, 26],\n [9, 10, 14, 15, 17, 18, 23, 26],\n [9, 10, 14, 15, 17, 18, 23, 26, 28],\n [9, 10, 14, 15, 17, 18, 21, 24, 26, 28],\n [9, 10, 12, 14, 15, 17, 18, 21, 24, 26, 28],\n [3, 6, 9, 10, 12, 14, 15, 17, 18, 21, 24, 26],\n [3, 6, 9, 10, 12, 14, 15, 16, 17, 18, 21, 24, 26],\n [3, 6, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26],\n [3, 6, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26, 28],\n [3, 5, 7, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26, 28],\n [3, 5, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26, 28],\n [3, 5, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26, 27, 28],\n [2, 4, 5, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26, 27, 28],\n [2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 20, 22, 24, 26, 27, 28],\n [2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 21, 23, 25, 26, 27, 28],\n [2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 21, 23, 25, 26, 27, 28, 29],\n [1, 2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 21, 23, 25, 26, 27, 28, 29],\n]\n\n/**\n * Get a color from the discrete rainbow palette for a given index and palette size.\n * Colors are optimized for visual distinction at each palette size.\n *\n * @param index - The index of the color in the series (0-based)\n * @param size - The total number of colors needed (1-23)\n * @returns The hex color string\n */\nexport function getDiscreteRainbowColor(index: number, size: number): string {\n index = Math.max(0, index)\n size = Math.min(Math.max(1, size), discreteRainbowPalettes.length)\n\n const palette = discreteRainbowPalettes[size - 1]\n if (index >= palette.length) index = index % palette.length\n\n return discreteRainbow[palette[index] - 1]\n}\n\nexport const primitiveTypography = {\n fontFamilies: {\n sans: [\n 'Inter',\n '-apple-system',\n 'BlinkMacSystemFont',\n 'Segoe UI',\n 'Helvetica',\n 'Arial',\n 'sans-serif',\n ],\n body: ['Nunito Sans', 'sans-serif'],\n heading: ['Space Grotesk', 'sans-serif'],\n mono: [\n 'SF Mono',\n 'Monaco',\n 'Inconsolata',\n 'Fira Mono',\n 'Droid Sans Mono',\n 'Source Code Pro',\n 'monospace',\n ],\n },\n fontSizes: {\n '2xs': '0.625rem', // 10px\n xs: '0.75rem', // 12px\n sm: '0.875rem', // 14px\n base: '1rem', // 16px\n lg: '1.125rem', // 18px\n xl: '1.5rem', // 24px\n '2xl': '2rem', // 32px\n '3xl': '2.25rem', // 36px\n '4xl': '3rem', // 48px\n '5xl': '3.5rem', // 56px\n },\n fontWeights: {\n normal: 400,\n medium: 500,\n semibold: 600,\n bold: 700,\n },\n lineHeights: {\n none: 1,\n tight: 1.375,\n snug: 1.5,\n normal: 1.57,\n relaxed: 1.66,\n loose: 1.75,\n },\n letterSpacing: {\n tighter: '-0.05em',\n tight: '-0.025em',\n normal: '0em',\n wide: '0.025em',\n wider: '0.05em',\n widest: '0.5px',\n },\n} as const\n\nexport const primitiveSpacing = {\n 0: '0',\n px: '1px',\n 0.5: '0.125rem', // 2px\n 1: '0.25rem', // 4px\n 1.5: '0.375rem', // 6px\n 2: '0.5rem', // 8px\n 2.5: '0.625rem', // 10px\n 3: '0.75rem', // 12px\n 3.5: '0.875rem', // 14px\n 4: '1rem', // 16px\n 5: '1.25rem', // 20px\n 6: '1.5rem', // 24px\n 7: '1.75rem', // 28px\n 8: '2rem', // 32px\n 9: '2.25rem', // 36px\n 10: '2.5rem', // 40px\n 11: '2.75rem', // 44px\n 12: '3rem', // 48px\n 14: '3.5rem', // 56px\n 16: '4rem', // 64px\n 20: '5rem', // 80px\n 24: '6rem', // 96px\n 28: '7rem', // 112px\n 32: '8rem', // 128px\n} as const\n\nexport const primitiveBorderRadius = {\n none: '0',\n sm: '4px',\n DEFAULT: '8px',\n md: '8px',\n lg: '12px',\n xl: '16px',\n '2xl': '24px',\n full: '9999px',\n} as const\n\nexport const primitiveBreakpoints = {\n xs: 0,\n sm: 600,\n md: 1000,\n lg: 1200,\n xl: 1920,\n} as const\n\nexport const primitiveZIndex = {\n hide: -1,\n auto: 'auto',\n base: 0,\n docked: 10,\n dropdown: 1000,\n sticky: 1100,\n drawer: 1100,\n banner: 1200,\n appBar: 1200,\n overlay: 1300,\n modal: 1400,\n popover: 1500,\n skipLink: 1600,\n toast: 1700,\n tooltip: 1800,\n} as const\n","/**\n * Semantic Design Tokens\n *\n * Meaningful tokens following DTCG (Design Tokens Community Group) naming conventions.\n * Pattern: {category}-{intent}-{variant?}-{state?}\n *\n * Categories:\n * - brand-* : Brand colors (primary, secondary, accent)\n * - status-* : Feedback colors (success, error, warning, info)\n * - result-* : Outcome indicators (improve, degrade, inconclusive, neutral)\n * - data-* : Data visualization colors (chart series)\n * - on-* : Text on colored backgrounds\n * - surface-* : Elevated containers (NOT \"paper\")\n * - background-* : Page backgrounds\n * - text-* : Text colors\n * - border-* : Border colors\n * - interactive-* : Hover/focus/active/disabled states\n */\n\nimport {\n primitiveColors as p,\n primitiveRamps as ramp,\n greyRamp,\n discreteRainbow,\n alertRedVivid,\n resultPaletteColors,\n semanticPins,\n} from './primitives'\n\n/**\n * GREY MAPPING (TD-07.14) — how the old cool scales resolved onto `greyRamp`.\n *\n * Every grey below came off `grey` (pure R=G=B) or `neutral` (cool, R−B\n * down to −26). They were snapped by NEAREST L*, not by matching step numbers,\n * because the two old scales were numbered incompatibly: `grey` ran\n * INVERTED and compressed (0 = #6E6E6E lightest, 900 = #101010 darkest), so\n * `grey[400]` and `greyRamp[400]` have nothing to do with each other.\n *\n * grey 200→800 300→900 400→925 500→950\n * neutral 50→50 100→100 300→200 400→400 500→600 600→700 900→950\n *\n * Surfaces move ΔE 1.9–4.8 — at or near imperceptible. The TEXT roles move\n * further (8.6–12.8), and that is the intended part of the change: they are\n * picking up the warmth the surfaces already had.\n *\n * Light gets its own column because strict L*-nearest collapsed `neutral[50]`\n * and `[100]` onto one step, flattening surface-elevated into surface-raised.\n * Light is still deferred as a design question — there is no `surfaceRampLight`.\n *\n * `border-default`, `-subtle` and `-strong` are GONE, replaced by `hairline-*`.\n * Once the planes became ramp steps, every value dark enough to read as a\n * border was also a plane's fill. Alpha composites instead of colliding.\n *\n * `text-tertiary` on dark is the one role that ignores L*-nearest; see it.\n */\n\n// Light mode semantic colors (default)\nexport const semanticColorsLight = {\n // Brand colors (brand-*)\n 'brand-primary': ramp.orange[400],\n 'brand-primary-light': ramp.orange[300],\n 'brand-primary-dark': ramp.orange[500],\n 'brand-primary-subtle': 'rgba(255, 121, 0, 0.08)',\n 'brand-primary-muted': 'rgba(255, 121, 0, 0.30)',\n 'brand-primary-strong': 'rgba(255, 121, 0, 0.50)',\n 'brand-primary-hover': ramp.orange[500],\n 'brand-primary-active': ramp.orange[600],\n\n 'brand-secondary': ramp.cyan[600],\n 'brand-secondary-light': ramp.cyan[500],\n 'brand-secondary-dark': ramp.cyan[700],\n 'brand-secondary-subtle': 'rgba(48, 123, 155, 0.08)',\n 'brand-secondary-muted': 'rgba(48, 123, 155, 0.30)',\n 'brand-secondary-strong': 'rgba(48, 123, 155, 0.50)',\n 'brand-secondary-hover': ramp.cyan[700],\n 'brand-secondary-active': ramp.cyan[800],\n\n // Text on brand backgrounds (on-*)\n 'on-brand-primary': p.white,\n 'on-brand-secondary': p.white,\n\n // Text ON a `-subtle` fill. Light mode keeps today's pairing (the base token) so\n // nothing moves here: light has the same disease mirrored — a light rung on a\n // near-white ramp[50] fill — but correcting it belongs with the light-mode pass\n // in AW-121, not this one.\n 'on-brand-primary-subtle': ramp.orange[400],\n 'on-brand-secondary-subtle': ramp.cyan[600],\n\n // Status colors (status-*)\n 'status-success': ramp.green[300],\n 'status-success-light': ramp.green[200],\n 'status-success-dark': ramp.green[600],\n 'status-success-subtle': ramp.green[50],\n 'status-success-muted': 'rgba(46, 213, 115, 0.30)',\n 'status-success-strong': 'rgba(46, 213, 115, 0.50)',\n\n // Live-session accent — its OWN role, decoupled from success so the two can diverge\n 'status-live': ramp.green[300],\n 'status-live-muted': ramp.green[500],\n\n 'status-error': ramp.red[600],\n 'status-error-light': ramp.red[500],\n 'status-error-dark': ramp.red[700],\n 'status-error-subtle': ramp.red[50],\n 'status-error-muted': 'rgba(209, 67, 67, 0.30)',\n 'status-error-strong': 'rgba(209, 67, 67, 0.50)',\n\n 'status-error-vivid': alertRedVivid, // NOT red[600], that is status-error\n 'status-error-vivid-light': ramp.red[500],\n 'status-error-vivid-dark': ramp.red[700],\n 'status-error-vivid-subtle': 'rgba(255, 71, 87, 0.12)',\n 'status-error-vivid-muted': 'rgba(255, 71, 87, 0.30)',\n 'status-error-vivid-strong': 'rgba(255, 71, 87, 0.50)',\n\n 'status-warning': ramp.amber[300],\n 'status-warning-light': ramp.amber[200],\n 'status-warning-dark': ramp.amber[500],\n 'status-warning-subtle': ramp.amber[50],\n 'status-warning-muted': 'rgba(249, 180, 21, 0.30)',\n 'status-warning-strong': 'rgba(249, 180, 21, 0.50)',\n\n 'status-info': ramp.blue[500],\n 'status-info-light': ramp.blue[300],\n 'status-info-dark': ramp.blue[600],\n 'status-info-subtle': ramp.blue[50],\n 'status-info-muted': 'rgba(33, 150, 243, 0.30)',\n 'status-info-strong': 'rgba(33, 150, 243, 0.50)',\n\n // Text ON a `-subtle` fill — see the on-brand-*-subtle note above.\n 'on-status-success-subtle': ramp.green[300],\n 'on-status-error-subtle': ramp.red[600],\n 'on-status-warning-subtle': ramp.amber[300],\n 'on-status-info-subtle': ramp.blue[500],\n\n // Text on status backgrounds (on-status-*)\n 'on-status-success': p.white,\n 'on-status-error': p.white,\n 'on-status-warning': p.white,\n 'on-status-info': p.white,\n\n // Result/outcome indicators (result-*)\n 'result-improve': resultPaletteColors.improve, // Green - positive outcome\n 'result-improve-light': 'rgba(76, 175, 80, 0.12)',\n 'result-improve-dark': resultPaletteColors.improveDark,\n 'result-degrade': resultPaletteColors.degrade, // Red - negative outcome\n 'result-degrade-light': 'rgba(239, 83, 80, 0.12)',\n 'result-degrade-dark': resultPaletteColors.degradeDark,\n 'result-inconclusive': resultPaletteColors.inconclusive, // Gray - no clear result\n 'result-inconclusive-light': 'rgba(158, 154, 151, 0.12)',\n 'result-neutral': greyRamp[600], // Neutral baseline\n\n // Text on result backgrounds (on-result-*)\n 'on-result-improve': p.white,\n 'on-result-degrade': p.white,\n 'on-result-inconclusive': p.white,\n\n // Data visualization colors (data-*)\n // First 10 colors from discrete rainbow optimized for charts\n 'data-1': discreteRainbow[9], // Blue\n 'data-2': discreteRainbow[14], // Green\n 'data-3': discreteRainbow[17], // Yellow\n 'data-4': discreteRainbow[25], // Red\n 'data-5': discreteRainbow[8], // Purple\n 'data-6': discreteRainbow[20], // Orange\n 'data-7': discreteRainbow[13], // Light Blue\n 'data-8': discreteRainbow[15], // Light Green\n 'data-9': discreteRainbow[3], // Lavender\n 'data-10': discreteRainbow[22], // Dark Orange\n\n // Text colors (text-*)\n 'text-primary': semanticPins.textPrimaryLight,\n 'text-secondary': semanticPins.textSecondaryLight,\n 'text-tertiary': greyRamp[400],\n 'text-disabled': 'rgba(55, 65, 81, 0.48)',\n 'text-inverse': p.white,\n 'text-link': ramp.blue[600],\n 'text-link-hover': ramp.blue[700],\n\n // Surface colors (surface-*) - for elevated containers\n 'surface-base': p.white,\n 'surface-elevated': greyRamp[50], // slightly off-white for elevated cards\n 'surface-raised': greyRamp[100], // light gray for raised cards\n 'surface-overlay': p.white,\n 'surface-input': greyRamp[50], // Input field background (filled variant)\n\n // Background colors (background-*)\n 'background-base': semanticPins.backgroundBaseLight,\n 'background-default': p.white,\n 'background-subtle': greyRamp[50],\n // Frame/bezel chrome — top bar + side nav shell, one step below\n // `background-base`. Placeholder pairing for light mode, which is deferred.\n 'background-frame': greyRamp[400],\n\n // Border colors (border-*)\n 'border-prominent': greyRamp[400], // high-visibility divider\n 'border-focus': ramp.blue[600],\n 'border-input': greyRamp[200], // Input field border\n 'border-input-hover': greyRamp[400], // Input field border on hover\n 'border-input-focus': ramp.blue[600], // Input field border on focus\n 'border-input-error': ramp.red[600], // Input field border on error\n\n // Alpha hairline separators (surface-independent — composite toward black on\n // light surfaces, mirroring the dark-mode white-alpha family). See §4/S-2.\n 'hairline-subtle': 'rgba(0, 0, 0, 0.06)',\n 'hairline-default': 'rgba(0, 0, 0, 0.09)',\n 'hairline-strong': 'rgba(0, 0, 0, 0.14)',\n\n // Interactive states (interactive-*)\n 'interactive-hover': 'rgba(55, 65, 81, 0.04)',\n 'interactive-focus': 'rgba(55, 65, 81, 0.12)',\n 'interactive-active': 'rgba(55, 65, 81, 0.16)',\n 'interactive-selected': 'rgba(55, 65, 81, 0.08)',\n 'interactive-disabled': 'rgba(55, 65, 81, 0.12)',\n 'interactive-disabled-text': 'rgba(55, 65, 81, 0.26)',\n\n // Divider\n divider: semanticPins.dividerLight,\n\n // Avatar default\n 'avatar-background': greyRamp[600],\n 'avatar-text': p.white,\n} as const\n\n// Dark mode semantic colors\nexport const semanticColorsDark = {\n // Brand colors stay the same in dark mode\n 'brand-primary': ramp.orange[400],\n 'brand-primary-light': ramp.orange[300],\n 'brand-primary-dark': ramp.orange[500],\n 'brand-primary-subtle': 'rgba(255, 121, 0, 0.12)',\n 'brand-primary-muted': 'rgba(255, 121, 0, 0.30)',\n 'brand-primary-strong': 'rgba(255, 121, 0, 0.50)',\n 'brand-primary-hover': ramp.orange[300],\n 'brand-primary-active': ramp.orange[200],\n\n 'brand-secondary': ramp.cyan[600],\n 'brand-secondary-light': ramp.cyan[500],\n 'brand-secondary-dark': ramp.cyan[700],\n 'brand-secondary-subtle': 'rgba(34, 211, 238, 0.12)',\n 'brand-secondary-muted': 'rgba(48, 123, 155, 0.30)',\n 'brand-secondary-strong': 'rgba(48, 123, 155, 0.50)',\n 'brand-secondary-hover': ramp.cyan[500],\n 'brand-secondary-active': ramp.cyan[400],\n\n // Text on brand backgrounds\n 'on-brand-primary': p.white,\n 'on-brand-secondary': p.white,\n\n // Text ON a `-subtle` fill. Its own role: `brand-primary` and friends are tuned to\n // carry a white label as a solid fill, which makes the two deepest of them\n // (cyan[600], red[600]) too dark to read as text on a dark plane. Levelling the\n // family at rung 300 puts every tone within OKLCH L 0.769-0.813 instead of\n // 0.550-0.813. Brand is deliberately left at its own orange[400] (operator, AW-133)\n // so the Voltras tone never drifts; it is the one tone under AA on a raised card.\n 'on-brand-primary-subtle': ramp.orange[400],\n 'on-brand-secondary-subtle': ramp.cyan[300],\n\n // Status colors\n 'status-success': ramp.green[300],\n 'status-success-light': ramp.green[200],\n 'status-success-dark': ramp.green[600],\n 'status-success-subtle': 'rgba(46, 213, 115, 0.12)',\n 'status-success-muted': 'rgba(46, 213, 115, 0.30)',\n 'status-success-strong': 'rgba(46, 213, 115, 0.50)',\n\n // Live-session accent — its OWN role, decoupled from success so the two can diverge\n 'status-live': ramp.green[300],\n 'status-live-muted': ramp.green[500],\n\n 'status-error': ramp.red[600],\n 'status-error-light': ramp.red[500],\n 'status-error-dark': ramp.red[700],\n // Alpha 0.08, not the family's 0.12: error's label is red[400], a rung darker than\n // its siblings so it reads RED rather than pink (rung 300 has only 0.121 chroma).\n // Thinning the fill buys back the contrast that extra darkness costs. See AW-133.\n 'status-error-subtle': 'rgba(247, 113, 117, 0.08)',\n 'status-error-muted': 'rgba(209, 67, 67, 0.30)',\n 'status-error-strong': 'rgba(209, 67, 67, 0.50)',\n\n 'status-error-vivid': alertRedVivid,\n 'status-error-vivid-light': ramp.red[500],\n 'status-error-vivid-dark': ramp.red[700],\n 'status-error-vivid-subtle': 'rgba(255, 71, 87, 0.12)',\n 'status-error-vivid-muted': 'rgba(255, 71, 87, 0.30)',\n 'status-error-vivid-strong': 'rgba(255, 71, 87, 0.50)',\n\n 'status-warning': ramp.amber[300],\n 'status-warning-light': ramp.amber[200],\n 'status-warning-dark': ramp.amber[500],\n 'status-warning-subtle': 'rgba(249, 180, 21, 0.12)',\n 'status-warning-muted': 'rgba(249, 180, 21, 0.30)',\n 'status-warning-strong': 'rgba(249, 180, 21, 0.50)',\n\n 'status-info': ramp.blue[500],\n 'status-info-light': ramp.blue[300],\n 'status-info-dark': ramp.blue[600],\n 'status-info-subtle': 'rgba(120, 194, 255, 0.12)',\n 'status-info-muted': 'rgba(33, 150, 243, 0.30)',\n 'status-info-strong': 'rgba(33, 150, 243, 0.50)',\n\n // Text on status backgrounds\n 'on-status-success': p.white,\n 'on-status-error': p.white,\n 'on-status-warning': p.white,\n 'on-status-info': p.white,\n\n // Text ON a `-subtle` fill — see the on-brand-*-subtle note above. Error is the\n // second deliberate exception to the rung-300 rule (operator, AW-133): red[300]\n // levelled perfectly but read PINK, because a red that light can only hold 0.121\n // chroma. red[400] carries 0.165 and reads red; its fill is thinned to compensate.\n 'on-status-success-subtle': ramp.green[300],\n 'on-status-error-subtle': ramp.red[400],\n 'on-status-warning-subtle': ramp.amber[300],\n 'on-status-info-subtle': ramp.blue[300],\n\n // Result/outcome indicators (result-*)\n 'result-improve': resultPaletteColors.improve,\n 'result-improve-light': 'rgba(76, 175, 80, 0.16)',\n 'result-improve-dark': resultPaletteColors.improveDark,\n 'result-degrade': resultPaletteColors.degrade,\n 'result-degrade-light': 'rgba(239, 83, 80, 0.16)',\n 'result-degrade-dark': resultPaletteColors.degradeDark,\n 'result-inconclusive': resultPaletteColors.inconclusive,\n 'result-inconclusive-light': 'rgba(158, 154, 151, 0.16)',\n 'result-neutral': greyRamp[400],\n\n // Text on result backgrounds\n 'on-result-improve': p.white,\n 'on-result-degrade': p.white,\n 'on-result-inconclusive': p.white,\n\n // Data visualization colors (same in dark mode for consistency)\n 'data-1': discreteRainbow[9],\n 'data-2': discreteRainbow[14],\n 'data-3': discreteRainbow[17],\n 'data-4': discreteRainbow[25],\n 'data-5': discreteRainbow[8],\n 'data-6': discreteRainbow[20],\n 'data-7': discreteRainbow[13],\n 'data-8': discreteRainbow[15],\n 'data-9': discreteRainbow[3],\n 'data-10': discreteRainbow[22],\n\n // Text colors - inverted for dark mode\n 'text-primary': greyRamp[50],\n 'text-secondary': greyRamp[400],\n // Deliberately ONE step lighter than the L*-nearest match (`greyRamp[600]`).\n // The colour this replaced failed WCAG large-text outright on the three\n // lightest planes — 2.96 / 2.72 / 2.49 against elevated / raised / overlay —\n // and `600` carried that failure forward almost exactly (2.93 / 2.70 / 2.47).\n // `500` clears 3:1 everywhere (3.32–5.34). Contrast beats colour fidelity for\n // text roles; borders and surfaces still use strict L*-nearest. See\n // semantic-contrast.test.ts, which fails if this is moved back down.\n 'text-tertiary': greyRamp[500],\n 'text-disabled': 'rgba(255, 255, 255, 0.38)',\n 'text-inverse': greyRamp[950],\n 'text-link': semanticPins.focusIndigoDark,\n 'text-link-hover': ramp.blue[400],\n\n // Surface colors - dark backgrounds — warm-tapered DERIVED ramp (TD-surface-tokens,\n // S-1, re-spaced S-3). Shipped verbatim from `deriveSurfaceRamp()` — see\n // `surfaceRampDark` in primitives.ts for the full derivation note. `surface-overlay`\n // and `surface-elevated` are distinct (were both #191919 pre-S-1); `surface-input`\n // tracks one plane above `surface-base`, same relative position as before the remap.\n // `background-base` backs `Surface level=\"background\"` (SurfaceContext.SURFACE_LEVEL_TOKEN),\n // so it takes the ramp's shell role. The deepest plane is `background-frame`,\n // which is also the `SurfaceLevel` floor a pressed surface clamps at.\n 'surface-base': greyRamp[925], // main surface (#252321, L*13.9)\n 'surface-elevated': greyRamp[900], // elevated surface (#2C2A28, L*17.2 — nav/rail)\n 'surface-raised': greyRamp[875], // raised surface (#31302F, L*19.9 — cards)\n 'surface-overlay': greyRamp[850], // overlay surface (#373635, L*22.7 — hero/popover)\n 'surface-input': greyRamp[900], // input surface (#2C2A28 — one plane above base)\n\n // Background colors — same ramp, the frame/shell end of it.\n 'background-base': greyRamp[950], // shell (#1C1916, L*9 — Surface level=\"background\")\n 'background-default': greyRamp[925], // main background (#252321, L*13.9 — matches surface-base)\n 'background-subtle': greyRamp[900], // subtle background (#2C2A28, L*17.2 — matches surface-elevated)\n // Frame/bezel chrome — the top bar + side nav shell, one step BELOW\n // `background-base`. It used to be described as sitting OUTSIDE the ramp; it\n // is simply the ramp's last step now, and the floor `<Surface pressed>` clamps at.\n 'background-frame': greyRamp[975], // frame / bezel (#100D0A, L*3.8)\n\n // Border colors — solid dark borders are RETIRED (TD-07.14). Not a preference — a structural\n // consequence of one ramp. Every step from 850 to 975 is now a surface plane,\n // so a solid border dark enough to read as a border necessarily equals some\n // plane's fill, which is exactly the collision `surface.contract.test.ts` R2\n // forbids. The only non-plane steps left in that band are 800 and 700, and\n // borders there jump from L*~10-25 to L*~28-38 — a restyle, not a migration.\n //\n // So separation moves to the alpha hairlines, which dark mode already called\n // \"the primary separation cue\". Being alpha, they composite against whatever\n // plane they land on and cannot collide with any of them — the problem stops\n // existing rather than being re-solved per plane. The three solid tokens were\n // deleted outright; consumers point at the `hairline-*` family below.\n //\n // `border-prominent` stays SOLID: it is the one border meant to be seen\n // outright (4 call sites, high-visibility dividers), and grey-800 is not a\n // plane, so it keeps its job without collision.\n 'border-prominent': greyRamp[800], // high-visibility divider\n 'border-focus': semanticPins.focusIndigoDark,\n 'border-input': greyRamp[700],\n 'border-input-hover': greyRamp[600],\n 'border-input-focus': semanticPins.focusIndigoDark,\n 'border-input-error': ramp.red[500],\n\n // Alpha hairline separators — the primary separation cue (§4/S-2). Self-\n // normalizing: composites toward white by ~the same amount on ANY plane, so\n // one family works at every elevation instead of per-surface border tokens.\n // Shadows are demoted to floating-overlay use only (not shipped as a fill\n // separator here — see elevation.ts, follow-up S-4).\n //\n // RETUNED on the wall (VW-99, S-6). The original .06/.09/.14 were set at a\n // desk. On the panel at ~3 m `subtle` rendered but was indiscernible, and\n // `default` — the load-bearing one, with no solid-border fallback since\n // TD-07.14 — went weak on the lightest plane. `strong` read cleanly with room\n // to spare, which is what made raising the whole family viable.\n //\n // Each tier steps up onto the next MEASURED-GOOD rung rather than an\n // interpolated one: the new `subtle` is the old `default`, and the new\n // `default` is the old `strong` — a value just confirmed legible on all four\n // planes. Spacing goes 1 : 1.56 : 2.33, against the original 1 : 1.5 : 2.33.\n //\n // RUN 2 (VW-99): all three tiers were seen on all four planes — the retune\n // worked — but `subtle` was still \"a bit hard to read\", so the whole family\n // took a further +.01. That is a comfort margin on a passing row, not a fix\n // for a failing one, which is why it is a flat offset: the 1 : 1.56 : 2.33\n // spacing that the run validated is preserved rather than re-derived.\n //\n // Keep these to TWO decimals. react-native-web quantises alpha to 8 bits, so\n // a 3-decimal value silently rounds on the way to the DOM (.135 renders as\n // .13) — the token would say one thing and paint another.\n //\n // DARK ONLY. The light family above composites toward BLACK on light planes,\n // which this run says nothing about — do not mirror these numbers into it\n // without its own verification.\n 'hairline-subtle': 'rgba(255, 255, 255, 0.10)',\n 'hairline-default': 'rgba(255, 255, 255, 0.15)',\n 'hairline-strong': 'rgba(255, 255, 255, 0.22)',\n\n // Interactive states\n 'interactive-hover': 'rgba(255, 255, 255, 0.04)',\n 'interactive-focus': 'rgba(255, 255, 255, 0.12)',\n 'interactive-active': 'rgba(255, 255, 255, 0.16)',\n 'interactive-selected': 'rgba(255, 255, 255, 0.08)',\n 'interactive-disabled': 'rgba(255, 255, 255, 0.12)',\n 'interactive-disabled-text': 'rgba(255, 255, 255, 0.26)',\n\n // Divider\n divider: 'rgba(255, 255, 255, 0.09)',\n\n // Avatar default\n 'avatar-background': greyRamp[700],\n 'avatar-text': p.white,\n} as const\n\n// Typography tokens matching existing app\nexport const semanticTypography = {\n // Headings (Space Grotesk)\n h1: {\n fontFamily: 'heading',\n fontSize: '3.5rem',\n fontWeight: 700,\n lineHeight: 1.375,\n },\n h2: {\n fontFamily: 'heading',\n fontSize: '3rem',\n fontWeight: 700,\n lineHeight: 1.375,\n },\n h3: {\n fontFamily: 'heading',\n fontSize: '2.25rem',\n fontWeight: 700,\n lineHeight: 1.375,\n },\n h4: {\n fontFamily: 'heading',\n fontSize: '2rem',\n fontWeight: 700,\n lineHeight: 1.375,\n },\n h5: {\n fontFamily: 'heading',\n fontSize: '1.5rem',\n fontWeight: 600,\n lineHeight: 1.375,\n },\n h6: {\n fontFamily: 'heading',\n fontSize: '1.125rem',\n fontWeight: 600,\n lineHeight: 1.375,\n },\n\n // Body text (Nunito Sans)\n body1: {\n fontFamily: 'body',\n fontSize: '1rem',\n fontWeight: 400,\n lineHeight: 1.5,\n },\n body2: {\n fontFamily: 'body',\n fontSize: '0.875rem',\n fontWeight: 400,\n lineHeight: 1.57,\n },\n subtitle1: {\n fontFamily: 'body',\n fontSize: '1rem',\n fontWeight: 500,\n lineHeight: 1.75,\n },\n subtitle2: {\n fontFamily: 'body',\n fontSize: '0.875rem',\n fontWeight: 500,\n lineHeight: 1.57,\n },\n caption: {\n fontFamily: 'body',\n fontSize: '0.75rem',\n fontWeight: 400,\n lineHeight: 1.66,\n },\n overline: {\n fontFamily: 'body',\n fontSize: '0.75rem',\n fontWeight: 600,\n lineHeight: 2.5,\n letterSpacing: '0.5px',\n textTransform: 'uppercase' as const,\n },\n button: {\n fontFamily: 'sans',\n fontSize: '0.875rem',\n fontWeight: 600,\n lineHeight: 1.75,\n },\n} as const\n\n// Button size tokens\nexport const buttonSizes = {\n sm: {\n paddingX: '16px',\n paddingY: '6px',\n fontSize: '0.875rem',\n },\n md: {\n paddingX: '20px',\n paddingY: '8px',\n fontSize: '0.875rem',\n },\n lg: {\n paddingX: '24px',\n paddingY: '11px',\n fontSize: '1rem',\n },\n} as const\n\n// Export type for theme mode\nexport type ThemeMode = 'light' | 'dark'\n\n// Helper to get semantic colors based on mode\nexport function getSemanticColors(mode: ThemeMode) {\n return mode === 'dark' ? semanticColorsDark : semanticColorsLight\n}\n","import { Platform } from 'react-native'\nimport { getSemanticColors, type ThemeMode } from './tokens/semantic'\n\ntype ColorToken = keyof ReturnType<typeof getSemanticColors>\n\n/**\n * Resolve a semantic color token for an inline style where a nativewind\n * className can't apply — gradients (`backgroundImage`), per-edge borders\n * (`borderTopColor`, …), SVG attributes, and conditional hex/token mixes.\n *\n * The companion to className color tokens: on **web** it returns the CSS\n * variable (`var(--color-…)`), so the dashboard's light/dark switching keeps\n * working exactly as `global.css` intends; on **native** it returns the\n * resolved hex from `getSemanticColors` (mobile is dark-only). This is why\n * these spots stay theme-correct on web while also rendering on-device.\n */\nexport function resolveColor(token: ColorToken, mode: ThemeMode = 'dark'): string {\n return Platform.OS === 'web' ? `var(--color-${token})` : getSemanticColors(mode)[token]\n}\n","/**\n * Colour math shared by the depth system.\n *\n * This file used to be `shadows.ts` and shipped a neumorphic shadow builder —\n * dual opposing shadows, dark bottom-right and light top-left. That was removed\n * in TD-07.16. Neumorphism needs a mid-tone background (roughly 75-90%\n * lightness) so BOTH shadows have somewhere to fall; our surfaces sit near 10%,\n * which leaves the dark half nothing to fall onto. It collapsed to a one-sided\n * rim light and read as noise on the wall.\n *\n * Inline depth is a hairline now (`hairline-*`, self-normalising alpha), texture\n * is `materials.ts`, and drop-shadow survives only for genuinely FLOATING\n * things — see `elevation.ts`.\n *\n * What is left here is the HSV/hex maths that `elevation.ts` still uses to\n * derive rim and shadow tints from whatever surface colour it is handed.\n */\n\n// ============================================================================\n// Color Math Utilities\n// ============================================================================\n\n/**\n * Parse a hex color to RGB values (0-255).\n * Supports both #RGB and #RRGGBB formats.\n */\nexport function hexToRgb(hex: string): { r: number; g: number; b: number } | null {\n const cleaned = hex.replace('#', '')\n\n let r: number, g: number, b: number\n\n if (cleaned.length === 3) {\n r = parseInt(cleaned[0] + cleaned[0], 16)\n g = parseInt(cleaned[1] + cleaned[1], 16)\n b = parseInt(cleaned[2] + cleaned[2], 16)\n } else if (cleaned.length === 6) {\n r = parseInt(cleaned.slice(0, 2), 16)\n g = parseInt(cleaned.slice(2, 4), 16)\n b = parseInt(cleaned.slice(4, 6), 16)\n } else {\n return null\n }\n\n return { r, g, b }\n}\n\n/**\n * Convert RGB (0-255) to HSV (h: 0-360, s: 0-1, v: 0-1).\n */\nexport function rgbToHsv(r: number, g: number, b: number): { h: number; s: number; v: number } {\n const rNorm = r / 255\n const gNorm = g / 255\n const bNorm = b / 255\n\n const max = Math.max(rNorm, gNorm, bNorm)\n const min = Math.min(rNorm, gNorm, bNorm)\n const delta = max - min\n\n // Value\n const v = max\n\n // Saturation\n const s = max === 0 ? 0 : delta / max\n\n // Hue\n let h = 0\n if (delta !== 0) {\n if (max === rNorm) {\n h = 60 * (((gNorm - bNorm) / delta) % 6)\n } else if (max === gNorm) {\n h = 60 * ((bNorm - rNorm) / delta + 2)\n } else {\n h = 60 * ((rNorm - gNorm) / delta + 4)\n }\n }\n if (h < 0) h += 360\n\n return { h, s, v }\n}\n\n/**\n * Convert HSV (h: 0-360, s: 0-1, v: 0-1) to RGB (0-255).\n */\nexport function hsvToRgb(h: number, s: number, v: number): { r: number; g: number; b: number } {\n const c = v * s\n const x = c * (1 - Math.abs(((h / 60) % 2) - 1))\n const m = v - c\n\n let rPrime: number, gPrime: number, bPrime: number\n\n if (h >= 0 && h < 60) {\n rPrime = c\n gPrime = x\n bPrime = 0\n } else if (h >= 60 && h < 120) {\n rPrime = x\n gPrime = c\n bPrime = 0\n } else if (h >= 120 && h < 180) {\n rPrime = 0\n gPrime = c\n bPrime = x\n } else if (h >= 180 && h < 240) {\n rPrime = 0\n gPrime = x\n bPrime = c\n } else if (h >= 240 && h < 300) {\n rPrime = x\n gPrime = 0\n bPrime = c\n } else {\n rPrime = c\n gPrime = 0\n bPrime = x\n }\n\n return {\n r: Math.round((rPrime + m) * 255),\n g: Math.round((gPrime + m) * 255),\n b: Math.round((bPrime + m) * 255),\n }\n}\n\n/**\n * Convert RGB values to hex string.\n */\nexport function rgbToHex(r: number, g: number, b: number): string {\n const toHex = (n: number) => {\n const clamped = Math.max(0, Math.min(255, Math.round(n)))\n return clamped.toString(16).padStart(2, '0')\n }\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`\n}\n\n/**\n * Lighten a color by increasing its HSV Value component.\n *\n * @param hex - The hex color to lighten\n * @param amount - Amount to increase V by (0-1)\n */\nexport function lighten(hex: string, amount: number = 0.1): string {\n const rgb = hexToRgb(hex)\n if (!rgb) return hex\n\n const hsv = rgbToHsv(rgb.r, rgb.g, rgb.b)\n const newV = Math.min(1, hsv.v + amount)\n\n const newRgb = hsvToRgb(hsv.h, hsv.s, newV)\n return rgbToHex(newRgb.r, newRgb.g, newRgb.b)\n}\n\n/**\n * Darken a color by decreasing its HSV Value component.\n *\n * @param hex - The hex color to darken\n * @param amount - Amount to decrease V by (0-1)\n */\nexport function darken(hex: string, amount: number = 0.1): string {\n const rgb = hexToRgb(hex)\n if (!rgb) return hex\n\n const hsv = rgbToHsv(rgb.r, rgb.g, rgb.b)\n const newV = Math.max(0, hsv.v - amount)\n\n const newRgb = hsvToRgb(hsv.h, hsv.s, newV)\n return rgbToHex(newRgb.r, newRgb.g, newRgb.b)\n}\n\n/**\n * Get hover colors for a button based on its background color.\n * Automatically adapts intensity based on the color's luminance.\n *\n * @param bgColor - The button's background color (hex)\n * @param intensity - How strong the hover effect should be ('subtle' | 'medium' | 'strong')\n */\nexport function getHoverColors(\n bgColor: string,\n intensity: 'subtle' | 'medium' | 'strong' = 'medium'\n): { raised: string; pressed: string } {\n const amounts = {\n subtle: 0.01,\n medium: 0.02,\n strong: 0.03,\n }\n\n const amount = amounts[intensity]\n\n return {\n raised: lighten(bgColor, amount), // Raised hover: lighten (lifting up)\n pressed: darken(bgColor, amount), // Pressed hover: darken (pressing down)\n }\n}\n\n/**\n * Check if a color is considered \"dark\" (for choosing text color).\n * Uses HSV Value component for simplicity.\n */\nexport function isDark(hex: string): boolean {\n const rgb = hexToRgb(hex)\n if (!rgb) return true\n const hsv = rgbToHsv(rgb.r, rgb.g, rgb.b)\n return hsv.v < 0.6\n}\n\n/**\n * Shadow strength tiers. Retained because `elevation.ts` keys its level table on\n * them; the neumorphic shadow BUILDERS that used to live here are gone.\n */\nexport type ShadowIntensity = 'subtle' | 'medium' | 'strong'\n","/**\n * Color utility functions for the design system.\n *\n * `lighten`/`darken` are re-exported from `theme/color-utils`, which does the\n * HSV math. They are hover/state adjustments, not a depth ladder — planes come\n * from the grey ramp.\n */\n\nexport { lighten, darken } from '../theme/color-utils'\n\nexport type StatusType = 'success' | 'error' | 'warning' | 'info'\nexport type ResultType = 'improve' | 'degrade' | 'inconclusive' | 'neutral'\n\n/**\n * Get the semantic color token for a status type.\n *\n * @param status - The status type\n * @returns The CSS variable reference for the status color\n *\n * @example\n * const color = getStatusColor('success') // 'var(--color-status-success)'\n */\nexport function getStatusColor(status: StatusType): string {\n return `var(--color-status-${status})`\n}\n\n/**\n * Get the semantic color token for a result type.\n *\n * @param result - The result type\n * @returns The CSS variable reference for the result color\n *\n * @example\n * const color = getResultColor('improve') // 'var(--color-result-improve)'\n */\nexport function getResultColor(result: ResultType): string {\n return `var(--color-result-${result})`\n}\n\n/**\n * Apply alpha/opacity to a color.\n * Works with hex colors and rgb values.\n *\n * @param color - The color value (hex or rgb)\n * @param opacity - Opacity value between 0 and 1\n * @returns The color with alpha applied\n *\n * @example\n * alpha('#5048E5', 0.5) // 'rgba(80, 72, 229, 0.5)'\n * alpha('rgb(80, 72, 229)', 0.5) // 'rgba(80, 72, 229, 0.5)'\n */\nexport function alpha(color: string, opacity: number): string {\n // Clamp opacity between 0 and 1\n const clampedOpacity = Math.max(0, Math.min(1, opacity))\n\n // Handle hex colors\n if (color.startsWith('#')) {\n const hex = color.slice(1)\n let r: number, g: number, b: number\n\n if (hex.length === 3) {\n r = parseInt(hex[0] + hex[0], 16)\n g = parseInt(hex[1] + hex[1], 16)\n b = parseInt(hex[2] + hex[2], 16)\n } else if (hex.length === 6) {\n r = parseInt(hex.slice(0, 2), 16)\n g = parseInt(hex.slice(2, 4), 16)\n b = parseInt(hex.slice(4, 6), 16)\n } else {\n return color\n }\n\n return `rgba(${r}, ${g}, ${b}, ${clampedOpacity})`\n }\n\n // Handle rgb colors\n const rgbMatch = color.match(/rgb\\((\\d+),\\s*(\\d+),\\s*(\\d+)\\)/)\n if (rgbMatch) {\n const [, r, g, b] = rgbMatch\n return `rgba(${r}, ${g}, ${b}, ${clampedOpacity})`\n }\n\n // Handle rgba colors - replace the alpha value\n const rgbaMatch = color.match(/rgba\\((\\d+),\\s*(\\d+),\\s*(\\d+),\\s*[\\d.]+\\)/)\n if (rgbaMatch) {\n const [, r, g, b] = rgbaMatch\n return `rgba(${r}, ${g}, ${b}, ${clampedOpacity})`\n }\n\n return color\n}\n\n/**\n * Determine if a color is light or dark.\n * Useful for determining text color contrast.\n *\n * @param color - Hex color value\n * @returns 'light' or 'dark'\n *\n * @example\n * getLuminance('#FFFFFF') // 'light'\n * getLuminance('#000000') // 'dark'\n */\nexport function getLuminance(color: string): 'light' | 'dark' {\n if (!color.startsWith('#')) return 'dark'\n\n const hex = color.slice(1)\n let r: number, g: number, b: number\n\n if (hex.length === 3) {\n r = parseInt(hex[0] + hex[0], 16)\n g = parseInt(hex[1] + hex[1], 16)\n b = parseInt(hex[2] + hex[2], 16)\n } else if (hex.length === 6) {\n r = parseInt(hex.slice(0, 2), 16)\n g = parseInt(hex.slice(2, 4), 16)\n b = parseInt(hex.slice(4, 6), 16)\n } else {\n return 'dark'\n }\n\n // Calculate relative luminance using sRGB\n const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255\n\n return luminance > 0.5 ? 'light' : 'dark'\n}\n\n/**\n * Get a contrasting text color for a given background.\n *\n * @param backgroundColor - The background color (hex)\n * @returns 'white' or 'black' for contrast\n *\n * @example\n * getContrastText('#5048E5') // 'white'\n * getContrastText('#FFFFFF') // 'black'\n */\nexport function getContrastText(backgroundColor: string): string {\n return getLuminance(backgroundColor) === 'light' ? '#000000' : '#FFFFFF'\n}\n","/**\n * Surface MATERIALS — the treatments layered on top of the flat grey ramp.\n *\n * The ramp says how deep a plane sits. This says what it is made of. Two\n * materials, deliberately: a matte PAPER sheet for hero surfaces, and a recessed\n * INSET WELL for grouped or awaiting-data regions.\n *\n * SCOPE, and it is a hard rule rather than a preference: paper goes on hero\n * surfaces only — the live card, the LOAD/verdict chip, the rest hero. The\n * \"everything is a paper card\" look is explicitly NOT the model; it was an\n * over-application built to find the ceiling. There are no LEVELS of paper. One\n * treatment, used sparingly, or the texture stops meaning anything.\n *\n * Second hard rule: paper fills take DEEP/MUTED tones only (a ramp step, or a\n * categorical `dark` variant). Vivid and neon colours are ink ON paper — never\n * the paper itself.\n *\n * PLATFORM: `backgroundImage` and multi-layer `boxShadow` are web/RNW only. On\n * native these are ignored and the surface falls back to its flat fill, which is\n * why every material here keeps `backgroundColor` load-bearing on its own. A\n * material must never be the only thing carrying meaning.\n *\n * ── THE TONAL FILL IS GONE (VW-99, S-6 wall calibration) ───────────────────\n *\n * `paperSheet` used to carry a vertical ΔL* 3 gradient, sized \"just under seen\n * as a gradient\". On the wall panel at ~3 m it could not be told from a flat\n * sheet of the same tone, and the full material still read as — the operator's\n * words — \"a flat digital rectangle\". It failed its own stated purpose, which\n * was precisely to stop that.\n *\n * Raising it was not available. The design ceiling is ~ΔL* 4 (past that it reads\n * decorative, which the exploration rejected), and the same run showed why the\n * headroom would not have helped: the 0.025 ELEVATION step — a comparable ΔL*\n * — was called instantly, because it sits at a hard edge between two flat\n * fields. The fill spread the same amount smoothly over ~300 px, where vision is\n * genuinely poor. It is a spatial-frequency problem, not an amplitude one, so\n * the band between \"invisible\" and \"decorative\" may simply not exist here.\n *\n * ── AND THE DITHER WENT WITH IT (VW-99 run 2) ──────────────────────────────\n *\n * `ditherTile` was held back one run on the grounds that \"probably dead weight\"\n * is not a measurement. Run 1 could not measure it: with the fill invisible\n * there was no gradient to band, so the panel returned a guaranteed clean sheet.\n *\n * Run 2 settled it by adding a hand-quantised REFERENCE beside the smooth\n * control — the same tone span drawn as five hard-edged 1-level steps, which is\n * what the artefact looks like when it happens. The reference banded plainly and\n * the smooth gradient did not. So the panel can resolve banding; this render\n * path simply does not produce it. A mitigation for an artefact that does not\n * occur is cost with no benefit, and it is gone.\n *\n * That is a claim about THIS display, which is the one the product ships on and\n * the reason `paperSheet` is hero-surface-only. A phone is a separate question.\n *\n * Kept: grain, rim-light, contact shadow.\n *\n * See `sources/design/surface-system-north-star.md` §4 and\n * `sources/runbooks/VW-99-depth-wall-calibration.md`. Those paths are relative to\n * the `voltras-workspace` active-work initiative (`active-work open voltras-workspace`), not this repo —\n * titan-design has no `sources/` directory, so they do not resolve from here.\n */\nimport type { TextStyle, ViewStyle } from 'react-native'\nimport { getSemanticColors } from './tokens/semantic'\n\nconst c = getSemanticColors('dark')\n\n// ── colour math ─────────────────────────────────────────────────────────────\n\nfunction parseHex(hex: string): [number, number, number] | null {\n const h = hex.replace('#', '')\n const full =\n h.length === 3\n ? h\n .split('')\n .map((ch) => ch + ch)\n .join('')\n : h\n const rgb: [number, number, number] = [\n parseInt(full.slice(0, 2), 16),\n parseInt(full.slice(2, 4), 16),\n parseInt(full.slice(4, 6), 16),\n ]\n return rgb.some(Number.isNaN) ? null : rgb\n}\n\n/** sRGB perceived luminance (0 dark … 1 bright), Rec.601 weights. */\nfunction perceivedLuminance(hex: string): number {\n const rgb = parseHex(hex)\n if (!rgb) return 0.5\n const [r, g, b] = rgb\n return (0.299 * r + 0.587 * g + 0.114 * b) / 255\n}\n\n// The CIELAB conversion chain (srgb2lin/lin2srgb/fLab/fInv, hexToLab/labToHex,\n// shiftL) lived here so the tonal fill could be specified in ΔL*. It had no\n// other caller, so it went with the fill — see the module header.\n\n// ── grain ───────────────────────────────────────────────────────────────────\n\n/**\n * Grain opacity for a tone, scaled by perceived brightness.\n *\n * A fixed opacity reads hot on a dark plane and vanishes on a bright one, so\n * darker tones get a whisper and brighter tones keep full texture. Anchored so a\n * dark chip (lum ≈ 0.13) lands ≈ 0.06 and a bright bar (lum ≈ 0.58) lands ≈ 0.20.\n * Above roughly 0.05α on a mid tone it starts reading as \"dirty\" rather than\n * matte, which is what the clamp is protecting.\n *\n * This is the ONE curve all grain goes through — a card and a bar carry\n * proportional, not identical, texture. That is what makes them read as the same\n * material.\n */\nexport function grainOpacityForTone(baseColor: string): number {\n return Math.min(0.24, Math.max(0.04, 0.02 + 0.31 * perceivedLuminance(baseColor)))\n}\n\n/**\n * The matte grain tile as a `backgroundImage` url — one shared `feTurbulence`\n * fractal-noise tile, painted once, NEVER animated. Pair with\n * `backgroundColor: baseColor`.\n */\nexport function grainForTone(baseColor: string): string {\n const op = grainOpacityForTone(baseColor).toFixed(3)\n return (\n `url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E` +\n `%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E` +\n `%3Crect width='120' height='120' filter='url(%23n)' opacity='${op}'/%3E%3C/svg%3E\")`\n )\n}\n\n// `tonalFill` and `ditherTile` both lived here until VW-99 measured them on the\n// wall. Deleted rather than left exported-but-unused; the reasoning is in the\n// module header, which is the part worth keeping.\n\n// ── the materials ───────────────────────────────────────────────────────────\n\n/**\n * A matte PAPER hero sheet: brightness-scaled grain + a crisp top rim-light +\n * one soft contact shadow.\n *\n * The contact shadow is the ONE place a drop-shadow is still correct on a dark\n * surface: it is large, soft, and describes a sheet lying on a plane rather than\n * trying to encode hierarchy. Inline depth is the hairline's job.\n *\n * Defaults to `surface-raised` so a same-toned card laid inside reads as one\n * continuous sheet rather than a seam.\n *\n * THE RIM-LIGHT IS A HAIRLINE. Run 2 of VW-99 called it \"weak at distance\" on\n * both the card and the hero sheet, and the reason is visible in the number: it\n * was `rgba(255,255,255,0.10)`, a 1px white line on a dark plane — physically\n * the same cue as `hairline-*`, but set BELOW `hairline-default`, which the same\n * run had just had to raise twice. It is not a subtler species of edge, it was\n * simply mistuned. Raised to `0.20`, between `hairline-default` and\n * `hairline-strong`: this edge defines a hero surface, so it earns more than the\n * default separator, and unlike a separator there is no fallback behind it.\n *\n * Deliberately NOT wired to the token, though the values now agree in spirit: a\n * box-shadow rim and a border hairline are retuned by different evidence, and\n * coupling them means a hairline run silently restyles every hero sheet.\n *\n * HERO SURFACES ONLY, MUTED TONES ONLY — see the module header.\n */\nexport function paperSheet(tone: string = c['surface-raised']): ViewStyle {\n return {\n backgroundColor: tone,\n // Grain alone. The dither went with the gradient it protected — see header.\n backgroundImage: grainForTone(tone),\n boxShadow: 'inset 0 1px 0 rgba(255,255,255,0.20), 0 8px 22px rgba(0,0,0,0.50)',\n } as unknown as ViewStyle\n}\n\n/**\n * A recessed INSET WELL: a tone pressed BELOW the surrounding plane, cut in by an\n * inner top shadow with a faint light line on the floor.\n *\n * The bottom rim is the load-bearing half. A dark inset alone just reads as a\n * darker rectangle; it is the light catching the floor that says \"this is below\n * the surface\" — which is why the treatment survives at 16px where a full paper\n * treatment does not.\n *\n * The floor light was `0.04` and is now `0.12`, chosen on the wall in VW-99 run\n * 2 against a `.04`-vs-`.12`-vs-none forced choice. Worth recording that `.04`\n * was NOT invisible — the no-line decoy was correctly rejected and both real\n * values were seen, so this is a preference between two working values, not a\n * rescue. The rim-light next door was a genuine miss; this one was only thin.\n *\n * Note this is a MATERIAL, and independent of the surface LEVEL named `inset`\n * that was retired in TD-07.14. A well is something you apply; a level is\n * somewhere you sit.\n */\nexport function insetWell(tone: string = c['surface-input']): ViewStyle {\n return {\n backgroundColor: tone,\n boxShadow: 'inset 0 2px 6px rgba(0,0,0,0.55), inset 0 -1px 0 rgba(255,255,255,0.12)',\n } as unknown as ViewStyle\n}\n\n/**\n * Paper for a COLORED BAR — the same material as {@link paperSheet}, tuned for a\n * small saturated element: grain + top rim-light + a contact shadow cast past the\n * bar's leading edge, so a filled bar reads as a physical block that has travelled.\n *\n * No tonal fill or dither here: a bar is too narrow for a ΔL* 3 gradient to read,\n * and too narrow to band.\n *\n * `flip` = a vertically mirrored (`scaleY(-1)`) plot, i.e. the `down` wing of a\n * diverging chart. The contact shadow's y-offset is pre-inverted so the mirror\n * lands it pointing AWAY from the shared axis rather than up across it, and the\n * top rim-light is DROPPED — mirrored it would sit on the axis edge and read\n * wrong, so grain and shadow carry the material alone.\n */\nexport function barPaper(color: string, flip = false): ViewStyle {\n return {\n backgroundImage: grainForTone(color),\n boxShadow: flip\n ? '0 -6px 16px rgba(0,0,0,0.45)'\n : 'inset 0 1.5px 0 rgba(255,255,255,0.22), 0 6px 16px rgba(0,0,0,0.45)',\n } as unknown as ViewStyle\n}\n\n/**\n * A POST-IT card: a matte tinted sheet with a crisp rim, a defined contact\n * shadow, and a deliberate CANT (`deg`) so it reads as a stuck note — where a\n * small unit of data wants to feel pinned to the surface (alerts, next-set). A\n * degree or two, not a fraction, so the tilt is intentional rather than a bug.\n */\nexport function postIt(tone: string = c['surface-raised'], deg = -1.5): ViewStyle {\n return {\n backgroundColor: tone,\n backgroundImage: grainForTone(tone),\n boxShadow: 'inset 0 1px 0 rgba(255,255,255,0.12), 0 6px 14px rgba(0,0,0,0.45)',\n transform: [{ rotate: `${deg}deg` }],\n } as unknown as ViewStyle\n}\n\n/**\n * DEBOSSED (engraved) text: a 1px light highlight dropped just below the glyphs\n * so a label reads as pressed INTO the surface. Deliberate, for section eyebrows\n * on a matte plane — not body copy. Pair with a tertiary/dim text colour.\n */\nexport const debossLabel: TextStyle = {\n textShadowColor: 'rgba(255,255,255,0.11)',\n textShadowOffset: { width: 0, height: 1 },\n textShadowRadius: 0,\n}\n","/**\n * LIFT — the treatment a plane wears when it sits above its neighbour.\n *\n * Tone says which plane a container sits on; lift says it is resting ON the one\n * below. Two cues, both lit from above:\n *\n * RIM a crisp 1px top rim-light. The one neumorphism half that survives\n * near black. paperSheet's hero rim is 0.20 (VW-99 run 2); a card is\n * not a hero, so the default lift sits one grade quieter at 0.12,\n * chosen against 0.20 side by side in Lab/Depth (2026-09-08).\n * AMBIENT a soft shadow cast onto the plane below, growing with the number of\n * planes crossed. Content lifts (1–3) are tight; floating lifts (4–5)\n * are large and soft, describing separation from the page rather than\n * rank in a stack.\n *\n * Neither cue is a hairline ring: a ring is an edge, not a lift, and stays the\n * divider's job. Web carries the multi-layer boxShadow; native gets the single\n * shadow* set. The tone underneath is load-bearing on its own either way.\n */\nimport { Platform, type ViewStyle } from 'react-native'\nimport type { ThemeMode } from './tokens/semantic'\n\nexport type LiftStep = 1 | 2 | 3 | 4 | 5\n\n/** The lowest lift that is FLOATING (menu, popover, toast) rather than content. */\nexport const FLOATING_LIFT_MIN: LiftStep = 4\n\n/** Rim-light alpha per mode. Light mode is a placeholder pending its own pass. */\nexport const LIFT_RIM_ALPHA: Record<ThemeMode, number> = { dark: 0.12, light: 0.9 }\n\ninterface ShadowLayer {\n y: number\n blur: number\n alpha: number\n}\n\nconst AMBIENT: Record<LiftStep, ShadowLayer[]> = {\n 1: [\n { y: 1, blur: 2, alpha: 0.35 },\n { y: 2, blur: 6, alpha: 0.3 },\n ],\n 2: [\n { y: 1, blur: 2, alpha: 0.35 },\n { y: 4, blur: 12, alpha: 0.32 },\n ],\n 3: [\n { y: 2, blur: 4, alpha: 0.35 },\n { y: 8, blur: 22, alpha: 0.35 },\n ],\n 4: [\n { y: 1, blur: 2, alpha: 0.35 },\n { y: 10, blur: 24, alpha: 0.3 },\n { y: 24, blur: 48, alpha: 0.2 },\n ],\n 5: [\n { y: 2, blur: 4, alpha: 0.4 },\n { y: 16, blur: 32, alpha: 0.35 },\n { y: 32, blur: 64, alpha: 0.25 },\n ],\n}\n\n/** A light surface casts a lighter shadow: same geometry, scaled alpha. */\nconst AMBIENT_ALPHA_SCALE: Record<ThemeMode, number> = { dark: 1, light: 0.4 }\n\nexport interface LiftOptions {\n /** Override the rim alpha. `0` drops the rim and leaves the ambient shadow alone. */\n rim?: number\n}\n\nfunction ambientLayers(step: LiftStep, mode: ThemeMode): string[] {\n const scale = AMBIENT_ALPHA_SCALE[mode]\n return AMBIENT[step].map(\n ({ y, blur, alpha }) => `0 ${y}px ${blur}px rgba(0,0,0,${(alpha * scale).toFixed(2)})`\n )\n}\n\n/** The web boxShadow string for a lift: rim first, then the ambient layers. */\nexport function liftShadow(step: LiftStep, mode: ThemeMode = 'dark', opts: LiftOptions = {}) {\n const rim = opts.rim ?? LIFT_RIM_ALPHA[mode]\n const layers = ambientLayers(step, mode)\n if (rim > 0) layers.unshift(`inset 0 1px 0 rgba(255,255,255,${rim.toFixed(2)})`)\n return layers.join(', ')\n}\n\n/** Platform style for a lift. Compose after `backgroundColor`; never instead of it. */\nexport function liftStyle(\n step: LiftStep,\n mode: ThemeMode = 'dark',\n opts: LiftOptions = {}\n): ViewStyle {\n const deepest = AMBIENT[step][AMBIENT[step].length - 1]\n return Platform.select({\n web: { boxShadow: liftShadow(step, mode, opts) } as unknown as ViewStyle,\n default: {\n shadowColor: '#000',\n shadowOffset: { width: 0, height: Math.round(deepest.y / 2) },\n shadowOpacity: deepest.alpha * AMBIENT_ALPHA_SCALE[mode],\n shadowRadius: deepest.blur / 2,\n elevation: step,\n },\n }) as ViewStyle\n}\n","/**\n * The surface planes: the grey-ramp steps a container can sit on, darkest first.\n *\n * Every background a `<Surface>` or `<Card>` paints resolves through this list,\n * so a container can only ever land ON the ramp. Stepping up (a lifted card) or\n * down (a pressed well) is indexing `PLANE_ORDER`, clamped at both ends.\n *\n * `frame` is the bezel the ramp sits inside and the floor a pressed surface\n * clamps at. It replaced a separate `inset` level in TD-07.14: at ΔE 1.10 from\n * the frame that level was an imperceptible duplicate.\n */\nimport { getSemanticColors, type ThemeMode } from './tokens/semantic'\n\ntype ColorToken = keyof ReturnType<typeof getSemanticColors>\n\nexport type SurfaceLevel = 'frame' | 'background' | 'base' | 'elevated' | 'raised' | 'overlay'\n\n// Which semantic token backs each plane. Values live in `semantic.ts` and stay\n// in sync with the grey ramp; this map never carries literal hexes.\nexport const SURFACE_LEVEL_TOKEN = {\n frame: 'background-frame',\n background: 'background-base',\n base: 'surface-base',\n elevated: 'surface-elevated',\n raised: 'surface-raised',\n overlay: 'surface-overlay',\n} as const satisfies Record<SurfaceLevel, ColorToken>\n\n/** Darkest → lightest. Kept in lockstep with the grey ramp and surface.contract.test. */\nexport const PLANE_ORDER = [\n 'frame',\n 'background',\n 'base',\n 'elevated',\n 'raised',\n 'overlay',\n] as const satisfies readonly SurfaceLevel[]\n\n/** The background hex for a plane under a theme mode (literal hex, never a var()). */\nexport function surfaceBackground(level: SurfaceLevel, mode: ThemeMode): string {\n return getSemanticColors(mode)[SURFACE_LEVEL_TOKEN[level]]\n}\n\nfunction stepPlane(from: SurfaceLevel, delta: number): SurfaceLevel {\n const index = PLANE_ORDER.indexOf(from)\n const clamped = Math.min(PLANE_ORDER.length - 1, Math.max(0, index + delta))\n return PLANE_ORDER[clamped]\n}\n\n/**\n * The plane a `<Surface pressed>` resolves to: its parent's plane stepped one\n * index DOWN the ramp, clamped at the `frame` floor.\n * overlay→raised, raised→elevated, elevated→base, base→background,\n * background→frame, frame→frame (clamped).\n */\nexport function pressedLevel(parent: SurfaceLevel): SurfaceLevel {\n return stepPlane(parent, -1)\n}\n\n/**\n * The plane a lifted surface resolves to: its parent's plane stepped `steps`\n * UP the ramp, clamped at `overlay`. The clamp is what makes raised-on-raised\n * unrepresentable: a card inside an overlay stays on the overlay and relies on\n * its lift treatment, never on a lighter grey that is not on the ramp.\n */\nexport function raisedLevel(parent: SurfaceLevel, steps: number): SurfaceLevel {\n return stepPlane(parent, Math.max(0, steps))\n}\n","/**\n * Elevation — numeric depth that resolves to the grey ramp.\n *\n * A level is a plane on the surface ramp plus the treatment that plane wears:\n *\n * -2 frame recessed (inset well, two planes down)\n * -1 background recessed (inset well, one plane down)\n * 0 base flat, no treatment\n * 1 elevated lifted (tone + rim-light + ambient shadow)\n * 2 raised lifted\n * 3 overlay lifted\n * 4 overlay floating (same recipe, larger shadow)\n * 5 overlay floating\n *\n * These are ABSOLUTE readings from the page plane. `<Surface>` and `<Card>`\n * apply the same numbers RELATIVE to the plane they are nested in; see\n * `resolveSurfaceDepth`.\n *\n * No level can produce a colour off the ramp. The previous ladder lightened a\n * base colour in HSV by 2.5% per level and put five of its six stops between\n * ramp steps, drifting warmer as it rose while the ramp is designed to cool.\n * Floating levels share the overlay plane on purpose: past the top of the ramp,\n * separation is the shadow's job, not a lighter grey.\n *\n * Depth is TONE + LIFT by default. The earlier rule that levels 1–3 separate by\n * tone alone (TD-07.16) was reversed on 2026-09-08: the tight upper steps of the\n * ramp (ΔL* 2.5–3) need the second channel, and a soft ambient shadow on a\n * near-black plane is not inert once the rim-light gives it an edge to fall\n * from. See Foundations/Depth.\n */\nimport { Platform, type ViewStyle } from 'react-native'\nimport { hexToRgb } from './color-utils'\nimport { insetWell } from './materials'\nimport { FLOATING_LIFT_MIN, liftStyle, type LiftOptions, type LiftStep } from './lift'\nimport { surfaceBackground, type SurfaceLevel } from './surface-planes'\nimport type { ThemeMode } from './tokens/semantic'\n\nexport type ElevationLevel = -2 | -1 | 0 | 1 | 2 | 3 | 4 | 5\n\nexport const ELEVATION_PLANE: Record<ElevationLevel, SurfaceLevel> = {\n [-2]: 'frame',\n [-1]: 'background',\n [0]: 'base',\n [1]: 'elevated',\n [2]: 'raised',\n [3]: 'overlay',\n [4]: 'overlay',\n [5]: 'overlay',\n}\n\n/** The lowest elevation that is floating (menu, popover, toast) rather than content. */\nexport const FLOATING_ELEVATION_MIN: ElevationLevel = FLOATING_LIFT_MIN\n\n/** Elevation backing a `<Surface pressed>` recess: one plane down. */\nexport const PRESSED_ELEVATION_LEVEL: ElevationLevel = -1\n\n/** The ramp plane an absolute elevation sits on. */\nexport function elevationPlane(level: ElevationLevel): SurfaceLevel {\n return ELEVATION_PLANE[level]\n}\n\n/** The background hex for an absolute elevation: always a ramp step. */\nexport function getElevationSurface(level: ElevationLevel, mode: ThemeMode = 'dark'): string {\n return surfaceBackground(ELEVATION_PLANE[level], mode)\n}\n\n/**\n * Inner-shadow recess for a pressed (sunken) surface: the `insetWell` material's\n * cut, which the wall calibrated in VW-99. Web only; on native the recess reads\n * from the darker fill alone, which is why the fill is never optional.\n */\nexport function getPressedRecessShadow(fillColor: string, _mode: ThemeMode = 'dark'): ViewStyle {\n const { boxShadow } = insetWell(fillColor) as unknown as { boxShadow: string }\n return Platform.select({\n web: { boxShadow } as unknown as ViewStyle,\n default: {},\n }) as ViewStyle\n}\n\n/**\n * The treatment an absolute elevation wears: a recess below 0, nothing at 0,\n * a lift above it. Compose after `backgroundColor`.\n */\nexport function getElevationShadow(\n level: ElevationLevel,\n mode: ThemeMode = 'dark',\n opts: LiftOptions = {}\n): ViewStyle {\n if (level < 0) return getPressedRecessShadow(getElevationSurface(level, mode), mode)\n if (level === 0) return {}\n return liftStyle(level as LiftStep, mode, opts)\n}\n\n// =============================================================================\n// Glow Shadow Support\n// =============================================================================\n\nexport type GlowIntensity = 'tight' | 'subtle' | 'medium' | 'strong'\n\n// Four fixed intensities, chosen by EMPHASIS rather than by the element's size:\n// a caller says how loud the glow should be, not how big the thing is. `tight`\n// is the close halo a small indicator wore before glows were centralised; it is\n// kept as a rung on the scale so that look stays reachable.\nconst glowConfig: Record<GlowIntensity, { blur: number; spread: number; opacity: number }> = {\n tight: { blur: 4, spread: 0, opacity: 0.4 },\n subtle: { blur: 12, spread: 0, opacity: 0.25 },\n medium: { blur: 20, spread: 2, opacity: 0.4 },\n strong: { blur: 30, spread: 4, opacity: 0.55 },\n}\n\n/**\n * A coloured radial glow around an element, for emphasis and active states:\n * a live recording indicator, a success or error pulse, a focus halo.\n */\nexport function getGlowShadow(color: string, intensity: GlowIntensity = 'medium'): ViewStyle {\n const config = glowConfig[intensity]\n const rgb = hexToRgb(color)\n if (!rgb) return {}\n\n return Platform.select({\n web: {\n boxShadow: `0 0 ${config.blur}px ${config.spread}px rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${config.opacity})`,\n } as unknown as ViewStyle,\n default: {\n shadowColor: color,\n shadowOffset: { width: 0, height: 0 },\n shadowOpacity: config.opacity,\n shadowRadius: config.blur / 2,\n elevation: 0,\n },\n }) as ViewStyle\n}\n","/**\n * Workout-specific tokens not yet in the main Tailwind config.\n * Use these inline instead of Tailwind classes.\n */\nimport { divergingScale, sequentialEffort, primitiveRamps as ramp } from './tokens/primitives'\n\nexport const WORKOUT_TOKENS = {\n // Canonical 4-band performance scale — the single source for BOTH the\n // VelocityStrip zone bars and the SetRow RPE color (TD-03.43). The direction\n // is intentionally inverted between the two consumers: for velocity, green =\n // fastest/best; for RPE, green = easiest. This is the [0,2,3,4] subsample of\n // the canonical `sequentialEffort` primitive: an EVEN hue walk across the ramp\n // (green → gold → orange → red). The earlier [0,1,2,4] spent two of its four\n // bands on adjacent yellows (amber-200 + amber-300) and skipped orange, reading\n // yellow-heavy with an abrupt jump to red; sampling amber-300 + orange-400\n // instead gives four cleanly separable bands that hold at 3px strip scale.\n // Consumed inline (RN).\n scale: {\n green: sequentialEffort[0], // green-300\n yellow: sequentialEffort[2], // amber-300 (gold)\n orange: sequentialEffort[3], // orange-400 (true orange)\n red: sequentialEffort[4], // red-600\n },\n\n // BodyMap volume heatmap — the canonical `divergingScale` (under → optimal →\n // over): a true diverging shape with a light green center, cool-blue under-\n // trained end and warm-red over-reaching end (colorblind-robust in lightness).\n heatmap: {\n none: '#E0E0E0', // no training data\n under: divergingScale[0], // below MEV\n maintenance: divergingScale[1], // MEV to MAV\n productive: divergingScale[2], // optimal center — MAV to MRV\n approaching: divergingScale[3], // near MRV\n over: divergingScale[4], // over MRV\n },\n\n // Badge border-radius (rounded-sm is 4px, we need 2px)\n badgeRadius: 2,\n\n // Surface and border colors were removed here: those flip with the theme, so\n // components use the CSS custom properties (var(--color-surface-*/border-*))\n // directly. Only theme-independent data-viz values remain below.\n\n // Intensity bar specific — over-target tiers deepen along the red ramp.\n intensity: {\n track: '#333333',\n over1: ramp.red[600], // matches status-error\n over2: ramp.red[700],\n over3: ramp.red[800],\n targetLine: 'rgba(33, 150, 243, 0.5)',\n atTargetGlow: '0 0 5px 1px rgba(33, 150, 243, 0.35), 0 0 10px 3px rgba(33, 150, 243, 0.15)',\n },\n\n // Deviation bar\n deviation: {\n track: '#333333',\n },\n} as const\n","/**\n * Muscle grouping taxonomy for volume tracking, exercise mapping, and the\n * BodyMap visualization. Ported from the Voltras muscle-taxonomy design doc.\n *\n * Level 2 (15 groups) is the primary volume-tracking unit; SimpleMuscleGroup\n * (8 groups) is the beginner-facing aggregation. MUSCLE_TO_SVG_SLUGS maps each\n * group to react-native-body-highlighter slugs using the closest-slug approach\n * (Phase 1: combined colors, no sub-region splitting — deltoids is a single\n * slug, lats and upper back share `upper-back`).\n */\nimport { WORKOUT_TOKENS } from '../../../theme/workout-tokens'\n\n/**\n * Full muscle group taxonomy for volume tracking and exercise mapping.\n * 15 groups — the primary unit for volume accounting.\n */\nexport enum MuscleGroup {\n // Push\n CHEST = 'chest',\n FRONT_DELTS = 'front_delts',\n SIDE_DELTS = 'side_delts',\n TRICEPS = 'triceps',\n\n // Pull\n LATS = 'lats',\n UPPER_BACK = 'upper_back',\n REAR_DELTS = 'rear_delts',\n BICEPS = 'biceps',\n FOREARMS = 'forearms',\n\n // Legs\n QUADS = 'quads',\n HAMSTRINGS = 'hamstrings',\n GLUTES = 'glutes',\n CALVES = 'calves',\n\n // Core\n ABS = 'abs',\n OBLIQUES = 'obliques',\n}\n\n/**\n * Simplified muscle group view for beginners. Maps to one or more MuscleGroup.\n */\nexport enum SimpleMuscleGroup {\n CHEST = 'chest',\n BACK = 'back',\n SHOULDERS = 'shoulders',\n BICEPS = 'biceps',\n TRICEPS = 'triceps',\n LEGS = 'legs',\n CORE = 'core',\n FOREARMS = 'forearms',\n}\n\n/** Mapping from simplified groups to the full taxonomy. */\nexport const SIMPLE_TO_DETAILED: Record<SimpleMuscleGroup, MuscleGroup[]> = {\n [SimpleMuscleGroup.CHEST]: [MuscleGroup.CHEST],\n [SimpleMuscleGroup.BACK]: [MuscleGroup.LATS, MuscleGroup.UPPER_BACK],\n [SimpleMuscleGroup.SHOULDERS]: [\n MuscleGroup.FRONT_DELTS,\n MuscleGroup.SIDE_DELTS,\n MuscleGroup.REAR_DELTS,\n ],\n [SimpleMuscleGroup.BICEPS]: [MuscleGroup.BICEPS],\n [SimpleMuscleGroup.TRICEPS]: [MuscleGroup.TRICEPS],\n [SimpleMuscleGroup.LEGS]: [\n MuscleGroup.QUADS,\n MuscleGroup.HAMSTRINGS,\n MuscleGroup.GLUTES,\n MuscleGroup.CALVES,\n ],\n [SimpleMuscleGroup.CORE]: [MuscleGroup.ABS, MuscleGroup.OBLIQUES],\n [SimpleMuscleGroup.FOREARMS]: [MuscleGroup.FOREARMS],\n}\n\n/** Reverse map: detailed MuscleGroup -> its SimpleMuscleGroup. */\nexport const DETAILED_TO_SIMPLE: Record<MuscleGroup, SimpleMuscleGroup> = Object.entries(\n SIMPLE_TO_DETAILED\n).reduce(\n (acc, [simple, groups]) => {\n for (const group of groups) {\n acc[group] = simple as SimpleMuscleGroup\n }\n return acc\n },\n {} as Record<MuscleGroup, SimpleMuscleGroup>\n)\n\n/** Movement category for training split organization. */\nexport type MovementCategory = 'push' | 'pull' | 'legs' | 'core'\n\nexport const MUSCLE_TO_CATEGORY: Record<MuscleGroup, MovementCategory> = {\n [MuscleGroup.CHEST]: 'push',\n [MuscleGroup.FRONT_DELTS]: 'push',\n [MuscleGroup.SIDE_DELTS]: 'push',\n [MuscleGroup.TRICEPS]: 'push',\n [MuscleGroup.LATS]: 'pull',\n [MuscleGroup.UPPER_BACK]: 'pull',\n [MuscleGroup.REAR_DELTS]: 'pull',\n [MuscleGroup.BICEPS]: 'pull',\n [MuscleGroup.FOREARMS]: 'pull',\n [MuscleGroup.QUADS]: 'legs',\n [MuscleGroup.HAMSTRINGS]: 'legs',\n [MuscleGroup.GLUTES]: 'legs',\n [MuscleGroup.CALVES]: 'legs',\n [MuscleGroup.ABS]: 'core',\n [MuscleGroup.OBLIQUES]: 'core',\n}\n\n/**\n * react-native-body-highlighter slug(s) per muscle group. Phase 1 uses the\n * closest available slug; deltoids share one path and lats/upper-back share\n * `upper-back` (see doc Level 4 \"Recommended approach\").\n */\nexport const MUSCLE_TO_SVG_SLUGS: Record<MuscleGroup, string[]> = {\n [MuscleGroup.CHEST]: ['chest'],\n [MuscleGroup.FRONT_DELTS]: ['deltoids'],\n [MuscleGroup.SIDE_DELTS]: ['deltoids'],\n [MuscleGroup.REAR_DELTS]: ['deltoids'],\n [MuscleGroup.TRICEPS]: ['triceps'],\n [MuscleGroup.LATS]: ['upper-back'],\n [MuscleGroup.UPPER_BACK]: ['upper-back', 'trapezius'],\n [MuscleGroup.BICEPS]: ['biceps'],\n [MuscleGroup.FOREARMS]: ['forearm'],\n [MuscleGroup.QUADS]: ['quadriceps'],\n [MuscleGroup.HAMSTRINGS]: ['hamstring'],\n [MuscleGroup.GLUTES]: ['gluteal'],\n [MuscleGroup.CALVES]: ['calves'],\n [MuscleGroup.ABS]: ['abs'],\n [MuscleGroup.OBLIQUES]: ['obliques'],\n}\n\n/** Human-readable name per muscle group (used in a11y labels). */\nexport const MUSCLE_DISPLAY_NAMES: Record<MuscleGroup, string> = {\n [MuscleGroup.CHEST]: 'Chest',\n [MuscleGroup.FRONT_DELTS]: 'Front Delts',\n [MuscleGroup.SIDE_DELTS]: 'Side Delts',\n [MuscleGroup.REAR_DELTS]: 'Rear Delts',\n [MuscleGroup.TRICEPS]: 'Triceps',\n [MuscleGroup.LATS]: 'Lats',\n [MuscleGroup.UPPER_BACK]: 'Upper Back',\n [MuscleGroup.BICEPS]: 'Biceps',\n [MuscleGroup.FOREARMS]: 'Forearms',\n [MuscleGroup.QUADS]: 'Quads',\n [MuscleGroup.HAMSTRINGS]: 'Hamstrings',\n [MuscleGroup.GLUTES]: 'Glutes',\n [MuscleGroup.CALVES]: 'Calves',\n [MuscleGroup.ABS]: 'Abs',\n [MuscleGroup.OBLIQUES]: 'Obliques',\n}\n\n/** Human-readable name per simple group. */\nexport const SIMPLE_DISPLAY_NAMES: Record<SimpleMuscleGroup, string> = {\n [SimpleMuscleGroup.CHEST]: 'Chest',\n [SimpleMuscleGroup.BACK]: 'Back',\n [SimpleMuscleGroup.SHOULDERS]: 'Shoulders',\n [SimpleMuscleGroup.BICEPS]: 'Biceps',\n [SimpleMuscleGroup.TRICEPS]: 'Triceps',\n [SimpleMuscleGroup.LEGS]: 'Legs',\n [SimpleMuscleGroup.CORE]: 'Core',\n [SimpleMuscleGroup.FOREARMS]: 'Forearms',\n}\n\n/** Volume landmarks per muscle group (weekly working sets). */\nexport interface VolumeLandmarks {\n mev: number // Minimum Effective Volume\n mav: number // Maximum Adaptive Volume\n mrv: number // Maximum Recoverable Volume\n}\n\nexport const DEFAULT_VOLUME_LANDMARKS: Record<MuscleGroup, VolumeLandmarks> = {\n [MuscleGroup.CHEST]: { mev: 8, mav: 14, mrv: 20 },\n [MuscleGroup.LATS]: { mev: 8, mav: 14, mrv: 20 },\n [MuscleGroup.UPPER_BACK]: { mev: 6, mav: 12, mrv: 18 },\n [MuscleGroup.FRONT_DELTS]: { mev: 2, mav: 6, mrv: 10 },\n [MuscleGroup.SIDE_DELTS]: { mev: 6, mav: 14, mrv: 22 },\n [MuscleGroup.REAR_DELTS]: { mev: 6, mav: 12, mrv: 18 },\n [MuscleGroup.BICEPS]: { mev: 4, mav: 10, mrv: 18 },\n [MuscleGroup.TRICEPS]: { mev: 4, mav: 8, mrv: 14 },\n [MuscleGroup.FOREARMS]: { mev: 2, mav: 6, mrv: 12 },\n [MuscleGroup.QUADS]: { mev: 6, mav: 12, mrv: 18 },\n [MuscleGroup.HAMSTRINGS]: { mev: 4, mav: 10, mrv: 16 },\n [MuscleGroup.GLUTES]: { mev: 4, mav: 10, mrv: 16 },\n [MuscleGroup.CALVES]: { mev: 6, mav: 10, mrv: 16 },\n [MuscleGroup.ABS]: { mev: 0, mav: 8, mrv: 16 },\n [MuscleGroup.OBLIQUES]: { mev: 0, mav: 6, mrv: 12 },\n}\n\n/** Weekly-volume status relative to MEV/MAV/MRV landmarks. */\nexport type VolumeStatus = 'under' | 'maintenance' | 'productive' | 'over'\n\n/** Readable label per status for a11y descriptions. */\nexport const VOLUME_STATUS_LABELS: Record<VolumeStatus, string> = {\n under: 'under-trained',\n maintenance: 'maintenance',\n productive: 'productive',\n over: 'over-reaching',\n}\n\n/** Severity ranking — higher wins when several groups share an SVG slug. */\nconst STATUS_SEVERITY: Record<VolumeStatus, number> = {\n under: 1,\n maintenance: 2,\n productive: 3,\n over: 4,\n}\n\n/**\n * Maps a volume status (and intensity, 0-1) to a heatmap fill color. The\n * `approaching` token is used when a productive muscle nears its MRV.\n */\nexport function getHeatmapColor(status: VolumeStatus | null | undefined, intensity = 0): string {\n const heatmap = WORKOUT_TOKENS.heatmap\n switch (status) {\n case 'under':\n return heatmap.under\n case 'maintenance':\n return heatmap.maintenance\n case 'productive':\n return intensity >= 0.85 ? heatmap.approaching : heatmap.productive\n case 'over':\n return heatmap.over\n default:\n return heatmap.none\n }\n}\n\n/** True when one status is at least as severe as another. */\nexport function isMoreSevere(a: VolumeStatus, b: VolumeStatus): boolean {\n return STATUS_SEVERITY[a] >= STATUS_SEVERITY[b]\n}\n\n/**\n * Representative MuscleGroup for each SVG slug, used to resolve taps on shared\n * paths (e.g. `deltoids`, `upper-back`) back to a single group.\n */\nexport const SLUG_TO_PRIMARY_MUSCLE: Record<string, MuscleGroup> = {\n chest: MuscleGroup.CHEST,\n deltoids: MuscleGroup.SIDE_DELTS,\n triceps: MuscleGroup.TRICEPS,\n 'upper-back': MuscleGroup.LATS,\n trapezius: MuscleGroup.UPPER_BACK,\n biceps: MuscleGroup.BICEPS,\n forearm: MuscleGroup.FOREARMS,\n quadriceps: MuscleGroup.QUADS,\n hamstring: MuscleGroup.HAMSTRINGS,\n gluteal: MuscleGroup.GLUTES,\n calves: MuscleGroup.CALVES,\n abs: MuscleGroup.ABS,\n obliques: MuscleGroup.OBLIQUES,\n}\n","/**\n * Custom JSX runtime for titan-design's web distribution.\n *\n * Converts className props to $$css style objects at build time,\n * eliminating the need for NativeWind's runtime interopComponents\n * Map lookup. RNW's styleq recognizes $$css objects and applies\n * their values as CSS class names on DOM elements.\n *\n * This file is NOT used by source builds (specimen, storybook,\n * native Metro). It is only inlined into the dist by tsup via\n * an esbuild onResolve plugin.\n */\nimport { jsx as reactJsx, jsxs as reactJsxs, Fragment } from 'react/jsx-runtime'\nimport type { StyleProp } from 'react-native'\n\ntype JsxFn = typeof reactJsx\n\nfunction wrapJsx(fn: JsxFn): JsxFn {\n return function (type, props: Record<string, any>, ...rest) {\n if (props && typeof props.className === 'string' && props.className) {\n const cn = props.className\n const cssStyle = { $$css: true, [cn]: cn } as unknown as StyleProp<any>\n const existing = props.style\n props = {\n ...props,\n style: existing ? [cssStyle, existing] : cssStyle,\n }\n delete props.className\n }\n return fn(type, props, ...rest)\n } as JsxFn\n}\n\nconst jsx = wrapJsx(reactJsx)\nconst jsxs = wrapJsx(reactJsxs)\n\nexport { jsx, jsxs, Fragment }\n","// Font mapping: font-heading=Space Grotesk, font-body=Nunito Sans (UI), font-sans=Inter (body)\nimport { useEffect, useMemo, useState } from 'react'\nimport { View, Text, Pressable, Animated, Easing, type ViewProps } from 'react-native'\nimport BodyHighlighter, { type ExtendedBodyPart, type Slug } from 'react-native-body-highlighter'\nimport { cn } from '../../../utils/cn'\nimport { resolveColor } from '../../../theme/resolve-color'\nimport { getSemanticColors } from '../../../theme/tokens/semantic'\nimport { primitiveColors } from '../../../theme/tokens/primitives'\nimport { alpha } from '../../../utils/colors'\nimport { getGlowShadow } from '../../../theme/elevation'\nimport {\n MuscleGroup,\n SimpleMuscleGroup,\n MUSCLE_TO_SVG_SLUGS,\n MUSCLE_DISPLAY_NAMES,\n SIMPLE_DISPLAY_NAMES,\n DETAILED_TO_SIMPLE,\n SLUG_TO_PRIMARY_MUSCLE,\n VOLUME_STATUS_LABELS,\n getHeatmapColor,\n isMoreSevere,\n type VolumeStatus,\n} from './muscleTaxonomy'\n\n/**\n * react-native-body-highlighter is published as a CommonJS default export; the\n * interop keeps it working whether the bundler unwraps the default or not.\n */\nconst Body = ((BodyHighlighter as unknown as { default?: typeof BodyHighlighter }).default ??\n BodyHighlighter) as typeof BodyHighlighter\n\nconst BRAND_PRIMARY = getSemanticColors('dark')['brand-primary']\n\nconst OUTLINE_FILL = alpha(primitiveColors.white, 0.08)\nconst OUTLINE_BORDER = alpha(primitiveColors.white, 0.12)\nconst BODY_SCALE = 0.8 // 200x400 intrinsic -> ~160x320 px\n\nexport interface BodyMapData {\n muscleGroup: MuscleGroup\n /** Intensity 0-1 for heatmap color. */\n intensity: number\n /** Volume status for tooltip / heatmap token. */\n volumeStatus: VolumeStatus\n /** Weekly effective sets. */\n weeklySets: number\n}\n\nexport interface BodyMapProps extends ViewProps {\n /** Muscle group intensity data. */\n data: BodyMapData[]\n /** Which view to show. */\n view: 'front' | 'back'\n /** Toggle between front/back. */\n onViewChange?: (view: 'front' | 'back') => void\n /** Called when a muscle group is tapped. */\n onMusclePress?: (muscleGroup: MuscleGroup) => void\n /** Currently highlighted muscle (from external selection). */\n highlightedMuscle?: MuscleGroup | null\n /** Show simplified (8 groups) or detailed (15 groups). */\n mode?: 'simple' | 'detailed'\n className?: string\n}\n\ninterface LegendEntry {\n key: string\n name: string\n status: VolumeStatus\n intensity: number\n sets: number\n /** Detailed group reported to onMusclePress. */\n muscle: MuscleGroup\n}\n\n/** Build the per-slug heatmap fill list, combining groups that share a slug. */\nfunction buildSlugParts(data: BodyMapData[]): ExtendedBodyPart[] {\n const bySlug = new Map<string, { status: VolumeStatus; intensity: number }>()\n for (const d of data) {\n for (const slug of MUSCLE_TO_SVG_SLUGS[d.muscleGroup] ?? []) {\n const existing = bySlug.get(slug)\n if (!existing || isMoreSevere(d.volumeStatus, existing.status)) {\n bySlug.set(slug, { status: d.volumeStatus, intensity: d.intensity })\n }\n }\n }\n return Array.from(bySlug.entries()).map(([slug, v]) => ({\n slug: slug as Slug,\n color: getHeatmapColor(v.status, v.intensity),\n }))\n}\n\n/** Collapse data into per-simple-group legend entries (summed sets). */\nfunction buildSimpleLegend(data: BodyMapData[]): LegendEntry[] {\n const bySimple = new Map<SimpleMuscleGroup, LegendEntry>()\n for (const d of data) {\n const simple = DETAILED_TO_SIMPLE[d.muscleGroup]\n const existing = bySimple.get(simple)\n if (!existing) {\n bySimple.set(simple, {\n key: simple,\n name: SIMPLE_DISPLAY_NAMES[simple],\n status: d.volumeStatus,\n intensity: d.intensity,\n sets: d.weeklySets,\n muscle: d.muscleGroup,\n })\n continue\n }\n existing.sets += d.weeklySets\n existing.intensity = Math.max(existing.intensity, d.intensity)\n if (isMoreSevere(d.volumeStatus, existing.status)) {\n existing.status = d.volumeStatus\n existing.muscle = d.muscleGroup\n }\n }\n return Array.from(bySimple.values())\n}\n\n/** One legend entry per data row, named by detailed group. */\nfunction buildDetailedLegend(data: BodyMapData[]): LegendEntry[] {\n return data.map((d) => ({\n key: d.muscleGroup,\n name: MUSCLE_DISPLAY_NAMES[d.muscleGroup],\n status: d.volumeStatus,\n intensity: d.intensity,\n sets: d.weeklySets,\n muscle: d.muscleGroup,\n }))\n}\n\n/**\n * Interactive SVG body map with tappable muscle groups and a volume heatmap.\n * Renders the front or back view (toggle via onViewChange), colors each muscle\n * by its weekly-volume status, and exposes an accessible muscle legend wired to\n * onMusclePress. Phase 1 uses react-native-body-highlighter's combined slugs\n * (deltoids as one path, lats/upper-back shared); swipe between views and the\n * delt/lat SVG split are follow-ups.\n *\n * @example\n * <BodyMap\n * data={[{ muscleGroup: MuscleGroup.CHEST, intensity: 0.7, volumeStatus: 'productive', weeklySets: 12 }]}\n * view=\"front\"\n * onViewChange={setView}\n * onMusclePress={setSelected}\n * highlightedMuscle={selected}\n * />\n */\nexport function BodyMap({\n data,\n view,\n onViewChange,\n onMusclePress,\n highlightedMuscle,\n mode = 'detailed',\n className,\n ...props\n}: BodyMapProps) {\n const slugParts = useMemo(() => buildSlugParts(data), [data])\n const legend = useMemo(\n () => (mode === 'simple' ? buildSimpleLegend(data) : buildDetailedLegend(data)),\n [data, mode]\n )\n\n const [highlight] = useState(() => new Animated.Value(highlightedMuscle ? 1 : 0))\n useEffect(() => {\n const animation = Animated.timing(highlight, {\n toValue: highlightedMuscle ? 1 : 0,\n duration: 250,\n easing: Easing.out(Easing.ease),\n useNativeDriver: false,\n })\n animation.start()\n return () => animation.stop()\n }, [highlightedMuscle, highlight])\n\n const scale = highlight.interpolate({ inputRange: [0, 1], outputRange: [1, 1.02] })\n const glowColor = highlightedMuscle\n ? getHeatmapColor(\n data.find((d) => d.muscleGroup === highlightedMuscle)?.volumeStatus,\n data.find((d) => d.muscleGroup === highlightedMuscle)?.intensity ?? 0\n )\n : null\n\n const handleBodyPress = (part: ExtendedBodyPart) => {\n if (!onMusclePress || !part.slug) return\n const fromData = data.find((d) =>\n (MUSCLE_TO_SVG_SLUGS[d.muscleGroup] ?? []).includes(part.slug as string)\n )\n const muscle = fromData?.muscleGroup ?? SLUG_TO_PRIMARY_MUSCLE[part.slug]\n if (muscle) onMusclePress(muscle)\n }\n\n return (\n <View className={cn(className)} testID=\"body-map\" {...props}>\n <ViewToggle view={view} onViewChange={onViewChange} />\n\n <Animated.View\n style={[\n {\n width: 200 * BODY_SCALE,\n alignSelf: 'center',\n transform: [{ scale }],\n },\n // The highlight halo is emphasis, not depth.\n glowColor ? getGlowShadow(glowColor, 'medium') : undefined,\n ]}\n // The SVG is decorative; the accessible muscle legend below is the\n // screen-reader / keyboard interface.\n aria-hidden\n accessibilityElementsHidden\n importantForAccessibility=\"no-hide-descendants\"\n testID=\"body-map-svg\"\n >\n <Body\n side={view}\n data={slugParts}\n scale={BODY_SCALE}\n gender=\"male\"\n defaultFill={OUTLINE_FILL}\n border={OUTLINE_BORDER}\n onBodyPartPress={handleBodyPress}\n />\n </Animated.View>\n\n {legend.length === 0 ? (\n <Text\n className=\"text-text-secondary\"\n style={{\n marginTop: 8,\n fontSize: 12,\n textAlign: 'center',\n fontFamily: 'Inter, sans-serif',\n }}\n testID=\"body-map-empty\"\n >\n No training data\n </Text>\n ) : (\n <View\n className=\"flex-row flex-wrap\"\n style={{ marginTop: 10, gap: 6, justifyContent: 'center' }}\n testID=\"body-map-legend\"\n >\n {legend.map((entry) => (\n <MuscleButton\n key={entry.key}\n entry={entry}\n highlighted={highlightedMuscle === entry.muscle}\n onMusclePress={onMusclePress}\n />\n ))}\n </View>\n )}\n </View>\n )\n}\n\ninterface ViewToggleProps {\n view: 'front' | 'back'\n onViewChange?: (view: 'front' | 'back') => void\n}\n\nfunction ViewToggle({ view, onViewChange }: ViewToggleProps) {\n return (\n <View\n className=\"flex-row self-center\"\n style={{ gap: 4, marginBottom: 8 }}\n testID=\"body-map-view-toggle\"\n >\n {(['front', 'back'] as const).map((side) => {\n const active = view === side\n return (\n <Pressable\n key={side}\n onPress={() => onViewChange?.(side)}\n accessibilityRole=\"button\"\n accessibilityLabel={`Show ${side} view`}\n aria-pressed={active}\n disabled={!onViewChange}\n style={{\n paddingHorizontal: 12,\n paddingVertical: 4,\n borderRadius: 9999,\n backgroundColor: active ? alpha(BRAND_PRIMARY, 0.16) : 'transparent',\n borderWidth: 1,\n borderColor: active ? BRAND_PRIMARY : resolveColor('hairline-strong'),\n }}\n testID={`body-map-toggle-${side}`}\n >\n <Text\n style={{\n fontSize: 12,\n fontFamily: 'Inter, sans-serif',\n fontWeight: active ? '700' : '500',\n color: active ? BRAND_PRIMARY : resolveColor('text-secondary'),\n textTransform: 'capitalize',\n }}\n >\n {side}\n </Text>\n </Pressable>\n )\n })}\n </View>\n )\n}\n\ninterface MuscleButtonProps {\n entry: LegendEntry\n highlighted: boolean\n onMusclePress?: (muscleGroup: MuscleGroup) => void\n}\n\nfunction MuscleButton({ entry, highlighted, onMusclePress }: MuscleButtonProps) {\n const dotColor = getHeatmapColor(entry.status, entry.intensity)\n const label = `${entry.name}, ${VOLUME_STATUS_LABELS[entry.status]}, ${entry.sets} sets this week`\n return (\n <Pressable\n onPress={() => onMusclePress?.(entry.muscle)}\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n aria-pressed={highlighted}\n className=\"bg-surface-raised\"\n style={{\n flexDirection: 'row',\n alignItems: 'center',\n gap: 5,\n paddingHorizontal: 8,\n paddingVertical: 3,\n borderRadius: 9999,\n borderWidth: 1,\n borderColor: highlighted ? BRAND_PRIMARY : resolveColor('hairline-default'),\n }}\n testID={`body-map-muscle-${entry.key}`}\n >\n <View\n style={{ width: 7, height: 7, borderRadius: 9999, backgroundColor: dotColor }}\n accessibilityElementsHidden\n testID={`body-map-muscle-dot-${entry.key}`}\n />\n <Text\n className=\"text-text-primary\"\n style={{\n fontSize: 11,\n fontFamily: 'Inter, sans-serif',\n fontWeight: '500',\n }}\n accessibilityElementsHidden\n >\n {entry.name}\n </Text>\n </Pressable>\n )\n}\n","import { View, type ViewProps } from 'react-native'\nimport { cn } from '../../../utils/cn'\nimport { getGlowShadow } from '../../../theme/elevation'\nimport { getSemanticColors } from '../../../theme/tokens/semantic'\nimport { greyRamp } from '../../../theme/tokens/primitives'\n\nexport type IndicatorSize = 'xs' | 'sm' | 'md' | 'lg'\nexport type IndicatorColor =\n | 'default'\n | 'primary'\n | 'success'\n | 'live'\n | 'error'\n | 'warning'\n | 'info'\n | 'error-vivid'\n\n/** How a pulsing indicator animates: a subtle opacity fade, or an expanding ring. */\nexport type IndicatorPulse = 'opacity' | 'ping'\n\nexport interface IndicatorProps extends ViewProps {\n /** Dot size */\n size?: IndicatorSize\n /** Semantic color */\n color?: IndicatorColor\n /** Custom hex color (overrides color prop) */\n customColor?: string\n /** Add a glow shadow effect */\n glow?: boolean\n /** Add a ring border */\n ring?: boolean\n /** Animate for live/active status. `true` = opacity fade; `'ping'` = expanding ring. */\n pulse?: boolean | IndicatorPulse\n /** Additional className */\n className?: string\n}\n\nconst sizeStyles: Record<IndicatorSize, string> = {\n xs: 'w-1 h-1',\n sm: 'w-1.5 h-1.5',\n md: 'w-2 h-2',\n lg: 'w-2.5 h-2.5',\n}\n\nconst colorStyles: Record<IndicatorColor, string> = {\n default: 'bg-text-tertiary',\n primary: 'bg-brand-primary',\n success: 'bg-status-success',\n live: 'bg-status-live',\n error: 'bg-status-error',\n warning: 'bg-status-warning',\n info: 'bg-status-info',\n 'error-vivid': 'bg-status-error-vivid',\n}\n\n// Glow is EMPHASIS, not depth: the dot's own colour, through the shared builder.\n// Literal hex (not `resolveColor`) because getGlowShadow does colour maths on it.\nconst t = getSemanticColors('dark')\n\nconst glowColors: Record<IndicatorColor, string> = {\n default: greyRamp[500],\n primary: t['brand-primary'],\n success: t['status-success'],\n live: t['status-live'],\n error: t['status-error'],\n warning: t['status-warning'],\n info: t['status-info'],\n 'error-vivid': t['status-error-vivid'],\n}\n\nexport function Indicator({\n size = 'sm',\n color = 'default',\n customColor,\n glow = false,\n ring = false,\n pulse = false,\n className,\n style,\n ...props\n}: IndicatorProps) {\n const pulseMode: IndicatorPulse | false = pulse === true ? 'opacity' : pulse || false\n const colorClass = !customColor ? colorStyles[color] : undefined\n const colorStyle = customColor ? { backgroundColor: customColor } : undefined\n\n // Expanding-ring pulse: a ping layer behind the solid dot (for live/active status).\n if (pulseMode === 'ping') {\n return (\n <View className={cn('relative', sizeStyles[size], className)} style={style} {...props}>\n <View\n className={cn('absolute inset-0 rounded-full animate-ping', colorClass)}\n style={colorStyle}\n />\n <View\n className={cn(\n 'relative rounded-full',\n sizeStyles[size],\n colorClass,\n ring && 'border-2 border-background-base'\n )}\n style={colorStyle}\n />\n </View>\n )\n }\n\n const glowStyle = glow ? getGlowShadow(customColor ?? glowColors[color], 'subtle') : null\n\n return (\n <View\n className={cn(\n 'rounded-full shrink-0',\n sizeStyles[size],\n colorClass,\n pulseMode === 'opacity' && 'animate-pulse',\n ring && 'border-2 border-background-base',\n className\n )}\n style={[style, colorStyle, glowStyle]}\n {...props}\n />\n )\n}\n","import React from 'react'\nimport { View, Text, Pressable, type ViewProps } from 'react-native'\nimport { cn } from '../../../utils/cn'\n\nexport type PillVariant = 'solid' | 'subtle' | 'outline'\n/** Semantic tone. `brand-secondary` is the accent, not a second brand. */\nexport type PillTone =\n | 'neutral'\n | 'brand'\n | 'brand-secondary'\n | 'success'\n | 'warning'\n | 'error'\n | 'info'\n/** Legacy palette names, kept so existing `color=` call sites keep working. */\nexport type PillColor =\n | 'default'\n | 'primary'\n | 'secondary'\n | 'success'\n | 'error'\n | 'warning'\n | 'info'\nexport type PillSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n\nexport interface PillProps extends ViewProps {\n /** Pill content */\n children?: React.ReactNode\n /** Visual variant */\n variant?: PillVariant\n /** Semantic tone */\n tone?: PillTone\n /** @deprecated Use `tone` — `color` maps onto it and is kept for call-site compatibility. */\n color?: PillColor\n /** Size */\n size?: PillSize\n /** Fully rounded (default true) or slight radius */\n rounded?: boolean\n /** Leading slot: `'dot'` renders a tone-matched dot, any node renders as-is. */\n leading?: React.ReactNode | 'dot'\n /**\n * Colour the leading dot independently of the capsule. For the pattern where\n * the label is neutral and only the dot carries status, so a row of chips\n * stays quiet and the dots are the signal.\n */\n dotTone?: PillTone\n /** @deprecated Use `leading`. */\n leftElement?: React.ReactNode\n /** Trailing slot (dismiss affordance, counter) */\n trailing?: React.ReactNode\n /** Press handler (makes pill interactive) */\n onPress?: () => void\n /** Non-interactive and dimmed */\n isDisabled?: boolean\n /** Additional className on the container */\n className?: string\n /** Additional className on the label, for presets that own their typography */\n textClassName?: string\n}\n\nconst colorToTone: Record<PillColor, PillTone> = {\n default: 'neutral',\n primary: 'brand',\n secondary: 'brand-secondary',\n success: 'success',\n error: 'error',\n warning: 'warning',\n info: 'info',\n}\n\nconst toneStyles: Record<PillVariant, Record<PillTone, string>> = {\n solid: {\n neutral: 'bg-hairline-strong border-transparent text-text-inverse',\n brand: 'bg-brand-primary border-transparent text-text-inverse',\n 'brand-secondary': 'bg-brand-secondary border-transparent text-text-inverse',\n success: 'bg-status-success border-transparent text-text-inverse',\n warning: 'bg-status-warning border-transparent text-text-inverse',\n error: 'bg-status-error border-transparent text-text-inverse',\n info: 'bg-status-info border-transparent text-text-inverse',\n },\n subtle: {\n // Alpha-white rather than a ramp step: a pill sits on whatever plane its\n // host is, and an alpha fill composites by the same amount on all of them.\n // A `surface-*` fill would vanish on the plane it names. Borderless like the\n // six coloured tones — the fill carries the capsule, not a ring.\n // Label comes from `on-*-subtle`, not the base tone token: the base is tuned to\n // carry a white label as a solid fill, which left error and accent unreadable\n // here (AW-133). The on-subtle tokens level the family at one weight.\n neutral: 'bg-hairline-subtle border-transparent text-text-secondary',\n brand: 'bg-brand-primary-subtle border-transparent text-on-brand-primary-subtle',\n 'brand-secondary':\n 'bg-brand-secondary-subtle border-transparent text-on-brand-secondary-subtle',\n success: 'bg-status-success-subtle border-transparent text-on-status-success-subtle',\n warning: 'bg-status-warning-subtle border-transparent text-on-status-warning-subtle',\n error: 'bg-status-error-subtle border-transparent text-on-status-error-subtle',\n info: 'bg-status-info-subtle border-transparent text-on-status-info-subtle',\n },\n outline: {\n neutral: 'border-hairline text-text-secondary',\n brand: 'border-brand-primary text-brand-primary',\n 'brand-secondary': 'border-brand-secondary text-brand-secondary',\n success: 'border-status-success text-status-success',\n warning: 'border-status-warning text-status-warning',\n error: 'border-status-error text-status-error',\n info: 'border-status-info text-status-info',\n },\n}\n\nconst dotToneStyles: Record<PillTone, string> = {\n neutral: 'bg-text-tertiary',\n brand: 'bg-brand-primary',\n 'brand-secondary': 'bg-brand-secondary',\n success: 'bg-status-success',\n warning: 'bg-status-warning',\n error: 'bg-status-error',\n info: 'bg-status-info',\n}\n\n// One text step per rung. `md` used to repeat `sm`'s 10px, which left no 12px\n// capsule at all and pushed anything between the two down to 10px — that is how\n// MuscleGroupChip lost 7px of height. `md` is the 12px rung now.\nconst sizeStyles: Record<PillSize, { container: string; text: string }> = {\n xs: { container: 'px-1 py-px', text: 'text-3xs' },\n sm: { container: 'px-2 py-0.5', text: 'text-2xs' },\n md: { container: 'px-2.5 py-1', text: 'text-xs' },\n lg: { container: 'px-3 py-1.5', text: 'text-sm' },\n xl: { container: 'px-4 py-2', text: 'text-base' },\n}\n\n// The dot derives its testID from the pill's, so a preset's dot stays\n// addressable under the preset's own name (`muscle-group-chip-dot`) instead of\n// collapsing to a generic one — the visual parity layer targets it by name.\nfunction PillDot({ tone, testID }: { tone: PillTone; testID?: string }) {\n return (\n <View\n className={cn('w-1.5 h-1.5 rounded-full shrink-0', dotToneStyles[tone])}\n accessibilityElementsHidden\n testID={testID ? `${testID}-dot` : 'pill-dot'}\n />\n )\n}\n\nfunction containerClasses(p: PillProps, tone: PillTone) {\n return cn(\n 'flex-row items-center gap-1 border self-start shrink-0',\n p.rounded === false ? 'rounded' : 'rounded-full',\n toneStyles[p.variant ?? 'subtle'][tone],\n sizeStyles[p.size ?? 'sm'].container,\n p.isDisabled && 'opacity-50',\n p.className\n )\n}\n\nfunction PillContent({ tone, ...p }: PillProps & { tone: PillTone }) {\n const textClasses = cn(\n 'font-heading font-semibold text-inherit',\n sizeStyles[p.size ?? 'sm'].text,\n p.textClassName\n )\n const slot = p.leading ?? p.leftElement\n return (\n <>\n {slot === 'dot' ? <PillDot tone={p.dotTone ?? tone} testID={p.testID} /> : slot}\n {typeof p.children === 'string' ? (\n <Text className={textClasses}>{p.children}</Text>\n ) : (\n p.children\n )}\n {p.trailing}\n </>\n )\n}\n\n/**\n * The single pill primitive: a capsule of tone-coloured label with optional\n * leading and trailing slots. `Badge`, `Chip`, `StatusPill` and\n * `MuscleGroupChip` are presets over it.\n *\n * @example\n * <Pill tone=\"success\" leading=\"dot\">Active</Pill>\n */\nexport function Pill(props: PillProps) {\n const {\n variant,\n tone,\n color,\n size,\n rounded,\n leading,\n dotTone,\n leftElement,\n trailing,\n onPress,\n isDisabled,\n className,\n textClassName,\n children,\n ...viewProps\n } = props\n const resolvedTone = tone ?? (color ? colorToTone[color] : 'neutral')\n const classes = containerClasses(props, resolvedTone)\n const content = <PillContent {...props} tone={resolvedTone} />\n\n if (onPress) {\n return (\n <Pressable\n onPress={onPress}\n disabled={isDisabled}\n accessibilityRole=\"button\"\n className={classes}\n {...viewProps}\n >\n {content}\n </Pressable>\n )\n }\n\n return (\n <View className={classes} {...viewProps}>\n {content}\n </View>\n )\n}\n","import React from 'react'\nimport { Text, type ViewProps } from 'react-native'\nimport { cn } from '../../../utils/cn'\nimport { Indicator, type IndicatorColor } from '../indicator'\nimport { Pill, type PillTone, type PillVariant } from '../pill'\n\nexport type BadgeVariant = 'solid' | 'subtle' | 'outline'\nexport type BadgeColor =\n | 'default'\n | 'primary'\n | 'secondary'\n | 'success'\n | 'error'\n | 'warning'\n | 'info'\nexport type BadgeSize = 'sm' | 'md' | 'lg'\n\nexport interface BadgeProps extends ViewProps {\n /** Visual variant */\n variant?: BadgeVariant\n /** Color scheme */\n color?: BadgeColor\n /** Size */\n size?: BadgeSize\n /** Show a leading indicator dot */\n dot?: boolean\n /** Color for the dot indicator (defaults to match badge color) */\n dotColor?: IndicatorColor\n /** Additional className */\n className?: string\n children?: React.ReactNode\n}\n\nconst colorToTone: Record<BadgeColor, PillTone> = {\n default: 'neutral',\n primary: 'brand',\n secondary: 'brand-secondary',\n success: 'success',\n error: 'error',\n warning: 'warning',\n info: 'info',\n}\n\n/** Badge keeps its own geometry; Pill supplies structure, tone and the slots. */\nconst sizeStyles: Record<BadgeSize, string> = {\n sm: 'px-1.5 py-0.5',\n md: 'px-2 py-0.5',\n lg: 'px-2.5 py-1',\n}\n\nconst textSizeStyles: Record<BadgeSize, string> = {\n sm: 'text-xs',\n md: 'text-xs',\n lg: 'text-sm',\n}\n\nfunction dotIndicatorColor(color: BadgeColor, dotColor?: IndicatorColor): IndicatorColor {\n if (dotColor) return dotColor\n return color === 'default' || color === 'secondary' ? 'default' : (color as IndicatorColor)\n}\n\n/**\n * Badge — a `Pill` preset for status indicators and labels.\n *\n * @example\n * <Badge color=\"success\">Active</Badge>\n * <Badge variant=\"outline\" color=\"warning\">Pending</Badge>\n */\nexport function Badge({\n variant = 'subtle',\n color = 'default',\n size = 'md',\n dot,\n dotColor,\n className,\n children,\n ...props\n}: BadgeProps) {\n return (\n <Pill\n variant={variant as PillVariant}\n tone={colorToTone[color]}\n leading={\n dot ? (\n <Indicator size=\"xs\" color={dotIndicatorColor(color, dotColor)} className=\"mr-0.5\" />\n ) : undefined\n }\n className={cn(\n 'justify-center self-auto gap-0',\n variant === 'outline' ? 'border' : 'border-0',\n sizeStyles[size],\n className\n )}\n textClassName={cn('font-sans font-medium', textSizeStyles[size])}\n {...props}\n >\n {children}\n </Pill>\n )\n}\n\nexport interface BadgeTextProps {\n children: React.ReactNode\n className?: string\n}\n\n/**\n * Text component for Badge content.\n */\nexport function BadgeText({ children, className }: BadgeTextProps) {\n return <Text className={cn('text-inherit font-medium', className)}>{children}</Text>\n}\n","import React from 'react'\nimport { Text, type TextProps } from 'react-native'\nimport { cn } from '../../../utils/cn'\n\nexport type TypographyVariant =\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'h6'\n | 'body1'\n | 'body2'\n | 'subtitle1'\n | 'subtitle2'\n | 'caption'\n | 'overline'\n | 'button'\n | 'mono'\n | 'monoLabel'\n | 'microLabel'\n | 'boldLabel'\n\nexport type TypographyColor =\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'disabled'\n | 'inverse'\n | 'success'\n | 'error'\n | 'warning'\n | 'info'\n | 'inherit'\n\nexport type TypographyAlign = 'left' | 'center' | 'right' | 'justify'\n\nexport type TypographyMarginBottom = 'none' | 'sm' | 'md' | 'lg'\n\nexport interface TypographyProps extends TextProps {\n /** Typography variant */\n variant?: TypographyVariant\n /** Text color */\n color?: TypographyColor\n /** Text alignment */\n align?: TypographyAlign\n /** Whether text should truncate with ellipsis */\n truncate?: boolean\n /** @deprecated Use truncate instead */\n noWrap?: boolean\n /** Margin bottom spacing */\n marginBottom?: TypographyMarginBottom\n /** @deprecated Use marginBottom instead */\n gutterBottom?: boolean\n /** Maximum number of lines before truncating */\n maxLines?: number\n /** Additional className */\n className?: string\n children?: React.ReactNode\n}\n\n// Variant styles matching the existing theme\nconst variantStyles: Record<TypographyVariant, string> = {\n h1: 'font-heading text-5xl font-bold leading-tight',\n h2: 'font-heading text-4xl font-bold leading-tight',\n h3: 'font-heading text-3xl font-bold leading-tight',\n h4: 'font-heading text-2xl font-bold leading-tight',\n h5: 'font-heading text-xl font-semibold leading-tight',\n h6: 'font-heading text-lg font-semibold leading-tight',\n body1: 'font-body text-base font-normal leading-normal',\n body2: 'font-body text-sm font-normal leading-normal',\n subtitle1: 'font-body text-base font-medium leading-relaxed',\n subtitle2: 'font-body text-sm font-medium leading-normal',\n caption: 'font-body text-xs font-normal leading-loose',\n overline: 'font-body text-xs font-semibold uppercase tracking-widest leading-relaxed',\n button: 'font-sans text-sm font-semibold leading-relaxed',\n // Monospace technical readouts (clocks, ids, metrics) and their all-caps label form.\n mono: 'font-mono text-xs font-normal leading-normal',\n monoLabel: 'font-mono text-xs font-bold uppercase tracking-wide leading-normal',\n // The sans (Inter) label pair: 10px for dense table/column headers, 12px bold for\n // badge and row labels. `overline` is the 12px font-body form of the same idea.\n microLabel: 'font-sans text-2xs font-semibold uppercase tracking-widest leading-normal',\n boldLabel: 'font-sans text-xs font-bold leading-normal',\n}\n\nconst colorStyles: Record<TypographyColor, string> = {\n primary: 'text-text-primary',\n secondary: 'text-text-secondary',\n tertiary: 'text-text-tertiary',\n disabled: 'text-text-disabled',\n inverse: 'text-text-inverse',\n success: 'text-status-success',\n error: 'text-status-error',\n warning: 'text-status-warning',\n info: 'text-status-info',\n inherit: '', // No color class, inherit from parent\n}\n\nconst alignStyles: Record<TypographyAlign, string> = {\n left: 'text-left',\n center: 'text-center',\n right: 'text-right',\n justify: 'text-justify',\n}\n\n// Heading variants for accessibility role\nconst headingVariants: TypographyVariant[] = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']\n\nconst marginBottomStyles: Record<TypographyMarginBottom, string> = {\n none: '',\n sm: 'mb-1',\n md: 'mb-2',\n lg: 'mb-4',\n}\n\n/**\n * Typography component for consistent text styling.\n *\n * @example\n * <Typography variant=\"h1\">Page Title</Typography>\n * <Typography variant=\"body1\" color=\"secondary\">Body text content</Typography>\n * <Typography variant=\"caption\" marginBottom=\"md\">Small caption text</Typography>\n * <Typography truncate maxLines={2}>Long text that will truncate...</Typography>\n */\nexport function Typography({\n variant = 'body1',\n color = 'primary',\n align,\n truncate = false,\n noWrap = false, // deprecated, kept for backward compatibility\n marginBottom,\n gutterBottom = false, // deprecated, kept for backward compatibility\n maxLines,\n className,\n children,\n ...props\n}: TypographyProps) {\n const isHeading = headingVariants.includes(variant)\n const shouldTruncate = truncate || noWrap\n const mb = marginBottom || (gutterBottom ? 'md' : 'none')\n\n // Determine number of lines\n let numLines: number | undefined\n if (maxLines) {\n numLines = maxLines\n } else if (shouldTruncate) {\n numLines = 1\n }\n\n return (\n <Text\n accessibilityRole={isHeading ? 'header' : 'text'}\n numberOfLines={numLines}\n className={cn(\n variantStyles[variant],\n color !== 'inherit' && colorStyles[color],\n align && alignStyles[align],\n shouldTruncate && 'truncate',\n marginBottomStyles[mb],\n className\n )}\n {...props}\n >\n {children}\n </Text>\n )\n}\n\n// Convenience components for common typography patterns\n\nexport interface HeadingProps extends Omit<TypographyProps, 'variant'> {\n /** Heading level (1-6) */\n level?: 1 | 2 | 3 | 4 | 5 | 6\n}\n\n/**\n * Heading component - convenience wrapper for Typography with heading variants.\n *\n * @example\n * <Heading level={1}>Page Title</Heading>\n * <Heading level={2} gutterBottom>Section Title</Heading>\n */\nexport function Heading({ level = 1, ...props }: HeadingProps) {\n const variant = `h${level}` as TypographyVariant\n return <Typography variant={variant} {...props} />\n}\n\nexport interface ParagraphProps extends Omit<TypographyProps, 'variant'> {\n /** Use smaller body2 variant */\n small?: boolean\n}\n\n/**\n * Paragraph component - convenience wrapper for body text.\n *\n * @example\n * <Paragraph>This is body text content.</Paragraph>\n * <Paragraph small>This is smaller body text.</Paragraph>\n */\nexport function Paragraph({ small = false, ...props }: ParagraphProps) {\n return <Typography variant={small ? 'body2' : 'body1'} {...props} />\n}\n\nexport interface CaptionProps extends Omit<TypographyProps, 'variant'> {}\n\n/**\n * Caption component - for small helper/secondary text.\n */\nexport function Caption(props: CaptionProps) {\n return <Typography variant=\"caption\" color=\"secondary\" {...props} />\n}\n\nexport interface LabelProps extends Omit<TypographyProps, 'variant'> {}\n\n/**\n * Label component - for form labels and similar.\n */\nexport function Label(props: LabelProps) {\n return <Typography variant=\"subtitle2\" {...props} />\n}\n\nexport interface OverlineProps extends Omit<TypographyProps, 'variant'> {}\n\n/**\n * Overline component - for section labels, categories.\n */\nexport function Overline(props: OverlineProps) {\n return <Typography variant=\"overline\" color=\"secondary\" {...props} />\n}\n","// Font mapping: font-heading=Space Grotesk, font-body=Nunito Sans (UI), font-sans=Inter (body)\nimport { View, type ViewProps } from 'react-native'\nimport { cn } from '../../../utils/cn'\nimport { Typography } from '../Typography'\nimport { resolveColor } from '../../../theme/resolve-color'\n\nexport interface SparklineProps extends ViewProps {\n data: number[]\n width?: number\n height?: number\n color?: string\n showDots?: boolean\n referenceLines?: Array<{\n value: number\n color: string\n dashed?: boolean\n label?: string\n }>\n highlightLast?: boolean\n className?: string\n}\n\nfunction normalizeData(data: number[], height: number): number[] {\n if (data.length === 0) return []\n const min = Math.min(...data)\n const max = Math.max(...data)\n const range = max - min || 1\n return data.map((v) => height - ((v - min) / range) * height)\n}\n\nfunction normalizeValue(value: number, data: number[], height: number): number {\n const min = Math.min(...data)\n const max = Math.max(...data)\n const range = max - min || 1\n return height - ((value - min) / range) * height\n}\n\nexport function Sparkline({\n data,\n width = 80,\n height = 30,\n color,\n showDots = false,\n referenceLines,\n highlightLast = false,\n className,\n ...props\n}: SparklineProps) {\n if (data.length === 0) {\n return (\n <View\n style={{ width, height }}\n className={className}\n testID=\"sparkline-empty\"\n accessibilityLabel=\"Sparkline chart, no data\"\n {...props}\n />\n )\n }\n\n const resolvedColor = color ?? resolveColor('brand-primary')\n const normalized = normalizeData(data, height)\n const stepX = data.length > 1 ? width / (data.length - 1) : 0\n\n const dotSize = 3\n const highlightSize = 6\n\n return (\n <View\n style={{ width, height, position: 'relative' }}\n className={cn(className)}\n accessibilityRole=\"image\"\n accessibilityLabel={`Sparkline chart with ${data.length} data points`}\n testID=\"sparkline\"\n {...props}\n >\n {referenceLines?.map((line, i) => {\n const y = normalizeValue(line.value, data, height)\n return (\n <View\n key={`ref-${i}`}\n style={[\n {\n position: 'absolute',\n top: y,\n left: 0,\n right: 0,\n opacity: 0.6,\n },\n line.dashed\n ? {\n height: 0,\n borderStyle: 'dashed',\n borderTopWidth: 1,\n borderTopColor: line.color,\n }\n : {\n height: 1,\n backgroundColor: line.color,\n },\n ]}\n accessibilityElementsHidden\n testID={`sparkline-reference-${i}`}\n >\n {line.label && (\n // `3xs` (9px) is the scale floor; the label was 7px, which is off it\n // entirely (TOKENS.md §4). The line box stays unpinned, as the raw\n // <Text> this replaced was, so the absolute offset still lands.\n <Typography\n variant=\"caption\"\n color=\"inherit\"\n className=\"text-3xs leading-[normal]\"\n style={{\n position: 'absolute',\n right: 0,\n top: -10,\n color: line.color,\n opacity: 1,\n }}\n testID={`sparkline-reference-label-${i}`}\n >\n {line.label}\n </Typography>\n )}\n </View>\n )\n })}\n\n {/* Line segments connecting data points */}\n {normalized.map((y, i) => {\n if (i === 0) return null\n const prevY = normalized[i - 1]\n const x1 = (i - 1) * stepX\n const x2 = i * stepX\n const dx = x2 - x1\n const dy = y - prevY\n const length = Math.sqrt(dx * dx + dy * dy)\n const angle = Math.atan2(dy, dx) * (180 / Math.PI)\n return (\n <View\n key={`line-${i}`}\n style={{\n position: 'absolute',\n left: x1,\n top: prevY,\n width: length,\n height: 1.5,\n backgroundColor: resolvedColor,\n transformOrigin: '0 0',\n transform: [{ rotate: `${angle}deg` }],\n }}\n accessibilityElementsHidden\n testID={`sparkline-segment-${i}`}\n />\n )\n })}\n\n {/* Data point dots */}\n {(showDots || highlightLast) &&\n normalized.map((y, i) => {\n const isLast = i === data.length - 1\n const shouldShow = showDots || (highlightLast && isLast)\n if (!shouldShow) return null\n\n const size = highlightLast && isLast ? highlightSize : dotSize\n return (\n <View\n key={`dot-${i}`}\n style={{\n position: 'absolute',\n left: i * stepX - size / 2,\n top: y - size / 2,\n width: size,\n height: size,\n borderRadius: size / 2,\n backgroundColor: resolvedColor,\n }}\n accessibilityElementsHidden\n testID={`sparkline-dot-${i}`}\n />\n )\n })}\n </View>\n )\n}\n","// Font mapping: font-heading=Space Grotesk, font-body=Nunito Sans (UI), font-sans=Inter (body)\nimport { useEffect, useState } from 'react'\nimport {\n View,\n Text,\n Pressable,\n ScrollView,\n Animated,\n Easing,\n type ViewProps,\n type ViewStyle,\n} from 'react-native'\nimport { Badge, type BadgeColor } from '../../ui/badge'\nimport { Sparkline } from './Sparkline'\nimport {\n MuscleGroup,\n VOLUME_STATUS_LABELS,\n type VolumeLandmarks,\n type VolumeStatus,\n} from './muscleTaxonomy'\nimport { getSemanticColors } from '../../../theme/tokens/semantic'\nimport { primitiveColors } from '../../../theme/tokens/primitives'\nimport { liftStyle } from '../../../theme/lift'\nimport { alpha } from '../../../utils/colors'\n\nconst t = getSemanticColors('dark')\n\nconst BRAND_PRIMARY = t['brand-primary']\n\n/** Volume track gradient: status-info -> status-success -> status-error. */\nconst VOLUME_GRADIENT = `linear-gradient(90deg, ${t['status-info']} 0%, ${t['status-success']} 50%, ${t['status-error']} 100%)`\n\n/** Sheet slides up from this offset (px) and the backdrop fades to this opacity. */\nconst SLIDE_OFFSET = 400\nconst BACKDROP_OPACITY = 0.4\n\n/** Volume status -> Badge color scheme. */\nconst STATUS_BADGE_COLOR: Record<VolumeStatus, BadgeColor> = {\n under: 'info',\n maintenance: 'warning',\n productive: 'success',\n over: 'error',\n}\n\nexport interface ContributingExercise {\n /** Exercise name. */\n name: string\n /** Working sets contributed this week. */\n sets: number\n /** Effective-set multiplier toward this muscle (0-1). */\n contributionWeight: number\n}\n\nexport interface UpcomingExercise {\n /** Exercise name. */\n name: string\n /** Workout the exercise belongs to. */\n workoutName: string\n /** Planned sets. */\n sets: number\n}\n\nexport interface BodyMapDetailPanelProps extends ViewProps {\n /** Muscle group whose volume detail is shown. */\n muscleGroup: MuscleGroup\n /** Human-readable muscle name for the title and a11y label. */\n displayName: string\n /** Weekly effective sets logged for this muscle. */\n weeklySets: number\n /** Volume landmarks (weekly working sets). */\n landmarks: VolumeLandmarks\n /** Weekly-volume status relative to the landmarks. */\n volumeStatus: VolumeStatus\n /** Last trained label, e.g. \"2 days ago\". */\n lastTrained?: string\n /** Volume sparkline data (last 4-8 weeks). */\n weeklyHistory?: number[]\n /** Exercises contributing to this muscle's volume. */\n contributingExercises?: ContributingExercise[]\n /** Upcoming exercises targeting this muscle. */\n upcomingExercises?: UpcomingExercise[]\n /** Whether the bottom sheet is visible. */\n isOpen?: boolean\n /** Alias for `isOpen` (spec wording: \"isOpen/visible\"). `isOpen` wins when both are set. */\n visible?: boolean\n /** Dismiss the panel (backdrop, handle, or close button). */\n onClose: () => void\n /** Navigate to a filtered exercise list. */\n onViewExercises?: () => void\n}\n\nfunction clamp01(value: number): number {\n if (value < 0) return 0\n if (value > 1) return 1\n return value\n}\n\n/** Marker position (0-1) of current sets between MEV (left) and MRV (right). */\nfunction markerFraction(weeklySets: number, { mev, mrv }: VolumeLandmarks): number {\n const span = mrv - mev\n if (span <= 0) return weeklySets >= mrv ? 1 : 0\n return clamp01((weeklySets - mev) / span)\n}\n\n/**\n * Slide-up bottom-sheet panel with detailed weekly-volume info for a tapped\n * muscle group: a MEV|current|MRV gradient progress bar, the big weekly set\n * count against MRV, an optional volume sparkline, and the contributing /\n * upcoming exercise lists. Composes the titan `Badge` and Workout `Sparkline`.\n *\n * Controlled via `isOpen` (or the `visible` alias); renders nothing when closed\n * and animates in on open — sheet translateY 400->0 (400ms ease-out) and a\n * backdrop fade 0->0.4 (RN Animated, useNativeDriver:false). Backdrop, handle,\n * and the header close button all call `onClose`.\n *\n * @example\n * <BodyMapDetailPanel\n * muscleGroup={MuscleGroup.CHEST}\n * displayName=\"Chest\"\n * weeklySets={14}\n * landmarks={{ mev: 8, mav: 14, mrv: 20 }}\n * volumeStatus=\"productive\"\n * lastTrained=\"2 days ago\"\n * weeklyHistory={[8, 10, 12, 14]}\n * isOpen={open}\n * onClose={() => setOpen(false)}\n * />\n */\nexport function BodyMapDetailPanel({\n muscleGroup,\n displayName,\n weeklySets,\n landmarks,\n volumeStatus,\n lastTrained,\n weeklyHistory,\n contributingExercises,\n upcomingExercises,\n isOpen,\n visible,\n onClose,\n onViewExercises,\n ...props\n}: BodyMapDetailPanelProps) {\n const open = isOpen ?? visible ?? false\n\n const [translateY] = useState(() => new Animated.Value(SLIDE_OFFSET))\n const [backdrop] = useState(() => new Animated.Value(0))\n\n useEffect(() => {\n if (!open) return\n const animation = Animated.parallel([\n Animated.timing(translateY, {\n toValue: 0,\n duration: 400,\n easing: Easing.out(Easing.ease),\n useNativeDriver: false,\n }),\n Animated.timing(backdrop, {\n toValue: BACKDROP_OPACITY,\n duration: 300,\n easing: Easing.out(Easing.ease),\n useNativeDriver: false,\n }),\n ])\n animation.start()\n return () => animation.stop()\n }, [open, translateY, backdrop])\n\n if (!open) return null\n\n const dialogLabel = `${displayName} volume details`\n const markerLeft = markerFraction(weeklySets, landmarks) * 100\n const hasContributing = (contributingExercises?.length ?? 0) > 0\n const hasUpcoming = (upcomingExercises?.length ?? 0) > 0\n\n return (\n <View\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n justifyContent: 'flex-end',\n }}\n testID=\"body-map-detail-panel-root\"\n >\n <Animated.View\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: primitiveColors.black,\n opacity: backdrop,\n }}\n testID=\"body-map-detail-panel-backdrop-anim\"\n >\n <Pressable\n onPress={onClose}\n accessibilityRole=\"button\"\n accessibilityLabel={`Close ${displayName} details`}\n style={{ flex: 1 }}\n testID=\"body-map-detail-panel-backdrop\"\n />\n </Animated.View>\n\n <Animated.View\n accessibilityRole={'dialog' as ViewProps['accessibilityRole']}\n accessibilityLabel={dialogLabel}\n aria-label={dialogLabel}\n className=\"bg-surface-elevated\"\n style={{\n borderTopLeftRadius: 16,\n borderTopRightRadius: 16,\n maxHeight: '88%',\n transform: [{ translateY }],\n }}\n testID=\"body-map-detail-panel\"\n {...props}\n >\n <Pressable\n onPress={onClose}\n accessibilityRole=\"button\"\n accessibilityLabel={`Close ${displayName} details`}\n hitSlop={12}\n style={{ alignSelf: 'center', paddingVertical: 8 }}\n testID=\"body-map-detail-panel-handle\"\n >\n <View\n className=\"bg-hairline-strong\"\n style={{ width: 40, height: 4, borderRadius: 2 }}\n accessibilityElementsHidden\n />\n </Pressable>\n\n <ScrollView\n style={{ paddingHorizontal: 16 }}\n contentContainerStyle={{ paddingBottom: 20 }}\n testID=\"body-map-detail-panel-scroll\"\n >\n <View\n className=\"flex-row items-center justify-between\"\n style={{ gap: 8, paddingTop: 4, paddingBottom: 4 }}\n testID=\"body-map-detail-panel-header\"\n >\n <View className=\"flex-row items-center\" style={{ gap: 8, flexShrink: 1 }}>\n <Text\n accessibilityRole=\"header\"\n className=\"text-text-primary\"\n style={{\n fontSize: 16,\n fontFamily: '\"Space Grotesk\", sans-serif',\n fontWeight: '700',\n }}\n testID=\"body-map-detail-panel-title\"\n >\n {displayName}\n </Text>\n <Badge\n variant=\"subtle\"\n color={STATUS_BADGE_COLOR[volumeStatus]}\n size=\"sm\"\n testID=\"body-map-detail-panel-status-badge\"\n >\n {VOLUME_STATUS_LABELS[volumeStatus]}\n </Badge>\n </View>\n <Pressable\n onPress={onClose}\n accessibilityRole=\"button\"\n accessibilityLabel={`Close ${displayName} details`}\n hitSlop={8}\n style={{ padding: 4, margin: -4 }}\n testID=\"body-map-detail-panel-close\"\n >\n <Text className=\"text-text-secondary\" style={{ fontSize: 22, lineHeight: 22 }}>\n {'×'}\n </Text>\n </Pressable>\n </View>\n\n {lastTrained != null && (\n <Text\n className=\"text-text-secondary\"\n style={{ fontSize: 12, fontFamily: 'Inter, sans-serif' }}\n testID=\"body-map-detail-panel-last-trained\"\n >\n {`Last trained ${lastTrained}`}\n </Text>\n )}\n\n <View style={{ marginTop: 16 }} testID=\"body-map-detail-panel-volume\">\n <View\n className=\"flex-row items-center justify-between\"\n style={{ marginBottom: 6 }}\n accessibilityElementsHidden\n >\n <Text\n className=\"text-text-tertiary\"\n style={{ fontSize: 10, fontFamily: 'Inter, sans-serif', fontWeight: '600' }}\n >\n {`MEV ${landmarks.mev}`}\n </Text>\n <Text\n className=\"text-text-tertiary\"\n style={{ fontSize: 10, fontFamily: 'Inter, sans-serif', fontWeight: '600' }}\n >\n {`MRV ${landmarks.mrv}`}\n </Text>\n </View>\n <View\n style={{ height: 14, justifyContent: 'center' }}\n accessibilityRole=\"progressbar\"\n accessibilityValue={{ min: landmarks.mev, max: landmarks.mrv, now: weeklySets }}\n accessibilityLabel={`${weeklySets} weekly sets, between MEV ${landmarks.mev} and MRV ${landmarks.mrv}`}\n aria-valuenow={weeklySets}\n aria-valuemin={landmarks.mev}\n aria-valuemax={landmarks.mrv}\n testID=\"body-map-detail-panel-volume-bar\"\n >\n <View\n style={\n { height: 8, borderRadius: 4, backgroundImage: VOLUME_GRADIENT } as ViewStyle\n }\n accessibilityElementsHidden\n />\n <View\n className=\"border-text-primary bg-surface-elevated\"\n style={{\n position: 'absolute',\n left: `${markerLeft}%`,\n marginLeft: -7,\n width: 14,\n height: 14,\n borderRadius: 7,\n borderWidth: 2,\n // A knob resting on the volume bar: lift, with the ring as its edge.\n ...liftStyle(1, 'dark', { rim: 0 }),\n }}\n accessibilityElementsHidden\n testID=\"body-map-detail-panel-volume-marker\"\n />\n </View>\n </View>\n\n <View className=\"flex-row items-baseline\" style={{ marginTop: 14, gap: 4 }}>\n <Text\n className=\"text-text-primary\"\n style={{\n fontSize: 24,\n fontFamily: '\"Space Grotesk\", sans-serif',\n fontWeight: '700',\n }}\n testID=\"body-map-detail-panel-set-count\"\n >\n {weeklySets}\n </Text>\n <Text\n className=\"text-text-secondary\"\n style={{ fontSize: 12, fontFamily: 'Inter, sans-serif' }}\n testID=\"body-map-detail-panel-mrv-suffix\"\n >\n {`/ ${landmarks.mrv} MRV`}\n </Text>\n </View>\n\n {weeklyHistory != null && weeklyHistory.length > 0 && (\n <View style={{ marginTop: 14 }} testID=\"body-map-detail-panel-sparkline\">\n <Text\n className=\"text-text-tertiary\"\n style={{\n fontSize: 10,\n fontFamily: 'Inter, sans-serif',\n fontWeight: '600',\n marginBottom: 6,\n }}\n accessibilityElementsHidden\n >\n {'VOLUME TREND'}\n </Text>\n <Sparkline data={weeklyHistory} width={80} height={30} highlightLast />\n </View>\n )}\n\n {hasContributing && (\n <View style={{ marginTop: 16 }} testID=\"body-map-detail-panel-contributing\">\n <Text\n className=\"text-text-tertiary\"\n style={{\n fontSize: 10,\n fontFamily: 'Inter, sans-serif',\n fontWeight: '600',\n marginBottom: 8,\n }}\n >\n {'CONTRIBUTING EXERCISES'}\n </Text>\n {contributingExercises!.map((exercise, index) => (\n <View\n key={`${exercise.name}-${index}`}\n className=\"flex-row items-center justify-between bg-surface-raised border-hairline\"\n style={{\n gap: 10,\n paddingVertical: 8,\n paddingHorizontal: 12,\n marginBottom: 6,\n borderRadius: 8,\n borderWidth: 1,\n }}\n testID={`body-map-detail-panel-contributing-${index}`}\n >\n <Text\n className=\"text-text-primary\"\n style={{\n flex: 1,\n fontSize: 13,\n fontFamily: 'Inter, sans-serif',\n fontWeight: '600',\n }}\n testID={`body-map-detail-panel-contributing-${index}-name`}\n >\n {exercise.name}\n </Text>\n <Text\n className=\"text-text-secondary\"\n style={{ fontSize: 12, fontFamily: 'Inter, sans-serif' }}\n testID={`body-map-detail-panel-contributing-${index}-detail`}\n >\n {`${exercise.sets} sets · ${Math.round(exercise.contributionWeight * 100)}%`}\n </Text>\n </View>\n ))}\n </View>\n )}\n\n {hasUpcoming && (\n <View style={{ marginTop: 16 }} testID=\"body-map-detail-panel-upcoming\">\n <Text\n className=\"text-text-tertiary\"\n style={{\n fontSize: 10,\n fontFamily: 'Inter, sans-serif',\n fontWeight: '600',\n marginBottom: 8,\n }}\n >\n {'UPCOMING'}\n </Text>\n {upcomingExercises!.map((exercise, index) => (\n <View\n key={`${exercise.name}-${index}`}\n className=\"flex-row items-center justify-between\"\n style={{ gap: 10, paddingVertical: 6 }}\n testID={`body-map-detail-panel-upcoming-${index}`}\n >\n <Text\n className=\"text-text-primary\"\n style={{\n flex: 1,\n fontSize: 13,\n fontFamily: 'Inter, sans-serif',\n fontWeight: '600',\n }}\n testID={`body-map-detail-panel-upcoming-${index}-name`}\n >\n {exercise.name}\n </Text>\n <Text\n className=\"text-text-tertiary\"\n style={{ fontSize: 12, fontFamily: 'Inter, sans-serif' }}\n testID={`body-map-detail-panel-upcoming-${index}-detail`}\n >\n {`${exercise.workoutName} · ${exercise.sets} sets`}\n </Text>\n </View>\n ))}\n </View>\n )}\n\n {onViewExercises != null && (\n <Pressable\n onPress={onViewExercises}\n accessibilityRole=\"button\"\n accessibilityLabel={`View ${displayName} exercises`}\n style={{\n marginTop: 16,\n paddingVertical: 10,\n borderRadius: 8,\n alignItems: 'center',\n backgroundColor: alpha(BRAND_PRIMARY, 0.12),\n borderWidth: 1,\n borderColor: alpha(BRAND_PRIMARY, 0.3),\n }}\n testID=\"body-map-detail-panel-view-exercises\"\n >\n <Text\n style={{\n fontSize: 13,\n fontFamily: 'Inter, sans-serif',\n fontWeight: '700',\n color: BRAND_PRIMARY,\n }}\n >\n {'View exercises'}\n </Text>\n </Pressable>\n )}\n </ScrollView>\n </Animated.View>\n </View>\n )\n}\n","// On-surface colour context (TD-05.12).\n//\n// A <Surface> owns a background from the surface ramp AND publishes the current\n// theme mode so descendant text/icons resolve their colour from \"what surface am\n// I on\" instead of a `text-*` className. Those classNames silently fail to black\n// when the tree renders as raw RN in the standalone wall SPA (no global.css, no\n// nativewind), which is the bug class this primitive retires.\nimport { createContext, useContext } from 'react'\nimport { getSemanticColors, type ThemeMode } from '../../../theme/tokens/semantic'\nimport type { SurfaceLevel } from '../../../theme/surface-planes'\n\n// The plane vocabulary lives in the theme so `elevation.ts` can resolve levels\n// to planes without importing a component. Re-exported here for callers that\n// reached it through the Surface module.\nexport {\n SURFACE_LEVEL_TOKEN,\n PLANE_ORDER,\n surfaceBackground,\n pressedLevel,\n raisedLevel,\n type SurfaceLevel,\n} from '../../../theme/surface-planes'\n\ntype ColorToken = keyof ReturnType<typeof getSemanticColors>\n\n/** On-surface neutral text roles, resolved for the current surface + theme. */\nexport type OnSurfaceRole = 'primary' | 'secondary' | 'tertiary'\n\nconst ON_SURFACE_TOKEN = {\n primary: 'text-primary',\n secondary: 'text-secondary',\n tertiary: 'text-tertiary',\n} as const satisfies Record<OnSurfaceRole, ColorToken>\n\nexport interface SurfaceContextValue {\n /** Active theme mode. Defaults to dark (the wall). */\n mode: ThemeMode\n /** Plane of the nearest enclosing Surface. */\n level: SurfaceLevel\n}\n\n// Default context: dark 'base' plane, so descendants OUTSIDE any Surface still\n// resolve to real dark colours (never black) on the dark-only wall.\nconst DEFAULT_CONTEXT: SurfaceContextValue = { mode: 'dark', level: 'base' }\n\nexport const SurfaceContext = createContext<SurfaceContextValue>(DEFAULT_CONTEXT)\n\n/** The nearest surface context ({ mode, level }); default dark 'base'. */\nexport function useSurface(): SurfaceContextValue {\n return useContext(SurfaceContext)\n}\n\n/** The active theme mode from the nearest Surface/provider (default dark). */\nexport function useSurfaceMode(): ThemeMode {\n return useContext(SurfaceContext).mode\n}\n\n/**\n * Literal-hex on-surface neutral text colours for a theme mode. Uses\n * `getSemanticColors` (literal hex), never `resolveColor` (which returns `var()`\n * under the RNW vitest alias), so values stay real in tested component code and\n * on raw-RN surfaces alike.\n */\nexport function onSurfaceColors(mode: ThemeMode): Record<OnSurfaceRole, string> {\n const c = getSemanticColors(mode)\n return {\n primary: c[ON_SURFACE_TOKEN.primary],\n secondary: c[ON_SURFACE_TOKEN.secondary],\n tertiary: c[ON_SURFACE_TOKEN.tertiary],\n }\n}\n\n/** Resolve one on-surface text colour for descendants of a Surface. */\nexport function useOnSurfaceColor(role: OnSurfaceRole = 'primary'): string {\n return getSemanticColors(useSurfaceMode())[ON_SURFACE_TOKEN[role]]\n}\n","// How a container decides which plane it sits on and what it wears there.\n//\n// One resolution path shared by <Surface> and <Card>, so the two can never\n// disagree about depth. Everything is RELATIVE to the enclosing Surface unless\n// an absolute `level` names a shell root.\nimport { useMemo } from 'react'\nimport type { ViewStyle } from 'react-native'\nimport {\n FLOATING_ELEVATION_MIN,\n getPressedRecessShadow,\n type ElevationLevel,\n} from '../../../theme/elevation'\nimport { liftStyle, type LiftOptions, type LiftStep } from '../../../theme/lift'\nimport {\n pressedLevel,\n raisedLevel,\n surfaceBackground,\n type SurfaceLevel,\n} from '../../../theme/surface-planes'\nimport type { ThemeMode } from '../../../theme/tokens/semantic'\nimport { useSurface, type SurfaceContextValue } from './SurfaceContext'\n\nexport interface SurfaceDepthProps {\n /** Absolute plane, for shell roots (shell = background, page = base). No lift. */\n level?: SurfaceLevel\n /** Planes to step UP from the enclosing Surface, with the lift treatment. */\n raise?: 1 | 2 | 3\n /**\n * Numeric depth relative to the enclosing Surface: negative recesses, 0 sits\n * flat on the same plane, 1–3 lift, 4–5 float on the overlay plane.\n */\n elevation?: ElevationLevel\n /** One plane DOWN with an inner-shadow recess. */\n pressed?: boolean\n /** Force the lift treatment on or off regardless of the step taken. */\n lift?: boolean\n /** Tune the lift (rim alpha). Specimens and hero surfaces only. */\n liftOptions?: LiftOptions\n /** Override the inherited theme mode. */\n theme?: ThemeMode\n}\n\nexport interface ResolvedSurface {\n mode: ThemeMode\n plane: SurfaceLevel\n backgroundColor: string\n /** Recess or lift, to compose after `backgroundColor`. */\n depthStyle: ViewStyle\n /** Planes stepped up (0 when flat, pressed, or an absolute plane). */\n step: number\n lifted: boolean\n}\n\nfunction recessDepth(inherited: SurfaceContextValue, planesDown: number, mode: ThemeMode) {\n let plane = inherited.level\n for (let i = 0; i < planesDown; i++) plane = pressedLevel(plane)\n const backgroundColor = surfaceBackground(plane, mode)\n return { plane, backgroundColor, depthStyle: getPressedRecessShadow(backgroundColor, mode) }\n}\n\n/** Pure resolution: the plane, its hex, and the treatment. */\nexport function resolveSurfaceDepth(\n inherited: SurfaceContextValue,\n props: SurfaceDepthProps\n): ResolvedSurface {\n const mode = props.theme ?? inherited.mode\n const elevation = props.elevation ?? 0\n if (props.pressed || elevation < 0) {\n const down = props.pressed ? 1 : -elevation\n return { mode, step: 0, lifted: false, ...recessDepth(inherited, down, mode) }\n }\n const step = props.level != null ? 0 : (props.raise ?? elevation)\n const floating = step >= FLOATING_ELEVATION_MIN\n const plane = props.level ?? (floating ? 'overlay' : raisedLevel(inherited.level, step))\n const lifted = props.lift ?? step > 0\n const liftStep = Math.max(1, Math.min(5, step)) as LiftStep\n const depthStyle = lifted ? liftStyle(liftStep, mode, props.liftOptions) : {}\n return { mode, plane, backgroundColor: surfaceBackground(plane, mode), depthStyle, step, lifted }\n}\n\n/** The resolved depth of a container at this point in the tree. */\nexport function useResolvedSurface(props: SurfaceDepthProps): ResolvedSurface {\n const inherited = useSurface()\n const { level, raise, elevation, pressed, lift, liftOptions, theme } = props\n return useMemo(\n () =>\n resolveSurfaceDepth(inherited, {\n level,\n raise,\n elevation,\n pressed,\n lift,\n liftOptions,\n theme,\n }),\n [inherited, level, raise, elevation, pressed, lift, liftOptions, theme]\n )\n}\n","import React, { useMemo, useState } from 'react'\nimport { View, Text, Pressable, type ViewProps, type ViewStyle } from 'react-native'\nimport { cn } from '../../../utils/cn'\nimport { liftStyle, type LiftStep } from '../../../theme/lift'\nimport { Surface } from '../surface/Surface'\nimport { SurfaceContext, type SurfaceContextValue } from '../surface/SurfaceContext'\nimport { useResolvedSurface } from '../surface/resolveSurface'\n\nexport type CardVariant = 'elevated' | 'outline' | 'filled' | 'accent' | 'subtle'\n/** Planes to lift above the enclosing Surface. */\nexport type CardElevation = 1 | 2 | 3\n\nexport interface CardProps extends ViewProps {\n /**\n * How the card separates from its host:\n * - `elevated` (default): lifts `elevation` planes and wears the lift (rim + shadow).\n * - `accent`: as `elevated`, plus a left stripe.\n * - `filled`: lifts `elevation` planes, tone only — for tiles nested in a lifted card.\n * - `outline`: stays on the host plane with a hairline-strong edge — status borders.\n * - `subtle`: stays on the host plane with a hairline-subtle edge.\n */\n variant?: CardVariant\n /** Planes to lift above the enclosing Surface (default 2: page → the card plane). */\n elevation?: CardElevation\n /** Whether the card is interactive (hoverable/pressable) */\n isInteractive?: boolean\n /** Whether the card is in a loading state (renders skeleton) */\n isLoading?: boolean\n /** Callback when card is pressed (makes card interactive) */\n onPress?: () => void\n /** Custom border color (hex, rgb, or CSS color). Useful for status cards. */\n borderColor?: string\n /**\n * Custom background color. The one way to override the plane: a `bg-*`\n * className is discarded because the plane is written into `style`.\n */\n bgColor?: string\n /** Accent stripe color for accent variant (CSS color or hex) */\n accentColor?: string\n /** Accent stripe width for accent variant in pixels (default: 3) */\n accentWidth?: number\n /** Additional className */\n className?: string\n children?: React.ReactNode\n /** Show header skeleton when loading (default: true) */\n skeletonHasHeader?: boolean\n /** Show footer skeleton when loading (default: false) */\n skeletonHasFooter?: boolean\n /** Number of content lines in skeleton when loading (default: 3) */\n skeletonContentLines?: number\n}\n\nconst EDGE_CLASS: Record<CardVariant, string> = {\n elevated: '',\n accent: '',\n filled: '',\n outline: 'border border-hairline-strong',\n subtle: 'border border-hairline-subtle',\n}\n\nconst LIFTED: Record<CardVariant, boolean> = {\n elevated: true,\n accent: true,\n filled: false,\n outline: false,\n subtle: false,\n}\n\nconst STAYS_ON_HOST: Record<CardVariant, boolean> = {\n elevated: false,\n accent: false,\n filled: false,\n outline: true,\n subtle: true,\n}\n\n/** The card's plane and treatment, hover lifting one more plane when clickable. */\nfunction useCardDepth(variant: CardVariant, elevation: CardElevation, hovered: boolean) {\n const raise = STAYS_ON_HOST[variant] ? undefined : elevation\n const resolved = useResolvedSurface({ raise, lift: LIFTED[variant] })\n const depthStyle = useMemo(() => {\n if (!hovered || !LIFTED[variant]) return resolved.depthStyle\n const hoverStep = Math.min(3, resolved.step + 1) as LiftStep\n return liftStyle(hoverStep, resolved.mode)\n }, [hovered, variant, resolved])\n return { ...resolved, depthStyle }\n}\n\n/**\n * Card component for containing related content. Sits `elevation` planes above\n * the enclosing Surface and publishes its own plane, so a card nested in a card\n * steps up again (and clamps at the top of the ramp).\n *\n * Lift sparingly: a card lifts off the page, but a small card lifted off a\n * small card reads as clutter. Inside a card, organise with `CardInset`, a\n * `filled` tile, or a divider, and keep a second lift for something that\n * genuinely floats over the first.\n *\n * @example\n * <Card>\n * <CardHeader>\n * <CardTitle>Card Title</CardTitle>\n * <CardDescription>Card description</CardDescription>\n * </CardHeader>\n * <CardContent>\n * <Text>Card content goes here</Text>\n * </CardContent>\n * </Card>\n */\nexport function Card({\n variant = 'elevated',\n elevation = 2,\n isInteractive = false,\n isLoading = false,\n onPress,\n borderColor,\n bgColor,\n accentColor,\n accentWidth,\n className,\n children,\n style,\n skeletonHasHeader = true,\n skeletonHasFooter = false,\n skeletonContentLines = 3,\n ...props\n}: CardProps) {\n const isClickable = isInteractive || !!onPress\n const [isHovered, setIsHovered] = useState(false)\n const depth = useCardDepth(variant, elevation, isHovered && isClickable)\n\n const baseClassName = cn(\n 'rounded-lg overflow-hidden relative',\n borderColor ? 'border' : EDGE_CLASS[variant],\n isClickable && 'web:cursor-pointer web:transition-all web:duration-150',\n isClickable && 'web:hover:-translate-y-0.5 active:scale-[0.99]',\n isLoading && 'pointer-events-none animate-pulse',\n className\n )\n\n const mergedStyle = useMemo(() => {\n const own: ViewStyle & Record<string, unknown> = {\n backgroundColor: bgColor || depth.backgroundColor,\n borderRadius: 8,\n overflow: 'hidden',\n ...depth.depthStyle,\n }\n if (variant === 'accent') {\n own.borderLeftWidth = accentWidth ?? 3\n own.borderLeftColor = accentColor ?? 'var(--color-brand-primary)'\n }\n if (borderColor) own.borderColor = borderColor\n return style ? [own, style] : own\n }, [style, depth, bgColor, borderColor, variant, accentWidth, accentColor])\n\n const context = useMemo<SurfaceContextValue>(\n () => ({ mode: depth.mode, level: depth.plane }),\n [depth.mode, depth.plane]\n )\n\n const content = isLoading ? (\n <SkeletonBody\n hasHeader={skeletonHasHeader}\n hasFooter={skeletonHasFooter}\n contentLines={skeletonContentLines}\n />\n ) : (\n children\n )\n\n return (\n <SurfaceContext.Provider value={context}>\n {isClickable ? (\n <Pressable\n onPress={onPress}\n onHoverIn={() => setIsHovered(true)}\n onHoverOut={() => setIsHovered(false)}\n accessibilityRole=\"button\"\n className={baseClassName}\n style={mergedStyle}\n {...props}\n >\n {content}\n </Pressable>\n ) : (\n <View className={baseClassName} style={mergedStyle} {...props}>\n {content}\n </View>\n )}\n </SurfaceContext.Provider>\n )\n}\n\nexport interface CardHeaderProps {\n children?: React.ReactNode\n className?: string\n}\n\n/**\n * Header section of a Card.\n */\nexport function CardHeader({ children, className }: CardHeaderProps) {\n return <View className={cn('px-6 py-6', className)}>{children}</View>\n}\n\nexport interface CardTitleProps {\n children?: React.ReactNode\n className?: string\n}\n\n/**\n * Title for CardHeader.\n */\nexport function CardTitle({ children, className }: CardTitleProps) {\n return (\n <Text\n accessibilityRole=\"header\"\n className={cn('text-lg font-semibold text-text-primary font-heading', className)}\n >\n {children}\n </Text>\n )\n}\n\nexport interface CardDescriptionProps {\n children?: React.ReactNode\n className?: string\n}\n\n/**\n * Description for CardHeader.\n */\nexport function CardDescription({ children, className }: CardDescriptionProps) {\n return <Text className={cn('mt-1.5 text-sm text-text-secondary', className)}>{children}</Text>\n}\n\nexport interface CardContentProps {\n children?: React.ReactNode\n className?: string\n}\n\n/**\n * Content section of a Card.\n */\nexport function CardContent({ children, className }: CardContentProps) {\n return <View className={cn('px-6 py-4', className)}>{children}</View>\n}\n\nexport interface CardFooterProps {\n children?: React.ReactNode\n className?: string\n}\n\n/**\n * Footer section of a Card.\n */\nexport function CardFooter({ children, className }: CardFooterProps) {\n return <View className={cn('px-6 py-4 flex-row items-center gap-2', className)}>{children}</View>\n}\n\ninterface SkeletonBodyProps {\n hasHeader: boolean\n hasFooter: boolean\n contentLines: number\n}\n\nfunction SkeletonBody({ hasHeader, hasFooter, contentLines }: SkeletonBodyProps) {\n return (\n <>\n {hasHeader && (\n <CardHeader>\n <View className=\"h-5 w-1/3 bg-interactive-disabled rounded\" />\n <View className=\"mt-2 h-4 w-2/3 bg-interactive-disabled rounded\" />\n </CardHeader>\n )}\n <CardContent>\n {Array.from({ length: contentLines }).map((_, i) => (\n <View\n key={i}\n className={cn(\n 'h-4 bg-interactive-disabled rounded',\n i < contentLines - 1 ? 'mb-2 w-full' : 'w-4/5'\n )}\n />\n ))}\n </CardContent>\n {hasFooter && (\n <CardFooter>\n <View className=\"h-9 w-24 bg-interactive-disabled rounded\" />\n </CardFooter>\n )}\n </>\n )\n}\n\nexport interface CardSkeletonProps {\n /** Whether to show header skeleton */\n hasHeader?: boolean\n /** Whether to show footer skeleton */\n hasFooter?: boolean\n /** Number of content lines */\n contentLines?: number\n /** Additional className */\n className?: string\n}\n\n/**\n * Skeleton placeholder for Card loading state.\n */\nexport function CardSkeleton({\n hasHeader = true,\n hasFooter = false,\n contentLines = 3,\n className,\n}: CardSkeletonProps) {\n return (\n <Card variant=\"elevated\" className={cn('animate-pulse', className)}>\n <SkeletonBody hasHeader={hasHeader} hasFooter={hasFooter} contentLines={contentLines} />\n </Card>\n )\n}\n\nexport interface CardInsetProps extends ViewProps {\n /** Additional className */\n className?: string\n children?: React.ReactNode\n}\n\n/**\n * A sunken well inside a Card: one plane down from the card with the inset\n * recess. Nest one inside another to step down again (clamps at the frame).\n *\n * @example\n * <Card>\n * <CardContent>\n * <CardInset className=\"p-4\">\n * <Text>This content appears inset/sunken</Text>\n * </CardInset>\n * </CardContent>\n * </Card>\n */\nexport function CardInset({ className, children, ...props }: CardInsetProps) {\n return (\n <Surface pressed className={cn('rounded', className)} rounded={false} {...props}>\n {children}\n </Surface>\n )\n}\n","// Font mapping: font-heading=Space Grotesk, font-body=Nunito Sans (UI), font-sans=Inter (body)\nimport { View, type ViewProps, type ViewStyle } from 'react-native'\nimport { Typography } from '../Typography'\nimport { resolveColor } from '../../../theme/resolve-color'\nimport { semanticColorsDark } from '../../../theme/tokens/semantic'\nimport { greyRamp } from '../../../theme/tokens/primitives'\nimport { alpha } from '../../../utils/colors'\nimport { getGlowShadow } from '../../../theme/elevation'\n\nexport type StatusDotVariant =\n | 'success'\n | 'warning'\n | 'error'\n | 'neutral'\n | 'on-track'\n | 'deviation'\n | 'future'\n\nexport interface StatusDotProps extends ViewProps {\n variant: StatusDotVariant\n /** Center glyph. Only rendered at size=\"md\"; the 8px \"sm\" dot is too small to fit one. */\n icon?: 'check' | 'exclamation' | 'dash'\n size?: 'sm' | 'md'\n /** Adds a subtle glow effect in the variant color */\n glow?: boolean\n label?: string\n className?: string\n}\n\ntype SolidVariant = 'success' | 'warning' | 'error' | 'neutral'\n\n/** Solid variants: a filled dot. `neutral` takes `text-tertiary`, as Indicator's `default` does. */\nconst solidFillToken = {\n success: 'status-success',\n warning: 'status-warning',\n error: 'status-error',\n neutral: 'text-tertiary',\n} as const\n\n/** Ring variants: a `-subtle` wash inside a `-muted` rim, both off the same role. */\nconst ringWashToken = {\n 'on-track': { fill: 'status-success-subtle', border: 'status-success-muted' },\n deviation: { fill: 'status-warning-subtle', border: 'status-warning-muted' },\n} as const\n\n// The neutral ring has no wash rungs: `-subtle`/`-muted`/`-strong` were published for\n// the seven status and brand roles, and `text-tertiary` is not one of them. Derived\n// from the same ramp step the token resolves to, at the frozen alphas, rather than\n// mixed independently. FINDING for E3: the neutral role needs the wash ladder too.\nconst FUTURE_FILL = alpha(greyRamp[500], 0.1)\nconst FUTURE_BORDER = alpha(greyRamp[500], 0.2)\n\n/** Glyph colour: dark on a solid fill, the role's own colour inside a ring. */\nconst glyphToken = {\n success: 'text-inverse',\n warning: 'text-inverse',\n error: 'text-inverse',\n neutral: 'text-inverse',\n 'on-track': 'status-success',\n deviation: 'status-warning',\n future: 'text-tertiary',\n} as const\n\n// Glow is EMPHASIS, not depth: one shared builder, one token colour per variant.\n// Literal hex (not `resolveColor`) because getGlowShadow does colour maths on it —\n// the same exception Indicator documents.\nconst glowColors: Record<StatusDotVariant, string> = {\n success: semanticColorsDark['status-success'],\n warning: semanticColorsDark['status-warning'],\n error: semanticColorsDark['status-error'],\n neutral: greyRamp[500],\n 'on-track': semanticColorsDark['status-success'],\n deviation: semanticColorsDark['status-warning'],\n future: greyRamp[500],\n}\n\nconst glowStyles: Record<StatusDotVariant, ViewStyle> = Object.fromEntries(\n Object.entries(glowColors).map(([variant, color]) => [variant, getGlowShadow(color, 'subtle')])\n) as Record<StatusDotVariant, ViewStyle>\n\nconst iconChars: Record<string, string> = {\n check: '\\u2713',\n exclamation: '!',\n dash: '\\u2014',\n}\n\nconst sizeDimensions = {\n sm: { size: 8, showIcon: false },\n md: { size: 18, showIcon: true },\n}\n\nfunction isSolidVariant(variant: StatusDotVariant): variant is SolidVariant {\n return variant in solidFillToken\n}\n\n/** The ring variants' wash + rim, resolved per theme. `future` adds the dashed rim. */\nfunction ringStyle(variant: StatusDotVariant): ViewStyle | undefined {\n if (variant === 'future') {\n return {\n backgroundColor: FUTURE_FILL,\n borderWidth: 1,\n borderStyle: 'dashed',\n borderColor: FUTURE_BORDER,\n }\n }\n if (variant === 'on-track' || variant === 'deviation') {\n const tokens = ringWashToken[variant]\n return {\n backgroundColor: resolveColor(tokens.fill),\n borderWidth: 1,\n borderColor: resolveColor(tokens.border),\n }\n }\n return undefined\n}\n\nexport function StatusDot({\n variant,\n icon,\n size = 'sm',\n glow,\n label,\n className,\n ...props\n}: StatusDotProps) {\n const config = sizeDimensions[size]\n const solid = isSolidVariant(variant)\n const ring = ringStyle(variant)\n\n const glowStyle = glow ? glowStyles[variant] : null\n\n const dot = (\n <View\n style={[\n {\n width: config.size,\n height: config.size,\n borderRadius: 9999,\n alignItems: 'center',\n justifyContent: 'center',\n flexShrink: 0,\n },\n solid ? { backgroundColor: resolveColor(solidFillToken[variant]) } : undefined,\n ring,\n glowStyle ? (glowStyle as Record<string, unknown>) : undefined,\n ]}\n accessibilityRole=\"image\"\n accessibilityLabel={`${variant} status`}\n testID=\"status-dot\"\n >\n {config.showIcon && icon && (\n // The glyph was 11px/900, off the type scale (TOKENS.md §4); `boldLabel` is\n // the 12px sans label step and `font-black` keeps the original weight.\n <Typography\n variant=\"boldLabel\"\n color=\"inherit\"\n className=\"font-black leading-none\"\n style={{ color: resolveColor(glyphToken[variant]) }}\n accessibilityElementsHidden\n >\n {iconChars[icon]}\n </Typography>\n )}\n </View>\n )\n\n if (label) {\n return (\n <View\n className={className}\n style={{ flexDirection: 'row', alignItems: 'center', gap: 6 }}\n accessibilityLabel={`${variant} status: ${label}`}\n {...props}\n >\n <View accessibilityElementsHidden>{dot}</View>\n {/* 12px/16 is `caption` at the 4-unit leading step; its colour is `text-secondary`. */}\n <Typography\n variant=\"caption\"\n color=\"secondary\"\n className=\"leading-4\"\n accessibilityElementsHidden\n >\n {label}\n </Typography>\n </View>\n )\n }\n\n return (\n <View className={className} {...props}>\n {dot}\n </View>\n )\n}\n","/**\n * Data-viz / status / brand fills, sourced from the color foundations.\n */\n\nimport { categoricalPalette, primitiveRamps as ramp } from './tokens/primitives'\n\n/**\n * Titan categorical fallback palette shared by Treemap and Scatter — the\n * canonical {@link categoricalPalette} (ordered, nested-stable, CVD-safe).\n * Components index into it modulo length, so the 7-color series is sufficient.\n */\nexport const DATAVIZ_CATEGORICAL_PALETTE = categoricalPalette.default\n\n/**\n * MesoCard / MesoStatusCard 3px top-accent gradient stops (dark → primary →\n * light), on the orange ramp that brand-primary (orange-400) lives in.\n */\nexport const MESO_ACCENT_GRADIENT_DARK = ramp.orange[500]\nexport const MESO_ACCENT_GRADIENT_LIGHT = ramp.orange[300]\n\nexport const WORKOUT_PILL_DELOAD = ramp.magenta[600]\n","// Font mapping: font-heading=Space Grotesk, font-body=Nunito Sans (UI), font-sans=Inter (body)\nimport { Fragment, type ReactNode } from 'react'\nimport { View, Text, type ViewProps, type ViewStyle } from 'react-native'\nimport { Card } from '../../ui/card'\nimport { StatusDot } from './StatusDot'\nimport { resolveColor } from '../../../theme/resolve-color'\nimport { getSemanticColors } from '../../../theme/tokens/semantic'\nimport { primitiveColors } from '../../../theme/tokens/primitives'\nimport {\n MESO_ACCENT_GRADIENT_DARK,\n MESO_ACCENT_GRADIENT_LIGHT,\n} from '../../../theme/extracted-colors-dataviz'\nimport { liftStyle } from '../../../theme/lift'\nimport { alpha } from '../../../utils/colors'\n\nconst t = getSemanticColors('dark')\n\nconst BRAND_PRIMARY = t['brand-primary']\nconst BRAND_PRIMARY_DARK = MESO_ACCENT_GRADIENT_DARK\nconst BRAND_PRIMARY_LIGHT = MESO_ACCENT_GRADIENT_LIGHT\n\nconst SUCCESS = t['status-success']\nconst WARNING = t['status-warning']\nconst ERROR = t['status-error']\n\n/** Gradient stops for the 3px top accent: dark -> primary -> light (matches MesoCard). */\nconst ACCENT_STOPS = [BRAND_PRIMARY_DARK, BRAND_PRIMARY, BRAND_PRIMARY_LIGHT]\n\n/**\n * Card surface gradient: elevated -> raised at 135deg. Uses resolved dark-theme\n * hexes (a gradient string can't carry a className token, and var() renders\n * black on native).\n */\nconst CARD_GRADIENT = `linear-gradient(135deg, ${resolveColor('surface-elevated')} 0%, ${resolveColor('surface-raised')} 100%)`\n\n/** Gauge track gradient (teal -> amber -> red) at 0.25 alpha. */\nconst GAUGE_GRADIENT = `linear-gradient(90deg, ${alpha(SUCCESS, 0.25)} 0%, ${alpha(WARNING, 0.25)} 50%, ${alpha(ERROR, 0.25)} 100%)`\n\nexport type MesoStatusBadgeVariant = 'success' | 'warning' | 'error'\n\nconst STATUS_VARIANTS: Record<\n MesoStatusBadgeVariant,\n { bg: string; border: string; text: string }\n> = {\n success: { bg: alpha(SUCCESS, 0.15), border: alpha(SUCCESS, 0.3), text: SUCCESS },\n warning: { bg: alpha(WARNING, 0.15), border: alpha(WARNING, 0.3), text: WARNING },\n error: { bg: alpha(ERROR, 0.15), border: alpha(ERROR, 0.25), text: ERROR },\n}\n\nexport interface MesoStatusBadge {\n /** Short status label, e.g. \"On Track\". */\n label: string\n /** Color treatment for the badge. */\n variant: MesoStatusBadgeVariant\n}\n\nexport interface MesoStatusMetric {\n /** Cell label, e.g. \"Prescribed\". */\n label: string\n /** Cell value, e.g. \"3×8 @ RPE 8\". */\n value: string\n}\n\nexport interface MesoStatusGauge {\n /** Gauge label, e.g. \"Intensity\". */\n label: string\n /** Fill position 0-1; the 14px marker sits at this level. */\n level: number\n /** Optional right-aligned sublabel, e.g. \"Prescribed\". */\n sublabel?: string\n}\n\nexport interface MesoStatusCoaching {\n /** Coaching recommendation copy. */\n text: string\n /** Substrings within `text` to render in bold. */\n highlights?: string[]\n}\n\nexport interface MesoStatusNextTarget {\n /** Leading glyph/emoji, e.g. \"→\" or \"🎯\". */\n icon: string\n /** Next-session target copy. */\n text: string\n}\n\nexport interface MesoStatusCardProps extends ViewProps {\n /** Mesocycle name, e.g. \"Hypertrophy Block\". */\n mesoName: string\n /** Context line, e.g. \"Week 6 of 8 · Upper/Lower\". */\n mesoSubtitle: string\n /** Status pill in the header. */\n statusBadge: MesoStatusBadge\n /** Prescription-vs-actual metrics rendered as a 2x2 grid. */\n metrics: MesoStatusMetric[]\n /** Intensity / volume gauges stacked vertically. */\n gauges: MesoStatusGauge[]\n /** Optional coaching recommendation box. */\n coaching?: MesoStatusCoaching\n /** Optional next-session target box. */\n nextTarget?: MesoStatusNextTarget\n className?: string\n}\n\nfunction clamp01(value: number): number {\n if (!Number.isFinite(value)) return 0\n if (value < 0) return 0\n if (value > 1) return 1\n return value\n}\n\n/** Marker fill color by gauge zone: teal 0-0.4, amber 0.4-0.7, red 0.7-1.0. */\nfunction getGaugeZoneColor(level: number): string {\n if (level >= 0.7) return ERROR\n if (level >= 0.4) return WARNING\n return SUCCESS\n}\n\n/** Splits `text` into nodes, bolding any segment that exactly matches a highlight. */\nfunction renderCoachingText(text: string, highlights?: string[]): ReactNode {\n if (!highlights || highlights.length === 0) return text\n const escaped = highlights.filter(Boolean).map((h) => h.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'))\n if (escaped.length === 0) return text\n const regex = new RegExp(`(${escaped.join('|')})`, 'g')\n return text.split(regex).map((part, index) =>\n highlights.includes(part) ? (\n <Text key={`${part}-${index}`} className=\"text-text-primary\" style={{ fontWeight: '700' }}>\n {part}\n </Text>\n ) : (\n <Fragment key={`t-${index}`}>{part}</Fragment>\n )\n )\n}\n\nfunction StatusPill({ badge }: { badge: MesoStatusBadge }) {\n const colors = STATUS_VARIANTS[badge.variant]\n return (\n <View\n className=\"flex-row items-center\"\n style={{\n gap: 5,\n paddingVertical: 3,\n paddingHorizontal: 8,\n borderRadius: 4,\n borderWidth: 1,\n backgroundColor: colors.bg,\n borderColor: colors.border,\n }}\n testID=\"meso-status-card-badge\"\n >\n <View accessibilityElementsHidden>\n <StatusDot variant={badge.variant} size=\"sm\" />\n </View>\n <Text\n style={{\n fontSize: 10,\n fontFamily: 'Inter, sans-serif',\n fontWeight: '700',\n letterSpacing: 0.3,\n color: colors.text,\n }}\n >\n {badge.label}\n </Text>\n </View>\n )\n}\n\nfunction MetricCell({ metric }: { metric: MesoStatusMetric }) {\n return (\n <View style={{ width: '48%' }} testID=\"meso-status-card-metric\">\n <Text\n className=\"text-text-tertiary\"\n style={{\n fontSize: 10,\n fontFamily: 'Inter, sans-serif',\n fontWeight: '600',\n letterSpacing: 0.5,\n textTransform: 'uppercase',\n }}\n >\n {metric.label}\n </Text>\n <Text\n className=\"text-text-primary\"\n style={{\n marginTop: 2,\n fontSize: 13,\n fontFamily: 'Inter, sans-serif',\n fontWeight: '600',\n }}\n >\n {metric.value}\n </Text>\n </View>\n )\n}\n\nfunction Gauge({ gauge }: { gauge: MesoStatusGauge }) {\n const level = clamp01(gauge.level)\n const percentage = Math.round(level * 100)\n const markerColor = getGaugeZoneColor(level)\n return (\n <View\n style={{ gap: 6 }}\n accessibilityRole=\"progressbar\"\n accessibilityValue={{ min: 0, max: 100, now: percentage }}\n accessibilityLabel={`${gauge.label}: ${percentage}%`}\n aria-valuenow={percentage}\n aria-valuemin={0}\n aria-valuemax={100}\n testID=\"meso-status-card-gauge\"\n >\n <View className=\"flex-row items-center justify-between\" accessibilityElementsHidden>\n <Text\n className=\"text-text-secondary\"\n style={{\n fontSize: 10,\n fontFamily: 'Inter, sans-serif',\n fontWeight: '500',\n letterSpacing: 0.5,\n textTransform: 'uppercase',\n }}\n >\n {gauge.label}\n </Text>\n {gauge.sublabel != null && (\n <Text\n className=\"text-text-tertiary\"\n style={{\n fontSize: 10,\n fontFamily: 'Inter, sans-serif',\n fontWeight: '500',\n }}\n >\n {gauge.sublabel}\n </Text>\n )}\n </View>\n\n <View\n style={\n {\n height: 8,\n borderRadius: 4,\n position: 'relative',\n backgroundImage: GAUGE_GRADIENT,\n } as ViewStyle\n }\n accessibilityElementsHidden\n >\n <View\n style={{\n position: 'absolute',\n left: '50%',\n top: 0,\n bottom: 0,\n width: 1,\n marginLeft: -0.5,\n backgroundColor: alpha(primitiveColors.white, 0.3),\n }}\n testID=\"meso-status-card-gauge-center\"\n />\n <View\n className=\"border-text-primary\"\n style={{\n position: 'absolute',\n left: `${percentage}%`,\n top: -3,\n marginLeft: -7,\n width: 14,\n height: 14,\n borderRadius: 9999,\n borderWidth: 2,\n backgroundColor: markerColor,\n // A knob resting on the gauge: lift, with the ring as its edge.\n ...liftStyle(1, 'dark', { rim: 0 }),\n }}\n testID=\"meso-status-card-gauge-marker\"\n />\n </View>\n </View>\n )\n}\n\n/**\n * Mesocycle context card for a specific exercise: prescription vs actual\n * metrics, intensity/volume gauges, and coaching guidance. Composes the titan\n * `Card` plus the Workout `StatusDot`, and renders the §25 gauge (8px track,\n * 50% center line, 14px marker) inline since that visual differs from the\n * IntensityBar/DeviationBar primitives.\n *\n * @example\n * <MesoStatusCard\n * mesoName=\"Hypertrophy Block\"\n * mesoSubtitle=\"Week 6 of 8 · Upper/Lower\"\n * statusBadge={{ label: 'On Track', variant: 'success' }}\n * metrics={[\n * { label: 'Prescribed', value: '3×8 @ RPE 8' },\n * { label: 'Actual', value: '3×8 @ 185 lbs' },\n * ]}\n * gauges={[{ label: 'Intensity', level: 0.7, sublabel: 'Actual' }]}\n * coaching={{ text: 'Add load next session.', highlights: ['Add load'] }}\n * nextTarget={{ icon: '→', text: '190 lbs × 8' }}\n * />\n */\nexport function MesoStatusCard({\n mesoName,\n mesoSubtitle,\n statusBadge,\n metrics,\n gauges,\n coaching,\n nextTarget,\n className,\n ...props\n}: MesoStatusCardProps) {\n return (\n <Card\n variant=\"outline\"\n elevation={1}\n borderColor={BRAND_PRIMARY_DARK}\n className={className}\n style={\n {\n borderColor: BRAND_PRIMARY_DARK,\n borderWidth: 1,\n backgroundImage: CARD_GRADIENT,\n } as ViewStyle\n }\n role=\"article\"\n aria-label={`Mesocycle status for ${mesoName}`}\n testID=\"meso-status-card\"\n {...props}\n >\n <View\n className=\"flex-row\"\n style={{ position: 'absolute', top: 0, left: 0, right: 0, height: 3, zIndex: 1 }}\n accessibilityElementsHidden\n testID=\"meso-status-card-accent\"\n >\n {ACCENT_STOPS.map((color) => (\n <View key={color} style={{ flex: 1, backgroundColor: color }} />\n ))}\n </View>\n\n <View style={{ padding: 14, gap: 14 }} testID=\"meso-status-card-body\">\n <View testID=\"meso-status-card-header\">\n <View className=\"flex-row items-center justify-between\" style={{ gap: 8 }}>\n <Text\n className=\"text-text-primary\"\n style={{\n flexShrink: 1,\n fontSize: 15,\n fontFamily: '\"Space Grotesk\", sans-serif',\n fontWeight: '700',\n }}\n testID=\"meso-status-card-name\"\n >\n {mesoName}\n </Text>\n <StatusPill badge={statusBadge} />\n </View>\n <Text\n className=\"text-text-secondary\"\n style={{\n marginTop: 4,\n fontSize: 12,\n fontFamily: 'Inter, sans-serif',\n }}\n testID=\"meso-status-card-subtitle\"\n >\n {mesoSubtitle}\n </Text>\n </View>\n\n {metrics.length > 0 && (\n <View className=\"flex-row flex-wrap\" style={{ gap: 8 }} testID=\"meso-status-card-metrics\">\n {metrics.map((metric, index) => (\n <MetricCell key={`${metric.label}-${index}`} metric={metric} />\n ))}\n </View>\n )}\n\n {gauges.length > 0 && (\n <View style={{ gap: 12 }} testID=\"meso-status-card-gauges\">\n {gauges.map((gauge, index) => (\n <Gauge key={`${gauge.label}-${index}`} gauge={gauge} />\n ))}\n </View>\n )}\n\n {coaching != null && (\n <View\n style={{\n backgroundColor: alpha(WARNING, 0.06),\n borderWidth: 1,\n borderColor: alpha(WARNING, 0.15),\n borderRadius: 8,\n paddingVertical: 10,\n paddingHorizontal: 12,\n }}\n testID=\"meso-status-card-coaching\"\n >\n <Text\n className=\"text-text-secondary\"\n style={{\n fontSize: 12,\n lineHeight: 17,\n fontFamily: 'Inter, sans-serif',\n }}\n >\n {renderCoachingText(coaching.text, coaching.highlights)}\n </Text>\n </View>\n )}\n\n {nextTarget != null && (\n <View\n className=\"flex-row items-center\"\n style={{\n gap: 8,\n backgroundColor: alpha(SUCCESS, 0.06),\n borderWidth: 1,\n borderColor: alpha(SUCCESS, 0.2),\n borderRadius: 8,\n paddingVertical: 10,\n paddingHorizontal: 12,\n }}\n testID=\"meso-status-card-next-target\"\n >\n <Text style={{ fontSize: 14, color: SUCCESS }} accessibilityElementsHidden>\n {nextTarget.icon}\n </Text>\n <Text\n style={{\n flexShrink: 1,\n fontSize: 12,\n fontFamily: 'Inter, sans-serif',\n fontWeight: '600',\n color: SUCCESS,\n }}\n >\n {nextTarget.text}\n </Text>\n </View>\n )}\n </View>\n </Card>\n )\n}\n","// Font mapping: font-heading=Space Grotesk, font-body=Nunito Sans (UI), font-sans=Inter (body)\nimport { useMemo, useState } from 'react'\nimport { View, Text, type ViewProps } from 'react-native'\nimport { BodyMap, type BodyMapData } from './BodyMap'\nimport {\n BodyMapDetailPanel,\n type ContributingExercise,\n type UpcomingExercise,\n} from './BodyMapDetailPanel'\nimport { MesoStatusCard, type MesoStatusCardProps } from './MesoStatusCard'\nimport {\n MuscleGroup,\n VOLUME_STATUS_LABELS,\n getHeatmapColor,\n type VolumeLandmarks,\n type VolumeStatus,\n} from './muscleTaxonomy'\n\n/** Volume statuses in display order for the legend and summary cards. */\nconst STATUS_ORDER: VolumeStatus[] = ['under', 'maintenance', 'productive', 'over']\n\n/** One muscle's full volume picture — feeds the body maps and the detail panel. */\nexport interface TrainingStatusMuscle {\n /** Detailed muscle group (drives the SVG heatmap + panel identity). */\n muscleGroup: MuscleGroup\n /** Human-readable name for the legend, summary, and panel title. */\n displayName: string\n /** Which body-map view the muscle belongs to. */\n side: 'front' | 'back'\n /** Heatmap intensity 0-1. */\n intensity: number\n /** Weekly-volume status relative to the landmarks. */\n volumeStatus: VolumeStatus\n /** Weekly effective sets logged. */\n weeklySets: number\n /** Volume landmarks (weekly working sets). */\n landmarks: VolumeLandmarks\n /** Last trained label, e.g. \"2 days ago\". */\n lastTrained?: string\n /** Weekly volume history for the panel sparkline. */\n weeklyHistory?: number[]\n /** Exercises contributing to this muscle's volume. */\n contributingExercises?: ContributingExercise[]\n /** Upcoming exercises targeting this muscle. */\n upcomingExercises?: UpcomingExercise[]\n}\n\n/** Derived, page-level roll-up of the tracked muscles. */\nexport interface TrainingStatusSummary {\n /** Total weekly effective sets across all tracked muscles. */\n totalWeeklySets: number\n /** Number of muscles being tracked. */\n trackedMuscles: number\n /** Count of muscles per volume status. */\n statusCounts: Record<VolumeStatus, number>\n}\n\nexport interface TrainingStatusPageProps extends ViewProps {\n /** Page heading. */\n title?: string\n /** Mesocycle context banner shown at the top. */\n meso: MesoStatusCardProps\n /** Muscles tracked this week. */\n muscles: TrainingStatusMuscle[]\n className?: string\n}\n\n/** Roll up per-muscle rows into the page summary (pure, testable). */\nexport function deriveTrainingSummary(muscles: TrainingStatusMuscle[]): TrainingStatusSummary {\n const statusCounts: Record<VolumeStatus, number> = {\n under: 0,\n maintenance: 0,\n productive: 0,\n over: 0,\n }\n let totalWeeklySets = 0\n for (const muscle of muscles) {\n totalWeeklySets += muscle.weeklySets\n statusCounts[muscle.volumeStatus] += 1\n }\n return { totalWeeklySets, trackedMuscles: muscles.length, statusCounts }\n}\n\n/** Project the muscle rows for one side into `BodyMap` heatmap data. */\nexport function toBodyMapData(\n muscles: TrainingStatusMuscle[],\n side: 'front' | 'back'\n): BodyMapData[] {\n return muscles\n .filter((muscle) => muscle.side === side)\n .map(({ muscleGroup, intensity, volumeStatus, weeklySets }) => ({\n muscleGroup,\n intensity,\n volumeStatus,\n weeklySets,\n }))\n}\n\nconst SUMMARY_CARDS: Array<{\n key: keyof TrainingStatusSummary['statusCounts'] | 'total'\n label: string\n}> = [\n { key: 'total', label: 'Weekly Sets' },\n { key: 'productive', label: 'Productive' },\n { key: 'under', label: 'Under' },\n { key: 'over', label: 'Over' },\n]\n\nfunction SummaryCards({ summary }: { summary: TrainingStatusSummary }) {\n return (\n <View className=\"flex-row flex-wrap\" style={{ gap: 8 }} testID=\"training-status-page-summary\">\n {SUMMARY_CARDS.map(({ key, label }) => {\n const value = key === 'total' ? summary.totalWeeklySets : summary.statusCounts[key]\n return (\n <View\n key={key}\n className=\"bg-surface-elevated border-hairline\"\n style={{\n flexGrow: 1,\n flexBasis: '46%',\n padding: 12,\n borderRadius: 10,\n borderWidth: 1,\n }}\n testID={`training-status-page-summary-${key}`}\n >\n <Text\n className=\"text-text-primary\"\n style={{\n fontSize: 22,\n fontFamily: '\"Space Grotesk\", sans-serif',\n fontWeight: '700',\n }}\n >\n {value}\n </Text>\n <Text\n className=\"text-text-tertiary\"\n style={{\n marginTop: 2,\n fontSize: 11,\n fontFamily: 'Inter, sans-serif',\n fontWeight: '600',\n letterSpacing: 0.4,\n textTransform: 'uppercase',\n }}\n >\n {label}\n </Text>\n </View>\n )\n })}\n </View>\n )\n}\n\nfunction StatusLegend() {\n return (\n <View\n className=\"flex-row flex-wrap\"\n style={{ gap: 10, justifyContent: 'center' }}\n testID=\"training-status-page-legend\"\n >\n {STATUS_ORDER.map((status) => (\n <View\n key={status}\n className=\"flex-row items-center\"\n style={{ gap: 5 }}\n testID={`training-status-page-legend-${status}`}\n >\n <View\n style={{\n width: 8,\n height: 8,\n borderRadius: 9999,\n backgroundColor: getHeatmapColor(status, 0.6),\n }}\n accessibilityElementsHidden\n />\n <Text\n className=\"text-text-secondary\"\n style={{\n fontSize: 11,\n fontFamily: 'Inter, sans-serif',\n textTransform: 'capitalize',\n }}\n >\n {VOLUME_STATUS_LABELS[status]}\n </Text>\n </View>\n ))}\n </View>\n )\n}\n\ninterface BodyMapColumnProps {\n side: 'front' | 'back'\n muscles: TrainingStatusMuscle[]\n selected: MuscleGroup | null\n onSelect: (muscle: MuscleGroup) => void\n}\n\nfunction BodyMapColumn({ side, muscles, selected, onSelect }: BodyMapColumnProps) {\n const data = useMemo(() => toBodyMapData(muscles, side), [muscles, side])\n return (\n <View style={{ flexGrow: 1, flexBasis: '46%' }} testID={`training-status-page-bodymap-${side}`}>\n <BodyMap\n data={data}\n view={side}\n onMusclePress={onSelect}\n highlightedMuscle={selected}\n mode=\"detailed\"\n />\n </View>\n )\n}\n\n/**\n * TrainingStatusPage — a body-map training dashboard that composes the\n * mesocycle context banner (`MesoStatusCard`), side-by-side front/back\n * `BodyMap`s with a shared heatmap legend, per-status summary cards, and a\n * tap-to-detail `BodyMapDetailPanel`. Tapping any muscle (SVG or legend chip)\n * opens the slide-up panel for that group; the summary is derived from the\n * supplied muscle rows.\n *\n * @example\n * <TrainingStatusPage meso={meso} muscles={muscles} />\n */\nexport function TrainingStatusPage({\n title = 'Training Status',\n meso,\n muscles,\n className,\n ...props\n}: TrainingStatusPageProps) {\n const [selected, setSelected] = useState<MuscleGroup | null>(null)\n const summary = useMemo(() => deriveTrainingSummary(muscles), [muscles])\n const active = selected != null ? (muscles.find((m) => m.muscleGroup === selected) ?? null) : null\n\n return (\n <View\n className={['bg-background-base', className].filter(Boolean).join(' ')}\n style={{ position: 'relative', width: 390 }}\n accessibilityRole={'main' as ViewProps['accessibilityRole']}\n aria-label={title}\n testID=\"training-status-page\"\n {...props}\n >\n <View style={{ padding: 16, gap: 16 }} testID=\"training-status-page-content\">\n <Text\n accessibilityRole=\"header\"\n className=\"text-text-primary\"\n style={{\n fontSize: 20,\n fontFamily: '\"Space Grotesk\", sans-serif',\n fontWeight: '700',\n }}\n testID=\"training-status-page-title\"\n >\n {title}\n </Text>\n\n <MesoStatusCard {...meso} />\n\n <SummaryCards summary={summary} />\n\n <View\n className=\"bg-surface-elevated border-hairline\"\n style={{\n borderWidth: 1,\n borderRadius: 12,\n padding: 12,\n gap: 12,\n }}\n testID=\"training-status-page-bodymaps\"\n >\n <View className=\"flex-row\" style={{ gap: 8 }}>\n <BodyMapColumn\n side=\"front\"\n muscles={muscles}\n selected={selected}\n onSelect={setSelected}\n />\n <BodyMapColumn\n side=\"back\"\n muscles={muscles}\n selected={selected}\n onSelect={setSelected}\n />\n </View>\n <StatusLegend />\n </View>\n </View>\n\n {active != null && (\n <BodyMapDetailPanel\n muscleGroup={active.muscleGroup}\n displayName={active.displayName}\n weeklySets={active.weeklySets}\n landmarks={active.landmarks}\n volumeStatus={active.volumeStatus}\n lastTrained={active.lastTrained}\n weeklyHistory={active.weeklyHistory}\n contributingExercises={active.contributingExercises}\n upcomingExercises={active.upcomingExercises}\n isOpen\n onClose={() => setSelected(null)}\n />\n )}\n </View>\n )\n}\n"]}