actual-css 0.20.2 → 0.21.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 (80) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/README.md +6 -6
  3. package/components.json +19 -4
  4. package/dist/actual.full.css +451 -118
  5. package/dist/actual.full.js +2 -2
  6. package/dist/actual.full.min.css +1 -1
  7. package/dist/types/data-flag.d.ts +1 -0
  8. package/dist/types/enhancement-loader-state.d.ts +6 -0
  9. package/dist/types/enhancement-loader.d.ts +0 -2
  10. package/dist/types/parse-config.d.ts +0 -1
  11. package/dist/types/popover-transport.d.ts +2 -0
  12. package/dist/types/status.d.ts +0 -1
  13. package/dist/types/validation.d.ts +6 -2
  14. package/docs/pages/components/app-navigation.md +67 -0
  15. package/docs/pages/components/button.md +3 -0
  16. package/docs/pages/components/dialog.md +3 -0
  17. package/docs/pages/components/list.md +13 -0
  18. package/docs/pages/components/segmented.md +7 -4
  19. package/docs/pages/components/table.md +4 -1
  20. package/docs/pages/enhancements/flyout.md +12 -3
  21. package/docs/pages/enhancements/tooltip.md +1 -0
  22. package/docs/pages/examples/overview.md +29 -1
  23. package/docs/pages/forms/combobox.md +10 -8
  24. package/docs/pages/forms/labels.md +7 -0
  25. package/docs/pages/forms/overview.md +13 -10
  26. package/docs/pages/forms/validation.md +3 -3
  27. package/docs/pages/foundations/philosophy.md +26 -0
  28. package/docs/pages/foundations/theming.md +80 -7
  29. package/docs/pages/foundations/tokens.md +39 -2
  30. package/docs/pages/guides/coding-agents.md +11 -0
  31. package/docs/pages/guides/introduction.md +1 -1
  32. package/docs/pages/guides/progressive-enhancement.md +88 -20
  33. package/docs/pages/guides/tailwind.md +12 -6
  34. package/docs/pages/guides/upgrading.md +52 -0
  35. package/docs/pages/layout/app-layout.md +50 -1
  36. package/docs/pages/patterns/empty-state.md +48 -10
  37. package/forms.json +325 -0
  38. package/llms.txt +2 -1
  39. package/package.json +3 -1
  40. package/reserved-classes.json +1 -0
  41. package/skills/actual-css/SKILL.md +1 -1
  42. package/skills/actual-css/references/api-and-vocabulary.md +2 -1
  43. package/src/cli/actual-css.js +8 -2
  44. package/src/css/components/app-nav.css +75 -18
  45. package/src/css/components/badge.css +7 -1
  46. package/src/css/components/button.css +20 -3
  47. package/src/css/components/flyout.css +5 -2
  48. package/src/css/components/list.css +28 -13
  49. package/src/css/components/menu.css +18 -0
  50. package/src/css/components/meter.css +4 -0
  51. package/src/css/components/progress.css +9 -2
  52. package/src/css/components/segmented.css +22 -12
  53. package/src/css/components/table.css +21 -2
  54. package/src/css/core/theme.css +11 -1
  55. package/src/css/core/tokens.css +16 -2
  56. package/src/css/forms/choice-card.css +4 -3
  57. package/src/css/forms/choice.css +28 -16
  58. package/src/css/forms/control.css +23 -16
  59. package/src/css/forms/custom-select.css +3 -1
  60. package/src/css/forms/form.css +8 -5
  61. package/src/css/forms/otp.css +2 -1
  62. package/src/css/forms/range.css +20 -6
  63. package/src/css/forms/select.css +12 -4
  64. package/src/css/forms/switch.css +11 -5
  65. package/src/css/layout/app-layout.css +104 -5
  66. package/src/js/data-flag.js +4 -0
  67. package/src/js/dialog.js +5 -8
  68. package/src/js/enhancement-loader-state.js +7 -0
  69. package/src/js/enhancement-loader.js +4 -21
  70. package/src/js/keys.js +5 -7
  71. package/src/js/parse-config.js +0 -2
  72. package/src/js/popover-transport.js +18 -0
  73. package/src/js/status.js +0 -2
  74. package/src/js/surface.js +35 -41
  75. package/src/js/tooltip.js +8 -36
  76. package/src/js/validation.js +24 -10
  77. package/src/tooling/css-bundle.js +5 -0
  78. package/src/tooling/design-tokens.js +8 -1
  79. package/src/tooling/theme-contrast.js +45 -17
  80. package/tokens.json +4 -0
@@ -129,6 +129,17 @@ dialog:not([open]) {
129
129
  --radius-full: 9999px;
130
130
  --shadow: 0 1px 3px rgb(0 0 0 / 0.05), 0 4px 12px rgb(0 0 0 / 0.04);
131
131
  --shadow-popout: 0 0.25rem 0.75rem rgb(0 0 0 / 0.15);
132
+ /* Control-scale relief, unset so the default theme stays flat: a theme sets
133
+ them on its root. --shadow-control lifts the part that moves on a rail
134
+ (selected segment, switch knob, range thumb), where --shadow's blur reads
135
+ as a smudge; --shadow-inset recesses fields and rails. Both enter shadow
136
+ lists, so a theme flattens them with 0 0 #0000, never none. */
137
+ --shadow-control: initial;
138
+ --shadow-inset: initial;
139
+ /* Finish, unset so the default theme stays matte: a background-image every
140
+ solid fill (button, checked choice and switch, progress value, solid
141
+ badge) layers over its color. Keep it a translucent neutral veil. */
142
+ --finish: initial;
132
143
 
133
144
  /* Motion — see reset.css for the prefers-reduced-motion hard reset.
134
145
  --duration scales component transitions (hover/focus); the dedicated
@@ -285,9 +296,12 @@ dialog:not([open]) {
285
296
  when a tinted or translucent surface pulls the edge under 3:1. */
286
297
  --border-control-mix: 45%;
287
298
 
288
- /* Shared icon assets. Override these URLs when a strict CSP disallows data:. */
299
+ /* Shared icon assets. Override these URLs when a strict CSP disallows data:.
300
+ --icon-check is every checked state's mark (checkbox, choice card, chip,
301
+ menu, picker), drawn as a mask in the ink of its context: replace it to
302
+ restyle them all. Its 3-unit stroke draws 2px at 1em. */
289
303
  --icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%238a8594' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
290
- --icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
304
+ --icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
291
305
  --icon-close: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3C/svg%3E");
292
306
  --icon-plus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'/%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E");
293
307
 
@@ -366,7 +380,8 @@ dialog:not([open]) {
366
380
  * Exception: --surface-opaque and --surface-solid-fg are public; a theme with
367
381
  * translucent surfaces overrides them with opaque values. --border-control is
368
382
  * public too: the resting edge of a neutral control, apart from structural
369
- * separators. --control-default-bg is the inherited resting field fill.
383
+ * separators. --control-default-bg and --control-default-border are the
384
+ * inherited resting field fill and edge.
370
385
  *
371
386
  * Internal:
372
387
  * --hgroup-gap
@@ -492,6 +507,12 @@ dialog:not([open]) {
492
507
  /* Inherited resting field fill, shared with external control bridges.
493
508
  Component state rules still own readonly, disabled and invalid fills. */
494
509
  --control-default-bg: var(--surface);
510
+ /* Inherited resting field edge: the quiet --border, like a neutral outline
511
+ button. A known WCAG 1.4.11 trade-off: on a fill equal to the surface the
512
+ field reads by its label and place, not a 3:1 edge (actual-css contrast
513
+ warns). Increased contrast restores --border-control below; a product
514
+ that needs strong identification everywhere sets it on :root. */
515
+ --control-default-border: var(--border);
495
516
  }
496
517
 
497
518
  /* Custom properties accept unknown functions, so guard the pair to preserve
@@ -624,6 +645,9 @@ dialog:not([open]) {
624
645
  --focus-ring-width: 3px;
625
646
  --text-muted: var(--text);
626
647
  --text-subtle: var(--text);
648
+ /* Fields are identified by a 3:1 edge again, quiet or borderless themes
649
+ included. */
650
+ --control-default-border: var(--border-control);
627
651
  }
628
652
  }
