@terpjs/react-core 0.25.0 → 0.28.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.
package/src/styles.ts CHANGED
@@ -103,7 +103,7 @@
103
103
  * touched.
104
104
  */
105
105
 
106
- import { ROOMY_VIEWPORT_QUERY, WIDE_VIEWPORT_QUERY } from "./breakpoints";
106
+ import { NARROW_VIEWPORT, ROOMY_VIEWPORT_QUERY, WIDE_VIEWPORT_QUERY } from "./breakpoints";
107
107
 
108
108
  /** The `<style>` element id used to detect a prior injection. */
109
109
  export const TERP_STYLES_ID = "terp-core-styles";
@@ -569,10 +569,11 @@ textarea[data-terp="input"] {
569
569
  two halves of the cutover partition the viewport by construction. Written out here they
570
570
  would be two literals that agree until someone edits one.
571
571
 
572
- There are TWO \${…} in this sheet now, one per cutover — this one and the page band's
573
- ROOMY block. Both come from ./breakpoints and neither spells a number, which is the
574
- property worth grepping for: a third interpolation is fine if it names a constant from
575
- that module, and a literal pixel width in a media query here is not. */
572
+ There are FOUR \${…} in this sheet now: this one, the page band's ROOMY block, and the
573
+ two halves of the band's own cutover (its WIDE two-row form and its NARROW single
574
+ column). Every one of them comes from ./breakpoints and none spells a number, which is
575
+ the property worth grepping for: a further interpolation is fine if it names a constant
576
+ from that module, and a literal pixel width in a media query here is not. */
576
577
  @media ${WIDE_VIEWPORT_QUERY} {
577
578
  [data-terp="stack"][data-direction-wide="column"] { flex-direction: column; }
578
579
  [data-terp="stack"][data-direction-wide="row"] { flex-direction: row; }
@@ -636,6 +637,21 @@ textarea[data-terp="input"] {
636
637
  [data-terp="detail-list"][data-layout="aligned"] {
637
638
  grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
638
639
  column-gap: var(--space-3);
640
+ /* The pair's alignment, and it belongs to the shared column rather than to the grid. A
641
+ dt and a dd are separate grid items here -- that is what display: contents below does
642
+ -- so under the default stretch each box starts at the row's top and each text sits at
643
+ the top of its own line box. The two line boxes are not the same height, because the
644
+ term is a type step smaller than the value, so the label rides ABOVE the value it
645
+ labels: measured at 4px on every row of a two-column card, which is precisely the
646
+ misalignment a shared label column exists to remove.
647
+
648
+ baseline rather than center, and the difference shows on the second line rather than
649
+ the first: a value that wraps would pull a centred label to the middle of a block it
650
+ is not describing, while a baseline holds the label on the line the value STARTS on.
651
+ That is also why it is align-items on the container rather than align-self on the dt --
652
+ a grid baseline group spans the row, so at two pairs per row all four items share one
653
+ line, which one item aligning itself cannot produce. */
654
+ align-items: baseline;
639
655
  }
640
656
  [data-terp="detail-list"][data-layout="aligned"][data-columns="2"] {
641
657
  grid-template-columns: repeat(2, minmax(0, max-content) minmax(0, 1fr));
@@ -679,6 +695,38 @@ textarea[data-terp="input"] {
679
695
  > [data-terp="detail-list"][data-layout="aligned"]:not([data-columns]) {
680
696
  grid-template-columns: subgrid;
681
697
  }
698
+ /* FieldRow's wide half: the three shared lines, and the columns that hold them.
699
+ align-items: start so a field shorter than its neighbour does not stretch, and
700
+ justify-content: start so the row is as wide as its fields rather than as wide as the
701
+ page. */
702
+ [data-terp="field-row"] {
703
+ grid-auto-flow: column;
704
+ grid-auto-columns: minmax(0, auto);
705
+ grid-template-rows: auto auto auto;
706
+ align-items: start;
707
+ justify-content: start;
708
+ }
709
+ /* Each field spans all three and subgrids them, which is what puts every label on one
710
+ line and every control on the next whatever any one field has to say. */
711
+ [data-terp="field-row"] > [data-terp="field"] {
712
+ display: grid;
713
+ grid-template-rows: subgrid;
714
+ grid-row: 1 / -1;
715
+ }
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. */
721
+ [data-terp="field-row"] > [data-terp="field"] > [data-terp="field-label"] {
722
+ display: contents;
723
+ }
724
+ /* Anything that is not a field -- a remove button, an add button -- lands on the control
725
+ line rather than at the top of the row, which is where a box with no label of its own
726
+ would otherwise sit. */
727
+ [data-terp="field-row"] > :not([data-terp="field"]) {
728
+ grid-row: 2;
729
+ }
682
730
  }
683
731
 
684
732
  /* Grids -------------------------------------------------------------------- */
@@ -843,6 +891,12 @@ textarea[data-terp="input"] {
843
891
  minmax(min(9rem, 30%), max-content) minmax(min(13rem, 60%), 1fr)
844
892
  );
845
893
  column-gap: var(--space-3);
894
+ /* The baseline the wide block's aligned rule takes, declared again HERE and therefore at
895
+ every width. An auto list keeps its shared column below the cutover -- the contents rule
896
+ two blocks down says so -- so it is the one aligned list whose pairs are grid items in a
897
+ phone's width, and it would be the one place the label went back to riding above its
898
+ value. */
899
+ align-items: baseline;
846
900
  }
847
901
  /* The shared column for an auto list, at EVERY width, which the aligned rule in the wide block
848
902
  only gives above the cutover. Without it an auto list below the cutover would place each pair
@@ -873,6 +927,29 @@ textarea[data-terp="input"] {
873
927
  font-weight: var(--font-weight-normal);
874
928
  color: var(--color-fg-muted);
875
929
  }
930
+ /* And the value comes down to meet it. Muting the term above moved one half of the pair and
931
+ left the other at the inherited base, which is 12px against 16px -- two steps apart, far
932
+ enough that a reader sees two kinds of text rather than a label and the thing it labels.
933
+ Reported as the value being too big for its label, which is the same observation from the
934
+ other end.
935
+
936
+ sm is not a fresh judgement about this component. It is what every other dense record
937
+ surface in this sheet already renders: a DataView header cell is xs and its body cell is
938
+ sm, which IS this pair in a table, and card-description, input and field-label-text are all
939
+ sm. An aligned detail list beside a table on the same page was the one surface reading a
940
+ step larger than the record it describes.
941
+
942
+ inline is excluded for the reason the muting rule above gives. There the value is the second
943
+ half of a sentence whose first half is the term, so stepping one half down would break the
944
+ line rather than group it.
945
+
946
+ It sets the dd, so a value that declares its own size keeps it -- a Text inside a value
947
+ still renders at the step that Text asked for. That is the correct outcome for a caller who
948
+ said a size and the thing to know about a caller who did not. */
949
+ [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"] {
951
+ font-size: var(--font-size-sm);
952
+ }
876
953
  /* The gap prop, and this block must stay AFTER the layout rules above. Both
877
954
  [data-terp="detail-list"][data-gap="3"] and [data-terp="detail-list"][data-layout="aligned"]
878
955
  weigh (0,2,0), so nothing but source order decides which row-gap a list carrying both
@@ -1034,44 +1111,52 @@ textarea[data-terp="input"] {
1034
1111
  }
1035
1112
 
1036
1113
  /* Cards -------------------------------------------------------------------- */
1037
- /* The surface model, and this is the rule that states it: an in-flow block declares a
1038
- FRAME and no fill. Border, radius and padding are the whole of a card's chrome, and
1039
- what shows through it is the canvas the page already paints.
1040
-
1041
- It used to paint --color-neutral-0 over a --color-neutral-50 canvas — a second colour
1042
- saying what the border already says, and it cost twice. A card dropped onto anything
1043
- that is itself a surface repainted it rather than sitting on it, which is the
1044
- frame-inside-a-frame the plain variant exists to escape; and an app that themed the
1045
- canvas found that its cards did not follow, because the fill named the OTHER end of
1046
- the ramp. Both go away with the declaration: the plain variant is now the base rule
1047
- minus a border and a padding, and a themed canvas reaches every block on the page.
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
1122
+ about the fix: cards were painting --color-neutral-0, the far end of the primitive ramp,
1123
+ 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.
1048
1135
 
1049
1136
  Six rules follow the same line, and they are the framework's other in-flow blocks:
1050
1137
  hubcard-body, profile-card, resource-list-row, empty-state, dataview-card and the full
1051
- DataView's table frame — whose header cells carried the same fill, invisibly, since a
1052
- filled frame sat directly behind them. Three kinds of element deliberately do NOT. An
1053
- overlay has to be opaque over whatever it covers (dialog, popover-panel, toast, the
1054
- combobox list, and appshell-header, which the page scrolls under); a control needs a
1055
- surface of its own to read as a control against the page (input, select, the secondary
1056
- button); and login-card is the one object on an otherwise empty canvas, where the fill
1057
- IS the object.
1058
-
1059
- The washes moved with it, because a wash that painted --color-neutral-50 was painting
1060
- the canvas and on a card with no fill it painted nothing: the table's hover and
1061
- selection, the expanded row's panel, a code block, a neutral alert and a disabled
1062
- control each step one place along the ramp to --color-neutral-100 — which is already
1063
- this sheet's hover wash for every control — or to the --color-interactive-* token that
1064
- names the state. One step along the ramp rather than a value per rule, because the dark
1065
- themes invert it: the same step is darker than the canvas in light and lighter in dark,
1066
- midnight and twilight, which is the direction a recess and a wash want in each.
1067
- --color-bg-inset cannot do that job — in those three themes it is declared AS the
1068
- canvas value, so an inset named from it would be the one thing that disappears. */
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.
1143
+
1144
+ The washes stay one step along the ramp — --color-neutral-100, or the
1145
+ --color-interactive-* token that names the state — rather than returning to
1146
+ --color-neutral-50. That step is now the canvas's neighbour rather than the canvas
1147
+ itself, so a hover on a card is a step DOWN from the object and a hover on the page is a
1148
+ step down from the page, in light; the dark themes invert both, which is the direction a
1149
+ recess wants in each. --color-bg-inset cannot do that job — in three themes it is
1150
+ declared AS the canvas value, so an inset named from it would be the one thing that
1151
+ disappears. */
1069
1152
  [data-terp="card"] {
1070
1153
  display: flex;
1071
1154
  flex-direction: column;
1072
1155
  gap: var(--space-3);
1156
+ background: var(--color-bg-surface);
1073
1157
  border: 1px solid var(--color-neutral-200);
1074
1158
  border-radius: var(--radius-lg);
1159
+ box-shadow: var(--shadow-sm);
1075
1160
  padding: var(--space-4);
1076
1161
  min-width: 0;
1077
1162
  }
@@ -1118,20 +1203,24 @@ textarea[data-terp="input"] {
1118
1203
  flex: 1 1 0;
1119
1204
  min-width: 0;
1120
1205
  }
1121
- /* Chrome off, heading kept. Two declarations removed rather than a second component
1206
+ /* Chrome off, heading kept. Three declarations removed rather than a second component
1122
1207
  with six markers of its own describing the same DOM: a titled region inside something
1123
- that is already a surface wants no second border, and the commonest instance is a
1208
+ that is already a surface wants no second frame, and the commonest instance is a
1124
1209
  section whose body is a DataView — boxed, the table gets a border inside a border and
1125
1210
  loses the full width its own scroll container gives it.
1126
1211
 
1127
- Two, and it was three: background: none went with the base rule's fill. Un-declaring
1128
- what nothing declares is the shape ADR 0094 exists to avoid, and here it would also
1129
- have been the only line in the sheet still implying a card has a colour of its own.
1212
+ background: none is back, and it is the un-declaration the base rule's note warns
1213
+ about, kept deliberately: this variant's whole meaning is "the surface you are already
1214
+ on", so the one thing it must not do is paint a second one. A plain card nested in a
1215
+ card would otherwise be a lighter rectangle inside a lighter rectangle in every dark
1216
+ theme, where surface and raised differ.
1130
1217
 
1131
1218
  padding: 0 rather than dropping the declaration, because the base rule sets it and an
1132
1219
  absent value inherits nothing useful. */
1133
1220
  [data-terp="card"][data-variant="plain"] {
1221
+ background: none;
1134
1222
  border-color: transparent;
1223
+ box-shadow: none;
1135
1224
  padding: 0;
1136
1225
  }
1137
1226
 
@@ -2015,12 +2104,22 @@ textarea[data-terp="input"] {
2015
2104
  gap: var(--space-2) var(--space-4);
2016
2105
  min-width: 0;
2017
2106
  }
2018
- /* The two-row band, and it costs nothing to the pages that get it. A page with badges or a
2019
- lead line ALREADY spends a second row on them; putting the action cluster there too fills
2020
- space that was empty, and it buys the trail the whole of the first row -- which is what
2021
- stops a deep trail having to truncate at all. A page with neither keeps the single row,
2022
- and with it the promise the chrome is measured against: the band matches the app header
2023
- above it.
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.
2024
2123
 
2025
2124
  A grid rather than the flex-wrap this was: wrap order follows source order, so the meta
2026
2125
  group and the cluster could not share a row while staying two groups, and the moment the
@@ -2029,15 +2128,67 @@ textarea[data-terp="input"] {
2029
2128
  whose whole job was to right-align it. Areas say where things go and no free space is
2030
2129
  distributed anywhere, so neither failure has anywhere to happen. */
2031
2130
  [data-terp="page-header"][data-has-meta] {
2032
- grid-template-areas:
2033
- "trail trail"
2034
- "meta actions";
2035
- /* Same-height lines, and 1fr is what spells that in a box whose height nobody declared:
2036
- with an indefinite container the fr rows resolve to the LARGEST row's content rather
2037
- than to a share of a height that does not exist, so both rows come out at the taller
2038
- one. A band of two content-sized rows would otherwise be a short trail line above a
2039
- tall control line, which reads as two different bands rather than one of two lines. */
2040
- grid-auto-rows: 1fr;
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
+ @media ${WIDE_VIEWPORT_QUERY} {
2141
+ [data-terp="page-header"][data-has-meta] {
2142
+ grid-template-areas:
2143
+ "trail actions"
2144
+ "meta meta";
2145
+ }
2146
+ }
2147
+ /* Below the first cutover the band is one column and nothing competes for a line. The trail
2148
+ keeps the leaf and one ancestor: every crumb carries min-width: 0 and an ellipsis while the
2149
+ separators are flex: 0 0 auto, so a trail with no room does not degrade to short labels --
2150
+ it degrades to a row of bare chevrons with the h1 among the casualties. Measured at 360px
2151
+ on a six-crumb page: six labels under 8px, no page title on screen at all, and the cluster
2152
+ overlapping the badges by 24px. Dropping the ancestors takes their separators with them,
2153
+ which is the only degradation here that leaves something readable.
2154
+
2155
+ The actions row is declared only when there IS a cluster -- :has() for the same reason
2156
+ card-header and control-label use it, that the alternative is an attribute the component
2157
+ would have to stamp. A named row with nothing in it is still a row, and with the band's
2158
+ gap under it that is 8px of empty space wedged under the trail on every page that has no
2159
+ actions. */
2160
+ @media ${NARROW_VIEWPORT} {
2161
+ [data-terp="page-header"] {
2162
+ grid-template-columns: minmax(0, 1fr);
2163
+ grid-template-areas: "trail";
2164
+ }
2165
+ [data-terp="page-header"]:has(> [data-terp="page-actions"]) {
2166
+ grid-template-areas:
2167
+ "trail"
2168
+ "actions";
2169
+ }
2170
+ /* Written AFTER the :has() rule and not before it: the two selectors tie at (0,2,0), so
2171
+ source order is what decides a page that carries meta and no cluster, and it belongs to
2172
+ this one. The combined selector below outranks both at (0,3,0). */
2173
+ [data-terp="page-header"][data-has-meta] {
2174
+ grid-template-areas:
2175
+ "trail"
2176
+ "meta";
2177
+ }
2178
+ [data-terp="page-header"][data-has-meta]:has(> [data-terp="page-actions"]) {
2179
+ grid-template-areas:
2180
+ "trail"
2181
+ "meta"
2182
+ "actions";
2183
+ }
2184
+ [data-terp="breadcrumbs"] li:not(:last-child):not(:nth-last-child(2)) {
2185
+ display: none;
2186
+ }
2187
+ [data-terp="breadcrumbs"] li:nth-last-child(2):not(:first-child)::before {
2188
+ content: "…";
2189
+ margin-inline-end: var(--space-2);
2190
+ color: var(--color-neutral-600);
2191
+ }
2041
2192
  }
2042
2193
  /* The band's left group, and it generates NO box. The trail and the meta group have to be
2043
2194
  grid items of the band itself -- they sit on different rows -- but the marker is published
@@ -2053,8 +2204,16 @@ textarea[data-terp="input"] {
2053
2204
  [data-terp="page-heading"] {
2054
2205
  display: contents;
2055
2206
  }
2056
- /* The trail owns the first row outright once there is a second one to own. */
2057
- [data-terp="page-header"] > [data-terp="breadcrumbs"] {
2207
+ /* The trail's placement, and the combinator is the whole of it. This was a CHILD selector,
2208
+ and the trail is not a child of the band: Page renders it inside page-heading, which is
2209
+ display: contents. That removes the BOX and not the node, and selectors match the tree, so
2210
+ the rule matched nothing at all and the trail was auto-placed with its automatic minimum
2211
+ intact. Both halves below were therefore dead from the day the heading group arrived, and
2212
+ the two-row band above was justified by a benefit this rule was supposed to deliver.
2213
+
2214
+ Descendant, not child, and scoped to the band: page-header holds the heading group and the
2215
+ cluster and nothing else, so there is no second trail here to catch by accident. */
2216
+ [data-terp="page-header"] [data-terp="breadcrumbs"] {
2058
2217
  grid-area: trail;
2059
2218
  min-width: 0;
2060
2219
  }
@@ -2094,18 +2253,35 @@ textarea[data-terp="input"] {
2094
2253
  2em } ON the element, and a declaration on the element beats an inherited value however
2095
2254
  specific the ancestor rule is: without this the leaf renders at twice the trail.
2096
2255
 
2097
- Semibold at the trail's own size, which is the whole "the trail is the title" idea in one
2098
- declaration — heavier than its ancestors, not larger.
2099
-
2100
- And no line-height of its own, which is the other half of that idea: it takes the trail's
2101
- (see breadcrumbs, where the value and the defect are recorded). A second value here — 1.3
2102
- against the ancestors' inherited normal — is what left the leaf's glyphs sitting 0.59px
2103
- above the crumb they hang off, in the same font at the same size. */
2256
+ xl, not the trail's own sm. "Heavier than its ancestors, not larger" was the rule while the
2257
+ band was 3rem and the leaf had no room to be anything else, and it cost the page its name:
2258
+ at sm/semibold the title measured the same as a table header, less than the action button
2259
+ beside it, and exactly as much as the card titles of the sections under it — so on a hub
2260
+ every HubCard outranked the page it was on. A screen whose largest type belongs to its
2261
+ content is a screen with no masthead, and that reads as unfinished before any one component
2262
+ does. The scale is 24 / 18 / 16 / 14 again: page title, card title, body, description.
2263
+
2264
+ The one-row band still holds its floor, which is the promise this row makes and the number
2265
+ to re-measure if either half moves. --shell-header-height is 3.5rem now, and xl at the TIGHT
2266
+ step is 28.8px, so the title's line box sits inside 56px with room to spare: measured, a hub's
2267
+ band and the app header above it are both 56.0. At the trail's snug step it would be 32.4 and
2268
+ still fit, but the band that carries meta — which has broken the floor by design, and does not
2269
+ make the claim — would take the extra 3.6px on every page with a lead line, so the tight step
2270
+ is what keeps the two bands one apart rather than two.
2271
+
2272
+ That is also the answer to the line height the trail's own rule argues for. Sharing it keeps
2273
+ the leaf's glyphs on the ancestors' baseline, which mattered when leaf and ancestors were the
2274
+ same size; at 24 against 14 they cannot share a baseline anyway and the li centres them, so
2275
+ the value is free to do the job only it can do here.
2276
+
2277
+ Tracking is the scale's tight step, which only starts earning its keep at this size: -0.02em
2278
+ is 0.48px here and nothing at all at 14px, which is why the trail below does not take it. */
2104
2279
  [data-terp="page-title"] {
2105
2280
  margin: 0;
2106
- font-size: var(--font-size-sm);
2281
+ font-size: var(--font-size-xl);
2282
+ line-height: var(--font-line-height-tight);
2107
2283
  font-weight: var(--font-weight-semibold);
2108
- letter-spacing: 0;
2284
+ letter-spacing: var(--font-letter-spacing-tight);
2109
2285
  color: var(--color-neutral-900);
2110
2286
  }
2111
2287
  /* Status pills next to the title. A row of its own so a page passing several keeps them
@@ -2171,6 +2347,26 @@ textarea[data-terp="input"] {
2171
2347
  box-sizing: border-box;
2172
2348
  border-block-end: 1px solid var(--color-neutral-200);
2173
2349
  }
2350
+ /* The block padding the ONE-ROW band cannot have, spent on the bands that are already more
2351
+ than one row. The rule above stays at var(--space-0) and stays tied to the app header's
2352
+ own padding, because that row is the one making the claim: 48px, the same as the header
2353
+ above it, and the largest control this package ships (2.75rem) has to fit inside it. A band
2354
+ that carries meta has broken that height already and makes no such claim, so it can afford
2355
+ the 4px — and it is the only band where the missing padding was ever visible, since the
2356
+ one-row band centres its single line inside the floor and reads as padded either way.
2357
+ Below the cutover the same is true of a band whose cluster has taken a row of its own.
2358
+
2359
+ The narrow rule weighs (0,3,0) plus :has()'s argument, so (0,4,0) — the same as the meta
2360
+ rule, and they declare the same value, so the tie decides nothing. */
2361
+ [data-terp="page"]:not([data-measure="narrow"]) > [data-terp="page-header"][data-has-meta] {
2362
+ padding-block: var(--space-1);
2363
+ }
2364
+ @media ${NARROW_VIEWPORT} {
2365
+ [data-terp="page"]:not([data-measure="narrow"])
2366
+ > [data-terp="page-header"]:has(> [data-terp="page-actions"]) {
2367
+ padding-block: var(--space-1);
2368
+ }
2369
+ }
2174
2370
  /* The BLEED, which does need a shell, because the negative-margin idiom is only correct when
2175
2371
  the box being escaped is appshell-main and that box pads by exactly --shell-gutter. ADR
2176
2372
  0097 §2 kept "it works with no shell above it at all" as a property of the mechanism, and
@@ -2347,6 +2543,14 @@ textarea[data-terp="input"] {
2347
2543
  display: grid;
2348
2544
  gap: var(--space-3);
2349
2545
  }
2546
+ /* The form's named parts, found by whoever cannot read the labels -- the conformance
2547
+ helpers drive this screen in every locale an app ships. No box, so each field and the
2548
+ button stay grid items of login-form and its gap falls between them as it always has. */
2549
+ [data-terp="login-email"],
2550
+ [data-terp="login-password"],
2551
+ [data-terp="login-submit"] {
2552
+ display: contents;
2553
+ }
2350
2554
  [data-terp="login-separator"] {
2351
2555
  display: flex;
2352
2556
  align-items: center;
@@ -2383,6 +2587,7 @@ textarea[data-terp="input"] {
2383
2587
  gap: var(--space-4);
2384
2588
  padding: var(--space-4);
2385
2589
  max-width: 32rem;
2590
+ background: var(--color-bg-surface);
2386
2591
  border: 1px solid var(--color-neutral-200);
2387
2592
  border-radius: var(--radius-lg);
2388
2593
  }
@@ -2525,8 +2730,10 @@ textarea[data-terp="input"] {
2525
2730
  height: 100%;
2526
2731
  min-height: 10rem;
2527
2732
  padding: var(--space-4);
2733
+ background: var(--color-bg-surface);
2528
2734
  border: 1px solid var(--color-neutral-200);
2529
2735
  border-radius: var(--radius-lg);
2736
+ box-shadow: var(--shadow-sm);
2530
2737
  color: var(--color-neutral-900);
2531
2738
  box-sizing: border-box;
2532
2739
  transition: border-color var(--motion-duration-fast) var(--motion-easing-standard);
@@ -2647,6 +2854,7 @@ textarea[data-terp="input"] {
2647
2854
  [data-terp="dataview"][data-variant="full"] > [data-terp="dataview-scroll"],
2648
2855
  [data-terp="dataview"][data-variant="full"] > [data-terp="dataview-error"],
2649
2856
  [data-terp="dataview"][data-variant="full"] > [data-terp="dataview-skeleton"] {
2857
+ background: var(--color-bg-surface);
2650
2858
  border: 1px solid var(--color-neutral-200);
2651
2859
  border-radius: var(--radius-lg);
2652
2860
  }
@@ -2927,19 +3135,46 @@ input[data-terp="input"][type="password"]::-ms-reveal {
2927
3135
  /* The header cell's inline axis follows density; its block axis does not,
2928
3136
  because --space-2 is already worth what --density-compact-cell-pad-y is. The
2929
3137
  0.04em tracking stays a literal: the contract's letter-spacing scale offers
2930
- tight / base / wide, and wide is 0.08em, which would double it. */
3138
+ tight / base / wide, and wide is 0.08em, which would double it.
3139
+
3140
+ The fill is the canvas step, so the header row reads as a recess in the table's own
3141
+ surface rather than as a first row that happens to be shouting. It is the same step the
3142
+ washes take, and it inverts with them: darker than the surface in light, lighter in the
3143
+ three dark themes. Without it the only thing separating nine uppercase labels from the
3144
+ data under them is a hairline, and at xs that is not enough to stop the eye reading the
3145
+ header as a row.
3146
+
3147
+ The ink moved one step WITH the fill, and that is the fill's cost rather than a separate
3148
+ opinion. --color-fg-subtle measured 4.76:1 on the surface it used to sit on, which is inside
3149
+ AA by six hundredths; against the recess it is 4.20 and axe failed every DataView specimen in
3150
+ light. A wash that dims its own label is not free, and the step that pays for it is
3151
+ --color-fg-muted: 6.69 light, and 8.14 at its worst across the other four. */
2931
3152
  [data-terp="dataview-table"] > thead > tr > th {
2932
3153
  position: relative;
2933
3154
  padding: var(--space-2) var(--density-cell-pad-x);
2934
3155
  text-align: left;
2935
3156
  font-size: var(--font-size-xs);
2936
3157
  font-weight: var(--font-weight-semibold);
2937
- color: var(--color-fg-subtle);
3158
+ color: var(--color-fg-muted);
3159
+ background: var(--color-neutral-50);
2938
3160
  text-transform: uppercase;
2939
3161
  letter-spacing: 0.04em;
2940
3162
  border-bottom: 1px solid var(--color-neutral-200);
2941
3163
  white-space: nowrap;
2942
3164
  }
3165
+ /* The header row's outer corners, which the fill above made visible. The full variant's frame
3166
+ carries the radius and deliberately no overflow: hidden — clipping it would trap the
3167
+ horizontal scroll container and any overlay a cell renders (see the frame's own rule) — so a
3168
+ filled th paints a square corner over the curve, and the grey then pokes outside the border
3169
+ at both top corners. Rounding the two end cells to the same step is the fix that leaves the
3170
+ scroller alone. Keyed on the FULL variant: the embedded one has no frame, and a rounded
3171
+ header cell there would be a curve against nothing. */
3172
+ [data-terp="dataview"][data-variant="full"] [data-terp="dataview-table"] > thead > tr > th:first-child {
3173
+ border-start-start-radius: var(--radius-lg);
3174
+ }
3175
+ [data-terp="dataview"][data-variant="full"] [data-terp="dataview-table"] > thead > tr > th:last-child {
3176
+ border-start-end-radius: var(--radius-lg);
3177
+ }
2943
3178
  /* A column's declared track. A MINIMUM rather than a width, because a specified width is only a
2944
3179
  preference under table-layout: auto and the algorithm shrinks it to fit — which is why the pixel
2945
3180
  hint this replaces did nothing at all, measured in the workbench at three columns asking for
@@ -3119,6 +3354,7 @@ th[data-terp="dataview-actions-cell"] > span {
3119
3354
  display: grid;
3120
3355
  gap: var(--space-2);
3121
3356
  padding: var(--density-cell-pad-y) var(--density-cell-pad-x);
3357
+ background: var(--color-bg-surface);
3122
3358
  border: 1px solid var(--color-neutral-200);
3123
3359
  border-radius: var(--radius-lg);
3124
3360
  box-shadow: var(--shadow-sm);
@@ -3438,6 +3674,7 @@ th[data-terp="dataview-actions-cell"] > span {
3438
3674
  justify-content: space-between;
3439
3675
  gap: var(--space-3);
3440
3676
  padding: var(--space-3);
3677
+ background: var(--color-bg-surface);
3441
3678
  border: 1px solid var(--color-neutral-200);
3442
3679
  border-radius: var(--radius-md);
3443
3680
  }
@@ -3445,8 +3682,9 @@ th[data-terp="dataview-actions-cell"] > span {
3445
3682
  /* Empty / error / loading states ------------------------------------------- */
3446
3683
  /* Same centred block, opposite messages: empty is a dashed outline on the page
3447
3684
  surface because nothing is wrong, error is a filled danger wash because
3448
- something is. Which is now literal — the outline is all of it, and the surface
3449
- underneath is whatever the block was dropped on. */
3685
+ something is. The fill is the surface token rather than the danger one — an
3686
+ empty collection is still the page's object, so it sits on the canvas as an
3687
+ object does. */
3450
3688
  [data-terp="empty-state"] {
3451
3689
  display: grid;
3452
3690
  justify-items: center;
@@ -3454,6 +3692,7 @@ th[data-terp="dataview-actions-cell"] > span {
3454
3692
  padding: var(--space-8) var(--space-6);
3455
3693
  text-align: center;
3456
3694
  color: var(--color-neutral-600);
3695
+ background: var(--color-bg-surface);
3457
3696
  border: 1px dashed var(--color-neutral-300);
3458
3697
  border-radius: var(--radius-lg);
3459
3698
  }
@@ -3829,6 +4068,16 @@ button[data-terp="input"][data-placeholder="true"] {
3829
4068
  gap: var(--space-1);
3830
4069
  justify-items: start;
3831
4070
  }
4071
+ /* The hint and the error as one box. It is emitted only when there is something to say, so
4072
+ a field with neither renders no envelope and no row -- see useControlMessages. The grid
4073
+ restates the gap the field used to put between two loose spans, so a field outside a row
4074
+ is unchanged to the pixel; justify-items keeps each message as wide as its own text
4075
+ rather than as wide as the field, which is what a stretched grid item would do. */
4076
+ [data-terp="field-messages"] {
4077
+ display: grid;
4078
+ gap: var(--space-1);
4079
+ justify-items: start;
4080
+ }
3832
4081
  [data-terp="field-hint"] {
3833
4082
  color: var(--color-fg-subtle);
3834
4083
  font-size: var(--font-size-xs);
@@ -3839,6 +4088,194 @@ button[data-terp="input"][data-placeholder="true"] {
3839
4088
  font-weight: var(--font-weight-medium);
3840
4089
  }
3841
4090
 
4091
+
4092
+ /* Field rows --------------------------------------------------------------- */
4093
+ /* Three shared lines -- label, control, messages -- and each field a subgrid of them.
4094
+
4095
+ THE BASE RULE IS THE NARROW SHAPE, mobile-first like SplitPage's panes and DetailList's
4096
+ columns: one column, each field full width, no subgrid and no alignment problem to solve.
4097
+ Everything below is the wide block's job. Declared this way round because three controls
4098
+ and an action do not fit a phone at any gap, so the row a caller writes is the one that
4099
+ has to give way, not the viewport.
4100
+
4101
+ justify-content: start so the tracks take their content's width and the row does not
4102
+ stretch four controls across a 1600px page. grid-auto-columns keeps each track floored at
4103
+ zero -- an auto track floors at min-content, which a long option label would push past its
4104
+ container, the same failure DetailList's minmax(0, 1fr) exists to stop.
4105
+
4106
+ ROW-GAP LIVES ON THE PARENT AND NOT ON THE SUBGRID. A subgrid takes its parent's gutters
4107
+ unless it declares its own, and a field that declared one would space its own three lines
4108
+ while the row's other tracks kept the parent's -- so a bare button, which is not a subgrid,
4109
+ sat 2px above every control on the row. Measured; it reads as a button that is almost
4110
+ aligned, which is worse than one that is obviously not. */
4111
+ [data-terp="field-row"] {
4112
+ display: grid;
4113
+ row-gap: var(--space-1);
4114
+ column-gap: var(--space-2);
4115
+ }
4116
+ /* The gap prop, column only. Declared after the base rule for the reason DetailList's own
4117
+ roll-call is: both weigh the same, so source order is the only thing deciding, and
4118
+ backwards the prop silently does nothing. */
4119
+ [data-terp="field-row"][data-gap="0"] { column-gap: var(--space-0); }
4120
+ [data-terp="field-row"][data-gap="1"] { column-gap: var(--space-1); }
4121
+ [data-terp="field-row"][data-gap="2"] { column-gap: var(--space-2); }
4122
+ [data-terp="field-row"][data-gap="3"] { column-gap: var(--space-3); }
4123
+ [data-terp="field-row"][data-gap="4"] { column-gap: var(--space-4); }
4124
+ [data-terp="field-row"][data-gap="6"] { column-gap: var(--space-6); }
4125
+ [data-terp="field-row"][data-gap="8"] { column-gap: var(--space-8); }
4126
+ /* Quiet actions ------------------------------------------------------------ */
4127
+ /* A value and the action attached to it, where the action is quiet until someone reaches for
4128
+ it. The row itself is unconditional -- inline-flex so it sits inside a sentence or a table
4129
+ cell rather than claiming a block, and baseline-aligned so a chip and its button sit on the
4130
+ value's own reading line. Only the FADE is conditional, and the whole of the condition is
4131
+ in the query below. */
4132
+ [data-terp="quiet-actions"] {
4133
+ display: inline-flex;
4134
+ align-items: baseline;
4135
+ gap: var(--space-1);
4136
+ }
4137
+ [data-terp="quiet-actions"][data-gap="0"] { gap: var(--space-0); }
4138
+ [data-terp="quiet-actions"][data-gap="1"] { gap: var(--space-1); }
4139
+ [data-terp="quiet-actions"][data-gap="2"] { gap: var(--space-2); }
4140
+ [data-terp="quiet-actions"][data-gap="3"] { gap: var(--space-3); }
4141
+ [data-terp="quiet-actions"][data-gap="4"] { gap: var(--space-4); }
4142
+ [data-terp="quiet-actions"][data-gap="6"] { gap: var(--space-6); }
4143
+ [data-terp="quiet-actions"][data-gap="8"] { gap: var(--space-8); }
4144
+ /* The slot holds the actions together and keeps them on the value's line. It exists at every
4145
+ width and in every pointer mode, because it is what reserves the space: the fade changes
4146
+ opacity and never layout, so nothing on the row moves when a pointer arrives. A value that
4147
+ reflows under the cursor is a value you cannot click. */
4148
+ [data-terp="quiet-actions-slot"] {
4149
+ display: inline-flex;
4150
+ align-items: center;
4151
+ gap: var(--space-1);
4152
+ transition: opacity var(--motion-duration-fast) var(--motion-easing-standard);
4153
+ }
4154
+ /* THE ONLY hover-capability query in this sheet, and it is a correctness gate rather than a
4155
+ refinement. On a touch screen there is no hover to reveal anything, so an unconditional
4156
+ rule would leave the action permanently invisible and permanently tappable -- a control
4157
+ that is operable and unfindable, which is worse than a busy row. Where hovering exists the
4158
+ action fades in on hover of the ROW, so reaching for the value reveals its action, and on
4159
+ :focus-within, because opacity does not remove an element from the tab order and a keyboard
4160
+ user must never be sent to a control they cannot see.
4161
+
4162
+ Introducing a media feature the sheet has not used before is a mechanism change; it is
4163
+ justified here because the alternative is not a worse-looking row but an unusable one, and
4164
+ styles.test.ts pins both halves so neither can be dropped without the other being noticed.
4165
+
4166
+ No prefers-reduced-motion clause is needed: that block already sets transition: none on
4167
+ every [data-terp] element, and this slot is one. */
4168
+ @media (hover: hover) {
4169
+ [data-terp="quiet-actions"] [data-terp="quiet-actions-slot"] {
4170
+ opacity: 0;
4171
+ }
4172
+ [data-terp="quiet-actions"]:hover [data-terp="quiet-actions-slot"],
4173
+ [data-terp="quiet-actions"]:focus-within [data-terp="quiet-actions-slot"] {
4174
+ opacity: 1;
4175
+ }
4176
+ }
4177
+
4178
+ /* Meters ------------------------------------------------------------------- */
4179
+ /* A bar and the value printed beside it. inline-flex so a meter sits in a sentence or a
4180
+ DetailList value as readily as in a stack, and it sets no colour and no size on the value:
4181
+ the printed number is text in its row and reads at that row's ink and step, which is also
4182
+ what keeps its contrast the row's own declared pairing rather than a new one. */
4183
+ [data-terp="meter"] {
4184
+ display: inline-flex;
4185
+ align-items: center;
4186
+ gap: var(--space-2);
4187
+ max-inline-size: 100%;
4188
+ }
4189
+ /* The bar is the native element, so the browser draws the proportion from its attributes and
4190
+ nothing here needs a width that depends on the value. A fixed measure rather than a bar
4191
+ that grows with its container, because meters are read against each other: two bars of
4192
+ different lengths make a 60% and a 40% impossible to compare at a glance. 10rem is what the
4193
+ narrowest hub card -- 16rem, less its padding -- holds beside a three-digit percentage
4194
+ without shrinking; below that it shrinks, to a floor.
4195
+
4196
+ An inline-size and not a flex-basis, and that was measured rather than chosen: an
4197
+ inline-flex root sizes itself from its items' own widths, and a meter's own width is the
4198
+ element's intrinsic 5em. With the measure written as a basis the bar came out 70px in a
4199
+ 14px list and 80px in a 16px sentence -- a length set by the surrounding type.
4200
+
4201
+ The track is --color-bg-inset, a recess, and every fill below holds 3:1 against it in all
4202
+ five themes -- declared in token-pairs.json, so the gate measures it rather than this
4203
+ comment. */
4204
+ [data-terp="meter-bar"] {
4205
+ appearance: none;
4206
+ flex: 0 1 auto;
4207
+ inline-size: 10rem;
4208
+ min-inline-size: 4rem;
4209
+ block-size: var(--space-2);
4210
+ margin: 0;
4211
+ border: 0;
4212
+ border-radius: var(--radius-full);
4213
+ background: var(--color-bg-inset);
4214
+ }
4215
+ /* Blink draws the track and the fill as pseudo-elements, one per region, and this is the
4216
+ block the screenshot lane sees; WebKit documents the same pseudo-elements, and no lane runs
4217
+ it. Each engine's selectors are their own rules and must
4218
+ stay that way: a selector list naming a pseudo-element the engine does not know is invalid
4219
+ as a whole, and the engine drops the entire rule -- measured, the adopted sheet keeps every
4220
+ rule here in Chromium and drops only the -moz ones below. */
4221
+ [data-terp="meter-bar"]::-webkit-meter-bar {
4222
+ block-size: 100%;
4223
+ border: 0;
4224
+ border-radius: var(--radius-full);
4225
+ background: var(--color-bg-inset);
4226
+ }
4227
+ [data-terp="meter-bar"]::-webkit-meter-optimum-value,
4228
+ [data-terp="meter-bar"]::-webkit-meter-suboptimum-value,
4229
+ [data-terp="meter-bar"]::-webkit-meter-even-less-good-value {
4230
+ border-radius: var(--radius-full);
4231
+ background: var(--color-fg-accent);
4232
+ }
4233
+ /* The bands, keyed on the region Meter computes rather than on which pseudo-element the
4234
+ engine chose. Unbanded, the browser still puts every value in its "optimum" region -- so
4235
+ styling by the engine's choice would paint a bare quota in the success tone, a judgement
4236
+ nobody made. The attribute is only stamped when a band is declared. */
4237
+ [data-terp="meter-bar"][data-region="optimum"]::-webkit-meter-optimum-value,
4238
+ [data-terp="meter-bar"][data-region="optimum"]::-webkit-meter-suboptimum-value,
4239
+ [data-terp="meter-bar"][data-region="optimum"]::-webkit-meter-even-less-good-value {
4240
+ background: var(--color-status-success);
4241
+ }
4242
+ [data-terp="meter-bar"][data-region="suboptimum"]::-webkit-meter-optimum-value,
4243
+ [data-terp="meter-bar"][data-region="suboptimum"]::-webkit-meter-suboptimum-value,
4244
+ [data-terp="meter-bar"][data-region="suboptimum"]::-webkit-meter-even-less-good-value {
4245
+ background: var(--color-status-warning);
4246
+ }
4247
+ [data-terp="meter-bar"][data-region="even-less-good"]::-webkit-meter-optimum-value,
4248
+ [data-terp="meter-bar"][data-region="even-less-good"]::-webkit-meter-suboptimum-value,
4249
+ [data-terp="meter-bar"][data-region="even-less-good"]::-webkit-meter-even-less-good-value {
4250
+ background: var(--color-status-danger);
4251
+ }
4252
+ /* Gecko draws the element itself as the track and one ::-moz-meter-bar as the fill. NO LANE
4253
+ SEES THESE: the workbench runs one browser, and that browser drops them. They are written
4254
+ to Gecko's documented pseudo-element, unmeasured, and pinned in Meter.test.tsx so that at
4255
+ least deleting or retoning one is noticed. */
4256
+ [data-terp="meter-bar"]::-moz-meter-bar {
4257
+ border-radius: var(--radius-full);
4258
+ background: var(--color-fg-accent);
4259
+ }
4260
+ [data-terp="meter-bar"][data-region="optimum"]::-moz-meter-bar {
4261
+ background: var(--color-status-success);
4262
+ }
4263
+ [data-terp="meter-bar"][data-region="suboptimum"]::-moz-meter-bar {
4264
+ background: var(--color-status-warning);
4265
+ }
4266
+ [data-terp="meter-bar"][data-region="even-less-good"]::-moz-meter-bar {
4267
+ background: var(--color-status-danger);
4268
+ }
4269
+ /* The value is the root's BASELINE, which is what puts a meter on the line of the text around
4270
+ it: the printed number sits on the baseline its label sits on, and the bar is centred on the
4271
+ number. Without it the root takes its baseline from the bar, whose own is its bottom edge.
4272
+ Tabular figures, so a value that changes does not change width and walk the row around. */
4273
+ [data-terp="meter-value"] {
4274
+ align-self: baseline;
4275
+ font-variant-numeric: tabular-nums;
4276
+ white-space: nowrap;
4277
+ }
4278
+
3842
4279
  /* Tooltips ----------------------------------------------------------------- */
3843
4280
  /* No display declaration here on purpose: the panel is hidden with the hidden
3844
4281
  attribute, and any author display would beat the UA's [hidden] rule and
@@ -4024,6 +4461,12 @@ button[data-terp="input"][data-placeholder="true"] {
4024
4461
  font-size: var(--font-size-sm);
4025
4462
  overflow-wrap: anywhere;
4026
4463
  }
4464
+ /* A name and nothing else: sign-out is found by it, and styled as the menu-item it wraps.
4465
+ No box, so the item stays a grid item of the menu and the menu's gap still spaces it --
4466
+ the markdown wrapper's reasoning, and the same one-declaration rule. */
4467
+ [data-terp="user-menu-sign-out"] {
4468
+ display: contents;
4469
+ }
4027
4470
 
4028
4471
  /* Page actions ------------------------------------------------------------- */
4029
4472
  [data-terp="page-actions"] {
@@ -4080,6 +4523,14 @@ button[data-terp="input"][data-placeholder="true"] {
4080
4523
  z-index: var(--z-index-toast);
4081
4524
  max-width: min(22.5rem, calc(100vw - 2 * var(--space-4)));
4082
4525
  }
4526
+ /* The font-family is declared here, and it is not decoration: this package sets the family
4527
+ per ROOT — on appshell and on login-view — and never on body, so a box outside both
4528
+ inherits the UA default and renders the platform's confirmations in a serif. The toast
4529
+ viewport is exactly that box. ToastProvider wraps the router rather than living inside a
4530
+ page, and a context provider emits no DOM, so the viewport is a SIBLING of appshell, not a
4531
+ descendant; position: fixed has nothing to do with it, since inheritance follows the tree
4532
+ and not the box. The portalled popover panel already carries this declaration for the same
4533
+ reason and says so; this is the one surface that escaped the shell without it. */
4083
4534
  [data-terp="toast"] {
4084
4535
  display: grid;
4085
4536
  grid-template-columns: auto 1fr auto;
@@ -4091,6 +4542,7 @@ button[data-terp="input"][data-placeholder="true"] {
4091
4542
  border-inline-start-width: 3px;
4092
4543
  background: var(--color-neutral-0);
4093
4544
  color: var(--color-neutral-900);
4545
+ font-family: var(--font-family-sans);
4094
4546
  font-size: var(--font-size-sm);
4095
4547
  box-shadow: var(--shadow-md);
4096
4548
  }
@@ -4528,10 +4980,33 @@ button[data-terp="input"][data-placeholder="true"] {
4528
4980
  background: var(--color-sidebar-accent);
4529
4981
  color: var(--color-sidebar-fg);
4530
4982
  }
4983
+ /* The active route, and the brand is in the RAIL rather than in the fill or the ink. It used
4984
+ to be both: --color-brand-primary-soft behind --color-fg-accent. In the three dark themes
4985
+ that soft is a real navy against a near-black sidebar, so the one selected item outweighed
4986
+ the page beside it — measured on midnight, the pill carried more contrast against its own
4987
+ surface than any heading on the screen.
4988
+
4989
+ Moving the fill to neutral is what forced the ink to follow, and the numbers are why rather
4990
+ than a preference: accent ink on the neutral pill measures 4.07:1 in dark and 4.36 in
4991
+ twilight, both under AA, and axe failed every shell specimen in exactly those two themes and
4992
+ no others. --color-sidebar-fg is the pairing the hover rule above already proves, at 9.45 in
4993
+ its worst theme. So the accent survives as the one thing that needs no contrast bar at all.
4994
+
4995
+ Sharing the hover's fill is deliberate and not a collision: hovering the item you are
4996
+ already on should change nothing, and the four signals that separate active from hover are
4997
+ the rail, the weight, and the resting ink the hover is lifting FROM.
4998
+
4999
+ The rail is an inset shadow rather than a border or a pseudo-element: a border would move the
5000
+ label by its own width on selection, and a ::before would need the link to be positioned —
5001
+ the link is the app router's element and the shell owns only where it sits. An inset shadow
5002
+ paints inside the existing box and follows the radius, so nothing reflows and nothing has to
5003
+ be positioned. It is also what survives the icon rail, where the label is visually hidden and
5004
+ a neutral fill alone would say no more than hover does. */
4531
5005
  [data-terp="appshell-nav"] a[aria-current="page"] {
4532
- background: var(--color-brand-primary-soft);
4533
- color: var(--color-fg-accent);
5006
+ background: var(--color-sidebar-accent);
5007
+ color: var(--color-sidebar-fg);
4534
5008
  font-weight: var(--font-weight-semibold);
5009
+ box-shadow: inset var(--border-width-base) 0 0 var(--color-brand-primary);
4535
5010
  }
4536
5011
  [data-terp="appshell-sidebar"][data-collapsed="true"] [data-terp="appshell-nav"] {
4537
5012
  overflow-x: hidden;