@terpjs/react-core 0.30.0 → 0.32.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 (82) hide show
  1. package/README.md +35 -14
  2. package/package.json +5 -5
  3. package/src/DashboardPage.tsx +34 -0
  4. package/src/Field.test.tsx +26 -1
  5. package/src/Field.tsx +15 -5
  6. package/src/HubPage.tsx +7 -2
  7. package/src/ModuleNav.test.tsx +29 -1
  8. package/src/ModuleNav.tsx +5 -1
  9. package/src/Page.test.tsx +192 -0
  10. package/src/Page.tsx +141 -55
  11. package/src/PageActions.test.tsx +64 -3
  12. package/src/PageActions.tsx +40 -15
  13. package/src/PageSequence.tsx +114 -0
  14. package/src/Stat.test.tsx +376 -0
  15. package/src/Stat.tsx +316 -0
  16. package/src/Timeline.test.tsx +74 -0
  17. package/src/Timeline.tsx +71 -0
  18. package/src/admin/AdminHub.tsx +233 -78
  19. package/src/admin/AuditLogAdmin.tsx +3 -1
  20. package/src/admin/GroupCreate.tsx +3 -1
  21. package/src/admin/GroupDetail.tsx +72 -67
  22. package/src/admin/GroupsAdmin.tsx +3 -1
  23. package/src/admin/ModuleAccessPanel.tsx +13 -12
  24. package/src/admin/RecordHistory.tsx +88 -0
  25. package/src/admin/UserCreate.tsx +3 -1
  26. package/src/admin/UserDetail.tsx +8 -1
  27. package/src/admin/UsersAdmin.tsx +3 -0
  28. package/src/admin/admin.test.tsx +389 -19
  29. package/src/bootstrap.test.tsx +31 -7
  30. package/src/bootstrap.tsx +30 -4
  31. package/src/charts/BarChart.tsx +74 -0
  32. package/src/charts/ProportionBar.tsx +118 -0
  33. package/src/charts/StatusHistory.tsx +75 -0
  34. package/src/charts/TrendChart.tsx +232 -0
  35. package/src/charts/charts.test.tsx +409 -0
  36. package/src/charts/scale.ts +103 -0
  37. package/src/currentInView.ts +28 -0
  38. package/src/dataview/DataView.test.tsx +303 -1
  39. package/src/dataview/DataView.tsx +53 -3
  40. package/src/dataview/DataViewCardList.tsx +21 -13
  41. package/src/dataview/DataViewTable.tsx +5 -6
  42. package/src/dataview/DataViewToolbar.tsx +4 -1
  43. package/src/dataview/README.md +18 -0
  44. package/src/dataview/index.ts +1 -0
  45. package/src/dataview/internal.tsx +112 -5
  46. package/src/dataview/types.ts +39 -10
  47. package/src/errorMessages.test.tsx +17 -0
  48. package/src/errorMessages.tsx +18 -0
  49. package/src/format.ts +15 -0
  50. package/src/index.ts +24 -1
  51. package/src/layout.manifest.json +2 -9
  52. package/src/layout.manifest.test.ts +4 -2
  53. package/src/layout.test.tsx +74 -6
  54. package/src/layout.tsx +85 -25
  55. package/src/layoutContract.test.tsx +239 -1
  56. package/src/layoutContract.ts +131 -5
  57. package/src/layoutDeclaration.test.ts +31 -10
  58. package/src/layoutDeclaration.ts +9 -4
  59. package/src/locale.tsx +28 -3
  60. package/src/markers.test.ts +70 -2
  61. package/src/router.test.tsx +15 -3
  62. package/src/router.tsx +11 -2
  63. package/src/ssr.test.tsx +18 -0
  64. package/src/styles.test.ts +288 -190
  65. package/src/styles.ts +1379 -361
  66. package/src/theme.test.tsx +44 -18
  67. package/src/theme.themes.test.ts +22 -2
  68. package/src/theme.tsx +22 -14
  69. package/src/themes.ts +39 -4
  70. package/src/tokens.guard.test.ts +13 -15
  71. package/src/typography.tsx +5 -1
  72. package/src/ui/Alert.test.tsx +24 -1
  73. package/src/ui/Alert.tsx +10 -1
  74. package/src/ui/Card.tsx +5 -4
  75. package/src/ui/Tabs.test.tsx +44 -0
  76. package/src/ui/Tabs.tsx +5 -2
  77. package/src/ui/Tooltip.test.tsx +171 -2
  78. package/src/ui/Tooltip.tsx +144 -8
  79. package/src/ui/controlMessages.tsx +20 -7
  80. package/src/uiText.test.tsx +16 -0
  81. package/src/uiText.tsx +105 -7
  82. package/src/viewerTimeZone.ts +15 -0
package/src/styles.ts CHANGED
@@ -206,7 +206,7 @@ html, body {
206
206
  margin: 0;
207
207
  }
208
208
  body {
209
- background: var(--color-neutral-50);
209
+ background: var(--color-bg-canvas);
210
210
  }
211
211
  /* Border-box baseline: react-core sizes components as padding-inclusive
212
212
  (e.g. LoginView's 100vh page with padding, inputs at width:100% with
@@ -307,11 +307,14 @@ html {
307
307
  [data-terp="button"][data-variant="secondary"] {
308
308
  background: var(--color-neutral-0);
309
309
  color: var(--color-neutral-900);
310
- border-color: var(--color-neutral-300);
310
+ border-color: var(--color-border-strong);
311
311
  }
312
+ /* The danger as a filled surface, on tokens of its own (ADR 0170 §6, the split ADR 0093 §5
313
+ made for the accent): the danger INK is light in a dark palette so it reads on the app's own
314
+ ground, and a fill in that ink is a pale button that outshouts the primary one. */
312
315
  [data-terp="button"][data-variant="danger"] {
313
- background: var(--color-status-danger);
314
- color: var(--color-neutral-0);
316
+ background: var(--color-status-danger-fill);
317
+ color: var(--color-status-danger-fill-contrast);
315
318
  }
