@citolab/qti-components 10.0.0-next.1 → 10.0.0-next.11

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 (65) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +3701 -765
  3. package/dist/base.d.ts +10 -10
  4. package/dist/base.js +7 -1
  5. package/dist/{chunk-FWR6HZQS.js → chunk-454ZDSKX.js} +16 -13
  6. package/dist/chunk-454ZDSKX.js.map +1 -0
  7. package/dist/{chunk-35WWWFS6.js → chunk-AJ5U5KXR.js} +2 -2
  8. package/dist/{chunk-FD4AB6TM.js → chunk-AVZRY5SQ.js} +2 -2
  9. package/dist/{chunk-CKJ7M7JQ.js → chunk-KYNLY2ET.js} +2340 -2032
  10. package/dist/chunk-KYNLY2ET.js.map +1 -0
  11. package/dist/{chunk-6K3QWJHH.js → chunk-LCGPLQLE.js} +40 -4
  12. package/dist/chunk-LCGPLQLE.js.map +1 -0
  13. package/dist/{chunk-MI7774NV.js → chunk-M7X6TWSX.js} +2 -2
  14. package/dist/{chunk-YYIS6FDP.js → chunk-N2CTFOIK.js} +2 -2
  15. package/dist/{chunk-RSMYGGQK.js → chunk-O76BOKAP.js} +496 -271
  16. package/dist/chunk-O76BOKAP.js.map +1 -0
  17. package/dist/{chunk-GBZNFSFY.js → chunk-RWMY7KRT.js} +2 -2
  18. package/dist/{chunk-TDWJ6WZA.js → chunk-T7YSBBAA.js} +37 -1
  19. package/dist/chunk-T7YSBBAA.js.map +1 -0
  20. package/dist/{chunk-RU6332MD.js → chunk-XXJAE6AP.js} +3 -3
  21. package/dist/chunk-YKXVAXSI.js +7 -0
  22. package/dist/chunk-YKXVAXSI.js.map +1 -0
  23. package/dist/{chunk-6U3YPHXU.js → chunk-YOCOLMGB.js} +40 -5
  24. package/dist/{chunk-6U3YPHXU.js.map → chunk-YOCOLMGB.js.map} +1 -1
  25. package/dist/{computed.types.d-gJrBeUMG.d.ts → computed.types.d-IXACuBr7.d.ts} +10 -1
  26. package/dist/corrections.d.ts +9 -9
  27. package/dist/corrections.js +8 -8
  28. package/dist/elements.d.ts +2 -2
  29. package/dist/elements.js +3 -3
  30. package/dist/index.d.ts +11 -11
  31. package/dist/index.js +37 -19
  32. package/dist/interactions.d.ts +4 -4
  33. package/dist/interactions.js +7 -3
  34. package/dist/item.css +1581 -387
  35. package/dist/item.d.ts +4 -4
  36. package/dist/item.js +4 -4
  37. package/dist/{item.types.d-B55QkJ92.d.ts → item.types.d-DuVR0ZVK.d.ts} +7 -1
  38. package/dist/loader.d.ts +2 -2
  39. package/dist/processing.d.ts +10 -3
  40. package/dist/processing.js +3 -3
  41. package/dist/qti-components-jsx.d.ts +934 -761
  42. package/dist/{qti-condition-expression.d-VJH6cWxf.d.ts → qti-condition-expression.d-B-T1NNl0.d.ts} +1 -1
  43. package/dist/{qti-expression.d-BPxEp8HU.d.ts → qti-expression.d-B-Cfbqlb.d.ts} +1 -1
  44. package/dist/{qti-feedback.d-wMYNVkkj.d.ts → qti-feedback.d-DbzPSJuK.d.ts} +1 -1
  45. package/dist/{qti-item.d-DgC1AQbY.d.ts → qti-item.d-B1gffYCL.d.ts} +1 -1
  46. package/dist/{qti-test.d-DkpBNcsv.d.ts → qti-test.d-D5C7W8Lg.d.ts} +185 -101
  47. package/dist/{qti-text-entry-interaction.d-q8u5BiVK.d.ts → qti-text-entry-interaction.d-CU-fAAD1.d.ts} +28 -19
  48. package/dist/{interaction.d-g6XG0T0Z.d.ts → record.d-wB9uYs-j.d.ts} +34 -2
  49. package/dist/{session.context.d-D5080LVx.d.ts → session.context.d-DW09Lrie.d.ts} +7 -1
  50. package/dist/test.d.ts +117 -9
  51. package/dist/test.js +19 -11
  52. package/package.json +9 -9
  53. package/dist/chunk-6K3QWJHH.js.map +0 -1
  54. package/dist/chunk-CKJ7M7JQ.js.map +0 -1
  55. package/dist/chunk-FWR6HZQS.js.map +0 -1
  56. package/dist/chunk-RSMYGGQK.js.map +0 -1
  57. package/dist/chunk-TDWJ6WZA.js.map +0 -1
  58. package/dist/chunk-ZP6QQYSU.js +0 -7
  59. package/dist/chunk-ZP6QQYSU.js.map +0 -1
  60. /package/dist/{chunk-35WWWFS6.js.map → chunk-AJ5U5KXR.js.map} +0 -0
  61. /package/dist/{chunk-FD4AB6TM.js.map → chunk-AVZRY5SQ.js.map} +0 -0
  62. /package/dist/{chunk-MI7774NV.js.map → chunk-M7X6TWSX.js.map} +0 -0
  63. /package/dist/{chunk-YYIS6FDP.js.map → chunk-N2CTFOIK.js.map} +0 -0
  64. /package/dist/{chunk-GBZNFSFY.js.map → chunk-RWMY7KRT.js.map} +0 -0
  65. /package/dist/{chunk-RU6332MD.js.map → chunk-XXJAE6AP.js.map} +0 -0
package/dist/item.css CHANGED
@@ -1462,6 +1462,10 @@
1462
1462
  box-sizing: border-box;
1463
1463
  }
1464
1464
 