629
653
 
@@ -1669,11 +1693,19 @@ mark {
1669
1693
  *
1670
1694
  * Docs: docs/pages/layout/app-layout.md
1671
1695
  *
1696
+ * data-nav="rail" is the application's desktop preference for a captioned rail.
1697
+ * It only changes the side presentation; the bottom bar ignores it. Setting,
1698
+ * toggling and persisting it belong to the application.
1699
+ *
1672
1700
  * Public hooks:
1673
1701
  * --app-nav-side-size
1702
+ * --app-nav-rail-size
1703
+ * --app-layout-bar-size
1674
1704
  */
1675
1705
  .app-layout {
1676
1706
  --app-nav-side-size: 12rem;
1707
+ --app-nav-rail-size: 5.5rem;
1708
+ --app-layout-bar-size: calc(var(--control-size) + var(--space-30) * 2);
1677
1709
 
1678
1710
  display: grid;
1679
1711
  grid-template:
@@ -1720,23 +1752,68 @@ mark {
1720
1752
  / var(--app-nav-side-size) minmax(0, 1fr);
1721
1753
  }
1722
1754
 
1755
+ /* A column, not grid rows: the footer takes the free space above it with an
1756
+ auto margin. Scrolls on its own when the destinations outgrow a short
1757
+ viewport, so the footer follows the last link instead of covering it. */
1758
+ /* Where the brand lives decides who owns the top-left corner. A nav header
1759
+ claims it, and the nav runs the full height; without one the brand is in
1760
+ the topbar, which then spans the navigation as a global bar. Areas only:
1761
+ columns stay with the rules above and the rail's, which this selector
1762
+ would outweigh. Without :has() the nav keeps the full height. */
1763
+ .app-layout:not(:has(> .app-nav > header)) {
1764
+ grid-template-areas:
1765
+ "topbar topbar"
1766
+ "nav main";
1767
+ }
1768
+
1723
1769
  .app-layout > .app-nav {
1724
1770
  position: sticky;
1725
1771
  inset-block: 0;
1726
- grid-auto-flow: row;
1727
- grid-auto-rows: minmax(var(--control-size-lg), auto);
1728
- grid-auto-columns: auto;
1729
- align-content: start;
1772
+ display: flex;
1773
+ flex-direction: column;
1730
1774
  gap: var(--space-20);
1731
1775
  min-block-size: 0;
1732
1776
  padding-block: max(var(--space-20), env(safe-area-inset-top))
1733
1777
  max(var(--space-20), env(safe-area-inset-bottom));
1734
1778
  padding-inline: var(--space-20);
1779
+ overflow-y: auto;
1735
1780
  border-block-start: 0;
1736
1781
  border-inline-end: var(--border-width) solid var(--ui-border, var(--border));
1737
1782
  }
1738
1783
 
1739
- .app-layout > .app-nav > a {
1784
+ /* An explicit tile min-size would otherwise let an overflowing column
1785
+ shrink a two-line label below its content. */
1786
+ .app-layout > .app-nav > * {
1787
+ flex: none;
1788
+ }
1789
+
1790
+ .app-layout > .app-nav > :is(header, footer) {
1791
+ display: grid;
1792
+ gap: var(--space-20);
1793
+ }
1794
+
1795
+ /* The nav spans both rows, so its header cannot read the topbar's height.
1796
+ Both share one band instead: the header's first row (the brand) centres
1797
+ on the topbar's line, a primary action stacks below it, and the first
1798
+ destination starts below the band, level with the main region. */
1799
+ .app-layout > .topbar {
1800
+ min-block-size: calc(var(--app-layout-bar-size) + env(safe-area-inset-top));
1801
+ }
1802
+
1803
+ .app-layout > .app-nav > header {
1804
+ grid-template-rows: var(--app-layout-bar-size);
1805
+ align-items: center;
1806
+ /* Starts at the nav's border edge, as the topbar does at the viewport's:
1807
+ cancels the nav's top padding and re-adds the inset above the band. */
1808
+ margin-block-start: calc(max(var(--space-20), env(safe-area-inset-top)) * -1);
1809
+ padding-block-start: env(safe-area-inset-top);
1810
+ }
1811
+
1812
+ .app-layout > .app-nav > footer {
1813
+ margin-block-start: auto;
1814
+ }
1815
+
1816
+ .app-layout > .app-nav > :is(a, button) {
1740
1817
  grid-template-rows: auto;
1741
1818
  grid-template-columns: 1.5rem minmax(0, 1fr);
1742
1819
  place-content: center start;
@@ -1744,9 +1821,55 @@ mark {
1744
1821
  justify-items: start;
1745
1822
  gap: var(--space-30);
1746
1823
  padding-inline: var(--space-30);
1824
+ /* The xs caption suits a label under an icon in a cramped bar; beside the
1825
+ icon it reads as a navigation link, at body size like .nav-link. */
1826
+ font-size: inherit;
1747
1827
  text-align: start;
1748
1828
  }
1749
1829
 
1830
+ /* A labelled row is the target itself: the state fills the whole row and
1831
+ the icon drops its pill (app-nav.css), back to a plain glyph. */
1832
+ .app-layout:not([data-nav="rail"]) > .app-nav > :is(a, button) {
1833
+ background: var(--app-nav-fill, transparent);
1834
+ }
1835
+
1836
+ .app-layout:not([data-nav="rail"]) > .app-nav > a[aria-current="page"] {
1837
+ color: var(--app-nav-ink);
1838
+ }
1839
+
1840
+ .app-layout:not([data-nav="rail"])
1841
+ > .app-nav
1842
+ > :is(a, button)
1843
+ > :where(svg, img, [aria-hidden="true"]) {
1844
+ padding: 0;
1845
+ background: none;
1846
+ color: inherit;
1847
+ }
1848
+
1849
+ .app-layout[data-nav="rail"] {
1850
+ grid-template-columns: var(--app-nav-rail-size) minmax(0, 1fr);
1851
+ }
1852
+
1853
+ /* The rail keeps a caption under each icon, the bottom bar's tile turned
1854
+ upright: a visible label needs no tooltip and names the tile for everyone.
1855
+ The track fits single-word xs captions ("Notifications" measured 76px),
1856
+ with the nav's inline padding narrowed so the tile keeps that width; two
1857
+ words wrap onto a second line. */
1858
+ .app-layout[data-nav="rail"] > .app-nav {
1859
+ padding-inline: var(--space-10);
1860
+ }
1861
+
1862
+ .app-layout[data-nav="rail"] > .app-nav > :is(a, button) {
1863
+ grid-template-rows: auto auto;
1864
+ grid-template-columns: auto;
1865
+ place-content: center;
1866
+ justify-items: center;
1867
+ gap: var(--space-10);
1868
+ padding: var(--space-10) 0;
1869
+ font-size: var(--font-size-xs);
1870
+ text-align: center;
1871
+ }
1872
+
1750
1873
  /* In the side layout the FAB owns the viewport's bottom safe-area inset. */
1751
1874
  .app-layout > .fab {
1752
1875
  margin-block-end: max(var(--fab-offset), env(safe-area-inset-bottom));
@@ -2329,6 +2452,7 @@ mark {
2329
2452
  * .field-group.flush, .required-mark.
2330
2453
  *
2331
2454
  * Public hooks:
2455
+ * --field-label-scale
2332
2456
  * --fieldset-legend-padding-inline
2333
2457
  */
2334
2458
  .field {
@@ -2356,12 +2480,14 @@ mark {
2356
2480
  own size the hierarchy rested on weight alone, and a stack of medium
2357
2481
  labels read louder than the fields. Medium and the full ink keep it a
2358
2482
  clear read. A fraction of --control-font-size, not a fixed step, so it
2359
- follows .sm/.lg on the .field whatever element holds the label. The legend
2360
- titles a group, one level up, and is set small inside the frame, so it
2361
- keeps the heavier weight. */
2483
+ follows .sm/.lg on the .field whatever element holds the label.
2484
+ --field-label-scale is the author hook for that fraction (1 sets labels at
2485
+ the field text size); its fallback stays here, not on :root, so the hook
2486
+ can be set on any container. The legend titles a group, one level up, and
2487
+ is set small inside the frame, so it keeps the heavier weight. */
2362
2488
  .field-label {
2363
2489
  color: var(--text);
2364
- font-size: calc(var(--control-font-size) * 0.875);
2490
+ font-size: calc(var(--control-font-size) * var(--field-label-scale, 0.875));
2365
2491
  font-weight: var(--font-weight-medium);
2366
2492
  }
2367
2493
 
@@ -2387,7 +2513,7 @@ mark {
2387
2513
  .field-group.flush > legend {
2388
2514
  margin-block-end: var(--space-10);
2389
2515
  padding-inline: 0;
2390
- font-size: calc(var(--control-font-size) * 0.875);
2516
+ font-size: calc(var(--control-font-size) * var(--field-label-scale, 0.875));
2391
2517
  }
2392
2518
 
2393
2519
  .field-help {
@@ -2429,9 +2555,12 @@ mark {
2429
2555
  * underline-style lower edge instead of a uniform border.
2430
2556
  *
2431
2557
  * --control-default-border is the inherited resting edge, the twin of
2432
- * --control-default-bg: a theme sets both on its root, where --control-border
2433
- * itself is owned by the state rules below. Paired with the lower-edge hook it
2434
- * moves the 3:1 identification to the bottom alone (quiet sides, or none).
2558
+ * --control-default-bg: theme.css sets both (the quiet --border, and
2559
+ * --border-control under increased contrast), and a theme sets them on its
2560
+ * root, where --control-border itself is owned by the state rules below.
2561
+ * --border-control there is strong field identification; paired with the
2562
+ * lower-edge hook it puts the 3:1 cue on the bottom alone. The fallback below
2563
+ * is the strong edge, for a page that unsets the token.
2435
2564
  * readonly and disabled reset the lower edge, so an inherited accent or 3:1
2436
2565
  * underline never marks a field the user cannot edit.
2437
2566
  *
@@ -2445,8 +2574,8 @@ mark {
2445
2574
  * --control-shadow
2446
2575
  * --control-border-block-end-color
2447
2576
  * --control-border-block-end-width
2448
- * --control-hover-border (input and textarea)
2449
- * --control-hover-bg (select)
2577
+ * --control-hover-border
2578
+ * --control-hover-bg
2450
2579
  */
2451
2580
  .input,
2452
2581
  .textarea,
@@ -2471,10 +2600,11 @@ mark {
2471
2600
  background: var(--control-bg);
2472
2601
  color: var(--control-fg);
2473
2602
  /* why: an unset hook, so a theme can give every field a resting elevation
2474
- that focus keeps (see the focus rule). The fallback is none, the same as
2475
- the focus rule's: a transparent 0 0 shadow here made focus transition
2476
- between two values and expose a phantom shadow mid-way. */
2477
- box-shadow: var(--control-shadow, none);
2603
+ that focus keeps (see the focus rule); --shadow-inset recesses fields and
2604
+ rails alike. The fallback is none, the same as the focus rule's: a
2605
+ transparent 0 0 shadow here made focus transition between two values and
2606
+ expose a phantom shadow mid-way. */
2607
+ box-shadow: var(--control-shadow, var(--shadow-inset, none));
2478
2608
  font-size: var(--control-font-size);
2479
2609
  cursor: var(--control-cursor);
2480
2610
  /* No outline: none here — the core :focus fallback must survive for browsers
@@ -2494,13 +2624,16 @@ mark {
2494
2624
  resize: vertical;
2495
2625
  }
2496
2626
 
2497
- .input:hover:not(:disabled),
2498
- .textarea:hover:not(:disabled) {
2499
- --control-border: var(--control-hover-border, var(--text-subtle));
2500
- }
2501
-
2627
+ /* One hover for every field, so a select never answers differently from the
2628
+ input beside it: the edge darkens, and the fill changes once a theme sets
2629
+ --control-hover-bg (a theme that clears the hover edge, such as an
2630
+ underline or a borderless well, needs one). A readonly field is not
2631
+ editable, so it keeps its rest state. */
2632
+ .input:hover:not(:disabled, [readonly]),
2633
+ .textarea:hover:not(:disabled, [readonly]),
2502
2634
  .select:hover:not(:disabled) {
2503
- --control-bg: var(--control-hover-bg, var(--surface-subtle));
2635
+ --control-border: var(--control-hover-border, var(--text-subtle));
2636
+ --control-bg: var(--control-hover-bg, var(--control-default-bg, var(--surface)));
2504
2637
  }
2505
2638
 
2506
2639
  /* Field focus is an inset outline: offset = -width keeps every pixel inside
@@ -2515,7 +2648,7 @@ mark {
2515
2648
  .select:focus-visible:not(:disabled) {
2516
2649
  outline: var(--focus-ring-width) solid var(--form-invalid-border, var(--focus));
2517
2650
  outline-offset: calc(var(--focus-ring-width) * -1);
2518
- box-shadow: var(--control-shadow, none);
2651
+ box-shadow: var(--control-shadow, var(--shadow-inset, none));
2519
2652
  }
2520
2653
 
2521
2654
  .input[readonly],
@@ -2543,6 +2676,8 @@ mark {
2543
2676
  /*
2544
2677
  * Checkbox and radio controls.
2545
2678
  *
2679
+ * Docs: docs/pages/forms/overview.md
2680
+ *
2546
2681
  * Native inputs keep their behavior while sharing custom geometry, checked,
2547
2682
  * focus, and disabled states across semantic forms and classed aliases. This
2548
2683
  * file also owns the .choice label layout (input + label text) so the whole
@@ -2723,12 +2858,15 @@ mark {
2723
2858
  transition: transform var(--duration);
2724
2859
  }
2725
2860
 
2861
+ /* The check is --icon-check, the mark every checked state shares (cards,
2862
+ chips, menus, the picker), at 1em: a 24-unit icon with a 3-unit stroke
2863
+ draws 2px at 16px. Replace the token to restyle every check at once. */
2726
2864
  .check::before {
2727
- inline-size: 0.58em;
2728
- block-size: 0.34em;
2729
- border-inline-start: 2px solid currentColor;
2730
- border-block-end: 2px solid currentColor;
2731
- transform: translateY(-0.06em) rotate(-45deg) scale(0);
2865
+ inline-size: 1em;
2866
+ block-size: 1em;
2867
+ background: currentColor;
2868
+ -webkit-mask: var(--icon-check) center / contain no-repeat;
2869
+ mask: var(--icon-check) center / contain no-repeat;
2732
2870
  }
2733
2871
 
2734
2872
  .radio::before {
@@ -2738,25 +2876,26 @@ mark {
2738
2876
  background: currentColor;
2739
2877
  }
2740
2878
 
2879
+ /* Checked is a solid fill, so it takes the theme finish like a solid button. */
2741
2880
  .check:is(:checked, :indeterminate),
2742
2881
  .radio:checked {
2743
2882
  --choice-border: var(--intent, var(--state-selected));
2744
2883
  --choice-bg: var(--intent, var(--state-selected));
2745
2884
  --choice-mark: var(--intent-fg, var(--state-selected-fg));
2746
- }
2747
2885
 
2748
- .check:checked::before {
2749
- transform: translateY(-0.06em) rotate(-45deg) scale(1);
2886
+ background-image: var(--finish, none);
2750
2887
  }
2751
2888
 
2889
+ /* The dash stays drawn: the same layer without the mask, flattened to a bar
2890
+ the check's stroke weight. */
2752
2891
  .check:indeterminate::before {
2753
- border-inline-start: 0;
2892
+ -webkit-mask: none;
2893
+ mask: none;
2754
2894
  inline-size: 0.6em;
2755
- block-size: 0;
2756
- border-block-end: 2px solid currentColor;
2757
- transform: scale(1);
2895
+ block-size: 2px;
2758
2896
  }
2759
2897
 
2898
+ .check:is(:checked, :indeterminate)::before,
2760
2899
  .radio:checked::before {
2761
2900
  transform: scale(1);
2762
2901
  }
@@ -2783,10 +2922,16 @@ mark {
2783
2922
  opacity: 1;
2784
2923
  }
2785
2924
 
2786
- /* Forced colors intentionally stay under UA control: the visible check/dot
2787
- carries state while native remapping preserves platform contrast and focus.
2788
- If real HCM testing ever loses a mark, opt out on that pseudo only—never on
2789
- the interactive input host. */
2925
+ /* Forced colors stay under UA control on the input host, which keeps platform
2926
+ contrast and focus. The marks are currentColor fills (the check a mask, the
2927
+ dash and dot plain), which the system remaps to Canvas, erasing the state:
2928
+ they opt out on the pseudo only, and inherit the host's forced ink. */
2929
+ @media (forced-colors: active) {
2930
+ .check::before,
2931
+ .radio::before {
2932
+ forced-color-adjust: none;
2933
+ }
2934
+ }
2790
2935
 
2791
2936
  /*
2792
2937
  * Select — chevron and appearance layer on top of the shared text-control
@@ -2802,17 +2947,25 @@ mark {
2802
2947
  *
2803
2948
  * Public hooks:
2804
2949
  * --select-icon-size
2950
+ * --select-icon-inset
2805
2951
  */
2806
2952
  /* --select-icon-size is typographic (em), so the reserved slot and the
2807
2953
  pictogram scale with the control's font size, not a fixed rem sliver. */
2808
2954
  .select:not(:is([multiple], [size]:not([size="1"]))) {
2809
2955
  --select-icon-size: 1em;
2956
+ /* why: optical, not geometric. The chevron is drawn on the middle half of
2957
+ its box (6..18 of 24), so a box at the pad left its ink a quarter icon
2958
+ further in than the text on the other side and than the native date,
2959
+ time and search icons, which fill their box. Shifting the box by that
2960
+ margin puts the ink at the pad. A replacement --icon-chevron that fills
2961
+ its box sets this to the pad. */
2962
+ --select-icon-inset: calc(var(--control-pad-x) - var(--select-icon-size) * 0.25);
2810
2963
 
2811
2964
  appearance: none;
2812
2965
  -webkit-appearance: none;
2813
2966
  padding-inline-end: calc(var(--control-pad-x) * 2 + var(--select-icon-size));
2814
2967
  background-image: var(--icon-chevron);
2815
- background-position: center right var(--control-pad-x);
2968
+ background-position: center right var(--select-icon-inset);
2816
2969
  background-size: var(--select-icon-size) auto;
2817
2970
  background-repeat: no-repeat;
2818
2971
  }
@@ -2824,15 +2977,15 @@ mark {
2824
2977
  directionality, so the explicit ltr rule neutralizes an outer RTL fallback
2825
2978
  for a nested direction change. */
2826
2979
  [dir="rtl"] .select:not(:is([multiple], [size]:not([size="1"]))) {
2827
- background-position: center left var(--control-pad-x);
2980
+ background-position: center left var(--select-icon-inset);
2828
2981
  }
2829
2982
 
2830
2983
  .select:not(:is([multiple], [size]:not([size="1"]))):dir(ltr) {
2831
- background-position: center right var(--control-pad-x);
2984
+ background-position: center right var(--select-icon-inset);
2832
2985
  }
2833
2986
 
2834
2987
  .select:not(:is([multiple], [size]:not([size="1"]))):dir(rtl) {
2835
- background-position: center left var(--control-pad-x);
2988
+ background-position: center left var(--select-icon-inset);
2836
2989
  }
2837
2990
 
2838
2991
  /* Both forced-colors and prefers-contrast hand the arrow back to the
@@ -3284,6 +3437,8 @@ mark {
3284
3437
  border: var(--border-width) solid var(--form-invalid-border, var(--switch-border));
3285
3438
  border-radius: var(--radius-full);
3286
3439
  background: var(--switch-bg);
3440
+ /* A rail, recessed with the fields when a theme sets --shadow-inset. */
3441
+ box-shadow: var(--shadow-inset, none);
3287
3442
  appearance: none;
3288
3443
  -webkit-appearance: none;
3289
3444
  cursor: pointer;
@@ -3304,11 +3459,11 @@ mark {
3304
3459
  }
3305
3460
  }
3306
3461
 
3307
- /* No elevation on the knob: --shadow is a surface elevation (card, modal,
3308
- drawer, fab), and at this size its 12px blur reads as a smudge that spills
3309
- past the rail while carrying no state. The range thumb — the same kind of
3310
- small moving part — stays flat for the same reason. The concentric inset
3311
- against the track is what makes the knob legible. */
3462
+ /* Never --shadow on the knob: it is a surface elevation (card, modal, drawer,
3463
+ fab), and at this size its 12px blur reads as a smudge that spills past the
3464
+ rail while carrying no state. A theme lifts it with the control-scale
3465
+ --shadow-control; unset, the knob stays flat and the concentric inset
3466
+ against the track is what makes it legible. */
3312
3467
  .switch::before {
3313
3468
  content: "";
3314
3469
  /* Out of flow like the checkbox mark, so the track carries no in-flow item
@@ -3324,6 +3479,7 @@ mark {
3324
3479
  block-size: var(--switch-knob-size);
3325
3480
  border-radius: var(--radius-full);
3326
3481
  background: var(--switch-knob);
3482
+ box-shadow: var(--shadow-control, none);
3327
3483
  transition:
3328
3484
  transform var(--duration),
3329
3485
  background-color var(--duration);
@@ -3337,10 +3493,13 @@ mark {
3337
3493
  }
3338
3494
  }
3339
3495
 
3496
+ /* The checked track is a solid fill: it takes the theme finish. */
3340
3497
  .switch:checked {
3341
3498
  --switch-bg: var(--intent, var(--state-selected));
3342
3499
  --switch-border: var(--switch-bg);
3343
3500
  --switch-knob: var(--intent-fg, var(--state-selected-fg));
3501
+
3502
+ background-image: var(--finish, none);
3344
3503
  }
3345
3504
 
3346
3505
  .switch:checked::before {
@@ -3459,6 +3618,7 @@ mark {
3459
3618
  --range-fill-from: to left;
3460
3619
  }
3461
3620
 
3621
+ /* A rail, recessed with the fields when a theme sets --shadow-inset. */
3462
3622
  .range::-webkit-slider-runnable-track {
3463
3623
  block-size: var(--range-track-height);
3464
3624
  border-radius: var(--radius-full);
@@ -3467,6 +3627,7 @@ mark {
3467
3627
  var(--range-fill-bg) var(--range-progress),
3468
3628
  var(--range-track-bg) var(--range-progress)
3469
3629
  );
3630
+ box-shadow: var(--shadow-inset, none);
3470
3631
  }
3471
3632
 
3472
3633
  .range::-moz-range-track {
@@ -3477,6 +3638,7 @@ mark {
3477
3638
  var(--range-fill-bg) var(--range-progress),
3478
3639
  var(--range-track-bg) var(--range-progress)
3479
3640
  );
3641
+ box-shadow: var(--shadow-inset, none);
3480
3642
  }
3481
3643
 
3482
3644
  .range::-webkit-slider-thumb {
@@ -3491,8 +3653,11 @@ mark {
3491
3653
  cursor: inherit;
3492
3654
  /* Permanent surface separator: the fill defaults to the thumb color, so
3493
3655
  without this the thumb would melt into the filled part of the track.
3494
- Focus-visible keeps this ring and adds the --focus ring outside it. */
3495
- box-shadow: 0 0 0 2px var(--surface-opaque);
3656
+ Focus-visible keeps this ring and adds the --focus ring outside it. A
3657
+ theme's --shadow-control comes last, under both rings. */
3658
+ box-shadow:
3659
+ 0 0 0 2px var(--surface-opaque),
3660
+ var(--shadow-control, 0 0 #0000);
3496
3661
  transition: box-shadow var(--duration);
3497
3662
  }
3498
3663
 
@@ -3503,7 +3668,9 @@ mark {
3503
3668
  border: 0;
3504
3669
  background: var(--range-thumb-bg);
3505
3670
  cursor: inherit;
3506
- box-shadow: 0 0 0 2px var(--surface-opaque);
3671
+ box-shadow:
3672
+ 0 0 0 2px var(--surface-opaque),
3673
+ var(--shadow-control, 0 0 #0000);
3507
3674
  transition: box-shadow var(--duration);
3508
3675
  }
3509
3676
 
@@ -3522,13 +3689,15 @@ mark {
3522
3689
  .range:focus-visible::-webkit-slider-thumb {
3523
3690
  box-shadow:
3524
3691
  0 0 0 2px var(--surface-opaque),
3525
- 0 0 0 calc(2px + var(--focus-ring-width)) var(--focus);
3692
+ 0 0 0 calc(2px + var(--focus-ring-width)) var(--focus),
3693
+ var(--shadow-control, 0 0 #0000);
3526
3694
  }
3527
3695
 
3528
3696
  .range:focus-visible::-moz-range-thumb {
3529
3697
  box-shadow:
3530
3698
  0 0 0 2px var(--surface-opaque),
3531
- 0 0 0 calc(2px + var(--focus-ring-width)) var(--focus);
3699
+ 0 0 0 calc(2px + var(--focus-ring-width)) var(--focus),
3700
+ var(--shadow-control, 0 0 #0000);
3532
3701
  }
3533
3702
 
3534
3703
  .range:disabled {
@@ -3546,7 +3715,9 @@ mark {
3546
3715
  and would win the variable, leaving a Canvas-remapped fill.
3547
3716
  The split lives in a background-image, which forced-color-adjust: auto
3548
3717
  drops — so the tracks opt out locally. The colors stay system keywords,
3549
- keeping native contrast adaptation; only the host keeps adjusting. */
3718
+ keeping native contrast adaptation; only the host keeps adjusting. Opting
3719
+ out also keeps a theme's --shadow-inset, which the forced palette would
3720
+ drop everywhere else, hence the reset. */
3550
3721
  @media (forced-colors: active) {
3551
3722
  .range {
3552
3723
  --range-track-bg: CanvasText;
@@ -3561,6 +3732,7 @@ mark {
3561
3732
  Highlight var(--range-progress),
3562
3733
  CanvasText var(--range-progress)
3563
3734
  );
3735
+ box-shadow: none;
3564
3736
  }
3565
3737
 
3566
3738
  .range::-moz-range-track {
@@ -3570,6 +3742,7 @@ mark {
3570
3742
  Highlight var(--range-progress),
3571
3743
  CanvasText var(--range-progress)
3572
3744
  );
3745
+ box-shadow: none;
3573
3746
  }
3574
3747
  .range::-webkit-slider-thumb {
3575
3748
  background: ButtonFace;
@@ -3745,11 +3918,12 @@ mark {
3745
3918
  border-radius: var(--radius-sm);
3746
3919
  }
3747
3920
 
3748
- /* Check mark */
3921
+ /* Check mark: --icon-check, as on .check. 80% of the indicator is 1em at the
3922
+ default size, the checkbox's mark, and grows with a larger indicator. */
3749
3923
  .choice-card::after {
3750
3924
  background: var(--intent-fg, var(--state-selected-fg));
3751
- -webkit-mask: var(--icon-check) center / 60% no-repeat;
3752
- mask: var(--icon-check) center / 60% no-repeat;
3925
+ -webkit-mask: var(--icon-check) center / 80% no-repeat;
3926
+ mask: var(--icon-check) center / 80% no-repeat;
3753
3927
  z-index: 2;
3754
3928
  }
3755
3929
 
@@ -4046,6 +4220,8 @@ mark {
4046
4220
  /*
4047
4221
  * Customizable select — appearance: base-select picker enhancement.
4048
4222
  *
4223
+ * Docs: docs/pages/forms/overview.md
4224
+ *
4049
4225
  * Progressive enhancement on top of the native .select baseline in select.css.
4050
4226
  * Wrapped in @supports and gated on fine pointer devices so it never blocks a
4051
4227
  * layout. Add .native to a specific select to opt out.
@@ -4093,7 +4269,7 @@ mark {
4093
4269
  --control-bg: var(--surface-raised);
4094
4270
  outline: var(--focus-ring-width) solid var(--form-invalid-border, var(--focus));
4095
4271
  outline-offset: calc(var(--focus-ring-width) * -1);
4096
- box-shadow: var(--control-shadow, none);
4272
+ box-shadow: var(--control-shadow, var(--shadow-inset, none));
4097
4273
  }
4098
4274
 
4099
4275
  &::picker-icon {
@@ -4284,7 +4460,8 @@ mark {
4284
4460
  --otp-cell-size: var(--control-size);
4285
4461
  --otp-gap: var(--space-10);
4286
4462
  --otp-font-size: 1.5em;
4287
- --otp-cell-border: var(--border-control);
4463
+ /* A text field per cell: the same resting edge as .input. */
4464
+ --otp-cell-border: var(--control-default-border, var(--border-control));
4288
4465
  --otp-cell-bg: var(--surface);
4289
4466
  --otp-caret-space: calc((var(--otp-cell-size) - 1ch) / 2 + var(--otp-gap) + 1px);
4290
4467
 
@@ -4502,7 +4679,16 @@ mark {
4502
4679
  );
4503
4680
  border-block-end-width: var(--btn-border-block-end-width, var(--border-width));
4504
4681
  border-radius: var(--btn-radius);
4505
- background: var(--btn-bg);
4682
+ /* why: the fill is a color and the finish (--finish, the token every solid
4683
+ fill reads) an image layered over it, so a theme lights every intent the
4684
+ same way without restating its color, and the hover (a background-color
4685
+ change under an inset overlay) keeps the finish. --btn-bg must stay a
4686
+ color: an image there invalidates the declaration. From the border box,
4687
+ so a repeated tile does not show its bottom edge in the transparent
4688
+ border along the top. */
4689
+ background-color: var(--btn-bg);
4690
+ background-image: var(--finish, none);
4691
+ background-origin: border-box;
4506
4692
  color: var(--btn-fg);
4507
4693
  /* why: an unset hook rather than none, so a theme or container can give
4508
4694
  every button an elevation the hover overlay composes with instead of
@@ -4582,6 +4768,14 @@ mark {
4582
4768
  --btn-hover-overlay: transparent;
4583
4769
  }
4584
4770
 
4771
+ /* A finish lights a solid fill: the recipes without one stay flat. A
4772
+ declaration, not a reset of --finish, so the token does not stop at the
4773
+ button for its content. A theme that wants a sheen on one of them paints
4774
+ its own background-image there. */
4775
+ .btn:is(.outline, .ghost, .link, .soft, .surface) {
4776
+ background-image: none;
4777
+ }
4778
+
4585
4779
  /* Shared hover recipe — sets --ui-hover-bg consumed by the hover rule below.
4586
4780
  Declared outside :hover: the variables resolve only when the hover rule
4587
4781
  reads them, so the values are inert until interaction. */
@@ -4622,7 +4816,7 @@ mark {
4622
4816
  /* The .soft/.outline/.ghost hover recipe (--ui-hover-bg) is set locally above;
4623
4817
  the overlay darkening for solid is .btn-specific. */
4624
4818
  .btn:not(:where(:disabled, [aria-disabled="true"])):hover {
4625
- background: var(--ui-hover-bg, var(--btn-bg));
4819
+ background-color: var(--ui-hover-bg, var(--btn-bg));
4626
4820
  /* Huge inset spread paints the overlay over any border-radius without a
4627
4821
  pseudo-element; a plain background would replace the fill instead of
4628
4822
  darkening it. Listed after --btn-shadow, which it must not drop. */
@@ -4662,7 +4856,7 @@ mark {
4662
4856
  after components and overrides border-radius at equal specificity. */
4663
4857
 
4664
4858
  .btn.link:not(:where(:disabled, [aria-disabled="true"])):hover {
4665
- background: transparent;
4859
+ background-color: transparent;
4666
4860
  text-decoration-thickness: 0.12em;
4667
4861
  }
4668
4862
 
@@ -4982,6 +5176,11 @@ a.btn[aria-disabled="true"] {
4982
5176
  --ui-border: initial;
4983
5177
  }
4984
5178
 
5179
+ /* A solid pill takes the theme finish like a solid button. */
5180
+ .badge.solid {
5181
+ background-image: var(--finish, none);
5182
+ }
5183
+
4985
5184
  .badge:empty {
4986
5185
  --badge-size: var(--badge-dot-size);
4987
5186
  --badge-bg: var(--intent, var(--neutral));
@@ -5049,8 +5248,9 @@ a.btn[aria-disabled="true"] {
5049
5248
  }
5050
5249
  }
5051
5250
 
5251
+ /* The color alone: the shorthand would drop a solid pill's finish. */
5052
5252
  :where(a.badge, button.badge):not(:where(:disabled, [aria-disabled="true"])):hover {
5053
- background: var(--ui-hover-bg, var(--badge-default-hover-bg));
5253
+ background-color: var(--ui-hover-bg, var(--badge-default-hover-bg));
5054
5254
  }
5055
5255
 
5056
5256
  /* Solid and empty badges keep the overlay darkening on hover; soft badges do
@@ -6380,13 +6580,16 @@ picture.bleed > img {
6380
6580
  last row of a full-width sidebar nav list. Stretches both the
6381
6581
  positioning wrapper and its trigger control. Named for the effect
6382
6582
  (stretch to fill), not the display value, to avoid reading like a
6383
- generic display-block utility. */
6583
+ generic display-block utility. The trigger is matched by aria-controls,
6584
+ the runtime's own wiring: aria-haspopup="menu" follows role="menu" only, so
6585
+ a trigger for a panel holding a field (an account menu with a theme select)
6586
+ carries none and stayed content-sized. */
6384
6587
  .flyout-trigger.stretch {
6385
6588
  display: block;
6386
6589
  inline-size: 100%;
6387
6590
  }
6388
6591
 
6389
- .flyout-trigger.stretch > [aria-haspopup="menu"] {
6592
+ .flyout-trigger.stretch > [aria-controls] {
6390
6593
  inline-size: 100%;
6391
6594
  }
6392
6595
 
@@ -6646,6 +6849,24 @@ picture.bleed > img {
6646
6849
  text-overflow: ellipsis;
6647
6850
  }
6648
6851
 
6852
+ .menu-item-text:where(:has(> .menu-item-desc)),
6853
+ .menu-item-desc {
6854
+ overflow-wrap: anywhere;
6855
+ white-space: normal;
6856
+ }
6857
+
6858
+ .menu-item-desc {
6859
+ display: block;
6860
+ color: var(--text-muted);
6861
+ font-size: 0.875em;
6862
+ }
6863
+
6864
+ /* Keep the leading icon aligned with the label when the description wraps. */
6865
+ .menu-item:where(:has(> .menu-item-text > .menu-item-desc)) {
6866
+ align-items: flex-start;
6867
+ padding-block: var(--space-10);
6868
+ }
6869
+
6649
6870
  .menu-item-end {
6650
6871
  display: inline-flex;
6651
6872
  align-items: center;
@@ -7327,24 +7548,31 @@ picture.bleed > img {
7327
7548
  border: 0;
7328
7549
  border-radius: var(--bar-radius);
7329
7550
  background: var(--progress-track);
7551
+ /* A rail, recessed with the fields when a theme sets --shadow-inset. */
7552
+ box-shadow: var(--shadow-inset, none);
7330
7553
  }
7331
7554
 
7555
+ /* The bar box paints over the host's inset shadow, so it carries it too. */
7332
7556
  .progress::-webkit-progress-bar {
7333
7557
  block-size: var(--bar-height);
7334
7558
  border-radius: var(--bar-radius);
7335
7559
  background: var(--progress-track);
7560
+ box-shadow: var(--shadow-inset, none);
7336
7561
  }
7337
7562
 
7563
+ /* The value is a solid fill: the theme finish is the layer over it. Two
7564
+ layers of one shorthand, so --progress-value may stay a color or become a
7565
+ gradient (only the last layer accepts a color). */
7338
7566
  .progress::-webkit-progress-value {
7339
7567
  block-size: var(--bar-height);
7340
7568
  border-radius: var(--bar-radius);
7341
- background: var(--progress-value);
7569
+ background: var(--finish, none), var(--progress-value);
7342
7570
  }
7343
7571
 
7344
7572
  .progress::-moz-progress-bar {
7345
7573
  block-size: var(--bar-height);
7346
7574
  border-radius: var(--bar-radius);
7347
- background: var(--progress-value);
7575
+ background: var(--finish, none), var(--progress-value);
7348
7576
  }
7349
7577
 
7350
7578
  /* Indeterminate progress */
@@ -9045,10 +9273,21 @@ a.avatar[aria-disabled="true"] {
9045
9273
  *
9046
9274
  * Docs: docs/pages/components/app-navigation.md
9047
9275
  *
9276
+ * Tiles are direct-child links and buttons (a "More" button opening a drawer,
9277
+ * a disabled destination). A direct-child header and footer, at most one each,
9278
+ * belong to the side presentation only (app-layout.css); the bottom bar has
9279
+ * room for destinations alone.
9280
+ *
9048
9281
  * Public hooks:
9049
9282
  * --app-nav-size
9050
9283
  * --app-nav-gap
9051
9284
  * --app-nav-icon-size
9285
+ * --app-nav-current-bg (fallback-only: current fill, icon pill or side row)
9286
+ * --app-nav-current-fg (fallback-only: ink on that fill)
9287
+ *
9288
+ * Internal:
9289
+ * --app-nav-fill (state fill, read by the icon pill or the whole tile)
9290
+ * --app-nav-ink (state ink on that fill)
9052
9291
  */
9053
9292
  :where(.app-nav) {
9054
9293
  --intent: initial;
@@ -9079,7 +9318,11 @@ a.avatar[aria-disabled="true"] {
9079
9318
  color: var(--ui-fg, var(--text-muted));
9080
9319
  }
9081
9320
 
9082
- .app-nav > a {
9321
+ .app-nav > :is(header, footer) {
9322
+ display: none;
9323
+ }
9324
+
9325
+ .app-nav > :is(a, button) {
9083
9326
  position: relative;
9084
9327
  display: grid;
9085
9328
  grid-template-rows: auto auto;
@@ -9101,41 +9344,83 @@ a.avatar[aria-disabled="true"] {
9101
9344
  -webkit-tap-highlight-color: transparent;
9102
9345
  }
9103
9346
 
9104
- .app-nav > a > :where(svg, img, [aria-hidden="true"]) {
9347
+ .app-nav > button {
9348
+ border: 0;
9349
+ background: none;
9350
+ font-family: inherit;
9351
+ cursor: pointer;
9352
+ }
9353
+
9354
+ .app-nav > button:disabled {
9355
+ cursor: not-allowed;
9356
+ opacity: var(--disabled-opacity);
9357
+ }
9358
+
9359
+ /* The fill hugs what it marks. Under a caption, a tile is mostly empty space,
9360
+ so its state paints a pill around the icon, not the tile: a full-tile fill
9361
+ read as a segmented control. States only set --app-nav-fill and
9362
+ --app-nav-ink; the presentation decides what reads them (the labelled side
9363
+ navigation paints the whole row, app-layout.css). Every icon carries the
9364
+ pill's geometry, so becoming current never moves it. */
9365
+ .app-nav > :is(a, button) > :where(svg, img, [aria-hidden="true"]) {
9366
+ box-sizing: content-box;
9105
9367
  inline-size: var(--app-nav-icon-size);
9106
9368
  block-size: var(--app-nav-icon-size);
9369
+ padding: var(--space-10) var(--space-40);
9370
+ border-radius: var(--radius-full);
9371
+ background: var(--app-nav-fill, transparent);
9372
+ color: var(--app-nav-ink, currentColor);
9107
9373
  font-size: var(--app-nav-icon-size);
9108
9374
  line-height: 1;
9109
9375
  }
9110
9376
 
9111
- .app-nav > a:hover {
9112
- background: var(--surface-subtle);
9377
+ /* A tile without an icon has nothing else to carry its state. Without :has()
9378
+ it shows the label color alone, and forced colors keep their frame. */
9379
+ .app-nav > :is(a, button):not(:has(> :where(svg, img, [aria-hidden="true"]))) {
9380
+ background: var(--app-nav-fill, transparent);
9381
+ }
9382
+
9383
+ /* :where() keeps hover below the current tile, as when tiles were links only:
9384
+ :is(button:enabled) would raise hover over a[aria-current] and repaint it. */
9385
+ .app-nav > :where(a, button:enabled):hover {
9386
+ --app-nav-fill: var(--surface-subtle);
9387
+
9113
9388
  color: var(--text);
9114
9389
  }
9115
9390
 
9116
9391
  /* Same contextual hover as .nav-link (navbar.css): a tint of the tile's ink
9117
9392
  reads on any --ui-* bar; the baseline keeps a legible light chip. */
9118
9393
  @supports (color: color-mix(in oklch, red, white)) {
9119
- .app-nav > a:hover {
9120
- background: color-mix(in oklch, currentColor 10%, transparent);
9394
+ .app-nav > :where(a, button:enabled):hover {
9395
+ --app-nav-fill: color-mix(in oklch, currentColor 10%, transparent);
9396
+
9121
9397
  color: var(--ui-fg, var(--text));
9122
9398
  }
9123
9399
  }
9124
9400
 
9125
- /* Current tile is already a full selected surface. Selection never changes
9126
- text metrics: the shared medium weight is kept. The forced-colors cue is a
9127
- transparent border on a ::before overlay, not on the tile: an element border
9128
- shrinks the content box, and the side layout starts its content at the inline
9129
- edge, so the icon and label shifted by --border-width when a tile became
9130
- current. The overlay costs no layout, yet forced colors still turn its
9131
- transparent border into a system-color frame once --state-selected flattens
9132
- to the bar's own Canvas. No forced-colors repaint: a Highlight fill put
9133
- HighlightText on Chromium's Canvas backplate, which hid the label. The
9401
+ /* Selection never changes text metrics: the shared medium weight is kept. The
9402
+ label sits on the bar, not on the fill, so it takes the bar's full ink; the
9403
+ selected ink goes to what the fill paints. The forced-colors cue is a
9404
+ transparent border on a ::before overlay of the tile, not on the tile: an
9405
+ element border shrinks the content box, and the side layout starts its
9406
+ content at the inline edge, so the icon and label shifted by --border-width
9407
+ when a tile became current. The overlay costs no layout, yet forced colors
9408
+ still turn its transparent border into a system-color frame once the fill
9409
+ flattens to the bar's own Canvas. No forced-colors repaint: a Highlight fill
9410
+ put HighlightText on Chromium's Canvas backplate, which hid the label. The
9134
9411
  positioning context is on every link so it does not move when one becomes
9135
- current or an application places its own decoration. */
9412
+ current or an application places its own decoration. A pale
9413
+ --app-nav-current-bg must still stand out from the nav surface: its
9414
+ contrast is the theme's to keep. */
9136
9415
  .app-nav > a[aria-current="page"] {
9137
- background: var(--state-selected);
9138
- color: var(--state-selected-fg);
9416
+ --app-nav-fill: var(--app-nav-current-bg, var(--state-selected));
9417
+ --app-nav-ink: var(--app-nav-current-fg, var(--state-selected-fg));
9418
+
9419
+ color: var(--ui-fg, var(--text));
9420
+ }
9421
+
9422
+ .app-nav > a[aria-current="page"]:not(:has(> :where(svg, img, [aria-hidden="true"]))) {
9423
+ color: var(--app-nav-ink);
9139
9424
  }
9140
9425
 
9141
9426
  .app-nav > a[aria-current="page"]::before {
@@ -9985,11 +10270,13 @@ a.avatar[aria-disabled="true"] {
9985
10270
  * --segmented-radius
9986
10271
  * --segmented-fg
9987
10272
  * --segmented-selected-bg
10273
+ * --segmented-selected-fg
9988
10274
  * --segmented-selected-border (fallback-only: no edge by default; a theme sets
9989
10275
  * it once on its root, e.g. a flat theme whose selected pill has no shadow)
9990
10276
  *
9991
10277
  * Internal:
9992
10278
  * --segment-min-size
10279
+ * --segment-focus
9993
10280
  */
9994
10281
  .segmented {
9995
10282
  --segmented-bg: var(--surface-subtle);
@@ -10010,6 +10297,8 @@ a.avatar[aria-disabled="true"] {
10010
10297
  border: var(--border-width) solid transparent;
10011
10298
  border-radius: var(--segmented-radius);
10012
10299
  background: var(--segmented-bg);
10300
+ /* A rail, recessed with the fields when a theme sets --shadow-inset. */
10301
+ box-shadow: var(--shadow-inset, none);
10013
10302
  font-size: var(--control-font-size);
10014
10303
  vertical-align: middle;
10015
10304
  }
@@ -10110,33 +10399,39 @@ a.avatar[aria-disabled="true"] {
10110
10399
  The selected pill is set apart by its fill, its shadow and the full --text
10111
10400
  ink against --text-muted; no edge by default. --segmented-selected-border
10112
10401
  is read, never declared here, so a theme (a flat one without --shadow) can
10113
- restore the edge once on its root.
10114
- Trap: the ring and --shadow share one box-shadow list, and `none` is not a
10115
- list item. A theme that sets --shadow: none drops the whole declaration,
10116
- ring included; flatten shadows with --shadow-color: transparent instead. */
10402
+ restore the edge once on its root. The shadow is --shadow-control when a
10403
+ theme sets it, the surface --shadow otherwise.
10404
+ Trap: the ring and the shadow share one box-shadow list, and `none` is not
10405
+ a list item. A theme that sets either shadow to none drops the whole
10406
+ declaration, ring included; flatten with 0 0 #0000 or
10407
+ --shadow-color: transparent instead. */
10117
10408
  .segment:is([aria-selected="true"], [aria-current="page"], [aria-current="true"]) {
10409
+ --segment-focus: var(--segmented-selected-fg, var(--focus));
10410
+
10118
10411
  background: var(--segmented-selected-bg);
10119
- color: var(--text);
10412
+ color: var(--segmented-selected-fg, var(--text));
10120
10413
  box-shadow:
10121
10414
  0 0 0 var(--border-width) var(--segmented-selected-border, transparent),
10122
- var(--shadow);
10415
+ var(--shadow-control, var(--shadow));
10123
10416
  }
10124
10417
 
10125
10418
  .segment:has(> input:checked) {
10419
+ --segment-focus: var(--segmented-selected-fg, var(--focus));
10420
+
10126
10421
  background: var(--segmented-selected-bg);
10127
- color: var(--text);
10422
+ color: var(--segmented-selected-fg, var(--text));
10128
10423
  box-shadow:
10129
10424
  0 0 0 var(--border-width) var(--segmented-selected-border, transparent),
10130
- var(--shadow);
10425
+ var(--shadow-control, var(--shadow));
10131
10426
  }
10132
10427
 
10133
10428
  .segment:focus-visible {
10134
- outline: var(--focus-ring-width) solid var(--focus);
10429
+ outline: var(--focus-ring-width) solid var(--segment-focus, var(--focus));
10135
10430
  outline-offset: calc(var(--focus-ring-width) * -1);
10136
10431
  }
10137
10432
 
10138
10433
  .segment:has(> input:focus-visible) {
10139
- outline: var(--focus-ring-width) solid var(--focus);
10434
+ outline: var(--focus-ring-width) solid var(--segment-focus, var(--focus));
10140
10435
  outline-offset: calc(var(--focus-ring-width) * -1);
10141
10436
  }
10142
10437
 
@@ -10158,7 +10453,7 @@ a.avatar[aria-disabled="true"] {
10158
10453
  is dropped here and the focus line takes the highlight's text color. */
10159
10454
  @media (forced-colors: active) {
10160
10455
  .segment:is([aria-selected="true"], [aria-current="page"], [aria-current="true"]) {
10161
- --focus: HighlightText;
10456
+ --segment-focus: HighlightText;
10162
10457
 
10163
10458
  forced-color-adjust: none;
10164
10459
  background: Highlight;
@@ -10167,7 +10462,7 @@ a.avatar[aria-disabled="true"] {
10167
10462
  }
10168
10463
 
10169
10464
  .segment:has(> input:checked) {
10170
- --focus: HighlightText;
10465
+ --segment-focus: HighlightText;
10171
10466
 
10172
10467
  forced-color-adjust: none;
10173
10468
  background: Highlight;
@@ -10279,6 +10574,7 @@ a.avatar[aria-disabled="true"] {
10279
10574
  * --list-item-pad-block
10280
10575
  * --list-item-pad-inline
10281
10576
  * --list-item-gap
10577
+ * --list-current-inset-block
10282
10578
  * --list-divider
10283
10579
  * --list-radius
10284
10580
  */
@@ -10321,18 +10617,6 @@ a.avatar[aria-disabled="true"] {
10321
10617
  background: var(--surface-raised);
10322
10618
  }
10323
10619
 
10324
- /* A row's fill sits inside the shell's border box, so its inner radius is the
10325
- shell radius minus that border — and never negative on a square theme. */
10326
- .list.grouped > :where(li:first-child > .list-item, .list-item:first-child) {
10327
- border-start-start-radius: max(0px, calc(var(--list-radius) - var(--border-width)));
10328
- border-start-end-radius: max(0px, calc(var(--list-radius) - var(--border-width)));
10329
- }
10330
-
10331
- .list.grouped > :where(li:last-child > .list-item, .list-item:last-child) {
10332
- border-end-start-radius: max(0px, calc(var(--list-radius) - var(--border-width)));
10333
- border-end-end-radius: max(0px, calc(var(--list-radius) - var(--border-width)));
10334
- }
10335
-
10336
10620
  /*
10337
10621
  * Flex, not a three-track grid: the leading and trailing regions are optional,
10338
10622
  * and a fixed `auto minmax(0, 1fr) auto` template gives an absent region a
@@ -10362,6 +10646,20 @@ a.avatar[aria-disabled="true"] {
10362
10646
  border-block-start: var(--list-divider);
10363
10647
  }
10364
10648
 
10649
+ /* A row's fill sits inside the shell's border box, so its inner radius is the
10650
+ shell radius minus that border — and never negative on a square theme. */
10651
+ .list.grouped > :where(li:first-child) > :where(.list-item),
10652
+ .list.grouped > :where(.list-item:first-child) {
10653
+ border-start-start-radius: max(0px, calc(var(--list-radius) - var(--border-width)));
10654
+ border-start-end-radius: max(0px, calc(var(--list-radius) - var(--border-width)));
10655
+ }
10656
+
10657
+ .list.grouped > :where(li:last-child) > :where(.list-item),
10658
+ .list.grouped > :where(.list-item:last-child) {
10659
+ border-end-start-radius: max(0px, calc(var(--list-radius) - var(--border-width)));
10660
+ border-end-end-radius: max(0px, calc(var(--list-radius) - var(--border-width)));
10661
+ }
10662
+
10365
10663
  a.list-item {
10366
10664
  position: relative;
10367
10665
  color: inherit;
@@ -10388,9 +10686,21 @@ a.list-item:is([aria-current="page"], [aria-current="true"]) {
10388
10686
  a.list-item:is([aria-current="page"], [aria-current="true"])::before {
10389
10687
  content: "";
10390
10688
  position: absolute;
10391
- inset-block: var(--list-item-pad-block);
10689
+ inset-block: var(--list-current-inset-block, var(--list-item-pad-block));
10392
10690
  inset-inline-start: 0;
10393
10691
  border-inline-start: 2px solid var(--state-selected);
10692
+ pointer-events: none;
10693
+ }
10694
+
10695
+ /* Draw against the full corner, then trim the mark. Clipping the row itself
10696
+ would also clip its focus outline and any flyout anchored inside it. */
10697
+ :is(.list.grouped > li > .list-item, .list.grouped > .list-item):is(
10698
+ [aria-current="page"],
10699
+ [aria-current="true"]
10700
+ )::before {
10701
+ inset: 0;
10702
+ border-radius: inherit;
10703
+ clip-path: inset(var(--list-current-inset-block, var(--list-item-pad-block)) 0);
10394
10704
  }
10395
10705
 
10396
10706
  /* The content region is the one that flexes, whichever position it holds.
@@ -10454,7 +10764,8 @@ a.list-item:is([aria-current="page"], [aria-current="true"])::before {
10454
10764
  *
10455
10765
  * Public hooks:
10456
10766
  * --table-min
10457
- * --table-cell-pad
10767
+ * --table-cell-pad (a single length: the edge columns compare it to the radius)
10768
+ * --table-radius (on .table-wrap; the edge columns pad at least this much)
10458
10769
  *
10459
10770
  * Theme hooks (unset by default, read with a fallback, so a theme sets them
10460
10771
  * once on its root and third-party grid bridges can read the same choice):
@@ -10474,8 +10785,10 @@ a.list-item:is([aria-current="page"], [aria-current="true"])::before {
10474
10785
  max-inline-size: 100%;
10475
10786
  min-inline-size: 0;
10476
10787
  overflow-x: auto;
10788
+ --table-radius: var(--radius-lg);
10789
+
10477
10790
  border: var(--border-width) solid var(--border);
10478
- border-radius: var(--radius-lg);
10791
+ border-radius: var(--table-radius);
10479
10792
  background: var(--surface-raised);
10480
10793
  }
10481
10794
 
@@ -10504,6 +10817,22 @@ a.list-item:is([aria-current="page"], [aria-current="true"])::before {
10504
10817
  vertical-align: baseline;
10505
10818
  }
10506
10819
 
10820
+ /* The edge columns clear the wrap's corner: with an inline padding under the
10821
+ radius, the first letter of a header or caption sits inside the curve. The
10822
+ whole column takes it so the body stays aligned with its header. A row under
10823
+ a rowspan cell starts in the second column and takes it too. */
10824
+ .table caption {
10825
+ padding-inline: max(var(--table-cell-pad), var(--table-radius, 0px));
10826
+ }
10827
+
10828
+ .table :is(th, td):first-child {
10829
+ padding-inline-start: max(var(--table-cell-pad), var(--table-radius, 0px));
10830
+ }
10831
+
10832
+ .table :is(th, td):last-child {
10833
+ padding-inline-end: max(var(--table-cell-pad), var(--table-radius, 0px));
10834
+ }
10835
+
10507
10836
  .table th {
10508
10837
  color: var(--text-muted);
10509
10838
  font-weight: var(--font-weight-semibold);
@@ -10564,6 +10893,8 @@ a.list-item:is([aria-current="page"], [aria-current="true"])::before {
10564
10893
  border: 0;
10565
10894
  border-radius: var(--bar-radius);
10566
10895
  background: var(--meter-track);
10896
+ /* A rail, recessed with the fields when a theme sets --shadow-inset. */
10897
+ box-shadow: var(--shadow-inset, none);
10567
10898
  }
10568
10899
 
10569
10900
  /* A non-native meter is a weighted flex container. The element type keeps the
@@ -10591,6 +10922,8 @@ a.list-item:is([aria-current="page"], [aria-current="true"])::before {
10591
10922
  border: 0;
10592
10923
  border-radius: var(--bar-radius);
10593
10924
  background: var(--meter-track);
10925
+ /* Paints over the host's inset shadow, so it carries it too. */
10926
+ box-shadow: var(--shadow-inset, none);
10594
10927
  }
10595
10928
 
10596
10929
  .meter::-webkit-meter-optimum-value {