316
319
  [data-terp="button"][data-variant="ghost"] {
317
320
  background: transparent;
@@ -354,20 +357,32 @@ html {
354
357
  /* Badges ------------------------------------------------------------------- */
355
358
  /* The border matches the soft fill exactly, so it reads as one flat pill while
356
359
  still occupying a border box — which is what keeps a Badge the same height
357
- next to a bordered control. */
360
+ next to a bordered control.
361
+
362
+ A label longer than its container wraps inside it. It did not: nowrap with no width cap let a
363
+ phrase in a narrow column run out of it, cover the next one and widen a phone's page. The
364
+ radius is what keeps one line a pill. 0.75rem is more than half a one-line badge's height,
365
+ so the corners clamp to a full round, exactly as 9999px did, and less than half of two lines',
366
+ so a wrapped badge is a rounded box rather than a lozenge.
367
+
368
+ It wraps between words, and inside a word only once a word alone is wider than the
369
+ container. break-word on an inline block, not anywhere on an inline flex: anywhere also
370
+ shrinks the badge's narrowest width to one glyph, so an auto-layout table squeezed the
371
+ badge column first and split "Cancelled" mid-word over three lines. A badge holds text
372
+ only, so the inline block draws one line exactly as the inline flex did. */
358
373
  [data-terp="badge"] {
359
- display: inline-flex;
360
- align-items: center;
374
+ display: inline-block;
375
+ max-inline-size: 100%;
361
376
  border: 1px solid;
362
- border-radius: var(--radius-full);
377
+ border-radius: var(--radius-lg);
363
378
  padding: 2px var(--space-2);
364
379
  font-size: var(--font-size-xs);
365
380
  font-weight: var(--font-weight-semibold);
366
381
  line-height: 1.4;
367
- white-space: nowrap;
382
+ overflow-wrap: break-word;
368
383
  }
369
384
  [data-terp="badge"][data-tone="neutral"] {
370
- color: var(--color-neutral-600);
385
+ color: var(--color-fg-muted);
371
386
  background: var(--color-neutral-100);
372
387
  border-color: var(--color-neutral-100);
373
388
  }
@@ -440,7 +455,7 @@ html {
440
455
  row already spell for the same tone. It was --color-neutral-50, which is the canvas: on
441
456
  a card with no fill the alert kept its border and lost its wash entirely. */
442
457
  [data-terp="alert"][data-tone="neutral"] {
443
- color: var(--color-neutral-600);
458
+ color: var(--color-fg-muted);
444
459
  background: var(--color-neutral-100);
445
460
  }
446
461
  [data-terp="alert"][data-tone="info"] {
@@ -473,6 +488,15 @@ html {
473
488
  [data-terp="alert-title"] {
474
489
  font-weight: var(--font-weight-semibold);
475
490
  }
491
+ /* What to do about it, under what happened, inside the alert's own tint: a wrapping row of
492
+ buttons, so two actions sit side by side on a desk and stack on a phone without leaving the
493
+ alert they answer. */
494
+ [data-terp="alert-actions"] {
495
+ display: flex;
496
+ flex-wrap: wrap;
497
+ gap: var(--space-2);
498
+ margin-block-start: var(--space-2);
499
+ }
476
500
 
477
501
  /* Text controls ------------------------------------------------------------ */
478
502
  /* Input, Select and Textarea deliberately share one marker, because the focus
@@ -481,7 +505,7 @@ html {
481
505
  carries that — no second attribute for a distinction the tag name already
482
506
  makes. */
483
507
  [data-terp="input"] {
484
- border: 1px solid var(--color-neutral-300);
508
+ border: 1px solid var(--color-border-strong);
485
509
  border-radius: var(--radius-md);
486
510
  color: var(--color-neutral-900);
487
511
  background: var(--color-neutral-0);
@@ -695,29 +719,34 @@ textarea[data-terp="input"] {
695
719
  > [data-terp="detail-list"][data-layout="aligned"]:not([data-columns]) {
696
720
  grid-template-columns: subgrid;
697
721
  }
698
- /* FieldRow's wide half: the three shared lines, and the columns that hold them.
722
+ /* FieldRow's wide half: the two shared lines, and the columns that hold them.
699
723
  align-items: start so a field shorter than its neighbour does not stretch, and
700
724
  justify-content: start so the row is as wide as its fields rather than as wide as the
701
- page. */
725
+ page.
726
+
727
+ TWO lines, label and body, where there were three -- label, control, messages. The
728
+ messages now live in the field's body under its control (see Field), and that retired
729
+ the third line's one cost: a line nobody on the row had anything for was still a line,
730
+ with a gutter on either side of it. */
702
731
  [data-terp="field-row"] {
703
732
  grid-auto-flow: column;
704
733
  grid-auto-columns: minmax(0, auto);
705
- grid-template-rows: auto auto auto;
734
+ grid-template-rows: auto auto;
706
735
  align-items: start;
707
736
  justify-content: start;
708
737
  }
709
- /* Each field spans all three and subgrids them, which is what puts every label on one
738
+ /* Each field spans both lines and subgrids them, which is what puts every label on one
710
739
  line and every control on the next whatever any one field has to say. */
711
740
  [data-terp="field-row"] > [data-terp="field"] {
712
741
  display: grid;
713
742
  grid-template-rows: subgrid;
714
743
  grid-row: 1 / -1;
715
744
  }
716
- /* The label element generates no box, so the label TEXT and the control become items of
717
- the field and can land on separate shared lines. It stays a <label> wrapping its
718
- control in the DOM, which is what names the control -- display: contents changes the
719
- box tree, and the accessible name is computed from the DOM. Field additionally points
720
- aria-labelledby at the text, so the name is exact either way. */
745
+ /* The label element generates no box, so the label TEXT and the body become items of the
746
+ field and can land on separate shared lines. It stays a <label> wrapping its control in
747
+ the DOM, which is what names the control -- display: contents changes the box tree, and
748
+ the accessible name is computed from the DOM. Field additionally points aria-labelledby
749
+ at the text, so the name is exact either way. */
721
750
  [data-terp="field-row"] > [data-terp="field"] > [data-terp="field-label"] {
722
751
  display: contents;
723
752
  }
@@ -773,6 +802,26 @@ textarea[data-terp="input"] {
773
802
  [data-terp="grid"][data-columns="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
774
803
  [data-terp="grid"][data-columns="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
775
804
  [data-terp="grid"][data-columns="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
805
+ /* The named track templates (ADR 0169 §2): proportions read left to right, each track
806
+ minmax(0, n fr) for the reason the fixed counts above give. A closed set on the parent rather
807
+ than a span on a child, so a row cannot go ragged whatever renders in it.
808
+
809
+ Each one gives up its tracks at the one cutover, which is the property a fixed count lacks
810
+ and the reason a template exists beside it: columns={4} keeps four tracks on a phone and
811
+ clips, a template does not. Every template becomes one track there, except the four-track set,
812
+ which becomes two — four small blocks as a square rather than a column four screens long.
813
+ The collapse is a viewport query, unlike "auto"'s container reflow, because a template is the
814
+ layout of a page section and the page changes shape at the cutover with the shell around it. */
815
+ [data-terp="grid"][data-template="1:1"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
816
+ [data-terp="grid"][data-template="1:1:1"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
817
+ [data-terp="grid"][data-template="1:1:1:1"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
818
+ [data-terp="grid"][data-template="2:1"] { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
819
+ [data-terp="grid"][data-template="1:2"] { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
820
+ [data-terp="grid"][data-template="3:1"] { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); }
821
+ @media ${NARROW_VIEWPORT} {
822
+ [data-terp="grid"][data-template] { grid-template-columns: minmax(0, 1fr); }
823
+ [data-terp="grid"][data-template="1:1:1:1"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
824
+ }
776
825
  [data-terp="grid"][data-gap="0"] { gap: var(--space-0); }
777
826
  [data-terp="grid"][data-gap="1"] { gap: var(--space-1); }
778
827
  [data-terp="grid"][data-gap="2"] { gap: var(--space-2); }
@@ -790,6 +839,52 @@ textarea[data-terp="input"] {
790
839
  [data-terp="grid"][data-padding="4"] { padding: var(--space-4); }
791
840
  [data-terp="grid"][data-padding="6"] { padding: var(--space-6); }
792
841
  [data-terp="grid"][data-padding="8"] { padding: var(--space-8); }
842
+ /* A grid of fields lines its fields up by itself: every label on one line and every control
843
+ on the next, in each row of the grid, however long any label runs or whatever any field
844
+ says under its control. Before this, a grid of fields aligned their TOPS (or, with
845
+ align="end", their bottoms), so one label that wrapped to two lines pushed its control below
846
+ its neighbours', and one hint lifted a control above them. FieldRow had the fix, and only
847
+ for the fields placed in it on purpose; the ordinary composition -- a form's fields in a
848
+ Grid -- never got it.
849
+
850
+ Each field spans two of the grid's rows and subgrids them, label and body, the shape
851
+ FieldRow uses. Two rows rather than three because the body holds the control AND its
852
+ messages, so no row is ever empty: a row of fields with no hint has no zero-height messages
853
+ line carrying the grid's gap twice.
854
+
855
+ The grid's row gap is the caller's spacing BETWEEN rows of fields, and that is what it
856
+ stays. Inside a field the label sits var(--space-1) above its control as it does anywhere
857
+ else: the subgrid declares that gap, and a subgrid's own gap is honoured by moving its edge
858
+ items into the parent's gutter, so the label and the control meet at 4px while the grid's
859
+ tracks keep the caller's spacing.
860
+
861
+ Only a grid whose children are ALL fields. A grid mixing fields with other things -- a card,
862
+ a button -- keeps its ordinary cells, because a one-row item placed among two-row fields
863
+ would take a field's label line and push the auto-placement out of step for every row after
864
+ it. A row of fields with an action beside them is FieldRow's job, which puts the action on
865
+ the control line. */
866
+ [data-terp="grid"]:not(:has(> :not([data-terp="field"]))) > [data-terp="field"] {
867
+ display: grid;
868
+ grid-row: span 2;
869
+ grid-template-rows: subgrid;
870
+ row-gap: var(--space-1);
871
+ }
872
+ [data-terp="grid"]:not(:has(> :not([data-terp="field"])))
873
+ > [data-terp="field"]
874
+ > [data-terp="field-label"] {
875
+ display: contents;
876
+ }
877
+ /* The label at the FOOT of its line, directly above its control, in a grid of fields and in a
878
+ field row alike. The line is as tall as the longest label in the row, so a one-line label
879
+ beside a two-line one has a line of space to stand in, and at the top of it the short label
880
+ floated a line away from the control it names. Its spare space goes above it instead. */
881
+ [data-terp="grid"]:not(:has(> :not([data-terp="field"])))
882
+ > [data-terp="field"]
883
+ > [data-terp="field-label"]
884
+ > [data-terp="field-label-text"],
885
+ [data-terp="field-row"] > [data-terp="field"] > [data-terp="field-label"] > [data-terp="field-label-text"] {
886
+ align-self: end;
887
+ }
793
888
 
794
889
  /* Detail lists ------------------------------------------------------------- */
795
890
  /* The term and value are inline boxes inside a block row, which is what makes
@@ -906,10 +1001,41 @@ textarea[data-terp="input"] {
906
1001
  [data-terp="detail-list-row"]:not([data-full="true"]) {
907
1002
  display: contents;
908
1003
  }
1004
+ /* The ruled grid (ADR 0169 §5): a record's facts as a sheet. Each pair is a cell -- its label
1005
+ above its value -- padded half a gap all round, as many to a row as fit, and the list reaches
1006
+ out by that half on both sides so the labels start on the line the content around them does.
1007
+ StatGroup's construction, with a second rule: each cell draws a 1px shadow outside its start
1008
+ edge and one outside its top edge, and the list's overflow clips the ones that fall outside it
1009
+ -- so a cell that starts a row has no rule before it and the first row none above it, however
1010
+ many render. The tracks meet with no gap, so the rules are continuous; the clip sits half a gap
1011
+ outside the text, so a focus ring inside a cell keeps its sides.
1012
+
1013
+ 12.5rem is 11rem of fact and the 1.5rem of its padding. A gap from the gap prop opens space
1014
+ between ruled rows on top of this (its rules are declared later and win on source order). */
1015
+ [data-terp="detail-list"][data-layout="grid"] {
1016
+ gap: 0;
1017
+ margin-inline: calc(-1 * var(--space-3));
1018
+ overflow: hidden;
1019
+ }
1020
+ [data-terp="detail-list"][data-layout="grid"][data-columns="auto"] {
1021
+ grid-template-columns: repeat(auto-fit, minmax(min(12.5rem, 100%), 1fr));
1022
+ column-gap: 0;
1023
+ }
1024
+ [data-terp="detail-list"][data-layout="grid"] > [data-terp="detail-list-row"] {
1025
+ display: flex;
1026
+ flex-direction: column;
1027
+ gap: var(--space-1);
1028
+ padding: var(--space-3);
1029
+ box-shadow:
1030
+ -1px 0 0 0 var(--color-neutral-200),
1031
+ 0 -1px 0 0 var(--color-neutral-200);
1032
+ }
909
1033
  [data-terp="detail-list"][data-layout="aligned"] [data-terp="detail-list-term"],
910
1034
  [data-terp="detail-list"][data-layout="aligned"] [data-terp="detail-list-value"],
911
1035
  [data-terp="detail-list"][data-layout="stacked"] [data-terp="detail-list-term"],
912
- [data-terp="detail-list"][data-layout="stacked"] [data-terp="detail-list-value"] {
1036
+ [data-terp="detail-list"][data-layout="stacked"] [data-terp="detail-list-value"],
1037
+ [data-terp="detail-list"][data-layout="grid"] [data-terp="detail-list-term"],
1038
+ [data-terp="detail-list"][data-layout="grid"] [data-terp="detail-list-value"] {
913
1039
  display: block;
914
1040
  }
915
1041
  /* The label takes the muted, smaller, regular step so a pair reads as one unit rather than two
@@ -922,7 +1048,8 @@ textarea[data-terp="input"] {
922
1048
  the ::after above — and muting half a sentence is a different defect from the one this fixes.
923
1049
  Two layouts diverging was the bug; three converging would be another. */
924
1050
  [data-terp="detail-list"][data-layout="aligned"] [data-terp="detail-list-term"],
925
- [data-terp="detail-list"][data-layout="stacked"] [data-terp="detail-list-term"] {
1051
+ [data-terp="detail-list"][data-layout="stacked"] [data-terp="detail-list-term"],
1052
+ [data-terp="detail-list"][data-layout="grid"] [data-terp="detail-list-term"] {
926
1053
  font-size: var(--font-size-xs);
927
1054
  font-weight: var(--font-weight-normal);
928
1055
  color: var(--color-fg-muted);
@@ -947,7 +1074,8 @@ textarea[data-terp="input"] {
947
1074
  still renders at the step that Text asked for. That is the correct outcome for a caller who
948
1075
  said a size and the thing to know about a caller who did not. */
949
1076
  [data-terp="detail-list"][data-layout="aligned"] [data-terp="detail-list-value"],
950
- [data-terp="detail-list"][data-layout="stacked"] [data-terp="detail-list-value"] {
1077
+ [data-terp="detail-list"][data-layout="stacked"] [data-terp="detail-list-value"],
1078
+ [data-terp="detail-list"][data-layout="grid"] [data-terp="detail-list-value"] {
951
1079
  font-size: var(--font-size-sm);
952
1080
  }
953
1081
  /* The gap prop, and this block must stay AFTER the layout rules above. Both
@@ -1047,7 +1175,7 @@ textarea[data-terp="input"] {
1047
1175
  flex-direction: column;
1048
1176
  gap: var(--space-1);
1049
1177
  padding: var(--space-3);
1050
- border: 1px solid var(--color-neutral-300);
1178
+ border: 1px solid var(--color-border-strong);
1051
1179
  border-radius: var(--radius-md);
1052
1180
  background: var(--color-neutral-0);
1053
1181
  cursor: pointer;
@@ -1087,10 +1215,15 @@ textarea[data-terp="input"] {
1087
1215
  }
1088
1216
  [data-terp="tile-body"] {
1089
1217
  font-size: var(--font-size-xs);
1090
- color: var(--color-fg-subtle);
1218
+ color: var(--color-fg-muted);
1091
1219
  display: grid;
1092
1220
  gap: var(--space-1);
1093
1221
  }
1222
+ /* A tile's body is read to make the choice, so it carries the muted ink rather than the
1223
+ subtle one; a disabled tile is not a choice, and its body fades with the rest of it. */
1224
+ [data-terp="tile"][aria-disabled="true"] [data-terp="tile-body"] {
1225
+ color: inherit;
1226
+ }
1094
1227
  [data-terp="radio-group"] {
1095
1228
  display: grid;
1096
1229
  gap: var(--space-2);
@@ -1111,35 +1244,38 @@ textarea[data-terp="input"] {
1111
1244
  }
1112
1245
 
1113
1246
  /* Cards -------------------------------------------------------------------- */
1114
- /* The surface model, and this is the rule that states it: an in-flow block is an OBJECT —
1115
- a fill, a frame, a radius and a padding — sitting on a canvas that is tinted away from
1116
- it. Two tokens, two jobs: --color-bg-surface is what an object is made of and
1117
- --color-bg-canvas is what the page is made of, and the whole legibility of a screen
1118
- rests on the gap between them.
1119
-
1120
- It was frame-only for one release — border and radius with the canvas showing through —
1121
- and that is what this reverses. The argument then was sound about the DEFECT and wrong
1247
+ /* The surface model, and this is the rule that states it. A screen is legible because its
1248
+ blocks sit at different heights, and ADR 0169 gives the page four rungs, one job each:
1249
+ --color-bg-canvas is what the page is made of; --color-bg-subtle, the midpoint between
1250
+ canvas and surface, is what containers and chrome are made of — this card, the HubCard
1251
+ body, the profile card, the page band and the sequence bar; --color-bg-surface is where
1252
+ data is read — the
1253
+ full DataView's table frame, dataview-card, resource-list-row and empty-state; and the
1254
+ brand fill is kept for the one headline figure a page may carry.
1255
+
1256
+ Cards were frame-only for one release — border and radius with the canvas showing
1257
+ through — and that was reversed. The argument then was sound about the DEFECT and wrong
1122
1258
  about the fix: cards were painting --color-neutral-0, the far end of the primitive ramp,
1123
1259
  so an app that themed its canvas got cards that did not follow, and a card dropped on
1124
- something already a surface repainted it. Naming the SEMANTIC surface answers the first
1125
- (a theme moves both ends together, which is what the bg family is for) and
1126
- variant="plain" already answered the second.
1127
-
1128
- What frame-only cost was the thing a screen is judged on. With canvas and surface a
1129
- rounding error apart there is no object anywhere on the page: measured on the light
1130
- theme, a table, a hub card and the page behind them all rendered #f8fafc inside a
1131
- #e2e8f0 hairline, which reads as a wireframe of an app rather than an app. Tinting the
1132
- canvas alone does not fix it either — it just moves every object onto grey, and a data
1133
- table with a grey ground reads as disabled. Both halves have to move, and they are one
1134
- decision, so they are in one commit.
1135
-
1136
- Six rules follow the same line, and they are the framework's other in-flow blocks:
1137
- hubcard-body, profile-card, resource-list-row, empty-state, dataview-card and the full
1138
- DataView's table frame. Three kinds of element already did and keep doing so for reasons
1139
- of their own: an overlay has to be opaque over whatever it covers (dialog,
1140
- popover-panel, toast, the combobox list, and appshell-header, which the page scrolls
1141
- under); a control needs a surface of its own to read as a control (input, select, the
1142
- secondary button); and login-card is the one object on an otherwise empty canvas.
1260
+ something already a surface repainted it. Naming SEMANTIC tokens answers the first —
1261
+ every shipped palette declares every rung, which is what the bg family is for, and an
1262
+ app's theme.css that moves canvas or surface redeclares subtle with them (terp guide
1263
+ theming says so, because a token there does not recompute another) — and variant="plain"
1264
+ already answered the second.
1265
+
1266
+ What frame-only cost was the thing a screen is judged on: with every block and the page a
1267
+ rounding error apart there is no object anywhere, and the page reads as a wireframe of an
1268
+ app. Tinting the canvas alone does not fix it either — it moves every object onto grey,
1269
+ and a data table on a grey ground reads as disabled. That is why the containers step back
1270
+ to the midpoint while the collection stays on surface. In the midday theme the midpoint
1271
+ halves the step from canvas to surface, to about 1.06:1 either side, so a container's
1272
+ edge is carried by its hairline, and the table keeps the brightest fill on the page.
1273
+
1274
+ Three kinds of element paint --color-neutral-0 for reasons of their own: an overlay has to
1275
+ be opaque over whatever it covers (dialog, popover-panel, toast, the combobox list, and
1276
+ appshell-header, which the page scrolls under); a control needs a surface of its own to
1277
+ read as a control (input, select, the secondary button); and login-card is the one object
1278
+ on an otherwise empty canvas.
1143
1279
 
1144
1280
  The washes stay one step along the ramp — --color-neutral-100, or the
1145
1281
  --color-interactive-* token that names the state — rather than returning to
@@ -1153,7 +1289,7 @@ textarea[data-terp="input"] {
1153
1289
  display: flex;
1154
1290
  flex-direction: column;
1155
1291
  gap: var(--space-3);
1156
- background: var(--color-bg-surface);
1292
+ background: var(--color-bg-subtle);
1157
1293
  border: 1px solid var(--color-neutral-200);
1158
1294
  border-radius: var(--radius-lg);
1159
1295
  box-shadow: var(--shadow-sm);
@@ -1167,41 +1303,32 @@ textarea[data-terp="input"] {
1167
1303
  [data-terp="card"][data-gap="4"] { gap: var(--space-4); }
1168
1304
  [data-terp="card"][data-gap="6"] { gap: var(--space-6); }
1169
1305
  [data-terp="card"][data-gap="8"] { gap: var(--space-8); }
1306
+ /* A card's header is the page band's shape at a card's size: the title, the actions beside it
1307
+ when they fit, and the description on a line of its own under both -- then the body. The
1308
+ card used to put the title and the description in ONE column with the actions in a second
1309
+ one beside the pair, so the actions took their width out of the description: a sentence of
1310
+ description wrapped in a narrow column next to a single button, and grew the header three
1311
+ lines deep to say what one line under the title would have.
1312
+
1313
+ The same wrapping line the band uses (see page-header), for the same reasons. The heading
1314
+ group generates no box, so the title and the description are items of the header itself;
1315
+ order puts the actions straight after the title and the description last, with a full-line
1316
+ basis so it never sits beside them. The title claims 10rem before the actions must wrap, and
1317
+ wrapped actions are pushed to the end and wrap their own buttons.
1318
+
1319
+ align-items: center for the title's line: the actions are controls, a control is taller than
1320
+ a line of title, and the title belongs in the middle of the line it shares with them. The
1321
+ description sits var(--space-2) under that line, and the card's own gap separates the header
1322
+ from the body -- header, a little space, the description, a little more, the content. */
1170
1323
  [data-terp="card-header"] {
1171
1324
  display: flex;
1172
- align-items: center;
1173
- justify-content: space-between;
1174
1325
  flex-wrap: wrap;
1175
- gap: var(--space-3);
1176
- }
1177
- /* start rather than center once there is a description, and the condition is the whole point.
1178
- With a title alone, center is right: the actions slot is a control, so its box is
1179
- --density-control-min-height tall against a single line box, and start would leave the title
1180
- riding above it. With two or three lines of description the same declaration floats the
1181
- control in the middle of the block instead of beside the title it belongs to.
1182
-
1183
- :has() rather than an attribute Card could stamp, for the reason control-label's disabled
1184
- states use it (see the note there): the header has no idea what its heading holds, and the
1185
- alternative is a prop describing the DOM back to the sheet. Specificity (0,2,0) beats the
1186
- base rule above, so this does not depend on its position. */
1187
- [data-terp="card-header"]:has([data-terp="card-description"]) {
1188
- align-items: start;
1326
+ align-items: center;
1327
+ column-gap: var(--space-3);
1328
+ row-gap: var(--space-2);
1189
1329
  }
1190
- /* flex: 1 1 0, and the base size is the load-bearing half. Left at the initial 0 1 auto, the
1191
- heading's hypothetical main size is the max-content width of a block holding a title AND a
1192
- sentence of description — and flex breaks lines on hypothetical main sizes BEFORE it shrinks
1193
- anything, so with flex-wrap above the heading claimed the whole line and the actions slot
1194
- wrapped underneath it. Measured: a 103px header with the button below the description, where
1195
- the same component with no description rendered inline at 48px. Same prop, two results,
1196
- depending on whether a sibling prop was set.
1197
-
1198
- A base size of 0 means both items fit on one line by construction, and the heading then grows
1199
- into whatever the actions slot does not use. min-width: 0 stays for the other half of that
1200
- story: a flex item's automatic minimum size is its content's, so a long unbreakable word in a
1201
- title would otherwise refuse to shrink past it. */
1202
1330
  [data-terp="card-heading"] {
1203
- flex: 1 1 0;
1204
- min-width: 0;
1331
+ display: contents;
1205
1332
  }
1206
1333
  /* Chrome off, heading kept. Three declarations removed rather than a second component
1207
1334
  with six markers of its own describing the same DOM: a titled region inside something
@@ -1299,6 +1426,11 @@ textarea[data-terp="input"] {
1299
1426
  background: var(--color-neutral-100);
1300
1427
  color: var(--color-fg-default);
1301
1428
  }
1429
+ /* An identifier in a table cell stays one token. Broken at a hyphen, its chip became two chips
1430
+ on two lines; whole, the column widens to it, and the table scrolls where the page cannot. */
1431
+ [data-terp="dataview-table"] td [data-terp="code"] {
1432
+ white-space: nowrap;
1433
+ }
1302
1434
  /* The same wash as inline code, and that is new: the block was --color-neutral-50 while
1303
1435
  the chip above it was --color-neutral-100, so two renderings of one thing disagreed —
1304
1436
  and the block's half was the canvas, which a card with no fill would have shown
@@ -1355,8 +1487,19 @@ textarea[data-terp="input"] {
1355
1487
  inline-size: 1px;
1356
1488
  }
1357
1489
 
1490
+ /* The actions: one item, after the title, pushed to the end of whichever line it lands on, and
1491
+ allowed to shrink to that line -- min-width: 0, or a flex item refuses to go below its
1492
+ content and a row of buttons runs past the card's edge. Its own buttons wrap when it does. */
1358
1493
  [data-terp="card-actions"] {
1359
- flex-shrink: 0;
1494
+ order: 2;
1495
+ flex: 0 1 auto;
1496
+ min-width: 0;
1497
+ margin-inline-start: auto;
1498
+ display: flex;
1499
+ flex-wrap: wrap;
1500
+ justify-content: flex-end;
1501
+ align-items: center;
1502
+ gap: var(--space-2);
1360
1503
  }
1361
1504
  /* lg, and it is no longer "the step below the page title" — page-title moved DOWN to sm in
1362
1505
  0.14.0 when the header became a band, so a section heading is now two steps above the view's
@@ -1372,22 +1515,50 @@ textarea[data-terp="input"] {
1372
1515
  }
1373
1516
  [data-terp="card-description"] {
1374
1517
  margin: 0;
1375
- color: var(--color-neutral-600);
1518
+ color: var(--color-fg-muted);
1376
1519
  font-size: var(--font-size-sm);
1377
1520
  }
1521
+ /* Their places in the header line (see card-header): the title first, claiming 10rem before the
1522
+ actions must wrap; the description last, on a line of its own. After the two base rules
1523
+ rather than beside the header's, so the look of each is read first and its placement after. */
1524
+ [data-terp="card-header"] [data-terp="card-title"] {
1525
+ order: 1;
1526
+ flex: 1 1 10rem;
1527
+ min-width: 0;
1528
+ }
1529
+ [data-terp="card-header"] [data-terp="card-description"] {
1530
+ order: 3;
1531
+ flex: 1 1 100%;
1532
+ }
1378
1533
 
1379
1534
  /* Tabs --------------------------------------------------------------------- */
1380
- /* The tab strip sits one pixel over the list's bottom rule, so the selected
1381
- tab's own 2px edge covers it rather than stacking beside it. */
1535
+ /* The strip is one line that scrolls sideways where it does not fit. It wrapped, and a wrapped
1536
+ strip put the second line's tabs under the first line's selected edge and the rule under the
1537
+ second line, so on a phone it read as two strips with one tab marked between them. The
1538
+ current tab is scrolled into the strip's view as it changes (useCurrentInView).
1539
+
1540
+ The rule is a 1px background on the content box's last row rather than a bottom border. A
1541
+ scroll container clips at its padding edge, and the selected tab's 2px edge reached a pixel
1542
+ into the border to cover it; drawn inside, the rule sits under that edge and nothing is cut.
1543
+ The padding is room for the focus ring, which the container would clip as well, and the
1544
+ negative margin gives the layout that room back, so the strip sits where it did. */
1382
1545
  [data-terp="tabs"] {
1383
1546
  display: grid;
1384
1547
  gap: var(--space-3);
1385
1548
  }
1386
1549
  [data-terp="tab-list"] {
1387
1550
  display: flex;
1388
- flex-wrap: wrap;
1551
+ flex-wrap: nowrap;
1389
1552
  gap: var(--space-1);
1390
- border-block-end: 1px solid var(--color-neutral-200);
1553
+ margin: calc(-1 * var(--space-1));
1554
+ padding: var(--space-1);
1555
+ overflow-x: auto;
1556
+ scrollbar-width: none;
1557
+ background: linear-gradient(var(--color-neutral-200), var(--color-neutral-200)) no-repeat
1558
+ var(--space-1) calc(100% - var(--space-1)) / calc(100% - 2 * var(--space-1)) 1px;
1559
+ }
1560
+ [data-terp="tab-list"]::-webkit-scrollbar {
1561
+ display: none;
1391
1562
  }
1392
1563
  [data-terp="tab"] {
1393
1564
  font-family: var(--font-family-sans);
@@ -1397,10 +1568,11 @@ textarea[data-terp="input"] {
1397
1568
  padding: var(--space-2) var(--space-3);
1398
1569
  border: 0;
1399
1570
  border-block-end: 2px solid transparent;
1400
- color: var(--color-neutral-600);
1571
+ color: var(--color-fg-muted);
1401
1572
  background: transparent;
1402
1573
  cursor: pointer;
1403
- margin-block-end: -1px;
1574
+ flex: none;
1575
+ white-space: nowrap;
1404
1576
  border-top-left-radius: var(--radius-sm);
1405
1577
  border-top-right-radius: var(--radius-sm);
1406
1578
  transition:
@@ -1420,24 +1592,36 @@ textarea[data-terp="input"] {
1420
1592
 
1421
1593
  The edges are logical (border-block-end) to match tab and appshell-footer rather
1422
1594
  than the physical borderBottom the component declared. Identical in every writing
1423
- mode this framework ships, and the sheet already had one convention. */
1595
+ mode this framework ships, and the sheet already had one convention.
1596
+
1597
+ One line that scrolls sideways where it does not fit, as the tab strip is and for its
1598
+ reason: wrapped, the strip's rule sat under the second line and the first line's active
1599
+ edge floated above it. The rule stays the nav's own border, outside the scrolling list, so
1600
+ nothing clips it; the list's padding is the focus ring's room and its negative margin gives
1601
+ the layout that room back. */
1424
1602
  [data-terp="module-nav"] {
1425
1603
  border-block-end: 1px solid var(--color-neutral-200);
1426
1604
  }
1427
1605
  [data-terp="module-nav-list"] {
1428
1606
  list-style: none;
1429
- margin: 0;
1430
- padding: 0;
1607
+ margin: calc(-1 * var(--space-1));
1608
+ padding: var(--space-1);
1431
1609
  display: flex;
1432
- flex-wrap: wrap;
1610
+ flex-wrap: nowrap;
1433
1611
  gap: var(--space-3);
1612
+ overflow-x: auto;
1613
+ scrollbar-width: none;
1614
+ }
1615
+ [data-terp="module-nav-list"]::-webkit-scrollbar {
1616
+ display: none;
1434
1617
  }
1435
1618
  [data-terp="module-nav-link"] {
1436
1619
  display: inline-flex;
1437
1620
  align-items: center;
1438
1621
  padding: var(--space-2) 0;
1439
- color: var(--color-neutral-600);
1622
+ color: var(--color-fg-muted);
1440
1623
  text-decoration: none;
1624
+ white-space: nowrap;
1441
1625
  border-block-end: 2px solid transparent;
1442
1626
  }
1443
1627
 
@@ -1470,7 +1654,7 @@ textarea[data-terp="input"] {
1470
1654
  [data-terp="breadcrumbs"] {
1471
1655
  font-size: var(--font-size-sm);
1472
1656
  line-height: var(--font-line-height-snug);
1473
- color: var(--color-neutral-600);
1657
+ color: var(--color-fg-muted);
1474
1658
  }
1475
1659
  /* NOWRAP on both, and the li is the one that matters. A crumb's chevron lives inside the li
1476
1660
  beside its label, so a wrapping li let a long label push its own separator onto the next
@@ -1516,7 +1700,7 @@ textarea[data-terp="input"] {
1516
1700
  font-weight: var(--font-weight-medium);
1517
1701
  }
1518
1702
  [data-terp="breadcrumbs"] a {
1519
- color: var(--color-neutral-600);
1703
+ color: var(--color-fg-muted);
1520
1704
  text-decoration: none;
1521
1705
  transition: color var(--motion-duration-fast) var(--motion-easing-standard);
1522
1706
  }
@@ -1570,7 +1754,7 @@ textarea[data-terp="input"] {
1570
1754
  min-height: 100vh;
1571
1755
  font-family: var(--font-family-sans);
1572
1756
  color: var(--color-neutral-900);
1573
- background: var(--color-neutral-50);
1757
+ background: var(--color-bg-canvas);
1574
1758
  }
1575
1759
  /* The sidebar. width is a rule now rather than an inline value chosen per render, which
1576
1760
  is what finally puts its transition inside terp.motion's reach: the aside carried no
@@ -1785,10 +1969,11 @@ textarea[data-terp="input"] {
1785
1969
  text-overflow: ellipsis;
1786
1970
  white-space: nowrap;
1787
1971
  }
1788
- /* Visually hidden, five elements, one rule. One is the skip link, which is the whole point of
1972
+ /* Visually hidden, one rule. One is the skip link, which is the whole point of
1789
1973
  the block for it: hidden at rest and un-hidden by a rule in terp.state. Two are the drawer's
1790
1974
  focus sentinels, which
1791
- must stay focusable and so cannot be display: none. The other two are the brand title
1975
+ must stay focusable and so cannot be display: none. Two are a figure's words for what its
1976
+ colours and its sparkline show (see Stat): read out, never drawn. The rest are the brand title
1792
1977
  and the nav labels in the icon rail, which were a style-object TERNARY before this —
1793
1978
  the component picked between two objects per render, and the collapsed branch was
1794
1979
  painted by nothing, because the rail state was internal and no specimen could reach it.
@@ -1796,6 +1981,10 @@ textarea[data-terp="input"] {
1796
1981
  [data-terp="appshell-skip-link"],
1797
1982
  [data-terp="drawer-focus-start"],
1798
1983
  [data-terp="drawer-focus-end"],
1984
+ [data-terp="stat-sentiment"],
1985
+ [data-terp="stat-trend-data"],
1986
+ [data-terp="chart-table"],
1987
+ [data-terp="status-history-data"],
1799
1988
  [data-terp="appshell-sidebar"][data-collapsed="true"] [data-terp="appshell-brand-title"],
1800
1989
  [data-terp="appshell-sidebar"][data-collapsed="true"] [data-terp="appshell-nav-label"],
1801
1990
  [data-terp="appshell-sidebar"][data-collapsed="true"] [data-terp="appshell-nav-group-label"] {
@@ -2093,174 +2282,108 @@ textarea[data-terp="input"] {
2093
2282
 
2094
2283
  align-items: center rather than baseline, because the row mixes a heading, pill badges and
2095
2284
  a button cluster: baseline alignment lines up the text and leaves the pills sitting low.
2096
- Wrapping is kept from the old heading row for the same reason it was there — a long title
2097
- meeting a wide action cluster takes a second line instead of overflowing — and the band
2098
- grows past its floor when it does. */
2285
+
2286
+ A WRAPPING FLEX LINE, and this is the third shape the band has had. It was a wrapping flex
2287
+ row first; ADR 0135 made it a grid of named areas, because a source-ordered wrap could not
2288
+ keep the meta group and the cluster as two groups and justify-content: space-between spread
2289
+ a wrapped cluster across the width. Both objections are answered here without areas:
2290
+ order puts the cluster straight after the trail and the meta group after both, and the
2291
+ cluster is ONE item pushed to the end by margin-inline-start: auto, so no free space is ever
2292
+ distributed among buttons.
2293
+
2294
+ What areas could not do is the reason for the change. "Beside the trail if it fits, under it
2295
+ if not" is a question about content, and a grid template answers it per viewport: above the
2296
+ first cutover the cluster stayed beside the trail however wide it was -- squeezing the trail
2297
+ to nothing, and with enough actions running past the window's edge -- and below it the
2298
+ cluster took a row of its own even when a single button would have fitted beside a short
2299
+ title. Reported on exactly the pages that have one action and one crumb: an overview's "New"
2300
+ button sitting alone under its title on a phone. A flex line wraps on what the items need:
2301
+ the cluster shares the trail's line when the WHOLE trail fits beside it, and when it does not
2302
+ it drops to a line of its own and wraps its own buttons there rather than pushing them off
2303
+ screen. */
2099
2304
  [data-terp="page-header"] {
2100
- display: grid;
2101
- grid-template-columns: minmax(0, 1fr) auto;
2102
- grid-template-areas: "trail actions";
2305
+ display: flex;
2306
+ flex-wrap: wrap;
2103
2307
  align-items: center;
2104
2308
  gap: var(--space-2) var(--space-4);
2105
2309
  min-width: 0;
2106
2310
  }
2107
- /* The two-row band. It used to move the action cluster onto the meta row at every width, on
2108
- the reasoning that a page with badges or a lead line ALREADY spends a second row, so the
2109
- cluster joining them costs no height and buys the trail the whole first row.
2110
-
2111
- The second half of that was never true, because the rule that gave the trail the first row
2112
- never matched (see the trail's own rule below). So the cluster was paying the whole price
2113
- and the trail collected none of it: measured on a 1280px viewport, an ordinary detail page
2114
- -- two crumbs, one badge, one button -- put the button on line two with 1028px of empty
2115
- room beside the trail on line one. That is what "the button wraps before the breadcrumb is
2116
- long" turns out to be, and it is width-independent: the same at 1440.
2117
-
2118
- So the cluster keeps its place beside the trail and the meta group takes the row below it,
2119
- which is also what the one-row band does and therefore one rule for where a page's actions
2120
- live rather than two. Below the first cutover the band becomes a single column instead --
2121
- there the cluster genuinely cannot share a line with the title, and the row it used to take
2122
- from the trail was squeezing the h1 to nothing.
2123
-
2124
- A grid rather than the flex-wrap this was: wrap order follows source order, so the meta
2125
- group and the cluster could not share a row while staying two groups, and the moment the
2126
- band did wrap justify-content: space-between had free space to distribute -- which
2127
- spread a page's buttons across the full width, or left-aligned a single cluster on a row
2128
- whose whole job was to right-align it. Areas say where things go and no free space is
2129
- distributed anywhere, so neither failure has anywhere to happen. */
2130
- [data-terp="page-header"][data-has-meta] {
2131
- /* auto, not 1fr. Equal-height lines read as one band of two lines, which is why they were
2132
- here -- but fr rows in an indefinite container resolve to the LARGEST row's content, so
2133
- the shorter line's item was centred in a track sized by the taller one and the taller
2134
- line's item filled its track exactly. With no block padding under it (the chrome row
2135
- spends none, by the invariant below) that put the bottom row flush against the band's
2136
- border: measured 9px above the content and 0px below it on every two-row page. Rows sized
2137
- to their content, plus the padding the multi-row band now spends, give 4px and 4px. */
2138
- grid-auto-rows: auto;
2139
- }
2140
- /* WHICH meta decides the row, not whether there is any. Badges show at every width, so a band
2141
- carrying one has its second row at every width. A lead line shows only above the SECOND
2142
- cutover (see page-description below), so a band whose only meta is a lead line has nothing
2143
- to put on that row anywhere beneath it -- and a grid row with nothing visible in it is still
2144
- a row. It was one: the empty meta group took a track, the band's row gap and the multi-row
2145
- band's block padding came with it, and the whole was stretched to the header floor. Measured
2146
- below the first cutover on a hub with a lead line, the title sat 6.8px above the centre of a
2147
- one-line band whose other line showed nothing at all.
2148
-
2149
- So Page stamps the kind (data-has-meta="badges" or "description"), and a description-only
2150
- band is a one-row band until the correction at the second cutover gives it its meta row --
2151
- the same mobile-first shape the lead line itself is written in. Its meta group is taken out
2152
- of flow there too, and not merely left empty: its grid-area names an area the one-row
2153
- template does not declare, and an item placed into a missing named area is not dropped but
2154
- given IMPLICIT lines, which is a new row after all. */
2311
+ /* WHICH meta decides whether it shows, not whether there is any. Badges show at every width.
2312
+ A lead line shows only above the SECOND cutover (see page-description below), so a band
2313
+ whose only meta is a lead line has nothing to put on its meta line anywhere beneath it -- and
2314
+ an empty flex item with a full-width basis is still a line, with the band's gap above it.
2315
+ Page stamps the kind (data-has-meta="badges" or "description"), and the description-only
2316
+ group is out of flow until the correction at the second cutover brings it back: the same
2317
+ mobile-first shape the lead line itself is written in. */
2155
2318
  [data-terp="page-header"][data-has-meta="description"] [data-terp="page-meta"] {
2156
2319
  display: none;
2157
2320
  }
2158
- @media ${WIDE_VIEWPORT_QUERY} {
2159
- [data-terp="page-header"][data-has-meta="badges"] {
2160
- grid-template-areas:
2161
- "trail actions"
2162
- "meta meta";
2163
- }
2164
- }
2165
2321
  @media ${ROOMY_VIEWPORT_QUERY} {
2166
- [data-terp="page-header"][data-has-meta="description"] {
2167
- grid-template-areas:
2168
- "trail actions"
2169
- "meta meta";
2170
- }
2171
2322
  [data-terp="page-header"][data-has-meta="description"] [data-terp="page-meta"] {
2172
2323
  display: flex;
2173
2324
  }
2174
2325
  }
2175
- /* Below the first cutover the band is one column and nothing competes for a line. The trail
2176
- keeps the leaf and one ancestor: every crumb carries min-width: 0 and an ellipsis while the
2177
- separators are flex: 0 0 auto, so a trail with no room does not degrade to short labels --
2178
- it degrades to a row of bare chevrons with the h1 among the casualties. Measured at 360px
2179
- on a six-crumb page: six labels under 8px, no page title on screen at all, and the cluster
2180
- overlapping the badges by 24px. Dropping the ancestors takes their separators with them,
2181
- which is the only degradation here that leaves something readable.
2182
-
2183
- The actions row is declared only when there IS a cluster -- :has() for the same reason
2184
- card-header and control-label use it, that the alternative is an attribute the component
2185
- would have to stamp. A named row with nothing in it is still a row, and with the band's
2186
- gap under it that is 8px of empty space wedged under the trail on every page that has no
2187
- actions. */
2326
+ /* Below the first cutover the trail keeps the leaf and one ancestor: every crumb carries
2327
+ min-width: 0 and an ellipsis while the separators are flex: 0 0 auto, so a trail with no
2328
+ room does not degrade to short labels -- it degrades to a row of bare chevrons with the h1
2329
+ among the casualties. Measured at 360px on a six-crumb page: six labels under 8px and no
2330
+ page title on screen at all. Dropping the ancestors takes their separators with them, which
2331
+ is the only degradation here that leaves something readable. */
2188
2332
  @media ${NARROW_VIEWPORT} {
2189
- [data-terp="page-header"] {
2190
- grid-template-columns: minmax(0, 1fr);
2191
- grid-template-areas: "trail";
2192
- }
2193
- [data-terp="page-header"]:has(> [data-terp="page-actions"]) {
2194
- grid-template-areas:
2195
- "trail"
2196
- "actions";
2197
- }
2198
- /* Written AFTER the :has() rule and not before it: the two selectors tie at (0,2,0), so
2199
- source order is what decides a page that carries meta and no cluster, and it belongs to
2200
- this one. The combined selector below outranks both at (0,3,0).
2201
-
2202
- Badges only: this whole block sits below the first cutover, where a lead line never
2203
- shows, so a description-only band keeps the rows it would have with no meta at all. */
2204
- [data-terp="page-header"][data-has-meta="badges"] {
2205
- grid-template-areas:
2206
- "trail"
2207
- "meta";
2208
- }
2209
- [data-terp="page-header"][data-has-meta="badges"]:has(> [data-terp="page-actions"]) {
2210
- grid-template-areas:
2211
- "trail"
2212
- "meta"
2213
- "actions";
2214
- }
2215
2333
  [data-terp="breadcrumbs"] li:not(:last-child):not(:nth-last-child(2)) {
2216
2334
  display: none;
2217
2335
  }
2218
2336
  [data-terp="breadcrumbs"] li:nth-last-child(2):not(:first-child)::before {
2219
2337
  content: "…";
2220
2338
  margin-inline-end: var(--space-2);
2221
- color: var(--color-neutral-600);
2339
+ color: var(--color-fg-muted);
2222
2340
  }
2223
2341
  }
2224
2342
  /* The band's left group, and it generates NO box. The trail and the meta group have to be
2225
- grid items of the band itself -- they sit on different rows -- but the marker is published
2226
- and a wrapper that boxed them would put them both in one cell. display: contents is the
2227
- sheet's existing answer to exactly that shape (see the markdown wrapper): the children
2228
- stay in flow as the grid's own items, and the marker survives for the scanner and for
2229
- anything reading the DOM.
2230
-
2231
- The flex basis this used to carry is gone with the box. What it bought -- a heading that
2232
- shrinks instead of pushing the cluster off the row -- is now the grid's minmax(0, 1fr)
2233
- first column, which does the same job by construction rather than by getting a flex
2234
- hypothetical size right. */
2343
+ items of the band itself -- the trail shares a line with the cluster and the meta group
2344
+ takes one of its own -- and a wrapper that boxed them would make them one item.
2345
+ display: contents keeps the marker for the scanner and for anything reading the DOM. */
2235
2346
  [data-terp="page-heading"] {
2236
2347
  display: contents;
2237
2348
  }
2238
- /* The trail's placement, and the combinator is the whole of it. This was a CHILD selector,
2239
- and the trail is not a child of the band: Page renders it inside page-heading, which is
2240
- display: contents. That removes the BOX and not the node, and selectors match the tree, so
2241
- the rule matched nothing at all and the trail was auto-placed with its automatic minimum
2242
- intact. Both halves below were therefore dead from the day the heading group arrived, and
2243
- the two-row band above was justified by a benefit this rule was supposed to deliver.
2244
-
2245
- Descendant, not child, and scoped to the band: page-header holds the heading group and the
2246
- cluster and nothing else, so there is no second trail here to catch by accident. */
2349
+ /* The trail: first, and growing into whatever the cluster leaves. Its basis is auto -- its own
2350
+ full width -- because that is what "fits" means: the cluster joins the trail's line only when
2351
+ the whole trail and the cluster fit on it together, so a short overview title keeps its "New"
2352
+ button beside it, and a title too long to share a line keeps the line and sends the cluster
2353
+ under it rather than being cut short to make room. A fixed claim was tried first (12rem) and
2354
+ answered the wrong question: at a phone's width it moved a single button off a one-word
2355
+ title, and at a desk's it truncated a title the cluster could have wrapped under.
2356
+ min-width: 0 so a trail longer than the whole line still ellipsises rather than widening it.
2357
+
2358
+ Descendant, not child: Page renders the trail inside page-heading, which is display:
2359
+ contents. That removes the box and not the node, and selectors match the tree -- a child
2360
+ selector here matched nothing for a release, and the trail kept its automatic minimum. */
2247
2361
  [data-terp="page-header"] [data-terp="breadcrumbs"] {
2248
- grid-area: trail;
2362
+ order: 1;
2363
+ flex: 1 1 auto;
2364
+ min-width: 0;
2365
+ }
2366
+ /* The cluster: one item, pushed to the line's end. It may shrink to the line it is on, and
2367
+ min-width: 0 is what lets it -- a flex item's automatic minimum is its content's, so a
2368
+ cluster wider than the window would otherwise refuse to shrink and run off the edge. Shrunk,
2369
+ its own flex-wrap (see page-actions) breaks its buttons onto further lines. */
2370
+ [data-terp="page-header"] > [data-terp="page-actions"] {
2371
+ order: 2;
2372
+ flex: 0 1 auto;
2249
2373
  min-width: 0;
2374
+ margin-inline-start: auto;
2250
2375
  }
2251
- /* Badges and the lead line, grouped so they share the second row as one left-hand item
2252
- rather than competing for cells with the cluster opposite them. */
2376
+ /* Badges and the lead line, grouped as one item with a full-line basis, so they always take a
2377
+ line of their own under the trail and the cluster rather than competing with either. */
2253
2378
  [data-terp="page-meta"] {
2254
- grid-area: meta;
2379
+ order: 3;
2380
+ flex: 1 1 100%;
2255
2381
  display: flex;
2256
2382
  flex-wrap: wrap;
2257
2383
  align-items: center;
2258
2384
  gap: var(--space-2) var(--space-3);
2259
2385
  min-width: 0;
2260
2386
  }
2261
- [data-terp="page-header"] > [data-terp="page-actions"] {
2262
- grid-area: actions;
2263
- }
2264
2387
  /* The lead line is desktop-only, and it is written as the correction rather than the rule:
2265
2388
  hidden at every width, shown again above the SECOND cutover. Mobile-first in the literal
2266
2389
  sense, and it is what lets the three regions come out of two queries (see ./breakpoints) —
@@ -2326,7 +2449,7 @@ textarea[data-terp="input"] {
2326
2449
  margin: 0;
2327
2450
  flex: 1 1 0;
2328
2451
  min-width: 0;
2329
- color: var(--color-fg-subtle);
2452
+ color: var(--color-fg-muted);
2330
2453
  font-size: var(--font-size-sm);
2331
2454
  overflow: hidden;
2332
2455
  white-space: nowrap;
@@ -2334,70 +2457,64 @@ textarea[data-terp="input"] {
2334
2457
  }
2335
2458
  /* The band's CHROME, which needs no shell above it and so is not gated on one. Its height
2336
2459
  and its border are what make the row a band rather than a title line, and they are correct
2337
- wherever Page renders — the workbench's specimen cards and the unit tests included. That
2338
- split is the repair of a real contradiction: these declarations used to sit inside the
2339
- shell-gated rule below while the comment claimed "standalone, the band is still a bordered
2340
- row at the header's height", which the rule made false and a test fifteen lines away in
2341
- styles.test.ts pinned as false. The three page-header specimens were pictures of a plain
2342
- flex row that the comment described as chrome.
2460
+ wherever Page renders — the workbench's specimen cards and the unit tests included.
2343
2461
 
2344
2462
  box-sizing: border-box so the floor counts the padding, matching appshell-header, whose
2345
- height this is reading. Without it the two are a padding apart and the "same height as the
2346
- header above it" claim is off by 1rem.
2347
-
2348
- padding-block is ZERO for the reason the app header's rule states in full, and this row is
2349
- where the symptom showed: with var(--space-2) a single action button beat the floor, so the
2350
- band was 53px on a page with actions and 48px on a page without — the one piece of chrome
2351
- whose entire promise is that it is the same height as the header above it, changing height
2352
- per page. var(--space-1) fixed that for the default control and not for the large one, which
2353
- is why this is zero rather than a step. It still grows past the floor when the row WRAPS, which is the
2354
- one case that should move it: a long title meeting a wide action cluster takes a second
2355
- line rather than overflowing, and a band that clipped its own title to keep a height would
2356
- be the worse trade.
2463
+ height this is reading. Without it the two are a padding apart.
2464
+
2465
+ ONE calc((var(--shell-header-height) - 1px - var(--density-control-min-height)) / 2), spent at the edges and between lines alike. Every line of the band is at least a
2466
+ control tall (the rule after this one), and the inset is what the header height leaves around
2467
+ one control, halved: (48px - 1px rule - 36px) / 2 = 5.5px at comfortable density. So a band
2468
+ of one line is inset + control + inset + rule = the header's 48px exactly, and every line it
2469
+ adds is a control and one more inset -- the second line as far from the first as the first is
2470
+ from the border. The two shapes before this each got half of that wrong: content-sized lines
2471
+ with 4px of padding crammed a multi-line band against its border, and lines a full 47px tall
2472
+ each stacked their centring space where two met, about 26px between the trail and the badges
2473
+ against 13px from the border.
2474
+
2475
+ On EVERY chrome band rather than on the kinds known to be multi-line, which is what the flex
2476
+ line changed: whether the cluster wraps depends on its content, and no selector can see that
2477
+ it did. Spent everywhere, a band that wraps for any reason gets the same inset, and a band
2478
+ that does not is the 48px it always was. The one price is the large control: 2.75rem plus the
2479
+ inset either side is 56px, so a band carrying a size="lg" button grows by 8px, where the
2480
+ zero padding this replaces held it at 48. A band's own actions are default size, and a page
2481
+ that chooses a large one has chosen a taller band.
2357
2482
 
2358
2483
  :not([data-measure="narrow"]) because a form is capped WITH its header (ADR 0098 §3) — a
2359
2484
  Save button a screen-width from its field is worse than one over it — so a form gets the
2360
- one-row band with no chrome at all: a title row, which is what it wants.
2485
+ band with no chrome at all: a title row, which is what it wants.
2361
2486
 
2362
2487
  padding-BLOCK only. The inline gutter belongs to the bleed below, because standalone there
2363
2488
  is nothing to bleed into and an inline pad with no negative margin would inset the band's
2364
- content from the body beneath it for no reason. */
2489
+ content from the body beneath it for no reason. The inset is written out rather than named:
2490
+ a custom property declared here is one the token sheet does not publish, which
2491
+ tokens.guard.test.ts refuses. */
2365
2492
  [data-terp="page"]:not([data-measure="narrow"]) > [data-terp="page-header"] {
2366
- padding-block: var(--space-0);
2493
+ padding-block: calc((var(--shell-header-height) - 1px - var(--density-control-min-height)) / 2);
2494
+ row-gap: calc((var(--shell-header-height) - 1px - var(--density-control-min-height)) / 2);
2367
2495
  min-height: var(--shell-header-height);
2368
2496
  box-sizing: border-box;
2369
2497
  border-block-end: 1px solid var(--color-neutral-200);
2370
2498
  }
2371
- /* The block padding the ONE-ROW band cannot have, spent on the bands that are already more
2372
- than one row. The rule above stays at var(--space-0) and stays tied to the app header's
2373
- own padding, because that row is the one making the claim: 48px, the same as the header
2374
- above it, and the largest control this package ships (2.75rem) has to fit inside it. A band
2375
- that carries meta has broken that height already and makes no such claim, so it can afford
2376
- the 4px — and it is the only band where the missing padding was ever visible, since the
2377
- one-row band centres its single line inside the floor and reads as padded either way.
2378
- Below the cutover the same is true of a band whose cluster has taken a row of its own.
2379
-
2380
- The narrow rule weighs (0,3,0) plus :has()'s argument, so (0,4,0) — the same as the meta
2381
- rule, and they declare the same value, so the tie decides nothing.
2382
-
2383
- A description-only band is multi-row only above the second cutover (see the meta-kind rule
2384
- near the top of the band), so that is the only width it spends this padding at. Below it
2385
- the band is one row and holds the floor like any other: spending 4px + 4px there is exactly
2386
- what pushed a lone title off the centre of a band with nothing else in it. */
2387
- [data-terp="page"]:not([data-measure="narrow"]) > [data-terp="page-header"][data-has-meta="badges"] {
2388
- padding-block: var(--space-1);
2499
+ /* The trail's line and the cluster's are at least a control tall, so the trail alone is the
2500
+ same height as a line holding the cluster, and centres in it. The trail's own list is centred
2501
+ inside it by making the nav a flex box here; outside the band a trail is just the list. */
2502
+ [data-terp="page"]:not([data-measure="narrow"]) > [data-terp="page-header"] [data-terp="breadcrumbs"],
2503
+ [data-terp="page"]:not([data-measure="narrow"]) > [data-terp="page-header"] > [data-terp="page-actions"] {
2504
+ min-height: var(--density-control-min-height);
2389
2505
  }
2390
- @media ${ROOMY_VIEWPORT_QUERY} {
2391
- [data-terp="page"]:not([data-measure="narrow"])
2392
- > [data-terp="page-header"][data-has-meta="description"] {
2393
- padding-block: var(--space-1);
2394
- }
2506
+ /* The meta line -- badges, the lead sentence -- is not a control's line. It takes its own height
2507
+ and sits directly under the line above it, the band's gap cancelled, and keeps --space-2 under
2508
+ it: with the band's inset that is the room the title has above its ink, so the band reads as a
2509
+ title and its subtitle and neither hugs a border. As a control-tall line of its own, the lead
2510
+ sentence sat 42px under a 14px title, in a band nearly twice the header's height. */
2511
+ [data-terp="page"]:not([data-measure="narrow"]) > [data-terp="page-header"] [data-terp="page-meta"] {
2512
+ margin-block-start: calc((var(--shell-header-height) - 1px - var(--density-control-min-height)) / -2);
2513
+ padding-block-end: var(--space-2);
2395
2514
  }
2396
- @media ${NARROW_VIEWPORT} {
2397
- [data-terp="page"]:not([data-measure="narrow"])
2398
- > [data-terp="page-header"]:has(> [data-terp="page-actions"]) {
2399
- padding-block: var(--space-1);
2400
- }
2515
+ [data-terp="page"]:not([data-measure="narrow"]) > [data-terp="page-header"] [data-terp="breadcrumbs"] {
2516
+ display: flex;
2517
+ align-items: center;
2401
2518
  }
2402
2519
  /* The BLEED, which does need a shell, because the negative-margin idiom is only correct when
2403
2520
  the box being escaped is appshell-main and that box pads by exactly --shell-gutter. ADR
@@ -2405,9 +2522,10 @@ textarea[data-terp="input"] {
2405
2522
  keying this half on the shell is what keeps it: standalone the band is the same bordered
2406
2523
  row at the same height, it simply does not reach past its container.
2407
2524
 
2408
- The surface comes with the bleed rather than with the chrome, and that is deliberate under
2409
- 0.14.0's surface model: a block paints no fill of its own, and this one is only chrome —
2410
- the app header's companion — once there is an app header above it to pair with.
2525
+ The fill comes with the bleed rather than with the chrome, and that is deliberate: this band
2526
+ is only chrome — the app header's companion — once there is an app header above it to pair
2527
+ with. Chrome sits on --color-bg-subtle, the container rung of ADR 0169's surface ladder, so
2528
+ the band steps back from the white app header above it and from the data below it.
2411
2529
 
2412
2530
  ONE rule for both variants, which is the payoff of the token rather than a tidy-up. As two
2413
2531
  literals this needed a mobile twin, and a negative margin whose sign has to agree with a
@@ -2418,7 +2536,55 @@ textarea[data-terp="input"] {
2418
2536
  > [data-terp="page-header"] {
2419
2537
  margin: calc(-1 * var(--shell-gutter)) calc(-1 * var(--shell-gutter)) 0;
2420
2538
  padding-inline: var(--shell-gutter);
2421
- background: var(--color-neutral-0);
2539
+ background: var(--color-bg-subtle);
2540
+ }
2541
+ /* The summary band (ADR 0169 §4): the page's own figures, directly under the band that names
2542
+ the page, so what the page is about is the first thing read after its name.
2543
+
2544
+ The fill is --color-bg-summary, a token of its own because the record leaves the fill to the
2545
+ theme: each palette ships it at the brand's soft tint, and an app that wants a calmer band
2546
+ moves that one token without moving the tint the hub tiles and the selected states share.
2547
+ The text it carries is declared against it in token-pairs.json.
2548
+
2549
+ A wrapping flex line. A group of figures takes whatever the line has, a lone figure stays
2550
+ near its own measure beside it -- the grow factors are what say so, 999 against 1 -- and a
2551
+ line of text takes a line of its own. Standalone (the workbench, a narrow form) it is a
2552
+ rounded block on the page; inside a shell it bleeds to the content column's edges as the
2553
+ band above it does, flush against that band's border by cancelling the page's own gap.
2554
+
2555
+ Its items hang from the top, and a lone figure takes the block padding a group's cells do,
2556
+ so every label in the band reads on one line and every value on the next. Centred, a
2557
+ headline tile with a sparkline set the group beside it 20px lower than its own label. */
2558
+ [data-terp="page-summary"] {
2559
+ display: flex;
2560
+ flex-wrap: wrap;
2561
+ align-items: flex-start;
2562
+ gap: var(--space-4) var(--space-6);
2563
+ min-width: 0;
2564
+ padding: var(--space-5) var(--space-4);
2565
+ box-sizing: border-box;
2566
+ border-radius: var(--radius-lg);
2567
+ background: var(--color-bg-summary);
2568
+ color: var(--color-fg-default);
2569
+ }
2570
+ [data-terp="page-summary"] > [data-terp="stat-group"] {
2571
+ flex: 999 1 24rem;
2572
+ }
2573
+ [data-terp="page-summary"] > [data-terp="stat"] {
2574
+ flex: 1 1 14rem;
2575
+ max-inline-size: 22rem;
2576
+ padding: var(--space-3) var(--space-4);
2577
+ }
2578
+ [data-terp="page-summary"] > [data-terp="text"] {
2579
+ flex: 1 1 100%;
2580
+ }
2581
+ [data-terp="appshell-main"]
2582
+ > [data-terp="page"]:not([data-measure="narrow"])
2583
+ > [data-terp="page-summary"] {
2584
+ margin: calc(-1 * var(--space-4)) calc(-1 * var(--shell-gutter)) 0;
2585
+ padding-inline: var(--shell-gutter);
2586
+ border-radius: 0;
2587
+ border-block-end: 1px solid var(--color-neutral-200);
2422
2588
  }
2423
2589
  /* The content measure, and the subheader band, which are ONE declaration rather than two
2424
2590
  features (ADR 0097 §2). A full-width band only means anything once the column beside it is
@@ -2444,7 +2610,9 @@ textarea[data-terp="input"] {
2444
2610
  never asked for, silently. The frame's own header is the only thing meant to span the track,
2445
2611
  and the marker says so. (The layout contract's runtime check still drops the header by TAG
2446
2612
  name, because that check runs where no marker is guaranteed; the two mechanisms answer
2447
- different questions and only this one is a style.)
2613
+ different questions and only this one is a style.) The summary band is the frame's too, and
2614
+ spans the track for the same reason; a selector list inside the one :not() counts as its
2615
+ most specific argument, so naming it leaves the weight below where it was.
2448
2616
 
2449
2617
  And no backticks in this block, which is not a style note: a backtick here TERMINATES
2450
2618
  TERP_STYLES_CSS and the parse fails somewhere else entirely with "try inserting a
@@ -2472,7 +2640,7 @@ textarea[data-terp="input"] {
2472
2640
  still wins with it. min() rather than a bare token so a track narrower than the measure is
2473
2641
  untouched rather than overflowing. */
2474
2642
  [data-terp="appshell"][data-content-width="measured"]
2475
- [data-terp="page"] > *:not([data-terp="page-header"]) {
2643
+ [data-terp="page"] > *:not([data-terp="page-header"], [data-terp="page-summary"]) {
2476
2644
  width: min(100%, var(--shell-content-max-width));
2477
2645
  }
2478
2646
  /* The reach-through, for the one body child that generates no box of its own. Markdown is
@@ -2488,6 +2656,130 @@ textarea[data-terp="input"] {
2488
2656
  width: min(100%, var(--shell-content-max-width));
2489
2657
  }
2490
2658
 
2659
+ /* The sequence bar (ADR 0168) ---------------------------------------------- */
2660
+ /* A page's previous and next neighbours and its place among them, rendered by Page after its
2661
+ article when the page is given a sequence. The band at the top says where the page is; this
2662
+ bar at the bottom says what comes before and after it.
2663
+
2664
+ STICKY, and that is the reason it exists rather than a row of buttons under the body. A row
2665
+ placed after the content sits wherever the content ends, so stepping through a series moved
2666
+ the control on every page — a long record put "next" below the fold, a short one put it
2667
+ halfway up the screen — and the reader had to find it again each time. Pinned to the bottom
2668
+ it is in one place for the whole series.
2669
+
2670
+ THREE CELLS, always rendered: an absent neighbour leaves its cell empty, so "next" is at the
2671
+ same spot on the first page as on the fortieth. The outer two are minmax(0, 1fr), which is
2672
+ what lets a long neighbour name truncate inside its half instead of pushing the position
2673
+ off centre.
2674
+
2675
+ A surface of its own, which a block in this sheet does not usually paint: content scrolls
2676
+ UNDER a sticky bar, so a transparent one would print the body through itself. The same fill
2677
+ and border the band at the top carries — --color-bg-subtle, the chrome rung of ADR 0169's
2678
+ surface ladder — so the two read as one frame around the body.
2679
+
2680
+ The safe-area inset is the phone's home indicator: max() keeps the ordinary padding where
2681
+ there is none and clears the indicator where there is. */
2682
+ [data-terp="page-sequence"] {
2683
+ position: sticky;
2684
+ bottom: 0;
2685
+ z-index: var(--z-index-sticky);
2686
+ display: grid;
2687
+ grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
2688
+ align-items: center;
2689
+ gap: var(--space-3);
2690
+ margin-block-start: var(--space-4);
2691
+ padding-block: var(--space-2) max(var(--space-2), env(safe-area-inset-bottom));
2692
+ border-block-start: 1px solid var(--color-neutral-200);
2693
+ background: var(--color-bg-subtle);
2694
+ font-size: var(--font-size-sm);
2695
+ }
2696
+ [data-terp="page-sequence-previous"],
2697
+ [data-terp="page-sequence-next"] {
2698
+ display: flex;
2699
+ min-width: 0;
2700
+ }
2701
+ [data-terp="page-sequence-next"] {
2702
+ justify-content: flex-end;
2703
+ }
2704
+ [data-terp="page-sequence-position"] {
2705
+ color: var(--color-fg-subtle);
2706
+ white-space: nowrap;
2707
+ font-variant-numeric: tabular-nums;
2708
+ }
2709
+ /* The links read as the ghost button they sit beside in every other toolbar — same height,
2710
+ same ink, same wash on hover (terp.state) — while staying links, which is the half a button
2711
+ could not be: a step to a sibling page is a navigation, so it opens in a new tab on a
2712
+ middle-click like any other link. Child selectors from the marked cells rather than a marker
2713
+ on the anchor, because the anchor is the router's: a renderer that forwards no attributes
2714
+ would otherwise leave the bar unstyled with no error, which is the reason Link's marker is
2715
+ on a wrapper too. */
2716
+ [data-terp="page-sequence-previous"] > a,
2717
+ [data-terp="page-sequence-next"] > a {
2718
+ display: inline-flex;
2719
+ align-items: center;
2720
+ gap: var(--space-1);
2721
+ max-width: 100%;
2722
+ min-height: var(--density-control-min-height);
2723
+ padding: 0 var(--space-2);
2724
+ border-radius: var(--radius-md);
2725
+ box-sizing: border-box;
2726
+ color: var(--color-neutral-700);
2727
+ font-weight: var(--font-weight-medium);
2728
+ text-decoration: none;
2729
+ }
2730
+ [data-terp="page-sequence-label"] {
2731
+ min-width: 0;
2732
+ overflow: hidden;
2733
+ text-overflow: ellipsis;
2734
+ white-space: nowrap;
2735
+ }
2736
+ /* A narrow frame caps the bar with it, as it caps its own band (ADR 0098 §3). */
2737
+ [data-terp="page"][data-measure="narrow"] + [data-terp="page-sequence"] {
2738
+ max-width: 32rem;
2739
+ }
2740
+ /* Inside a shell the bar has to be at the BOTTOM of the content column even when the page is
2741
+ short, or a short page and a long one put it in different places and the bar has fixed
2742
+ nothing. appshell-main already fills the column — the shell is at least the viewport's
2743
+ height and main grows to fill what the header and footer leave — so the page only has to
2744
+ take up the rest of main, and that needs main to be a flex column.
2745
+
2746
+ Scoped to a main that HAS a bar, with :has(), so no other page changes at all: a page with
2747
+ no sequence keeps main as the block it has always been. Inside the scope the article is a
2748
+ flex item of a column container, which stretches it across main exactly as block layout did
2749
+ (stretch fills the cross axis; the automatic minimum size applies to the main axis only),
2750
+ and flex-grow gives it the free height.
2751
+
2752
+ The bar then bleeds through main's padding to the column's edges, by the same gutter the
2753
+ band at the top bleeds by, so the frame's bottom edge lines up with its top one. Bottom too,
2754
+ so a bar at rest and a bar pinned to the viewport sit on the same line rather than a gutter
2755
+ apart. A narrow frame keeps its cap and takes only the bottom bleed. */
2756
+ [data-terp="appshell-main"]:has(> [data-terp="page-sequence"]) {
2757
+ display: flex;
2758
+ flex-direction: column;
2759
+ }
2760
+ [data-terp="appshell-main"] > [data-terp="page"]:has(+ [data-terp="page-sequence"]) {
2761
+ flex-grow: 1;
2762
+ }
2763
+ [data-terp="appshell-main"] > [data-terp="page-sequence"] {
2764
+ margin-block-end: calc(-1 * var(--shell-gutter));
2765
+ }
2766
+ [data-terp="appshell-main"]
2767
+ > [data-terp="page"]:not([data-measure="narrow"])
2768
+ + [data-terp="page-sequence"] {
2769
+ margin-inline: calc(-1 * var(--shell-gutter));
2770
+ padding-inline: var(--shell-gutter);
2771
+ }
2772
+ /* A bar pinned over the bottom of the viewport can cover what the browser just scrolled into
2773
+ view: tab to the last field of a long form and the field lands behind the bar (WCAG 2.2 SC
2774
+ 2.4.11, focus not obscured). Scroll padding at the bottom of the document — its scroll
2775
+ container, see the gutter rule on html — keeps a focused or scrolled-to element above it.
2776
+ The bar's own height, from the tokens it is built of: a control, its two paddings and the
2777
+ border. The root's control height, which is the comfortable one and so never the shorter of
2778
+ the two densities. */
2779
+ html:has([data-terp="page-sequence"]) {
2780
+ scroll-padding-block-end: calc(var(--density-control-min-height) + 2 * var(--space-2) + 1px);
2781
+ }
2782
+
2491
2783
  /* The split archetype ------------------------------------------------------ */
2492
2784
  /* A list beside the record it selects. Mobile-first: one column, list first, so the tab
2493
2785
  sequence is the reading order in both layouts and the stacked case needs no rule at all.
@@ -2543,7 +2835,7 @@ textarea[data-terp="input"] {
2543
2835
  display: grid;
2544
2836
  place-items: center;
2545
2837
  padding: var(--space-6);
2546
- background: var(--color-neutral-50);
2838
+ background: var(--color-bg-canvas);
2547
2839
  font-family: var(--font-family-sans);
2548
2840
  color: var(--color-neutral-900);
2549
2841
  }
@@ -2619,7 +2911,7 @@ textarea[data-terp="input"] {
2619
2911
  gap: var(--space-4);
2620
2912
  padding: var(--space-4);
2621
2913
  max-width: 32rem;
2622
- background: var(--color-bg-surface);
2914
+ background: var(--color-bg-subtle);
2623
2915
  border: 1px solid var(--color-neutral-200);
2624
2916
  border-radius: var(--radius-lg);
2625
2917
  }
@@ -2659,7 +2951,7 @@ textarea[data-terp="input"] {
2659
2951
  }
2660
2952
  [data-terp="profile-role"] {
2661
2953
  margin: 0;
2662
- color: var(--color-neutral-600);
2954
+ color: var(--color-fg-muted);
2663
2955
  }
2664
2956
 
2665
2957
  /* The built-in admin screens ----------------------------------------------- */
@@ -2677,10 +2969,11 @@ textarea[data-terp="input"] {
2677
2969
  [data-terp="admin-form"] {
2678
2970
  max-width: 32rem;
2679
2971
  }
2680
- /* A section heading inside a detail screen: the members list, the permission
2681
- grants. font-size-base rather than the UA default, which for an h2 is LARGER than
2682
- the page's own h1 at font-size-lg — so without this a section outranks the view
2683
- it sits in. */
2972
+ /* A section heading inside a detail screen: the access a person or a group holds per
2973
+ module. An h3, the level a Card's title and a titled collection take, so the sections of
2974
+ one screen sit at one level of its outline. font-size-base rather than the UA default for a
2975
+ heading, which is larger than the page's own title -- so without this a section outranks
2976
+ the view it sits in. */
2684
2977
  [data-terp="admin-section-title"] {
2685
2978
  margin: 0;
2686
2979
  font-size: var(--font-size-base);
@@ -2762,7 +3055,7 @@ textarea[data-terp="input"] {
2762
3055
  height: 100%;
2763
3056
  min-height: 10rem;
2764
3057
  padding: var(--space-4);
2765
- background: var(--color-bg-surface);
3058
+ background: var(--color-bg-subtle);
2766
3059
  border: 1px solid var(--color-neutral-200);
2767
3060
  border-radius: var(--radius-lg);
2768
3061
  box-shadow: var(--shadow-sm);
@@ -2802,7 +3095,7 @@ textarea[data-terp="input"] {
2802
3095
  /* neutral-600 rather than fg-muted, and it is not the tinted-surface case: this text
2803
3096
  sits on the card's own neutral-0 and measures 7.58 / 7.94 / 7.50 / 7.60 / 18.42. */
2804
3097
  [data-terp="hubcard-description"] {
2805
- color: var(--color-neutral-600);
3098
+ color: var(--color-fg-muted);
2806
3099
  font-size: var(--font-size-sm);
2807
3100
  line-height: 1.5;
2808
3101
  }
@@ -2828,6 +3121,23 @@ textarea[data-terp="input"] {
2828
3121
  [data-terp="hubcard-stat"][data-empty="true"] {
2829
3122
  visibility: hidden;
2830
3123
  }
3124
+ /* A list none of whose cards carries a figure keeps no figure row. The placeholder is there so
3125
+ a bare card stays flush with a full one beside it; with no full one there is nothing to stay
3126
+ flush with, and the row and the 10rem floor it helped pad out were blank space at the foot
3127
+ of every card — the admin hub's areas under its figures, an app's landing before its first
3128
+ figure. The cards in a row still share a height: the grid stretches them, and the
3129
+ description's track takes the slack. */
3130
+ :is(ul, ol):not(:has([data-terp="hubcard-stat"]:not([data-empty="true"])))
3131
+ > [data-terp="hubcard"]
3132
+ [data-terp="hubcard-body"] {
3133
+ grid-template-rows: auto 1fr;
3134
+ min-height: 0;
3135
+ }
3136
+ :is(ul, ol):not(:has([data-terp="hubcard-stat"]:not([data-empty="true"])))
3137
+ > [data-terp="hubcard"]
3138
+ [data-terp="hubcard-stat"] {
3139
+ display: none;
3140
+ }
2831
3141
 
2832
3142
  /* DataView: the composition root ------------------------------------------- */
2833
3143
  /* One display for both return paths, so it belongs on the bare marker rather than
@@ -2874,10 +3184,12 @@ textarea[data-terp="input"] {
2874
3184
  leaves the toolbar inside a surface, and leaves two nested frames whenever the view
2875
3185
  is empty (the empty state's dashed frame inside the card's solid one).
2876
3186
 
2877
- What the slot carries is now a FRAME rather than a fill — border and radius, with the
2878
- page showing through, per the card rule's note on the surface model. That changes the
2879
- sentence above by one word and not the ownership it settles: the frame is the table's,
2880
- not the view's.
3187
+ What the slot carries is the surface itself — a fill, a border and a radius — and the
3188
+ page's one raised shadow. The collection is where data is read, so under ADR 0169's
3189
+ surface ladder it keeps --color-bg-surface while the containers around it step back to
3190
+ --color-bg-subtle, and --shadow-md lifts it above them: the table is the brightest object
3191
+ on the page by rule. None of that moves the ownership settled above: the frame is the
3192
+ table's, not the view's.
2881
3193
 
2882
3194
  Keyed on [data-variant="full"] rather than the bare marker for the reason the
2883
3195
  previous rule gave and which still holds: [data-variant="embedded"] must declare
@@ -2889,6 +3201,7 @@ textarea[data-terp="input"] {
2889
3201
  background: var(--color-bg-surface);
2890
3202
  border: 1px solid var(--color-neutral-200);
2891
3203
  border-radius: var(--radius-lg);
3204
+ box-shadow: var(--shadow-md);
2892
3205
  }
2893
3206
  /* The horizontal scroll container the reset's scrollbar comment already names. A
2894
3207
  marker rather than [data-terp="dataview"] > div, which also matches the toolbar.
@@ -3134,13 +3447,9 @@ input[data-terp="input"][type="password"]::-ms-reveal {
3134
3447
  gap: var(--space-1);
3135
3448
  }
3136
3449
  /* The two toggles at rest, which is to say INACTIVE. 2rem stays a literal, pager
3137
- reasoning. Their border is the neutral-300 control boundary, which measures
3138
- 1.42-2.36:1 across the surfaces a bordered control sits on in four themes — below
3139
- the 3:1 SC 1.4.11 asks of a control boundary. Still not fixed here, because a token
3140
- clearing 3:1 repaints every bordered control in the package, but no longer only a
3141
- sentence: control-boundary-on-surface and control-boundary-on-canvas are declared
3142
- pairings held at their measured floors by BELOW_UI in tokens.contrast.test.js, so
3143
- the debt can only shrink and emptying that table is the acceptance criterion. */
3450
+ reasoning. Their border is the control boundary every bordered control shares,
3451
+ --color-border-strong, which control-boundary-on-surface and control-boundary-on-canvas
3452
+ in token-pairs.json hold at the 3:1 SC 1.4.11 asks of it in every theme. */
3144
3453
  [data-terp="dataview-toolbar-layout"] > [data-terp="iconbutton"] {
3145
3454
  display: inline-flex;
3146
3455
  align-items: center;
@@ -3148,7 +3457,7 @@ input[data-terp="input"][type="password"]::-ms-reveal {
3148
3457
  min-height: 2rem;
3149
3458
  padding: var(--space-1) var(--space-2);
3150
3459
  background: transparent;
3151
- border: 1px solid var(--color-neutral-300);
3460
+ border: 1px solid var(--color-border-strong);
3152
3461
  border-radius: var(--radius-md);
3153
3462
  cursor: pointer;
3154
3463
  color: var(--color-fg-subtle);
@@ -3374,11 +3683,17 @@ th[data-terp="dataview-actions-cell"] > span {
3374
3683
  /* DataView: the card layout ------------------------------------------------ */
3375
3684
  /* The responsive stand-in for a row, so it reads the same cell-padding tokens:
3376
3685
  a card IS the row's padding, and having compact tighten the table while
3377
- leaving the cards alone would make the attribute mean two things. */
3686
+ leaving the cards alone would make the attribute mean two things.
3687
+
3688
+ The list has NO padding of its own. It is a direct child of the view, beside the toolbar
3689
+ and the pagination -- not inside the table's frame -- so the space-2 it used to carry inset
3690
+ every card 8px from the edge the toolbar, the pagination and the table frame all sit on.
3691
+ Measured at a phone width: toolbar 16-394px, cards 24-386px. The cards are the frame in
3692
+ this layout, so their edge is the one that lines up. */
3378
3693
  [data-terp="dataview-card-list"] {
3379
3694
  list-style: none;
3380
3695
  margin: 0;
3381
- padding: var(--space-2);
3696
+ padding: 0;
3382
3697
  display: grid;
3383
3698
  gap: var(--space-2);
3384
3699
  }
@@ -3448,12 +3763,21 @@ th[data-terp="dataview-actions-cell"] > span {
3448
3763
  [data-terp="dataview-card-title"] {
3449
3764
  font-weight: var(--font-weight-medium);
3450
3765
  }
3766
+ /* The status slot is a PLACE, not a pill. It used to wear one -- a neutral-100 fill, space-2
3767
+ of inline padding and a full radius -- around whatever the status column rendered, and what
3768
+ a status column renders is usually a Badge, which is a pill already: so the card showed a
3769
+ badge inside a slightly wider grey capsule, and a slot carrying a badge AND a date (one cell,
3770
+ two things) put both in it. The fill could only ever be seen as that stray margin.
3771
+
3772
+ Bare now: the column's own content decides how it looks. Plain text still reads as
3773
+ secondary, at the size it had, in --color-fg-muted rather than the neutral-700 it sat in on
3774
+ its own fill: without that fill the text lands on whichever tone wash the card took, and
3775
+ fg-muted is the ink declared and measured against all five (see the meta rule below). */
3451
3776
  [data-terp="dataview-card-status"] {
3777
+ display: inline-flex;
3778
+ align-items: center;
3452
3779
  font-size: var(--font-size-sm);
3453
- padding: 0 var(--space-2);
3454
- background: var(--color-neutral-100);
3455
- border-radius: var(--radius-full);
3456
- color: var(--color-neutral-700);
3780
+ color: var(--color-fg-muted);
3457
3781
  }
3458
3782
  /* Subtitle and date share one name because they share every declaration. Two
3459
3783
  markers would suggest the sheet distinguishes them, and it does not.
@@ -3560,7 +3884,7 @@ th[data-terp="dataview-actions-cell"] > span {
3560
3884
  min-height: 2rem;
3561
3885
  padding: var(--space-1) var(--space-2);
3562
3886
  background: var(--color-neutral-0);
3563
- border: 1px solid var(--color-neutral-300);
3887
+ border: 1px solid var(--color-border-strong);
3564
3888
  border-radius: var(--radius-md);
3565
3889
  cursor: pointer;
3566
3890
  color: var(--color-neutral-700);
@@ -3593,7 +3917,7 @@ th[data-terp="dataview-actions-cell"] > span {
3593
3917
  gap: var(--space-1);
3594
3918
  padding: var(--space-1) var(--space-2);
3595
3919
  background: transparent;
3596
- border: 1px solid var(--color-neutral-300);
3920
+ border: 1px solid var(--color-border-strong);
3597
3921
  border-radius: var(--radius-md);
3598
3922
  cursor: pointer;
3599
3923
  color: var(--color-neutral-700);
@@ -3691,7 +4015,7 @@ th[data-terp="dataview-actions-cell"] > span {
3691
4015
  color: var(--color-status-danger);
3692
4016
  }
3693
4017
  [data-terp="resource-list-empty"] {
3694
- color: var(--color-neutral-600);
4018
+ color: var(--color-fg-muted);
3695
4019
  }
3696
4020
  [data-terp="resource-list-items"] {
3697
4021
  list-style: none;
@@ -3723,7 +4047,7 @@ th[data-terp="dataview-actions-cell"] > span {
3723
4047
  gap: var(--space-3);
3724
4048
  padding: var(--space-8) var(--space-6);
3725
4049
  text-align: center;
3726
- color: var(--color-neutral-600);
4050
+ color: var(--color-fg-muted);
3727
4051
  background: var(--color-bg-surface);
3728
4052
  border: 1px dashed var(--color-neutral-300);
3729
4053
  border-radius: var(--radius-lg);
@@ -3757,7 +4081,7 @@ th[data-terp="dataview-actions-cell"] > span {
3757
4081
  font-weight: var(--font-weight-semibold);
3758
4082
  }
3759
4083
  [data-terp="empty-state-description"] {
3760
- color: var(--color-neutral-600);
4084
+ color: var(--color-fg-muted);
3761
4085
  font-size: var(--font-size-sm);
3762
4086
  line-height: 1.5;
3763
4087
  max-width: 36ch;
@@ -3875,7 +4199,7 @@ input[data-terp="input"][role="combobox"] {
3875
4199
  align-items: center;
3876
4200
  gap: var(--space-1);
3877
4201
  padding: var(--space-1);
3878
- border: 1px solid var(--color-neutral-300);
4202
+ border: 1px solid var(--color-border-strong);
3879
4203
  border-radius: var(--radius-md);
3880
4204
  background: var(--color-neutral-0);
3881
4205
  }
@@ -3911,7 +4235,7 @@ input[data-terp="input"][role="combobox"] {
3911
4235
  min-inline-size: var(--space-4);
3912
4236
  min-block-size: var(--space-4);
3913
4237
  padding: 0;
3914
- color: var(--color-neutral-600);
4238
+ color: var(--color-fg-muted);
3915
4239
  background: transparent;
3916
4240
  border: none;
3917
4241
  border-radius: var(--radius-sm);
@@ -4016,7 +4340,7 @@ button[data-terp="input"][data-placeholder="true"] {
4016
4340
  justify-content: center;
4017
4341
  width: 2rem;
4018
4342
  height: 2rem;
4019
- border: 1px solid var(--color-neutral-300);
4343
+ border: 1px solid var(--color-border-strong);
4020
4344
  border-radius: var(--radius-md);
4021
4345
  background: transparent;
4022
4346
  color: var(--color-neutral-700);
@@ -4081,10 +4405,19 @@ button[data-terp="input"][data-placeholder="true"] {
4081
4405
 
4082
4406
  /* Fields ------------------------------------------------------------------- */
4083
4407
  [data-terp="field"],
4084
- [data-terp="field-label"] {
4408
+ [data-terp="field-label"],
4409
+ [data-terp="field-body"] {
4085
4410
  display: grid;
4086
4411
  gap: var(--space-1);
4087
4412
  }
4413
+ /* The body holds its control at the control's own height. Where fields share lines, a body is
4414
+ stretched to the tallest body on its line -- a neighbour's control AND its hint -- and its
4415
+ grid track stretched with it, so a field with no hint grew a control half again as tall as
4416
+ the one beside it. align-content: start keeps the tracks their content's height and leaves
4417
+ the spare space below, where a hint would have been. */
4418
+ [data-terp="field-body"] {
4419
+ align-content: start;
4420
+ }
4088
4421
  [data-terp="field-label-text"] {
4089
4422
  font-weight: var(--font-weight-medium);
4090
4423
  font-size: var(--font-size-sm);
@@ -4111,7 +4444,7 @@ button[data-terp="input"][data-placeholder="true"] {
4111
4444
  justify-items: start;
4112
4445
  }
4113
4446
  [data-terp="field-hint"] {
4114
- color: var(--color-fg-subtle);
4447
+ color: var(--color-fg-muted);
4115
4448
  font-size: var(--font-size-xs);
4116
4449
  }
4117
4450
  [data-terp="field-error"] {
@@ -4244,6 +4577,13 @@ button[data-terp="input"][data-placeholder="true"] {
4244
4577
  border-radius: var(--radius-full);
4245
4578
  background: var(--color-bg-inset);
4246
4579
  }
4580
+ /* In a table cell the measure is shorter, and still one measure for the whole column, so its
4581
+ bars compare as any meters do. An automatic table layout sizes a column from what its cells
4582
+ cannot shrink below, and a 10rem bar beside its value made a bar column some 13rem wide
4583
+ however narrow it was declared -- the names and identifiers beside it wrapped to make room. */
4584
+ [data-terp="dataview-table"] td [data-terp="meter-bar"] {
4585
+ inline-size: 6rem;
4586
+ }
4247
4587
  /* Blink draws the track and the fill as pseudo-elements, one per region, and this is the
4248
4588
  block the screenshot lane sees; WebKit documents the same pseudo-elements, and no lane runs
4249
4589
  it. Each engine's selectors are their own rules and must
@@ -4308,31 +4648,692 @@ button[data-terp="input"][data-placeholder="true"] {
4308
4648
  white-space: nowrap;
4309
4649
  }
4310
4650
 
4311
- /* Tooltips ----------------------------------------------------------------- */
4312
- /* No display declaration here on purpose: the panel is hidden with the hidden
4313
- attribute, and any author display would beat the UA's [hidden] rule and
4314
- leave the tooltip permanently visible. */
4315
- [data-terp="tooltip-anchor"] {
4316
- position: relative;
4317
- display: inline-flex;
4651
+ /* Charts (ADR 0158, ADR 0169 §6) -------------------------------------------- */
4652
+ /* A chart is a tile on the surface, the rung where data is read, as a figure is: the surface,
4653
+ its hairline and its small shadow. Every mark is SVG geometry in attributes and every colour
4654
+ is a rule here, keyed on the markers and on data-series / data-tone, so nothing is styled
4655
+ inline. The marks' colours hold 3:1 against the surface, declared in token-pairs.json; the
4656
+ gridlines are decorative and declare nothing. */
4657
+ [data-terp="trend-chart"],
4658
+ [data-terp="bar-chart"],
4659
+ [data-terp="proportion-bar"] {
4660
+ display: flex;
4661
+ flex-direction: column;
4662
+ gap: var(--space-3);
4663
+ min-width: 0;
4664
+ margin: 0;
4665
+ padding: var(--space-4);
4666
+ box-sizing: border-box;
4667
+ border: 1px solid var(--color-neutral-200);
4668
+ border-radius: var(--radius-lg);
4669
+ background: var(--color-bg-surface);
4670
+ box-shadow: var(--shadow-sm);
4671
+ color: var(--color-fg-default);
4318
4672
  }
4319
- [data-terp="tooltip"] {
4320
- position: absolute;
4321
- z-index: var(--z-index-tooltip);
4322
- inset-block-end: calc(100% + var(--space-1));
4323
- inset-inline-start: 0;
4324
- max-inline-size: min(18rem, calc(100vw - 2 * var(--space-4)));
4325
- padding: var(--space-1) var(--space-2);
4326
- border-radius: var(--radius-sm);
4327
- color: var(--color-neutral-0);
4328
- background: var(--color-neutral-900);
4329
- font-size: var(--font-size-xs);
4330
- font-weight: var(--font-weight-medium);
4331
- line-height: 1.4;
4332
- box-shadow: var(--shadow-md);
4333
- /* No pointer-events: none. It was here, and it makes WCAG 1.4.13's Hoverable clause
4334
- impossible by construction: a bubble the pointer cannot reach is a bubble nobody
4335
- tracking with a pointer, or reading under magnification, can finish reading. The
4673
+ [data-terp="chart-caption"] {
4674
+ color: var(--color-fg-default);
4675
+ font-size: var(--font-size-sm);
4676
+ font-weight: var(--font-weight-semibold);
4677
+ line-height: var(--font-line-height-snug);
4678
+ }
4679
+ /* The plot beside its value axis, and the period labels under the plot only. The axis takes
4680
+ three ticks in two equal steps, so space-between puts each label on its gridline with no
4681
+ position of its own; the plot's height is the axis's height. */
4682
+ [data-terp="chart-body"] {
4683
+ display: grid;
4684
+ grid-template-columns: auto minmax(0, 1fr);
4685
+ column-gap: var(--space-2);
4686
+ row-gap: var(--space-1);
4687
+ }
4688
+ [data-terp="chart-axis"] {
4689
+ display: flex;
4690
+ flex-direction: column;
4691
+ justify-content: space-between;
4692
+ block-size: 10rem;
4693
+ color: var(--color-fg-muted);
4694
+ font-size: var(--font-size-xs);
4695
+ line-height: var(--font-line-height-tight);
4696
+ text-align: end;
4697
+ font-variant-numeric: tabular-nums;
4698
+ }
4699
+ /* The top and foot labels straddle their gridlines rather than hang from the one and stand on
4700
+ the other: half a line out of the axis's box each, so all three sit centred on their lines. */
4701
+ [data-terp="chart-axis"] > :first-child {
4702
+ margin-block-start: -0.6em;
4703
+ }
4704
+ [data-terp="chart-axis"] > :last-child {
4705
+ margin-block-end: -0.6em;
4706
+ }
4707
+ [data-terp="chart-plot"] {
4708
+ display: block;
4709
+ inline-size: 100%;
4710
+ block-size: 10rem;
4711
+ overflow: visible;
4712
+ }
4713
+ [data-terp="chart-gridline"] {
4714
+ stroke: var(--color-neutral-200);
4715
+ stroke-width: 1;
4716
+ vector-effect: non-scaling-stroke;
4717
+ }
4718
+ [data-terp="trend-chart-line"] {
4719
+ fill: none;
4720
+ stroke: var(--color-chart-1);
4721
+ stroke-width: 2;
4722
+ stroke-linecap: round;
4723
+ stroke-linejoin: round;
4724
+ vector-effect: non-scaling-stroke;
4725
+ }
4726
+ [data-terp="trend-chart-area"] {
4727
+ fill: var(--color-chart-1);
4728
+ fill-opacity: 0.15;
4729
+ }
4730
+ [data-terp="trend-chart-column"] {
4731
+ fill: var(--color-chart-1);
4732
+ }
4733
+ /* The earlier period: the subtle ink, dashed, behind the series, so the two read apart by
4734
+ weight and by pattern as well as by colour. */
4735
+ [data-terp="trend-chart-comparison"] {
4736
+ fill: none;
4737
+ stroke: var(--color-fg-subtle);
4738
+ stroke-width: 1.5;
4739
+ stroke-dasharray: 4 3;
4740
+ vector-effect: non-scaling-stroke;
4741
+ }
4742
+ /* A point with no neighbour -- a series of one, or a value between two gaps -- is a dot: a line
4743
+ needs two points, and a polyline of one is never stroked. It is a zero-length stroke with a
4744
+ round cap, so the plot's stretch cannot turn it into an ellipse the way a circle would. */
4745
+ [data-terp="trend-chart-dot"] {
4746
+ fill: none;
4747
+ stroke: var(--color-chart-1);
4748
+ stroke-width: 6;
4749
+ stroke-linecap: round;
4750
+ vector-effect: non-scaling-stroke;
4751
+ }
4752
+ [data-terp="trend-chart-dot"][data-series="comparison"] {
4753
+ stroke: var(--color-fg-subtle);
4754
+ stroke-width: 4;
4755
+ }
4756
+ /* The period labels: a line's first, middle and last at the ends and the centre; a column
4757
+ chart's under each column in a slot of its own, the ones not printed still holding their
4758
+ place, so a label sits under its column. */
4759
+ [data-terp="chart-labels"] {
4760
+ grid-column: 2;
4761
+ display: flex;
4762
+ justify-content: space-between;
4763
+ gap: var(--space-2);
4764
+ min-width: 0;
4765
+ color: var(--color-fg-muted);
4766
+ font-size: var(--font-size-xs);
4767
+ }
4768
+ /* No gap between a column chart's label slots: each is exactly its column's band, or the
4769
+ labels drift off their columns by the gaps they add up. */
4770
+ [data-terp="chart-labels"][data-mark="columns"] {
4771
+ gap: 0;
4772
+ }
4773
+ /* A printed label is centred on its column and may be wider than its band: it overflows to
4774
+ both sides, over the neighbours that print nothing, rather than being cut to the band. */
4775
+ [data-terp="chart-labels"][data-mark="columns"] > span {
4776
+ flex: 1 1 0;
4777
+ min-width: 0;
4778
+ display: flex;
4779
+ justify-content: center;
4780
+ white-space: nowrap;
4781
+ }
4782
+ /* A single point stands in the middle of the plot, and so does its label. */
4783
+ [data-terp="chart-labels"] > :only-child {
4784
+ margin-inline: auto;
4785
+ }
4786
+ [data-terp="chart-labels"] > [data-quiet="true"] {
4787
+ visibility: hidden;
4788
+ }
4789
+ /* The legend: a word for every colour on the chart, and a swatch drawn the way its mark is. */
4790
+ [data-terp="chart-legend"] {
4791
+ display: flex;
4792
+ flex-wrap: wrap;
4793
+ gap: var(--space-1) var(--space-4);
4794
+ margin: 0;
4795
+ padding: 0;
4796
+ list-style: none;
4797
+ color: var(--color-fg-muted);
4798
+ font-size: var(--font-size-xs);
4799
+ }
4800
+ [data-terp="chart-legend-item"] {
4801
+ display: inline-flex;
4802
+ align-items: center;
4803
+ gap: var(--space-2);
4804
+ }
4805
+ [data-terp="chart-legend-value"] {
4806
+ color: var(--color-fg-default);
4807
+ font-variant-numeric: tabular-nums;
4808
+ }
4809
+ [data-terp="chart-swatch"] {
4810
+ flex: none;
4811
+ inline-size: 0.75rem;
4812
+ block-size: 0.75rem;
4813
+ border-radius: var(--radius-sm);
4814
+ background: var(--color-chart-1);
4815
+ }
4816
+ /* A line's swatch is a line, as a comparison's is a dashed one. */
4817
+ [data-terp="trend-chart"][data-mark="line"] [data-terp="chart-swatch"][data-series="main"] {
4818
+ block-size: 0;
4819
+ border-radius: 0;
4820
+ border-block-start: 2px solid var(--color-chart-1);
4821
+ background: none;
4822
+ }
4823
+ [data-terp="chart-swatch"][data-series="comparison"] {
4824
+ block-size: 0;
4825
+ border-radius: 0;
4826
+ border-block-start: 2px dashed var(--color-fg-subtle);
4827
+ background: none;
4828
+ }
4829
+ /* The chart ramp, for a part or a swatch with no tone of its own, in order. */
4830
+ [data-terp="chart-swatch"][data-series="2"],
4831
+ [data-terp="proportion-bar-part"][data-series="2"] { background: var(--color-chart-2); fill: var(--color-chart-2); }
4832
+ [data-terp="chart-swatch"][data-series="3"],
4833
+ [data-terp="proportion-bar-part"][data-series="3"] { background: var(--color-chart-3); fill: var(--color-chart-3); }
4834
+ [data-terp="chart-swatch"][data-series="4"],
4835
+ [data-terp="proportion-bar-part"][data-series="4"] { background: var(--color-chart-4); fill: var(--color-chart-4); }
4836
+ [data-terp="chart-swatch"][data-series="5"],
4837
+ [data-terp="proportion-bar-part"][data-series="5"] { background: var(--color-chart-5); fill: var(--color-chart-5); }
4838
+ [data-terp="proportion-bar-part"] { fill: var(--color-chart-1); }
4839
+ /* A part that is a state takes its state's tone, the status dots' colours, declared the same. */
4840
+ [data-terp="chart-swatch"][data-tone="neutral"],
4841
+ [data-terp="proportion-bar-part"][data-tone="neutral"],
4842
+ [data-terp="status-history-cell"][data-tone="neutral"] { background: var(--color-fg-subtle); fill: var(--color-fg-subtle); }
4843
+ [data-terp="chart-swatch"][data-tone="info"],
4844
+ [data-terp="proportion-bar-part"][data-tone="info"],
4845
+ [data-terp="status-history-cell"][data-tone="info"] { background: var(--color-status-info); fill: var(--color-status-info); }
4846
+ [data-terp="chart-swatch"][data-tone="success"],
4847
+ [data-terp="proportion-bar-part"][data-tone="success"],
4848
+ [data-terp="status-history-cell"][data-tone="success"] { background: var(--color-status-success); fill: var(--color-status-success); }
4849
+ [data-terp="chart-swatch"][data-tone="warning"],
4850
+ [data-terp="proportion-bar-part"][data-tone="warning"],
4851
+ [data-terp="status-history-cell"][data-tone="warning"] { background: var(--color-status-warning); fill: var(--color-status-warning); }
4852
+ [data-terp="chart-swatch"][data-tone="danger"],
4853
+ [data-terp="proportion-bar-part"][data-tone="danger"],
4854
+ [data-terp="status-history-cell"][data-tone="danger"] { background: var(--color-status-danger); fill: var(--color-status-danger); }
4855
+ /* The proportion bar: one bar the width of its tile, its parts parted by a hairline of the
4856
+ surface so two near colours still read as two. */
4857
+ [data-terp="proportion-bar-track"] {
4858
+ display: block;
4859
+ inline-size: 100%;
4860
+ block-size: 0.75rem;
4861
+ border-radius: var(--radius-full);
4862
+ overflow: hidden;
4863
+ }
4864
+ [data-terp="proportion-bar-gap"] {
4865
+ stroke: var(--color-bg-surface);
4866
+ stroke-width: 2;
4867
+ vector-effect: non-scaling-stroke;
4868
+ }
4869
+ /* The bar chart is a table: a category's name, its bar and its value, one row each, the bars
4870
+ scaled to the largest. The name column takes what its longest name needs up to a third of
4871
+ the tile; the bar takes the rest. A table cell's max-inline-size is ignored in an automatic
4872
+ table layout, so the cap is on the name inside the cell, in units of the chart's own width:
4873
+ the chart is a container for exactly that. */
4874
+ [data-terp="bar-chart"] {
4875
+ container-type: inline-size;
4876
+ }
4877
+ [data-terp="bar-chart-table"] {
4878
+ inline-size: 100%;
4879
+ border-collapse: collapse;
4880
+ font-size: var(--font-size-sm);
4881
+ }
4882
+ [data-terp="bar-chart-label"] {
4883
+ inline-size: 1%;
4884
+ padding: var(--space-1) var(--space-3) var(--space-1) 0;
4885
+ color: var(--color-fg-default);
4886
+ font-weight: var(--font-weight-normal);
4887
+ text-align: start;
4888
+ }
4889
+ [data-terp="bar-chart-name"] {
4890
+ display: block;
4891
+ max-inline-size: 33cqi;
4892
+ overflow: hidden;
4893
+ text-overflow: ellipsis;
4894
+ white-space: nowrap;
4895
+ }
4896
+ [data-terp="bar-chart-bar"] {
4897
+ padding: var(--space-1) 0;
4898
+ }
4899
+ [data-terp="bar-chart-bar"] > svg {
4900
+ display: block;
4901
+ inline-size: 100%;
4902
+ block-size: 0.875rem;
4903
+ }
4904
+ [data-terp="bar-chart-mark"] {
4905
+ fill: var(--color-chart-1);
4906
+ }
4907
+ [data-terp="bar-chart-value"] {
4908
+ inline-size: 1%;
4909
+ padding: var(--space-1) 0 var(--space-1) var(--space-3);
4910
+ color: var(--color-fg-default);
4911
+ text-align: end;
4912
+ white-space: nowrap;
4913
+ font-variant-numeric: tabular-nums;
4914
+ }
4915
+ /* A status history: one small cell per run, oldest first, and the latest run's ending in words
4916
+ beside them. Inline, so it sits in a sentence, a collection's cell or a summary band. */
4917
+ [data-terp="status-history"] {
4918
+ display: inline-flex;
4919
+ align-items: center;
4920
+ gap: var(--space-2);
4921
+ max-inline-size: 100%;
4922
+ }
4923
+ [data-terp="status-history-cells"] {
4924
+ display: inline-flex;
4925
+ gap: 2px;
4926
+ }
4927
+ [data-terp="status-history-cell"] {
4928
+ inline-size: 0.5rem;
4929
+ block-size: 0.875rem;
4930
+ border-radius: 2px;
4931
+ }
4932
+ [data-terp="status-history-latest"] {
4933
+ color: var(--color-fg-muted);
4934
+ font-size: var(--font-size-xs);
4935
+ white-space: nowrap;
4936
+ }
4937
+
4938
+ /* Timeline (ADR 0169 §5) ----------------------------------------------------- */
4939
+ /* Events in order on a line that joins them: a marker per event, its words beside it, and the
4940
+ line drawn by each event but the last, from under its marker to its foot, so it ends at the
4941
+ last marker rather than running past it. Unframed, so it reads in a card or on the page. The
4942
+ marker takes the event's tone where it has one; the label is always its word. */
4943
+ [data-terp="timeline"] {
4944
+ display: grid;
4945
+ margin: 0;
4946
+ padding: 0;
4947
+ list-style: none;
4948
+ }
4949
+ [data-terp="timeline-event"] {
4950
+ position: relative;
4951
+ display: grid;
4952
+ grid-template-columns: 1rem minmax(0, 1fr);
4953
+ column-gap: var(--space-3);
4954
+ row-gap: 2px;
4955
+ padding-block-end: var(--space-4);
4956
+ }
4957
+ [data-terp="timeline-event"]:last-child {
4958
+ padding-block-end: 0;
4959
+ }
4960
+ [data-terp="timeline-event"]:not(:last-child)::before {
4961
+ content: "";
4962
+ position: absolute;
4963
+ inset-block: 1.1rem 0;
4964
+ inset-inline-start: calc(0.5rem - 1px);
4965
+ border-inline-start: 2px solid var(--color-neutral-200);
4966
+ }
4967
+ [data-terp="timeline-marker"] {
4968
+ grid-row: 1 / span 3;
4969
+ justify-self: center;
4970
+ margin-block-start: 0.3rem;
4971
+ inline-size: 0.625rem;
4972
+ block-size: 0.625rem;
4973
+ border-radius: var(--radius-full);
4974
+ background: var(--color-fg-subtle);
4975
+ }
4976
+ [data-terp="timeline-event"][data-tone="info"] > [data-terp="timeline-marker"] { background: var(--color-status-info); }
4977
+ [data-terp="timeline-event"][data-tone="success"] > [data-terp="timeline-marker"] { background: var(--color-status-success); }
4978
+ [data-terp="timeline-event"][data-tone="warning"] > [data-terp="timeline-marker"] { background: var(--color-status-warning); }
4979
+ [data-terp="timeline-event"][data-tone="danger"] > [data-terp="timeline-marker"] { background: var(--color-status-danger); }
4980
+ [data-terp="timeline-label"] {
4981
+ grid-column: 2;
4982
+ color: var(--color-fg-default);
4983
+ font-size: var(--font-size-sm);
4984
+ font-weight: var(--font-weight-medium);
4985
+ }
4986
+ [data-terp="timeline-when"] {
4987
+ grid-column: 2;
4988
+ color: var(--color-fg-muted);
4989
+ font-size: var(--font-size-xs);
4990
+ font-variant-numeric: tabular-nums;
4991
+ }
4992
+ [data-terp="timeline-detail"] {
4993
+ grid-column: 2;
4994
+ color: var(--color-fg-muted);
4995
+ font-size: var(--font-size-sm);
4996
+ }
4997
+
4998
+ /* The prominent collection (ADR 0169 §5) ------------------------------------- */
4999
+ /* A collection's own heading, with its count as part of its name. The card title's step and
5000
+ weight, so a titled collection and a titled card are one level of the page; the count is a
5001
+ neutral pill -- muted ink on the neutral wash, a declared pairing -- in tabular figures so a
5002
+ count that changes does not move the title. */
5003
+ [data-terp="dataview-title"] {
5004
+ display: flex;
5005
+ flex-wrap: wrap;
5006
+ align-items: center;
5007
+ gap: var(--space-2);
5008
+ margin: 0;
5009
+ color: var(--color-fg-default);
5010
+ font-size: var(--font-size-lg);
5011
+ font-weight: var(--font-weight-semibold);
5012
+ line-height: var(--font-line-height-snug);
5013
+ }
5014
+ [data-terp="dataview-count"] {
5015
+ padding: 0 var(--space-2);
5016
+ border-radius: var(--radius-full);
5017
+ background: var(--color-neutral-100);
5018
+ color: var(--color-fg-muted);
5019
+ font-size: var(--font-size-xs);
5020
+ font-weight: var(--font-weight-semibold);
5021
+ line-height: var(--font-line-height-base);
5022
+ font-variant-numeric: tabular-nums;
5023
+ }
5024
+ /* A status column's quiet form: a dot before the cell's text, which is the word the dot stands
5025
+ for. Each tone's dot holds 3:1 against the surface the rows are read on, declared in
5026
+ token-pairs.json; neutral is the subtle ink, whose text pairing on the surface already holds
5027
+ more than that. */
5028
+ [data-terp="dataview-status"] {
5029
+ display: inline-flex;
5030
+ align-items: center;
5031
+ gap: var(--space-2);
5032
+ }
5033
+ [data-terp="dataview-status-dot"] {
5034
+ flex: none;
5035
+ width: 0.5rem;
5036
+ height: 0.5rem;
5037
+ border-radius: var(--radius-full);
5038
+ background: var(--color-fg-subtle);
5039
+ }
5040
+ [data-terp="dataview-status-dot"][data-tone="info"] {
5041
+ background: var(--color-status-info);
5042
+ }
5043
+ [data-terp="dataview-status-dot"][data-tone="success"] {
5044
+ background: var(--color-status-success);
5045
+ }
5046
+ [data-terp="dataview-status-dot"][data-tone="warning"] {
5047
+ background: var(--color-status-warning);
5048
+ }
5049
+ [data-terp="dataview-status-dot"][data-tone="danger"] {
5050
+ background: var(--color-status-danger);
5051
+ }
5052
+
5053
+ /* Figures (ADR 0169) --------------------------------------------------------- */
5054
+ /* One figure is a tile on --color-bg-surface, the rung where data is read (ADR 0169 §3): the
5055
+ surface, its hairline and its small shadow, as a boxed card one rung brighter. The value is
5056
+ the largest type on the tile and the label names it, which is the order a Card with a title
5057
+ over a line of text had backwards.
5058
+
5059
+ A column whose items keep their own widths (align-items: flex-start), so the delta's pill
5060
+ and the target's meter are as wide as what they say rather than as wide as the tile; the
5061
+ sparkline asks for the full width itself. */
5062
+ [data-terp="stat"] {
5063
+ display: flex;
5064
+ flex-direction: column;
5065
+ align-items: flex-start;
5066
+ gap: var(--space-1);
5067
+ min-width: 0;
5068
+ padding: var(--space-4);
5069
+ box-sizing: border-box;
5070
+ border: 1px solid var(--color-neutral-200);
5071
+ border-radius: var(--radius-lg);
5072
+ background: var(--color-bg-surface);
5073
+ box-shadow: var(--shadow-sm);
5074
+ color: var(--color-fg-default);
5075
+ }
5076
+ [data-terp="stat-label"] {
5077
+ color: var(--color-fg-muted);
5078
+ font-size: var(--font-size-sm);
5079
+ font-weight: var(--font-weight-medium);
5080
+ line-height: var(--font-line-height-snug);
5081
+ }
5082
+ /* Tabular figures, so a value that ticks does not change width; anywhere-wrapping, so a long
5083
+ figure in a narrow track breaks rather than widening it. */
5084
+ [data-terp="stat-value"] {
5085
+ max-inline-size: 100%;
5086
+ font-size: var(--font-size-2xl);
5087
+ font-weight: var(--font-weight-semibold);
5088
+ line-height: var(--font-line-height-tight);
5089
+ letter-spacing: var(--font-letter-spacing-tight);
5090
+ font-variant-numeric: tabular-nums;
5091
+ overflow-wrap: anywhere;
5092
+ }
5093
+ /* A figure with nothing to show prints a dash, and the dash is an absence rather than a number:
5094
+ in the value's full ink and weight it read as a broken bar. A headline keeps its own ink, the
5095
+ one its fill was measured against. */
5096
+ [data-terp="stat"]:not([data-headline]) [data-terp="stat-value"][data-empty] {
5097
+ color: var(--color-fg-subtle);
5098
+ font-weight: var(--font-weight-normal);
5099
+ }
5100
+ [data-terp="stat-delta"] {
5101
+ display: flex;
5102
+ flex-wrap: wrap;
5103
+ align-items: center;
5104
+ gap: var(--space-1) var(--space-2);
5105
+ color: var(--color-fg-muted);
5106
+ font-size: var(--font-size-xs);
5107
+ line-height: var(--font-line-height-snug);
5108
+ }
5109
+ /* The change is a pill with its own soft fill, the badge's construction, and that is what
5110
+ makes its contrast its own: the success ink measures under AA directly on the summary band's
5111
+ tint in the midday theme, and on its soft fill it is the success badge, declared and gated
5112
+ wherever a band or a card puts it. Neutral is muted ink on the neutral wash, a declared
5113
+ pairing too. */
5114
+ [data-terp="stat-change"] {
5115
+ display: inline-flex;
5116
+ align-items: center;
5117
+ gap: var(--space-1);
5118
+ padding: 1px var(--space-2);
5119
+ border: 1px solid;
5120
+ border-radius: var(--radius-full);
5121
+ font-weight: var(--font-weight-semibold);
5122
+ font-variant-numeric: tabular-nums;
5123
+ white-space: nowrap;
5124
+ }
5125
+ [data-terp="stat-change"][data-sentiment="positive"] {
5126
+ color: var(--color-status-success);
5127
+ background: var(--color-status-success-soft);
5128
+ border-color: var(--color-status-success-soft);
5129
+ }
5130
+ [data-terp="stat-change"][data-sentiment="negative"] {
5131
+ color: var(--color-status-danger);
5132
+ background: var(--color-status-danger-soft);
5133
+ border-color: var(--color-status-danger-soft);
5134
+ }
5135
+ [data-terp="stat-change"][data-sentiment="neutral"] {
5136
+ color: var(--color-fg-muted);
5137
+ background: var(--color-neutral-100);
5138
+ border-color: var(--color-neutral-100);
5139
+ }
5140
+ [data-terp="stat-arrow"] {
5141
+ flex: none;
5142
+ width: 0.625rem;
5143
+ height: 0.625rem;
5144
+ fill: currentColor;
5145
+ }
5146
+ /* The sparkline: the full width of its tile at a fixed height, so sparklines side by side
5147
+ share a scale of height. The SVG stretches to its box, and non-scaling-stroke keeps the
5148
+ line at its width through the stretch. The accent is a declared pairing on every ground a
5149
+ figure stands on -- text pairings on the surface, a container and the summary band, and the
5150
+ focus ring's non-text pairing on the canvas -- so the line clears the 3:1 a graphic needs
5151
+ everywhere. The wash under it is reinforcement only. */
5152
+ [data-terp="stat-trend"] {
5153
+ display: block;
5154
+ align-self: stretch;
5155
+ margin-block-start: var(--space-1);
5156
+ }
5157
+ [data-terp="stat-trend-chart"] {
5158
+ display: block;
5159
+ width: 100%;
5160
+ height: 2rem;
5161
+ overflow: visible;
5162
+ }
5163
+ [data-terp="stat-trend-line"] {
5164
+ fill: none;
5165
+ stroke: var(--color-fg-accent);
5166
+ stroke-width: 1.5;
5167
+ stroke-linecap: round;
5168
+ stroke-linejoin: round;
5169
+ vector-effect: non-scaling-stroke;
5170
+ }
5171
+ [data-terp="stat-trend-area"] {
5172
+ fill: var(--color-fg-accent);
5173
+ fill-opacity: 0.12;
5174
+ stroke: none;
5175
+ }
5176
+ /* The target's meter prints its share at the tile's small step, beside the caption's, rather
5177
+ than at the body size it would inherit from a tile that sets none. */
5178
+ [data-terp="stat"] > [data-terp="meter"] {
5179
+ margin-block-start: var(--space-1);
5180
+ font-size: var(--font-size-sm);
5181
+ }
5182
+ [data-terp="stat-caption"] {
5183
+ color: var(--color-fg-muted);
5184
+ font-size: var(--font-size-xs);
5185
+ line-height: var(--font-line-height-snug);
5186
+ }
5187
+ /* The headline: the one figure on a page filled with the brand colour (ADR 0169 §4), every
5188
+ word on it in the brand's contrast ink -- the primary button's pairing. The delta keeps its
5189
+ pill, which carries its own pairing onto any fill. One shadow step up, so it also stands
5190
+ off the page. */
5191
+ [data-terp="stat"][data-headline] {
5192
+ border-color: var(--color-brand-primary);
5193
+ background: var(--color-brand-primary);
5194
+ box-shadow: var(--shadow-md);
5195
+ color: var(--color-brand-primary-contrast);
5196
+ }
5197
+ [data-terp="stat"][data-headline] [data-terp="stat-label"],
5198
+ [data-terp="stat"][data-headline] [data-terp="stat-delta"],
5199
+ [data-terp="stat"][data-headline] [data-terp="stat-caption"] {
5200
+ color: var(--color-brand-primary-contrast);
5201
+ }
5202
+ [data-terp="stat"][data-headline] [data-terp="stat-trend-line"] {
5203
+ stroke: var(--color-brand-primary-contrast);
5204
+ }
5205
+ [data-terp="stat"][data-headline] [data-terp="stat-trend-area"] {
5206
+ fill: var(--color-brand-primary-contrast);
5207
+ }
5208
+ /* A group of figures: one ruled row, unframed wherever it is placed. As many figures to a line
5209
+ as fit -- two on a phone -- each a cell padded half a gap either side, and the group reaching
5210
+ out by that half on both sides so the first figure's text starts on the line the content
5211
+ around it does.
5212
+
5213
+ The rule before a figure is a 1px shadow outside its cell's start edge. For a figure that
5214
+ starts a line that edge is the group's own, where overflow: hidden clips the shadow, so no
5215
+ figure at a line's start carries a rule however the row wraps. The clip sits half a gap
5216
+ outside the text rather than at it, which is the point of the padding: a focus ring on
5217
+ something inside a figure has room to draw, where clipping at the text's edge cut its side
5218
+ off -- the first version, rules drawn in the column gap, did exactly that.
5219
+
5220
+ 9.5rem is 8rem of figure and the 1.5rem of its padding. */
5221
+ [data-terp="stat-group"] {
5222
+ display: grid;
5223
+ grid-template-columns: repeat(auto-fit, minmax(min(9.5rem, 100%), 1fr));
5224
+ row-gap: var(--space-4);
5225
+ min-width: 0;
5226
+ margin-inline: calc(-1 * var(--space-3));
5227
+ overflow: hidden;
5228
+ }
5229
+ /* Every cell takes the block padding the headline's fill needs, so a row with a headline in it
5230
+ keeps its labels on one line: padded alone, the headline's label sat 12px under the rest. */
5231
+ [data-terp="stat-group"] > [data-terp="stat"] {
5232
+ padding: var(--space-3);
5233
+ border: 0;
5234
+ border-radius: 0;
5235
+ background: none;
5236
+ box-shadow: -1px 0 0 0 var(--color-neutral-200);
5237
+ }
5238
+ /* The headline keeps its fill in a group, inset in its own padding and held off the figures
5239
+ on either side by half a gap, so it reads as the one filled cell of the row. The group
5240
+ reaches out by half a gap so a focus ring has room; the fill must not reach out with it, or
5241
+ a headline that starts a line pokes past the edge every other block on the page keeps --
5242
+ with the margin, its fill starts where the band's content does. The fill is its own
5243
+ division, so no rule is drawn on either side of it. */
5244
+ [data-terp="stat-group"] > [data-terp="stat"][data-headline] {
5245
+ margin-inline: var(--space-3);
5246
+ padding: var(--space-3) var(--space-4);
5247
+ border-radius: var(--radius-lg);
5248
+ background: var(--color-brand-primary);
5249
+ box-shadow: none;
5250
+ }
5251
+ [data-terp="stat-group"] > [data-terp="stat"][data-headline] + [data-terp="stat"] {
5252
+ box-shadow: none;
5253
+ }
5254
+ /* On a narrow screen the rows of figures, and the band they sit in, close up: a band of five
5255
+ figures is three rows deep there, and with a full gap between them and the band's full padding
5256
+ around them it put the page's own content half a phone's height down. The floor above stays,
5257
+ two to a line: three were tried, and a figure such as "4 m 12 s" then broke over two lines
5258
+ and its label over two more, which made the group taller rather than shorter. */
5259
+ @media ${NARROW_VIEWPORT} {
5260
+ [data-terp="stat-group"] {
5261
+ row-gap: var(--space-2);
5262
+ }
5263
+ [data-terp="page-summary"] {
5264
+ padding-block: var(--space-3);
5265
+ }
5266
+ }
5267
+ /* A lone figure in a boxed card: the card is its frame, so the figure takes no tile of its own
5268
+ -- a tile inside a box is a frame inside a frame. A group's cells keep theirs, and the
5269
+ headline keeps its fill wherever it is. A plain card has no frame to lend, so a figure in one
5270
+ keeps its tile. */
5271
+ [data-terp="card"]:not([data-variant]) [data-terp="stat"]:not([data-headline], [data-terp="stat-group"] > *) {
5272
+ padding: 0;
5273
+ border: 0;
5274
+ border-radius: 0;
5275
+ background: none;
5276
+ box-shadow: none;
5277
+ }
5278
+ /* In a hub card's stat row the card is the frame, so an ordinary figure has none of its own
5279
+ there. The headline keeps its fill wherever it is. */
5280
+ [data-terp="hubcard-stat"] > [data-terp="stat"]:not([data-headline]) {
5281
+ padding: 0;
5282
+ border: 0;
5283
+ border-radius: 0;
5284
+ background: none;
5285
+ box-shadow: none;
5286
+ }
5287
+
5288
+ /* Tooltips ----------------------------------------------------------------- */
5289
+ /* No display declaration here on purpose: the panel is hidden with the hidden
5290
+ attribute, and any author display would beat the UA's [hidden] rule and
5291
+ leave the tooltip permanently visible.
5292
+
5293
+ The bubble is PORTALLED -- to the body, or into the dialog its trigger sits in, since a
5294
+ modal dialog is in the top layer and nothing outside it paints above it -- and placed with
5295
+ position: fixed, the way [data-terp="popover-panel"] already was. It used to be an
5296
+ absolutely positioned child of
5297
+ its anchor, and that failed three ways an app reported together:
5298
+ - An ancestor with overflow other than visible clipped it, whatever its z-index. A DataView
5299
+ cell is inside the table's horizontal scroller, so a tooltip there was cut off at the
5300
+ table's edge instead of drawing over it.
5301
+ - Its containing block was the anchor, so its available width was the TRIGGER's. A long
5302
+ message on a button wrapped to the button's width -- a column of words one button wide --
5303
+ and grew upward from there.
5304
+ - It always opened above and started at the trigger's left edge, so a trigger near the top
5305
+ or the right edge of the window put the message off screen.
5306
+ The component now measures the trigger and the bubble, opens above or flips below, and
5307
+ clamps the bubble inside the viewport; only those coordinates and the one-frame
5308
+ visibility before them are inline, the measured part ADR 0094 allows. inline-size:
5309
+ max-content is what makes the measured width the MESSAGE's rather than whatever room a
5310
+ containing block happens to leave, so where the bubble lands cannot change what it measures.
5311
+
5312
+ The anchor keeps its inline-flex and loses its position: relative, which existed only to
5313
+ be the bubble's containing block. */
5314
+ [data-terp="tooltip-anchor"] {
5315
+ display: inline-flex;
5316
+ }
5317
+ [data-terp="tooltip"] {
5318
+ position: fixed;
5319
+ z-index: var(--z-index-tooltip);
5320
+ inline-size: max-content;
5321
+ max-inline-size: min(18rem, calc(100vw - 2 * var(--space-4)));
5322
+ padding: var(--space-1) var(--space-2);
5323
+ border-radius: var(--radius-sm);
5324
+ color: var(--color-neutral-0);
5325
+ background: var(--color-neutral-900);
5326
+ /* Declared, not inherited, now that the bubble is portalled: its parent is the body, which
5327
+ no Terp rule gives a typeface, so it rendered in the browser's default serif. The
5328
+ popover panel declares its family for the same reason. */
5329
+ font-family: var(--font-family-sans);
5330
+ font-size: var(--font-size-xs);
5331
+ font-weight: var(--font-weight-medium);
5332
+ line-height: 1.4;
5333
+ box-shadow: var(--shadow-md);
5334
+ /* No pointer-events: none. It was here, and it makes WCAG 1.4.13's Hoverable clause
5335
+ impossible by construction: a bubble the pointer cannot reach is a bubble nobody
5336
+ tracking with a pointer, or reading under magnification, can finish reading. The
4336
5337
  component keeps it open across the gap with a short close delay instead. */
4337
5338
  white-space: normal;
4338
5339
  }
@@ -4351,7 +5352,7 @@ button[data-terp="input"][data-placeholder="true"] {
4351
5352
  padding: var(--space-1) var(--space-2);
4352
5353
  background: transparent;
4353
5354
  color: var(--color-neutral-700);
4354
- border: 1px solid var(--color-neutral-300);
5355
+ border: 1px solid var(--color-border-strong);
4355
5356
  border-radius: var(--radius-md);
4356
5357
  cursor: pointer;
4357
5358
  font-family: var(--font-family-sans);
@@ -4422,7 +5423,7 @@ button[data-terp="input"][data-placeholder="true"] {
4422
5423
  }
4423
5424
  [data-terp="theme-toggle-label"],
4424
5425
  [data-terp="language-switcher-label"] {
4425
- color: var(--color-neutral-600);
5426
+ color: var(--color-fg-muted);
4426
5427
  }
4427
5428
 
4428
5429
  /* Account menu -------------------------------------------------------------- */
@@ -4472,7 +5473,7 @@ button[data-terp="input"][data-placeholder="true"] {
4472
5473
  outside this selector by construction) and the panel keeps the neutral. The sheet already
4473
5474
  argues this exact split for the drawer close button. */
4474
5475
  [data-terp="user-menu-role"] {
4475
- color: var(--color-neutral-600);
5476
+ color: var(--color-fg-muted);
4476
5477
  }
4477
5478
  [data-terp="user-menu"] [data-terp="user-menu-role"] {
4478
5479
  color: var(--color-sidebar-muted);
@@ -4662,7 +5663,7 @@ button[data-terp="input"][data-placeholder="true"] {
4662
5663
  color: var(--color-neutral-900);
4663
5664
  }
4664
5665
  [data-terp="dialog-description"] {
4665
- color: var(--color-neutral-600);
5666
+ color: var(--color-fg-muted);
4666
5667
  font-size: var(--font-size-sm);
4667
5668
  line-height: 1.5;
4668
5669
  }
@@ -4731,10 +5732,10 @@ button[data-terp="input"][data-placeholder="true"] {
4731
5732
  on whatever ancestor happens to establish a context looks like. It reads
4732
5733
  --z-index-tooltip (70) now, the level published for it.
4733
5734
 
4734
- Still true, and NOT fixed by this: an ancestor with overflow: hidden clips an
4735
- absolutely positioned tooltip whatever its level. The fix for that is the one
4736
- [data-terp="popover-panel"] already uses — position: fixed with measured
4737
- coordinates — and it is a change to the component rather than to this sheet. */
5735
+ That left one failure no level could fix: an ancestor with overflow other than visible
5736
+ clipped the absolutely positioned bubble whatever its z-index. It is fixed the way this
5737
+ panel was, by the component rather than the sheet -- the tooltip is portalled and placed
5738
+ with position: fixed from measured coordinates now (see its own rule). */
4738
5739
  [data-terp="popover-panel"] {
4739
5740
  position: fixed;
4740
5741
  z-index: var(--z-index-popover);
@@ -4821,7 +5822,7 @@ button[data-terp="input"][data-placeholder="true"] {
4821
5822
  }
4822
5823
  [data-terp="button"][data-variant="secondary"]:hover:not(:disabled) {
4823
5824
  background: var(--color-neutral-100);
4824
- border-color: var(--color-neutral-300);
5825
+ border-color: var(--color-border-strong);
4825
5826
  }
4826
5827
  [data-terp="button"][data-variant="ghost"]:hover:not(:disabled) {
4827
5828
  background: var(--color-neutral-100);
@@ -4932,7 +5933,7 @@ button[data-terp="input"][data-placeholder="true"] {
4932
5933
  user is pointing at the thing they need to fix. Narrowing the aggressor rather than adding a
4933
5934
  competing [aria-invalid="true"]:hover rule is this sheet's convention. */
4934
5935
  [data-terp="input"]:hover:not(:disabled):not(:focus):not([aria-invalid="true"]) {
4935
- border-color: var(--color-neutral-400);
5936
+ border-color: var(--color-neutral-500);
4936
5937
  }
4937
5938
  [data-terp="input"]:focus,
4938
5939
  [data-terp="input"]:focus-visible {
@@ -5248,6 +6249,23 @@ button[data-terp="input"][data-placeholder="true"] {
5248
6249
  text-decoration: underline;
5249
6250
  }
5250
6251
 
6252
+ /* Sequence links ----------------------------------------------------------- */
6253
+ /* The ghost button's hover, for links that read as one (see the bar's rule in terp.base). */
6254
+ [data-terp="page-sequence-previous"] > a:hover,
6255
+ [data-terp="page-sequence-next"] > a:hover {
6256
+ background: var(--color-neutral-100);
6257
+ color: var(--color-neutral-900);
6258
+ }
6259
+ /* The shared ring, restated for an anchor that carries no marker of its own: the router renders
6260
+ it, so [data-terp]:focus-visible cannot reach it, and without this a keyboard user stepping
6261
+ through a series would get whatever ring the browser draws by default. */
6262
+ [data-terp="page-sequence-previous"] > a:focus-visible,
6263
+ [data-terp="page-sequence-next"] > a:focus-visible {
6264
+ outline: 2px solid var(--color-fg-accent);
6265
+ outline-offset: 1px;
6266
+ box-shadow: 0 0 0 3px var(--color-focus-ring);
6267
+ }
6268
+
5251
6269
  /* The pager's disabled ink, scoped rather than added to the shared iconbutton
5252
6270
  rule above: of the seventeen sites wearing that marker only six can be disabled at
5253
6271
  all — these four and the view-options panel's two reorder arrows, which carry