1465
+ .qti-layout-row > [class*='qti-layout-col'] > :first-child {
1466
+ margin-block-start: 0; /* a heading or paragraph that opens a column starts at the column's top edge */
1467
+ }
1468
+
1465
1469
  .qti-layout-row [class*='qti-layout-col']:empty {
1466
1470
  width: 0;
1467
1471
  overflow: hidden; /* to fully collapse if there’s padding or borders */
@@ -1582,6 +1586,7 @@
1582
1586
  */
1583
1587
 
1584
1588
  @layer qti-components.reset{
1589
+
1585
1590
  @scope (qti-item-body, .ProseMirror) {
1586
1591
  :scope,
1587
1592
  :scope * {
@@ -1631,6 +1636,24 @@
1631
1636
  margin: 0;
1632
1637
  }
1633
1638
  }
1639
+
1640
+ /*
1641
+ * Reading rhythm for rendered items.
1642
+ *
1643
+ * Browsers and normalize sheets leave the line height at about 1.15, which squashes every sentence
1644
+ * of an item against the next. Items set their own, from one token a host can re-value. The token is
1645
+ * derived from the height of an inline field, so a line holding one is no taller than the rest.
1646
+ * Rendered items only: an editor document keeps the line height its editor gives it.
1647
+ */
1648
+ @scope (qti-item-body) {
1649
+ :scope {
1650
+ line-height: var(--qti-line-height);
1651
+ font-family: var(--cito-font-family, inherit); /* the page's font, unless a brand sets one */
1652
+ /* The theme's text colour, so the words flip with the surfaces when the page is dark. Inheriting
1653
+ the page's colour left dark text on the dark fields of a page that had not set its own. */
1654
+ color: var(--qti-color-base-content);
1655
+ }
1656
+ }
1634
1657
  }
1635
1658
 
1636
1659
  @layer qti-components.elements{
@@ -1679,7 +1702,7 @@
1679
1702
  :scope td {
1680
1703
  border: var(--qti-prose-table-border-width, var(--qti-border-thickness, 1px))
1681
1704
  var(--qti-prose-table-border-style, var(--qti-border-style, solid))
1682
- var(--qti-prose-table-border-color, var(--qti-border-color, #c6cad0));
1705
+ var(--qti-prose-table-border-color, var(--qti-border-color));
1683
1706
  padding: var(--qti-prose-table-cell-padding, 0.25rem 0.5rem);
1684
1707
  text-align: left;
1685
1708
  /* No vertical-align here: that is layout, and the theme does not do layout (CONTRACT.md §7,
@@ -1687,7 +1710,7 @@
1687
1710
  }
1688
1711
 
1689
1712
  :scope th {
1690
- background: var(--qti-prose-table-header-bg, var(--qti-bg-active, #f6f8fa));
1713
+ background: var(--qti-prose-table-header-bg, var(--qti-bg-active));
1691
1714
  font-weight: 600;
1692
1715
  }
1693
1716
  }
@@ -1703,6 +1726,11 @@
1703
1726
  * token declared in `global` is readable from a rule in any layer, and `var()` substitution across
1704
1727
  * these blocks (--qti-correct reads --qti-success) is layer-independent. Nothing here renders
1705
1728
  * differently for being grouped this way.
1729
+ *
1730
+ * Tiers (CONTRACT.md §8): a token tagged `t1` is a brand knob and the only kind that holds a
1731
+ * literal; every other token here is tier 2, derived from tier 1. Every block is declared on
1732
+ * `:root, :host, [data-qti-theme]`, so a subtree themed with `data-qti-theme` re-derives tier 2 from
1733
+ * its own tier 1.
1706
1734
  */
1707
1735
 
1708
1736
  /* ============================================================================
@@ -1710,16 +1738,125 @@
1710
1738
  * ========================================================================== */
1711
1739
  @layer qti-components.global {
1712
1740
  :root,
1713
- :host {
1714
- /* ── Base palette — six concrete brand colours. A theme replaces just these. ── */
1715
- --qti-primary: #0175aa; /* purple — chips, selection, active border */
1716
- --qti-success: #2b830e; /* green */
1717
- --qti-warning: #ffa700; /* amber */
1718
- --qti-error: #df0000; /* red */
1719
- --qti-info: #007ac3; /* blue — the answer key */
1741
+ :host,
1742
+ [data-qti-theme] {
1743
+ /*
1744
+ * ── Tier 1: the theme ──────────────────────────────────────────────────────────────────────
1745
+ *
1746
+ * Modelled on a daisyUI theme block. Setting these, and nothing else, makes a complete theme;
1747
+ * every other token in this file is derived from them (CONTRACT.md §8). They are the public
1748
+ * styling API, so they carry the public prefix, `cito-`, like the `cito-` events. Everything
1749
+ * derived from them keeps `qti-`.
1750
+ *
1751
+ * Colours are written in oklch. Each `-content` colour is the one that reads ON its partner:
1752
+ * text on a primary fill, a label on a neutral button, the text of a chip. base-100 is the
1753
+ * surface an item sits on; base-content is what is drawn against it.
1754
+ *
1755
+ * Light and dark are one set. The base and neutral colours are `light-dark()`, so they follow
1756
+ * the `color-scheme` of the page around the item. The theme sets no `color-scheme` itself: a
1757
+ * page that declares none stays light. The semantic colours are one value for both.
1758
+ *
1759
+ * The default theme is black and white: the surface is white (light) or near-black (dark), and
1760
+ * the primary, which marks what is selected, active or focused, is the text colour itself, so a
1761
+ * selected choice is a black fill with white text, and white on black in dark mode. Only the
1762
+ * four state colours carry hue, because they carry meaning: the answer key, correct, partially
1763
+ * correct, incorrect. A brand sets its colour through --cito-color-primary. Today's names below
1764
+ * are aliases of these.
1765
+ *
1766
+ * HOW THEY ARE READ. The theme never declares a `--cito-*` name. Each line below reads one, with
1767
+ * the default as its fallback, into the `--qti-` name every rule uses:
1768
+ *
1769
+ * --qti-color-primary: var(--cito-color-primary, oklch(…));
1770
+ *
1771
+ * An undeclared custom property inherits through every shadow boundary, so a `--cito-*` value a
1772
+ * host sets anywhere above an item reaches it, also inside a shadow root that adopts this sheet
1773
+ * (test-container, an item's own root). Declaring the `--cito-*` names here, on `:host`, would
1774
+ * reset them to the defaults in every such root. Two inputs have no `--qti-` line because their
1775
+ * default is `inherit`, which a custom property cannot hold: --cito-color-chip-content (read in
1776
+ * `@mixin drag`) and --cito-font-family (read in reset.css). The optional --cito-color-border is
1777
+ * read by --qti-border-color, below.
1778
+ */
1779
+ --qti-color-base-100: var(--cito-color-base-100, light-dark(oklch(100% 0 none), oklch(20% 0 none))); /* t1 */
1780
+ --qti-color-base-content: var(--cito-color-base-content, light-dark(oklch(21% 0 none), oklch(96% 0 none))); /* t1 */
1781
+
1782
+ --qti-color-primary: var(
1783
+ --cito-color-primary,
1784
+ light-dark(oklch(21% 0 none), oklch(96% 0 none))
1785
+ ); /* t1 — selection, active border, focus ring */
1786
+ --qti-color-primary-content: var(
1787
+ --cito-color-primary-content,
1788
+ light-dark(oklch(100% 0 none), oklch(21% 0 none))
1789
+ ); /* t1 */
1790
+
1791
+ /* The colour of an unbranded control that still has to stand out: the test's Next button. */
1792
+ --qti-color-neutral: var(--cito-color-neutral, light-dark(oklch(17.76% 0 none), oklch(92% 0 none))); /* t1 */
1793
+ --qti-color-neutral-content: var(
1794
+ --cito-color-neutral-content,
1795
+ light-dark(oklch(100% 0 none), oklch(17.76% 0 none))
1796
+ ); /* t1 */
1797
+
1798
+ /*
1799
+ * A drag chip: the surface by default, so a chip is an outlined box; a brand that wants filled
1800
+ * chips sets its own colour here. Its text is the surrounding text unless a brand says otherwise.
1801
+ */
1802
+ --qti-color-chip: var(--cito-color-chip, var(--qti-color-base-100)); /* t1 */
1803
+
1804
+ --qti-color-info: var(--cito-color-info, oklch(56.14% 0.1437 245.8)); /* t1 — the answer key */
1805
+ --qti-color-success: var(--cito-color-success, oklch(53.64% 0.166 139.96)); /* t1 — correct */
1806
+ --qti-color-warning: var(--cito-color-warning, oklch(79.62% 0.1708 71.71)); /* t1 — partially correct, validation */
1807
+ --qti-color-error: var(--cito-color-error, oklch(56.75% 0.2329 29.23)); /* t1 — incorrect */
1808
+
1809
+ /*
1810
+ * Radii, by what a box is: a selector is a small thing you pick (checkbox, chip), a field is a
1811
+ * thing you type or choose in (text entry, choice, dropdown), a box holds content (menu, modal,
1812
+ * rubric, validation message).
1813
+ *
1814
+ * Selector and box default to the field radius, read through its old name, so a brand that sets
1815
+ * --qti-border-radius still rounds all three.
1816
+ */
1817
+ --qti-radius-field: var(--cito-radius-field, 0.2rem); /* t1 */
1818
+ --qti-radius-selector: var(--cito-radius-selector, var(--qti-border-radius)); /* t1 */
1819
+ --qti-radius-box: var(--cito-radius-box, var(--qti-border-radius)); /* t1 */
1820
+
1821
+ /*
1822
+ * Sizes. The selector unit is a quarter of a radio or checkbox (`em`, so a control follows the
1823
+ * text it labels; see --qti-control-size). The field unit is an inline field's block padding:
1824
+ * the room above and below the text in a text entry, an inline choice or a gap.
1825
+ */
1826
+ --qti-size-selector: var(--cito-size-selector, 0.25em); /* t1 */
1827
+ --qti-size-field: var(--cito-size-field, 0.125rem); /* t1 */
1828
+
1829
+ /* The width of every border. A hairline, so a length in px. */
1830
+ --qti-border-width: var(--cito-border-width, 1px); /* t1 */
1831
+
1832
+ /*
1833
+ * Depth: 0 or 1. At 1 a chip stands off the page with a small lift under it; at 0 (the default)
1834
+ * it is flat. A multiplier, like --qti-motion, so it can also be set in between.
1835
+ */
1836
+ --qti-depth: var(--cito-depth, 0); /* t1 */
1837
+
1838
+ /*
1839
+ * Two surfaces a step darker than base-100, derived so the three cannot drift apart: a little
1840
+ * base-content mixed in (2.5% and 6% reproduce the 98% and 95% greys of the light default).
1841
+ */
1842
+ --qti-color-base-200: color-mix(in oklab, var(--qti-color-base-100), var(--qti-color-base-content) 2.5%);
1843
+ --qti-color-base-300: color-mix(in oklab, var(--qti-color-base-100), var(--qti-color-base-content) 6%);
1844
+
1845
+ /* What a disabled interaction is drawn in: text, edges, controls and the selected mark, all one
1846
+ muted grey (interactions/qti-disabled.css). 40% of the text colour into the surface; WCAG
1847
+ exempts disabled controls from contrast, and this keeps them readable but plainly off. */
1848
+ --qti-color-disabled: color-mix(in oklab, var(--qti-color-base-content) 40%, var(--qti-color-base-100));
1849
+
1850
+ /* ── Today's names, as aliases of tier 1 ──
1851
+ Rules and components read these, so a brand that sets one still wins. */
1852
+ --qti-primary: var(--qti-color-primary);
1853
+ --qti-success: var(--qti-color-success);
1854
+ --qti-warning: var(--qti-color-warning);
1855
+ --qti-error: var(--qti-color-error);
1856
+ --qti-info: var(--qti-color-info);
1720
1857
 
1721
1858
  /* Foreground on a primary fill. */
1722
- --qti-primary-fg: #fff;
1859
+ --qti-primary-fg: var(--qti-color-primary-content);
1723
1860
 
1724
1861
  /* ── Rhythm ──
1725
1862
  *
@@ -1760,18 +1897,57 @@
1760
1897
  *
1761
1898
  * Widening boxes without touching the vertical rhythm means re-declaring --qti-padding-box,
1762
1899
  * which is deliberate: that is a different look, not a different unit. */
1763
- --qti-spacing: 0.5rem;
1900
+ --qti-spacing: 0.5rem; /* t1 */
1764
1901
  --qti-padding-box: var(--qti-spacing) calc(var(--qti-spacing) * 2);
1765
1902
  --qti-padding-inline: calc(var(--qti-spacing) / 4) calc(var(--qti-spacing) / 2);
1766
1903
  --qti-gap: calc(var(--qti-spacing) * 2);
1767
1904
 
1905
+ /*
1906
+ * Inline fields: a text entry, an inline choice, a gap, anything that sits in a line of text.
1907
+ *
1908
+ * Named, not computed at the call site (the contract above): they are the quarter-unit values
1909
+ * the three composites do not offer, and each is read whole.
1910
+ *
1911
+ * --qti-inline-gap space either side of the field, so it never touches the words
1912
+ * around it; the sentence's own space supplies the rest and
1913
+ * collapses at a line break, where a margin would leave an indent
1914
+ * --qti-inline-padding-block the field's block padding: a quarter unit, so the line holding a
1915
+ * field stays near the height of the lines around it
1916
+ * --qti-inline-padding-inline the field's inline padding: one spacing unit, half the padding a
1917
+ * block box gets (--qti-gap), so a field in a sentence stays compact
1918
+ * without its text touching the side edges
1919
+ * --qti-inline-field-padding the field's box, those two together
1920
+ *
1921
+ * --qti-line-height is derived from the same parts, so a line of text is exactly as tall as a
1922
+ * field set in it: a field line then sits level with the lines around it. It is a length, so it
1923
+ * is the same in every element of the item, whatever its font size.
1924
+ */
1925
+ --qti-inline-gap: calc(var(--qti-spacing) / 4);
1926
+ --qti-inline-padding-block: var(--qti-size-field);
1927
+ --qti-inline-padding-inline: var(--qti-spacing);
1928
+ --qti-inline-field-padding: var(--qti-inline-padding-block) var(--qti-inline-padding-inline);
1929
+ --qti-line-height: calc(
1930
+ var(--qti-field-line-height) * 1em + 2 * var(--qti-inline-padding-block) + 2 * var(--qti-component-border-width)
1931
+ );
1932
+
1933
+ /*
1934
+ * How far a stacked choice is pulled out toward the edge of the prose around it: the room it
1935
+ * reserves for its selected paint, which is its inline padding (--qti-gap, the inline half of
1936
+ * --qti-padding-box) and its border, less the reach of the focus ring round its radio or
1937
+ * checkbox. The control then sits just inside the prose edge, so its ring stays inside the
1938
+ * column instead of being cut off by it.
1939
+ */
1940
+ --qti-choice-outdent: calc(
1941
+ var(--qti-gap) + var(--qti-component-border-width) - var(--qti-focus-offset) - var(--qti-focus-border-width)
1942
+ );
1943
+
1768
1944
  --qti-popover-z-index: 1000;
1769
1945
  --qti-overlay-z-index: 1;
1770
1946
  /* Motion master switch — a unitless multiplier every animation scales by. 1 = normal, 0 = no
1771
1947
  motion. CSS transitions read it through the calc below; the drag-drop FLIP engine reads
1772
1948
  --qti-motion directly (see flip.utils.ts resolveMotionScale), so this one token silences both
1773
1949
  CSS motion and JS FLIP. A theme or PNP profile can set 0.5 to slow motion or 0 to stop it. */
1774
- --qti-motion: 1;
1950
+ --qti-motion: 1; /* t1 */
1775
1951
  --qti-motion-duration-fast: calc(150ms * var(--qti-motion));
1776
1952
 
1777
1953
  /* ── The component surface ──
@@ -1780,7 +1956,7 @@
1780
1956
  slider track). Those two readerships are why this group and the --qti-component-* group below
1781
1957
  are not one group: this is "the theme's surface colour", that is "what a component paints when
1782
1958
  it says nothing", and only the second is the paint contract's business. */
1783
- --qti-bg: white;
1959
+ --qti-bg: var(--qti-color-base-100);
1784
1960
 
1785
1961
  /*
1786
1962
  * THE body text colour — the foreground half of the --qti-bg / --qti-fg pair.
@@ -1804,13 +1980,36 @@
1804
1980
  * Every reader is a colour context, which is what makes the keyword safe: it reaches `color`
1805
1981
  * either directly or through a role slot (--field-color, --drag-color, @mixin candidate).
1806
1982
  */
1807
- --qti-fg: inherit;
1808
- --qti-border-thickness: 1px; /* some places need the width alone (invariance, calcs) */
1809
- --qti-border-style: solid;
1810
- --qti-border-color: var(--qti-primary); /* THE border colour — the border half of the --qti-bg / --qti-fg pair */
1811
- --qti-border-radius: 0.2rem;
1983
+ --qti-fg: inherit; /* t1 */
1984
+ --qti-border-thickness: var(--qti-border-width); /* some places need the width alone (invariance, calcs) */
1985
+ --qti-border-style: solid; /* t1 */
1986
+ /*
1987
+ * THE border colour, the border half of the --qti-bg / --qti-fg pair. A neutral, worked out from
1988
+ * the base colours: base-content mixed into the surface, just far enough (about 3.3:1 on white) to
1989
+ * meet the 3:1 WCAG asks of a field's edge. It was the primary colour, which drew every field,
1990
+ * table and drop in the brand's blue at rest; the primary now marks only what is active or
1991
+ * selected (--qti-border-active). A brand that wants its colour on every edge sets this token,
1992
+ * as kennisnet.css does.
1993
+ */
1994
+ --qti-border-color: var(
1995
+ --cito-color-border,
1996
+ color-mix(in oklab, var(--qti-color-base-content) 45%, var(--qti-color-base-100))
1997
+ ); /* t1 input: --cito-color-border, optional */
1998
+ --qti-border-radius: var(--qti-radius-field);
1812
1999
  --qti-border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
1813
2000
 
2001
+ /* The QTI 3 shared CSS (qti-native/qti3p0.css, vocabulary §2.12) leaves the colours of
2002
+ .qti-bordered, .qti-underline and .qti-well to these hooks and defines none of them, so
2003
+ without the theme a well got its padding and nothing else. Filled from the theme's own
2004
+ tokens: a brand that restyles its borders restyles the well and the bordered box with them.
2005
+ A well is a tinted surface inside the theme's border (§1.1.6.2: border plus background, the
2006
+ background chosen by the platform); base-200 is the theme's tint for that. */
2007
+ --table-border-color: var(--qti-border-color);
2008
+ --foreground: var(--qti-color-base-content);
2009
+ --well-bg: var(--qti-color-base-200);
2010
+ --well-border: var(--qti-border);
2011
+ --well-box-shadow: none;
2012
+
1814
2013
  /* ── The paint contract's resting look ──
1815
2014
  *
1816
2015
  * One token per PAINT property, and the whole of what a role paints when it sets nothing. These
@@ -1844,6 +2043,32 @@
1844
2043
  --qti-component-opacity: 1;
1845
2044
  --qti-component-filter: none;
1846
2045
 
2046
+ /*
2047
+ * Depth, worked out from --cito-depth (tier 1).
2048
+ *
2049
+ * --qti-drag-lift a chip at rest: a hard shadow under it, as tall as two borders. At
2050
+ * depth 0 its colour mixes to nothing, so the chip is flat.
2051
+ * --qti-drag-elevation a chip in flight, at any depth: picked up is always off the page. A
2052
+ * theme sets its own with --cito-shadow-drag (`none` for flat).
2053
+ * --qti-hover-mix how much base-content a hover mixes into a fill.
2054
+ * --qti-active-mix how much a press mixes in: twice the hover, so a press reads as one.
2055
+ */
2056
+ --qti-drag-lift: 0 calc(2 * var(--qti-border-width)) 0
2057
+ color-mix(in oklab, var(--qti-color-base-content) calc(var(--qti-depth) * 20%), transparent);
2058
+ --qti-drag-elevation: var(
2059
+ --cito-shadow-drag,
2060
+ 0 var(--qti-spacing) calc(var(--qti-spacing) * 1.5)
2061
+ color-mix(in oklab, var(--qti-color-base-content) 20%, transparent),
2062
+ 0 calc(var(--qti-spacing) / 2) var(--qti-spacing)
2063
+ color-mix(in oklab, var(--qti-color-base-content) 10%, transparent)
2064
+ ); /* t1 input: --cito-shadow-drag, optional */
2065
+ --qti-hover-mix: 8%;
2066
+
2067
+ /* A chip's resting fill: the tier-1 chip colour. `press` reads --qti-<role>-fill, so a pressed
2068
+ chip darkens from the chip colour; other roles fall back to the component surface. */
2069
+ --qti-drag-fill: var(--qti-color-chip);
2070
+ --qti-active-mix: 16%; /* a press: the same mix, twice as far */
2071
+
1847
2072
  /* Interaction icon masks. Kept in the QTI namespace so the theme has no FontAwesome runtime
1848
2073
  dependency. One vocabulary, kept together even though --qti-times-mask is read only from
1849
2074
  the corrections layer. */
@@ -1853,7 +2078,12 @@
1853
2078
  A SHAPE rather than a shade, deliberately — colour alone would leave partial credit
1854
2079
  indistinguishable from correct for a colour-blind candidate, or in greyscale print. */
1855
2080
  --qti-partial-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath d='M432 256c0 17.7-14.3 32-32 32L48 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l352 0c17.7 0 32 14.3 32 32z'/%3E%3C/svg%3E");
1856
- --qti-grip-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3E%3Cpath d='M40 352l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40zm192 0l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40zM40 320c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0zM232 192l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40zM40 160c-22.1 0-40-17.9-40-40L0 72C0 49.9 17.9 32 40 32l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0zM232 32l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40z'/%3E%3C/svg%3E");
2081
+ /* The drag handle (`@mixin grip`): six small round dots by default, a theme sets its own shape
2082
+ with --cito-icon-drag (a mask) and its colour with --cito-color-drag-icon. */
2083
+ --qti-grip-mask: var(
2084
+ --cito-icon-drag,
2085
+ url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 16'%3E%3Ccircle cx='3' cy='3' r='1.4'/%3E%3Ccircle cx='7' cy='3' r='1.4'/%3E%3Ccircle cx='3' cy='8' r='1.4'/%3E%3Ccircle cx='7' cy='8' r='1.4'/%3E%3Ccircle cx='3' cy='13' r='1.4'/%3E%3Ccircle cx='7' cy='13' r='1.4'/%3E%3C/svg%3E")
2086
+ ); /* t1 input: --cito-icon-drag, optional */
1857
2087
  --qti-chevron-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z'/%3E%3C/svg%3E");
1858
2088
 
1859
2089
  /*
@@ -1867,26 +2097,29 @@
1867
2097
  * Deliberately in `global`: they are read from both interactions.base and interactions.states,
1868
2098
  * so no single interaction layer could own them.
1869
2099
  */
1870
- --qti-bg-active: color-mix(in srgb, var(--qti-primary) 8%, var(--qti-bg));
2100
+ --qti-bg-active: color-mix(in oklab, var(--qti-primary) 8%, var(--qti-bg));
1871
2101
  --qti-border-active: var(--qti-primary);
1872
2102
 
1873
- /* ── Slated for removal — still referenced across mixins/interactions ──
2103
+ /*
2104
+ * The focus ring (`@mixin foc`): one outline on `:focus-visible`, for everything. The test
2105
+ * controls read the same two tokens, so a page has one ring.
2106
+ *
2107
+ * Primary, not the answer key's info blue: a ring is the brand's "you are here", and it must not
2108
+ * be mistaken for the answer key. 2px, a hairline, so a length in px. It sits that far outside
2109
+ * the box, or that far inside it for a row in a list that clips (`@mixin foc-inset`).
1874
2110
  *
1875
- * focus → a single :focus-visible outline (no vars)
1876
- * Two treatments already read these two tokens: `@mixin foc` draws a box-shadow, while
1877
- * hotspot and graphic-order draw an outline. The box-shadow half is the problem — four
1878
- * rules contest that one property on a drag (the resting lift, the in-flight elevation,
1879
- * the placeholder's inset, the focus ring) and the last one declared wins, so focusing a
1880
- * drag mid-interaction drops either its ring or its elevation. An outline joins no such
1881
- * fight and costs no layout. The theme also still says `:focus` 24 times against
1882
- * `:focus-visible` 10, so most rings show on mouse click too. Once it is an outline on
1883
- * :focus-visible, a width and a colour are not worth tokenising.
1884
2111
  * The four --qti-light-* and --qti-dark-* tokens that used to sit here are now
1885
2112
  * --qti-selections-*, in the interactions.states block below. They are not a page-level light
1886
2113
  * and dark theme, which is what the old names suggested and why they were mistaken for dead.
1887
2114
  */
1888
2115
  --qti-focus-border-width: 2px;
1889
- --qti-focus-color: var(--qti-info);
2116
+ --qti-focus-color: var(--qti-primary);
2117
+ --qti-focus-offset: var(--qti-focus-border-width);
2118
+ --qti-focus-offset-inset: calc(-1 * var(--qti-focus-border-width));
2119
+ --qti-focus-offset-past-border: calc(var(--qti-focus-offset) + var(--qti-border-width));
2120
+
2121
+ /* A drop edge drawn as an outline lies exactly where a border would (an inline gap). */
2122
+ --qti-drop-outline-offset: calc(-1 * var(--qti-border-width));
1890
2123
  }
1891
2124
 
1892
2125
  /* Honour the OS "reduce motion" request through the same knob, so CSS transitions and the JS FLIP
@@ -1894,7 +2127,8 @@
1894
2127
  with higher specificity. */
1895
2128
  @media (prefers-reduced-motion: reduce) {
1896
2129
  :root,
1897
- :host {
2130
+ :host,
2131
+ [data-qti-theme] {
1898
2132
  --qti-motion: 0;
1899
2133
  }
1900
2134
  }
@@ -1905,7 +2139,8 @@
1905
2139
  * ========================================================================== */
1906
2140
  @layer qti-components.interactions.base {
1907
2141
  :root,
1908
- :host {
2142
+ :host,
2143
+ [data-qti-theme] {
1909
2144
  /*
1910
2145
  * The radio/checkbox box. Named for what it is — every other name around it already says
1911
2146
  * "control": part="control", part="control-mark", the control-selected mixin. "form" was the odd
@@ -1926,7 +2161,11 @@
1926
2161
  * shrinks with it. Nothing in the theme sets a smaller size yet, so a floor would be a magic
1927
2162
  * number guarding a case that does not exist; add `max()` here if a real one turns up.
1928
2163
  */
1929
- --qti-control-size: 1em;
2164
+ /* Snapped to an even number of pixels, as are the marks drawn inside it (`mark-size`,
2165
+ `radio-checked`): with a fractional control (19.2px at Playful's 0.3em) the gap round the dot
2166
+ is fractional too, and the ring and the dot antialias differently, so the dot looks off
2167
+ centre although it is not. Even sizes keep every gap a whole pixel. 16px is unchanged. */
2168
+ --qti-control-size: round(calc(var(--qti-size-selector) * 4), 2px);
1930
2169
 
1931
2170
  /* The correction badge's box. Named in two comments above and read by correction.styles.ts, but
1932
2171
  never actually declared until now — every badge has been running on that file's `1em`
@@ -1954,10 +2193,10 @@
1954
2193
  /* The line-height @mixin field-typography gives a field. A token because the correction badge
1955
2194
  has to be exactly one field-line tall to centre on the text, and `1lh` cannot be used for it:
1956
2195
  that unit resolves against the badge's own inherited line-height, not the field's. */
1957
- --qti-field-line-height: 1.5;
2196
+ --qti-field-line-height: 1.5; /* t1 */
1958
2197
 
1959
2198
  /*
1960
- * The left gutter a multi-line field reserves for its correction badge.
2199
+ * The gutter at the end of the line a multi-line field reserves for its correction badge.
1961
2200
  *
1962
2201
  * DERIVED, so it cannot drift from the thing it makes room for: the badge's own inset, plus the
1963
2202
  * badge, plus the gap that separates it from the first character. It used to be a literal
@@ -2054,7 +2293,7 @@
2054
2293
  --qti-hotspot-ring-color is intentionally NOT defined here: it is neutral by default and set
2055
2294
  contextually by the qti-selections-* classes and the correction states. */
2056
2295
  --qti-hotspot-ring-width: 2px;
2057
- --qti-hotspot-halo: rgb(255 255 255 / 85%);
2296
+ --qti-hotspot-halo: oklch(100% 0 none / 85%);
2058
2297
 
2059
2298
  /*
2060
2299
  * A drag's own padding, deliberately not --qti-padding-box.
@@ -2067,8 +2306,15 @@
2067
2306
  * the old `chip` paid `0.8em`, and which one you got depended on the layer the call site
2068
2307
  * happened to sit in. That is the associate bug recorded in drag-drop.invariance.spec.ts — one
2069
2308
  * drag, two box models, depending on where it was standing.
2309
+ *
2310
+ * Compact: three quarters of a spacing unit above and below, one and a half either side (6px ×
2311
+ * 12px at the default unit), with the field line height (`@mixin drag`), so a chip is a
2312
+ * word-sized box rather than a button. It was a whole unit by 0.8em. A choice drawn as a box takes the same, so a list of
2313
+ * buttons and a bank of chips read as the same kind of thing. Gap match goes tighter still: its
2314
+ * chips sit in a sentence (--qti-inline-field-padding).
2070
2315
  */
2071
- --qti-drag-padding: var(--qti-spacing) 0.8em;
2316
+ --qti-drag-padding: calc(var(--qti-spacing) * 0.75) calc(var(--qti-spacing) * 1.5);
2317
+ --qti-choice-box-padding: var(--qti-drag-padding);
2072
2318
  }
2073
2319
  }
2074
2320
 
@@ -2077,14 +2323,15 @@
2077
2323
  * ========================================================================== */
2078
2324
  @layer qti-components.interactions.states {
2079
2325
  :root,
2080
- :host {
2326
+ :host,
2327
+ [data-qti-theme] {
2081
2328
  /* Selection is a semantic alias of the primary action colour. */
2082
2329
  --qti-selected-bg: var(--qti-primary);
2083
2330
  --qti-selected-color: var(--qti-primary-fg);
2084
2331
 
2085
2332
  /* The hole a lifted / placed chip leaves — derived from primary. */
2086
- --qti-placeholder-bg: color-mix(in srgb, var(--qti-primary) 20%, white);
2087
- --qti-placeholder-shadow: 0 4px color-mix(in srgb, var(--qti-primary) 30%, white);
2333
+ --qti-placeholder-bg: color-mix(in oklab, var(--qti-primary) 20%, var(--qti-bg));
2334
+ --qti-placeholder-shadow: 0 4px color-mix(in oklab, var(--qti-primary) 30%, var(--qti-bg));
2088
2335
 
2089
2336
  /*
2090
2337
  * Selections theming, for the two interactions Appendix B.1 of the QTI 3 implementation guide
@@ -2100,10 +2347,10 @@
2100
2347
  * feature, and `global` claimed an ownership they never had — nothing outside these two
2101
2348
  * interactions' state rules reads them.
2102
2349
  */
2103
- --qti-selections-light-bg: #f0f0f0;
2104
- --qti-selections-light-border: #d0d0d0;
2105
- --qti-selections-dark-bg: #1f2937;
2106
- --qti-selections-dark-border: #64748b;
2350
+ --qti-selections-light-bg: oklch(95.51% 0 none);
2351
+ --qti-selections-light-border: oklch(85.76% 0 none);
2352
+ --qti-selections-dark-bg: oklch(27.81% 0.0296 256.85);
2353
+ --qti-selections-dark-border: oklch(55.44% 0.0407 257.42);
2107
2354
 
2108
2355
  /* A drop-zone highlight is a background FILL only — no border, no ring — which keeps it
2109
2356
  layout-invariant for free (a fill never reflows; the old inset ring existed only to avoid the
@@ -2113,7 +2360,7 @@
2113
2360
  --qti-drop-highlight-border-color / -border-width stay ONLY for the chip-in-flight outline
2114
2361
  (the dragging / return-anchor states), which marks the dragged element, not the zone. */
2115
2362
  --qti-drop-highlight-bg: var(--qti-bg-active);
2116
- --qti-drop-highlight-enabled-bg: color-mix(in srgb, var(--qti-drop-highlight-bg) 50%, transparent);
2363
+ --qti-drop-highlight-enabled-bg: color-mix(in oklab, var(--qti-drop-highlight-bg) 50%, transparent);
2117
2364
  --qti-drop-highlight-border-color: var(--qti-border-active);
2118
2365
  --qti-drop-highlight-border-width: 2px;
2119
2366
  }
@@ -2124,18 +2371,19 @@
2124
2371
  * ========================================================================== */
2125
2372
  @layer qti-components.interactions.corrections {
2126
2373
  :root,
2127
- :host {
2374
+ :host,
2375
+ [data-qti-theme] {
2128
2376
  /* ── Correction — derived from the semantic colours, never set directly. ── */
2129
2377
  --qti-correct: var(--qti-success);
2130
2378
  --qti-incorrect: var(--qti-error);
2131
2379
  --qti-partially-correct: var(--qti-warning);
2132
- --qti-correct-light: color-mix(in srgb, var(--qti-correct) 5%, white);
2133
- --qti-incorrect-light: color-mix(in srgb, var(--qti-incorrect) 5%, white);
2134
- --qti-partially-correct-light: color-mix(in srgb, var(--qti-partially-correct) 5%, white);
2380
+ --qti-correct-light: color-mix(in oklab, var(--qti-correct) 5%, var(--qti-bg));
2381
+ --qti-incorrect-light: color-mix(in oklab, var(--qti-incorrect) 5%, var(--qti-bg));
2382
+ --qti-partially-correct-light: color-mix(in oklab, var(--qti-partially-correct) 5%, var(--qti-bg));
2135
2383
 
2136
2384
  /* The answer key — the info blue, deliberately NOT the correct green. */
2137
2385
  --qti-answer-fg: var(--qti-info);
2138
- --qti-answer-bg: color-mix(in srgb, var(--qti-info) 5%, white);
2386
+ --qti-answer-bg: color-mix(in oklab, var(--qti-info) 5%, var(--qti-bg));
2139
2387
  --qti-answer-border: var(--qti-info);
2140
2388
  }
2141
2389
  }
@@ -2245,6 +2493,28 @@
2245
2493
  * rather than leaning on the glyph's intrinsic size.
2246
2494
  */
2247
2495
 
2496
+ /*
2497
+ * An element that sits in a line of text: a text entry, an inline choice, a gap, a hottext. They all
2498
+ * get the same box, so a sentence holding several of them stays level: space either side, the field
2499
+ * line height, and the inline-field padding (2px above and below, one spacing unit either side). Its
2500
+ * line is then exactly --qti-line-height tall, like every other line of the item.
2501
+ *
2502
+ * The padding is declared as --qti-padding-box, which the parts of a text entry and an inline choice
2503
+ * already read, so no component has to know about it. An element that pays its own padding (a
2504
+ * hottext) reads --qti-inline-field-padding directly; a gap is sized by the chip in it, which
2505
+ * gap-match gives the same padding through --qti-drag-padding.
2506
+ */
2507
+
2508
+ /*
2509
+ * The drop the chip is over, during a drag: the target it lands on when you let go. Every target
2510
+ * that can take a chip already shows the faint `enabled` wash; this one adds the highlight fill and
2511
+ * a ring in the active border colour, OUTSIDE its edge: the chip in flight is the size of the slot
2512
+ * and covers it, so a ring inside would be hidden under the very chip it is for. An outline, so it
2513
+ * costs no layout, and it replaces the dashed outline of a gap or a hotspot while it shows. The drag
2514
+ * code sets the `hover` flag on the one target under the pointer (drag-drop-core.mixin.ts,
2515
+ * handleDragMove).
2516
+ */
2517
+
2248
2518
  /*
2249
2519
  * The radio and the checkbox: the other two things this theme draws as boxes, and so the other two
2250
2520
  * paint roles. A control is a bordered box on the theme's surface exactly like a chip is, and now it
@@ -2290,7 +2560,26 @@
2290
2560
  * A glyph, not a box — the same kind of thing as `grip` and `answer-check`, so it gets a colour slot
2291
2561
  * rather than a whole paint role. It is drawn ON the checked control's accent fill (see
2292
2562
  * `control-selected`), so the two belong together: override --checkbox-background-color and you will
2293
- * usually want --checkbox-mark-color with it. `white` is the resting value, not a fixed one.
2563
+ * usually want --checkbox-mark-color with it. --qti-primary-fg is the resting value, not a fixed one.
2564
+ */
2565
+
2566
+ /*
2567
+ * THE focus ring: one outline, on `:focus-visible`, for everything a candidate can focus.
2568
+ *
2569
+ * An outline, not a box-shadow: it costs no layout, and it joins none of the fights over box-shadow
2570
+ * (a chip's resting lift, its in-flight elevation, the placeholder's inset). A focused chip keeps
2571
+ * its lift and gets its ring.
2572
+ *
2573
+ * WHEN: on `:focus`, for everything a candidate can focus (choices, hottext, hotspots, an inline
2574
+ * choice's trigger, a slider, a tabular match cell, chips and drops), so what you just picked with
2575
+ * the mouse shows its ring as it does from the keyboard, and so does the drop a keyboard drag moves
2576
+ * to. A lifted chip's placeholder does not ring (`:not(:state(placeholder))`): the chip is in your
2577
+ * hand, not in the bank. Nor does a chip while the button is down (`:not(:active)`): a press may
2578
+ * be the start of a drag, so the ring waits for the release. A text field matches `:focus-visible`
2579
+ * on a click anyway.
2580
+ *
2581
+ * `foc-inset` draws the same ring just inside the box, for a row in a list that clips (the inline
2582
+ * choice menu scrolls, so a ring outside a row would be cut off at the menu's edge).
2294
2583
  */
2295
2584
 
2296
2585
  /*
@@ -2299,12 +2588,11 @@
2299
2588
  *
2300
2589
  * `readonly` and `dis` were a single `cursor` declaration each — `pointer` and `not-allowed`. A mixin
2301
2590
  * that expands to one property is a name you have to look up to read the rule, and thirteen call
2302
- * sites had to. THE POLICY THEY CARRIED IS STILL THE POLICY, and is worth stating once here rather
2303
- * than losing with them: **the theme's disabled and readonly treatments are cursor ONLY.** No dimming,
2304
- * no desaturation, no border change. A disabled control keeps its box and its colour so the page does
2305
- * not reflow or change meaning when an item locks; the pointer is the whole affordance. If that ever
2306
- * stops being true it becomes a state that PAINTS, and it belongs in the contract below, not in a
2307
- * one-line mixin.
2591
+ * sites had to. The policy they carried has since split. **Readonly is cursor ONLY**: an answered item
2592
+ * in review keeps its full look, so its answers stay readable. **Disabled paints**: one muted grey
2593
+ * for text, edges, controls and the selected mark (interactions/qti-disabled.css, through
2594
+ * --qti-color-disabled), so a candidate can see that nothing there will respond. Neither moves a
2595
+ * box: only colours change, so the page does not reflow when an item locks.
2308
2596
  *
2309
2597
  * `act` set `border-color` + `background-color` directly, which is what the paint contract exists to
2310
2598
  * stop: a state repaints by SWITCHING a variable, never by re-declaring the property. Its three call
@@ -2315,12 +2603,9 @@
2315
2603
  * `act-bor` was deleted outright: zero call sites anywhere in the repo.
2316
2604
  */
2317
2605
 
2318
- /* `foc` stays a mixin, deliberately, and is the one state still painting a property directly.
2319
- * Twenty call sites read it, and it draws a `box-shadow` — the property the contract has NOT bound
2320
- * (see `paint` above). Routing it through --<role>-box-shadow would not fix anything: focus would
2321
- * then fight the resting lift and the in-flight elevation over one slot, last-declared winning,
2322
- * which is the four-rule contention already documented in qti-variables.css. The intended fix
2323
- * recorded there is a single `outline` on `:focus-visible`, and that is its own VRT-checked step. */
2606
+ /* `foc` stays a mixin, deliberately, and is the one state still painting a property directly: an
2607
+ * `outline`, which the paint contract does not bind. Nothing else in the theme draws an outline on
2608
+ * these elements, so there is nothing to switch and no slot is needed. */
2324
2609
 
2325
2610
  /* A choice — the clickable box a candidate picks. Nothing but the resting paint box; its padding is
2326
2611
  the interaction's (qti-choice-interaction.css), because a choice's box differs per interaction and
@@ -2358,6 +2643,8 @@
2358
2643
  * `message` the validation box. Its warning colouring is the interaction's, not the role's.
2359
2644
  */
2360
2645
 
2646
+ /* The menu and the message hold content, so they take the box radius. */
2647
+
2361
2648
  /*
2362
2649
  * A drag in flight. The other `drag` modifier — applied with `drag`, never instead of it.
2363
2650
  *
@@ -2366,26 +2653,53 @@
2366
2653
  */
2367
2654
 
2368
2655
  /*
2369
- * A drag darkens a little under the pointer. The one hover affordance in the theme.
2656
+ * A press: the fill takes a little more of the content colour while the pointer is down.
2657
+ *
2658
+ * Not used by choices or chips. A choice selects on press (ActiveElementMixin, `activateOn:
2659
+ * 'press'`), so its selection is the feedback; a chip starts a drag, which lifts and tilts it. A
2660
+ * grey wash on top of either only muddied the look. Kept for a control that acts on release. Paint only, so nothing moves, and not guarded
2661
+ * by a hover query: a press is real on touch too, and it ends when the finger lifts.
2662
+ *
2663
+ * $role is the element's paint role (`button`, `drag`); the fill it mixes from is that role's own,
2664
+ * so a selected choice or a branded chip darkens from its own colour. A direct `background-color`,
2665
+ * for the reason `drag-hover` below gives.
2666
+ *
2667
+ * On a chip, call it as `&:active:not(:state(placeholder), :state(dragging))`. `:active` holds for
2668
+ * as long as the button is down, which is the whole drag, and a direct property outranks the slot
2669
+ * the placeholder switches: unguarded, the hole a lifted chip leaves would stay darkened.
2670
+ */
2671
+
2672
+ /*
2673
+ * A drag's edge takes the primary colour under the pointer. The one hover affordance in the theme.
2370
2674
  *
2371
- * Guarded by `@media (hover: hover)` because touch does not lack hover — it emulates it, and the
2372
- * emulated state sticks after a tap. Without the guard a tapped drag stays darkened until the
2373
- * candidate taps somewhere else, which is worse than no hover at all.
2675
+ * Guarded by `@media (hover: hover) and (pointer: fine)` because touch does not lack hover — it
2676
+ * emulates it, and the emulated state sticks after a tap. Without the guard a tapped drag stays
2677
+ * highlighted until the candidate taps somewhere else, which is worse than no hover at all.
2374
2678
  *
2375
- * So this may only ever decorate. Everything it says is also said by `:focus-visible` for a keyboard
2679
+ * So this may only ever decorate. Everything it says is also said by the focus ring for a keyboard
2376
2680
  * and by the resting state for a finger; nothing is communicated by hover alone.
2377
2681
  *
2378
- * A background darken, not a lift: it costs no layout (paint only, never reflows the bank), and it
2379
- * reads the chip's own `--drag-background-color`, so it tracks whatever the brand painted the
2380
- * chip — primary under Kennisnet, white otherwise. `background-color` is a DIRECT property (not
2381
- * `--drag-background-color`): it overrides the `@mixin paint drag` binding on `:hover`, does not
2382
- * self-reference the var it reads, and — being a real property — never inherits into children.
2682
+ * The edge, not the fill: a fill darkened by the text colour turned every white chip grey. The
2683
+ * border is reserved at rest, so this is paint only and never reflows the bank. It switches the
2684
+ * `--drag-border-color` slot rather than setting `border-color`, so the layers above still win: a
2685
+ * placeholder (states) keeps no edge, and a verdict (corrections) keeps its colour. A brand whose
2686
+ * chip edge already is the primary (Kennisnet's filled chips) sees no change on hover.
2383
2687
  *
2384
2688
  * It replaces `hov`, an empty mixin invoked 21 times, applied to drags, drop targets, textareas,
2385
2689
  * hotspots and choices alike where no single rule suited all of them. This one is called from drags
2386
2690
  * only.
2387
2691
  */
2692
+
2693
+ /*
2694
+ * The test controls' look (next, previous, the item links: packages/qti-test/src/components/
2695
+ * styles.ts), for the two interactions that are a button: end attempt, and the upload's file
2696
+ * button. The same `--test-button-*` slots with the same defaults, so a host that repaints its test
2697
+ * buttons repaints these too, and the page shows one kind of button. The neutral look; the filled
2698
+ * one is for Next alone.
2699
+ */
2700
+
2388
2701
  /* Per-interaction sheets; each import carries its layer where the file has just one. */
2702
+
2389
2703
  @layer qti-components.interactions.base {
2390
2704
  qti-choice-interaction {
2391
2705
  /* A choice hugs its text here, unlike order-interaction, which uses the same element as a chip.
@@ -2400,6 +2714,23 @@
2400
2714
  width: fit-content;
2401
2715
  cursor: pointer;
2402
2716
  }
2717
+
2718
+ /* Nothing is drawn around a choice at rest, only the room reserved for what appears when it is
2719
+ selected, so the control sits that far in from the prose around it. Pull a stacked choice out by
2720
+ the room it reserves (its padding and its border): the control and the text then line up with the
2721
+ paragraphs, and the selected paint reaches into the gutter. Not in a row or a grid, where the
2722
+ neighbours would overlap. Set --qti-choice-outdent to 0 for a choice that should stay where its
2723
+ padding puts it, or inside a box that clips. */
2724
+ qti-choice-interaction:not(.qti-input-control-hidden,.qti-orientation-horizontal,[class*='qti-choices-stacking-']) qti-simple-choice {
2725
+ margin-inline-start: calc(-1 * var(--qti-choice-outdent));
2726
+ }
2727
+
2728
+ qti-choice-interaction.qti-input-control-hidden {
2729
+ /* Choices drawn as boxes: their borders are visible, so they need air between them. A list of
2730
+ plain controls does not; its padding spaces it. */
2731
+ --qti-choice-gap: var(--qti-spacing);
2732
+ }
2733
+
2403
2734
  qti-choice-interaction.qti-input-control-hidden qti-simple-choice {
2404
2735
  background-color: var(--button-background-color, var(--qti-component-background-color));
2405
2736
  background-image: var(--button-background-image, var(--qti-component-background-image));
@@ -2411,10 +2742,17 @@
2411
2742
  color: var(--button-color, var(--qti-component-color));
2412
2743
  opacity: var(--button-opacity, var(--qti-component-opacity));
2413
2744
  filter: var(--button-filter, var(--qti-component-filter));
2745
+ /* A box, so a compact one: the chip's padding and the field line height, instead of the
2746
+ roomy --qti-padding-box a plain choice pays for its selected paint. */
2747
+ padding: var(--qti-choice-box-padding);
2748
+ line-height: var(--qti-field-line-height);
2414
2749
  --qti-control-display: none;
2750
+ /* On :focus, not :focus-visible: a choice is something you pick, so the ring shows which one
2751
+ you just picked with the mouse too (see `@mixin foc`). */
2415
2752
  }
2416
2753
  :is(qti-choice-interaction.qti-input-control-hidden qti-simple-choice):focus {
2417
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
2754
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
2755
+ outline-offset: var(--qti-focus-offset);
2418
2756
  }
2419
2757
  qti-choice-interaction:not(.qti-input-control-hidden) qti-simple-choice {
2420
2758
  background-color: var(--button-background-color, var(--qti-component-background-color));
@@ -2428,18 +2766,31 @@
2428
2766
  opacity: var(--button-opacity, var(--qti-component-opacity));
2429
2767
  filter: var(--button-filter, var(--qti-component-filter));
2430
2768
  --button-border-color: transparent;
2769
+ /* No fill either: at rest such a choice is a line of text with a control before it, so it shows
2770
+ the page behind it, not the theme's surface. A state or a correction still fills it through the
2771
+ same slot. */
2772
+ --button-background-color: transparent;
2431
2773
  gap: 0.5rem;
2432
- outline: none;
2433
2774
  cursor: pointer;
2434
- }
2435
2775
 
2776
+ /* With a radio or checkbox shown, the ring goes round the control, as on a native one; the
2777
+ choice itself is drawn as nothing at rest, so a ring round it would outline an invisible
2778
+ box. Choices drawn as boxes (.qti-input-control-hidden, above) ring the whole box. The host
2779
+ holds focus, so it is the host's :focus that picks the part; on :focus, so a choice picked
2780
+ with the mouse shows its ring too. */
2781
+ }
2436
2782
  :is(qti-choice-interaction:not(.qti-input-control-hidden) qti-simple-choice):focus {
2437
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
2783
+ outline: var(--qti-focus-border-width) solid transparent;
2784
+ }
2785
+
2786
+ :is(qti-choice-interaction:not(.qti-input-control-hidden) qti-simple-choice):focus::part(control) {
2787
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
2788
+ outline-offset: var(--qti-focus-offset);
2438
2789
  }
2439
2790
 
2440
2791
  :is(qti-choice-interaction:not(.qti-input-control-hidden) qti-simple-choice)::part(control-mark) {
2441
- width: calc(var(--qti-control-size) * 0.625);
2442
- height: calc(var(--qti-control-size) * 0.625);
2792
+ width: round(calc(var(--qti-control-size) * 0.625), 2px);
2793
+ height: round(calc(var(--qti-control-size) * 0.625), 2px);
2443
2794
  }
2444
2795
  }
2445
2796
 
@@ -2495,9 +2846,9 @@
2495
2846
 
2496
2847
  :is(qti-choice-interaction:not(.qti-input-control-hidden) qti-simple-choice):is(:state(radio), [data-state~='radio']):is(:state(checked), [data-state~='checked'])::part(control-mark) {
2497
2848
  /* 0.5 reproduces today's 8px at the default 1rem — see mark-size for why this is a fraction. */
2498
- width: calc(var(--qti-control-size) * 0.5);
2499
- height: calc(var(--qti-control-size) * 0.5);
2500
- background-color: var(--radio-mark-color, white);
2849
+ width: round(calc(var(--qti-control-size) * 0.5), 2px);
2850
+ height: round(calc(var(--qti-control-size) * 0.5), 2px);
2851
+ background-color: var(--radio-mark-color, var(--qti-primary-fg));
2501
2852
  border-radius: 100%;
2502
2853
  }
2503
2854
 
@@ -2512,12 +2863,13 @@
2512
2863
  color: var(--checkbox-color, var(--qti-component-color));
2513
2864
  opacity: var(--checkbox-opacity, var(--qti-component-opacity));
2514
2865
  filter: var(--checkbox-filter, var(--qti-component-filter));
2866
+ border-radius: var(--checkbox-border-radius, var(--qti-radius-selector));
2515
2867
  width: var(--qti-control-size);
2516
2868
  height: var(--qti-control-size);
2517
2869
  }
2518
2870
 
2519
2871
  :is(qti-choice-interaction:not(.qti-input-control-hidden) qti-simple-choice):is(:state(checkbox), [data-state~='checkbox']):is(:state(checked), [data-state~='checked'])::part(control-mark) {
2520
- background-color: var(--checkbox-mark-color, white);
2872
+ background-color: var(--checkbox-mark-color, var(--qti-primary-fg));
2521
2873
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
2522
2874
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
2523
2875
  }
@@ -2558,6 +2910,7 @@
2558
2910
  --button-color: var(--qti-correct);
2559
2911
  --button-border-color: var(--qti-correct);
2560
2912
  --button-box-shadow: none;
2913
+ --qti-grip-color: var(--qti-correct);
2561
2914
  }
2562
2915
 
2563
2916
  :is(qti-choice-interaction.qti-input-control-hidden qti-simple-choice):is(:state(candidate-incorrect), [data-state~='candidate-incorrect']) {
@@ -2565,6 +2918,7 @@
2565
2918
  --button-color: var(--qti-incorrect);
2566
2919
  --button-border-color: var(--qti-incorrect);
2567
2920
  --button-box-shadow: none;
2921
+ --qti-grip-color: var(--qti-incorrect);
2568
2922
  }
2569
2923
  :is(qti-choice-interaction:not(.qti-input-control-hidden) qti-simple-choice):is(:state(candidate-correct), [data-state~='candidate-correct']) {
2570
2924
  background-color: transparent;
@@ -2636,11 +2990,88 @@
2636
2990
  qti-graphic-gap-match-interaction qti-gap-img,qti-graphic-gap-match-interaction qti-gap-text {
2637
2991
  --qti-drag-justify-content: center;
2638
2992
  cursor: grab;
2993
+ /* The bank chip's own ring; the rule below rings only the placed one. */
2639
2994
  }
2640
- /* The placed chip, in the hotspot's shadow. Plain too, to match the bank. Focus ring only. */
2641
- :is(qti-graphic-gap-match-interaction qti-associable-hotspot::part(drag)):focus {
2642
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
2995
+ :is(qti-graphic-gap-match-interaction qti-gap-img,qti-graphic-gap-match-interaction qti-gap-text):focus:not(:is(:state(placeholder), [data-state~='placeholder']),:active) {
2996
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
2997
+ outline-offset: var(--qti-focus-offset);
2643
2998
  }
2999
+ /* The placed chip, in the hotspot's shadow. Plain too, to match the bank. Focus ring only.
3000
+ Written in one selector: nested under `&::part(drag)` it compiled to `:is(…::part(drag))`,
3001
+ and a pseudo-element cannot sit inside `:is()`, so the ring never matched. */
3002
+ qti-graphic-gap-match-interaction qti-associable-hotspot::part(drag):focus:not(:active) {
3003
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
3004
+ outline-offset: var(--qti-focus-offset);
3005
+ }
3006
+ qti-graphic-gap-match-interaction {
3007
+ /*
3008
+ * A WORD chip is a label, so it gets the chip box: the drag paint and the inline-field box, the
3009
+ * same as a gap-match chip, in the bank and on the image. An IMAGE tile stays plain, as above.
3010
+ */
3011
+ --qti-drag-padding: var(--qti-inline-field-padding);
3012
+ }
3013
+ qti-graphic-gap-match-interaction qti-gap-text {
3014
+ /* Structural — the load-bearing box, never state-switched (layout-invariance contract).
3015
+ box-sizing is deliberate: the clone is appended to document.body outside reset.css's
3016
+ @scope, so it inherits no border-box from anywhere else and this sets it. */
3017
+ box-sizing: border-box;
3018
+ padding: var(--qti-drag-padding);
3019
+ line-height: var(--qti-field-line-height);
3020
+ cursor: grab;
3021
+ /*
3022
+ * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.
3023
+ *
3024
+ * That one shared name is what makes a drag and its drop the same size without any arithmetic
3025
+ * relating them: the interaction measures the widest chip, publishes it once, and both the chip
3026
+ * and the slot read it. See DROP-SIZING.md.
3027
+ *
3028
+ * It applies in the bank as well as in the drop, which is the point: the chip already has the
3029
+ * width before it is dropped, so nothing changes size at the moment of landing. That keeps "a chip
3030
+ * is the same chip wherever it lives" true (drag-drop.invariance.spec.ts) and keeps the return
3031
+ * animation from ending in a snap. A `width: 100%` on the placed chip gives the same still image
3032
+ * and breaks both — it is what order used to do, and why order was the one entry in
3033
+ * CHIP_BOX_KNOWN_BAD.
3034
+ *
3035
+ * min-width, not width, so a chip whose own text is wider than the widest measured chip still
3036
+ * fits. Defaults to 0 where nothing is measured (match, whose targets are cards, not slots), so
3037
+ * those chips keep their natural width with no rule needed to say so.
3038
+ *
3039
+ * --qti-drag-min-width, not --qti-dropzone-min-width: the mixin writes the same measured value to
3040
+ * both, so a chip and its slot still match, but the two need OPPOSITE defaults when nothing is
3041
+ * measured — a chip must stay at its natural width, while a drops-grid track must not collapse.
3042
+ * See the note on both names in qti-variables.css.
3043
+ */
3044
+ min-width: var(--qti-drag-min-width, 0);
3045
+ /* Paint via the contract, nothing more — the --qti-component-* tokens already make a neutral
3046
+ bordered box (white surface, theme border, no shadow). The chip sets NO --drag-* of its own,
3047
+ and that is load-bearing: if it did (e.g. `--drag-background-color: white`), that declaration
3048
+ would ride the interaction's HIGH-specificity chip selector
3049
+ (`qti-gap-match-interaction qti-gap::part(drag)`) and out-specify a brand overlay's bare
3050
+ `qti-gap::part(drag)`, so the brand could never win. With nothing set here, the overlay's
3051
+ --drag-* is the only declaration and wins with no specificity/layer contest. */
3052
+ background-color: var(--drag-background-color, var(--qti-component-background-color));
3053
+ background-image: var(--drag-background-image, var(--qti-component-background-image));
3054
+ border-width: var(--drag-border-width, var(--qti-component-border-width));
3055
+ border-style: var(--drag-border-style, var(--qti-component-border-style));
3056
+ border-color: var(--drag-border-color, var(--qti-component-border-color));
3057
+ border-radius: var(--drag-border-radius, var(--qti-component-border-radius));
3058
+ box-shadow: var(--drag-box-shadow, var(--qti-component-box-shadow));
3059
+ color: var(--drag-color, var(--qti-component-color));
3060
+ opacity: var(--drag-opacity, var(--qti-component-opacity));
3061
+ filter: var(--drag-filter, var(--qti-component-filter));
3062
+ /* A chip is a selector, so it takes the selector radius, and its lift follows --cito-depth. Both
3063
+ re-declared with the slot in FRONT, the drop's dashed-edge pattern: the default changes, the
3064
+ slot still wins, and nothing is set on --drag-* (see above). */
3065
+ border-radius: var(--drag-border-radius, var(--qti-radius-selector));
3066
+ box-shadow: var(--drag-box-shadow, var(--qti-drag-lift));
3067
+ /* The chip's own colours (--cito-color-chip), behind the same slots: the surface and the
3068
+ surrounding text by default, a filled chip when a brand sets the tier-1 chip colour. */
3069
+ background-color: var(--drag-background-color, var(--qti-drag-fill));
3070
+ /* A brand can give a chip its own edge (--cito-color-chip-border), transparent for a borderless
3071
+ card; the width stays, so a chip keeps its size whichever edge it shows. */
3072
+ border-color: var(--drag-border-color, var(--cito-color-chip-border, var(--qti-component-border-color)));
3073
+ color: var(--drag-color, var(--cito-color-chip-content, inherit));
3074
+ }
2644
3075
  /*
2645
3076
  * The hotspot centres its chip in qti-associable-hotspot.styles.ts.
2646
3077
  *
@@ -2654,6 +3085,13 @@
2654
3085
  * Adding a rule would be a redundant restatement of this line. Left as a note rather than code
2655
3086
  * because the absence is the kind of thing that reads as an oversight.
2656
3087
  */
3088
+ /* Where a word or tile can go, shown at rest: a dashed edge on an empty hotspot, drawn as an
3089
+ outline so the hotspot's box does not change. Not under qti-unselected-hidden, where the author
3090
+ asks for the hotspots to stay hidden until used (QTI 3 Appendix B.1). */
3091
+ qti-graphic-gap-match-interaction:not(.qti-unselected-hidden) qti-associable-hotspot:not(:is(:state(filled), [data-state~='filled'])) {
3092
+ outline: var(--qti-border-width) dashed var(--qti-border-color);
3093
+ outline-offset: var(--qti-drop-outline-offset);
3094
+ }
2657
3095
  qti-graphic-gap-match-interaction qti-associable-hotspot {
2658
3096
  border: 2px solid transparent;
2659
3097
  /* No .qti-selections-* branches in here. They used to sit inside both of these blocks as
@@ -2699,7 +3137,7 @@
2699
3137
  chip `flex: 0 0 auto`, which is the invariance rule this was quietly fighting. */
2700
3138
  :is(qti-graphic-gap-match-interaction qti-associable-hotspot):not(:empty) > * {
2701
3139
  transform: rotate(0);
2702
- box-shadow: 0 0 0 1px #e5e7eb;
3140
+ box-shadow: 0 0 0 var(--qti-border-width) var(--qti-color-base-300);
2703
3141
  }
2704
3142
  /* `:not(:empty)` tested light-DOM children. The hotspot renders its chips into its own shadow
2705
3143
  root now, so it is always "empty" to a selector — `:state(filled)` is the occupancy hook. */
@@ -2720,7 +3158,8 @@
2720
3158
  * (positionShapes), so they scale along — see qti-graphic-gap-match-interaction.styles.ts.
2721
3159
  * reset.css gives every picture inside an interaction `max-width: none`, which outranks that
2722
3160
  * component's ::slotted() rule, so the fluid sizing is restated here for the graphic alone: a
2723
- * direct child, never a chip's picture, which must keep its size in the bank and the hotspot.
3161
+ * direct child, never a chip's picture: a chip scales by the graphic's factor as a whole
3162
+ * (`--qti-graphic-scale`, qti-gap-img.styles.ts), the same in the bank and the hotspot.
2724
3163
  */
2725
3164
  qti-graphic-gap-match-interaction > img,qti-graphic-gap-match-interaction > object {
2726
3165
  max-width: 100%;
@@ -2728,15 +3167,84 @@
2728
3167
  }
2729
3168
  }
2730
3169
 
3170
+ /* The placed word, in the hotspot's shadow. Flat: a pseudo-element in a nested list compiles to a
3171
+ dead `:is()`. */
3172
+ @layer qti-components.interactions.base {
3173
+ qti-graphic-gap-match-interaction qti-associable-hotspot::part(drag-text) {
3174
+ /* Structural — the load-bearing box, never state-switched (layout-invariance contract).
3175
+ box-sizing is deliberate: the clone is appended to document.body outside reset.css's
3176
+ @scope, so it inherits no border-box from anywhere else and this sets it. */
3177
+ box-sizing: border-box;
3178
+ padding: var(--qti-drag-padding);
3179
+ line-height: var(--qti-field-line-height);
3180
+ cursor: grab;
3181
+ /*
3182
+ * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.
3183
+ *
3184
+ * That one shared name is what makes a drag and its drop the same size without any arithmetic
3185
+ * relating them: the interaction measures the widest chip, publishes it once, and both the chip
3186
+ * and the slot read it. See DROP-SIZING.md.
3187
+ *
3188
+ * It applies in the bank as well as in the drop, which is the point: the chip already has the
3189
+ * width before it is dropped, so nothing changes size at the moment of landing. That keeps "a chip
3190
+ * is the same chip wherever it lives" true (drag-drop.invariance.spec.ts) and keeps the return
3191
+ * animation from ending in a snap. A `width: 100%` on the placed chip gives the same still image
3192
+ * and breaks both — it is what order used to do, and why order was the one entry in
3193
+ * CHIP_BOX_KNOWN_BAD.
3194
+ *
3195
+ * min-width, not width, so a chip whose own text is wider than the widest measured chip still
3196
+ * fits. Defaults to 0 where nothing is measured (match, whose targets are cards, not slots), so
3197
+ * those chips keep their natural width with no rule needed to say so.
3198
+ *
3199
+ * --qti-drag-min-width, not --qti-dropzone-min-width: the mixin writes the same measured value to
3200
+ * both, so a chip and its slot still match, but the two need OPPOSITE defaults when nothing is
3201
+ * measured — a chip must stay at its natural width, while a drops-grid track must not collapse.
3202
+ * See the note on both names in qti-variables.css.
3203
+ */
3204
+ min-width: var(--qti-drag-min-width, 0);
3205
+ /* Paint via the contract, nothing more — the --qti-component-* tokens already make a neutral
3206
+ bordered box (white surface, theme border, no shadow). The chip sets NO --drag-* of its own,
3207
+ and that is load-bearing: if it did (e.g. `--drag-background-color: white`), that declaration
3208
+ would ride the interaction's HIGH-specificity chip selector
3209
+ (`qti-gap-match-interaction qti-gap::part(drag)`) and out-specify a brand overlay's bare
3210
+ `qti-gap::part(drag)`, so the brand could never win. With nothing set here, the overlay's
3211
+ --drag-* is the only declaration and wins with no specificity/layer contest. */
3212
+ background-color: var(--drag-background-color, var(--qti-component-background-color));
3213
+ background-image: var(--drag-background-image, var(--qti-component-background-image));
3214
+ border-width: var(--drag-border-width, var(--qti-component-border-width));
3215
+ border-style: var(--drag-border-style, var(--qti-component-border-style));
3216
+ border-color: var(--drag-border-color, var(--qti-component-border-color));
3217
+ border-radius: var(--drag-border-radius, var(--qti-component-border-radius));
3218
+ box-shadow: var(--drag-box-shadow, var(--qti-component-box-shadow));
3219
+ color: var(--drag-color, var(--qti-component-color));
3220
+ opacity: var(--drag-opacity, var(--qti-component-opacity));
3221
+ filter: var(--drag-filter, var(--qti-component-filter));
3222
+ /* A chip is a selector, so it takes the selector radius, and its lift follows --cito-depth. Both
3223
+ re-declared with the slot in FRONT, the drop's dashed-edge pattern: the default changes, the
3224
+ slot still wins, and nothing is set on --drag-* (see above). */
3225
+ border-radius: var(--drag-border-radius, var(--qti-radius-selector));
3226
+ box-shadow: var(--drag-box-shadow, var(--qti-drag-lift));
3227
+ /* The chip's own colours (--cito-color-chip), behind the same slots: the surface and the
3228
+ surrounding text by default, a filled chip when a brand sets the tier-1 chip colour. */
3229
+ background-color: var(--drag-background-color, var(--qti-drag-fill));
3230
+ /* A brand can give a chip its own edge (--cito-color-chip-border), transparent for a borderless
3231
+ card; the width stays, so a chip keeps its size whichever edge it shows. */
3232
+ border-color: var(--drag-border-color, var(--cito-color-chip-border, var(--qti-component-border-color)));
3233
+ color: var(--drag-color, var(--cito-color-chip-content, inherit));
3234
+ }
3235
+ }
3236
+
2731
3237
  @layer qti-components.interactions.states {
2732
3238
  qti-graphic-gap-match-interaction qti-gap-img:is(:state(placeholder), [data-state~='placeholder']),
2733
3239
  qti-graphic-gap-match-interaction qti-gap-text:is(:state(placeholder), [data-state~='placeholder']) {
2734
3240
  /* The hole a spent/lifted chip leaves. Like the chip (see `drag`), it sets NO fill / border /
2735
- shadow of its own — those inherit from the resting chip (neutral by default, the brand's fill
2736
- when an overlay is on), so a brand can restyle the hole via a `:state(placeholder)` overlay
2737
- with no specificity contest. The one thing a placeholder always does, in every brand, is hide
2738
- its text; the default hole is then just the resting chip (white + border) with its text gone. */
3241
+ shadow here, on the interaction's high-specificity selector: the hole's paint is the bare
3242
+ `:state(placeholder)` rule in interactions/qti-placeholder.css (a primary tint, inset shadow),
3243
+ which a brand can restyle with the same selector and no specificity contest. The one thing this
3244
+ mixin does, in every brand, is hide what the chip shows: its text, and its handle, which a theme
3245
+ that colours its handles (--cito-color-drag-icon) would otherwise leave standing in the hole. */
2739
3246
  --drag-color: transparent;
3247
+ --qti-grip-color: transparent;
2740
3248
  --drag-opacity: 1;
2741
3249
  pointer-events: none;
2742
3250
  }
@@ -2744,15 +3252,17 @@
2744
3252
  qti-graphic-gap-match-interaction qti-gap-img:is(:state(dragging), [data-state~='dragging']),
2745
3253
  qti-graphic-gap-match-interaction qti-gap-text:is(:state(dragging), [data-state~='dragging']) {
2746
3254
  /* The hole a spent/lifted chip leaves. Like the chip (see `drag`), it sets NO fill / border /
2747
- shadow of its own — those inherit from the resting chip (neutral by default, the brand's fill
2748
- when an overlay is on), so a brand can restyle the hole via a `:state(placeholder)` overlay
2749
- with no specificity contest. The one thing a placeholder always does, in every brand, is hide
2750
- its text; the default hole is then just the resting chip (white + border) with its text gone. */
3255
+ shadow here, on the interaction's high-specificity selector: the hole's paint is the bare
3256
+ `:state(placeholder)` rule in interactions/qti-placeholder.css (a primary tint, inset shadow),
3257
+ which a brand can restyle with the same selector and no specificity contest. The one thing this
3258
+ mixin does, in every brand, is hide what the chip shows: its text, and its handle, which a theme
3259
+ that colours its handles (--cito-color-drag-icon) would otherwise leave standing in the hole. */
2751
3260
  --drag-color: transparent;
3261
+ --qti-grip-color: transparent;
2752
3262
  --drag-opacity: 1;
2753
3263
  border-color: var(--qti-drop-highlight-border-color);
2754
3264
  box-shadow: inset 0 0 0 var(--qti-drop-highlight-border-width, 2px)
2755
- color-mix(in srgb, var(--qti-drop-highlight-border-color) 55%, transparent);
3265
+ color-mix(in oklab, var(--qti-drop-highlight-border-color) 55%, transparent);
2756
3266
  pointer-events: none;
2757
3267
  }
2758
3268
 
@@ -2760,7 +3270,7 @@
2760
3270
  qti-graphic-gap-match-interaction qti-gap-text:is(:state(return-anchor), [data-state~='return-anchor']) {
2761
3271
  border-color: var(--qti-drop-highlight-border-color);
2762
3272
  box-shadow: inset 0 0 0 var(--qti-drop-highlight-border-width, 2px)
2763
- color-mix(in srgb, var(--qti-drop-highlight-border-color) 55%, transparent);
3273
+ color-mix(in oklab, var(--qti-drop-highlight-border-color) 55%, transparent);
2764
3274
  }
2765
3275
 
2766
3276
  qti-graphic-gap-match-interaction qti-gap-img:is(:state(placeholder), [data-state~='placeholder']) > *,
@@ -2770,14 +3280,17 @@
2770
3280
  visibility: hidden;
2771
3281
  }
2772
3282
 
2773
- qti-graphic-gap-match-interaction qti-associable-hotspot:is(:state(hover), [data-state~='hover']),
2774
- qti-graphic-gap-match-interaction qti-associable-hotspot:is(:state(active), [data-state~='active']) {
2775
- background-color: var(--qti-drop-highlight-bg);
2776
- }
2777
-
3283
+ qti-graphic-gap-match-interaction qti-associable-hotspot:is(:state(active), [data-state~='active']),
2778
3284
  qti-graphic-gap-match-interaction qti-associable-hotspot:is(:state(enabled), [data-state~='enabled']) {
2779
3285
  background-color: var(--qti-drop-highlight-enabled-bg);
2780
3286
  }
3287
+
3288
+ /* After `enabled`, which every target carries during a drag: the one under the chip. */
3289
+ qti-graphic-gap-match-interaction qti-associable-hotspot:is(:state(hover), [data-state~='hover']) {
3290
+ background-color: var(--qti-drop-highlight-bg);
3291
+ outline: var(--qti-drop-highlight-border-width) solid var(--qti-drop-highlight-border-color);
3292
+ outline-offset: var(--qti-focus-offset);
3293
+ }
2781
3294
  }
2782
3295
 
2783
3296
  @layer qti-components.interactions.corrections {
@@ -2794,16 +3307,27 @@
2794
3307
  * Moved here from qti-corrections.css, whose unscoped `:state(drag)` rule covered these chips
2795
3308
  * along with everyone else's.
2796
3309
  */
2797
- qti-graphic-gap-match-interaction :is(:state(drag), [data-state~='drag']):is(:state(candidate-correct), [data-state~='candidate-correct']),
2798
- qti-graphic-gap-match-interaction qti-associable-hotspot::part(drag):is(:state(candidate-correct), [data-state~='candidate-correct']) {
3310
+ qti-graphic-gap-match-interaction :is(:state(drag), [data-state~='drag']):is(:state(candidate-correct), [data-state~='candidate-correct']) {
3311
+ background-color: var(--qti-correct-light);
3312
+ color: var(--qti-correct);
3313
+ border-color: var(--qti-correct);
3314
+ box-shadow: none;
3315
+ }
3316
+ qti-graphic-gap-match-interaction qti-associable-hotspot::part(drag):state(candidate-correct) {
2799
3317
  background-color: var(--qti-correct-light);
2800
3318
  color: var(--qti-correct);
2801
3319
  border-color: var(--qti-correct);
2802
3320
  box-shadow: none;
2803
3321
  }
2804
3322
 
2805
- qti-graphic-gap-match-interaction :is(:state(drag), [data-state~='drag']):is(:state(candidate-incorrect), [data-state~='candidate-incorrect']),
2806
- qti-graphic-gap-match-interaction qti-associable-hotspot::part(drag):is(:state(candidate-incorrect), [data-state~='candidate-incorrect']) {
3323
+ qti-graphic-gap-match-interaction :is(:state(drag), [data-state~='drag']):is(:state(candidate-incorrect), [data-state~='candidate-incorrect']) {
3324
+ background-color: var(--qti-incorrect-light);
3325
+ color: var(--qti-incorrect);
3326
+ border-color: var(--qti-incorrect);
3327
+ box-shadow: none;
3328
+ }
3329
+
3330
+ qti-graphic-gap-match-interaction qti-associable-hotspot::part(drag):state(candidate-incorrect) {
2807
3331
  background-color: var(--qti-incorrect-light);
2808
3332
  color: var(--qti-incorrect);
2809
3333
  border-color: var(--qti-incorrect);
@@ -2824,19 +3348,42 @@
2824
3348
  opacity: var(--text-opacity, var(--qti-component-opacity));
2825
3349
  filter: var(--text-filter, var(--qti-component-filter));
2826
3350
  cursor: text;
3351
+
3352
+ margin-inline: var(--qti-inline-gap);
3353
+
3354
+ line-height: var(--qti-field-line-height);
3355
+
3356
+ --qti-padding-box: var(--qti-inline-field-padding);
3357
+
3358
+ /* The correction badge sits as far in from the end as the text does from the start. */
3359
+
3360
+ --qti-correction-inset: var(--qti-inline-padding-inline);
3361
+
3362
+ /* The host is the field's box, so the ring goes on the host, around the border a candidate
3363
+ sees, and the input inside it draws none of its own: a browser's default ring there was a
3364
+ second one, inside the first (and orange, in Chrome). Transparent rather than removed, so a
3365
+ forced-colours mode that paints outlines still shows one. */
2827
3366
  }
3367
+ qti-text-entry-interaction:focus-within {
3368
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
3369
+ outline-offset: var(--qti-focus-offset);
3370
+ }
2828
3371
 
2829
3372
  qti-text-entry-interaction::part(input) {
2830
3373
  color: var(--qti-fg);
2831
3374
  font-family: inherit;
2832
3375
  font-size: 1rem;
2833
- line-height: 1.5;
3376
+ line-height: var(--qti-field-line-height);
2834
3377
  -webkit-appearance: none;
2835
3378
  -moz-appearance: none;
2836
3379
  appearance: none;
2837
3380
  border: none;
2838
3381
  background-color: transparent;
2839
3382
  }
3383
+
3384
+ qti-text-entry-interaction::part(input):focus-visible {
3385
+ outline: var(--qti-focus-border-width) solid transparent;
3386
+ }
2840
3387
  }
2841
3388
 
2842
3389
  @layer qti-components.interactions.corrections {
@@ -2845,6 +3392,7 @@
2845
3392
  --text-color: var(--qti-partially-correct);
2846
3393
  --text-border-color: var(--qti-partially-correct);
2847
3394
  --text-box-shadow: none;
3395
+ --qti-grip-color: var(--qti-partially-correct);
2848
3396
  }
2849
3397
 
2850
3398
  qti-text-entry-interaction:is(:state(candidate-correct), [data-state~='candidate-correct']) {
@@ -2852,6 +3400,7 @@
2852
3400
  --text-color: var(--qti-correct);
2853
3401
  --text-border-color: var(--qti-correct);
2854
3402
  --text-box-shadow: none;
3403
+ --qti-grip-color: var(--qti-correct);
2855
3404
  }
2856
3405
 
2857
3406
  qti-text-entry-interaction:is(:state(candidate-incorrect), [data-state~='candidate-incorrect']) {
@@ -2859,6 +3408,7 @@
2859
3408
  --text-color: var(--qti-incorrect);
2860
3409
  --text-border-color: var(--qti-incorrect);
2861
3410
  --text-box-shadow: none;
3411
+ --qti-grip-color: var(--qti-incorrect);
2862
3412
  }
2863
3413
 
2864
3414
  /* The answer key, moved here from the shared qti-corrections.css: it names this interaction, so
@@ -2899,9 +3449,10 @@
2899
3449
  color: var(--qti-fg);
2900
3450
  font-family: inherit;
2901
3451
  font-size: 1rem;
2902
- line-height: 1.5;
3452
+ line-height: var(--qti-field-line-height);
2903
3453
  /*
2904
- * The left gutter is reserved ALWAYS, graded or not.
3454
+ * The gutter at the END of the line is reserved ALWAYS, graded or not (it was on the left, which
3455
+ * indented every answer by the badge's room).
2905
3456
  *
2906
3457
  * It holds the correction badge, and it is stated here rather than in the corrections layer
2907
3458
  * because padding is layout: switching it on `:state(candidate-*)` would re-wrap every line of
@@ -2917,8 +3468,8 @@
2917
3468
  * padding and the badge's own offsets cannot drift apart. It was a literal 2.4rem that had to
2918
3469
  * be kept in agreement by hand with numbers in a different package.
2919
3470
  */
2920
- padding: var(--qti-spacing) var(--qti-correction-inset) var(--qti-spacing)
2921
- var(--qti-correction-gutter);
3471
+ padding-block: var(--qti-spacing);
3472
+ padding-inline: var(--qti-correction-inset) var(--qti-correction-gutter);
2922
3473
 
2923
3474
  background-color: var(--text-background-color, var(--qti-component-background-color));
2924
3475
 
@@ -2953,6 +3504,12 @@
2953
3504
  * that makes the preserved indentation legible. Typography only — the box does not move, so
2954
3505
  * the layout-invariance contract holds.
2955
3506
  */
3507
+ /* The textarea is the field's box itself, so the theme's ring replaces the browser's. */
3508
+ qti-extended-text-interaction::part(textarea):focus-visible {
3509
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
3510
+ outline-offset: var(--qti-focus-offset);
3511
+ }
3512
+
2956
3513
  qti-extended-text-interaction[format='preformatted']::part(textarea) {
2957
3514
  font-family: monospace;
2958
3515
  -moz-tab-size: 2;
@@ -2985,6 +3542,7 @@
2985
3542
  --text-color: var(--qti-correct);
2986
3543
  --text-border-color: var(--qti-correct);
2987
3544
  --text-box-shadow: none;
3545
+ --qti-grip-color: var(--qti-correct);
2988
3546
  }
2989
3547
 
2990
3548
  /* Amber throughout — text, edge and wash — exactly like text-entry's partial rule, which is the
@@ -2998,6 +3556,7 @@
2998
3556
  --text-color: var(--qti-partially-correct);
2999
3557
  --text-border-color: var(--qti-partially-correct);
3000
3558
  --text-box-shadow: none;
3559
+ --qti-grip-color: var(--qti-partially-correct);
3001
3560
  }
3002
3561
 
3003
3562
  qti-extended-text-interaction:is(:state(candidate-incorrect), [data-state~='candidate-incorrect'])::part(textarea) {
@@ -3005,6 +3564,7 @@
3005
3564
  --text-color: var(--qti-incorrect);
3006
3565
  --text-border-color: var(--qti-incorrect);
3007
3566
  --text-box-shadow: none;
3567
+ --qti-grip-color: var(--qti-incorrect);
3008
3568
  }
3009
3569
  }
3010
3570
  /* This interaction's chip vocabulary — the bank chip, the placed chip, and the floating clone. One
@@ -3030,6 +3590,7 @@
3030
3590
  @scope, so it inherits no border-box from anywhere else and this sets it. */
3031
3591
  box-sizing: border-box;
3032
3592
  padding: var(--qti-drag-padding);
3593
+ line-height: var(--qti-field-line-height);
3033
3594
  cursor: grab;
3034
3595
  /*
3035
3596
  * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.
@@ -3072,6 +3633,18 @@
3072
3633
  color: var(--drag-color, var(--qti-component-color));
3073
3634
  opacity: var(--drag-opacity, var(--qti-component-opacity));
3074
3635
  filter: var(--drag-filter, var(--qti-component-filter));
3636
+ /* A chip is a selector, so it takes the selector radius, and its lift follows --cito-depth. Both
3637
+ re-declared with the slot in FRONT, the drop's dashed-edge pattern: the default changes, the
3638
+ slot still wins, and nothing is set on --drag-* (see above). */
3639
+ border-radius: var(--drag-border-radius, var(--qti-radius-selector));
3640
+ box-shadow: var(--drag-box-shadow, var(--qti-drag-lift));
3641
+ /* The chip's own colours (--cito-color-chip), behind the same slots: the surface and the
3642
+ surrounding text by default, a filled chip when a brand sets the tier-1 chip colour. */
3643
+ background-color: var(--drag-background-color, var(--qti-drag-fill));
3644
+ /* A brand can give a chip its own edge (--cito-color-chip-border), transparent for a borderless
3645
+ card; the width stays, so a chip keeps its size whichever edge it shows. */
3646
+ border-color: var(--drag-border-color, var(--cito-color-chip-border, var(--qti-component-border-color)));
3647
+ color: var(--drag-color, var(--cito-color-chip-content, inherit));
3075
3648
  }
3076
3649
 
3077
3650
  qti-gap-match-interaction :is(:state(drag), [data-state~='drag'])::part(control)::before,
@@ -3084,23 +3657,40 @@
3084
3657
  width: 0.75em;
3085
3658
  height: 1em;
3086
3659
  margin-right: var(--qti-glyph-gap);
3087
- background-color: currentColor;
3660
+ /* A verdict (`@mixin candidate`) sets --qti-grip-color, so a corrected chip's handle takes the
3661
+ verdict colour even when a brand colours its handles. */
3662
+ background-color: var(--qti-grip-color, var(--cito-color-drag-icon, currentColor));
3088
3663
  mask: var(--qti-grip-mask) no-repeat center / contain;
3089
3664
  -webkit-mask: var(--qti-grip-mask) no-repeat center / contain;
3090
3665
  }
3091
3666
  }
3092
3667
 
3093
3668
  @layer qti-components.interactions.base {
3669
+ qti-gap-match-interaction {
3670
+ /* Its chips go into gaps in a sentence, so they are inline fields too: the inline-field padding
3671
+ instead of a chip's roomier one, and the field line height. A gap is sized by the chip it
3672
+ takes, so it follows. Bank chips get the same box, so a chip does not change size when it
3673
+ lands (drag-drop.invariance.spec.ts). */
3674
+ --qti-drag-padding: var(--qti-inline-field-padding);
3094
3675
  /* No qti-selections-light / -dark here. Appendix B.1 of the QTI 3 implementation guide defines
3095
3676
  that class pair for qti-hotspot-interaction and qti-graphic-gap-match-interaction only, and no
3096
3677
  item in this repo ever set it on a gap-match interaction. What was here overrode the neutral
3097
3678
  drag-bank highlight below with --qti-light-* and --qti-dark-* colours that nothing could reach. */
3679
+ }
3098
3680
  qti-gap-match-interaction:is(:state(dragzone-active), [data-state~='dragzone-active'])::part(drags) {
3099
3681
  background-color: var(--qti-bg-active);
3100
3682
  }
3101
3683
  qti-gap-match-interaction:is(:state(dragzone-enabled), [data-state~='dragzone-enabled'])::part(drags) {
3102
3684
  background-color: var(--qti-bg-active);
3103
3685
  }
3686
+ qti-gap-match-interaction qti-gap {
3687
+ margin-inline: var(--qti-inline-gap);
3688
+ line-height: var(--qti-field-line-height);
3689
+ --qti-padding-box: var(--qti-inline-field-padding);
3690
+ /* The correction badge sits as far in from the end as the text does from the start. */
3691
+ --qti-correction-inset: var(--qti-inline-padding-inline);
3692
+ }
3693
+
3104
3694
  /* Editor fake-drag projected into a filled <qti-gap>'s shadow. Same `drag`
3105
3695
  styling so the editor preview matches runtime when a gap is filled. */
3106
3696
  qti-gap-match-interaction qti-gap::part(drag) {
@@ -3109,6 +3699,7 @@
3109
3699
  @scope, so it inherits no border-box from anywhere else and this sets it. */
3110
3700
  box-sizing: border-box;
3111
3701
  padding: var(--qti-drag-padding);
3702
+ line-height: var(--qti-field-line-height);
3112
3703
  cursor: grab;
3113
3704
  /*
3114
3705
  * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.
@@ -3151,25 +3742,26 @@
3151
3742
  color: var(--drag-color, var(--qti-component-color));
3152
3743
  opacity: var(--drag-opacity, var(--qti-component-opacity));
3153
3744
  filter: var(--drag-filter, var(--qti-component-filter));
3745
+ /* A chip is a selector, so it takes the selector radius, and its lift follows --cito-depth. Both
3746
+ re-declared with the slot in FRONT, the drop's dashed-edge pattern: the default changes, the
3747
+ slot still wins, and nothing is set on --drag-* (see above). */
3748
+ border-radius: var(--drag-border-radius, var(--qti-radius-selector));
3749
+ box-shadow: var(--drag-box-shadow, var(--qti-drag-lift));
3750
+ /* The chip's own colours (--cito-color-chip), behind the same slots: the surface and the
3751
+ surrounding text by default, a filled chip when a brand sets the tier-1 chip colour. */
3752
+ background-color: var(--drag-background-color, var(--qti-drag-fill));
3753
+ /* A brand can give a chip its own edge (--cito-color-chip-border), transparent for a borderless
3754
+ card; the width stays, so a chip keeps its size whichever edge it shows. */
3755
+ border-color: var(--drag-border-color, var(--cito-color-chip-border, var(--qti-component-border-color)));
3756
+ color: var(--drag-color, var(--cito-color-chip-content, inherit));
3154
3757
  }
3155
- @media (hover: hover) {
3156
- :is(qti-gap-match-interaction qti-gap::part(drag)):hover {
3157
- background-color: color-mix(
3158
- in srgb,
3159
- var(--drag-background-color, var(--qti-component-background-color)) 92%,
3160
- black
3161
- );
3162
- }
3163
- }
3164
- :is(qti-gap-match-interaction qti-gap::part(drag)):focus {
3165
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
3166
- }
3167
3758
  qti-gap-match-interaction qti-gap-text {
3168
3759
  /* Structural — the load-bearing box, never state-switched (layout-invariance contract).
3169
3760
  box-sizing is deliberate: the clone is appended to document.body outside reset.css's
3170
3761
  @scope, so it inherits no border-box from anywhere else and this sets it. */
3171
3762
  box-sizing: border-box;
3172
3763
  padding: var(--qti-drag-padding);
3764
+ line-height: var(--qti-field-line-height);
3173
3765
  cursor: grab;
3174
3766
  /*
3175
3767
  * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.
@@ -3212,23 +3804,33 @@
3212
3804
  color: var(--drag-color, var(--qti-component-color));
3213
3805
  opacity: var(--drag-opacity, var(--qti-component-opacity));
3214
3806
  filter: var(--drag-filter, var(--qti-component-filter));
3807
+ /* A chip is a selector, so it takes the selector radius, and its lift follows --cito-depth. Both
3808
+ re-declared with the slot in FRONT, the drop's dashed-edge pattern: the default changes, the
3809
+ slot still wins, and nothing is set on --drag-* (see above). */
3810
+ border-radius: var(--drag-border-radius, var(--qti-radius-selector));
3811
+ box-shadow: var(--drag-box-shadow, var(--qti-drag-lift));
3812
+ /* The chip's own colours (--cito-color-chip), behind the same slots: the surface and the
3813
+ surrounding text by default, a filled chip when a brand sets the tier-1 chip colour. */
3814
+ background-color: var(--drag-background-color, var(--qti-drag-fill));
3815
+ /* A brand can give a chip its own edge (--cito-color-chip-border), transparent for a borderless
3816
+ card; the width stays, so a chip keeps its size whichever edge it shows. */
3817
+ border-color: var(--drag-border-color, var(--cito-color-chip-border, var(--qti-component-border-color)));
3818
+ color: var(--drag-color, var(--cito-color-chip-content, inherit));
3819
+ line-height: var(--qti-field-line-height);
3215
3820
  }
3216
3821
  [dragging]:is(qti-gap-match-interaction qti-gap-text) {
3217
3822
  pointer-events: none;
3218
3823
  rotate: -2deg;
3219
- --drag-box-shadow: 0 8px 12px rgb(0 0 0 / 20%), 0 4px 8px rgb(0 0 0 / 10%);
3824
+ --drag-box-shadow: var(--qti-drag-elevation);
3220
3825
  }
3221
- @media (hover: hover) {
3826
+ @media (hover: hover) and (pointer: fine) {
3222
3827
  :is(qti-gap-match-interaction qti-gap-text):hover {
3223
- background-color: color-mix(
3224
- in srgb,
3225
- var(--drag-background-color, var(--qti-component-background-color)) 92%,
3226
- black
3227
- );
3828
+ --drag-border-color: var(--qti-border-active);
3228
3829
  }
3229
3830
  }
3230
- :is(qti-gap-match-interaction qti-gap-text):focus {
3231
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
3831
+ :is(qti-gap-match-interaction qti-gap-text):focus:not(:is(:state(placeholder), [data-state~='placeholder']),:active) {
3832
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
3833
+ outline-offset: var(--qti-focus-offset);
3232
3834
  }
3233
3835
  qti-gap-match-interaction qti-gap {
3234
3836
  background-color: var(--drop-background-color, var(--qti-component-background-color));
@@ -3243,6 +3845,26 @@
3243
3845
  filter: var(--drop-filter, var(--qti-component-filter));
3244
3846
  border-style: var(--drop-border-style, dashed);
3245
3847
 
3848
+ /*
3849
+ * The dashed edge as an inset OUTLINE, not a border, so the gap is exactly as tall as the chip
3850
+ * it takes and as every other field in the sentence. A border would add its width to the chip's
3851
+ * height (the gap reserves the chip's border-box inside its own border). The outline reads the
3852
+ * same --drop-* slots as the border did, so the states and corrections that switch them still
3853
+ * repaint it; focus draws its own ring over it.
3854
+ */
3855
+ --drop-border-width: 0;
3856
+ outline: var(--qti-border-width) var(--drop-border-style, dashed)
3857
+ var(--drop-border-color, var(--qti-component-border-color));
3858
+ outline-offset: var(--qti-drop-outline-offset);
3859
+
3860
+ /* Focused (Tab, or the keyboard drag moving to it), the solid ring replaces the dashed edge:
3861
+ both are the outline, so without this the focus could not be seen. */
3862
+ }
3863
+ :is(qti-gap-match-interaction qti-gap):focus {
3864
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
3865
+ outline-offset: var(--qti-focus-offset);
3866
+ }
3867
+
3246
3868
  /*
3247
3869
  * A filled gap hides its dashed edge, exactly as a filled order slot does
3248
3870
  * (qti-order-interaction.css, `::part(filled)`).
@@ -3258,7 +3880,6 @@
3258
3880
  * every word on the line the instant a chip landed — the exact reflow qti-gap.styles.ts and
3259
3881
  * drag-drop.invariance.spec.ts exist to prevent.
3260
3882
  */
3261
- }
3262
3883
  :is(qti-gap-match-interaction qti-gap):is(:state(filled), [data-state~='filled']):is(:not([match-max]),[match-max='1']) {
3263
3884
  --drop-border-color: transparent;
3264
3885
  }
@@ -3307,7 +3928,7 @@
3307
3928
  transform: rotate(0);
3308
3929
  /* Through the drag slot so a correction (which sets --drag-box-shadow) composes over it
3309
3930
  instead of this leaking onto a corrected chip. */
3310
- --drag-box-shadow: 0 0 0 1px #e5e7eb;
3931
+ --drag-box-shadow: 0 0 0 var(--qti-border-width) var(--qti-color-base-300);
3311
3932
  }
3312
3933
 
3313
3934
  /* The source and placed chip share one visual component. */
@@ -3318,6 +3939,7 @@
3318
3939
  @scope, so it inherits no border-box from anywhere else and this sets it. */
3319
3940
  box-sizing: border-box;
3320
3941
  padding: var(--qti-drag-padding);
3942
+ line-height: var(--qti-field-line-height);
3321
3943
  cursor: grab;
3322
3944
  /*
3323
3945
  * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.
@@ -3360,6 +3982,18 @@
3360
3982
  color: var(--drag-color, var(--qti-component-color));
3361
3983
  opacity: var(--drag-opacity, var(--qti-component-opacity));
3362
3984
  filter: var(--drag-filter, var(--qti-component-filter));
3985
+ /* A chip is a selector, so it takes the selector radius, and its lift follows --cito-depth. Both
3986
+ re-declared with the slot in FRONT, the drop's dashed-edge pattern: the default changes, the
3987
+ slot still wins, and nothing is set on --drag-* (see above). */
3988
+ border-radius: var(--drag-border-radius, var(--qti-radius-selector));
3989
+ box-shadow: var(--drag-box-shadow, var(--qti-drag-lift));
3990
+ /* The chip's own colours (--cito-color-chip), behind the same slots: the surface and the
3991
+ surrounding text by default, a filled chip when a brand sets the tier-1 chip colour. */
3992
+ background-color: var(--drag-background-color, var(--qti-drag-fill));
3993
+ /* A brand can give a chip its own edge (--cito-color-chip-border), transparent for a borderless
3994
+ card; the width stays, so a chip keeps its size whichever edge it shows. */
3995
+ border-color: var(--drag-border-color, var(--cito-color-chip-border, var(--qti-component-border-color)));
3996
+ color: var(--drag-color, var(--cito-color-chip-content, inherit));
3363
3997
  }
3364
3998
  }
3365
3999
 
@@ -3371,6 +4005,7 @@
3371
4005
  @scope, so it inherits no border-box from anywhere else and this sets it. */
3372
4006
  box-sizing: border-box;
3373
4007
  padding: var(--qti-drag-padding);
4008
+ line-height: var(--qti-field-line-height);
3374
4009
  cursor: grab;
3375
4010
  /*
3376
4011
  * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.
@@ -3413,47 +4048,82 @@
3413
4048
  color: var(--drag-color, var(--qti-component-color));
3414
4049
  opacity: var(--drag-opacity, var(--qti-component-opacity));
3415
4050
  filter: var(--drag-filter, var(--qti-component-filter));
4051
+ /* A chip is a selector, so it takes the selector radius, and its lift follows --cito-depth. Both
4052
+ re-declared with the slot in FRONT, the drop's dashed-edge pattern: the default changes, the
4053
+ slot still wins, and nothing is set on --drag-* (see above). */
4054
+ border-radius: var(--drag-border-radius, var(--qti-radius-selector));
4055
+ box-shadow: var(--drag-box-shadow, var(--qti-drag-lift));
4056
+ /* The chip's own colours (--cito-color-chip), behind the same slots: the surface and the
4057
+ surrounding text by default, a filled chip when a brand sets the tier-1 chip colour. */
4058
+ background-color: var(--drag-background-color, var(--qti-drag-fill));
4059
+ /* A brand can give a chip its own edge (--cito-color-chip-border), transparent for a borderless
4060
+ card; the width stays, so a chip keeps its size whichever edge it shows. */
4061
+ border-color: var(--drag-border-color, var(--cito-color-chip-border, var(--qti-component-border-color)));
4062
+ color: var(--drag-color, var(--cito-color-chip-content, inherit));
4063
+ }
4064
+
4065
+ /*
4066
+ * A placed chip's hover and focus ring. Written flat: nested under `&::part(drag)` they
4067
+ * compiled to `:is(…::part(drag)):hover`, and a pseudo-element cannot sit inside `:is()`, so none
4068
+ * of them ever matched. In this layer, after the chip rule, because `@mixin drag` sets
4069
+ * `background-color` and must not out-rank the hover.
4070
+ */
4071
+ @media (hover: hover) and (pointer: fine) {
4072
+ qti-gap-match-interaction qti-gap::part(drag):hover {
4073
+ --drag-border-color: var(--qti-border-active);
4074
+ }
4075
+ }
4076
+ qti-gap-match-interaction qti-gap::part(drag):focus:not(:active) {
4077
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
4078
+ outline-offset: var(--qti-focus-offset);
3416
4079
  }
3417
4080
 
3418
4081
  qti-gap-match-interaction qti-gap-text:is(:state(placeholder), [data-state~='placeholder']) {
3419
4082
  /* The hole a spent/lifted chip leaves. Like the chip (see `drag`), it sets NO fill / border /
3420
- shadow of its own — those inherit from the resting chip (neutral by default, the brand's fill
3421
- when an overlay is on), so a brand can restyle the hole via a `:state(placeholder)` overlay
3422
- with no specificity contest. The one thing a placeholder always does, in every brand, is hide
3423
- its text; the default hole is then just the resting chip (white + border) with its text gone. */
4083
+ shadow here, on the interaction's high-specificity selector: the hole's paint is the bare
4084
+ `:state(placeholder)` rule in interactions/qti-placeholder.css (a primary tint, inset shadow),
4085
+ which a brand can restyle with the same selector and no specificity contest. The one thing this
4086
+ mixin does, in every brand, is hide what the chip shows: its text, and its handle, which a theme
4087
+ that colours its handles (--cito-color-drag-icon) would otherwise leave standing in the hole. */
3424
4088
  --drag-color: transparent;
4089
+ --qti-grip-color: transparent;
3425
4090
  --drag-opacity: 1;
3426
4091
  pointer-events: none;
3427
4092
  }
3428
4093
 
3429
4094
  qti-gap-match-interaction qti-gap-text:is(:state(dragging), [data-state~='dragging']) {
3430
4095
  /* The hole a spent/lifted chip leaves. Like the chip (see `drag`), it sets NO fill / border /
3431
- shadow of its own — those inherit from the resting chip (neutral by default, the brand's fill
3432
- when an overlay is on), so a brand can restyle the hole via a `:state(placeholder)` overlay
3433
- with no specificity contest. The one thing a placeholder always does, in every brand, is hide
3434
- its text; the default hole is then just the resting chip (white + border) with its text gone. */
4096
+ shadow here, on the interaction's high-specificity selector: the hole's paint is the bare
4097
+ `:state(placeholder)` rule in interactions/qti-placeholder.css (a primary tint, inset shadow),
4098
+ which a brand can restyle with the same selector and no specificity contest. The one thing this
4099
+ mixin does, in every brand, is hide what the chip shows: its text, and its handle, which a theme
4100
+ that colours its handles (--cito-color-drag-icon) would otherwise leave standing in the hole. */
3435
4101
  --drag-color: transparent;
4102
+ --qti-grip-color: transparent;
3436
4103
  --drag-opacity: 1;
3437
4104
  border-color: var(--qti-drop-highlight-border-color);
3438
4105
  box-shadow: inset 0 0 0 var(--qti-drop-highlight-border-width, 2px)
3439
- color-mix(in srgb, var(--qti-drop-highlight-border-color) 55%, transparent);
4106
+ color-mix(in oklab, var(--qti-drop-highlight-border-color) 55%, transparent);
3440
4107
  pointer-events: none;
3441
4108
  }
3442
4109
 
3443
4110
  qti-gap-match-interaction qti-gap-text:is(:state(return-anchor), [data-state~='return-anchor']) {
3444
4111
  border-color: var(--qti-drop-highlight-border-color);
3445
4112
  box-shadow: inset 0 0 0 var(--qti-drop-highlight-border-width, 2px)
3446
- color-mix(in srgb, var(--qti-drop-highlight-border-color) 55%, transparent);
3447
- }
3448
-
3449
- qti-gap-match-interaction qti-gap:is(:state(hover), [data-state~='hover']),
3450
- qti-gap-match-interaction qti-gap:is(:state(active), [data-state~='active']) {
3451
- background-color: var(--qti-drop-highlight-bg);
4113
+ color-mix(in oklab, var(--qti-drop-highlight-border-color) 55%, transparent);
3452
4114
  }
3453
4115
 
4116
+ qti-gap-match-interaction qti-gap:is(:state(active), [data-state~='active']),
3454
4117
  qti-gap-match-interaction qti-gap:is(:state(enabled), [data-state~='enabled']) {
3455
4118
  background-color: var(--qti-drop-highlight-enabled-bg);
3456
4119
  }
4120
+
4121
+ /* After `enabled`, which every target carries during a drag: the one under the chip. */
4122
+ qti-gap-match-interaction qti-gap:is(:state(hover), [data-state~='hover']) {
4123
+ background-color: var(--qti-drop-highlight-bg);
4124
+ outline: var(--qti-drop-highlight-border-width) solid var(--qti-drop-highlight-border-color);
4125
+ outline-offset: var(--qti-focus-offset);
4126
+ }
3457
4127
  }
3458
4128
 
3459
4129
  @layer qti-components.interactions.corrections {
@@ -3468,20 +4138,35 @@
3468
4138
  DIRECTLY, which outranks the paint binding that reads --drag-background-color, so the solid fill
3469
4139
  they asked for never rendered — a corrected gap-text has always been the pale tint. Left in place
3470
4140
  they would have come alive the moment the shared rule left, and turned solid. */
3471
- qti-gap-match-interaction :is(:state(drag), [data-state~='drag']):is(:state(candidate-correct), [data-state~='candidate-correct']),
3472
- qti-gap::part(drag):is(:state(candidate-correct), [data-state~='candidate-correct']) {
4141
+ qti-gap-match-interaction :is(:state(drag), [data-state~='drag']):is(:state(candidate-correct), [data-state~='candidate-correct']) {
4142
+ --drag-background-color: var(--qti-correct-light);
4143
+ --drag-color: var(--qti-correct);
4144
+ --drag-border-color: var(--qti-correct);
4145
+ --drag-box-shadow: none;
4146
+ --qti-grip-color: var(--qti-correct);
4147
+ }
4148
+ qti-gap::part(drag):state(candidate-correct) {
3473
4149
  --drag-background-color: var(--qti-correct-light);
3474
4150
  --drag-color: var(--qti-correct);
3475
4151
  --drag-border-color: var(--qti-correct);
3476
4152
  --drag-box-shadow: none;
4153
+ --qti-grip-color: var(--qti-correct);
3477
4154
  }
3478
4155
 
3479
- qti-gap-match-interaction :is(:state(drag), [data-state~='drag']):is(:state(candidate-incorrect), [data-state~='candidate-incorrect']),
3480
- qti-gap::part(drag):is(:state(candidate-incorrect), [data-state~='candidate-incorrect']) {
4156
+ qti-gap-match-interaction :is(:state(drag), [data-state~='drag']):is(:state(candidate-incorrect), [data-state~='candidate-incorrect']) {
3481
4157
  --drag-background-color: var(--qti-incorrect-light);
3482
4158
  --drag-color: var(--qti-incorrect);
3483
4159
  --drag-border-color: var(--qti-incorrect);
3484
4160
  --drag-box-shadow: none;
4161
+ --qti-grip-color: var(--qti-incorrect);
4162
+ }
4163
+
4164
+ qti-gap::part(drag):state(candidate-incorrect) {
4165
+ --drag-background-color: var(--qti-incorrect-light);
4166
+ --drag-color: var(--qti-incorrect);
4167
+ --drag-border-color: var(--qti-incorrect);
4168
+ --drag-box-shadow: none;
4169
+ --qti-grip-color: var(--qti-incorrect);
3485
4170
  }
3486
4171
 
3487
4172
  /* The bank is hidden by the interaction itself, on :host([answer-key]) — see
@@ -3516,9 +4201,9 @@
3516
4201
  @layer qti-components.interactions.base {
3517
4202
  qti-hotspot-interaction qti-hotspot-choice {
3518
4203
  /* Resting: a faint neutral ring, so the regions are discoverable before any interaction. */
3519
- --hs-ring: color-mix(in srgb, var(--qti-hotspot-ring-color, var(--qti-border-color)) 60%, transparent);
4204
+ --hs-ring: color-mix(in oklab, var(--qti-hotspot-ring-color, var(--qti-border-color)) 60%, transparent);
3520
4205
  --hs-width: var(--qti-hotspot-ring-width, 2px);
3521
- --hs-halo: var(--qti-hotspot-halo, rgb(255 255 255 / 85%));
4206
+ --hs-halo: var(--qti-hotspot-halo);
3522
4207
 
3523
4208
  background-color: transparent;
3524
4209
  cursor: pointer;
@@ -3551,12 +4236,12 @@
3551
4236
 
3552
4237
  /* Hover strengthens the resting ring rather than filling the shape. */
3553
4238
  qti-hotspot-interaction qti-hotspot-choice:hover {
3554
- --hs-ring: color-mix(in srgb, var(--qti-hotspot-ring-color, var(--qti-border-active)) 90%, transparent);
4239
+ --hs-ring: color-mix(in oklab, var(--qti-hotspot-ring-color, var(--qti-border-active)) 90%, transparent);
3555
4240
  }
3556
4241
 
3557
- qti-hotspot-interaction qti-hotspot-choice:focus-visible {
4242
+ qti-hotspot-interaction qti-hotspot-choice:focus {
3558
4243
  outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
3559
- outline-offset: 2px;
4244
+ outline-offset: var(--qti-focus-offset);
3560
4245
  }
3561
4246
  }
3562
4247
 
@@ -3598,13 +4283,13 @@
3598
4283
  *
3599
4284
  * Blank the ring and its halo while a hotspot is neither selected nor keyboard-focused. Both
3600
4285
  * halves matter: the picture reads cleanly, and a *focused* hotspot returns, which is the only
3601
- * thing that keeps the interaction operable from a keyboard — drop `:not(:focus-visible)` and
4286
+ * thing that keeps the interaction operable from a keyboard — drop `:not(:focus)` and
3602
4287
  * tabbing through an item shows nothing.
3603
4288
  *
3604
4289
  * In `states` so it outranks the base ring and the `:hover` strengthen: hover must NOT reveal, or
3605
4290
  * sweeping the pointer hands back the answer regions one at a time.
3606
4291
  */
3607
- qti-hotspot-interaction.qti-unselected-hidden qti-hotspot-choice:not(:is(:state(checked), [data-state~='checked'])):not(:focus-visible) {
4292
+ qti-hotspot-interaction.qti-unselected-hidden qti-hotspot-choice:not(:is(:state(checked), [data-state~='checked'])):not(:focus) {
3608
4293
  --hs-ring: transparent;
3609
4294
  --hs-halo: transparent;
3610
4295
  }
@@ -3662,7 +4347,8 @@
3662
4347
 
3663
4348
  @layer qti-components.interactions.base {
3664
4349
  qti-hottext-interaction {
3665
- --qti-hottext-selected-padding: var(--qti-padding-inline);
4350
+ /* A hottext is a word in a sentence: the inline-field box, as a text entry and a gap have. */
4351
+ --qti-hottext-selected-padding: var(--qti-inline-field-padding);
3666
4352
 
3667
4353
  /* The native radio/checkbox control is never rendered for a hottext — every variant uses custom
3668
4354
  styling. That is unconditional, so it lives in qti-hottext.styles.ts, which hides [part='control']
@@ -3680,41 +4366,51 @@
3680
4366
  * target's active border: pay the space once, up front, so the state has only to repaint. Every
3681
4367
  * hottext is now the size a selected one used to be, which is also a larger target to click.
3682
4368
  */
4369
+ /* A word you pick, like a choice: a pointer cursor, and the ring on :focus so a word picked
4370
+ with the mouse shows it too. */
3683
4371
  }
3684
4372
  qti-hottext-interaction qti-hottext {
4373
+ margin-inline: var(--qti-inline-gap);
4374
+ line-height: var(--qti-field-line-height);
4375
+ --qti-padding-box: var(--qti-inline-field-padding);
4376
+ /* The correction badge sits as far in from the end as the text does from the start. */
4377
+ --qti-correction-inset: var(--qti-inline-padding-inline);
3685
4378
  padding: var(--qti-hottext-selected-padding);
4379
+ cursor: pointer;
3686
4380
  }
3687
4381
  qti-hottext-interaction.qti-input-control-hidden qti-hottext {
3688
4382
  border: var(--qti-border);
3689
- border-radius: var(--qti-border-radius);
4383
+ border-radius: var(--qti-radius-selector);
3690
4384
 
3691
4385
  background: var(--qti-bg);
3692
4386
  }
3693
4387
 
3694
-
3695
4388
  :is(qti-hottext-interaction.qti-input-control-hidden qti-hottext):focus {
3696
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
4389
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
4390
+ outline-offset: var(--qti-focus-offset);
3697
4391
  }
3698
4392
  qti-hottext-interaction.qti-unselected-hidden qti-hottext {
3699
4393
  border: 0;
3700
- border-radius: var(--qti-border-radius);
4394
+ border-radius: var(--qti-radius-selector);
3701
4395
  background-color: transparent;
3702
- outline: none;
3703
4396
  cursor: pointer;
3704
4397
  }
3705
4398
 
3706
-
3707
4399
  :is(qti-hottext-interaction.qti-unselected-hidden qti-hottext):focus {
3708
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
4400
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
4401
+ outline-offset: var(--qti-focus-offset);
3709
4402
  }
3710
4403
  qti-hottext-interaction:not(.qti-input-control-hidden,.qti-unselected-hidden) qti-hottext {
3711
4404
  border: var(--qti-border);
3712
- border-radius: var(--qti-border-radius);
4405
+ border-radius: var(--qti-radius-selector);
4406
+ /* The field surface, as a text entry has: on a tinted page, or in a theme without borders,
4407
+ the fill is what shows a word can be picked. White on white changes nothing. */
4408
+ background-color: var(--qti-bg);
3713
4409
  }
3714
4410
 
3715
-
3716
4411
  :is(qti-hottext-interaction:not(.qti-input-control-hidden,.qti-unselected-hidden) qti-hottext):focus {
3717
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
4412
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
4413
+ outline-offset: var(--qti-focus-offset);
3718
4414
  }
3719
4415
  }
3720
4416
 
@@ -3732,7 +4428,10 @@
3732
4428
  :is(qti-hottext-interaction.qti-input-control-hidden qti-hottext):is(:state(disabled), [data-state~='disabled']) {
3733
4429
  cursor: not-allowed;
3734
4430
  }
4431
+ /* The edge takes the selected colour with the fill, as a selected choice's does, so a picked
4432
+ word is one solid shape rather than a filled box inside a grey frame. */
3735
4433
  :is(qti-hottext-interaction.qti-unselected-hidden qti-hottext,qti-hottext-interaction:not(.qti-input-control-hidden,.qti-unselected-hidden) qti-hottext):is(:state(checked), [data-state~='checked']) {
4434
+ border-color: var(--qti-border-active);
3736
4435
  background-color: var(--qti-selected-bg);
3737
4436
  color: var(--qti-selected-color);
3738
4437
  }
@@ -3829,6 +4528,11 @@
3829
4528
  color: var(--field-color, var(--qti-component-color));
3830
4529
  opacity: var(--field-opacity, var(--qti-component-opacity));
3831
4530
  filter: var(--field-filter, var(--qti-component-filter));
4531
+ margin-inline: var(--qti-inline-gap);
4532
+ line-height: var(--qti-field-line-height);
4533
+ --qti-padding-box: var(--qti-inline-field-padding);
4534
+ /* The correction badge sits as far in from the end as the text does from the start. */
4535
+ --qti-correction-inset: var(--qti-inline-padding-inline);
3832
4536
  --field-color: var(--qti-fg);
3833
4537
 
3834
4538
  /* ── Trigger: transparent inside the field border ───────────────────────── */
@@ -3841,11 +4545,17 @@
3841
4545
  color: inherit;
3842
4546
  cursor: pointer;
3843
4547
  font-size: inherit;
4548
+ /* The same line as a text entry's input (@mixin field-typography), so the two fields sit in a
4549
+ sentence at the same height. `normal` made the dropdown about 6px shorter. */
4550
+ line-height: var(--qti-field-line-height);
3844
4551
  }
3845
4552
 
3846
- qti-inline-choice-interaction::part(trigger):focus-visible {
3847
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
3848
- outline: none;
4553
+ /* The trigger fills the field inside its border, so its ring is pushed out past that border:
4554
+ it then sits where a text entry's does, which rings its host. */
4555
+ qti-inline-choice-interaction::part(trigger):focus {
4556
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
4557
+ outline-offset: var(--qti-focus-offset);
4558
+ outline-offset: var(--qti-focus-offset-past-border);
3849
4559
  }
3850
4560
 
3851
4561
  qti-inline-choice-interaction:is(:state(disabled), [data-state~='disabled'])::part(trigger),qti-inline-choice-interaction[disabled]::part(trigger) {
@@ -3890,6 +4600,7 @@
3890
4600
  color: var(--menu-color, var(--qti-component-color));
3891
4601
  opacity: var(--menu-opacity, var(--qti-component-opacity));
3892
4602
  filter: var(--menu-filter, var(--qti-component-filter));
4603
+ border-radius: var(--menu-border-radius, var(--qti-radius-box));
3893
4604
  padding: 0;
3894
4605
  }
3895
4606
 
@@ -3936,8 +4647,8 @@
3936
4647
  }
3937
4648
 
3938
4649
  qti-inline-choice-interaction::part(option):focus-visible {
3939
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
3940
- outline: none;
4650
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
4651
+ outline-offset: var(--qti-focus-offset-inset);
3941
4652
  }
3942
4653
 
3943
4654
  qti-inline-choice-interaction::part(option-selected) {
@@ -3964,8 +4675,8 @@
3964
4675
  }
3965
4676
 
3966
4677
  qti-inline-choice-interaction qti-inline-choice:focus-visible {
3967
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
3968
- outline: none;
4678
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
4679
+ outline-offset: var(--qti-focus-offset-inset);
3969
4680
  }
3970
4681
 
3971
4682
  qti-inline-choice-interaction qti-inline-choice:is(:state(checked), [data-state~='checked']) {
@@ -3986,8 +4697,9 @@
3986
4697
  color: var(--message-color, var(--qti-component-color));
3987
4698
  opacity: var(--message-opacity, var(--qti-component-opacity));
3988
4699
  filter: var(--message-filter, var(--qti-component-filter));
4700
+ border-radius: var(--message-border-radius, var(--qti-radius-box));
3989
4701
  --message-color: var(--qti-fg);
3990
- --message-background-color: color-mix(in srgb, var(--qti-warning) 5%, white);
4702
+ --message-background-color: color-mix(in oklab, var(--qti-warning) 5%, var(--qti-bg));
3991
4703
  --message-border-color: var(--qti-warning);
3992
4704
  padding: var(--qti-padding-box);
3993
4705
  }
@@ -4010,6 +4722,7 @@
4010
4722
  --field-color: var(--qti-correct);
4011
4723
  --field-border-color: var(--qti-correct);
4012
4724
  --field-box-shadow: none;
4725
+ --qti-grip-color: var(--qti-correct);
4013
4726
  }
4014
4727
 
4015
4728
  qti-inline-choice-interaction:is(:state(candidate-correct), [data-state~='candidate-correct'])::part(trigger) {
@@ -4021,6 +4734,7 @@
4021
4734
  --field-color: var(--qti-incorrect);
4022
4735
  --field-border-color: var(--qti-incorrect);
4023
4736
  --field-box-shadow: none;
4737
+ --qti-grip-color: var(--qti-incorrect);
4024
4738
  }
4025
4739
 
4026
4740
  qti-inline-choice-interaction:is(:state(candidate-incorrect), [data-state~='candidate-incorrect'])::part(trigger) {
@@ -4051,6 +4765,7 @@
4051
4765
  @scope, so it inherits no border-box from anywhere else and this sets it. */
4052
4766
  box-sizing: border-box;
4053
4767
  padding: var(--qti-drag-padding);
4768
+ line-height: var(--qti-field-line-height);
4054
4769
  cursor: grab;
4055
4770
  /*
4056
4771
  * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.
@@ -4093,6 +4808,18 @@
4093
4808
  color: var(--drag-color, var(--qti-component-color));
4094
4809
  opacity: var(--drag-opacity, var(--qti-component-opacity));
4095
4810
  filter: var(--drag-filter, var(--qti-component-filter));
4811
+ /* A chip is a selector, so it takes the selector radius, and its lift follows --cito-depth. Both
4812
+ re-declared with the slot in FRONT, the drop's dashed-edge pattern: the default changes, the
4813
+ slot still wins, and nothing is set on --drag-* (see above). */
4814
+ border-radius: var(--drag-border-radius, var(--qti-radius-selector));
4815
+ box-shadow: var(--drag-box-shadow, var(--qti-drag-lift));
4816
+ /* The chip's own colours (--cito-color-chip), behind the same slots: the surface and the
4817
+ surrounding text by default, a filled chip when a brand sets the tier-1 chip colour. */
4818
+ background-color: var(--drag-background-color, var(--qti-drag-fill));
4819
+ /* A brand can give a chip its own edge (--cito-color-chip-border), transparent for a borderless
4820
+ card; the width stays, so a chip keeps its size whichever edge it shows. */
4821
+ border-color: var(--drag-border-color, var(--cito-color-chip-border, var(--qti-component-border-color)));
4822
+ color: var(--drag-color, var(--cito-color-chip-content, inherit));
4096
4823
  }
4097
4824
 
4098
4825
  qti-match-interaction :is(:state(drag), [data-state~='drag'])::part(control)::before,
@@ -4105,7 +4832,9 @@
4105
4832
  width: 0.75em;
4106
4833
  height: 1em;
4107
4834
  margin-right: var(--qti-glyph-gap);
4108
- background-color: currentColor;
4835
+ /* A verdict (`@mixin candidate`) sets --qti-grip-color, so a corrected chip's handle takes the
4836
+ verdict colour even when a brand colours its handles. */
4837
+ background-color: var(--qti-grip-color, var(--cito-color-drag-icon, currentColor));
4109
4838
  mask: var(--qti-grip-mask) no-repeat center / contain;
4110
4839
  -webkit-mask: var(--qti-grip-mask) no-repeat center / contain;
4111
4840
  }
@@ -4121,6 +4850,7 @@
4121
4850
  @scope, so it inherits no border-box from anywhere else and this sets it. */
4122
4851
  box-sizing: border-box;
4123
4852
  padding: var(--qti-drag-padding);
4853
+ line-height: var(--qti-field-line-height);
4124
4854
  cursor: grab;
4125
4855
  /*
4126
4856
  * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.
@@ -4163,19 +4893,19 @@
4163
4893
  color: var(--drag-color, var(--qti-component-color));
4164
4894
  opacity: var(--drag-opacity, var(--qti-component-opacity));
4165
4895
  filter: var(--drag-filter, var(--qti-component-filter));
4896
+ /* A chip is a selector, so it takes the selector radius, and its lift follows --cito-depth. Both
4897
+ re-declared with the slot in FRONT, the drop's dashed-edge pattern: the default changes, the
4898
+ slot still wins, and nothing is set on --drag-* (see above). */
4899
+ border-radius: var(--drag-border-radius, var(--qti-radius-selector));
4900
+ box-shadow: var(--drag-box-shadow, var(--qti-drag-lift));
4901
+ /* The chip's own colours (--cito-color-chip), behind the same slots: the surface and the
4902
+ surrounding text by default, a filled chip when a brand sets the tier-1 chip colour. */
4903
+ background-color: var(--drag-background-color, var(--qti-drag-fill));
4904
+ /* A brand can give a chip its own edge (--cito-color-chip-border), transparent for a borderless
4905
+ card; the width stays, so a chip keeps its size whichever edge it shows. */
4906
+ border-color: var(--drag-border-color, var(--cito-color-chip-border, var(--qti-component-border-color)));
4907
+ color: var(--drag-color, var(--cito-color-chip-content, inherit));
4166
4908
  }
4167
- @media (hover: hover) {
4168
- :is(qti-simple-associable-choice::part(drag)):hover {
4169
- background-color: color-mix(
4170
- in srgb,
4171
- var(--drag-background-color, var(--qti-component-background-color)) 92%,
4172
- black
4173
- );
4174
- }
4175
- }
4176
- :is(qti-simple-associable-choice::part(drag)):focus {
4177
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
4178
- }
4179
4909
 
4180
4910
  qti-match-interaction:not(.qti-match-tabular) {
4181
4911
  /*
@@ -4207,6 +4937,7 @@
4207
4937
  @scope, so it inherits no border-box from anywhere else and this sets it. */
4208
4938
  box-sizing: border-box;
4209
4939
  padding: var(--qti-drag-padding);
4940
+ line-height: var(--qti-field-line-height);
4210
4941
  cursor: grab;
4211
4942
  /*
4212
4943
  * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.
@@ -4249,23 +4980,32 @@
4249
4980
  color: var(--drag-color, var(--qti-component-color));
4250
4981
  opacity: var(--drag-opacity, var(--qti-component-opacity));
4251
4982
  filter: var(--drag-filter, var(--qti-component-filter));
4983
+ /* A chip is a selector, so it takes the selector radius, and its lift follows --cito-depth. Both
4984
+ re-declared with the slot in FRONT, the drop's dashed-edge pattern: the default changes, the
4985
+ slot still wins, and nothing is set on --drag-* (see above). */
4986
+ border-radius: var(--drag-border-radius, var(--qti-radius-selector));
4987
+ box-shadow: var(--drag-box-shadow, var(--qti-drag-lift));
4988
+ /* The chip's own colours (--cito-color-chip), behind the same slots: the surface and the
4989
+ surrounding text by default, a filled chip when a brand sets the tier-1 chip colour. */
4990
+ background-color: var(--drag-background-color, var(--qti-drag-fill));
4991
+ /* A brand can give a chip its own edge (--cito-color-chip-border), transparent for a borderless
4992
+ card; the width stays, so a chip keeps its size whichever edge it shows. */
4993
+ border-color: var(--drag-border-color, var(--cito-color-chip-border, var(--qti-component-border-color)));
4994
+ color: var(--drag-color, var(--cito-color-chip-content, inherit));
4252
4995
  }
4253
4996
  [dragging]:is(:is(qti-match-interaction:not(.qti-match-tabular) qti-simple-match-set:first-of-type) qti-simple-associable-choice) {
4254
4997
  pointer-events: none;
4255
4998
  rotate: -2deg;
4256
- --drag-box-shadow: 0 8px 12px rgb(0 0 0 / 20%), 0 4px 8px rgb(0 0 0 / 10%);
4999
+ --drag-box-shadow: var(--qti-drag-elevation);
4257
5000
  }
4258
- @media (hover: hover) {
5001
+ @media (hover: hover) and (pointer: fine) {
4259
5002
  :is(:is(qti-match-interaction:not(.qti-match-tabular) qti-simple-match-set:first-of-type) qti-simple-associable-choice):hover {
4260
- background-color: color-mix(
4261
- in srgb,
4262
- var(--drag-background-color, var(--qti-component-background-color)) 92%,
4263
- black
4264
- );
5003
+ --drag-border-color: var(--qti-border-active);
4265
5004
  }
4266
5005
  }
4267
- :is(:is(qti-match-interaction:not(.qti-match-tabular) qti-simple-match-set:first-of-type) qti-simple-associable-choice):focus {
4268
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
5006
+ :is(:is(qti-match-interaction:not(.qti-match-tabular) qti-simple-match-set:first-of-type) qti-simple-associable-choice):focus:not(:is(:state(placeholder), [data-state~='placeholder']),:active) {
5007
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
5008
+ outline-offset: var(--qti-focus-offset);
4269
5009
  }
4270
5010
  qti-match-interaction:not(.qti-match-tabular) qti-simple-match-set:last-of-type {
4271
5011
  gap: var(--qti-gap);
@@ -4301,14 +5041,15 @@
4301
5041
  used to LEAK: `dragging` sets --component-box-shadow, one shared namespace, so it
4302
5042
  inherited onto every chip nested in the drop. That half is now structural — `dragging`
4303
5043
  sets --drag-box-shadow, which a drop does not read.) */
4304
- }
4305
- :is(:is(:is(qti-match-interaction:not(.qti-match-tabular) qti-simple-match-set:last-of-type) > qti-simple-associable-choice)::part(drop)):focus {
4306
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
4307
- }
4308
- :is(:is(qti-match-interaction:not(.qti-match-tabular) qti-simple-match-set:last-of-type) > qti-simple-associable-choice)::part(drop) {
4309
5044
  margin-top: var(--qti-gap);
4310
5045
  gap: var(--qti-gap);
4311
5046
  }
5047
+ /* The ring goes on the target itself: it is what takes keyboard focus. Nothing in its shadow
5048
+ is focusable, so the `::part(drop):focus` this replaces never matched. */
5049
+ :is(:is(qti-match-interaction:not(.qti-match-tabular) qti-simple-match-set:last-of-type) > qti-simple-associable-choice):focus:not(:is(:state(placeholder), [data-state~='placeholder'])) {
5050
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
5051
+ outline-offset: var(--qti-focus-offset);
5052
+ }
4312
5053
  :is(:is(qti-match-interaction:not(.qti-match-tabular) qti-simple-match-set:last-of-type) > qti-simple-associable-choice) > *:not(qti-simple-associable-choice) {
4313
5054
  pointer-events: none;
4314
5055
  }
@@ -4322,6 +5063,7 @@
4322
5063
  @scope, so it inherits no border-box from anywhere else and this sets it. */
4323
5064
  box-sizing: border-box;
4324
5065
  padding: var(--qti-drag-padding);
5066
+ line-height: var(--qti-field-line-height);
4325
5067
  cursor: grab;
4326
5068
  /*
4327
5069
  * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.
@@ -4364,18 +5106,27 @@
4364
5106
  color: var(--drag-color, var(--qti-component-color));
4365
5107
  opacity: var(--drag-opacity, var(--qti-component-opacity));
4366
5108
  filter: var(--drag-filter, var(--qti-component-filter));
5109
+ /* A chip is a selector, so it takes the selector radius, and its lift follows --cito-depth. Both
5110
+ re-declared with the slot in FRONT, the drop's dashed-edge pattern: the default changes, the
5111
+ slot still wins, and nothing is set on --drag-* (see above). */
5112
+ border-radius: var(--drag-border-radius, var(--qti-radius-selector));
5113
+ box-shadow: var(--drag-box-shadow, var(--qti-drag-lift));
5114
+ /* The chip's own colours (--cito-color-chip), behind the same slots: the surface and the
5115
+ surrounding text by default, a filled chip when a brand sets the tier-1 chip colour. */
5116
+ background-color: var(--drag-background-color, var(--qti-drag-fill));
5117
+ /* A brand can give a chip its own edge (--cito-color-chip-border), transparent for a borderless
5118
+ card; the width stays, so a chip keeps its size whichever edge it shows. */
5119
+ border-color: var(--drag-border-color, var(--cito-color-chip-border, var(--qti-component-border-color)));
5120
+ color: var(--drag-color, var(--cito-color-chip-content, inherit));
4367
5121
  }
4368
- @media (hover: hover) {
5122
+ @media (hover: hover) and (pointer: fine) {
4369
5123
  :is(:is(:is(qti-match-interaction:not(.qti-match-tabular) qti-simple-match-set:last-of-type) > qti-simple-associable-choice) > qti-simple-associable-choice):hover {
4370
- background-color: color-mix(
4371
- in srgb,
4372
- var(--drag-background-color, var(--qti-component-background-color)) 92%,
4373
- black
4374
- );
5124
+ --drag-border-color: var(--qti-border-active);
4375
5125
  }
4376
5126
  }
4377
- :is(:is(:is(qti-match-interaction:not(.qti-match-tabular) qti-simple-match-set:last-of-type) > qti-simple-associable-choice) > qti-simple-associable-choice):focus {
4378
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
5127
+ :is(:is(:is(qti-match-interaction:not(.qti-match-tabular) qti-simple-match-set:last-of-type) > qti-simple-associable-choice) > qti-simple-associable-choice):focus:not(:is(:state(placeholder), [data-state~='placeholder']),:active) {
5128
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
5129
+ outline-offset: var(--qti-focus-offset);
4379
5130
  }
4380
5131
 
4381
5132
  qti-match-interaction:not(.qti-match-tabular)
@@ -4387,6 +5138,7 @@
4387
5138
  @scope, so it inherits no border-box from anywhere else and this sets it. */
4388
5139
  box-sizing: border-box;
4389
5140
  padding: var(--qti-drag-padding);
5141
+ line-height: var(--qti-field-line-height);
4390
5142
  cursor: grab;
4391
5143
  /*
4392
5144
  * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.
@@ -4429,14 +5181,26 @@
4429
5181
  color: var(--drag-color, var(--qti-component-color));
4430
5182
  opacity: var(--drag-opacity, var(--qti-component-opacity));
4431
5183
  filter: var(--drag-filter, var(--qti-component-filter));
5184
+ /* A chip is a selector, so it takes the selector radius, and its lift follows --cito-depth. Both
5185
+ re-declared with the slot in FRONT, the drop's dashed-edge pattern: the default changes, the
5186
+ slot still wins, and nothing is set on --drag-* (see above). */
5187
+ border-radius: var(--drag-border-radius, var(--qti-radius-selector));
5188
+ box-shadow: var(--drag-box-shadow, var(--qti-drag-lift));
5189
+ /* The chip's own colours (--cito-color-chip), behind the same slots: the surface and the
5190
+ surrounding text by default, a filled chip when a brand sets the tier-1 chip colour. */
5191
+ background-color: var(--drag-background-color, var(--qti-drag-fill));
5192
+ /* A brand can give a chip its own edge (--cito-color-chip-border), transparent for a borderless
5193
+ card; the width stays, so a chip keeps its size whichever edge it shows. */
5194
+ border-color: var(--drag-border-color, var(--cito-color-chip-border, var(--qti-component-border-color)));
5195
+ color: var(--drag-color, var(--cito-color-chip-content, inherit));
4432
5196
  }
4433
5197
  /* The label's `align-content` and the drop's `flex-grow` are the target card's own box, and live
4434
5198
  in qti-simple-associable-choice.styles.ts under :host(:state(droppable)). `box-sizing` went with
4435
5199
  them: border-box is already the reset, and content-box is what dropRegion sets. */
4436
5200
  :is(qti-match-interaction:not(.qti-match-tabular) qti-simple-match-set:last-of-type > qti-simple-associable-choice)::part(label) {
4437
5201
  border: var(--qti-border);
4438
- border-top-left-radius: var(--qti-border-radius);
4439
- border-top-right-radius: var(--qti-border-radius);
5202
+ border-top-left-radius: var(--qti-radius-box);
5203
+ border-top-right-radius: var(--qti-radius-box);
4440
5204
  padding: 0.5rem;
4441
5205
  }
4442
5206
 
@@ -4450,6 +5214,22 @@
4450
5214
  }
4451
5215
 
4452
5216
  @layer qti-components.interactions.states {
5217
+ /*
5218
+ * A placed chip's hover and focus ring. Written flat: nested under `&::part(drag)` they
5219
+ * compiled to `:is(…::part(drag)):hover`, and a pseudo-element cannot sit inside `:is()`, so none
5220
+ * of them ever matched. In this layer, after the chip rule, because `@mixin drag` sets
5221
+ * `background-color` and must not out-rank the hover.
5222
+ */
5223
+ @media (hover: hover) and (pointer: fine) {
5224
+ qti-simple-associable-choice::part(drag):hover {
5225
+ --drag-border-color: var(--qti-border-active);
5226
+ }
5227
+ }
5228
+ qti-simple-associable-choice::part(drag):focus:not(:active) {
5229
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
5230
+ outline-offset: var(--qti-focus-offset);
5231
+ }
5232
+
4453
5233
  qti-match-interaction:not(.qti-match-tabular)
4454
5234
  qti-simple-match-set:first-of-type
4455
5235
  qti-simple-associable-choice:is(:state(dragging), [data-state~='dragging']),
@@ -4457,11 +5237,13 @@
4457
5237
  qti-simple-match-set:first-of-type
4458
5238
  qti-simple-associable-choice:is(:state(placeholder), [data-state~='placeholder']) {
4459
5239
  /* The hole a spent/lifted chip leaves. Like the chip (see `drag`), it sets NO fill / border /
4460
- shadow of its own — those inherit from the resting chip (neutral by default, the brand's fill
4461
- when an overlay is on), so a brand can restyle the hole via a `:state(placeholder)` overlay
4462
- with no specificity contest. The one thing a placeholder always does, in every brand, is hide
4463
- its text; the default hole is then just the resting chip (white + border) with its text gone. */
5240
+ shadow here, on the interaction's high-specificity selector: the hole's paint is the bare
5241
+ `:state(placeholder)` rule in interactions/qti-placeholder.css (a primary tint, inset shadow),
5242
+ which a brand can restyle with the same selector and no specificity contest. The one thing this
5243
+ mixin does, in every brand, is hide what the chip shows: its text, and its handle, which a theme
5244
+ that colours its handles (--cito-color-drag-icon) would otherwise leave standing in the hole. */
4464
5245
  --drag-color: transparent;
5246
+ --qti-grip-color: transparent;
4465
5247
  --drag-opacity: 1;
4466
5248
  pointer-events: none;
4467
5249
  }
@@ -4488,17 +5270,20 @@
4488
5270
 
4489
5271
  qti-match-interaction:not(.qti-match-tabular)
4490
5272
  qti-simple-match-set:last-of-type
4491
- > qti-simple-associable-choice:is(:state(hover), [data-state~='hover'])::part(drop),
5273
+ > qti-simple-associable-choice:is(:state(active), [data-state~='active'])::part(drop),
4492
5274
  qti-match-interaction:not(.qti-match-tabular)
4493
5275
  qti-simple-match-set:last-of-type
4494
- > qti-simple-associable-choice:is(:state(active), [data-state~='active'])::part(drop) {
4495
- background-color: var(--qti-drop-highlight-bg);
5276
+ > qti-simple-associable-choice:is(:state(enabled), [data-state~='enabled'])::part(drop) {
5277
+ background-color: var(--qti-drop-highlight-enabled-bg);
4496
5278
  }
4497
5279
 
5280
+ /* After `enabled`, which every target carries during a drag: the one under the chip. */
4498
5281
  qti-match-interaction:not(.qti-match-tabular)
4499
5282
  qti-simple-match-set:last-of-type
4500
- > qti-simple-associable-choice:is(:state(enabled), [data-state~='enabled'])::part(drop) {
4501
- background-color: var(--qti-drop-highlight-enabled-bg);
5283
+ > qti-simple-associable-choice:is(:state(hover), [data-state~='hover'])::part(drop) {
5284
+ background-color: var(--qti-drop-highlight-bg);
5285
+ outline: var(--qti-drop-highlight-border-width) solid var(--qti-drop-highlight-border-color);
5286
+ outline-offset: var(--qti-focus-offset);
4502
5287
  }
4503
5288
 
4504
5289
  qti-match-interaction:not(.qti-match-tabular)
@@ -4506,7 +5291,7 @@
4506
5291
  qti-simple-associable-choice:is(:state(dragging), [data-state~='dragging']) {
4507
5292
  border-color: var(--qti-drop-highlight-border-color);
4508
5293
  box-shadow: inset 0 0 0 var(--qti-drop-highlight-border-width, 2px)
4509
- color-mix(in srgb, var(--qti-drop-highlight-border-color) 55%, transparent);
5294
+ color-mix(in oklab, var(--qti-drop-highlight-border-color) 55%, transparent);
4510
5295
  }
4511
5296
 
4512
5297
  qti-match-interaction:not(.qti-match-tabular)
@@ -4514,7 +5299,7 @@
4514
5299
  qti-simple-associable-choice:is(:state(return-anchor), [data-state~='return-anchor']) {
4515
5300
  border-color: var(--qti-drop-highlight-border-color);
4516
5301
  box-shadow: inset 0 0 0 var(--qti-drop-highlight-border-width, 2px)
4517
- color-mix(in srgb, var(--qti-drop-highlight-border-color) 55%, transparent);
5302
+ color-mix(in oklab, var(--qti-drop-highlight-border-color) 55%, transparent);
4518
5303
  }
4519
5304
  }
4520
5305
 
@@ -4529,20 +5314,35 @@
4529
5314
  same reason as gap-match's: the shared rule's DIRECT `background-color` outranked the binding
4530
5315
  that reads them, so their solid fill never rendered. They out-specify this block, so leaving them
4531
5316
  would have flipped a corrected placed chip from the pale tint to solid. */
4532
- qti-match-interaction:not(.qti-match-tabular) :is(:state(drag), [data-state~='drag']):is(:state(candidate-correct), [data-state~='candidate-correct']),
4533
- qti-match-interaction:not(.qti-match-tabular) qti-simple-associable-choice::part(drag):is(:state(candidate-correct), [data-state~='candidate-correct']) {
5317
+ qti-match-interaction:not(.qti-match-tabular) :is(:state(drag), [data-state~='drag']):is(:state(candidate-correct), [data-state~='candidate-correct']) {
5318
+ --drag-background-color: var(--qti-correct-light);
5319
+ --drag-color: var(--qti-correct);
5320
+ --drag-border-color: var(--qti-correct);
5321
+ --drag-box-shadow: none;
5322
+ --qti-grip-color: var(--qti-correct);
5323
+ }
5324
+ qti-match-interaction:not(.qti-match-tabular) qti-simple-associable-choice::part(drag):state(candidate-correct) {
4534
5325
  --drag-background-color: var(--qti-correct-light);
4535
5326
  --drag-color: var(--qti-correct);
4536
5327
  --drag-border-color: var(--qti-correct);
4537
5328
  --drag-box-shadow: none;
5329
+ --qti-grip-color: var(--qti-correct);
5330
+ }
5331
+
5332
+ qti-match-interaction:not(.qti-match-tabular) :is(:state(drag), [data-state~='drag']):is(:state(candidate-incorrect), [data-state~='candidate-incorrect']) {
5333
+ --drag-background-color: var(--qti-incorrect-light);
5334
+ --drag-color: var(--qti-incorrect);
5335
+ --drag-border-color: var(--qti-incorrect);
5336
+ --drag-box-shadow: none;
5337
+ --qti-grip-color: var(--qti-incorrect);
4538
5338
  }
4539
5339
 
4540
- qti-match-interaction:not(.qti-match-tabular) :is(:state(drag), [data-state~='drag']):is(:state(candidate-incorrect), [data-state~='candidate-incorrect']),
4541
- qti-match-interaction:not(.qti-match-tabular) qti-simple-associable-choice::part(drag):is(:state(candidate-incorrect), [data-state~='candidate-incorrect']) {
5340
+ qti-match-interaction:not(.qti-match-tabular) qti-simple-associable-choice::part(drag):state(candidate-incorrect) {
4542
5341
  --drag-background-color: var(--qti-incorrect-light);
4543
5342
  --drag-color: var(--qti-incorrect);
4544
5343
  --drag-border-color: var(--qti-incorrect);
4545
5344
  --drag-box-shadow: none;
5345
+ --qti-grip-color: var(--qti-incorrect);
4546
5346
  }
4547
5347
 
4548
5348
  /* The bank is hidden by the interaction itself, on :host([answer-key]) — see
@@ -4599,12 +5399,13 @@
4599
5399
  color: var(--checkbox-color, var(--qti-component-color));
4600
5400
  opacity: var(--checkbox-opacity, var(--qti-component-opacity));
4601
5401
  filter: var(--checkbox-filter, var(--qti-component-filter));
5402
+ border-radius: var(--checkbox-border-radius, var(--qti-radius-selector));
4602
5403
  width: var(--qti-control-size);
4603
5404
  height: var(--qti-control-size);
4604
5405
  }
4605
5406
  qti-match-interaction.qti-match-tabular::part(control-mark) {
4606
- width: calc(var(--qti-control-size) * 0.625);
4607
- height: calc(var(--qti-control-size) * 0.625);
5407
+ width: round(calc(var(--qti-control-size) * 0.625), 2px);
5408
+ height: round(calc(var(--qti-control-size) * 0.625), 2px);
4608
5409
  }
4609
5410
  /* Both `control` and `control-mark` carry the variant tokens, so themes can repaint the
4610
5411
  outer box and the inner indicator independently. Scope the base inner-fill rules to
@@ -4612,13 +5413,13 @@
4612
5413
  look (outer filled, e.g. Kennisnet) add their own `::part(control checked)` rules. */
4613
5414
  qti-match-interaction.qti-match-tabular::part(control-mark radio checked) {
4614
5415
  /* 0.5 reproduces today's 8px at the default 1rem — see mark-size for why this is a fraction. */
4615
- width: calc(var(--qti-control-size) * 0.5);
4616
- height: calc(var(--qti-control-size) * 0.5);
4617
- background-color: var(--radio-mark-color, white);
5416
+ width: round(calc(var(--qti-control-size) * 0.5), 2px);
5417
+ height: round(calc(var(--qti-control-size) * 0.5), 2px);
5418
+ background-color: var(--radio-mark-color, var(--qti-primary-fg));
4618
5419
  border-radius: 100%;
4619
5420
  }
4620
5421
  qti-match-interaction.qti-match-tabular::part(control-mark checkbox checked) {
4621
- background-color: var(--checkbox-mark-color, white);
5422
+ background-color: var(--checkbox-mark-color, var(--qti-primary-fg));
4622
5423
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
4623
5424
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
4624
5425
  }
@@ -4657,12 +5458,19 @@
4657
5458
  gap: 1px;
4658
5459
  background-color: var(--qti-border-color);
4659
5460
  border: var(--qti-border-thickness) solid var(--qti-border-color);
4660
- border-radius: var(--qti-border-radius);
5461
+ border-radius: var(--qti-radius-box);
4661
5462
  }
4662
5463
 
4663
5464
  qti-match-interaction.qti-match-tabular::part(corner),qti-match-interaction.qti-match-tabular::part(input-cell) {
4664
5465
  border: none;
4665
- background-color: white;
5466
+ background-color: var(--qti-bg);
5467
+ }
5468
+
5469
+ /* A cell's radio or checkbox is a real input, visually hidden: the cell rings while it has
5470
+ focus, inside its own edge, because the grid clips. */
5471
+ qti-match-interaction.qti-match-tabular::part(input-cell):focus-within {
5472
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
5473
+ outline-offset: var(--qti-focus-offset-inset);
4666
5474
  }
4667
5475
 
4668
5476
  qti-match-interaction.qti-match-tabular::part(control checked) {
@@ -4671,18 +5479,18 @@
4671
5479
  }
4672
5480
 
4673
5481
  qti-match-interaction.qti-match-tabular::part(control-mark radio checked) {
4674
- background-color: white;
5482
+ background-color: var(--qti-bg);
4675
5483
  width: calc(var(--qti-control-size) * 0.5);
4676
5484
  height: calc(var(--qti-control-size) * 0.5);
4677
5485
  }
4678
5486
 
4679
5487
  qti-match-interaction.qti-match-tabular::part(control-mark checkbox checked) {
4680
- background-color: white;
5488
+ background-color: var(--qti-bg);
4681
5489
  }
4682
5490
 
4683
5491
  qti-match-interaction.qti-match-tabular qti-simple-match-set qti-simple-associable-choice {
4684
5492
  border: none;
4685
- background-color: white;
5493
+ background-color: var(--qti-bg);
4686
5494
  }
4687
5495
  }
4688
5496
 
@@ -4739,6 +5547,7 @@
4739
5547
  @scope, so it inherits no border-box from anywhere else and this sets it. */
4740
5548
  box-sizing: border-box;
4741
5549
  padding: var(--qti-drag-padding);
5550
+ line-height: var(--qti-field-line-height);
4742
5551
  cursor: grab;
4743
5552
  /*
4744
5553
  * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.
@@ -4781,6 +5590,18 @@
4781
5590
  color: var(--drag-color, var(--qti-component-color));
4782
5591
  opacity: var(--drag-opacity, var(--qti-component-opacity));
4783
5592
  filter: var(--drag-filter, var(--qti-component-filter));
5593
+ /* A chip is a selector, so it takes the selector radius, and its lift follows --cito-depth. Both
5594
+ re-declared with the slot in FRONT, the drop's dashed-edge pattern: the default changes, the
5595
+ slot still wins, and nothing is set on --drag-* (see above). */
5596
+ border-radius: var(--drag-border-radius, var(--qti-radius-selector));
5597
+ box-shadow: var(--drag-box-shadow, var(--qti-drag-lift));
5598
+ /* The chip's own colours (--cito-color-chip), behind the same slots: the surface and the
5599
+ surrounding text by default, a filled chip when a brand sets the tier-1 chip colour. */
5600
+ background-color: var(--drag-background-color, var(--qti-drag-fill));
5601
+ /* A brand can give a chip its own edge (--cito-color-chip-border), transparent for a borderless
5602
+ card; the width stays, so a chip keeps its size whichever edge it shows. */
5603
+ border-color: var(--drag-border-color, var(--cito-color-chip-border, var(--qti-component-border-color)));
5604
+ color: var(--drag-color, var(--cito-color-chip-content, inherit));
4784
5605
  }
4785
5606
 
4786
5607
  qti-order-interaction :is(:state(drag), [data-state~='drag'])::part(control)::before,
@@ -4793,7 +5614,9 @@
4793
5614
  width: 0.75em;
4794
5615
  height: 1em;
4795
5616
  margin-right: var(--qti-glyph-gap);
4796
- background-color: currentColor;
5617
+ /* A verdict (`@mixin candidate`) sets --qti-grip-color, so a corrected chip's handle takes the
5618
+ verdict colour even when a brand colours its handles. */
5619
+ background-color: var(--qti-grip-color, var(--cito-color-drag-icon, currentColor));
4797
5620
  mask: var(--qti-grip-mask) no-repeat center / contain;
4798
5621
  -webkit-mask: var(--qti-grip-mask) no-repeat center / contain;
4799
5622
  }
@@ -4806,12 +5629,13 @@
4806
5629
  qti-order-interaction:is(:state(dragzone-enabled), [data-state~='dragzone-enabled'])::part(drags) {
4807
5630
  background-color: var(--qti-bg-active);
4808
5631
  }
4809
- qti-order-interaction::part(drag),qti-order-interaction qti-simple-choice,qti-order-interaction::part(drag) {
5632
+ qti-order-interaction qti-simple-choice {
4810
5633
  /* Structural — the load-bearing box, never state-switched (layout-invariance contract).
4811
5634
  box-sizing is deliberate: the clone is appended to document.body outside reset.css's
4812
5635
  @scope, so it inherits no border-box from anywhere else and this sets it. */
4813
5636
  box-sizing: border-box;
4814
5637
  padding: var(--qti-drag-padding);
5638
+ line-height: var(--qti-field-line-height);
4815
5639
  cursor: grab;
4816
5640
  /*
4817
5641
  * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.
@@ -4854,35 +5678,42 @@
4854
5678
  color: var(--drag-color, var(--qti-component-color));
4855
5679
  opacity: var(--drag-opacity, var(--qti-component-opacity));
4856
5680
  filter: var(--drag-filter, var(--qti-component-filter));
5681
+ /* A chip is a selector, so it takes the selector radius, and its lift follows --cito-depth. Both
5682
+ re-declared with the slot in FRONT, the drop's dashed-edge pattern: the default changes, the
5683
+ slot still wins, and nothing is set on --drag-* (see above). */
5684
+ border-radius: var(--drag-border-radius, var(--qti-radius-selector));
5685
+ box-shadow: var(--drag-box-shadow, var(--qti-drag-lift));
5686
+ /* The chip's own colours (--cito-color-chip), behind the same slots: the surface and the
5687
+ surrounding text by default, a filled chip when a brand sets the tier-1 chip colour. */
5688
+ background-color: var(--drag-background-color, var(--qti-drag-fill));
5689
+ /* A brand can give a chip its own edge (--cito-color-chip-border), transparent for a borderless
5690
+ card; the width stays, so a chip keeps its size whichever edge it shows. */
5691
+ border-color: var(--drag-border-color, var(--cito-color-chip-border, var(--qti-component-border-color)));
5692
+ color: var(--drag-color, var(--cito-color-chip-content, inherit));
4857
5693
  }
4858
- [dragging]:is(qti-order-interaction::part(drag),qti-order-interaction qti-simple-choice,qti-order-interaction::part(drag)) {
5694
+ [dragging]:is(qti-order-interaction qti-simple-choice) {
4859
5695
  pointer-events: none;
4860
5696
  rotate: -2deg;
4861
- --drag-box-shadow: 0 8px 12px rgb(0 0 0 / 20%), 0 4px 8px rgb(0 0 0 / 10%);
5697
+ --drag-box-shadow: var(--qti-drag-elevation);
4862
5698
  }
4863
- @media (hover: hover) {
4864
- :is(qti-order-interaction::part(drag),qti-order-interaction qti-simple-choice,qti-order-interaction::part(drag)):hover {
4865
- background-color: color-mix(
4866
- in srgb,
4867
- var(--drag-background-color, var(--qti-component-background-color)) 92%,
4868
- black
4869
- );
5699
+ @media (hover: hover) and (pointer: fine) {
5700
+ :is(qti-order-interaction qti-simple-choice):hover {
5701
+ --drag-border-color: var(--qti-border-active);
4870
5702
  }
4871
5703
  }
4872
- :is(qti-order-interaction::part(drag),qti-order-interaction qti-simple-choice,qti-order-interaction::part(drag)):focus {
4873
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
5704
+ :is(qti-order-interaction qti-simple-choice):focus:not(:is(:state(placeholder), [data-state~='placeholder']),:active) {
5705
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
5706
+ outline-offset: var(--qti-focus-offset);
4874
5707
  }
4875
- /* Editor fake-drag projected into the interaction's drop-target shadow.
4876
- Same `drag` styling so editor previews match runtime visuals.
4877
- Kept as its own block (separate from the runtime-drag selector list
4878
- above) because a CSS comment between commas inside a nested selector
4879
- list is silently dropped by Chrome's nesting parser. */
5708
+ /* A placed chip, and the editor's fake-drag projected into the drop-target shadow. Its hover,
5709
+ and ring are in the states layer below. */
4880
5710
  qti-order-interaction::part(drag) {
4881
5711
  /* Structural — the load-bearing box, never state-switched (layout-invariance contract).
4882
5712
  box-sizing is deliberate: the clone is appended to document.body outside reset.css's
4883
5713
  @scope, so it inherits no border-box from anywhere else and this sets it. */
4884
5714
  box-sizing: border-box;
4885
5715
  padding: var(--qti-drag-padding);
5716
+ line-height: var(--qti-field-line-height);
4886
5717
  cursor: grab;
4887
5718
  /*
4888
5719
  * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.
@@ -4925,19 +5756,19 @@
4925
5756
  color: var(--drag-color, var(--qti-component-color));
4926
5757
  opacity: var(--drag-opacity, var(--qti-component-opacity));
4927
5758
  filter: var(--drag-filter, var(--qti-component-filter));
5759
+ /* A chip is a selector, so it takes the selector radius, and its lift follows --cito-depth. Both
5760
+ re-declared with the slot in FRONT, the drop's dashed-edge pattern: the default changes, the
5761
+ slot still wins, and nothing is set on --drag-* (see above). */
5762
+ border-radius: var(--drag-border-radius, var(--qti-radius-selector));
5763
+ box-shadow: var(--drag-box-shadow, var(--qti-drag-lift));
5764
+ /* The chip's own colours (--cito-color-chip), behind the same slots: the surface and the
5765
+ surrounding text by default, a filled chip when a brand sets the tier-1 chip colour. */
5766
+ background-color: var(--drag-background-color, var(--qti-drag-fill));
5767
+ /* A brand can give a chip its own edge (--cito-color-chip-border), transparent for a borderless
5768
+ card; the width stays, so a chip keeps its size whichever edge it shows. */
5769
+ border-color: var(--drag-border-color, var(--cito-color-chip-border, var(--qti-component-border-color)));
5770
+ color: var(--drag-color, var(--cito-color-chip-content, inherit));
4928
5771
  }
4929
- @media (hover: hover) {
4930
- :is(qti-order-interaction::part(drag)):hover {
4931
- background-color: color-mix(
4932
- in srgb,
4933
- var(--drag-background-color, var(--qti-component-background-color)) 92%,
4934
- black
4935
- );
4936
- }
4937
- }
4938
- :is(qti-order-interaction::part(drag)):focus {
4939
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
4940
- }
4941
5772
  /* The drag's box — flex, centred, clipped — is in qti-order-interaction.styles.ts. */
4942
5773
  qti-order-interaction::part(drag) {
4943
5774
  /*
@@ -4979,6 +5810,9 @@
4979
5810
  qti-order-interaction::part(drags) {
4980
5811
  gap: var(--qti-gap);
4981
5812
  }
5813
+ /* Flat, not nested under `&::part(drop)`: that compiled to `:is(…::part(drop)):focus-visible`,
5814
+ which never matched. Deleted: a nested `&[enabled] { @mixin dropping }`. An attribute
5815
+ selector after ::part() never matches; `::part(enabled)` is the hook. */
4982
5816
  qti-order-interaction::part(drop) {
4983
5817
  background-color: var(--drop-background-color, var(--qti-component-background-color));
4984
5818
  background-image: var(--drop-background-image, var(--qti-component-background-image));
@@ -4992,12 +5826,10 @@
4992
5826
  filter: var(--drop-filter, var(--qti-component-filter));
4993
5827
  border-style: var(--drop-border-style, dashed);
4994
5828
  }
4995
- [enabled]:is(qti-order-interaction::part(drop)) {
4996
- background-color: var(--qti-bg-active);
4997
- }
4998
- :is(qti-order-interaction::part(drop)):focus {
4999
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
5000
- }
5829
+ qti-order-interaction::part(drop):focus {
5830
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
5831
+ outline-offset: var(--qti-focus-offset);
5832
+ }
5001
5833
  qti-order-interaction::part(active) {
5002
5834
  background-color: var(--qti-bg-active);
5003
5835
  }
@@ -5039,6 +5871,7 @@
5039
5871
  @scope, so it inherits no border-box from anywhere else and this sets it. */
5040
5872
  box-sizing: border-box;
5041
5873
  padding: var(--qti-drag-padding);
5874
+ line-height: var(--qti-field-line-height);
5042
5875
  cursor: grab;
5043
5876
  /*
5044
5877
  * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.
@@ -5081,6 +5914,18 @@
5081
5914
  color: var(--drag-color, var(--qti-component-color));
5082
5915
  opacity: var(--drag-opacity, var(--qti-component-opacity));
5083
5916
  filter: var(--drag-filter, var(--qti-component-filter));
5917
+ /* A chip is a selector, so it takes the selector radius, and its lift follows --cito-depth. Both
5918
+ re-declared with the slot in FRONT, the drop's dashed-edge pattern: the default changes, the
5919
+ slot still wins, and nothing is set on --drag-* (see above). */
5920
+ border-radius: var(--drag-border-radius, var(--qti-radius-selector));
5921
+ box-shadow: var(--drag-box-shadow, var(--qti-drag-lift));
5922
+ /* The chip's own colours (--cito-color-chip), behind the same slots: the surface and the
5923
+ surrounding text by default, a filled chip when a brand sets the tier-1 chip colour. */
5924
+ background-color: var(--drag-background-color, var(--qti-drag-fill));
5925
+ /* A brand can give a chip its own edge (--cito-color-chip-border), transparent for a borderless
5926
+ card; the width stays, so a chip keeps its size whichever edge it shows. */
5927
+ border-color: var(--drag-border-color, var(--cito-color-chip-border, var(--qti-component-border-color)));
5928
+ color: var(--drag-color, var(--cito-color-chip-content, inherit));
5084
5929
  }
5085
5930
 
5086
5931
  qti-order-interaction::part(container) {
@@ -5106,45 +5951,68 @@
5106
5951
  }
5107
5952
 
5108
5953
  @layer qti-components.interactions.states {
5954
+ /*
5955
+ * A placed chip's hover and focus ring. Written flat: nested under `&::part(drag)` they
5956
+ * compiled to `:is(…::part(drag)):hover`, and a pseudo-element cannot sit inside `:is()`, so none
5957
+ * of them ever matched. In this layer, after the chip rule, because `@mixin drag` sets
5958
+ * `background-color` and must not out-rank the hover.
5959
+ */
5960
+ @media (hover: hover) and (pointer: fine) {
5961
+ qti-order-interaction::part(drag):hover {
5962
+ --drag-border-color: var(--qti-border-active);
5963
+ }
5964
+ }
5965
+ qti-order-interaction::part(drag):focus:not(:active) {
5966
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
5967
+ outline-offset: var(--qti-focus-offset);
5968
+ }
5969
+
5109
5970
  qti-order-interaction qti-simple-choice:is(:state(placeholder), [data-state~='placeholder']) {
5110
5971
  /* The hole a spent/lifted chip leaves. Like the chip (see `drag`), it sets NO fill / border /
5111
- shadow of its own — those inherit from the resting chip (neutral by default, the brand's fill
5112
- when an overlay is on), so a brand can restyle the hole via a `:state(placeholder)` overlay
5113
- with no specificity contest. The one thing a placeholder always does, in every brand, is hide
5114
- its text; the default hole is then just the resting chip (white + border) with its text gone. */
5972
+ shadow here, on the interaction's high-specificity selector: the hole's paint is the bare
5973
+ `:state(placeholder)` rule in interactions/qti-placeholder.css (a primary tint, inset shadow),
5974
+ which a brand can restyle with the same selector and no specificity contest. The one thing this
5975
+ mixin does, in every brand, is hide what the chip shows: its text, and its handle, which a theme
5976
+ that colours its handles (--cito-color-drag-icon) would otherwise leave standing in the hole. */
5115
5977
  --drag-color: transparent;
5978
+ --qti-grip-color: transparent;
5116
5979
  --drag-opacity: 1;
5117
5980
  pointer-events: none;
5118
5981
  }
5119
5982
 
5120
5983
  qti-order-interaction qti-simple-choice:is(:state(dragging), [data-state~='dragging']) {
5121
5984
  /* The hole a spent/lifted chip leaves. Like the chip (see `drag`), it sets NO fill / border /
5122
- shadow of its own — those inherit from the resting chip (neutral by default, the brand's fill
5123
- when an overlay is on), so a brand can restyle the hole via a `:state(placeholder)` overlay
5124
- with no specificity contest. The one thing a placeholder always does, in every brand, is hide
5125
- its text; the default hole is then just the resting chip (white + border) with its text gone. */
5985
+ shadow here, on the interaction's high-specificity selector: the hole's paint is the bare
5986
+ `:state(placeholder)` rule in interactions/qti-placeholder.css (a primary tint, inset shadow),
5987
+ which a brand can restyle with the same selector and no specificity contest. The one thing this
5988
+ mixin does, in every brand, is hide what the chip shows: its text, and its handle, which a theme
5989
+ that colours its handles (--cito-color-drag-icon) would otherwise leave standing in the hole. */
5126
5990
  --drag-color: transparent;
5991
+ --qti-grip-color: transparent;
5127
5992
  --drag-opacity: 1;
5128
5993
  border-color: var(--qti-drop-highlight-border-color);
5129
5994
  box-shadow: inset 0 0 0 var(--qti-drop-highlight-border-width, 2px)
5130
- color-mix(in srgb, var(--qti-drop-highlight-border-color) 55%, transparent);
5995
+ color-mix(in oklab, var(--qti-drop-highlight-border-color) 55%, transparent);
5131
5996
  pointer-events: none;
5132
5997
  }
5133
5998
 
5134
5999
  qti-order-interaction qti-simple-choice:is(:state(return-anchor), [data-state~='return-anchor']) {
5135
6000
  border-color: var(--qti-drop-highlight-border-color);
5136
6001
  box-shadow: inset 0 0 0 var(--qti-drop-highlight-border-width, 2px)
5137
- color-mix(in srgb, var(--qti-drop-highlight-border-color) 55%, transparent);
5138
- }
5139
-
5140
- qti-order-interaction::part(hover),
5141
- qti-order-interaction::part(active) {
5142
- background-color: var(--qti-drop-highlight-bg);
6002
+ color-mix(in oklab, var(--qti-drop-highlight-border-color) 55%, transparent);
5143
6003
  }
5144
6004
 
6005
+ qti-order-interaction::part(active),
5145
6006
  qti-order-interaction::part(enabled) {
5146
6007
  background-color: var(--qti-drop-highlight-enabled-bg);
5147
6008
  }
6009
+
6010
+ /* After `enabled`, which every target carries during a drag: the one under the chip. */
6011
+ qti-order-interaction::part(hover) {
6012
+ background-color: var(--qti-drop-highlight-bg);
6013
+ outline: var(--qti-drop-highlight-border-width) solid var(--qti-drop-highlight-border-color);
6014
+ outline-offset: var(--qti-focus-offset);
6015
+ }
5148
6016
  }
5149
6017
 
5150
6018
  @layer qti-components.interactions.corrections {
@@ -5170,20 +6038,35 @@
5170
6038
  `[data-drag-clone]:state(candidate-*)` went with it and is deliberately NOT reproduced — a clone
5171
6039
  carries no custom states at all, because cloneNode does not copy ElementInternals (measured), so
5172
6040
  that selector never matched anything. */
5173
- qti-order-interaction :is(:state(drag), [data-state~='drag']):is(:state(candidate-correct), [data-state~='candidate-correct']),
5174
- qti-order-interaction::part(drag):is(:state(candidate-correct), [data-state~='candidate-correct']) {
6041
+ qti-order-interaction :is(:state(drag), [data-state~='drag']):is(:state(candidate-correct), [data-state~='candidate-correct']) {
6042
+ --drag-background-color: var(--qti-correct-light);
6043
+ --drag-color: var(--qti-correct);
6044
+ --drag-border-color: var(--qti-correct);
6045
+ --drag-box-shadow: none;
6046
+ --qti-grip-color: var(--qti-correct);
6047
+ }
6048
+ qti-order-interaction::part(drag):state(candidate-correct) {
5175
6049
  --drag-background-color: var(--qti-correct-light);
5176
6050
  --drag-color: var(--qti-correct);
5177
6051
  --drag-border-color: var(--qti-correct);
5178
6052
  --drag-box-shadow: none;
6053
+ --qti-grip-color: var(--qti-correct);
6054
+ }
6055
+
6056
+ qti-order-interaction :is(:state(drag), [data-state~='drag']):is(:state(candidate-incorrect), [data-state~='candidate-incorrect']) {
6057
+ --drag-background-color: var(--qti-incorrect-light);
6058
+ --drag-color: var(--qti-incorrect);
6059
+ --drag-border-color: var(--qti-incorrect);
6060
+ --drag-box-shadow: none;
6061
+ --qti-grip-color: var(--qti-incorrect);
5179
6062
  }
5180
6063
 
5181
- qti-order-interaction :is(:state(drag), [data-state~='drag']):is(:state(candidate-incorrect), [data-state~='candidate-incorrect']),
5182
- qti-order-interaction::part(drag):is(:state(candidate-incorrect), [data-state~='candidate-incorrect']) {
6064
+ qti-order-interaction::part(drag):state(candidate-incorrect) {
5183
6065
  --drag-background-color: var(--qti-incorrect-light);
5184
6066
  --drag-color: var(--qti-incorrect);
5185
6067
  --drag-border-color: var(--qti-incorrect);
5186
6068
  --drag-box-shadow: none;
6069
+ --qti-grip-color: var(--qti-incorrect);
5187
6070
  }
5188
6071
 
5189
6072
  /* The bank is hidden by the interaction itself, on :host([answer-key]) — see
@@ -5218,6 +6101,7 @@
5218
6101
  @scope, so it inherits no border-box from anywhere else and this sets it. */
5219
6102
  box-sizing: border-box;
5220
6103
  padding: var(--qti-drag-padding);
6104
+ line-height: var(--qti-field-line-height);
5221
6105
  cursor: grab;
5222
6106
  /*
5223
6107
  * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.
@@ -5260,6 +6144,25 @@
5260
6144
  color: var(--drag-color, var(--qti-component-color));
5261
6145
  opacity: var(--drag-opacity, var(--qti-component-opacity));
5262
6146
  filter: var(--drag-filter, var(--qti-component-filter));
6147
+ /* A chip is a selector, so it takes the selector radius, and its lift follows --cito-depth. Both
6148
+ re-declared with the slot in FRONT, the drop's dashed-edge pattern: the default changes, the
6149
+ slot still wins, and nothing is set on --drag-* (see above). */
6150
+ border-radius: var(--drag-border-radius, var(--qti-radius-selector));
6151
+ box-shadow: var(--drag-box-shadow, var(--qti-drag-lift));
6152
+ /* The chip's own colours (--cito-color-chip), behind the same slots: the surface and the
6153
+ surrounding text by default, a filled chip when a brand sets the tier-1 chip colour. */
6154
+ background-color: var(--drag-background-color, var(--qti-drag-fill));
6155
+ /* A brand can give a chip its own edge (--cito-color-chip-border), transparent for a borderless
6156
+ card; the width stays, so a chip keeps its size whichever edge it shows. */
6157
+ border-color: var(--drag-border-color, var(--cito-color-chip-border, var(--qti-component-border-color)));
6158
+ color: var(--drag-color, var(--cito-color-chip-content, inherit));
6159
+ }
6160
+
6161
+ /* The bank chip's own ring. The rules below ring only the PLACED chip (::part(drag)), so a bank
6162
+ chip reached with Tab showed the browser's ring instead of the theme's. */
6163
+ qti-associate-interaction :is(:state(drag), [data-state~='drag']):focus:not(:is(:state(placeholder), [data-state~='placeholder']), :active) {
6164
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
6165
+ outline-offset: var(--qti-focus-offset);
5263
6166
  }
5264
6167
 
5265
6168
  qti-associate-interaction :is(:state(drag), [data-state~='drag'])::part(control)::before,
@@ -5272,7 +6175,9 @@
5272
6175
  width: 0.75em;
5273
6176
  height: 1em;
5274
6177
  margin-right: var(--qti-glyph-gap);
5275
- background-color: currentColor;
6178
+ /* A verdict (`@mixin candidate`) sets --qti-grip-color, so a corrected chip's handle takes the
6179
+ verdict colour even when a brand colours its handles. */
6180
+ background-color: var(--qti-grip-color, var(--cito-color-drag-icon, currentColor));
5276
6181
  mask: var(--qti-grip-mask) no-repeat center / contain;
5277
6182
  -webkit-mask: var(--qti-grip-mask) no-repeat center / contain;
5278
6183
  }
@@ -5304,12 +6209,17 @@
5304
6209
  qti-associate-interaction:is(:state(dragzone-enabled), [data-state~='dragzone-enabled']) slot[name='qti-simple-associable-choice'] {
5305
6210
  background-color: var(--qti-bg-active);
5306
6211
  }
5307
- qti-associate-interaction qti-simple-associable-choice::part(drag),qti-associate-interaction::part(drag) {
6212
+ /* A placed chip lives in a shadow root; `::part(drag)` is the only way in. This used to be
6213
+ `::part(qti-simple-associable-choice)`, a part named after the tag. Its hover and ring
6214
+ are in the states layer below. Deleted here: `&[dragging] { @mixin dragging }`. An attribute
6215
+ selector after ::part() never matches. */
6216
+ qti-associate-interaction qti-simple-associable-choice::part(drag) {
5308
6217
  /* Structural — the load-bearing box, never state-switched (layout-invariance contract).
5309
6218
  box-sizing is deliberate: the clone is appended to document.body outside reset.css's
5310
6219
  @scope, so it inherits no border-box from anywhere else and this sets it. */
5311
6220
  box-sizing: border-box;
5312
6221
  padding: var(--qti-drag-padding);
6222
+ line-height: var(--qti-field-line-height);
5313
6223
  cursor: grab;
5314
6224
  /*
5315
6225
  * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.
@@ -5352,34 +6262,27 @@
5352
6262
  color: var(--drag-color, var(--qti-component-color));
5353
6263
  opacity: var(--drag-opacity, var(--qti-component-opacity));
5354
6264
  filter: var(--drag-filter, var(--qti-component-filter));
6265
+ /* A chip is a selector, so it takes the selector radius, and its lift follows --cito-depth. Both
6266
+ re-declared with the slot in FRONT, the drop's dashed-edge pattern: the default changes, the
6267
+ slot still wins, and nothing is set on --drag-* (see above). */
6268
+ border-radius: var(--drag-border-radius, var(--qti-radius-selector));
6269
+ box-shadow: var(--drag-box-shadow, var(--qti-drag-lift));
6270
+ /* The chip's own colours (--cito-color-chip), behind the same slots: the surface and the
6271
+ surrounding text by default, a filled chip when a brand sets the tier-1 chip colour. */
6272
+ background-color: var(--drag-background-color, var(--qti-drag-fill));
6273
+ /* A brand can give a chip its own edge (--cito-color-chip-border), transparent for a borderless
6274
+ card; the width stays, so a chip keeps its size whichever edge it shows. */
6275
+ border-color: var(--drag-border-color, var(--cito-color-chip-border, var(--qti-component-border-color)));
6276
+ color: var(--drag-color, var(--cito-color-chip-content, inherit));
5355
6277
  }
5356
- @media (hover: hover) {
5357
- :is(qti-associate-interaction qti-simple-associable-choice::part(drag),qti-associate-interaction::part(drag)):hover {
5358
- background-color: color-mix(
5359
- in srgb,
5360
- var(--drag-background-color, var(--qti-component-background-color)) 92%,
5361
- black
5362
- );
5363
- }
5364
- }
5365
- :is(qti-associate-interaction qti-simple-associable-choice::part(drag),qti-associate-interaction::part(drag)):focus {
5366
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
5367
- }
5368
- [dragging]:is(qti-associate-interaction qti-simple-associable-choice::part(drag),qti-associate-interaction::part(drag)) {
5369
- pointer-events: none;
5370
- rotate: -2deg;
5371
- --drag-box-shadow: 0 8px 12px rgb(0 0 0 / 20%), 0 4px 8px rgb(0 0 0 / 10%);
5372
- }
5373
- /* Editor fake-drag projected into the interaction's drop-target shadow.
5374
- Kept as a separate block (not merged into the comma list above)
5375
- because a CSS comment between commas in a nested selector list is
5376
- silently dropped by Chrome's nesting parser. */
6278
+ /* Editor fake-drag projected into the interaction's drop-target shadow. */
5377
6279
  qti-associate-interaction::part(drag) {
5378
6280
  /* Structural — the load-bearing box, never state-switched (layout-invariance contract).
5379
6281
  box-sizing is deliberate: the clone is appended to document.body outside reset.css's
5380
6282
  @scope, so it inherits no border-box from anywhere else and this sets it. */
5381
6283
  box-sizing: border-box;
5382
6284
  padding: var(--qti-drag-padding);
6285
+ line-height: var(--qti-field-line-height);
5383
6286
  cursor: grab;
5384
6287
  /*
5385
6288
  * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.
@@ -5422,19 +6325,19 @@
5422
6325
  color: var(--drag-color, var(--qti-component-color));
5423
6326
  opacity: var(--drag-opacity, var(--qti-component-opacity));
5424
6327
  filter: var(--drag-filter, var(--qti-component-filter));
6328
+ /* A chip is a selector, so it takes the selector radius, and its lift follows --cito-depth. Both
6329
+ re-declared with the slot in FRONT, the drop's dashed-edge pattern: the default changes, the
6330
+ slot still wins, and nothing is set on --drag-* (see above). */
6331
+ border-radius: var(--drag-border-radius, var(--qti-radius-selector));
6332
+ box-shadow: var(--drag-box-shadow, var(--qti-drag-lift));
6333
+ /* The chip's own colours (--cito-color-chip), behind the same slots: the surface and the
6334
+ surrounding text by default, a filled chip when a brand sets the tier-1 chip colour. */
6335
+ background-color: var(--drag-background-color, var(--qti-drag-fill));
6336
+ /* A brand can give a chip its own edge (--cito-color-chip-border), transparent for a borderless
6337
+ card; the width stays, so a chip keeps its size whichever edge it shows. */
6338
+ border-color: var(--drag-border-color, var(--cito-color-chip-border, var(--qti-component-border-color)));
6339
+ color: var(--drag-color, var(--cito-color-chip-content, inherit));
5425
6340
  }
5426
- @media (hover: hover) {
5427
- :is(qti-associate-interaction::part(drag)):hover {
5428
- background-color: color-mix(
5429
- in srgb,
5430
- var(--drag-background-color, var(--qti-component-background-color)) 92%,
5431
- black
5432
- );
5433
- }
5434
- }
5435
- :is(qti-associate-interaction::part(drag)):focus {
5436
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
5437
- }
5438
6341
  /* `display: grid` lives in qti-associate-interaction.styles.ts, which already declares it on
5439
6342
  [part~='drop'] alongside the drop's min-height/min-width. */
5440
6343
  /* A filled drop hides its dashed edge — see the note in qti-gap-match-interaction.css. Every
@@ -5458,7 +6361,8 @@
5458
6361
  border-style: var(--drop-border-style, dashed);
5459
6362
  }
5460
6363
  qti-associate-interaction::part(drop):focus {
5461
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
6364
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
6365
+ outline-offset: var(--qti-focus-offset);
5462
6366
  }
5463
6367
 
5464
6368
  /*
@@ -5489,6 +6393,7 @@
5489
6393
  @scope, so it inherits no border-box from anywhere else and this sets it. */
5490
6394
  box-sizing: border-box;
5491
6395
  padding: var(--qti-drag-padding);
6396
+ line-height: var(--qti-field-line-height);
5492
6397
  cursor: grab;
5493
6398
  /*
5494
6399
  * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.
@@ -5531,24 +6436,59 @@
5531
6436
  color: var(--drag-color, var(--qti-component-color));
5532
6437
  opacity: var(--drag-opacity, var(--qti-component-opacity));
5533
6438
  filter: var(--drag-filter, var(--qti-component-filter));
6439
+ /* A chip is a selector, so it takes the selector radius, and its lift follows --cito-depth. Both
6440
+ re-declared with the slot in FRONT, the drop's dashed-edge pattern: the default changes, the
6441
+ slot still wins, and nothing is set on --drag-* (see above). */
6442
+ border-radius: var(--drag-border-radius, var(--qti-radius-selector));
6443
+ box-shadow: var(--drag-box-shadow, var(--qti-drag-lift));
6444
+ /* The chip's own colours (--cito-color-chip), behind the same slots: the surface and the
6445
+ surrounding text by default, a filled chip when a brand sets the tier-1 chip colour. */
6446
+ background-color: var(--drag-background-color, var(--qti-drag-fill));
6447
+ /* A brand can give a chip its own edge (--cito-color-chip-border), transparent for a borderless
6448
+ card; the width stays, so a chip keeps its size whichever edge it shows. */
6449
+ border-color: var(--drag-border-color, var(--cito-color-chip-border, var(--qti-component-border-color)));
6450
+ color: var(--drag-color, var(--cito-color-chip-content, inherit));
5534
6451
  }
5535
6452
 
5536
- qti-associate-interaction::part(hover),
5537
- qti-associate-interaction::part(active) {
5538
- background-color: var(--qti-drop-highlight-bg);
6453
+ /*
6454
+ * A placed chip's hover and focus ring. Written flat: nested under `&::part(drag)` they
6455
+ * compiled to `:is(…::part(drag)):hover`, and a pseudo-element cannot sit inside `:is()`, so none
6456
+ * of them ever matched. In this layer, after the chip rule, because `@mixin drag` sets
6457
+ * `background-color` and must not out-rank the hover.
6458
+ */
6459
+ @media (hover: hover) and (pointer: fine) {
6460
+ qti-associate-interaction qti-simple-associable-choice::part(drag):hover,
6461
+ qti-associate-interaction::part(drag):hover {
6462
+ --drag-border-color: var(--qti-border-active);
6463
+ }
6464
+ }
6465
+ qti-associate-interaction qti-simple-associable-choice::part(drag):focus:not(:active),
6466
+ qti-associate-interaction::part(drag):focus:not(:active) {
6467
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
6468
+ outline-offset: var(--qti-focus-offset);
5539
6469
  }
5540
6470
 
6471
+ qti-associate-interaction::part(active),
5541
6472
  qti-associate-interaction::part(enabled) {
5542
6473
  background-color: var(--qti-drop-highlight-enabled-bg);
5543
6474
  }
5544
6475
 
6476
+ /* After `enabled`, which every target carries during a drag: the one under the chip. */
6477
+ qti-associate-interaction::part(hover) {
6478
+ background-color: var(--qti-drop-highlight-bg);
6479
+ outline: var(--qti-drop-highlight-border-width) solid var(--qti-drop-highlight-border-color);
6480
+ outline-offset: var(--qti-focus-offset);
6481
+ }
6482
+
5545
6483
  qti-associate-interaction qti-simple-associable-choice:is(:state(placeholder), [data-state~='placeholder']) {
5546
6484
  /* The hole a spent/lifted chip leaves. Like the chip (see `drag`), it sets NO fill / border /
5547
- shadow of its own — those inherit from the resting chip (neutral by default, the brand's fill
5548
- when an overlay is on), so a brand can restyle the hole via a `:state(placeholder)` overlay
5549
- with no specificity contest. The one thing a placeholder always does, in every brand, is hide
5550
- its text; the default hole is then just the resting chip (white + border) with its text gone. */
6485
+ shadow here, on the interaction's high-specificity selector: the hole's paint is the bare
6486
+ `:state(placeholder)` rule in interactions/qti-placeholder.css (a primary tint, inset shadow),
6487
+ which a brand can restyle with the same selector and no specificity contest. The one thing this
6488
+ mixin does, in every brand, is hide what the chip shows: its text, and its handle, which a theme
6489
+ that colours its handles (--cito-color-drag-icon) would otherwise leave standing in the hole. */
5551
6490
  --drag-color: transparent;
6491
+ --qti-grip-color: transparent;
5552
6492
  --drag-opacity: 1;
5553
6493
  border-color: transparent;
5554
6494
  pointer-events: none;
@@ -5556,15 +6496,17 @@
5556
6496
 
5557
6497
  qti-associate-interaction qti-simple-associable-choice:is(:state(dragging), [data-state~='dragging']) {
5558
6498
  /* The hole a spent/lifted chip leaves. Like the chip (see `drag`), it sets NO fill / border /
5559
- shadow of its own — those inherit from the resting chip (neutral by default, the brand's fill
5560
- when an overlay is on), so a brand can restyle the hole via a `:state(placeholder)` overlay
5561
- with no specificity contest. The one thing a placeholder always does, in every brand, is hide
5562
- its text; the default hole is then just the resting chip (white + border) with its text gone. */
6499
+ shadow here, on the interaction's high-specificity selector: the hole's paint is the bare
6500
+ `:state(placeholder)` rule in interactions/qti-placeholder.css (a primary tint, inset shadow),
6501
+ which a brand can restyle with the same selector and no specificity contest. The one thing this
6502
+ mixin does, in every brand, is hide what the chip shows: its text, and its handle, which a theme
6503
+ that colours its handles (--cito-color-drag-icon) would otherwise leave standing in the hole. */
5563
6504
  --drag-color: transparent;
6505
+ --qti-grip-color: transparent;
5564
6506
  --drag-opacity: 1;
5565
6507
  border-color: var(--qti-drop-highlight-border-color);
5566
6508
  box-shadow: inset 0 0 0 var(--qti-drop-highlight-border-width, 2px)
5567
- color-mix(in srgb, var(--qti-drop-highlight-border-color) 55%, transparent);
6509
+ color-mix(in oklab, var(--qti-drop-highlight-border-color) 55%, transparent);
5568
6510
  pointer-events: none;
5569
6511
  }
5570
6512
 
@@ -5581,7 +6523,7 @@
5581
6523
  qti-associate-interaction qti-simple-associable-choice:is(:state(return-anchor), [data-state~='return-anchor']) {
5582
6524
  border-color: var(--qti-drop-highlight-border-color);
5583
6525
  box-shadow: inset 0 0 0 var(--qti-drop-highlight-border-width, 2px)
5584
- color-mix(in srgb, var(--qti-drop-highlight-border-color) 55%, transparent);
6526
+ color-mix(in oklab, var(--qti-drop-highlight-border-color) 55%, transparent);
5585
6527
  }
5586
6528
  }
5587
6529
 
@@ -5592,22 +6534,37 @@
5592
6534
  `[data-drag-clone]:state(candidate-*)` went with it and is deliberately NOT reproduced — a clone
5593
6535
  carries no custom states at all, because cloneNode does not copy ElementInternals (measured), so
5594
6536
  that selector never matched anything. */
5595
- qti-associate-interaction :is(:state(drag), [data-state~='drag']):is(:state(candidate-correct), [data-state~='candidate-correct']),
5596
- qti-simple-associable-choice::part(drag):is(:state(candidate-correct), [data-state~='candidate-correct']),
5597
- qti-associate-interaction::part(drag):is(:state(candidate-correct), [data-state~='candidate-correct']) {
6537
+ qti-associate-interaction :is(:state(drag), [data-state~='drag']):is(:state(candidate-correct), [data-state~='candidate-correct']) {
6538
+ --drag-background-color: var(--qti-correct-light);
6539
+ --drag-color: var(--qti-correct);
6540
+ --drag-border-color: var(--qti-correct);
6541
+ --drag-box-shadow: none;
6542
+ --qti-grip-color: var(--qti-correct);
6543
+ }
6544
+ qti-simple-associable-choice::part(drag):state(candidate-correct),
6545
+ qti-associate-interaction::part(drag):state(candidate-correct) {
5598
6546
  --drag-background-color: var(--qti-correct-light);
5599
6547
  --drag-color: var(--qti-correct);
5600
6548
  --drag-border-color: var(--qti-correct);
5601
6549
  --drag-box-shadow: none;
6550
+ --qti-grip-color: var(--qti-correct);
5602
6551
  }
5603
6552
 
5604
- qti-associate-interaction :is(:state(drag), [data-state~='drag']):is(:state(candidate-incorrect), [data-state~='candidate-incorrect']),
5605
- qti-simple-associable-choice::part(drag):is(:state(candidate-incorrect), [data-state~='candidate-incorrect']),
5606
- qti-associate-interaction::part(drag):is(:state(candidate-incorrect), [data-state~='candidate-incorrect']) {
6553
+ qti-associate-interaction :is(:state(drag), [data-state~='drag']):is(:state(candidate-incorrect), [data-state~='candidate-incorrect']) {
5607
6554
  --drag-background-color: var(--qti-incorrect-light);
5608
6555
  --drag-color: var(--qti-incorrect);
5609
6556
  --drag-border-color: var(--qti-incorrect);
5610
6557
  --drag-box-shadow: none;
6558
+ --qti-grip-color: var(--qti-incorrect);
6559
+ }
6560
+
6561
+ qti-simple-associable-choice::part(drag):state(candidate-incorrect),
6562
+ qti-associate-interaction::part(drag):state(candidate-incorrect) {
6563
+ --drag-background-color: var(--qti-incorrect-light);
6564
+ --drag-color: var(--qti-incorrect);
6565
+ --drag-border-color: var(--qti-incorrect);
6566
+ --drag-box-shadow: none;
6567
+ --qti-grip-color: var(--qti-incorrect);
5611
6568
  }
5612
6569
 
5613
6570
  /* The bank is hidden by the interaction itself, on :host([answer-key]) — see
@@ -5618,7 +6575,7 @@
5618
6575
  qti-graphic-order-interaction {
5619
6576
  --qti-graphic-order-pin-size: calc(var(--qti-select-point-marker-size, 1.5rem) * 1.2);
5620
6577
  --qti-graphic-order-pin-anchor: -100%;
5621
- --qti-graphic-order-pin-fill: var(--qti-background, #fff);
6578
+ --qti-graphic-order-pin-fill: var(--qti-bg);
5622
6579
  --qti-graphic-order-pin-number-size: calc(var(--qti-graphic-order-pin-size) * 0.5);
5623
6580
  --qti-graphic-order-pin-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath d='M192 500C145 434 106 386 77 344C49 305 32 272 32 224C32 135.6 103.6 64 192 64s160 71.6 160 160c0 48-17 81-45 120c-29 42-68 90-115 156z' fill='white' stroke='currentColor' stroke-width='28' stroke-linejoin='round'/%3E%3C/svg%3E");
5624
6581
  }
@@ -5626,7 +6583,7 @@
5626
6583
  qti-graphic-order-interaction qti-hotspot-choice {
5627
6584
  width: 100%;
5628
6585
  height: 100%;
5629
- background-color: color-mix(in srgb, var(--qti-border-color) 18%, transparent);
6586
+ background-color: color-mix(in oklab, var(--qti-border-color) 18%, transparent);
5630
6587
  padding: 0;
5631
6588
  cursor: pointer;
5632
6589
  transition:
@@ -5640,36 +6597,36 @@
5640
6597
  }
5641
6598
 
5642
6599
  [shape='poly']:is(qti-graphic-order-interaction qti-hotspot-choice) {
5643
- background-color: color-mix(in srgb, var(--qti-border-color) 18%, transparent);
6600
+ background-color: color-mix(in oklab, var(--qti-border-color) 18%, transparent);
5644
6601
  box-shadow: none;
5645
6602
  }
5646
6603
 
5647
6604
  [shape='circle']:is(qti-graphic-order-interaction qti-hotspot-choice):hover,[shape='rect']:is(qti-graphic-order-interaction qti-hotspot-choice):hover,[shape='ellipse']:is(qti-graphic-order-interaction qti-hotspot-choice):hover {
5648
- background-color: color-mix(in srgb, var(--qti-border-active) 12%, transparent);
6605
+ background-color: color-mix(in oklab, var(--qti-border-active) 12%, transparent);
5649
6606
  }
5650
6607
 
5651
6608
  [shape='poly']:is(qti-graphic-order-interaction qti-hotspot-choice):hover {
5652
- background-color: color-mix(in srgb, var(--qti-border-active) 20%, transparent);
6609
+ background-color: color-mix(in oklab, var(--qti-border-active) 20%, transparent);
5653
6610
  box-shadow: none;
5654
6611
  }
5655
6612
 
5656
- [shape='circle']:is(qti-graphic-order-interaction qti-hotspot-choice):focus-visible,[shape='rect']:is(qti-graphic-order-interaction qti-hotspot-choice):focus-visible,[shape='ellipse']:is(qti-graphic-order-interaction qti-hotspot-choice):focus-visible {
6613
+ [shape='circle']:is(qti-graphic-order-interaction qti-hotspot-choice):focus,[shape='rect']:is(qti-graphic-order-interaction qti-hotspot-choice):focus,[shape='ellipse']:is(qti-graphic-order-interaction qti-hotspot-choice):focus {
5657
6614
  outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
5658
- outline-offset: 2px;
6615
+ outline-offset: var(--qti-focus-offset);
5659
6616
  }
5660
6617
 
5661
- [shape='poly']:is(qti-graphic-order-interaction qti-hotspot-choice):focus-visible {
6618
+ [shape='poly']:is(qti-graphic-order-interaction qti-hotspot-choice):focus {
5662
6619
  outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
5663
- outline-offset: 2px;
6620
+ outline-offset: var(--qti-focus-offset);
5664
6621
  }
5665
6622
 
5666
6623
  [aria-ordervalue]:is(qti-graphic-order-interaction qti-hotspot-choice) {
5667
6624
  border: 0 !important;
5668
6625
  box-shadow: none;
5669
- background-color: color-mix(in srgb, var(--qti-selected-bg) 35%, transparent);
6626
+ background-color: color-mix(in oklab, var(--qti-selected-bg) 35%, transparent);
5670
6627
  }
5671
6628
 
5672
- [aria-ordervalue]:is(qti-graphic-order-interaction qti-hotspot-choice):hover,[aria-ordervalue]:is(qti-graphic-order-interaction qti-hotspot-choice):focus-visible {
6629
+ [aria-ordervalue]:is(qti-graphic-order-interaction qti-hotspot-choice):hover,[aria-ordervalue]:is(qti-graphic-order-interaction qti-hotspot-choice):focus {
5673
6630
  border-color: transparent !important;
5674
6631
  }
5675
6632
  [aria-ordercorrectvalue][aria-ordervalue]:is(qti-graphic-order-interaction qti-hotspot-choice):not([shape='circle'])::after {
@@ -5714,11 +6671,11 @@
5714
6671
  }
5715
6672
 
5716
6673
  [shape='circle']:is(qti-graphic-order-interaction qti-hotspot-choice):is(:state(checked), [data-state~='checked']),[shape='rect']:is(qti-graphic-order-interaction qti-hotspot-choice):is(:state(checked), [data-state~='checked']),[shape='ellipse']:is(qti-graphic-order-interaction qti-hotspot-choice):is(:state(checked), [data-state~='checked']) {
5717
- background-color: color-mix(in srgb, var(--qti-selected-bg) 35%, transparent);
6674
+ background-color: color-mix(in oklab, var(--qti-selected-bg) 35%, transparent);
5718
6675
  }
5719
6676
 
5720
6677
  [shape='poly']:is(qti-graphic-order-interaction qti-hotspot-choice):is(:state(checked), [data-state~='checked']) {
5721
- background-color: color-mix(in srgb, var(--qti-selected-bg) 40%, transparent);
6678
+ background-color: color-mix(in oklab, var(--qti-selected-bg) 40%, transparent);
5722
6679
  box-shadow: none;
5723
6680
  }
5724
6681
 
@@ -5745,29 +6702,29 @@
5745
6702
 
5746
6703
  @layer qti-components.interactions.corrections {
5747
6704
  [shape='circle']:is(qti-graphic-order-interaction qti-hotspot-choice):is(:state(correct-response), [data-state~='correct-response']),[shape='rect']:is(qti-graphic-order-interaction qti-hotspot-choice):is(:state(correct-response), [data-state~='correct-response']),[shape='ellipse']:is(qti-graphic-order-interaction qti-hotspot-choice):is(:state(correct-response), [data-state~='correct-response']) {
5748
- background-color: color-mix(in srgb, var(--qti-answer-bg) 75%, transparent);
6705
+ background-color: color-mix(in oklab, var(--qti-answer-bg) 75%, transparent);
5749
6706
  }
5750
6707
 
5751
6708
  [shape='poly']:is(qti-graphic-order-interaction qti-hotspot-choice):is(:state(correct-response), [data-state~='correct-response']) {
5752
- background-color: color-mix(in srgb, var(--qti-answer-bg) 80%, transparent);
6709
+ background-color: color-mix(in oklab, var(--qti-answer-bg) 80%, transparent);
5753
6710
  box-shadow: none;
5754
6711
  }
5755
6712
 
5756
6713
  [shape='circle']:is(qti-graphic-order-interaction qti-hotspot-choice):is(:state(candidate-correct), [data-state~='candidate-correct']),[shape='rect']:is(qti-graphic-order-interaction qti-hotspot-choice):is(:state(candidate-correct), [data-state~='candidate-correct']),[shape='ellipse']:is(qti-graphic-order-interaction qti-hotspot-choice):is(:state(candidate-correct), [data-state~='candidate-correct']) {
5757
- background-color: color-mix(in srgb, var(--qti-correct) 35%, transparent);
6714
+ background-color: color-mix(in oklab, var(--qti-correct) 35%, transparent);
5758
6715
  }
5759
6716
 
5760
6717
  [shape='poly']:is(qti-graphic-order-interaction qti-hotspot-choice):is(:state(candidate-correct), [data-state~='candidate-correct']) {
5761
- background-color: color-mix(in srgb, var(--qti-correct) 40%, transparent);
6718
+ background-color: color-mix(in oklab, var(--qti-correct) 40%, transparent);
5762
6719
  box-shadow: none;
5763
6720
  }
5764
6721
 
5765
6722
  [shape='circle']:is(qti-graphic-order-interaction qti-hotspot-choice):is(:state(candidate-incorrect), [data-state~='candidate-incorrect']),[shape='rect']:is(qti-graphic-order-interaction qti-hotspot-choice):is(:state(candidate-incorrect), [data-state~='candidate-incorrect']),[shape='ellipse']:is(qti-graphic-order-interaction qti-hotspot-choice):is(:state(candidate-incorrect), [data-state~='candidate-incorrect']) {
5766
- background-color: color-mix(in srgb, var(--qti-incorrect) 35%, transparent);
6723
+ background-color: color-mix(in oklab, var(--qti-incorrect) 35%, transparent);
5767
6724
  }
5768
6725
 
5769
6726
  [shape='poly']:is(qti-graphic-order-interaction qti-hotspot-choice):is(:state(candidate-incorrect), [data-state~='candidate-incorrect']) {
5770
- background-color: color-mix(in srgb, var(--qti-incorrect) 40%, transparent);
6727
+ background-color: color-mix(in oklab, var(--qti-incorrect) 40%, transparent);
5771
6728
  box-shadow: none;
5772
6729
  }
5773
6730
 
@@ -5790,13 +6747,12 @@
5790
6747
  background-color: transparent;
5791
6748
  }
5792
6749
  [shape='circle']:is(qti-graphic-associate-interaction qti-associable-hotspot):focus {
5793
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
6750
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
6751
+ outline-offset: var(--qti-focus-offset);
5794
6752
  }
5795
6753
  }
5796
6754
 
5797
6755
  @layer qti-components.interactions.states {
5798
-
5799
-
5800
6756
  /* No qti-selections-light / -dark here. Appendix B.1 of the QTI 3 implementation guide defines
5801
6757
  that class pair for qti-hotspot-interaction and qti-graphic-gap-match-interaction only, and no
5802
6758
  item in this repo ever set it on a graphic-associate interaction. What was here overrode the neutral
@@ -5815,10 +6771,22 @@
5815
6771
  }
5816
6772
 
5817
6773
  @layer qti-components.interactions.base{
6774
+
5818
6775
  qti-slider-interaction {
5819
- --qti-tick-color: rgb(229 231 235 / 100%);
6776
+ --qti-tick-color: var(--qti-color-base-300);
5820
6777
  --qti-tick-width: 1px;
5821
6778
  }
6779
+
6780
+ /* The slider takes focus on its host (tabindex 0, role slider); the ring goes round the knob, the
6781
+ part you move, on :focus like every control you set with the pointer. */
6782
+ qti-slider-interaction:focus {
6783
+ outline: var(--qti-focus-border-width) solid transparent;
6784
+ }
6785
+
6786
+ qti-slider-interaction:focus::part(knob) {
6787
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
6788
+ outline-offset: var(--qti-focus-offset);
6789
+ }
5822
6790
  }
5823
6791
 
5824
6792
  @layer qti-components.interactions.base {
@@ -5835,12 +6803,20 @@ qti-slider-interaction {
5835
6803
  * corrections mixin writes to. Setting it here rather than `color` leaves the prompt inheriting
5836
6804
  * ordinary body text, and corrections still win: they set the same variable on the point element
5837
6805
  * itself (`[part~='correct']`), which is deeper than this host declaration.
6806
+ *
6807
+ * A theme sets it through the optional input --cito-color-marker (the primary by default), and
6808
+ * the marker's shape through --cito-icon-marker. The halo round it follows the colour on its own
6809
+ * (qti-select-point-interaction.styles.ts).
5838
6810
  */
5839
- --qti-select-point-marker-color: var(--qti-primary);
6811
+ --qti-select-point-marker-color: var(--cito-color-marker, var(--qti-primary));
6812
+
6813
+ /* One selector, not nested under `&::part(point)`: that compiled to `:is(…::part(point))`,
6814
+ which no browser accepts, so the ring never matched. */
5840
6815
  }
5841
- :is(qti-select-point-interaction::part(point)):focus {
5842
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
5843
- }
6816
+ qti-select-point-interaction::part(point):focus {
6817
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
6818
+ outline-offset: var(--qti-focus-offset);
6819
+ }
5844
6820
  }
5845
6821
 
5846
6822
  @layer qti-components.interactions.corrections {
@@ -5862,7 +6838,214 @@ qti-slider-interaction {
5862
6838
  }
5863
6839
 
5864
6840
  @layer qti-components.interactions.base{
6841
+ /* End attempt is one button, drawn as a test control (`@mixin test-button`). Flat: a pseudo-class
6842
+ after ::part() in a nested list compiles to a dead `:is()`. */
6843
+ qti-end-attempt-interaction::part(button) {
6844
+ min-block-size: var(--test-button-size, 2.25rem);
6845
+ padding: 0 0.875rem;
6846
+ font: inherit;
6847
+ line-height: 1.25;
6848
+ cursor: pointer;
6849
+ border-radius: var(--test-button-border-radius, var(--qti-radius-field));
6850
+ background-color: var(--test-button-background-color, var(--qti-color-base-100));
6851
+ color: var(--test-button-color, var(--qti-color-base-content));
6852
+ border: var(--qti-border-width) solid var(--test-button-border-color, var(--qti-border-color));
6853
+ }
6854
+ @media (hover: hover) and (pointer: fine) {
6855
+
6856
+ qti-end-attempt-interaction::part(button):hover {
6857
+ background-color: var(
6858
+ --test-button-hover-background-color,
6859
+ color-mix(in oklab, var(--qti-color-base-100), var(--qti-color-base-content) var(--qti-hover-mix))
6860
+ );
6861
+ }
6862
+ }
6863
+
6864
+ qti-end-attempt-interaction::part(button):active {
6865
+ background-color: var(
6866
+ --test-button-active-background-color,
6867
+ color-mix(in oklab, var(--qti-color-base-100), var(--qti-color-base-content) var(--qti-active-mix))
6868
+ );
6869
+ }
6870
+
6871
+ qti-end-attempt-interaction::part(button):focus-visible {
6872
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
6873
+ outline-offset: var(--qti-focus-offset);
6874
+ }
6875
+
6876
+ qti-end-attempt-interaction::part(button):disabled {
6877
+ cursor: not-allowed;
6878
+ color: var(--qti-color-disabled);
6879
+ border-color: var(--qti-color-disabled);
6880
+ }
6881
+ }
6882
+
6883
+ @layer qti-components.interactions.base{
6884
+ /* The file input: its button drawn as a test control (`@mixin test-button`), the file name beside it
6885
+ in the item's own type. Flat: a pseudo-element after ::part() in a nested list compiles to a dead
6886
+ `:is()`. */
6887
+ qti-upload-interaction::part(input) {
6888
+ font: inherit;
6889
+ color: var(--qti-color-base-content);
6890
+ }
6891
+
6892
+ qti-upload-interaction::part(input)::file-selector-button {
6893
+ min-block-size: var(--test-button-size, 2.25rem);
6894
+ padding: 0 0.875rem;
6895
+ font: inherit;
6896
+ line-height: 1.25;
6897
+ cursor: pointer;
6898
+ border-radius: var(--test-button-border-radius, var(--qti-radius-field));
6899
+ background-color: var(--test-button-background-color, var(--qti-color-base-100));
6900
+ color: var(--test-button-color, var(--qti-color-base-content));
6901
+ border: var(--qti-border-width) solid var(--test-button-border-color, var(--qti-border-color));
6902
+ margin-inline-end: var(--qti-spacing);
6903
+ }
6904
+ @media (hover: hover) and (pointer: fine) {
6905
+
6906
+ qti-upload-interaction::part(input):hover::file-selector-button {
6907
+ background-color: var(
6908
+ --test-button-hover-background-color,
6909
+ color-mix(in oklab, var(--qti-color-base-100), var(--qti-color-base-content) var(--qti-hover-mix))
6910
+ );
6911
+ }
6912
+ }
6913
+
6914
+ qti-upload-interaction::part(input):active::file-selector-button {
6915
+ background-color: var(
6916
+ --test-button-active-background-color,
6917
+ color-mix(in oklab, var(--qti-color-base-100), var(--qti-color-base-content) var(--qti-active-mix))
6918
+ );
6919
+ }
6920
+
6921
+ qti-upload-interaction::part(input):focus-visible {
6922
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
6923
+ outline-offset: var(--qti-focus-offset);
6924
+ }
6925
+
6926
+ qti-upload-interaction::part(input):disabled::file-selector-button {
6927
+ cursor: not-allowed;
6928
+ color: var(--qti-color-disabled);
6929
+ border-color: var(--qti-color-disabled);
6930
+ }
6931
+ }
6932
+
6933
+ @layer qti-components.interactions.base{
6934
+
5865
6935
  /* `display: block` lives in qti-prompt.styles.ts, which already declares it on :host. */
6936
+
6937
+ /* A prompt opens the interaction it belongs to, so it carries no space above itself. Otherwise the
6938
+ interaction starts lower than whatever sits beside it, and columns do not line up at the top. */
6939
+ @layer qti-components.interactions.base {
6940
+ qti-prompt {
6941
+ margin-block-start: 0;
6942
+ }
6943
+ }
6944
+ }
6945
+
6946
+ @layer qti-components.interactions.states{
6947
+ /*
6948
+ * The hole a lifted or spent chip leaves, in every drag-and-drop interaction: a tint of the primary
6949
+ * colour, no border, and an inset shadow, so it reads as a slot the chip came out of rather than as
6950
+ * a chip without its label. Both colours are tier 2, derived from the primary (qti-variables.css).
6951
+ *
6952
+ * A bare `:state(placeholder)` on purpose, imported into `interactions.states`. The layer puts it
6953
+ * above a brand's resting chip (`interactions.brand`), so a filled chip still leaves a tinted hole;
6954
+ * the low specificity lets a brand sheet restyle the hole with the same selector, no contest. Each
6955
+ * interaction's own placeholder rule (`@mixin drag-placeholder`) only hides the text and the handle, so it does not
6956
+ * fight this one. Graphic gap match reads no --drag-* slot, so its tiles keep their own placeholder.
6957
+ * Corrections, a layer higher, still win.
6958
+ */
6959
+ :is(:state(placeholder), [data-state~='placeholder']) {
6960
+ --drag-background-color: var(--qti-placeholder-bg);
6961
+ --drag-border-color: transparent;
6962
+ --drag-box-shadow: inset var(--qti-placeholder-shadow);
6963
+ }
6964
+ }
6965
+
6966
+ @layer qti-components.interactions.states{
6967
+ /*
6968
+ * The chip in flight: the clone the drag code builds at pointer-down and moves with the pointer
6969
+ * (`[data-drag-clone]`, drag-drop-core.mixin.ts). Opaque, the chip as it is, raised off the page by
6970
+ * --qti-drag-elevation, which a theme sets with --cito-shadow-drag.
6971
+ *
6972
+ * Through the paint slot, so it composes with each interaction's `@mixin drag` on the clone. In
6973
+ * `interactions.states`, above the resting chip's lift. A graphic-gap-match image tile reads no
6974
+ * --drag-* slot and stays as it is: a picture.
6975
+ */
6976
+ [data-drag-clone] {
6977
+ --drag-box-shadow: var(--qti-drag-elevation);
6978
+ }
6979
+
6980
+ /*
6981
+ * While a chip is in flight, the others do not answer the pointer. The clone takes no pointer
6982
+ * events, so the chips it passes over match :hover, and their hover edge (`@mixin drag-hover`) lit
6983
+ * up under a drag that was not about them. `initial` makes the slot guaranteed-invalid, so the
6984
+ * edge falls back to its resting colour, whatever the theme made that. Not on a placeholder, which
6985
+ * keeps its own transparent edge. The drop the chip is over shows `@mixin drop-over` instead.
6986
+ */
6987
+ :is(:state(dragzone-active), [data-state~='dragzone-active']) :is(:state(drag), [data-state~='drag']):hover:not(:is(:state(placeholder), [data-state~='placeholder'])),
6988
+ :is(:state(dragzone-active), [data-state~='dragzone-active'])::part(drag):hover,
6989
+ :is(:state(dragzone-active), [data-state~='dragzone-active']) ::part(drag):hover {
6990
+ --drag-border-color: initial;
6991
+ }
6992
+ }
6993
+
6994
+ @layer qti-components.interactions.states{
6995
+ /*
6996
+ * A disabled interaction, or one disabled choice in it, is drawn in one muted grey: its text, its
6997
+ * edges, its controls and the mark of what is selected (--qti-color-disabled). Not opacity: that
6998
+ * faded everything equally, the selected answer too, let the background show through boxes and
6999
+ * chips, and could not be themed. The box does not move; only colours change.
7000
+ *
7001
+ * It works by re-valuing, on the disabled element, the tokens its paint reads, the same way a
7002
+ * [data-qti-theme] subtree re-themes; nothing per interaction has to know about it.
7003
+ *
7004
+ * Readonly is not disabled. A readonly interaction (an answered test in review) keeps its full look,
7005
+ * so the answers stay readable; only its cursor changes.
7006
+ *
7007
+ * Imported into `interactions.states`, so a disabled correction (corrections, a layer higher) still
7008
+ * shows its verdict colours.
7009
+ */
7010
+ :is(
7011
+ qti-choice-interaction,
7012
+ qti-hottext-interaction,
7013
+ qti-inline-choice-interaction,
7014
+ qti-text-entry-interaction,
7015
+ qti-extended-text-interaction,
7016
+ qti-gap-match-interaction,
7017
+ qti-order-interaction,
7018
+ qti-associate-interaction,
7019
+ qti-match-interaction,
7020
+ qti-hotspot-interaction,
7021
+ qti-graphic-order-interaction,
7022
+ qti-graphic-associate-interaction,
7023
+ qti-graphic-gap-match-interaction,
7024
+ qti-select-point-interaction,
7025
+ qti-slider-interaction
7026
+ )[disabled],
7027
+ :is(:state(disabled), [data-state~='disabled']) {
7028
+ color: var(--qti-color-disabled);
7029
+ --qti-fg: var(--qti-color-disabled);
7030
+ --qti-component-color: var(--qti-color-disabled);
7031
+ --qti-border-color: var(--qti-color-disabled);
7032
+ --qti-component-border-color: var(--qti-color-disabled);
7033
+ --qti-border-active: var(--qti-color-disabled);
7034
+ --qti-border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-color-disabled);
7035
+
7036
+ /* What is selected stays visibly selected, in the same grey. */
7037
+ --qti-primary: var(--qti-color-disabled);
7038
+ --qti-selected-bg: var(--qti-color-disabled);
7039
+ --qti-selected-color: var(--qti-color-base-100);
7040
+ --qti-primary-fg: var(--qti-color-base-100);
7041
+
7042
+ /* Chips, filled or not, and their handles. */
7043
+ --drag-background-color: var(--qti-color-base-100);
7044
+ --drag-color: var(--qti-color-disabled);
7045
+ --drag-border-color: var(--qti-color-disabled);
7046
+ --drag-box-shadow: none;
7047
+ --qti-grip-color: var(--qti-color-disabled);
7048
+ }
5866
7049
  }
5867
7050
 
5868
7051
  @layer qti-components.interactions.corrections{
@@ -5941,8 +7124,8 @@ qti-slider-interaction {
5941
7124
  /* `display: block` is declared by the element itself, in qti-rubric-block.ts. */
5942
7125
  qti-rubric-block {
5943
7126
  border: var(--qti-border-thickness) solid var(--qti-info);
5944
- background-color: color-mix(in srgb, var(--qti-info) 5%, white);
5945
- border-radius: var(--qti-border-radius);
7127
+ background-color: color-mix(in oklab, var(--qti-info) 5%, var(--qti-bg));
7128
+ border-radius: var(--qti-radius-box);
5946
7129
  padding: var(--qti-padding-box);
5947
7130
  margin-top: var(--qti-gap);
5948
7131
  }
@@ -5971,12 +7154,23 @@ qti-feedback-block::part(feedback) {
5971
7154
  width: 100%;
5972
7155
  border: var(--qti-border-thickness) solid var(--qti-info);
5973
7156
  background-color: var(--qti-bg);
5974
- border-radius: var(--qti-border-radius);
7157
+ border-radius: var(--qti-radius-box);
5975
7158
  padding: var(--qti-padding-box);
5976
7159
  margin-top: var(--qti-gap);
5977
7160
  }
5978
7161
  }
5979
7162
 
7163
+ @layer qti-components.elements{
7164
+ /*
7165
+ * The QTI 3 shared vocabulary (qti-native/qti3p0.css) in the theme's shape. Its colours come from
7166
+ * the hooks filled in qti-variables.css; what a hook cannot carry is restated here. The vocabulary's
7167
+ * well has a fixed 4px corner; a theme rounds its boxes with --qti-radius-box.
7168
+ */
7169
+ .qti-well {
7170
+ border-radius: var(--qti-radius-box);
7171
+ }
7172
+ }
7173
+
5980
7174
  @layer qti-components.global{
5981
7175
  /*
5982
7176
  * Cross-interaction custom states.
@@ -6001,10 +7195,10 @@ qti-feedback-block::part(feedback) {
6001
7195
  */
6002
7196
  ::part(message) {
6003
7197
  color: var(--qti-fg);
6004
- background-color: color-mix(in srgb, var(--qti-warning) 5%, white);
7198
+ background-color: color-mix(in oklab, var(--qti-warning) 5%, var(--qti-bg));
6005
7199
  padding: var(--qti-padding-box);
6006
7200
  border: var(--qti-border-thickness) solid var(--qti-warning);
6007
- border-radius: var(--qti-border-radius);
7201
+ border-radius: var(--qti-radius-box);
6008
7202
  margin-top: var(--qti-gap);
6009
7203
  }
6010
7204