@bwui/css 0.1.8 → 0.1.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.
@@ -33,9 +33,9 @@
33
33
  font: inherit;
34
34
  font-family: var(--bw-text-label-family);
35
35
  /* Type follows the step: the size is the fifth role variable (ADR-126
36
- * section 4), the label role size at md and scaled by the text step ratio at
37
- * the other steps, never below the 12 px legibility floor. Family, weight,
38
- * line height and tracking stay the label role at every step (BTN-011). */
36
+ * section 4, ADR-127 section 6), the ladder step with the button's own step
37
+ * name (md is --bw-font-size-md, 1rem at comfortable). Family, weight, line
38
+ * height and tracking stay the label role at every step (BTN-011). */
39
39
  font-size: var(--bw-control-font-size);
40
40
  font-weight: var(--bw-text-label-weight);
41
41
  line-height: var(--bw-text-label-line-height);
@@ -60,9 +60,10 @@
60
60
  * role variables at the resolved step tokens: height, padding, icon, gap and
61
61
  * the label font size. The box tokens are the density control base times the
62
62
  * kit-wide multiplier (--bw-size-step-*), so every density keeps five distinct
63
- * heights; the font size is the label role size times the gentler text
64
- * multiplier (--bw-size-text-step-*), clamped to the 12 px legibility floor.
65
- * No rule here computes a multiplier. Button earns all five steps, xs to xl
63
+ * heights; the font size is the computed type ladder step with the SAME name
64
+ * (ADR-127 section 6: --bw-font-size-<step>, so button sm and bw-text-sm are
65
+ * one token, floored at 12 px by the ladder itself). There is no control font
66
+ * table and no text multiplier here. No rule here computes a multiplier. Button earns all five steps, xs to xl
66
67
  * (BTN-003). The 1.5rem target floor is carried by the height tokens (compact
67
68
  * xs is exactly 1.5rem), not by a rule here. xs and xl have no bare spelling:
68
69
  * they were never shipped, so they are new-grammar only and are not part of the
@@ -82,35 +83,35 @@
82
83
  --bw-control-padding-inline: var(--bw-size-control-padding-inline-xs);
83
84
  --bw-control-icon-size: var(--bw-size-control-icon-xs);
84
85
  --bw-control-gap: var(--bw-size-control-gap-xs);
85
- --bw-control-font-size: var(--bw-size-control-font-size-xs);
86
+ --bw-control-font-size: var(--bw-font-size-xs);
86
87
  }
87
88
  .bw-btn--sm, .bw-btn--size-sm {
88
89
  --bw-control-height: var(--bw-size-control-height-sm);
89
90
  --bw-control-padding-inline: var(--bw-size-control-padding-inline-sm);
90
91
  --bw-control-icon-size: var(--bw-size-control-icon-sm);
91
92
  --bw-control-gap: var(--bw-size-control-gap-sm);
92
- --bw-control-font-size: var(--bw-size-control-font-size-sm);
93
+ --bw-control-font-size: var(--bw-font-size-sm);
93
94
  }
94
95
  .bw-btn--md, .bw-btn--size-md {
95
96
  --bw-control-height: var(--bw-size-control-height-md);
96
97
  --bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
97
98
  --bw-control-icon-size: var(--bw-size-control-icon-md);
98
99
  --bw-control-gap: var(--bw-size-control-gap-md);
99
- --bw-control-font-size: var(--bw-size-control-font-size-md);
100
+ --bw-control-font-size: var(--bw-font-size-md);
100
101
  }
101
102
  .bw-btn--lg, .bw-btn--size-lg {
102
103
  --bw-control-height: var(--bw-size-control-height-lg);
103
104
  --bw-control-padding-inline: var(--bw-size-control-padding-inline-lg);
104
105
  --bw-control-icon-size: var(--bw-size-control-icon-lg);
105
106
  --bw-control-gap: var(--bw-size-control-gap-lg);
106
- --bw-control-font-size: var(--bw-size-control-font-size-lg);
107
+ --bw-control-font-size: var(--bw-font-size-lg);
107
108
  }
108
109
  .bw-btn--size-xl {
109
110
  --bw-control-height: var(--bw-size-control-height-xl);
110
111
  --bw-control-padding-inline: var(--bw-size-control-padding-inline-xl);
111
112
  --bw-control-icon-size: var(--bw-size-control-icon-xl);
112
113
  --bw-control-gap: var(--bw-size-control-gap-xl);
113
- --bw-control-font-size: var(--bw-size-control-font-size-xl);
114
+ --bw-control-font-size: var(--bw-font-size-xl);
114
115
  }
115
116
  /* The glyph and the label are one line of content. The icon is a bw-icon, and
116
117
  * a bare .bw-icon (wave-e) paints a raised box and a muted ink, which showed
@@ -142,7 +143,7 @@
142
143
  * .bw-btn--solid is the early-draft name of primary. It is DEPRECATED, kept
143
144
  * here as an alias through :is() (class weight) for the window ADR-125 sets
144
145
  * for the bare size classes, and removed with them. Its old standalone rule
145
- * read --bw-color-accent-fg, which is not a token, so it needed a per-page
146
+ * read --bw-color-accent-fg (now --bw-color-fg-on-accent, fixed in #48), which was not a token
146
147
  * shim (GAP-BTN-6). */
147
148
  :is(.bw-btn--primary, .bw-btn--solid) {
148
149
  background: var(--bw-color-accent);
@@ -284,70 +285,115 @@
284
285
  }
285
286
  }
286
287
 
287
- /* --- Badges ---------------------------------------------------------------- */
288
+ /* --- Badges (docs/components/badge.md) ------------------------------------- */
288
289
 
290
+ /* Status tag and pace or delta pill. Display atom on the container inset
291
+ * scale (SIZE-COVERAGE: S for badge). Closed size subset sm and md; md is the
292
+ * default and always emitted by React and Vue. Padding fractions match Chip's
293
+ * sm/md so the two pills share one inset reading; Badge stays non-interactive
294
+ * (no 1.5rem floor). Neutral is the default tone (STA-008): a badge carries
295
+ * status information, never error communication (use Alert for that). */
289
296
  .bw-badge {
290
297
  display: inline-flex;
291
298
  align-items: center;
292
299
  gap: var(--bw-space-1);
293
- padding-block: var(--bw-space-0-5);
294
- padding-inline: var(--bw-space-2);
300
+ /* md default: same inset fractions as .bw-chip--size-md */
301
+ padding-block: calc(var(--bw-size-inset-xs) / 3);
302
+ padding-inline: var(--bw-size-inset-xs);
295
303
  /* transparent hairline so intent variants (tinted borders) keep the same
296
304
  geometry as the neutral badge */
297
305
  border: var(--bw-size-border-hairline) solid transparent;
298
306
  border-radius: var(--bw-radius-full);
299
307
  font-size: var(--bw-text-caption-size);
300
308
  font-weight: var(--bw-font-weight-medium);
309
+ line-height: var(--bw-text-caption-line-height);
301
310
  font-variant-numeric: tabular-nums;
302
311
  background: var(--bw-color-surface-sunken);
303
312
  color: var(--bw-color-fg-muted);
313
+ white-space: nowrap;
314
+ }
315
+
316
+ .bw-badge--size-sm {
317
+ padding-block: calc(var(--bw-size-inset-xs) / 6);
318
+ padding-inline: calc(var(--bw-size-inset-xs) * 2 / 3);
319
+ }
320
+
321
+ .bw-badge--size-md {
322
+ padding-block: calc(var(--bw-size-inset-xs) / 3);
323
+ padding-inline: var(--bw-size-inset-xs);
304
324
  }
305
- /* The documented default variant (#100): bw_badge's no-args default is
306
- * variant="neutral", so the contract needs a real .bw-badge--neutral rule,
307
- * not a look left implicit in the base class. The values restate the base's
308
- * neutral chip treatment (sunken surface, muted fg, the transparent hairline
309
- * that keeps every variant on the same geometry); fg-muted on surface-sunken
310
- * measures AA in both themes (the same pairing muted body text already
311
- * relies on). Neutral is the correct default per the badge-vs-alert rule
312
- * (STA-008): a badge carries neutral information, never error communication. */
325
+
313
326
  .bw-badge--neutral {
314
327
  background: var(--bw-color-surface-sunken);
315
328
  color: var(--bw-color-fg-muted);
316
329
  border-color: transparent;
317
330
  }
331
+
332
+ /* Quiet bordered tag (APP-007 sample / provenance). Transparent fill, hairline
333
+ * border, muted ink; never a filled status tone. */
334
+ .bw-badge--outline {
335
+ background: transparent;
336
+ color: var(--bw-color-fg-muted);
337
+ /* border-control: same 3:1 non-text floor as Input / Radio rings */
338
+ border-color: var(--bw-color-border-control);
339
+ }
340
+
318
341
  .bw-badge--success {
319
342
  background: var(--bw-color-success-subtle);
320
343
  color: var(--bw-color-success-fg);
321
344
  border-color: var(--bw-color-success-border);
322
345
  }
346
+
323
347
  .bw-badge--warning {
324
348
  background: var(--bw-color-warning-subtle);
325
349
  color: var(--bw-color-warning-fg);
326
350
  border-color: var(--bw-color-warning-border);
327
351
  }
352
+
328
353
  .bw-badge--danger {
329
354
  background: var(--bw-color-danger-subtle);
330
355
  color: var(--bw-color-danger-fg);
331
356
  border-color: var(--bw-color-danger-border);
332
357
  }
358
+
333
359
  .bw-badge--info {
334
360
  background: var(--bw-color-info-subtle);
335
361
  color: var(--bw-color-info-fg);
336
362
  border-color: var(--bw-color-info-border);
337
363
  }
338
364
 
339
- /* --- Alerts ---------------------------------------------------------------- */
365
+ .bw-badge__icon {
366
+ inline-size: 0.75rem;
367
+ block-size: 0.75rem;
368
+ flex-shrink: 0;
369
+ color: inherit;
370
+ }
371
+
372
+ /* --- Alerts (docs/components/alert.md) ------------------------------------ */
340
373
 
374
+ /* Feedback unit (SIZE-COVERAGE Feedback column). Status colour grammar:
375
+ * subtle fill + tint border; icon full intent; title intent-fg; message fg.
376
+ * Modifier required: info | success | warning | danger (default info). */
341
377
  .bw-alert {
342
378
  display: flex;
379
+ align-items: flex-start;
343
380
  gap: var(--bw-space-3);
344
381
  padding: var(--bw-space-4);
345
382
  border-radius: var(--bw-radius-lg); /* joins the card radius family */
346
383
  border: var(--bw-size-border-hairline) solid var(--bw-color-border);
347
384
  margin-block-end: var(--bw-density-stack-gap);
385
+ color: var(--bw-color-fg);
386
+ background: var(--bw-color-surface);
387
+ }
388
+ /* Decorative status icon (R13 Icon cites this class; Alert does not own Icon). */
389
+ .bw-alert__icon {
390
+ flex-shrink: 0;
391
+ inline-size: 1.25rem;
392
+ block-size: 1.25rem;
393
+ margin-block-start: 0.125rem; /* optically centre beside heading-sm */
348
394
  }
349
395
  /* The text region between the icon and the optional close button
350
- * (icvoss/django-brickwork#137): without a flex-grow rule of its own it
396
+ * (icvoss/django-brickwork issue 137): without a flex-grow rule of its own it
351
397
  * collapses to content width instead of filling the row, matching
352
398
  * .bw-toast__message and .bw-modal__body's own flex: 1 1 auto. min-inline-size:
353
399
  * 0 lets it actually shrink below its content's natural width (the row is
@@ -370,10 +416,14 @@
370
416
  font-size: var(--bw-text-body-sm-size);
371
417
  font-weight: var(--bw-text-body-sm-weight);
372
418
  line-height: var(--bw-text-body-sm-line-height);
419
+ color: var(--bw-color-fg);
420
+ }
421
+ .bw-alert__title + .bw-alert__message {
422
+ margin-block-start: var(--bw-space-1);
373
423
  }
374
424
  /* Variant borders use the per-intent tint-border tokens (decorative tint,
375
425
  * softer than the full-strength intent colour and not relied on for
376
- * contrast); icon carries the intent, title accents via X-fg (DESIGN.md 4.5). */
426
+ * contrast); icon carries the intent, title accents via X-fg. */
377
427
  .bw-alert--info {
378
428
  background: var(--bw-color-info-subtle);
379
429
  border-color: var(--bw-color-info-border);
@@ -414,7 +464,7 @@
414
464
  .bw-alert--danger .bw-alert__title {
415
465
  color: var(--bw-color-danger-fg);
416
466
  }
417
- /* The dismiss control (icvoss/django-brickwork#137): flex-shrink: 0 so it
467
+ /* The dismiss control (icvoss/django-brickwork issue 137): flex-shrink: 0 so it
418
468
  * does not compress, matching .bw-modal__close/.bw-slide-over__close/
419
469
  * .bw-toast__close. No margin-inline-start: auto needed here: .bw-alert__body
420
470
  * already carries flex: 1 1 auto, so it fills the remaining row space and
@@ -423,6 +473,149 @@
423
473
  flex-shrink: 0;
424
474
  }
425
475
 
476
+ /* --- Banner (H19 / R16) ---------------------------------------------------- */
477
+ /*
478
+ * Full-bleed edge-anchored announcement strip. Distinct from .bw-alert
479
+ * (in-flow status, role=alert, rounded) and .bw-callout (editorial).
480
+ * Status colour grammar reuses Alert's public intent tokens; neutral is
481
+ * sunken/surface for non-status announcements. Inner-edge borders use the
482
+ * solid intent (not the softer *-border tint) so the hairline clears 3:1
483
+ * against the subtle fill (CB-03 / BAN-053). docs/components/banner.md.
484
+ */
485
+ .bw-banner {
486
+ display: flex;
487
+ align-items: flex-start;
488
+ gap: var(--bw-space-3);
489
+ /* Density-following inset (Feedback class): sm step of the shared inset
490
+ * scale, which recomputes from --bw-density-card-padding. */
491
+ padding-block: var(--bw-size-inset-sm);
492
+ padding-inline: var(--bw-size-inset-md);
493
+ border-radius: 0;
494
+ border: 0;
495
+ color: var(--bw-color-fg);
496
+ background: var(--bw-color-info-subtle);
497
+ inline-size: 100%;
498
+ box-sizing: border-box;
499
+ }
500
+ .bw-banner--edge-top {
501
+ border-block-end: var(--bw-size-border-hairline) solid var(--bw-color-info);
502
+ }
503
+ .bw-banner--edge-bottom {
504
+ border-block-start: var(--bw-size-border-hairline) solid var(--bw-color-info);
505
+ border-block-end: 0;
506
+ }
507
+ .bw-banner__icon {
508
+ flex-shrink: 0;
509
+ inline-size: var(--bw-component-icon-size-sm);
510
+ block-size: var(--bw-component-icon-size-sm);
511
+ color: var(--bw-color-info);
512
+ }
513
+ .bw-banner__body {
514
+ flex: 1 1 auto;
515
+ min-inline-size: 0;
516
+ }
517
+ .bw-banner__title {
518
+ margin: 0;
519
+ font-family: var(--bw-text-heading-sm-family);
520
+ font-size: var(--bw-text-heading-sm-size);
521
+ font-weight: var(--bw-text-heading-sm-weight);
522
+ line-height: var(--bw-text-heading-sm-line-height);
523
+ color: var(--bw-color-info-fg);
524
+ }
525
+ .bw-banner__message {
526
+ margin: 0;
527
+ margin-block-start: var(--bw-space-1);
528
+ max-inline-size: var(--bw-size-max-width-prose);
529
+ font-size: var(--bw-text-body-sm-size);
530
+ font-weight: var(--bw-text-body-sm-weight);
531
+ line-height: var(--bw-text-body-sm-line-height);
532
+ }
533
+ .bw-banner__actions {
534
+ flex-shrink: 0;
535
+ display: flex;
536
+ flex-wrap: wrap;
537
+ align-items: center;
538
+ gap: var(--bw-space-2);
539
+ }
540
+ .bw-banner__close {
541
+ flex-shrink: 0;
542
+ }
543
+ .bw-banner--success {
544
+ background: var(--bw-color-success-subtle);
545
+ }
546
+ .bw-banner--success.bw-banner--edge-top {
547
+ border-block-end-color: var(--bw-color-success-fg);
548
+ }
549
+ .bw-banner--success.bw-banner--edge-bottom {
550
+ border-block-start-color: var(--bw-color-success-fg);
551
+ }
552
+ .bw-banner--success .bw-banner__icon {
553
+ color: var(--bw-color-success);
554
+ }
555
+ .bw-banner--success .bw-banner__title {
556
+ color: var(--bw-color-success-fg);
557
+ }
558
+ .bw-banner--warning {
559
+ background: var(--bw-color-warning-subtle);
560
+ }
561
+ .bw-banner--warning.bw-banner--edge-top {
562
+ border-block-end-color: var(--bw-color-warning-fg);
563
+ }
564
+ .bw-banner--warning.bw-banner--edge-bottom {
565
+ border-block-start-color: var(--bw-color-warning-fg);
566
+ }
567
+ .bw-banner--warning .bw-banner__icon {
568
+ color: var(--bw-color-warning);
569
+ }
570
+ .bw-banner--warning .bw-banner__title {
571
+ color: var(--bw-color-warning-fg);
572
+ }
573
+ .bw-banner--danger {
574
+ background: var(--bw-color-danger-subtle);
575
+ }
576
+ .bw-banner--danger.bw-banner--edge-top {
577
+ border-block-end-color: var(--bw-color-danger);
578
+ }
579
+ .bw-banner--danger.bw-banner--edge-bottom {
580
+ border-block-start-color: var(--bw-color-danger);
581
+ }
582
+ .bw-banner--danger .bw-banner__icon {
583
+ color: var(--bw-color-danger);
584
+ }
585
+ .bw-banner--danger .bw-banner__title {
586
+ color: var(--bw-color-danger-fg);
587
+ }
588
+ .bw-banner--neutral {
589
+ background: var(--bw-color-surface-sunken);
590
+ }
591
+ .bw-banner--neutral.bw-banner--edge-top {
592
+ border-block-end-color: var(--bw-color-fg-muted);
593
+ }
594
+ .bw-banner--neutral.bw-banner--edge-bottom {
595
+ border-block-start-color: var(--bw-color-fg-muted);
596
+ }
597
+ .bw-banner--neutral .bw-banner__icon {
598
+ color: var(--bw-color-fg-muted);
599
+ }
600
+ .bw-banner--neutral .bw-banner__title {
601
+ color: var(--bw-color-fg);
602
+ }
603
+ .bw-banner--info {
604
+ background: var(--bw-color-info-subtle);
605
+ }
606
+ .bw-banner--info.bw-banner--edge-top {
607
+ border-block-end-color: var(--bw-color-info);
608
+ }
609
+ .bw-banner--info.bw-banner--edge-bottom {
610
+ border-block-start-color: var(--bw-color-info);
611
+ }
612
+ .bw-banner--info .bw-banner__icon {
613
+ color: var(--bw-color-info);
614
+ }
615
+ .bw-banner--info .bw-banner__title {
616
+ color: var(--bw-color-info-fg);
617
+ }
618
+
426
619
  /* --- Form fields ----------------------------------------------------------- */
427
620
 
428
621
  /* Forms hold the designed measure: the max-width-form token caps the field
@@ -444,18 +637,25 @@
444
637
  .bw-field {
445
638
  display: flex;
446
639
  flex-direction: column;
447
- gap: var(--bw-space-1);
448
- margin-block-end: var(--bw-density-stack-gap);
640
+ /* Internal stack (label → control → help → error): layout gap xs, density-
641
+ * following (ADR-126 section 6 / SIZE-COVERAGE gate 5). Was --bw-space-1. */
642
+ gap: var(--bw-size-gap-xs);
643
+ /* Space before the next sibling field: layout gap md (= density stack gap). */
644
+ margin-block-end: var(--bw-size-gap-md);
449
645
  max-inline-size: var(--bw-size-max-width-form);
450
646
  }
451
647
  .bw-field__label {
648
+ color: var(--bw-color-fg);
649
+ font-family: var(--bw-text-label-family);
452
650
  font-size: var(--bw-text-label-size);
453
651
  font-weight: var(--bw-text-label-weight);
454
652
  line-height: var(--bw-text-label-line-height);
653
+ letter-spacing: var(--bw-text-label-tracking);
455
654
  }
456
655
  .bw-field__required {
457
656
  /* danger-fg, not raw danger: the text-duty tier holds AA at caption size. */
458
657
  color: var(--bw-color-danger-fg);
658
+ font-weight: var(--bw-text-label-weight);
459
659
  }
460
660
  /* The widget wrapper (icvoss/django-brickwork#130): every field renderer
461
661
  * (_field.html, _combobox.html, _dropzone.html, _tag_input.html) wraps its
@@ -468,15 +668,66 @@
468
668
  display: block;
469
669
  min-inline-size: 0;
470
670
  }
471
- .bw-input {
671
+ /* Input size classes: re-point the five control role variables at the
672
+ * resolved step tokens, same grammar as .bw-btn--size-* and
673
+ * .bw-combobox--size-* (ADR-125; SIZE-COVERAGE gate 2). The base .bw-input
674
+ * reads the role variables and defaults to md; a size class overrides them
675
+ * for the input and any element inside the same subtree that reads the same
676
+ * role variables (e.g. an attached addon). */
677
+ .bw-input--size-xs {
678
+ --bw-control-height: var(--bw-size-control-height-xs);
679
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-xs);
680
+ --bw-control-icon-size: var(--bw-size-control-icon-xs);
681
+ --bw-control-gap: var(--bw-size-control-gap-xs);
682
+ --bw-control-font-size: var(--bw-font-size-xs);
683
+ }
684
+ .bw-input--size-sm {
685
+ --bw-control-height: var(--bw-size-control-height-sm);
686
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-sm);
687
+ --bw-control-icon-size: var(--bw-size-control-icon-sm);
688
+ --bw-control-gap: var(--bw-size-control-gap-sm);
689
+ --bw-control-font-size: var(--bw-font-size-sm);
690
+ }
691
+ .bw-input--size-md {
692
+ --bw-control-height: var(--bw-size-control-height-md);
693
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
694
+ --bw-control-icon-size: var(--bw-size-control-icon-md);
695
+ --bw-control-gap: var(--bw-size-control-gap-md);
696
+ --bw-control-font-size: var(--bw-font-size-md);
697
+ }
698
+ .bw-input--size-lg {
699
+ --bw-control-height: var(--bw-size-control-height-lg);
700
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-lg);
701
+ --bw-control-icon-size: var(--bw-size-control-icon-lg);
702
+ --bw-control-gap: var(--bw-size-control-gap-lg);
703
+ --bw-control-font-size: var(--bw-font-size-lg);
704
+ }
705
+ .bw-input--size-xl {
706
+ --bw-control-height: var(--bw-size-control-height-xl);
707
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-xl);
708
+ --bw-control-icon-size: var(--bw-size-control-icon-xl);
709
+ --bw-control-gap: var(--bw-size-control-gap-xl);
710
+ --bw-control-font-size: var(--bw-font-size-xl);
711
+ }
712
+ /* .bw-input is canonical for single-line and multi-line text controls.
713
+ * .bw-textarea is a shipped alias (React Early / Free gallery) that paints
714
+ * identically; size always uses bw-input--size-* (INP-003). Native Select
715
+ * chrome lives on .bw-select (R04); select.bw-input remains a Django-widget
716
+ * alias of that unit. */
717
+ .bw-input,
718
+ .bw-textarea {
472
719
  inline-size: 100%;
473
- block-size: var(--bw-density-control-height);
474
- padding-inline: var(--bw-density-control-padding-inline);
720
+ block-size: var(--bw-control-height);
721
+ padding-inline: var(--bw-control-padding-inline);
475
722
  border: var(--bw-size-border-hairline) solid var(--bw-color-border-control);
476
723
  border-radius: var(--bw-radius-md);
477
724
  background: var(--bw-color-surface);
478
725
  color: var(--bw-color-fg);
479
726
  font: inherit;
727
+ /* Step-aware size: inherit sets the family, weight, etc., then the role
728
+ * variable overrides the size so a size class (bw-input--size-*) resizes
729
+ * the field. */
730
+ font-size: var(--bw-control-font-size);
480
731
  /* Inner top hairline (0.7.0 craft): black at 4% alpha, the faint recessed
481
732
  * top edge that makes the field read as a well rather than a flat rectangle
482
733
  * (the button bevel's counterpart, same black-literal shadow convention as
@@ -487,20 +738,33 @@
487
738
  /* Textareas share .bw-input chrome but must honour rows= (and grow with
488
739
  * content). Fixed block-size on .bw-input collapsed every textarea to a
489
740
  * single-line control height (icvoss/django-brickwork#521). */
490
- textarea.bw-input {
741
+ textarea.bw-input,
742
+ .bw-textarea {
491
743
  block-size: auto;
492
- min-block-size: calc(var(--bw-density-control-height) * 3);
493
- padding-block: var(--bw-density-control-padding-inline);
744
+ min-block-size: calc(var(--bw-control-height) * 3);
745
+ padding-block: var(--bw-control-padding-inline);
494
746
  resize: vertical;
495
747
  field-sizing: content;
496
748
  }
749
+ /* Placeholder (INP-035): fg-muted, not fg-subtle (same floor as Combobox
750
+ * CMB-035). Opacity reset because Firefox dims ::placeholder on top of colour. */
751
+ .bw-input::placeholder,
752
+ .bw-textarea::placeholder {
753
+ color: var(--bw-color-fg-muted);
754
+ opacity: 1;
755
+ }
756
+ .bw-input:disabled::placeholder,
757
+ .bw-textarea:disabled::placeholder {
758
+ color: var(--bw-color-action-disabled-text);
759
+ }
497
760
  /* Hover pre-light: one perceptible step from the control border toward ink.
498
761
  * Mixing toward fg (82% border-control, 18% fg) is theme-correct in both
499
762
  * directions automatically, because fg flips with the theme: measured 4.47:1
500
763
  * against the light surface and 4.61:1 against the dark (the resting border's
501
764
  * 3.23/3.39 stays the 1.4.11 floor). :where() keeps the guards at zero
502
765
  * specificity so the later focus-visible and invalid border rules still win. */
503
- .bw-input:hover:where(:not(:disabled):not([readonly]):not(:focus-visible)) {
766
+ .bw-input:hover:where(:not(:disabled):not([readonly]):not(:focus-visible)),
767
+ .bw-textarea:hover:where(:not(:disabled):not([readonly]):not(:focus-visible)) {
504
768
  border-color: color-mix(in oklab, var(--bw-color-border-control) 82%, var(--bw-color-fg));
505
769
  }
506
770
  /* The focus ring itself comes from the global :focus-visible rule; the border
@@ -510,134 +774,310 @@ textarea.bw-input {
510
774
  * the surface, purely decorative) hugs the input's own radius beneath the
511
775
  * offset outline, so focus reads at the control edge as well as the ring;
512
776
  * the inner hairline is restated so the well doesn't pop flat on focus. */
513
- .bw-input:focus-visible {
777
+ .bw-input:focus-visible,
778
+ .bw-textarea:focus-visible {
514
779
  border-color: var(--bw-color-accent);
515
780
  box-shadow:
516
781
  inset 0 1px 2px 0 oklch(0 0 0 / 0.04),
517
782
  0 0 0 3px color-mix(in oklab, var(--bw-color-accent) 18%, transparent);
518
783
  }
519
- /* Select (0.7.0 craft): the UA chrome goes, the input's own drawing stays, and
520
- * the affordance is an embedded chevron (--bw-component-select-indicator, a component
521
- * token carrying a data-URI SVG; its baked mid-grey and measured ratios are
522
- * documented on the token). Sized to the sm icon step, seated inside the
523
- * control padding; the end padding clears glyph plus a breathing space.
524
- * background-position has no logical form, so RTL swaps the corner via
525
- * [dir="rtl"], the same mechanism as .bw-icon-directional. */
784
+ .bw-input[readonly],
785
+ .bw-textarea[readonly] {
786
+ background-color: var(--bw-color-surface-sunken);
787
+ }
788
+ .bw-input:disabled,
789
+ .bw-textarea:disabled {
790
+ background-color: var(--bw-color-action-disabled-bg);
791
+ color: var(--bw-color-action-disabled-text);
792
+ border-color: var(--bw-color-action-disabled-border);
793
+ cursor: not-allowed;
794
+ }
795
+ .bw-field--invalid .bw-input,
796
+ .bw-field--invalid .bw-textarea,
797
+ .bw-input[aria-invalid="true"],
798
+ .bw-textarea[aria-invalid="true"] {
799
+ border-color: var(--bw-color-danger);
800
+ }
801
+
802
+ /* --- Select (native, R04 / C03) --------------------------------------------- */
803
+
804
+ /* Size classes: same five role-variable re-points as Input (ADR-125;
805
+ * SEL-003). md is the default emitted by React. */
806
+ .bw-select--size-xs {
807
+ --bw-control-height: var(--bw-size-control-height-xs);
808
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-xs);
809
+ --bw-control-icon-size: var(--bw-size-control-icon-xs);
810
+ --bw-control-gap: var(--bw-size-control-gap-xs);
811
+ --bw-control-font-size: var(--bw-font-size-xs);
812
+ }
813
+ .bw-select--size-sm {
814
+ --bw-control-height: var(--bw-size-control-height-sm);
815
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-sm);
816
+ --bw-control-icon-size: var(--bw-size-control-icon-sm);
817
+ --bw-control-gap: var(--bw-size-control-gap-sm);
818
+ --bw-control-font-size: var(--bw-font-size-sm);
819
+ }
820
+ .bw-select--size-md {
821
+ --bw-control-height: var(--bw-size-control-height-md);
822
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
823
+ --bw-control-icon-size: var(--bw-size-control-icon-md);
824
+ --bw-control-gap: var(--bw-size-control-gap-md);
825
+ --bw-control-font-size: var(--bw-font-size-md);
826
+ }
827
+ .bw-select--size-lg {
828
+ --bw-control-height: var(--bw-size-control-height-lg);
829
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-lg);
830
+ --bw-control-icon-size: var(--bw-size-control-icon-lg);
831
+ --bw-control-gap: var(--bw-size-control-gap-lg);
832
+ --bw-control-font-size: var(--bw-font-size-lg);
833
+ }
834
+ .bw-select--size-xl {
835
+ --bw-control-height: var(--bw-size-control-height-xl);
836
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-xl);
837
+ --bw-control-icon-size: var(--bw-size-control-icon-xl);
838
+ --bw-control-gap: var(--bw-size-control-gap-xl);
839
+ --bw-control-font-size: var(--bw-font-size-xl);
840
+ }
841
+ /* .bw-select is canonical. select.bw-input is the Django bw_field_widget
842
+ * alias (widget class still emits bw-input for Select until the lockstep
843
+ * pin lands); it paints the same chrome and chevron (SEL-001). */
844
+ .bw-select,
526
845
  select.bw-input {
527
846
  appearance: none;
528
- background-image: var(--bw-component-select-indicator);
529
- background-repeat: no-repeat;
530
- background-position: right var(--bw-density-control-padding-inline) center;
531
- background-size: var(--bw-component-icon-size-sm);
847
+ display: block;
848
+ inline-size: 100%;
849
+ block-size: var(--bw-control-height);
850
+ padding-inline: var(--bw-control-padding-inline);
851
+ /* End padding clears the chevron glyph plus a breathing space (SEL-012). */
532
852
  padding-inline-end: calc(
533
- var(--bw-density-control-padding-inline) + var(--bw-component-icon-size-sm) + var(--bw-space-1)
853
+ var(--bw-control-padding-inline) + var(--bw-control-icon-size) + var(--bw-space-1)
534
854
  );
855
+ border: var(--bw-size-border-hairline) solid var(--bw-color-border-control);
856
+ border-radius: var(--bw-radius-md);
857
+ /* background-color + background-image, never the shorthand: state rules that
858
+ * change fill must not wipe the chevron (0.7.0 craft). */
859
+ background-color: var(--bw-color-surface);
860
+ background-image: var(--bw-component-select-indicator);
861
+ background-repeat: no-repeat;
862
+ background-position: right var(--bw-control-padding-inline) center;
863
+ background-size: var(--bw-control-icon-size);
864
+ color: var(--bw-color-fg);
865
+ font: inherit;
866
+ font-size: var(--bw-control-font-size);
867
+ box-shadow: inset 0 1px 2px 0 oklch(0 0 0 / 0.04);
868
+ transition: var(--bw-transition-colors), var(--bw-transition-shadow);
535
869
  }
870
+ /* background-position has no logical form; RTL swaps the corner via
871
+ * [dir="rtl"], the same mechanism as .bw-icon-directional (SEL-015). */
872
+ [dir="rtl"] .bw-select,
536
873
  [dir="rtl"] select.bw-input {
537
- background-position: left var(--bw-density-control-padding-inline) center;
874
+ background-position: left var(--bw-control-padding-inline) center;
538
875
  }
539
- /* background-color, not the shorthand: the shorthand also reset
540
- * background-image, so a disabled select.bw-input lost its chevron (the
541
- * select rule is less specific than these state rules). */
542
- .bw-input[readonly] {
543
- background-color: var(--bw-color-surface-sunken);
876
+ .bw-select:hover:where(:not(:disabled):not(:focus-visible)),
877
+ select.bw-input:hover:where(:not(:disabled):not(:focus-visible)) {
878
+ border-color: color-mix(in oklab, var(--bw-color-border-control) 82%, var(--bw-color-fg));
879
+ }
880
+ .bw-select:focus-visible,
881
+ select.bw-input:focus-visible {
882
+ border-color: var(--bw-color-accent);
883
+ box-shadow:
884
+ inset 0 1px 2px 0 oklch(0 0 0 / 0.04),
885
+ 0 0 0 3px color-mix(in oklab, var(--bw-color-accent) 18%, transparent);
544
886
  }
545
- .bw-input:disabled {
887
+ .bw-select:disabled,
888
+ select.bw-input:disabled {
546
889
  background-color: var(--bw-color-action-disabled-bg);
547
890
  color: var(--bw-color-action-disabled-text);
548
891
  border-color: var(--bw-color-action-disabled-border);
549
892
  cursor: not-allowed;
550
893
  }
551
- .bw-field--invalid .bw-input,
552
- .bw-input[aria-invalid="true"] {
894
+ .bw-field--invalid .bw-select,
895
+ .bw-field--invalid select.bw-input,
896
+ .bw-select[aria-invalid="true"],
897
+ select.bw-input[aria-invalid="true"] {
553
898
  border-color: var(--bw-color-danger);
554
899
  }
900
+ /* Multiple: grow like a textarea; drop the single-select chevron (SEL-004). */
901
+ .bw-select[multiple],
902
+ select.bw-input[multiple] {
903
+ block-size: auto;
904
+ min-block-size: calc(var(--bw-control-height) * 3);
905
+ padding-block: var(--bw-control-padding-inline);
906
+ padding-inline-end: var(--bw-control-padding-inline);
907
+ background-image: none;
908
+ }
555
909
 
556
- /* --- Checkbox + radio (drawn controls, 0.7.0 craft) ------------------------- */
910
+ /* --- Checkbox (R05) + Radio (R06) ------------------------------------------- */
557
911
 
558
912
  /* appearance:none swaps the UA widget for a control drawn on our tokens (the
559
913
  * moderncss pattern: with appearance removed, every modern engine renders the
560
914
  * input as a plain box, including its ::before). inline-grid centres the
561
915
  * glyph; vertical-align + the end margin seat the control against label
562
- * text. The resting border is border-control (the WCAG 1.4.11 boundary,
563
- * measured 3.23:1 light / 3.39:1 dark, same contract as .bw-input); the focus
564
- * ring comes from the global :where(input):focus-visible rule. Every selector
565
- * is input-qualified: RadioSelect/CheckboxSelectMultiple rendering puts the
566
- * class on the group wrapper div as well as on each option input (the
567
- * option_inherits_attrs route), and the wrapper must stay unstyled.
916
+ * text. The resting border is border-control (the WCAG 1.4.11 boundary);
917
+ * the focus ring comes from the global :where(input):focus-visible rule.
918
+ * Every selector is input-qualified: RadioSelect/CheckboxSelectMultiple
919
+ * rendering puts the class on the group wrapper div as well as on each
920
+ * option input (the option_inherits_attrs route), and the wrapper must stay
921
+ * unstyled.
568
922
  *
569
- * icvoss/django-brickwork#208: both controls render as bare native inputs
570
- * with no wrapping label (the data table's select-all/select-row cells, and
571
- * bw_field_widget's own .bw-field__control), so there is no clickable
572
- * wrapper to extend the hit area through; the box itself IS the whole
573
- * target. The box is 1.5rem (24px), the exact WCAG 2.5.8 floor, grown from
574
- * the previous 1.125rem (18px). This does change the control's visual
575
- * size (the issue's own "changing visual weight is a regression in its own
576
- * right" applies), but a clip/padding trick to keep an 18px-looking box
577
- * inside a 24px hit area needs the border moved off `border` onto a layered
578
- * box-shadow to stop it tracking the padding box, which is exactly the kind
579
- * of fragile, non-obvious CSS this codebase avoids elsewhere; growing the
580
- * real box is the KISS option and is verified not to unbalance the label
581
- * row (row height already had headroom: the data table's select column and
582
- * .bw-field__control both size to the row/control height, not to the
583
- * checkbox). */
584
- input.bw-checkbox,
585
- input.bw-radio {
923
+ * Checkbox (R05) and Radio (R06) each read the control role variables: the
924
+ * box is --bw-control-height (floored at 1.5rem by the step tokens), the
925
+ * checkbox tick is --bw-control-icon-size, and the label gap is
926
+ * --bw-control-gap. Size classes bw-checkbox--size-* and bw-radio--size-*
927
+ * re-point those variables (ADR-125). The two grammars stay separate. */
928
+
929
+ input.bw-checkbox {
586
930
  appearance: none;
587
931
  display: inline-grid;
588
932
  place-content: center;
589
- inline-size: 1.5rem;
590
- block-size: 1.5rem;
933
+ inline-size: var(--bw-control-height);
934
+ block-size: var(--bw-control-height);
591
935
  flex-shrink: 0;
592
936
  margin: 0;
593
- margin-inline-end: var(--bw-space-2);
937
+ margin-inline-end: var(--bw-control-gap);
594
938
  vertical-align: middle;
595
939
  border: var(--bw-size-border-hairline) solid var(--bw-color-border-control);
940
+ border-radius: var(--bw-radius-sm);
596
941
  background: var(--bw-color-surface);
597
942
  transition: var(--bw-transition-colors);
598
943
  }
599
- input.bw-checkbox {
600
- border-radius: var(--bw-radius-sm);
944
+ /* Size classes: re-point role variables only (CBX-003). md is the default
945
+ * from :root; React always emits an explicit size class. */
946
+ input.bw-checkbox.bw-checkbox--size-xs {
947
+ --bw-control-height: var(--bw-size-control-height-xs);
948
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-xs);
949
+ --bw-control-icon-size: var(--bw-size-control-icon-xs);
950
+ --bw-control-gap: var(--bw-size-control-gap-xs);
951
+ --bw-control-font-size: var(--bw-font-size-xs);
601
952
  }
602
- input.bw-radio {
603
- border-radius: var(--bw-radius-full);
953
+ input.bw-checkbox.bw-checkbox--size-sm {
954
+ --bw-control-height: var(--bw-size-control-height-sm);
955
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-sm);
956
+ --bw-control-icon-size: var(--bw-size-control-icon-sm);
957
+ --bw-control-gap: var(--bw-size-control-gap-sm);
958
+ --bw-control-font-size: var(--bw-font-size-sm);
604
959
  }
605
- /* Shared hover pre-light, the input's own mix (constant documented there). */
606
- input.bw-checkbox:hover:where(:not(:disabled):not(:checked)),
607
- input.bw-radio:hover:where(:not(:disabled):not(:checked)) {
608
- border-color: color-mix(in oklab, var(--bw-color-border-control) 82%, var(--bw-color-fg));
960
+ input.bw-checkbox.bw-checkbox--size-md {
961
+ --bw-control-height: var(--bw-size-control-height-md);
962
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
963
+ --bw-control-icon-size: var(--bw-size-control-icon-md);
964
+ --bw-control-gap: var(--bw-size-control-gap-md);
965
+ --bw-control-font-size: var(--bw-font-size-md);
609
966
  }
610
- /* Checked: solid accent fill (measured 5.11:1 light / 7.14:1 dark against the
611
- * surface, the 1.4.11 state boundary). */
612
- input.bw-checkbox:checked,
613
- input.bw-radio:checked {
614
- border-color: var(--bw-color-accent);
615
- background-color: var(--bw-color-accent);
967
+ input.bw-checkbox.bw-checkbox--size-lg {
968
+ --bw-control-height: var(--bw-size-control-height-lg);
969
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-lg);
970
+ --bw-control-icon-size: var(--bw-size-control-icon-lg);
971
+ --bw-control-gap: var(--bw-size-control-gap-lg);
972
+ --bw-control-font-size: var(--bw-font-size-lg);
616
973
  }
617
- /* The tick: --bw-component-checkbox-glyph is a colour-free alpha shape consumed as a
618
- * mask and PAINTED with fg-on-accent, so the glyph ink flips with the theme
619
- * like every other ink-on-accent (white on the light accent, near-black on
620
- * the lighter dark accent; measured 5.11:1 light / 7.52:1 dark against the
621
- * fill; a baked white tick would fail dark at 2.63:1, documented on the
622
- * token). No entrance animation: the fill change is feedback enough and the
623
- * reduced-motion floor stays trivially honoured. */
624
- input.bw-checkbox:checked::before {
625
- content: "";
626
- inline-size: 1rem; /* 16px glyph centred in the 24px box, same ~66% fill ratio as the previous 12px-in-18px */
627
- block-size: 1rem;
628
- background-color: var(--bw-color-fg-on-accent);
629
- mask-image: var(--bw-component-checkbox-glyph);
630
- mask-repeat: no-repeat;
631
- mask-size: 100% 100%;
974
+ input.bw-checkbox.bw-checkbox--size-xl {
975
+ --bw-control-height: var(--bw-size-control-height-xl);
976
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-xl);
977
+ --bw-control-icon-size: var(--bw-size-control-icon-xl);
978
+ --bw-control-gap: var(--bw-size-control-gap-xl);
979
+ --bw-control-font-size: var(--bw-font-size-xl);
980
+ }
981
+
982
+
983
+ /* Radio size classes (docs/components/radio.md RAD-003): same grammar as
984
+ * .bw-input--size-*, re-pointing the five control role variables at the
985
+ * resolved step tokens (ADR-125). The radio reads height (its square box)
986
+ * and gap (its label offset); the control height floor of 1.5rem keeps every
987
+ * step and density on the WCAG 2.5.8 target (RAD-052). */
988
+ .bw-radio--size-xs {
989
+ --bw-control-height: var(--bw-size-control-height-xs);
990
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-xs);
991
+ --bw-control-icon-size: var(--bw-size-control-icon-xs);
992
+ --bw-control-gap: var(--bw-size-control-gap-xs);
993
+ --bw-control-font-size: var(--bw-font-size-xs);
994
+ }
995
+ .bw-radio--size-sm {
996
+ --bw-control-height: var(--bw-size-control-height-sm);
997
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-sm);
998
+ --bw-control-icon-size: var(--bw-size-control-icon-sm);
999
+ --bw-control-gap: var(--bw-size-control-gap-sm);
1000
+ --bw-control-font-size: var(--bw-font-size-sm);
1001
+ }
1002
+ .bw-radio--size-md {
1003
+ --bw-control-height: var(--bw-size-control-height-md);
1004
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
1005
+ --bw-control-icon-size: var(--bw-size-control-icon-md);
1006
+ --bw-control-gap: var(--bw-size-control-gap-md);
1007
+ --bw-control-font-size: var(--bw-font-size-md);
1008
+ }
1009
+ .bw-radio--size-lg {
1010
+ --bw-control-height: var(--bw-size-control-height-lg);
1011
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-lg);
1012
+ --bw-control-icon-size: var(--bw-size-control-icon-lg);
1013
+ --bw-control-gap: var(--bw-size-control-gap-lg);
1014
+ --bw-control-font-size: var(--bw-font-size-lg);
1015
+ }
1016
+ .bw-radio--size-xl {
1017
+ --bw-control-height: var(--bw-size-control-height-xl);
1018
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-xl);
1019
+ --bw-control-icon-size: var(--bw-size-control-icon-xl);
1020
+ --bw-control-gap: var(--bw-size-control-gap-xl);
1021
+ --bw-control-font-size: var(--bw-font-size-xl);
1022
+ }
1023
+ input.bw-radio {
1024
+ appearance: none;
1025
+ display: inline-grid;
1026
+ place-content: center;
1027
+ inline-size: var(--bw-control-height);
1028
+ block-size: var(--bw-control-height);
1029
+ flex-shrink: 0;
1030
+ margin: 0;
1031
+ margin-inline-end: var(--bw-control-gap);
1032
+ vertical-align: middle;
1033
+ border: var(--bw-size-border-hairline) solid var(--bw-color-border-control);
1034
+ border-radius: var(--bw-radius-full);
1035
+ background: var(--bw-color-surface);
1036
+ transition: var(--bw-transition-colors);
1037
+ }
1038
+
1039
+ /* Shared hover pre-light, the input's own mix (constant documented there). */
1040
+ input.bw-checkbox:hover:where(:not(:disabled):not(:checked):not(:indeterminate)),
1041
+ input.bw-radio:hover:where(:not(:disabled):not(:checked)) {
1042
+ border-color: color-mix(in oklab, var(--bw-color-border-control) 82%, var(--bw-color-fg));
1043
+ }
1044
+ /* Checked / indeterminate: solid accent fill (measured 5.11:1 light /
1045
+ * 7.14:1 dark against the surface, the 1.4.11 state boundary). */
1046
+ input.bw-checkbox:checked,
1047
+ input.bw-checkbox:indeterminate,
1048
+ input.bw-radio:checked {
1049
+ border-color: var(--bw-color-accent);
1050
+ background-color: var(--bw-color-accent);
1051
+ }
1052
+ /* The tick: --bw-component-checkbox-glyph is a colour-free alpha shape
1053
+ * consumed as a mask and PAINTED with fg-on-accent, so the glyph ink flips
1054
+ * with the theme. Glyph size follows --bw-control-icon-size. No entrance
1055
+ * animation: the fill change is feedback enough. */
1056
+ input.bw-checkbox:checked::before {
1057
+ content: "";
1058
+ inline-size: var(--bw-control-icon-size);
1059
+ block-size: var(--bw-control-icon-size);
1060
+ background-color: var(--bw-color-fg-on-accent);
1061
+ mask-image: var(--bw-component-checkbox-glyph);
1062
+ mask-repeat: no-repeat;
1063
+ mask-size: 100% 100%;
1064
+ }
1065
+ /* Indeterminate dash: a centred bar painted with fg-on-accent (data-table
1066
+ * select-all partial state). Width follows the icon role; thickness is the
1067
+ * hairline border token so no parallel rem table appears. */
1068
+ input.bw-checkbox:indeterminate::before {
1069
+ content: "";
1070
+ inline-size: var(--bw-control-icon-size);
1071
+ block-size: var(--bw-size-border-hairline);
1072
+ background-color: var(--bw-color-fg-on-accent);
1073
+ border-radius: var(--bw-radius-full);
1074
+ box-shadow: 0 0 0 var(--bw-size-border-hairline) var(--bw-color-fg-on-accent);
632
1075
  }
633
- /* The radio dot uses the border-width trick, the cleanest cross-browser
634
- * drawing: the accent border thickens and the background becomes the dot
635
- * (the same theme-correct ink pair as the tick). No pseudo-element, no
636
- * image; box-sizing: border-box keeps the geometry fixed so nothing shifts
637
- * on check. Border width scaled with the 18px->24px box (#208) to keep the
638
- * same ~duplicate dot-to-box proportion as before. */
1076
+ /* The radio dot uses the border-width trick: accent border thickens and the
1077
+ * background becomes the dot. Width is 0.278 of the box (5/18 of the original
1078
+ * 18px control), so the dot keeps its proportion at every step (RAD-013). */
639
1079
  input.bw-radio:checked {
640
- border-width: 0.4167rem; /* ~6.7px: 5px was 5/18 of the old box; keeps the same ratio at 24px */
1080
+ border-width: calc(var(--bw-control-height) * 0.278);
641
1081
  background-color: var(--bw-color-fg-on-accent);
642
1082
  }
643
1083
  input.bw-checkbox:disabled,
@@ -646,17 +1086,31 @@ input.bw-radio:disabled {
646
1086
  background: var(--bw-color-action-disabled-bg);
647
1087
  cursor: not-allowed;
648
1088
  }
649
- input.bw-checkbox:disabled:checked {
1089
+ input.bw-checkbox:disabled:checked,
1090
+ input.bw-checkbox:disabled:indeterminate {
650
1091
  border-color: var(--bw-color-action-disabled-border);
651
1092
  background-color: var(--bw-color-action-disabled-text);
652
1093
  }
653
- input.bw-checkbox:disabled:checked::before {
1094
+ input.bw-checkbox:disabled:checked::before,
1095
+ input.bw-checkbox:disabled:indeterminate::before {
654
1096
  background-color: var(--bw-color-action-disabled-bg);
1097
+ box-shadow: none;
655
1098
  }
656
1099
  input.bw-radio:disabled:checked {
657
1100
  border-color: var(--bw-color-action-disabled-text);
658
1101
  background-color: var(--bw-color-action-disabled-bg);
659
1102
  }
1103
+ /* Invalid: Field chrome or aria-invalid paints a danger border (CBX-034). */
1104
+ .bw-field--invalid input.bw-checkbox,
1105
+ input.bw-checkbox[aria-invalid="true"] {
1106
+ border-color: var(--bw-color-danger);
1107
+ }
1108
+ /* Invalid (RAD-034): danger ring on unchecked, enabled radios of an invalid
1109
+ * group only. A checked radio keeps its accent ring; disabled keeps disabled. */
1110
+ .bw-field--invalid input.bw-radio:where(:not(:checked):not(:disabled)),
1111
+ input.bw-radio[aria-invalid="true"]:where(:not(:checked):not(:disabled)) {
1112
+ border-color: var(--bw-color-danger);
1113
+ }
660
1114
 
661
1115
  /* --- Toggle switch (0.13.0, BR-BW-INPUT-001, brickwork#57) ------------------ */
662
1116
 
@@ -755,31 +1209,544 @@ input.bw-toggle:checked::before {
755
1209
  input.bw-toggle:disabled {
756
1210
  cursor: not-allowed;
757
1211
  }
758
- input.bw-toggle:disabled::after {
759
- border-color: var(--bw-color-action-disabled-border);
760
- background: var(--bw-color-action-disabled-bg);
1212
+ input.bw-toggle:disabled::after {
1213
+ border-color: var(--bw-color-action-disabled-border);
1214
+ background: var(--bw-color-action-disabled-bg);
1215
+ }
1216
+ input.bw-toggle:disabled:checked::after {
1217
+ border-color: var(--bw-color-action-disabled-border);
1218
+ background: var(--bw-color-action-disabled-text);
1219
+ }
1220
+ input.bw-toggle:disabled::before {
1221
+ box-shadow: none;
1222
+ }
1223
+ @media (prefers-reduced-motion: reduce) {
1224
+ input.bw-toggle::before {
1225
+ transition: none;
1226
+ }
1227
+ }
1228
+ .bw-toggle-field {
1229
+ display: inline-flex;
1230
+ align-items: center;
1231
+ cursor: pointer;
1232
+ }
1233
+ .bw-toggle-field__label {
1234
+ font-size: var(--bw-text-label-size);
1235
+ font-weight: var(--bw-text-label-weight);
1236
+ line-height: var(--bw-text-label-line-height);
1237
+ }
1238
+
1239
+ /* --- Switch (docs/components/switch.md, R07 / C06) --------------------------- */
1240
+
1241
+ /* .bw-switch is the canonical switch (SW-001): a span root holding a native
1242
+ * <input type="checkbox" role="switch">, then a decorative track and thumb.
1243
+ * input.bw-toggle above is the retained Django alias (GAP-SW-1), left as it
1244
+ * is until the lockstep that moves Django onto this block.
1245
+ *
1246
+ * The block reads the role variables only (SW-010). Size classes re-point all
1247
+ * five, same grammar as .bw-input--size-* and .bw-btn--size-* (ADR-125); the
1248
+ * switch itself needs --bw-control-height, which carries both the density and
1249
+ * the step. The track is half that height, the proportion the toggle tokens
1250
+ * draw at the comfortable md step (2.5rem control, 1.25rem track, 0.875rem
1251
+ * thumb, 2.25rem track width), so md is exactly the toggle geometry and every
1252
+ * other density and step scales with it. The floor is the toggle thumb token,
1253
+ * so a compact xs track never collapses. The ratios 1.8 (width), 0.7 (thumb)
1254
+ * and 0.2 (inset) are the toggle tokens' own proportions, kept as unitless
1255
+ * multipliers of the track height so the shape stays recognisably a switch at
1256
+ * every step. The --bw-switch-* names are private to this block (the same
1257
+ * convention as --bw-combobox-chip-size), not tokens.
1258
+ *
1259
+ * Hit area (WCAG 2.5.8, SW-052): the root is never shorter than 1.5rem; the
1260
+ * invisible input fills the whole root, so the target is the root, not the
1261
+ * drawn track. Track and thumb take no pointer events, so a click anywhere on
1262
+ * the switch reaches the input. */
1263
+ .bw-switch--size-xs {
1264
+ --bw-control-height: var(--bw-size-control-height-xs);
1265
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-xs);
1266
+ --bw-control-icon-size: var(--bw-size-control-icon-xs);
1267
+ --bw-control-gap: var(--bw-size-control-gap-xs);
1268
+ --bw-control-font-size: var(--bw-font-size-xs);
1269
+ }
1270
+ .bw-switch--size-sm {
1271
+ --bw-control-height: var(--bw-size-control-height-sm);
1272
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-sm);
1273
+ --bw-control-icon-size: var(--bw-size-control-icon-sm);
1274
+ --bw-control-gap: var(--bw-size-control-gap-sm);
1275
+ --bw-control-font-size: var(--bw-font-size-sm);
1276
+ }
1277
+ .bw-switch--size-md {
1278
+ --bw-control-height: var(--bw-size-control-height-md);
1279
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
1280
+ --bw-control-icon-size: var(--bw-size-control-icon-md);
1281
+ --bw-control-gap: var(--bw-size-control-gap-md);
1282
+ --bw-control-font-size: var(--bw-font-size-md);
1283
+ }
1284
+ .bw-switch--size-lg {
1285
+ --bw-control-height: var(--bw-size-control-height-lg);
1286
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-lg);
1287
+ --bw-control-icon-size: var(--bw-size-control-icon-lg);
1288
+ --bw-control-gap: var(--bw-size-control-gap-lg);
1289
+ --bw-control-font-size: var(--bw-font-size-lg);
1290
+ }
1291
+ .bw-switch--size-xl {
1292
+ --bw-control-height: var(--bw-size-control-height-xl);
1293
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-xl);
1294
+ --bw-control-icon-size: var(--bw-size-control-icon-xl);
1295
+ --bw-control-gap: var(--bw-size-control-gap-xl);
1296
+ --bw-control-font-size: var(--bw-font-size-xl);
1297
+ }
1298
+ .bw-switch {
1299
+ --bw-switch-track-block: max(
1300
+ var(--bw-component-toggle-thumb-size),
1301
+ calc(var(--bw-control-height) / 2)
1302
+ );
1303
+ --bw-switch-track-inline: calc(var(--bw-switch-track-block) * 1.8);
1304
+ --bw-switch-thumb: calc(var(--bw-switch-track-block) * 0.7);
1305
+ --bw-switch-inset: calc(var(--bw-switch-track-block) * 0.2);
1306
+ --bw-switch-travel: calc(
1307
+ var(--bw-switch-track-inline) - var(--bw-switch-thumb) - (var(--bw-switch-inset) * 2)
1308
+ );
1309
+ position: relative;
1310
+ display: inline-flex;
1311
+ align-items: center;
1312
+ flex-shrink: 0;
1313
+ vertical-align: middle;
1314
+ inline-size: var(--bw-switch-track-inline);
1315
+ block-size: max(1.5rem, var(--bw-switch-track-block));
1316
+ }
1317
+ /* The native input is the control (SW-002): it keeps the checkbox semantics,
1318
+ * form value, keyboard and label wiring, and is drawn invisibly over the whole
1319
+ * root. */
1320
+ .bw-switch > input {
1321
+ position: absolute;
1322
+ inset: 0;
1323
+ inline-size: 100%;
1324
+ block-size: 100%;
1325
+ margin: 0;
1326
+ opacity: 0;
1327
+ cursor: pointer;
1328
+ }
1329
+ .bw-switch__track {
1330
+ box-sizing: border-box;
1331
+ inline-size: 100%;
1332
+ block-size: var(--bw-switch-track-block);
1333
+ border: var(--bw-size-border-hairline) solid var(--bw-color-border-control);
1334
+ border-radius: var(--bw-radius-full);
1335
+ background: var(--bw-color-surface-sunken);
1336
+ pointer-events: none;
1337
+ transition: var(--bw-transition-colors);
1338
+ }
1339
+ .bw-switch__thumb {
1340
+ position: absolute;
1341
+ inset-block-start: 50%;
1342
+ inset-inline-start: var(--bw-switch-inset);
1343
+ inline-size: var(--bw-switch-thumb);
1344
+ block-size: var(--bw-switch-thumb);
1345
+ border-radius: var(--bw-radius-full);
1346
+ background: var(--bw-color-surface);
1347
+ box-shadow: var(--bw-elevation-1);
1348
+ pointer-events: none;
1349
+ transform: translate(var(--bw-switch-offset, 0), -50%);
1350
+ transition: var(--bw-transition-transform);
1351
+ }
1352
+ /* Hover pre-light: the border moves one step toward ink, the same 82/18 mix as
1353
+ * the input and the checkbox. :where() keeps the guards at zero specificity so
1354
+ * the checked and disabled rules below still win. */
1355
+ .bw-switch > input:hover:where(:not(:disabled):not(:checked)) ~ .bw-switch__track {
1356
+ border-color: color-mix(in oklab, var(--bw-color-border-control) 82%, var(--bw-color-fg));
1357
+ }
1358
+ /* Checked: accent track (the 1.4.11 state boundary) and the thumb travels to
1359
+ * the inline end. The offset is a signed custom property so the transform and
1360
+ * the RTL flip share one declaration; direction is read from [dir], the same
1361
+ * mechanism as .bw-icon-directional. */
1362
+ .bw-switch > input:checked ~ .bw-switch__track {
1363
+ border-color: var(--bw-color-accent);
1364
+ background: var(--bw-color-accent);
1365
+ }
1366
+ .bw-switch > input:checked ~ .bw-switch__thumb {
1367
+ --bw-switch-offset: var(--bw-switch-travel);
1368
+ }
1369
+ [dir="rtl"] .bw-switch > input:checked ~ .bw-switch__thumb {
1370
+ --bw-switch-offset: calc(var(--bw-switch-travel) * -1);
1371
+ }
1372
+ .bw-switch > input:hover:where(:not(:disabled)):checked ~ .bw-switch__track {
1373
+ border-color: var(--bw-color-accent-hover);
1374
+ background: var(--bw-color-accent-hover);
1375
+ }
1376
+ /* Focus: the global ring is drawn on the invisible input and so cannot be
1377
+ * seen; the same ring (token, width, offset) is drawn on the track. */
1378
+ .bw-switch > input:focus-visible ~ .bw-switch__track {
1379
+ outline: 2px solid var(--bw-color-focus-ring, var(--bw-color-accent));
1380
+ outline-offset: 2px;
1381
+ }
1382
+ .bw-switch > input:disabled {
1383
+ cursor: not-allowed;
1384
+ }
1385
+ .bw-switch > input:disabled ~ .bw-switch__track {
1386
+ border-color: var(--bw-color-action-disabled-border);
1387
+ background: var(--bw-color-action-disabled-bg);
1388
+ }
1389
+ .bw-switch > input:disabled:checked ~ .bw-switch__track {
1390
+ border-color: var(--bw-color-action-disabled-border);
1391
+ background: var(--bw-color-action-disabled-text);
1392
+ }
1393
+ .bw-switch > input:disabled ~ .bw-switch__thumb {
1394
+ box-shadow: none;
1395
+ }
1396
+ @media (prefers-reduced-motion: reduce) {
1397
+ .bw-switch__track,
1398
+ .bw-switch__thumb {
1399
+ transition: none;
1400
+ }
1401
+ }
1402
+
1403
+
1404
+ /* --- Slider (docs/components/slider.md, R49 / C18) --------------------------- */
1405
+
1406
+ /* .bw-slider is a span root holding a native <input type="range"> (SLD-001,
1407
+ * SLD-002). The block reads the role variables only (SLD-010). Size classes
1408
+ * re-point all five, same grammar as .bw-input--size-* (ADR-125). Track block
1409
+ * size is 0.2 x control height; thumb diameter is 0.5 x control height
1410
+ * (SLD-011). The fill is --bw-slider-percent (0-100), Progress convention
1411
+ * (SLD-017). --bw-slider-* geometry names are private to this block.
1412
+ *
1413
+ * Hit area (WCAG 2.5.8, SLD-052): the root is never shorter than 1.5rem; the
1414
+ * range input fills the root. */
1415
+ .bw-slider--size-xs {
1416
+ --bw-control-height: var(--bw-size-control-height-xs);
1417
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-xs);
1418
+ --bw-control-icon-size: var(--bw-size-control-icon-xs);
1419
+ --bw-control-gap: var(--bw-size-control-gap-xs);
1420
+ --bw-control-font-size: var(--bw-font-size-xs);
1421
+ }
1422
+ .bw-slider--size-sm {
1423
+ --bw-control-height: var(--bw-size-control-height-sm);
1424
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-sm);
1425
+ --bw-control-icon-size: var(--bw-size-control-icon-sm);
1426
+ --bw-control-gap: var(--bw-size-control-gap-sm);
1427
+ --bw-control-font-size: var(--bw-font-size-sm);
1428
+ }
1429
+ .bw-slider--size-md {
1430
+ --bw-control-height: var(--bw-size-control-height-md);
1431
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
1432
+ --bw-control-icon-size: var(--bw-size-control-icon-md);
1433
+ --bw-control-gap: var(--bw-size-control-gap-md);
1434
+ --bw-control-font-size: var(--bw-font-size-md);
1435
+ }
1436
+ .bw-slider--size-lg {
1437
+ --bw-control-height: var(--bw-size-control-height-lg);
1438
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-lg);
1439
+ --bw-control-icon-size: var(--bw-size-control-icon-lg);
1440
+ --bw-control-gap: var(--bw-size-control-gap-lg);
1441
+ --bw-control-font-size: var(--bw-font-size-lg);
1442
+ }
1443
+ .bw-slider--size-xl {
1444
+ --bw-control-height: var(--bw-size-control-height-xl);
1445
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-xl);
1446
+ --bw-control-icon-size: var(--bw-size-control-icon-xl);
1447
+ --bw-control-gap: var(--bw-size-control-gap-xl);
1448
+ --bw-control-font-size: var(--bw-font-size-xl);
1449
+ }
1450
+ .bw-slider {
1451
+ --bw-slider-track-block: calc(var(--bw-control-height) * 0.2);
1452
+ --bw-slider-thumb: calc(var(--bw-control-height) * 0.5);
1453
+ --bw-slider-percent: 0;
1454
+ --bw-slider-fill-dir: right;
1455
+ position: relative;
1456
+ display: block;
1457
+ inline-size: 100%;
1458
+ block-size: max(1.5rem, var(--bw-slider-thumb));
1459
+ }
1460
+ [dir="rtl"] .bw-slider {
1461
+ --bw-slider-fill-dir: left;
1462
+ }
1463
+ .bw-slider__input {
1464
+ -webkit-appearance: none;
1465
+ appearance: none;
1466
+ display: block;
1467
+ inline-size: 100%;
1468
+ block-size: 100%;
1469
+ margin: 0;
1470
+ padding: 0;
1471
+ background: transparent;
1472
+ cursor: pointer;
1473
+ vertical-align: middle;
1474
+ }
1475
+ .bw-slider__input:disabled {
1476
+ cursor: not-allowed;
1477
+ }
1478
+ .bw-slider__input::-webkit-slider-runnable-track {
1479
+ box-sizing: border-box;
1480
+ inline-size: 100%;
1481
+ block-size: var(--bw-slider-track-block);
1482
+ border: var(--bw-size-border-hairline) solid var(--bw-color-border-control);
1483
+ border-radius: var(--bw-radius-full);
1484
+ background: linear-gradient(
1485
+ to var(--bw-slider-fill-dir),
1486
+ var(--bw-color-accent) 0%,
1487
+ var(--bw-color-accent) calc(var(--bw-slider-percent, 0) * 1%),
1488
+ var(--bw-color-surface-sunken) calc(var(--bw-slider-percent, 0) * 1%),
1489
+ var(--bw-color-surface-sunken) 100%
1490
+ );
1491
+ transition: var(--bw-transition-colors);
1492
+ }
1493
+ .bw-slider__input::-webkit-slider-thumb {
1494
+ -webkit-appearance: none;
1495
+ appearance: none;
1496
+ box-sizing: border-box;
1497
+ inline-size: var(--bw-slider-thumb);
1498
+ block-size: var(--bw-slider-thumb);
1499
+ margin-block-start: calc((var(--bw-slider-track-block) - var(--bw-slider-thumb)) / 2);
1500
+ border: var(--bw-size-border-hairline) solid var(--bw-color-border-control);
1501
+ border-radius: var(--bw-radius-full);
1502
+ background: var(--bw-color-surface);
1503
+ box-shadow: var(--bw-elevation-1);
1504
+ transition: var(--bw-transition-colors);
1505
+ }
1506
+ .bw-slider__input::-moz-range-track {
1507
+ box-sizing: border-box;
1508
+ inline-size: 100%;
1509
+ block-size: var(--bw-slider-track-block);
1510
+ border: var(--bw-size-border-hairline) solid var(--bw-color-border-control);
1511
+ border-radius: var(--bw-radius-full);
1512
+ background: var(--bw-color-surface-sunken);
1513
+ transition: var(--bw-transition-colors);
1514
+ }
1515
+ .bw-slider__input::-moz-range-progress {
1516
+ block-size: var(--bw-slider-track-block);
1517
+ border-radius: var(--bw-radius-full);
1518
+ background: var(--bw-color-accent);
1519
+ transition: var(--bw-transition-colors);
1520
+ }
1521
+ .bw-slider__input::-moz-range-thumb {
1522
+ box-sizing: border-box;
1523
+ inline-size: var(--bw-slider-thumb);
1524
+ block-size: var(--bw-slider-thumb);
1525
+ border: var(--bw-size-border-hairline) solid var(--bw-color-border-control);
1526
+ border-radius: var(--bw-radius-full);
1527
+ background: var(--bw-color-surface);
1528
+ box-shadow: var(--bw-elevation-1);
1529
+ transition: var(--bw-transition-colors);
1530
+ }
1531
+ .bw-slider__input:hover:where(:not(:disabled))::-webkit-slider-runnable-track {
1532
+ background: linear-gradient(
1533
+ to var(--bw-slider-fill-dir),
1534
+ var(--bw-color-accent-hover) 0%,
1535
+ var(--bw-color-accent-hover) calc(var(--bw-slider-percent, 0) * 1%),
1536
+ var(--bw-color-surface-sunken) calc(var(--bw-slider-percent, 0) * 1%),
1537
+ var(--bw-color-surface-sunken) 100%
1538
+ );
1539
+ }
1540
+ .bw-slider__input:hover:where(:not(:disabled))::-webkit-slider-thumb {
1541
+ border-color: color-mix(in oklab, var(--bw-color-border-control) 82%, var(--bw-color-fg));
1542
+ }
1543
+ .bw-slider__input:hover:where(:not(:disabled))::-moz-range-progress {
1544
+ background: var(--bw-color-accent-hover);
1545
+ }
1546
+ .bw-slider__input:hover:where(:not(:disabled))::-moz-range-thumb {
1547
+ border-color: color-mix(in oklab, var(--bw-color-border-control) 82%, var(--bw-color-fg));
1548
+ }
1549
+ .bw-slider__input:focus-visible::-webkit-slider-thumb {
1550
+ outline: 2px solid var(--bw-color-focus-ring, var(--bw-color-accent));
1551
+ outline-offset: 2px;
1552
+ }
1553
+ .bw-slider__input:focus-visible::-moz-range-thumb {
1554
+ outline: 2px solid var(--bw-color-focus-ring, var(--bw-color-accent));
1555
+ outline-offset: 2px;
1556
+ }
1557
+ .bw-slider__input:disabled::-webkit-slider-runnable-track {
1558
+ border-color: var(--bw-color-action-disabled-border);
1559
+ background: linear-gradient(
1560
+ to var(--bw-slider-fill-dir),
1561
+ var(--bw-color-action-disabled-text) 0%,
1562
+ var(--bw-color-action-disabled-text) calc(var(--bw-slider-percent, 0) * 1%),
1563
+ var(--bw-color-action-disabled-bg) calc(var(--bw-slider-percent, 0) * 1%),
1564
+ var(--bw-color-action-disabled-bg) 100%
1565
+ );
1566
+ }
1567
+ .bw-slider__input:disabled::-webkit-slider-thumb {
1568
+ border-color: var(--bw-color-action-disabled-border);
1569
+ background: var(--bw-color-action-disabled-bg);
1570
+ box-shadow: none;
1571
+ }
1572
+ .bw-slider__input:disabled::-moz-range-track {
1573
+ border-color: var(--bw-color-action-disabled-border);
1574
+ background: var(--bw-color-action-disabled-bg);
1575
+ }
1576
+ .bw-slider__input:disabled::-moz-range-progress {
1577
+ background: var(--bw-color-action-disabled-text);
1578
+ }
1579
+ .bw-slider__input:disabled::-moz-range-thumb {
1580
+ border-color: var(--bw-color-action-disabled-border);
1581
+ background: var(--bw-color-action-disabled-bg);
1582
+ box-shadow: none;
1583
+ }
1584
+ .bw-field--invalid .bw-slider__input:where(:not(:disabled))::-webkit-slider-runnable-track,
1585
+ .bw-slider__input[aria-invalid="true"]:where(:not(:disabled))::-webkit-slider-runnable-track {
1586
+ border-color: var(--bw-color-danger);
1587
+ }
1588
+ .bw-field--invalid .bw-slider__input:where(:not(:disabled))::-moz-range-track,
1589
+ .bw-slider__input[aria-invalid="true"]:where(:not(:disabled))::-moz-range-track {
1590
+ border-color: var(--bw-color-danger);
1591
+ }
1592
+ .bw-field--invalid .bw-slider__input:hover:where(:not(:disabled))::-webkit-slider-runnable-track,
1593
+ .bw-slider__input[aria-invalid="true"]:hover:where(:not(:disabled))::-webkit-slider-runnable-track {
1594
+ border-color: var(--bw-color-danger);
1595
+ }
1596
+ .bw-field--invalid .bw-slider__input:hover:where(:not(:disabled))::-moz-range-track,
1597
+ .bw-slider__input[aria-invalid="true"]:hover:where(:not(:disabled))::-moz-range-track {
1598
+ border-color: var(--bw-color-danger);
1599
+ }
1600
+ @media (prefers-reduced-motion: reduce) {
1601
+ .bw-slider__input::-webkit-slider-runnable-track,
1602
+ .bw-slider__input::-webkit-slider-thumb,
1603
+ .bw-slider__input::-moz-range-track,
1604
+ .bw-slider__input::-moz-range-progress,
1605
+ .bw-slider__input::-moz-range-thumb {
1606
+ transition: none;
1607
+ }
1608
+ }
1609
+
1610
+ /* --- Copy button (docs/components/copy-button.md, R51 / C20) ---------------- */
1611
+
1612
+ /* First build of the missing copy-to-clipboard control. Ghost chrome, five
1613
+ * ADR-125 size steps via the control role variables only (CPY-010). Icon-only
1614
+ * is square at --bw-control-height; a labelled control keeps inline padding.
1615
+ * Colour is tokens only (CPY-012). */
1616
+ .bw-copy {
1617
+ /* Bare host is md: role variables default to the md step tokens so HTML
1618
+ * without a size class still has geometry (CPY-002). */
1619
+ --bw-control-height: var(--bw-size-control-height-md);
1620
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
1621
+ --bw-control-icon-size: var(--bw-size-control-icon-md);
1622
+ --bw-control-gap: var(--bw-size-control-gap-md);
1623
+ --bw-control-font-size: var(--bw-font-size-md);
1624
+ position: relative;
1625
+ display: inline-flex;
1626
+ align-items: center;
1627
+ justify-content: center;
1628
+ gap: var(--bw-control-gap);
1629
+ box-sizing: border-box;
1630
+ block-size: max(1.5rem, var(--bw-control-height));
1631
+ inline-size: max(1.5rem, var(--bw-control-height));
1632
+ padding-block: 0;
1633
+ padding-inline: 0;
1634
+ border: var(--bw-size-border-hairline) solid transparent;
1635
+ border-radius: var(--bw-component-button-radius);
1636
+ background: transparent;
1637
+ color: var(--bw-color-fg-muted);
1638
+ font: inherit;
1639
+ font-family: var(--bw-text-label-family);
1640
+ font-size: var(--bw-control-font-size);
1641
+ font-weight: var(--bw-text-label-weight);
1642
+ line-height: var(--bw-text-label-line-height);
1643
+ letter-spacing: var(--bw-text-label-tracking);
1644
+ white-space: nowrap;
1645
+ cursor: pointer;
1646
+ transition: var(--bw-transition-colors);
1647
+ }
1648
+ .bw-copy:has(.bw-copy__label) {
1649
+ inline-size: auto;
1650
+ padding-inline: var(--bw-control-padding-inline);
1651
+ }
1652
+ .bw-copy:hover:where(:not(:disabled)) {
1653
+ background-color: var(--bw-state-hover-overlay);
1654
+ color: var(--bw-color-fg);
1655
+ }
1656
+ .bw-copy:active:where(:not(:disabled)) {
1657
+ background-color: var(--bw-state-active-overlay);
1658
+ }
1659
+ .bw-copy:focus-visible {
1660
+ outline: 2px solid var(--bw-color-focus-ring, var(--bw-color-accent));
1661
+ outline-offset: 2px;
1662
+ }
1663
+ .bw-copy:disabled {
1664
+ background: var(--bw-color-action-disabled-bg);
1665
+ color: var(--bw-color-action-disabled-text);
1666
+ border-color: var(--bw-color-action-disabled-border);
1667
+ cursor: not-allowed;
1668
+ }
1669
+ .bw-copy__icon,
1670
+ .bw-copy__mark {
1671
+ display: inline-flex;
1672
+ align-items: center;
1673
+ justify-content: center;
1674
+ inline-size: var(--bw-control-icon-size);
1675
+ block-size: var(--bw-control-icon-size);
1676
+ color: inherit;
1677
+ flex-shrink: 0;
1678
+ }
1679
+ .bw-copy__icon > svg,
1680
+ .bw-copy__mark > svg {
1681
+ inline-size: 100%;
1682
+ block-size: 100%;
1683
+ fill: none;
1684
+ stroke: currentColor;
1685
+ stroke-width: 1.5;
1686
+ stroke-linecap: round;
1687
+ stroke-linejoin: round;
1688
+ }
1689
+ /* Outcome marks: shape change, not colour alone (CPY-051, CB-06). Idle shows
1690
+ * the consumer icon; copied shows the check; failed shows the cross. */
1691
+ .bw-copy__mark {
1692
+ display: none;
1693
+ }
1694
+ .bw-copy[data-bw-copy-state="copied"],
1695
+ .bw-copy[data-bw-copy-state="failed"] {
1696
+ color: var(--bw-color-fg);
1697
+ }
1698
+ .bw-copy[data-bw-copy-state="copied"] .bw-copy__icon,
1699
+ .bw-copy[data-bw-copy-state="failed"] .bw-copy__icon {
1700
+ display: none;
761
1701
  }
762
- input.bw-toggle:disabled:checked::after {
763
- border-color: var(--bw-color-action-disabled-border);
764
- background: var(--bw-color-action-disabled-text);
1702
+ .bw-copy[data-bw-copy-state="copied"] .bw-copy__mark--done {
1703
+ display: inline-flex;
765
1704
  }
766
- input.bw-toggle:disabled::before {
767
- box-shadow: none;
1705
+ .bw-copy[data-bw-copy-state="failed"] .bw-copy__mark--fail {
1706
+ display: inline-flex;
1707
+ }
1708
+ .bw-copy__label {
1709
+ color: inherit;
768
1710
  }
769
1711
  @media (prefers-reduced-motion: reduce) {
770
- input.bw-toggle::before {
1712
+ .bw-copy {
771
1713
  transition: none;
772
1714
  }
773
1715
  }
774
- .bw-toggle-field {
775
- display: inline-flex;
776
- align-items: center;
777
- cursor: pointer;
1716
+ .bw-copy--size-xs {
1717
+ --bw-control-height: var(--bw-size-control-height-xs);
1718
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-xs);
1719
+ --bw-control-icon-size: var(--bw-size-control-icon-xs);
1720
+ --bw-control-gap: var(--bw-size-control-gap-xs);
1721
+ --bw-control-font-size: var(--bw-font-size-xs);
778
1722
  }
779
- .bw-toggle-field__label {
780
- font-size: var(--bw-text-label-size);
781
- font-weight: var(--bw-text-label-weight);
782
- line-height: var(--bw-text-label-line-height);
1723
+ .bw-copy--size-sm {
1724
+ --bw-control-height: var(--bw-size-control-height-sm);
1725
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-sm);
1726
+ --bw-control-icon-size: var(--bw-size-control-icon-sm);
1727
+ --bw-control-gap: var(--bw-size-control-gap-sm);
1728
+ --bw-control-font-size: var(--bw-font-size-sm);
1729
+ }
1730
+ .bw-copy--size-md {
1731
+ --bw-control-height: var(--bw-size-control-height-md);
1732
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
1733
+ --bw-control-icon-size: var(--bw-size-control-icon-md);
1734
+ --bw-control-gap: var(--bw-size-control-gap-md);
1735
+ --bw-control-font-size: var(--bw-font-size-md);
1736
+ }
1737
+ .bw-copy--size-lg {
1738
+ --bw-control-height: var(--bw-size-control-height-lg);
1739
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-lg);
1740
+ --bw-control-icon-size: var(--bw-size-control-icon-lg);
1741
+ --bw-control-gap: var(--bw-size-control-gap-lg);
1742
+ --bw-control-font-size: var(--bw-font-size-lg);
1743
+ }
1744
+ .bw-copy--size-xl {
1745
+ --bw-control-height: var(--bw-size-control-height-xl);
1746
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-xl);
1747
+ --bw-control-icon-size: var(--bw-size-control-icon-xl);
1748
+ --bw-control-gap: var(--bw-size-control-gap-xl);
1749
+ --bw-control-font-size: var(--bw-font-size-xl);
783
1750
  }
784
1751
 
785
1752
  /* --- Theme switch (icvoss/django-brickwork#117) ----------------------------- */
@@ -997,9 +1964,15 @@ input.bw-toggle:disabled::before {
997
1964
  }
998
1965
  }
999
1966
 
1000
- .bw-field__help {
1967
+ /* Help and hint are one treatment (FLD-003). Django emits .bw-field__help
1968
+ * (BoundField.help_text); React Hint and Free gallery markup emit
1969
+ * .bw-field__hint. Both paint as caption muted. The wave-b divergent
1970
+ * .bw-field__hint (body-sm size, extra margin) is removed. */
1971
+ .bw-field__help,
1972
+ .bw-field__hint {
1001
1973
  margin: 0;
1002
1974
  color: var(--bw-color-fg-muted);
1975
+ font-family: var(--bw-text-caption-family);
1003
1976
  font-size: var(--bw-text-caption-size);
1004
1977
  font-weight: var(--bw-text-caption-weight);
1005
1978
  line-height: var(--bw-text-caption-line-height);
@@ -1012,6 +1985,7 @@ input.bw-toggle:disabled::before {
1012
1985
  /* danger-fg, not raw danger: the smallest text on the form carries the most
1013
1986
  * important message, so it gets the text-duty danger tier (AA at 12px). */
1014
1987
  color: var(--bw-color-danger-fg);
1988
+ font-family: var(--bw-text-caption-family);
1015
1989
  font-size: var(--bw-text-caption-size);
1016
1990
  font-weight: var(--bw-text-caption-weight);
1017
1991
  line-height: var(--bw-text-caption-line-height);
@@ -1058,7 +2032,7 @@ input.bw-toggle:disabled::before {
1058
2032
  * fight (grid: capping a field's width mid-column) the row's own layout, so
1059
2033
  * they are neutralised here and the row takes over spacing/sizing. */
1060
2034
  .bw-form-fields--stacked .bw-field-row {
1061
- margin-block-end: var(--bw-density-stack-gap);
2035
+ margin-block-end: var(--bw-size-gap-md);
1062
2036
  }
1063
2037
  .bw-form-fields--stacked .bw-field-row:last-child {
1064
2038
  margin-block-end: 0;
@@ -1073,7 +2047,7 @@ input.bw-toggle:disabled::before {
1073
2047
  .bw-field-row--grouped {
1074
2048
  display: flex;
1075
2049
  flex-wrap: wrap;
1076
- gap: var(--bw-space-3);
2050
+ gap: var(--bw-size-gap-sm);
1077
2051
  }
1078
2052
  .bw-field-row--grouped .bw-field {
1079
2053
  flex: 1 1 0;
@@ -1091,7 +2065,7 @@ input.bw-toggle:disabled::before {
1091
2065
  .bw-form-fields--grid {
1092
2066
  display: grid;
1093
2067
  grid-template-columns: repeat(var(--bw-form-grid-columns, 2), minmax(0, 1fr));
1094
- gap: var(--bw-density-stack-gap) var(--bw-space-4);
2068
+ gap: var(--bw-size-gap-md) var(--bw-size-gap-md);
1095
2069
  max-inline-size: none;
1096
2070
  }
1097
2071
  .bw-form-fields--grid .bw-field-row {
@@ -1135,7 +2109,14 @@ input.bw-toggle:disabled::before {
1135
2109
  color-mix(in oklab, var(--bw-color-fg) 10%, var(--bw-color-surface-sunken));
1136
2110
  border-radius: var(--bw-radius-lg);
1137
2111
  }
2112
+ /* Title row: h1 and at most one status Badge sit on one wrapping line;
2113
+ * description takes the full inline track beneath (H05 / R59, APP-009). */
1138
2114
  .bw-page-header__titles {
2115
+ display: flex;
2116
+ flex-wrap: wrap;
2117
+ align-items: center;
2118
+ column-gap: var(--bw-space-3);
2119
+ row-gap: var(--bw-space-1);
1139
2120
  flex: 1 1 12rem;
1140
2121
  min-inline-size: 0;
1141
2122
  }
@@ -1155,6 +2136,7 @@ input.bw-toggle:disabled::before {
1155
2136
  letter-spacing: var(--bw-text-heading-xl-tracking);
1156
2137
  }
1157
2138
  .bw-page-header__description {
2139
+ flex: 1 1 100%;
1158
2140
  margin: var(--bw-space-1) 0 0;
1159
2141
  color: var(--bw-color-fg-muted);
1160
2142
  font-size: var(--bw-text-body-md-size);
@@ -1293,40 +2275,26 @@ input.bw-toggle:disabled::before {
1293
2275
  .bw-data-table-wrap {
1294
2276
  overflow-x: auto;
1295
2277
  background: var(--bw-color-surface);
1296
- /* Edge + ambient match zero-kwargs .bw-card so the table reads on white;
1297
- * sunken header, zebra, hover and selected stay on the inner rows. */
1298
2278
  border: var(--bw-size-border-hairline) solid
1299
2279
  color-mix(in oklab, var(--bw-color-fg) 12%, var(--bw-color-surface));
1300
2280
  border-radius: var(--bw-radius-lg);
1301
- box-shadow:
1302
- var(--bw-elevation-1),
1303
- 0 4px 14px -4px oklch(0 0 0 / 0.1);
1304
- /* Wide tables scroll inside the card: thin, border-toned scrollbar so the
1305
- * apparatus stays quieter than the data (decorative chrome). */
2281
+ /* Token-only elevation (CB-16): no raw oklch shadow. */
2282
+ box-shadow: var(--bw-elevation-1);
1306
2283
  scrollbar-width: thin;
1307
2284
  scrollbar-color: var(--bw-color-border) transparent;
1308
- /* Paint containment: without it, an ancestor that still blows out (a
1309
- * consumer's own wrapper, not just the .bw-card/.bw-section-stack fixed
1310
- * above) can let this wrap's overflow paint outside its own box instead of
1311
- * clipping to it, which is what let the wide table drag the PAGE sideways
1312
- * rather than scrolling within its own card (icvoss/django-brickwork#136).
1313
- * contain: paint guarantees this element is the clipping boundary for its
1314
- * own descendants regardless of what an ancestor does. */
1315
2285
  contain: paint;
1316
2286
  }
1317
- /* density="compact" (Beat Phase C): ops/console tables with tighter rows. */
1318
2287
  .bw-data-table-wrap--density-compact .bw-data-table__th,
1319
2288
  .bw-data-table-wrap--density-compact .bw-data-table__td {
1320
2289
  padding-block: var(--bw-space-2);
1321
2290
  padding-inline: var(--bw-space-3);
1322
- font-size: var(--bw-text-body-sm-size);
1323
2291
  }
1324
2292
  .bw-data-table {
1325
2293
  inline-size: 100%;
1326
2294
  border-collapse: collapse;
1327
2295
  }
1328
- /* Column headers speak in the small tracked-uppercase voice so the sunken band
1329
- * reads as column apparatus, not a first data row. */
2296
+ /* APP-001 data-head: 12 px (--bw-font-size-xs), medium, normal tracking.
2297
+ * Named text.data-head lands with F02 / R29; this raise cites the tokens. */
1330
2298
  .bw-data-table__th {
1331
2299
  text-align: start;
1332
2300
  padding: var(--bw-density-row-padding-block) var(--bw-density-row-padding-inline);
@@ -1334,16 +2302,25 @@ input.bw-toggle:disabled::before {
1334
2302
  border-block-end: var(--bw-size-border-hairline) solid var(--bw-color-border-strong);
1335
2303
  color: var(--bw-color-fg-muted);
1336
2304
  font-size: var(--bw-font-size-xs);
1337
- font-weight: var(--bw-font-weight-semibold);
1338
- line-height: var(--bw-text-label-line-height);
1339
- letter-spacing: var(--bw-font-tracking-wide);
1340
- text-transform: uppercase;
2305
+ font-weight: var(--bw-font-weight-medium);
2306
+ line-height: var(--bw-font-line-height-normal);
2307
+ letter-spacing: var(--bw-font-tracking-normal);
2308
+ text-transform: none;
2309
+ }
2310
+ .bw-data-table__caption {
2311
+ caption-side: top;
2312
+ text-align: start;
2313
+ padding: var(--bw-density-row-padding-block) var(--bw-density-row-padding-inline);
2314
+ color: var(--bw-color-fg-muted);
2315
+ font-size: var(--bw-font-size-xs);
2316
+ font-weight: var(--bw-font-weight-medium);
2317
+ }
2318
+ .bw-data-table__footnote {
2319
+ padding: var(--bw-density-row-padding-block) var(--bw-density-row-padding-inline);
2320
+ color: var(--bw-color-fg-muted);
2321
+ font-size: var(--bw-font-size-xs);
2322
+ border-block-start: var(--bw-size-border-hairline) solid var(--bw-color-border);
1341
2323
  }
1342
- /* icvoss/django-brickwork#208: inline-flex with no minimum sized the target
1343
- * to whatever the label's line-height gave it (measured 74x16 at 375px),
1344
- * under the WCAG 2.5.8 floor. min-block-size only: the label text already
1345
- * centres via align-items, so this changes no visual weight, just the
1346
- * clickable/tappable extent above and below the text. */
1347
2324
  .bw-data-table__sort {
1348
2325
  display: inline-flex;
1349
2326
  align-items: center;
@@ -1356,11 +2333,13 @@ input.bw-toggle:disabled::before {
1356
2333
  .bw-data-table__sort:hover {
1357
2334
  color: var(--bw-color-accent);
1358
2335
  }
1359
- /* Idle sort arrows are noise until pointed at: hidden at rest, revealed on
1360
- * hover and (for keyboard users) focus-visible; the affordance also stays in
1361
- * the accessible name. Opacity transition only, so the reduced-motion floor
1362
- * caps it globally. */
2336
+ /* Idle sort chevron: CSS triangle, no letter glyph (CB-14). */
1363
2337
  .bw-data-table__sort-idle {
2338
+ display: inline-block;
2339
+ inline-size: 0;
2340
+ block-size: 0;
2341
+ border-inline: 0.25rem solid transparent;
2342
+ border-block-start: 0.3rem solid currentColor;
1364
2343
  opacity: 0;
1365
2344
  transition: var(--bw-transition-opacity);
1366
2345
  }
@@ -1371,40 +2350,28 @@ input.bw-toggle:disabled::before {
1371
2350
  .bw-data-table__td {
1372
2351
  padding: var(--bw-density-row-padding-block) var(--bw-density-row-padding-inline);
1373
2352
  border-block-end: var(--bw-size-border-hairline) solid var(--bw-color-border);
1374
- font-size: var(--bw-text-body-sm-size);
1375
- line-height: var(--bw-text-body-sm-line-height);
1376
- font-variant-numeric: tabular-nums; /* numeric columns align digit-for-digit */
2353
+ font-size: var(--bw-font-size-xs);
2354
+ line-height: var(--bw-font-line-height-normal);
2355
+ font-variant-numeric: tabular-nums;
2356
+ color: var(--bw-color-fg);
1377
2357
  }
1378
- /* The last row's bottom hairline would double against the card's own border. */
1379
2358
  .bw-data-table__row:last-child > .bw-data-table__td,
1380
2359
  .bw-data-table__row:last-child > .bw-data-table__th--label {
1381
2360
  border-block-end: 0;
1382
2361
  }
1383
- /* Records-variant zebra + hover. Even rows stripe so row 1 stays on the plain
1384
- surface next to the sunken header band. Hover is an overlay image so it
1385
- composes with the stripe rather than replacing it (DESIGN.md 4.6 stacking
1386
- order). The definition variant stays plain: key/value reads better without
1387
- stripes. */
1388
- .bw-data-table:not(.bw-data-table--definition) .bw-data-table__row:nth-child(even) {
2362
+ .bw-data-table:not(.bw-data-table--definition)
2363
+ .bw-data-table__row:where(
2364
+ :not(.bw-data-table__row--group):not(.bw-data-table__row--group-child):not(.bw-data-table__row--totals)
2365
+ ):nth-child(even) {
1389
2366
  background-color: var(--bw-color-surface-sunken);
1390
2367
  }
1391
- /* Selected row (records rows carry the hook): equal specificity to the zebra
1392
- rule, later in source order, so selection beats the stripe; hover still
1393
- layers its overlay image on top. */
1394
2368
  .bw-data-table:not(.bw-data-table--definition) .bw-data-table__row.bw-data-table__row--selected {
1395
2369
  background-color: var(--bw-state-selected-bg);
1396
2370
  }
1397
- .bw-data-table:not(.bw-data-table--definition) .bw-data-table__row:hover {
2371
+ .bw-data-table:not(.bw-data-table--definition) .bw-data-table__row:hover,
2372
+ .bw-data-table:not(.bw-data-table--definition) .bw-data-table__row:focus-within {
1398
2373
  background-image: linear-gradient(var(--bw-state-hover-overlay), var(--bw-state-hover-overlay));
1399
2374
  }
1400
-
1401
- /* A clickable record row (row.url, #10): the row-link fills its cell and
1402
- inherits colour, so the whole first cell is the target and the row reads as
1403
- actionable. The hover already comes from the records-variant row hover.
1404
- min-block-size (#208): the compact density's row padding leaves less than
1405
- 24px of line-height alone, so the row-link's own tap target fell under
1406
- the WCAG 2.5.8 floor there; comfortable/spacious density already clear it
1407
- without this, so the floor is a no-op visual change for them. */
1408
2375
  .bw-data-table__row-link {
1409
2376
  display: block;
1410
2377
  min-block-size: 1.5rem;
@@ -1414,21 +2381,123 @@ input.bw-toggle:disabled::before {
1414
2381
  .bw-data-table__row-link:hover {
1415
2382
  text-decoration: underline;
1416
2383
  }
1417
-
1418
- /* Definition-list mode (#18): a key/value fact table for one entity. The label
1419
- is a row header; give it the muted body-sm treatment (no header background,
1420
- the column is a key, not chrome). The table fills its card; the 1% nowrap
1421
- label column keeps the key column tight so values line up. */
2384
+ .bw-data-table__row--group > .bw-data-table__td,
2385
+ .bw-data-table__row--group > .bw-data-table__th {
2386
+ background: var(--bw-color-surface-sunken);
2387
+ font-weight: var(--bw-font-weight-semibold);
2388
+ }
2389
+ .bw-data-table__group-toggle {
2390
+ display: inline-flex;
2391
+ align-items: center;
2392
+ gap: var(--bw-space-2);
2393
+ min-block-size: 1.5rem;
2394
+ padding: 0;
2395
+ border: 0;
2396
+ background: transparent;
2397
+ color: inherit;
2398
+ font: inherit;
2399
+ cursor: pointer;
2400
+ }
2401
+ .bw-data-table__group-toggle::before {
2402
+ content: "";
2403
+ inline-size: 0;
2404
+ block-size: 0;
2405
+ border-block: 0.25rem solid transparent;
2406
+ border-inline-start: 0.3rem solid currentColor;
2407
+ transition: var(--bw-transition-transform);
2408
+ }
2409
+ .bw-data-table__group-toggle[aria-expanded="true"]::before {
2410
+ transform: rotate(90deg);
2411
+ }
2412
+ .bw-data-table__row--group-child[hidden] {
2413
+ display: none;
2414
+ }
2415
+ .bw-data-table__row--totals > .bw-data-table__td,
2416
+ .bw-data-table__row--totals > .bw-data-table__th {
2417
+ background: color-mix(in oklab, var(--bw-color-accent) 8%, var(--bw-color-surface));
2418
+ font-weight: var(--bw-font-weight-semibold);
2419
+ border-block-start: var(--bw-size-border-hairline) solid var(--bw-color-border-strong);
2420
+ }
2421
+ .bw-data-table__entity {
2422
+ display: inline-flex;
2423
+ align-items: center;
2424
+ gap: var(--bw-space-2);
2425
+ min-inline-size: 0;
2426
+ }
2427
+ .bw-data-table__entity-mark {
2428
+ flex: 0 0 auto;
2429
+ inline-size: var(--bw-space-2);
2430
+ block-size: var(--bw-space-2);
2431
+ border-radius: var(--bw-radius-full);
2432
+ background: var(--bw-color-chart-1);
2433
+ }
2434
+ /* Glyph form (APP-008): short letter mark (1-2 chars). Colour is the text;
2435
+ * the surface stays bordered so colour is never the only cue. Empty marks
2436
+ * keep the swatch treatment above. */
2437
+ .bw-data-table__entity-mark:not(:empty) {
2438
+ display: inline-grid;
2439
+ place-items: center;
2440
+ inline-size: 1.8125rem;
2441
+ block-size: 1.8125rem;
2442
+ border-radius: var(--bw-radius-md);
2443
+ border: var(--bw-size-border-hairline) solid var(--bw-color-border);
2444
+ background: var(--bw-color-surface);
2445
+ color: var(--bw-color-chart-1);
2446
+ font-size: var(--bw-font-size-xs);
2447
+ font-weight: var(--bw-font-weight-bold);
2448
+ line-height: 1;
2449
+ }
2450
+ .bw-data-table__entity-mark--chart-1 { background: var(--bw-color-chart-1); }
2451
+ .bw-data-table__entity-mark--chart-2 { background: var(--bw-color-chart-2); }
2452
+ .bw-data-table__entity-mark--chart-3 { background: var(--bw-color-chart-3); }
2453
+ .bw-data-table__entity-mark--chart-4 { background: var(--bw-color-chart-4); }
2454
+ .bw-data-table__entity-mark--chart-5 { background: var(--bw-color-chart-5); }
2455
+ .bw-data-table__entity-mark--chart-6 { background: var(--bw-color-chart-6); }
2456
+ .bw-data-table__entity-mark--chart-7 { background: var(--bw-color-chart-7); }
2457
+ .bw-data-table__entity-mark--chart-8 { background: var(--bw-color-chart-8); }
2458
+ .bw-data-table__entity-mark--chart-1:not(:empty) { background: var(--bw-color-surface); color: var(--bw-color-chart-1); }
2459
+ .bw-data-table__entity-mark--chart-2:not(:empty) { background: var(--bw-color-surface); color: var(--bw-color-chart-2); }
2460
+ .bw-data-table__entity-mark--chart-3:not(:empty) { background: var(--bw-color-surface); color: var(--bw-color-chart-3); }
2461
+ .bw-data-table__entity-mark--chart-4:not(:empty) { background: var(--bw-color-surface); color: var(--bw-color-chart-4); }
2462
+ .bw-data-table__entity-mark--chart-5:not(:empty) { background: var(--bw-color-surface); color: var(--bw-color-chart-5); }
2463
+ .bw-data-table__entity-mark--chart-6:not(:empty) { background: var(--bw-color-surface); color: var(--bw-color-chart-6); }
2464
+ .bw-data-table__entity-mark--chart-7:not(:empty) { background: var(--bw-color-surface); color: var(--bw-color-chart-7); }
2465
+ .bw-data-table__entity-mark--chart-8:not(:empty) { background: var(--bw-color-surface); color: var(--bw-color-chart-8); }
2466
+ .bw-data-table__entity-text {
2467
+ display: grid;
2468
+ min-inline-size: 0;
2469
+ }
2470
+ .bw-data-table__entity-label {
2471
+ overflow: hidden;
2472
+ text-overflow: ellipsis;
2473
+ white-space: nowrap;
2474
+ }
2475
+ .bw-data-table__entity-subline {
2476
+ color: var(--bw-color-fg-muted);
2477
+ font-size: var(--bw-font-size-xs);
2478
+ }
2479
+ .bw-data-table__delta {
2480
+ display: inline-flex;
2481
+ align-items: center;
2482
+ gap: var(--bw-space-1);
2483
+ }
2484
+ .bw-data-table__na {
2485
+ display: grid;
2486
+ }
2487
+ .bw-data-table__na-label {
2488
+ color: var(--bw-color-fg-muted);
2489
+ font-variant-numeric: normal;
2490
+ }
2491
+ .bw-data-table__na-reason {
2492
+ color: var(--bw-color-fg-muted);
2493
+ font-size: var(--bw-font-size-xs);
2494
+ }
1422
2495
  .bw-data-table--definition {
1423
2496
  inline-size: 100%;
1424
2497
  }
1425
- /* A key/value fact card hugs its facts rather than stretching the workspace.
1426
- Graceful no-op in engines without :has(). */
1427
2498
  .bw-data-table-wrap:has(.bw-data-table--definition) {
1428
2499
  max-inline-size: var(--bw-size-max-width-prose);
1429
2500
  }
1430
- /* The value is the payload: muted-regular key against medium value gives the
1431
- quiet two-rank rhythm. */
1432
2501
  .bw-data-table--definition .bw-data-table__td {
1433
2502
  font-weight: var(--bw-font-weight-medium);
1434
2503
  }
@@ -1440,20 +2509,12 @@ input.bw-toggle:disabled::before {
1440
2509
  padding-inline-end: var(--bw-space-6);
1441
2510
  vertical-align: baseline;
1442
2511
  color: var(--bw-color-fg-muted);
1443
- font-size: var(--bw-text-body-sm-size);
1444
- line-height: var(--bw-text-body-sm-line-height);
1445
- /* Reset the column-header voice: this cell also carries __th, but it is a
1446
- row key, not chrome, so it keeps the plain body-sm treatment. */
1447
- font-weight: var(--bw-text-label-weight);
2512
+ font-size: var(--bw-font-size-xs);
2513
+ line-height: var(--bw-font-line-height-normal);
2514
+ font-weight: var(--bw-font-weight-medium);
1448
2515
  letter-spacing: var(--bw-font-tracking-normal);
1449
2516
  text-transform: none;
1450
2517
  }
1451
-
1452
- /* --- Data table: bulk selection, sticky header, responsive (brickwork#54) -- */
1453
-
1454
- /* The leading checkbox column: 1% width hugs the control (the __th--label
1455
- * inline-size:1% trick reused), centred so it does not drag the header text
1456
- * baseline off the other columns. */
1457
2518
  .bw-data-table__th--select,
1458
2519
  .bw-data-table__td--select {
1459
2520
  inline-size: 1%;
@@ -1461,9 +2522,6 @@ input.bw-toggle:disabled::before {
1461
2522
  text-align: center;
1462
2523
  vertical-align: middle;
1463
2524
  }
1464
- /* Column alignment vocabulary (icvoss/django-brickwork#522): closed set
1465
- * start (default, no modifier) | center | end, applied to both header and
1466
- * body cells from the column dict's align key. */
1467
2525
  .bw-data-table__th--center,
1468
2526
  .bw-data-table__td--center {
1469
2527
  text-align: center;
@@ -1473,14 +2531,6 @@ input.bw-toggle:disabled::before {
1473
2531
  text-align: end;
1474
2532
  font-variant-numeric: tabular-nums;
1475
2533
  }
1476
-
1477
- /* loading=True skeleton (icvoss/django-brickwork#137): without padding of its
1478
- * own the placeholder bars sit flush to the wrap's card border, then jump
1479
- * inward once real rows arrive with their __td/__th row-density padding. Uses
1480
- * the same row-density tokens as the real cells so the loading and loaded
1481
- * states share one inset, and .bw-skeleton-group's own stack-with-gap shape
1482
- * (flex column, --bw-space-2 gap) so the bars read as the same house pattern
1483
- * for stacked skeletons rather than a one-off. */
1484
2534
  .bw-data-table__skeleton {
1485
2535
  display: flex;
1486
2536
  flex-direction: column;
@@ -1488,31 +2538,14 @@ input.bw-toggle:disabled::before {
1488
2538
  padding-block: var(--bw-density-row-padding-block);
1489
2539
  padding-inline: var(--bw-density-row-padding-inline);
1490
2540
  }
1491
-
1492
- /* scroll_container / sticky_header: the wrap keeps its own scroll (unchanged
1493
- * from the plain wrap), the <thead> pins to the top of that scroll region.
1494
- * The header cells need an opaque background of their own (they already
1495
- * carry --bw-color-surface-sunken) so scrolled body rows do not show through
1496
- * underneath the pinned band; the z-index keeps it above the body but below
1497
- * any overlay chrome (the shared --bw-z-sticky token, the same one the
1498
- * shell topbar uses, so a table's sticky head never fights the app chrome
1499
- * for stacking). */
1500
2541
  .bw-data-table-wrap--sticky {
1501
2542
  max-block-size: 100%;
1502
2543
  }
1503
- .bw-data-table-wrap--sticky .bw-data-table__th {
2544
+ .bw-data-table-wrap--sticky thead .bw-data-table__th {
1504
2545
  position: sticky;
1505
2546
  inset-block-start: 0;
1506
2547
  z-index: var(--bw-z-sticky);
1507
2548
  }
1508
-
1509
- /* responsive="stack": below the breakpoint each row becomes a labelled card
1510
- * (data-label per cell, stamped by the template from the column list) and
1511
- * the header row is hidden (the labels replace it). Above the breakpoint
1512
- * this is a no-op: the table renders exactly as the scroll default. The
1513
- * breakpoint matches the shell's own mobile cut (DESIGN.md's sidebar
1514
- * collapse breakpoint), so a table's card mode and the shell's mobile nav
1515
- * change together. */
1516
2549
  @media (width < --theme(--breakpoint-md)) {
1517
2550
  .bw-data-table--stack thead {
1518
2551
  position: absolute;
@@ -1545,19 +2578,14 @@ input.bw-toggle:disabled::before {
1545
2578
  border-block-end: 0;
1546
2579
  text-align: end;
1547
2580
  }
1548
- /* The stamped label reads as the row's own column key, in the same muted
1549
- * voice _data_table.html--definition uses for its row headers, so a
1550
- * stacked card and a definition table share one "key: value" language. */
1551
2581
  .bw-data-table--stack .bw-data-table__td[data-label]::before {
1552
2582
  content: attr(data-label);
1553
2583
  flex: 0 0 auto;
1554
2584
  color: var(--bw-color-fg-muted);
1555
- font-size: var(--bw-text-body-sm-size);
2585
+ font-size: var(--bw-font-size-xs);
1556
2586
  font-weight: var(--bw-font-weight-medium);
1557
2587
  text-align: start;
1558
2588
  }
1559
- /* The select column carries no data-label (it is a control, not a fact);
1560
- * it stays a plain leading row instead of a fake "key: value" pair. */
1561
2589
  .bw-data-table--stack .bw-data-table__td--select {
1562
2590
  justify-content: flex-start;
1563
2591
  }
@@ -2010,7 +3038,7 @@ button.bw-account-menu__item {
2010
3038
  * to point at, so the literal lives inline in the fallback slot. */
2011
3039
  .bw-skeleton--title {
2012
3040
  inline-size: var(--bw-skeleton-w, 40%);
2013
- block-size: var(--bw-skeleton-h, var(--bw-font-size-2xl));
3041
+ block-size: var(--bw-skeleton-h, var(--bw-font-size-3xl));
2014
3042
  margin-block-end: var(--bw-space-2);
2015
3043
  }
2016
3044
  .bw-skeleton--text {
@@ -2019,7 +3047,7 @@ button.bw-account-menu__item {
2019
3047
  }
2020
3048
  .bw-skeleton--row {
2021
3049
  inline-size: var(--bw-skeleton-w, 100%);
2022
- block-size: var(--bw-skeleton-h, var(--bw-density-control-height));
3050
+ block-size: var(--bw-skeleton-h, var(--bw-control-height));
2023
3051
  margin-block-end: var(--bw-space-2);
2024
3052
  }
2025
3053
  /* Filled rectangle (0.12.0, #56): a chart/image placeholder with no natural
@@ -2066,15 +3094,36 @@ button.bw-account-menu__item {
2066
3094
  gap: var(--bw-space-2);
2067
3095
  }
2068
3096
  .bw-progress__track {
3097
+ position: relative;
2069
3098
  flex: 1 1 auto;
2070
3099
  block-size: var(--bw-component-progress-track-height);
2071
3100
  background: var(--bw-color-surface-sunken);
2072
3101
  border-radius: var(--bw-radius-full);
3102
+ /* Default track clips the fill to the trough. When an elapsed/pace marker
3103
+ * is present (APP-010), overflow must be visible so the tick can sit
3104
+ * slightly proud of the track. */
2073
3105
  overflow: hidden;
2074
3106
  /* The track's own visible contrast against the fill is the non-colour
2075
3107
  * signal STA-007 requires: a sunken trough is legible even if the fill
2076
3108
  * hue is indistinguishable to the viewer. */
2077
3109
  }
3110
+ .bw-progress__track:has(> .bw-progress__elapsed) {
3111
+ overflow: visible;
3112
+ }
3113
+ /* Pace marker (APP-010 / R25): a 2px tick at --bw-progress-elapsed (0-100).
3114
+ * Sibling of the fill inside the track. aria-hidden: the progressbar's
3115
+ * accessible name states both used and elapsed. */
3116
+ .bw-progress__elapsed {
3117
+ position: absolute;
3118
+ inset-block-start: -0.2rem;
3119
+ inset-inline-start: calc(var(--bw-progress-elapsed, 0) * 1%);
3120
+ inline-size: 0.125rem;
3121
+ block-size: calc(var(--bw-component-progress-track-height) + 0.4rem);
3122
+ background: var(--bw-color-fg-muted);
3123
+ border-radius: var(--bw-radius-full);
3124
+ transform: translateX(-50%);
3125
+ pointer-events: none;
3126
+ }
2078
3127
  .bw-progress__fill {
2079
3128
  block-size: 100%;
2080
3129
  background: var(--bw-color-accent);
@@ -2088,32 +3137,163 @@ button.bw-account-menu__item {
2088
3137
  width: calc(var(--bw-progress-value, 0) * 1%);
2089
3138
  transition: width var(--bw-duration-normal) var(--bw-ease-standard);
2090
3139
  }
2091
- .bw-progress__value {
2092
- color: var(--bw-color-fg-muted);
2093
- font-size: var(--bw-text-caption-size);
2094
- font-weight: var(--bw-text-caption-weight);
2095
- line-height: var(--bw-text-caption-line-height);
2096
- font-variant-numeric: tabular-nums;
2097
- white-space: nowrap;
3140
+ .bw-progress__value {
3141
+ color: var(--bw-color-fg-muted);
3142
+ font-size: var(--bw-text-caption-size);
3143
+ font-weight: var(--bw-text-caption-weight);
3144
+ line-height: var(--bw-text-caption-line-height);
3145
+ font-variant-numeric: tabular-nums;
3146
+ white-space: nowrap;
3147
+ }
3148
+ /* Indeterminate: a fixed-width segment sweeps the track. Gated behind
3149
+ * no-preference (STA-005); reduced motion falls back to a static partial
3150
+ * fill (below) rather than a frozen mid-sweep segment, so "work is in
3151
+ * progress" still reads without relying on the animation. */
3152
+ .bw-progress__fill--indeterminate {
3153
+ width: 40%;
3154
+ }
3155
+ @media (prefers-reduced-motion: no-preference) {
3156
+ .bw-progress__fill--indeterminate {
3157
+ animation: bw-progress-sweep var(--bw-duration-shimmer) var(--bw-ease-standard) infinite;
3158
+ }
3159
+ }
3160
+ @keyframes bw-progress-sweep {
3161
+ 0% {
3162
+ margin-inline-start: -40%;
3163
+ }
3164
+ 100% {
3165
+ margin-inline-start: 100%;
3166
+ }
3167
+ }
3168
+
3169
+
3170
+
3171
+ /* --- Stat summary strip (APP-010 second tier) ------------------------------- */
3172
+
3173
+ /* Plain supporting metrics under a primary bw-stat-grid. Hairline column
3174
+ * dividers; not a card and not the marketing bw-stat-band. */
3175
+ .bw-stat-summary {
3176
+ display: grid;
3177
+ grid-template-columns: repeat(4, minmax(0, 1fr));
3178
+ margin-block: var(--bw-space-4) var(--bw-space-5);
3179
+ }
3180
+ .bw-stat-summary > * {
3181
+ display: flex;
3182
+ flex-wrap: wrap;
3183
+ align-items: baseline;
3184
+ gap: var(--bw-space-2);
3185
+ padding-inline: var(--bw-space-4);
3186
+ border-inline-end: var(--bw-size-border-hairline) solid var(--bw-color-border);
3187
+ }
3188
+ .bw-stat-summary > *:first-child {
3189
+ padding-inline-start: 0;
3190
+ }
3191
+ .bw-stat-summary > *:last-child {
3192
+ border-inline-end: 0;
3193
+ }
3194
+ .bw-stat-summary__label {
3195
+ color: var(--bw-color-fg-muted);
3196
+ font-size: var(--bw-font-size-xs);
3197
+ }
3198
+ .bw-stat-summary__value {
3199
+ font-size: var(--bw-font-size-sm);
3200
+ font-weight: var(--bw-font-weight-semibold);
3201
+ font-variant-numeric: tabular-nums;
3202
+ color: var(--bw-color-fg);
3203
+ }
3204
+ @media (width < 48rem) {
3205
+ .bw-stat-summary {
3206
+ grid-template-columns: repeat(2, minmax(0, 1fr));
3207
+ row-gap: var(--bw-space-3);
3208
+ }
3209
+ .bw-stat-summary > *:nth-child(2) {
3210
+ border-inline-end: 0;
3211
+ }
3212
+ .bw-stat-summary > *:nth-child(3) {
3213
+ padding-inline-start: 0;
3214
+ }
3215
+ }
3216
+
3217
+ /* --- Reporting window control (APP craft date chip) ------------------------- */
3218
+
3219
+ .bw-window-control {
3220
+ display: inline-flex;
3221
+ align-items: center;
3222
+ gap: var(--bw-space-2);
3223
+ border: var(--bw-size-border-hairline) solid var(--bw-color-border);
3224
+ border-radius: var(--bw-radius-md);
3225
+ background: var(--bw-color-surface);
3226
+ padding: var(--bw-space-2) var(--bw-space-3);
3227
+ color: var(--bw-color-fg);
3228
+ }
3229
+ .bw-window-control__icon {
3230
+ display: inline-flex;
3231
+ color: var(--bw-color-fg-muted);
3232
+ flex-shrink: 0;
3233
+ }
3234
+ .bw-window-control select,
3235
+ .bw-window-control .bw-select {
3236
+ border: 0;
3237
+ background: transparent;
3238
+ color: inherit;
3239
+ font: inherit;
3240
+ font-size: var(--bw-font-size-sm);
3241
+ padding: 0 var(--bw-space-1);
3242
+ max-inline-size: 100%;
3243
+ }
3244
+ .bw-window-control__stack {
3245
+ display: flex;
3246
+ flex-direction: column;
3247
+ align-items: flex-end;
3248
+ gap: var(--bw-space-1);
3249
+ }
3250
+ .bw-window-control__hint {
3251
+ margin: 0;
3252
+ color: var(--bw-color-fg-muted);
3253
+ font-size: var(--bw-font-size-xs);
3254
+ }
3255
+
3256
+ /* --- Insight notes (APP craft under dense tables) --------------------------- */
3257
+
3258
+ .bw-insight-grid {
3259
+ display: grid;
3260
+ grid-template-columns: repeat(3, minmax(0, 1fr));
3261
+ gap: var(--bw-space-4);
3262
+ }
3263
+ .bw-insight {
3264
+ display: flex;
3265
+ align-items: flex-start;
3266
+ gap: var(--bw-space-3);
3267
+ padding: var(--bw-space-3) var(--bw-space-4);
3268
+ border: var(--bw-size-border-hairline) solid var(--bw-color-border);
3269
+ border-radius: var(--bw-radius-md);
3270
+ background: var(--bw-color-surface);
2098
3271
  }
2099
- /* Indeterminate: a fixed-width segment sweeps the track. Gated behind
2100
- * no-preference (STA-005); reduced motion falls back to a static partial
2101
- * fill (below) rather than a frozen mid-sweep segment, so "work is in
2102
- * progress" still reads without relying on the animation. */
2103
- .bw-progress__fill--indeterminate {
2104
- width: 40%;
3272
+ .bw-insight__icon {
3273
+ display: grid;
3274
+ place-items: center;
3275
+ inline-size: 1.7rem;
3276
+ block-size: 1.7rem;
3277
+ border-radius: var(--bw-radius-md);
3278
+ background: color-mix(in oklab, var(--bw-color-accent) 16%, var(--bw-color-surface));
3279
+ color: var(--bw-color-accent);
3280
+ flex-shrink: 0;
2105
3281
  }
2106
- @media (prefers-reduced-motion: no-preference) {
2107
- .bw-progress__fill--indeterminate {
2108
- animation: bw-progress-sweep var(--bw-duration-shimmer) var(--bw-ease-standard) infinite;
2109
- }
3282
+ .bw-insight__title {
3283
+ margin: 0 0 var(--bw-space-1);
3284
+ font-size: var(--bw-font-size-xs);
3285
+ font-weight: var(--bw-font-weight-semibold);
3286
+ color: var(--bw-color-fg);
2110
3287
  }
2111
- @keyframes bw-progress-sweep {
2112
- 0% {
2113
- margin-inline-start: -40%;
2114
- }
2115
- 100% {
2116
- margin-inline-start: 100%;
3288
+ .bw-insight__body {
3289
+ margin: 0;
3290
+ color: var(--bw-color-fg-muted);
3291
+ font-size: var(--bw-font-size-xs);
3292
+ line-height: 1.65;
3293
+ }
3294
+ @media (width < 64rem) {
3295
+ .bw-insight-grid {
3296
+ grid-template-columns: 1fr;
2117
3297
  }
2118
3298
  }
2119
3299
 
@@ -2146,10 +3326,19 @@ button.bw-account-menu__item {
2146
3326
  box-shadow:
2147
3327
  var(--bw-elevation-1),
2148
3328
  0 4px 14px -4px oklch(0 0 0 / 0.1);
2149
- padding: var(--bw-density-card-padding);
2150
- }
2151
- /* Flat-design variant (CMP-015): the hairline carries the boundary alone. */
3329
+ /* The active inset is declared once as a component variable (the same
3330
+ * inline-token mechanism as --bw-component-stat-tile-value-size), so the
3331
+ * padding and every bleed margin below read one value and a size step
3332
+ * cannot leave a bleed region short or long (CRD-012). */
3333
+ --bw-component-card-inset: var(--bw-size-inset-md);
3334
+ padding: var(--bw-size-inset-md);
3335
+ }
3336
+ /* Flat mode (CMP-015, APP-002, CRD-020): the hairline carries the boundary
3337
+ alone. The edge is the app hairline token, not the soft ink-mix edge the
3338
+ elevated default keeps for marketing depth. Opt-in: the default card stays
3339
+ elevation-1 plus ambient. An explicit elevation modifier below still wins. */
2152
3340
  .bw-card--bordered {
3341
+ border-color: var(--bw-color-border);
2153
3342
  box-shadow: var(--bw-elevation-0);
2154
3343
  }
2155
3344
  /* Appearance suite (docs/APPEARANCE.md, #535): CSS-only surface / elevation /
@@ -2204,6 +3393,15 @@ button.bw-account-menu__item {
2204
3393
  var(--bw-elevation-1),
2205
3394
  0 4px 14px -4px oklch(0 0 0 / 0.1);
2206
3395
  }
3396
+ /* Flat mode outranks the recipe and inverse ambient stacks above (two classes
3397
+ against one), and loses to an explicit elevation compound below. */
3398
+ .bw-card--bordered.bw-card--surface-inverse,
3399
+ .bw-card--bordered.bw-card--header-inverse,
3400
+ .bw-card--bordered.bw-card--header-muted,
3401
+ .bw-card--bordered.bw-card--header-accent,
3402
+ .bw-card--bordered.bw-card--media-bleed {
3403
+ box-shadow: var(--bw-elevation-0);
3404
+ }
2207
3405
  .bw-card--surface-inverse.bw-card--elevation-0,
2208
3406
  .bw-card--header-inverse.bw-card--elevation-0,
2209
3407
  .bw-card--header-muted.bw-card--elevation-0,
@@ -2225,16 +3423,21 @@ button.bw-account-menu__item {
2225
3423
  .bw-card--media-bleed.bw-card--elevation-3 {
2226
3424
  box-shadow: var(--bw-elevation-3);
2227
3425
  }
2228
- /* padding arg (04-interfaces): md restates the density default so an explicit
2229
- padding="md" and the bare card always agree. */
3426
+ /* padding arg (04-interfaces), ADR-126 section 5 / SIZE-COVERAGE gate 6: the
3427
+ container inset scale (--bw-size-inset-*, md = --bw-density-card-padding).
3428
+ md restates the default so an explicit padding="md" and the bare card
3429
+ always agree; every step is density-aware (no absolute --bw-space-*). */
2230
3430
  .bw-card--size-sm {
2231
- padding: var(--bw-space-3);
3431
+ --bw-component-card-inset: var(--bw-size-inset-sm);
3432
+ padding: var(--bw-size-inset-sm);
2232
3433
  }
2233
3434
  .bw-card--size-md {
2234
- padding: var(--bw-density-card-padding);
3435
+ --bw-component-card-inset: var(--bw-size-inset-md);
3436
+ padding: var(--bw-size-inset-md);
2235
3437
  }
2236
3438
  .bw-card--size-lg {
2237
- padding: var(--bw-space-6);
3439
+ --bw-component-card-inset: var(--bw-size-inset-lg);
3440
+ padding: var(--bw-size-inset-lg);
2238
3441
  }
2239
3442
  /* Card-as-link (CMP-017): the whole card is an anchor; content keeps its own
2240
3443
  ink and no underline smears across the card. The focus ring comes from the
@@ -2247,17 +3450,39 @@ a.bw-card {
2247
3450
  /* Interactive variant (MOT-010, AC-BW-071): the shadow raises 1 to 2 on
2248
3451
  hover/focus-within, never a transform; elevation 2+ pairs with the raised
2249
3452
  surface in both themes (DESIGN.md 4.1: in light the raised surface equals
2250
- surface, so only the shadow moves; in dark the surface lightens too). */
3453
+ surface, so only the shadow moves; in dark the surface lightens too).
3454
+ Flat cards (CRD-021, APP-002) never gain a shadow on hover: the hairline
3455
+ steps to the strong border and the surface to raised instead. */
2251
3456
  .bw-card--interactive {
2252
3457
  transition: var(--bw-transition-shadow), var(--bw-transition-colors);
2253
3458
  }
2254
- .bw-card--interactive:hover,
2255
- .bw-card--interactive:focus-within {
3459
+ .bw-card--interactive:not(.bw-card--bordered):hover,
3460
+ .bw-card--interactive:not(.bw-card--bordered):focus-within {
2256
3461
  box-shadow:
2257
3462
  var(--bw-elevation-2),
2258
3463
  0 8px 20px -6px oklch(0 0 0 / 0.12);
2259
3464
  background: var(--bw-color-surface-raised);
2260
3465
  }
3466
+ .bw-card--bordered.bw-card--interactive:hover,
3467
+ .bw-card--bordered.bw-card--interactive:focus-within {
3468
+ border-color: var(--bw-color-border-strong);
3469
+ background: var(--bw-color-surface-raised);
3470
+ }
3471
+ /* A tinted, muted or inverse fill keeps its own fill on hover (CRD-022):
3472
+ swapping in the raised surface would leave inverse text on a light fill. */
3473
+ .bw-card--interactive.bw-card--surface-tint:hover,
3474
+ .bw-card--interactive.bw-card--surface-tint:focus-within {
3475
+ background: var(--bw-color-surface-marketing-tint);
3476
+ }
3477
+ .bw-card--interactive.bw-card--surface-muted:hover,
3478
+ .bw-card--interactive.bw-card--surface-muted:focus-within {
3479
+ background: var(--bw-color-surface-sunken);
3480
+ }
3481
+ .bw-card--interactive.bw-card--surface-inverse:hover,
3482
+ .bw-card--interactive.bw-card--surface-inverse:focus-within {
3483
+ background: var(--bw-color-surface-inverse);
3484
+ border-color: transparent;
3485
+ }
2261
3486
  .bw-card__header {
2262
3487
  display: flex;
2263
3488
  align-items: flex-start;
@@ -2274,18 +3499,18 @@ a.bw-card {
2274
3499
  }
2275
3500
  .bw-card__header--muted,
2276
3501
  .bw-card--header-muted .bw-card__header {
2277
- margin: calc(-1 * var(--bw-density-card-padding));
3502
+ margin: calc(-1 * var(--bw-component-card-inset, var(--bw-size-inset-md)));
2278
3503
  margin-block-end: var(--bw-space-3);
2279
- padding: var(--bw-density-card-padding);
3504
+ padding: var(--bw-component-card-inset, var(--bw-size-inset-md));
2280
3505
  background: var(--bw-color-surface-sunken);
2281
3506
  border-start-start-radius: inherit;
2282
3507
  border-start-end-radius: inherit;
2283
3508
  }
2284
3509
  .bw-card__header--inverse,
2285
3510
  .bw-card--header-inverse .bw-card__header {
2286
- margin: calc(-1 * var(--bw-density-card-padding));
3511
+ margin: calc(-1 * var(--bw-component-card-inset, var(--bw-size-inset-md)));
2287
3512
  margin-block-end: var(--bw-space-3);
2288
- padding: var(--bw-density-card-padding);
3513
+ padding: var(--bw-component-card-inset, var(--bw-size-inset-md));
2289
3514
  background: var(--bw-color-surface-inverse);
2290
3515
  color: var(--bw-color-fg-on-inverse);
2291
3516
  border-start-start-radius: inherit;
@@ -2293,9 +3518,9 @@ a.bw-card {
2293
3518
  }
2294
3519
  .bw-card__header--accent,
2295
3520
  .bw-card--header-accent .bw-card__header {
2296
- margin: calc(-1 * var(--bw-density-card-padding));
3521
+ margin: calc(-1 * var(--bw-component-card-inset, var(--bw-size-inset-md)));
2297
3522
  margin-block-end: var(--bw-space-3);
2298
- padding: var(--bw-density-card-padding);
3523
+ padding: var(--bw-component-card-inset, var(--bw-size-inset-md));
2299
3524
  background: var(--bw-color-accent-subtle);
2300
3525
  border-block-end: var(--bw-size-border-hairline) solid var(--bw-color-accent);
2301
3526
  border-start-start-radius: inherit;
@@ -2330,6 +3555,36 @@ a.bw-card {
2330
3555
  color: var(--bw-color-fg-on-inverse);
2331
3556
  background-color: var(--bw-state-hover-overlay);
2332
3557
  }
3558
+ /* Description (CRD-014): the supporting line under a title, on muted ink in
3559
+ the body-sm role. React CardDescription emits it; Django's caption and body
3560
+ strings use .bw-card__footer and .bw-card__body. */
3561
+ .bw-card__description {
3562
+ margin: 0;
3563
+ color: var(--bw-color-fg-muted);
3564
+ font-size: var(--bw-text-body-sm-size);
3565
+ font-weight: var(--bw-text-body-sm-weight);
3566
+ line-height: var(--bw-text-body-sm-line-height);
3567
+ text-wrap: pretty;
3568
+ }
3569
+ .bw-card__title + .bw-card__description {
3570
+ margin-block-start: var(--bw-space-1);
3571
+ }
3572
+ /* Whole-card inverse fill (CRD-023): the region ink flips to the on-inverse
3573
+ token. Without this the title and body (which speak in --bw-color-fg) would
3574
+ paint the inverse fill's own colour on itself. */
3575
+ .bw-card--surface-inverse .bw-card__title,
3576
+ .bw-card--surface-inverse .bw-card__description,
3577
+ .bw-card--surface-inverse .bw-card__body,
3578
+ .bw-card--surface-inverse .bw-card__footer {
3579
+ color: var(--bw-color-fg-on-inverse);
3580
+ }
3581
+ .bw-card--surface-inverse .bw-card__footer {
3582
+ border-block-start-color: color-mix(
3583
+ in oklab,
3584
+ var(--bw-color-fg-on-inverse) 30%,
3585
+ var(--bw-color-surface-inverse)
3586
+ );
3587
+ }
2333
3588
  /* Plain include-path body string (APPEARANCE.md): escaped text, not rich HTML. */
2334
3589
  .bw-card__body {
2335
3590
  margin: 0;
@@ -2340,6 +3595,7 @@ a.bw-card {
2340
3595
  text-wrap: pretty;
2341
3596
  }
2342
3597
  .bw-card__title + .bw-card__body,
3598
+ .bw-card__description + .bw-card__body,
2343
3599
  .bw-card__header + .bw-card__body,
2344
3600
  .bw-card__media + .bw-card__body,
2345
3601
  .bw-card__media + .bw-card__header,
@@ -2366,7 +3622,7 @@ a.bw-card {
2366
3622
  }
2367
3623
  .bw-card__media--bleed,
2368
3624
  .bw-card--media-bleed .bw-card__media {
2369
- margin: calc(-1 * var(--bw-density-card-padding));
3625
+ margin: calc(-1 * var(--bw-component-card-inset, var(--bw-size-inset-md)));
2370
3626
  margin-block-end: 0;
2371
3627
  border-start-start-radius: inherit;
2372
3628
  border-start-end-radius: inherit;
@@ -2403,9 +3659,9 @@ a.bw-card {
2403
3659
  }
2404
3660
  .bw-card__footer--muted,
2405
3661
  .bw-card--footer-muted .bw-card__footer {
2406
- margin-inline: calc(-1 * var(--bw-density-card-padding));
2407
- margin-block-end: calc(-1 * var(--bw-density-card-padding));
2408
- padding: var(--bw-space-3) var(--bw-density-card-padding);
3662
+ margin-inline: calc(-1 * var(--bw-component-card-inset, var(--bw-size-inset-md)));
3663
+ margin-block-end: calc(-1 * var(--bw-component-card-inset, var(--bw-size-inset-md)));
3664
+ padding: var(--bw-space-3) var(--bw-component-card-inset, var(--bw-size-inset-md));
2409
3665
  background: var(--bw-color-surface-sunken);
2410
3666
  border-block-start: var(--bw-size-border-hairline) solid var(--bw-color-border);
2411
3667
  border-end-start-radius: inherit;
@@ -2433,14 +3689,20 @@ a.bw-card {
2433
3689
  display: flex;
2434
3690
  flex-direction: column;
2435
3691
  gap: var(--bw-space-1);
3692
+ /* APP-002 (STA-002): hairline + tinted ground separate tiles; no ambient
3693
+ shadow at rest (the raw oklch drop shadow is removed). Shadow is
3694
+ reserved for overlays and linked-tile hover elevation only. */
2436
3695
  background: var(--bw-color-surface);
2437
3696
  border: var(--bw-size-border-hairline) solid
2438
- color-mix(in oklab, var(--bw-color-fg) 12%, var(--bw-color-surface));
3697
+ color-mix(in oklab, var(--bw-color-fg) 50%, var(--bw-color-surface));
2439
3698
  border-radius: var(--bw-radius-lg);
2440
- box-shadow:
2441
- var(--bw-elevation-1),
2442
- 0 4px 14px -4px oklch(0 0 0 / 0.1);
2443
- padding: var(--bw-density-card-padding);
3699
+ /* Value-size component token: points at 2xl (1.5rem at comfortable) per
3700
+ APP-CRAFT section 4 (kpi-value pick). Re-stated here so an explicit
3701
+ size="md" and the bare tile agree. The token is re-emitted for every
3702
+ density in @bwui/tokens so density cascades work without a component-
3703
+ level density block. */
3704
+ --bw-component-stat-tile-value-size: var(--bw-font-size-2xl);
3705
+ padding: var(--bw-size-inset-md);
2444
3706
  }
2445
3707
  /* Clickable tile (VIZ-024): an anchor stat is definitionally hoverable, so it
2446
3708
  takes the interactive card's shadow raise; same no-transform rule. */
@@ -2450,11 +3712,16 @@ a.bw-stat {
2450
3712
  transition: var(--bw-transition-shadow), var(--bw-transition-colors);
2451
3713
  }
2452
3714
  a.bw-stat:hover {
2453
- box-shadow:
2454
- var(--bw-elevation-2),
2455
- 0 8px 20px -6px oklch(0 0 0 / 0.12);
3715
+ /* APP-002: linked hover may use elevation tokens only (no raw oklch, CB-16). */
3716
+ box-shadow: var(--bw-elevation-2);
2456
3717
  background: var(--bw-color-surface-raised);
2457
3718
  }
3719
+ /* Optional leading icon (decorative; Django bw_icon sizes it). */
3720
+ .bw-stat__icon {
3721
+ block-size: var(--bw-space-5);
3722
+ inline-size: var(--bw-space-5);
3723
+ flex-shrink: 0;
3724
+ }
2458
3725
  /* Overline voice for the label (uppercase applied here at the component, per
2459
3726
  the role contract), on muted ink. */
2460
3727
  .bw-stat__label {
@@ -2468,13 +3735,17 @@ a.bw-stat:hover {
2468
3735
  }
2469
3736
  .bw-stat__value {
2470
3737
  margin: 0;
2471
- /* The component token scales the numeral (VIZ-001, AC-BW-075); until it is
2472
- emitted by the token build it falls back to the 3xl step, the same
2473
- inline-token-with-fallback mechanism as .bw-spinner's size. */
2474
- font-size: var(--bw-component-stat-tile-value-size, var(--bw-font-size-3xl));
3738
+ /* The component token scales the numeral (VIZ-001, AC-BW-075). Token is
3739
+ now emitted by the token build (2xl, 1.5rem at comfortable, APP-CRAFT
3740
+ section 4 kpi-value pick); the fallback retains the token so the cascade
3741
+ always wins when the stylesheet ships. */
3742
+ font-size: var(--bw-component-stat-tile-value-size, var(--bw-font-size-2xl));
2475
3743
  font-weight: var(--bw-font-weight-semibold);
2476
3744
  line-height: var(--bw-font-line-height-tight);
2477
- font-variant-numeric: tabular-nums; /* a column of tiles never jitters as digits change */
3745
+ /* STA-007 (CB-17 typography, APP-001): tight tracking on large numerals
3746
+ (tabular-nums + tight tracking together reduce jitter in KPI rows). */
3747
+ letter-spacing: var(--bw-font-tracking-tight);
3748
+ font-variant-numeric: tabular-nums;
2478
3749
  }
2479
3750
  /* The trend row itself (icvoss/django-brickwork#334): _stat.html now
2480
3751
  {% include %}s _trend_indicator.html rather than rendering its own trend
@@ -2484,13 +3755,23 @@ a.bw-stat:hover {
2484
3755
  consumer stylesheet that selects .bw-stat__trend directly; #334). */
2485
3756
  /* size arg (VIZ-027): modifiers re-point the value-size component token, so
2486
3757
  the numeral rule itself never forks. */
3758
+ /* Padding rides the container inset scale (ADR-126 section 5, gate 6); md
3759
+ restates the default so an explicit size="md" and the bare tile agree. */
3760
+ /* Size steps (STA-003, CB-17 subset sm|md|lg matching Card's own subset):
3761
+ re-point the value-size token coherently with the md base (xl→sm, 2xl→md,
3762
+ 3xl→lg). Padding rides the container inset scale (ADR-126 section 5). md
3763
+ restates the base so an explicit size="md" and the bare tile agree. */
2487
3764
  .bw-stat--sm, .bw-stat--size-sm {
3765
+ --bw-component-stat-tile-value-size: var(--bw-font-size-xl);
3766
+ padding: var(--bw-size-inset-sm);
3767
+ }
3768
+ .bw-stat--md, .bw-stat--size-md {
2488
3769
  --bw-component-stat-tile-value-size: var(--bw-font-size-2xl);
2489
- padding: var(--bw-space-3);
3770
+ padding: var(--bw-size-inset-md);
2490
3771
  }
2491
3772
  .bw-stat--lg, .bw-stat--size-lg {
2492
- --bw-component-stat-tile-value-size: var(--bw-font-size-4xl);
2493
- padding: var(--bw-space-6);
3773
+ --bw-component-stat-tile-value-size: var(--bw-font-size-3xl);
3774
+ padding: var(--bw-size-inset-lg);
2494
3775
  }
2495
3776
  /* chrome="plain" (#694): proof figures without card chrome. Default remains
2496
3777
  the KPI card (border, elevation, card padding). Size modifiers' padding is
@@ -2640,14 +3921,14 @@ a.bw-stat--chrome-plain:hover {
2640
3921
  display: flex;
2641
3922
  flex-direction: column;
2642
3923
  gap: var(--bw-space-1);
3924
+ /* APP-002 (STA-002): same hairline-only resting chrome as .bw-stat above;
3925
+ raw oklch drop shadow removed (CB-16). */
3926
+ --bw-component-stat-tile-value-size: var(--bw-font-size-2xl);
2643
3927
  background: var(--bw-color-surface);
2644
3928
  border: var(--bw-size-border-hairline) solid
2645
- color-mix(in oklab, var(--bw-color-fg) 12%, var(--bw-color-surface));
3929
+ color-mix(in oklab, var(--bw-color-fg) 50%, var(--bw-color-surface));
2646
3930
  border-radius: var(--bw-radius-lg);
2647
- box-shadow:
2648
- var(--bw-elevation-1),
2649
- 0 4px 14px -4px oklch(0 0 0 / 0.1);
2650
- padding: var(--bw-density-card-padding);
3931
+ padding: var(--bw-size-inset-md);
2651
3932
  }
2652
3933
  .bw-stat-comparison__label {
2653
3934
  color: var(--bw-color-fg-muted);
@@ -2660,9 +3941,10 @@ a.bw-stat--chrome-plain:hover {
2660
3941
  }
2661
3942
  .bw-stat-comparison__current {
2662
3943
  margin: 0;
2663
- font-size: var(--bw-component-stat-tile-value-size, var(--bw-font-size-3xl));
3944
+ font-size: var(--bw-component-stat-tile-value-size, var(--bw-font-size-2xl));
2664
3945
  font-weight: var(--bw-font-weight-semibold);
2665
3946
  line-height: var(--bw-font-line-height-tight);
3947
+ letter-spacing: var(--bw-font-tracking-tight);
2666
3948
  font-variant-numeric: tabular-nums;
2667
3949
  }
2668
3950
  /* The previous-period value and its period_label caption share one line:
@@ -2678,16 +3960,21 @@ a.bw-stat--chrome-plain:hover {
2678
3960
  .bw-stat-comparison__period {
2679
3961
  color: var(--bw-color-fg-muted);
2680
3962
  }
2681
- /* size arg (mirrors _stat.html's VIZ-027 seam): modifiers re-point the
2682
- same value-size component token _stat.html uses, so a comparison tile
2683
- sits at the same scale as a plain stat tile sharing its grid. */
3963
+ /* size arg (mirrors _stat.html's VIZ-027 seam, STA-003): modifiers re-point
3964
+ the same value-size component token _stat.html uses, so a comparison tile
3965
+ sits at the same scale as a plain stat tile sharing its grid. Steps are
3966
+ coherent with .bw-stat: sm→xl, (md default→2xl), lg→3xl. */
2684
3967
  .bw-stat-comparison--sm, .bw-stat-comparison--size-sm {
3968
+ --bw-component-stat-tile-value-size: var(--bw-font-size-xl);
3969
+ padding: var(--bw-size-inset-sm);
3970
+ }
3971
+ .bw-stat-comparison--md, .bw-stat-comparison--size-md {
2685
3972
  --bw-component-stat-tile-value-size: var(--bw-font-size-2xl);
2686
- padding: var(--bw-space-3);
3973
+ padding: var(--bw-size-inset-md);
2687
3974
  }
2688
3975
  .bw-stat-comparison--lg, .bw-stat-comparison--size-lg {
2689
- --bw-component-stat-tile-value-size: var(--bw-font-size-4xl);
2690
- padding: var(--bw-space-6);
3976
+ --bw-component-stat-tile-value-size: var(--bw-font-size-3xl);
3977
+ padding: var(--bw-size-inset-lg);
2691
3978
  }
2692
3979
  /* The trend row (_trend_indicator.html's css_class seam, matching #334's own
2693
3980
  .bw-stat__trend alias above): this template passes
@@ -3021,6 +4308,49 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
3021
4308
  flex-direction: column;
3022
4309
  gap: var(--bw-space-4);
3023
4310
  }
4311
+ /* Optional chrome above the mount (APP craft trend panel): title row with
4312
+ * optional metric segmented control, then an inline total + delta. Engine
4313
+ * ownership stays with the consumer; these classes are layout only. */
4314
+ .bw-chart-card__head {
4315
+ display: flex;
4316
+ justify-content: space-between;
4317
+ align-items: flex-start;
4318
+ gap: var(--bw-space-3);
4319
+ flex-wrap: wrap;
4320
+ }
4321
+ .bw-chart-card__title {
4322
+ margin: 0;
4323
+ font-size: var(--bw-font-size-sm);
4324
+ font-weight: var(--bw-font-weight-semibold);
4325
+ line-height: var(--bw-font-line-height-snug, 1.4);
4326
+ color: var(--bw-color-fg);
4327
+ }
4328
+ .bw-chart-card__subtitle {
4329
+ margin: var(--bw-space-1) 0 0;
4330
+ color: var(--bw-color-fg-muted);
4331
+ font-size: var(--bw-font-size-xs);
4332
+ }
4333
+ .bw-chart-card__total-row {
4334
+ display: flex;
4335
+ align-items: baseline;
4336
+ gap: var(--bw-space-2);
4337
+ flex-wrap: wrap;
4338
+ }
4339
+ .bw-chart-card__total {
4340
+ font-size: var(--bw-font-size-xl);
4341
+ font-weight: var(--bw-font-weight-semibold);
4342
+ letter-spacing: var(--bw-font-tracking-tight);
4343
+ font-variant-numeric: tabular-nums;
4344
+ color: var(--bw-color-fg);
4345
+ }
4346
+ .bw-chart-card__delta {
4347
+ font-size: var(--bw-font-size-xs);
4348
+ color: var(--bw-color-success);
4349
+ }
4350
+ .bw-chart-card__delta.is-down,
4351
+ .bw-chart-card__delta[data-bw-trend="down"] {
4352
+ color: var(--bw-color-warning);
4353
+ }
3024
4354
  .bw-chart-card--legend-bottom {
3025
4355
  flex-direction: column-reverse;
3026
4356
  }
@@ -3059,7 +4389,13 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
3059
4389
  display: block;
3060
4390
  inline-size: 100%;
3061
4391
  min-block-size: var(--bw-chart-mount-min-height, auto);
4392
+ /* Prefer an explicit height reservation when the consumer sets one; Chart.js
4393
+ * (and other engines that size the canvas from parent clientHeight) need a
4394
+ * definite block-size, not only min-block-size, or the canvas intrinsic
4395
+ * ratio expands the box past the CHT-024 reservation. */
4396
+ block-size: var(--bw-chart-mount-height, auto);
3062
4397
  aspect-ratio: var(--bw-chart-mount-aspect-ratio, auto);
4398
+ overflow: hidden;
3063
4399
  }
3064
4400
  /* The consumer's engine draws a <canvas> or <svg> into the mount; either
3065
4401
  * fills the reserved box exactly rather than adding its own intrinsic
@@ -3206,21 +4542,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
3206
4542
  block-size: 100%;
3207
4543
  }
3208
4544
 
3209
- /* Visually hidden, screen-reader-available text: the stat trend's directional
3210
- fallback ("increased"/"decreased", AC-BW-074) and any other markup whose
3211
- meaning must survive with CSS colour stripped. Standard clip pattern; the
3212
- px token keeps it out of the literal ban. */
3213
- .bw-visually-hidden {
3214
- position: absolute;
3215
- inline-size: var(--bw-space-px);
3216
- block-size: var(--bw-space-px);
3217
- margin: calc(var(--bw-space-px) * -1);
3218
- padding: 0;
3219
- overflow: hidden;
3220
- clip-path: inset(50%);
3221
- white-space: nowrap;
3222
- border: 0;
3223
- }
4545
+ /* .bw-visually-hidden lives in layout.css (F01 / R20). */
3224
4546
 
3225
4547
  /* --- Scorecard (VIZ-011/012, CHT-026) --------------------------------------- */
3226
4548
 
@@ -3586,14 +4908,14 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
3586
4908
  transition-duration: var(--bw-duration-instant);
3587
4909
  }
3588
4910
  /* Active tab: the nav band recipe (accent-duty text tier + accent marker).
3589
- * Two equivalent state carriers, one rule: the server-rendered floor marks
3590
- * the active anchor with the --active class; bwTabs marks its JS-selected
3591
- * tab with [data-bw-active] as selection moves (the class is the floor's,
3592
- * the attribute the enhancement's). The :hover restatement outranks the
4911
+ * Three equivalent state carriers, one rule: the server-rendered floor
4912
+ * marks the active anchor with the --active class; bwTabs marks its
4913
+ * JS-selected tab with [data-bw-active]; React and upgraded markup also
4914
+ * set aria-selected="true" (APP-003). The :hover restatement outranks the
3593
4915
  * plain hover rule so the active tab never dims back to fg on
3594
4916
  * pointer-over. */
3595
- .bw-tabs__tab:is(.bw-tabs__tab--active, [data-bw-active]),
3596
- .bw-tabs__tab:is(.bw-tabs__tab--active, [data-bw-active]):hover {
4917
+ .bw-tabs__tab:is(.bw-tabs__tab--active, [data-bw-active], [aria-selected="true"]),
4918
+ .bw-tabs__tab:is(.bw-tabs__tab--active, [data-bw-active], [aria-selected="true"]):hover {
3597
4919
  color: var(--bw-component-nav-item-active-text);
3598
4920
  border-block-end-color: var(--bw-component-nav-item-active-border);
3599
4921
  }
@@ -3613,10 +4935,12 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
3613
4935
  line-height: var(--bw-font-line-height-none);
3614
4936
  text-align: center;
3615
4937
  }
3616
- /* Pill style (CMP-024): no rail, no marker; selection is a selected-bg fill
3617
- * at radius-full. Hover/pressed take the overlay physics because a pill is
3618
- * a shape, not a rail position. The active pill's hover layers the overlay
3619
- * over the persistent fill (DESIGN.md 4.6 stacking). */
4938
+ /* Pill style (CMP-024): no rail, no underline marker; selection uses the
4939
+ * APP-003 pressed grammar owned by Segmented (accent-subtle fill, accent
4940
+ * text, accent border) at radius-full. Hover/pressed take the overlay
4941
+ * physics because a pill is a shape, not a rail position. The active
4942
+ * pill's hover layers the overlay over the persistent fill (DESIGN.md
4943
+ * 4.6 stacking). */
3620
4944
  /* --underline is the DOCUMENTED DEFAULT. It previously had no rule at all, so
3621
4945
  * the default variant emitted a class the stylesheet never matched (#120 defect
3622
4946
  * class). The underline treatment is the base .bw-tabs__tab marker, so this
@@ -3640,12 +4964,13 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
3640
4964
  background-color: var(--bw-state-active-overlay);
3641
4965
  transition-duration: var(--bw-duration-instant);
3642
4966
  }
3643
- .bw-tabs--pill .bw-tabs__tab:is(.bw-tabs__tab--active, [data-bw-active]),
3644
- .bw-tabs--pill .bw-tabs__tab:is(.bw-tabs__tab--active, [data-bw-active]):hover {
3645
- background-color: var(--bw-state-selected-bg);
4967
+ .bw-tabs--pill .bw-tabs__tab:is(.bw-tabs__tab--active, [data-bw-active], [aria-selected="true"]),
4968
+ .bw-tabs--pill .bw-tabs__tab:is(.bw-tabs__tab--active, [data-bw-active], [aria-selected="true"]):hover {
4969
+ background-color: var(--bw-color-accent-subtle);
3646
4970
  color: var(--bw-component-nav-item-active-text);
4971
+ border: var(--bw-size-border-hairline) solid var(--bw-color-accent);
3647
4972
  }
3648
- .bw-tabs--pill .bw-tabs__tab:is(.bw-tabs__tab--active, [data-bw-active]):hover {
4973
+ .bw-tabs--pill .bw-tabs__tab:is(.bw-tabs__tab--active, [data-bw-active], [aria-selected="true"]):hover {
3649
4974
  background-image: linear-gradient(var(--bw-state-hover-overlay), var(--bw-state-hover-overlay));
3650
4975
  }
3651
4976
  /* Panel spacing: the stack gap between the tablist and the panel. */
@@ -3688,6 +5013,10 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
3688
5013
  #bw-modal-root .bw-modal:not(.bw-modal--open):not([data-bw-open]) {
3689
5014
  display: none;
3690
5015
  }
5016
+ /* Floor and overlay roots never force the page wider than the viewport. */
5017
+ .bw-modal {
5018
+ max-inline-size: 100%;
5019
+ }
3691
5020
  /* The resting (floor) panel: the alone-on-a-page altitude of the auth and
3692
5021
  * centred panels (elevation-2), raised surface, the modal radius row.
3693
5022
  * Flex column so the header and footer hold still while the body scrolls
@@ -3696,11 +5025,11 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
3696
5025
  display: flex;
3697
5026
  flex-direction: column;
3698
5027
  inline-size: 100%;
3699
- max-inline-size: var(--bw-size-max-width-modal-md);
5028
+ max-inline-size: min(100%, var(--bw-size-max-width-modal-md));
3700
5029
  margin-inline: auto;
3701
5030
  background: var(--bw-color-surface-raised);
3702
5031
  border: var(--bw-size-border-hairline) solid
3703
- color-mix(in oklab, var(--bw-color-fg) 12%, var(--bw-color-surface-raised));
5032
+ color-mix(in oklab, var(--bw-color-fg) 50%, var(--bw-color-surface-raised));
3704
5033
  border-radius: var(--bw-radius-xl);
3705
5034
  box-shadow: var(--bw-elevation-2);
3706
5035
  }
@@ -3739,9 +5068,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
3739
5068
  position: relative;
3740
5069
  z-index: var(--bw-z-modal);
3741
5070
  max-block-size: 100%;
3742
- box-shadow:
3743
- var(--bw-elevation-4),
3744
- 0 16px 36px -10px oklch(0 0 0 / 0.16);
5071
+ box-shadow: var(--bw-elevation-4);
3745
5072
  animation: bw-modal-in var(--bw-duration-normal) var(--bw-ease-out);
3746
5073
  }
3747
5074
  @keyframes bw-modal-in {
@@ -3758,10 +5085,13 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
3758
5085
  * panel honours them too); full is full-viewport, gutterless, radius
3759
5086
  * squared off, and only means anything as an overlay. */
3760
5087
  .bw-modal--sm .bw-modal__panel, .bw-modal--size-sm .bw-modal__panel {
3761
- max-inline-size: var(--bw-size-max-width-modal-sm);
5088
+ max-inline-size: min(100%, var(--bw-size-max-width-modal-sm));
5089
+ }
5090
+ .bw-modal--md .bw-modal__panel, .bw-modal--size-md .bw-modal__panel {
5091
+ max-inline-size: min(100%, var(--bw-size-max-width-modal-md));
3762
5092
  }
3763
5093
  .bw-modal--lg .bw-modal__panel, .bw-modal--size-lg .bw-modal__panel {
3764
- max-inline-size: var(--bw-size-max-width-modal-lg);
5094
+ max-inline-size: min(100%, var(--bw-size-max-width-modal-lg));
3765
5095
  }
3766
5096
  .bw-modal--full:is(.bw-modal--open, [data-bw-open]), .bw-modal--size-full:is(.bw-modal--open, [data-bw-open]) {
3767
5097
  padding: 0;
@@ -3839,10 +5169,13 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
3839
5169
  /* --- Slide-over / side panel (0.14.0, brickwork#55) -------------------------- */
3840
5170
 
3841
5171
  /* Consumed by extending _slide_over.html; two render paths, one partial
3842
- * (BR-BW-HTMX-001), same shape as the modal above. Markup (per
3843
- * _slide_over.html):
5172
+ * (BR-BW-HTMX-001), same shape as the modal above. One unit (Sheet and
5173
+ * slide-over, docs/components/sheet.md): .bw-slide-over is the canonical
5174
+ * root, and .bw-sheet is its narrower mobile sheet mode (a modifier on the
5175
+ * same root, never a second primitive). The drawer (.bw-drawer) is the
5176
+ * Sidebar unit's, not this one. Markup (per _slide_over.html):
3844
5177
  *
3845
- * <div class="bw-slide-over bw-slide-over--sm|--md|--lg bw-slide-over--start|--end">
5178
+ * <div class="bw-slide-over bw-slide-over--size-sm|md|lg bw-slide-over--start|end [bw-sheet]">
3846
5179
  * <div class="bw-slide-over__scrim" aria-hidden="true"></div>
3847
5180
  * <div role="dialog" class="bw-slide-over__panel">
3848
5181
  * <header class="bw-slide-over__header">
@@ -3915,9 +5248,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
3915
5248
  position: relative;
3916
5249
  z-index: var(--bw-z-modal);
3917
5250
  max-block-size: 100%;
3918
- box-shadow:
3919
- var(--bw-elevation-4),
3920
- 0 16px 36px -10px oklch(0 0 0 / 0.16);
5251
+ box-shadow: var(--bw-elevation-4);
3921
5252
  animation-duration: var(--bw-duration-normal);
3922
5253
  animation-timing-function: var(--bw-ease-out);
3923
5254
  }
@@ -3975,20 +5306,28 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
3975
5306
  animation: none;
3976
5307
  }
3977
5308
  }
3978
- /* Size modifiers: reuse the modal's own width ramp. */
3979
- .bw-slide-over--sm .bw-slide-over__panel, .bw-slide-over--size-sm .bw-slide-over__panel {
5309
+ /* Size axis (SHT-003): the width ramp only, on the modal's own tokens
5310
+ * (--bw-size-max-width-modal-sm|md|lg, 28, 32 and 48rem). This is not the
5311
+ * xs to xl control-height axis and not the inset axis (SIZE-COVERAGE).
5312
+ * bw-slide-over--size-<step> is the only spelling; there is no bare
5313
+ * bw-slide-over--sm. md is the documented default and the template emits
5314
+ * it unconditionally, so it carries a real rule. */
5315
+ .bw-slide-over--size-sm .bw-slide-over__panel {
3980
5316
  max-inline-size: var(--bw-size-max-width-modal-sm);
3981
5317
  }
3982
- /* --md is the DOCUMENTED DEFAULT and the template emits it unconditionally, so
3983
- * it needs a real rule: without one the default size resolved to the panel's
3984
- * base width by accident rather than by declaration (the #120 defect class,
3985
- * found in the 3.0.0 options audit). */
3986
- .bw-slide-over--md .bw-slide-over__panel, .bw-slide-over--size-md .bw-slide-over__panel {
5318
+ .bw-slide-over--size-md .bw-slide-over__panel {
3987
5319
  max-inline-size: var(--bw-size-max-width-modal-md);
3988
5320
  }
3989
- .bw-slide-over--lg .bw-slide-over__panel, .bw-slide-over--size-lg .bw-slide-over__panel {
5321
+ .bw-slide-over--size-lg .bw-slide-over__panel {
3990
5322
  max-inline-size: var(--bw-size-max-width-modal-lg);
3991
5323
  }
5324
+ /* Sheet mode (SHT-004): the narrow mobile sheet, on either placement. It is
5325
+ * a modifier on the same root and overrides the size ramp with a fixed
5326
+ * narrower cap: the modal sm width less 4rem, which resolves to 24rem. The
5327
+ * panel is still fluid below the cap. */
5328
+ .bw-slide-over.bw-sheet .bw-slide-over__panel {
5329
+ max-inline-size: calc(var(--bw-size-max-width-modal-sm) - var(--bw-space-16));
5330
+ }
3992
5331
  /* Sticky header: title plus the always-present close control, divided
3993
5332
  * from the scrolling body by a hairline. Density card padding scales the
3994
5333
  * chrome with the density axis, matching the modal. */
@@ -4058,7 +5397,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
4058
5397
  * <svg class="bw-icon bw-toast__icon" aria-hidden="true">...</svg>
4059
5398
  * <p class="bw-toast__message">...</p>
4060
5399
  * [<a class="bw-toast__action" href="...">label</a>]
4061
- * <button class="bw-toast__close bw-btn bw-btn--ghost bw-btn--sm bw-btn--icon-only">...</button>
5400
+ * <button class="bw-toast__close bw-btn bw-btn--ghost bw-btn--size-sm bw-btn--icon-only">...</button>
4062
5401
  * </div>
4063
5402
  * <button class="bw-toast-region__more" hidden>+N more</button>
4064
5403
  * </div>
@@ -4128,9 +5467,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
4128
5467
  color-mix(in oklab, var(--bw-color-fg) 12%, var(--bw-color-surface-raised));
4129
5468
  border-inline-start: var(--bw-size-border-thick) solid var(--bw-color-border);
4130
5469
  border-radius: var(--bw-radius-xl);
4131
- box-shadow:
4132
- var(--bw-elevation-5),
4133
- 0 20px 44px -12px oklch(0 0 0 / 0.18);
5470
+ box-shadow: var(--bw-elevation-5);
4134
5471
  opacity: 0;
4135
5472
  transform: translateY(calc(-1 * var(--bw-space-2)));
4136
5473
  transition:
@@ -4266,35 +5603,35 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
4266
5603
  --bw-control-padding-inline: var(--bw-size-control-padding-inline-xs);
4267
5604
  --bw-control-icon-size: var(--bw-size-control-icon-xs);
4268
5605
  --bw-control-gap: var(--bw-size-control-gap-xs);
4269
- --bw-control-font-size: var(--bw-size-control-font-size-xs);
5606
+ --bw-control-font-size: var(--bw-font-size-xs);
4270
5607
  }
4271
5608
  .bw-combobox--size-sm {
4272
5609
  --bw-control-height: var(--bw-size-control-height-sm);
4273
5610
  --bw-control-padding-inline: var(--bw-size-control-padding-inline-sm);
4274
5611
  --bw-control-icon-size: var(--bw-size-control-icon-sm);
4275
5612
  --bw-control-gap: var(--bw-size-control-gap-sm);
4276
- --bw-control-font-size: var(--bw-size-control-font-size-sm);
5613
+ --bw-control-font-size: var(--bw-font-size-sm);
4277
5614
  }
4278
5615
  .bw-combobox--size-md {
4279
5616
  --bw-control-height: var(--bw-size-control-height-md);
4280
5617
  --bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
4281
5618
  --bw-control-icon-size: var(--bw-size-control-icon-md);
4282
5619
  --bw-control-gap: var(--bw-size-control-gap-md);
4283
- --bw-control-font-size: var(--bw-size-control-font-size-md);
5620
+ --bw-control-font-size: var(--bw-font-size-md);
4284
5621
  }
4285
5622
  .bw-combobox--size-lg {
4286
5623
  --bw-control-height: var(--bw-size-control-height-lg);
4287
5624
  --bw-control-padding-inline: var(--bw-size-control-padding-inline-lg);
4288
5625
  --bw-control-icon-size: var(--bw-size-control-icon-lg);
4289
5626
  --bw-control-gap: var(--bw-size-control-gap-lg);
4290
- --bw-control-font-size: var(--bw-size-control-font-size-lg);
5627
+ --bw-control-font-size: var(--bw-font-size-lg);
4291
5628
  }
4292
5629
  .bw-combobox--size-xl {
4293
5630
  --bw-control-height: var(--bw-size-control-height-xl);
4294
5631
  --bw-control-padding-inline: var(--bw-size-control-padding-inline-xl);
4295
5632
  --bw-control-icon-size: var(--bw-size-control-icon-xl);
4296
5633
  --bw-control-gap: var(--bw-size-control-gap-xl);
4297
- --bw-control-font-size: var(--bw-size-control-font-size-xl);
5634
+ --bw-control-font-size: var(--bw-font-size-xl);
4298
5635
  }
4299
5636
  .bw-combobox {
4300
5637
  /* Chip block size (CMB-038): the control height less the frame's own
@@ -4713,10 +6050,19 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
4713
6050
  * removal closes the gap in one reflow exactly as reduced motion does
4714
6051
  * (the global floor collapses this fade to an instant removal). */
4715
6052
  .bw-alert[data-bw-dismissing],
4716
- .bw-badge[data-bw-dismissing] {
6053
+ .bw-badge[data-bw-dismissing],
6054
+ .bw-banner[data-bw-dismissing] {
4717
6055
  opacity: 0;
4718
6056
  transition: opacity var(--bw-duration-fast) var(--bw-ease-in);
4719
6057
  }
6058
+ /* reduced-motion: Banner dismiss must collapse to an instant removal; the
6059
+ * global floor (0.001ms) is not identical to 0s, so an explicit banner-only
6060
+ * override is needed to satisfy MOT-007's clear-quickly contract. */
6061
+ @media (prefers-reduced-motion: reduce) {
6062
+ .bw-banner[data-bw-dismissing] {
6063
+ transition-duration: 0s !important;
6064
+ }
6065
+ }
4720
6066
  /* The badge's close control skips the bw-btn chrome (a control-height button
4721
6067
  * would dwarf the compact badge; the template notes the hit area is owned
4722
6068
  * here): an inline icon run with the overlay hover physics, inline content's
@@ -4766,35 +6112,194 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
4766
6112
  white-space: normal;
4767
6113
  pointer-events: none;
4768
6114
  }
4769
- /* [hidden] display floor is restated globally ([class^="bw-"][hidden] in
4770
- * index.css); bwTooltip toggles the attribute, never a class, so the closed
4771
- * state needs no rule here. */
4772
- .bw-tooltip--top .bw-tooltip__bubble {
4773
- inset-block-end: calc(100% + var(--bw-space-1));
4774
- inset-inline-start: 50%;
4775
- transform: translateX(-50%);
6115
+ /* [hidden] display floor is restated globally ([class^="bw-"][hidden] in
6116
+ * index.css); bwTooltip toggles the attribute, never a class, so the closed
6117
+ * state needs no rule here. */
6118
+ .bw-tooltip--top .bw-tooltip__bubble {
6119
+ inset-block-end: calc(100% + var(--bw-space-1));
6120
+ inset-inline-start: 50%;
6121
+ transform: translateX(-50%);
6122
+ }
6123
+ .bw-tooltip--bottom .bw-tooltip__bubble {
6124
+ inset-block-start: calc(100% + var(--bw-space-1));
6125
+ inset-inline-start: 50%;
6126
+ transform: translateX(-50%);
6127
+ }
6128
+ /* Logical placements: inline-start/-end flip automatically under dir="rtl"
6129
+ * (BR-BW-TOK-005), unlike top/bottom which are block-axis and
6130
+ * direction-agnostic already. */
6131
+ .bw-tooltip--start .bw-tooltip__bubble {
6132
+ inset-inline-end: calc(100% + var(--bw-space-1));
6133
+ inset-block-start: 50%;
6134
+ transform: translateY(-50%);
6135
+ }
6136
+ .bw-tooltip--end .bw-tooltip__bubble {
6137
+ inset-inline-start: calc(100% + var(--bw-space-1));
6138
+ inset-block-start: 50%;
6139
+ transform: translateY(-50%);
6140
+ }
6141
+ [data-theme="dark"] .bw-tooltip__bubble {
6142
+ box-shadow: var(--bw-elevation-3);
6143
+ }
6144
+
6145
+ /* --- Popover (docs/components/popover.md, R39 / H15) -------------------------- */
6146
+
6147
+ /* The small, non-modal panel that opens beside the control that asked for it
6148
+ * and holds interactive content. The no-JS floor is a native <details> and
6149
+ * <summary> (POP-003); script (@bwui/js initPopover, the Django bwPopover
6150
+ * module, React, Vue) upgrades the same markup. The native HTML popover
6151
+ * attribute is never used, so the panel stays on the --bw-z-dropdown rung.
6152
+ * Expected markup:
6153
+ *
6154
+ * <details class="bw-popover bw-popover--bottom">
6155
+ * <summary class="bw-popover__trigger bw-btn bw-btn--secondary bw-btn--size-md">
6156
+ * label
6157
+ * </summary>
6158
+ * <div class="bw-popover__panel" id="p" role="dialog" aria-labelledby="p-title">
6159
+ * <div class="bw-popover__header">
6160
+ * <h2 class="bw-popover__title" id="p-title">Title</h2>
6161
+ * [<button class="bw-popover__close" aria-label="Close" data-bw-popover-close>
6162
+ * <svg class="bw-icon" aria-hidden="true">...</svg>
6163
+ * </button>]
6164
+ * </div>
6165
+ * <div class="bw-popover__body">...</div>
6166
+ * [<div class="bw-popover__footer">...</div>]
6167
+ * </div>
6168
+ * </details>
6169
+ *
6170
+ * Open state is carried by [open] on the floor details and by
6171
+ * [data-bw-open] on the root under script; React and Vue render a div root
6172
+ * and a [hidden] panel, so one entrance rule serves every delivery. Close is
6173
+ * an instant state removal (POP-015). A closed panel is hidden by the native
6174
+ * details behaviour or by the [hidden] floor restated in index-extras.css.
6175
+ * The panel never sets overflow (POP-005), so a combobox listbox or a
6176
+ * date-picker panel inside it is not clipped. Every value reads a --bw-*
6177
+ * token directly; the block keeps no private custom properties. */
6178
+ .bw-popover {
6179
+ position: relative;
6180
+ display: inline-block;
6181
+ }
6182
+ .bw-popover__trigger {
6183
+ cursor: pointer;
6184
+ list-style: none;
6185
+ }
6186
+ .bw-popover__trigger::-webkit-details-marker {
6187
+ display: none;
6188
+ }
6189
+ /* Panel surface: raised fill, hairline border, radius-xl, elevation-3 at the
6190
+ * dropdown rung (POP-010; dark reset list at the end of this file). Content
6191
+ * sized and capped at the viewport less space-8 (POP-011); padding is the
6192
+ * density-computed md inset. A root with no placement modifier resolves to
6193
+ * bottom: the panel's inline-start edge aligns to the root's, never centred
6194
+ * on the trigger (POP-012). */
6195
+ .bw-popover__panel {
6196
+ position: absolute;
6197
+ inset-block-start: calc(100% + var(--bw-space-1));
6198
+ inset-inline-start: 0;
6199
+ z-index: var(--bw-z-dropdown);
6200
+ box-sizing: border-box;
6201
+ display: flex;
6202
+ flex-direction: column;
6203
+ gap: var(--bw-space-3);
6204
+ inline-size: max-content;
6205
+ max-inline-size: calc(100vw - var(--bw-space-8));
6206
+ padding: var(--bw-size-inset-md);
6207
+ background: var(--bw-color-surface-raised);
6208
+ color: var(--bw-color-fg);
6209
+ border: var(--bw-size-border-hairline) solid var(--bw-color-border);
6210
+ border-radius: var(--bw-radius-xl);
6211
+ box-shadow: var(--bw-elevation-3);
6212
+ text-align: start;
6213
+ }
6214
+ .bw-popover--top .bw-popover__panel {
6215
+ inset-block-start: auto;
6216
+ inset-block-end: calc(100% + var(--bw-space-1));
6217
+ }
6218
+ /* start and end are logical: they flip under dir="rtl" (POP-016). The
6219
+ * panel's block-start edge aligns to the root's. */
6220
+ .bw-popover--start .bw-popover__panel {
6221
+ inset-block-start: 0;
6222
+ inset-inline-start: auto;
6223
+ inset-inline-end: calc(100% + var(--bw-space-1));
6224
+ }
6225
+ .bw-popover--end .bw-popover__panel {
6226
+ inset-block-start: 0;
6227
+ inset-inline-start: calc(100% + var(--bw-space-1));
6228
+ }
6229
+ .bw-popover[open] > .bw-popover__panel,
6230
+ .bw-popover[data-bw-open] > .bw-popover__panel {
6231
+ animation: bw-fade-in-up var(--bw-duration-normal) var(--bw-ease-out);
6232
+ }
6233
+ .bw-popover__header {
6234
+ display: flex;
6235
+ align-items: flex-start;
6236
+ justify-content: space-between;
6237
+ gap: var(--bw-space-3);
6238
+ }
6239
+ .bw-popover__title {
6240
+ margin: 0;
6241
+ color: var(--bw-color-fg);
6242
+ font-family: var(--bw-text-heading-sm-family);
6243
+ font-size: var(--bw-text-heading-sm-size);
6244
+ font-weight: var(--bw-text-heading-sm-weight);
6245
+ line-height: var(--bw-text-heading-sm-line-height);
6246
+ }
6247
+ .bw-popover__body {
6248
+ font-size: var(--bw-text-body-sm-size);
6249
+ line-height: var(--bw-text-body-sm-line-height);
6250
+ }
6251
+ .bw-popover__footer:empty {
6252
+ display: none;
6253
+ }
6254
+ .bw-popover__footer {
6255
+ display: flex;
6256
+ flex-wrap: wrap;
6257
+ justify-content: flex-end;
6258
+ gap: var(--bw-space-3);
6259
+ font-size: var(--bw-text-body-sm-size);
6260
+ line-height: var(--bw-text-body-sm-line-height);
6261
+ }
6262
+ /* Close control (POP-014): its own icon-only button, painted like the
6263
+ * combobox clear control. The 2rem box is above the 24px target floor. */
6264
+ .bw-popover__close {
6265
+ display: inline-flex;
6266
+ flex: none;
6267
+ align-items: center;
6268
+ justify-content: center;
6269
+ inline-size: calc(var(--bw-component-icon-size-sm) + 2 * var(--bw-space-2));
6270
+ block-size: calc(var(--bw-component-icon-size-sm) + 2 * var(--bw-space-2));
6271
+ margin-inline-start: auto;
6272
+ padding: 0;
6273
+ background: transparent;
6274
+ border: 0;
6275
+ border-radius: var(--bw-radius-full);
6276
+ color: var(--bw-color-fg-muted);
6277
+ cursor: pointer;
6278
+ transition: var(--bw-transition-colors);
4776
6279
  }
4777
- .bw-tooltip--bottom .bw-tooltip__bubble {
4778
- inset-block-start: calc(100% + var(--bw-space-1));
4779
- inset-inline-start: 50%;
4780
- transform: translateX(-50%);
6280
+ .bw-popover__close .bw-icon,
6281
+ .bw-popover__close svg {
6282
+ inline-size: var(--bw-component-icon-size-sm);
6283
+ block-size: var(--bw-component-icon-size-sm);
6284
+ background: transparent;
6285
+ border-radius: 0;
6286
+ color: inherit;
4781
6287
  }
4782
- /* Logical placements: inline-start/-end flip automatically under dir="rtl"
4783
- * (BR-BW-TOK-005), unlike top/bottom which are block-axis and
4784
- * direction-agnostic already. */
4785
- .bw-tooltip--start .bw-tooltip__bubble {
4786
- inset-inline-end: calc(100% + var(--bw-space-1));
4787
- inset-block-start: 50%;
4788
- transform: translateY(-50%);
6288
+ .bw-popover__close:hover {
6289
+ background-color: var(--bw-state-hover-overlay);
6290
+ color: var(--bw-color-fg);
4789
6291
  }
4790
- .bw-tooltip--end .bw-tooltip__bubble {
4791
- inset-inline-start: calc(100% + var(--bw-space-1));
4792
- inset-block-start: 50%;
4793
- transform: translateY(-50%);
6292
+ .bw-popover__close:active {
6293
+ background-color: var(--bw-state-active-overlay);
6294
+ transition-duration: var(--bw-duration-instant);
4794
6295
  }
4795
- [data-theme="dark"] .bw-tooltip__bubble {
4796
- box-shadow: var(--bw-elevation-3);
6296
+ @media (prefers-reduced-motion: reduce) {
6297
+ .bw-popover[open] > .bw-popover__panel,
6298
+ .bw-popover[data-bw-open] > .bw-popover__panel {
6299
+ animation: none;
6300
+ }
4797
6301
  }
6302
+ /* --- end Popover --- */
4798
6303
 
4799
6304
  /* reduced-motion (interaction set): explicit caret overrides on top of the
4800
6305
  * global floor; a half-rotated caret reads as broken (DESIGN.md 8.4). The
@@ -5124,7 +6629,7 @@ input.bw-input[type="datetime-local"]:hover::-webkit-calendar-picker-indicator {
5124
6629
  box-shadow: var(--bw-elevation-3);
5125
6630
  padding: var(--bw-space-4);
5126
6631
  inline-size: max-content;
5127
- max-inline-size: calc(100vw - var(--bw-space-8));
6632
+ max-inline-size: 100%;
5128
6633
  }
5129
6634
  .bw-date-picker-chrome__panel[hidden] {
5130
6635
  display: none;
@@ -5926,38 +7431,75 @@ input.bw-input[type="datetime-local"]:hover::-webkit-calendar-picker-indicator {
5926
7431
  flex: 0 0 var(--bw-space-6);
5927
7432
  }
5928
7433
 
5929
- /* --- Avatar (Beat Phase B, #542) ------------------------------------------- */
5930
- /* Box size reuses shipped control-height tokens (DESIGN.md §10 keeps
5931
- --bw-avatar-size-* reserved until a consumer needs a distinct scale). */
7434
+ /* --- Avatar and avatar group (docs/components/avatar.md) --------------------- */
7435
+ /* Display atom. The box is the control height: the avatar reads only the five
7436
+ * control role variables (ADR-126 section 4), declared on :root and in every
7437
+ * [data-density] block (md at the density in force) and inherited here. A bare
7438
+ * .bw-avatar is md, a size class re-points them (ADR-125), and a control
7439
+ * container can set one step for its children. The avatar never reads a
7440
+ * density token or a --bw-size-control-* step token outside the size classes
7441
+ * (AVR-010). The 1.5rem target floor is carried by the height tokens, so a
7442
+ * linked avatar meets WCAG 2.5.8 at every step and density (AVR-052). There is
7443
+ * no bare spelling (bw-avatar--sm). --bw-avatar-size-* stays reserved. */
5932
7444
 
5933
7445
  .bw-avatar {
5934
7446
  display: inline-flex;
5935
7447
  align-items: center;
5936
7448
  justify-content: center;
5937
- inline-size: var(--bw-size-control-height-md);
5938
- block-size: var(--bw-size-control-height-md);
7449
+ inline-size: var(--bw-control-height);
7450
+ block-size: var(--bw-control-height);
5939
7451
  overflow: hidden;
5940
7452
  border-radius: var(--bw-radius-full);
5941
7453
  background: var(--bw-color-surface-sunken);
5942
7454
  color: var(--bw-color-fg-muted);
5943
7455
  border: var(--bw-size-border-hairline) solid color-mix(in oklab, var(--bw-color-fg) 12%, var(--bw-color-surface));
7456
+ /* Type follows the step (ADR-127 section 6): the letters take the fifth role
7457
+ * variable, the ladder step of the same name, floored by the ladder. They
7458
+ * are not a ratio of the box (AVR-013). */
7459
+ font-size: var(--bw-control-font-size);
7460
+ line-height: 1;
5944
7461
  vertical-align: middle;
5945
7462
  flex-shrink: 0;
5946
7463
  }
5947
7464
 
7465
+ .bw-avatar--size-xs {
7466
+ --bw-control-height: var(--bw-size-control-height-xs);
7467
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-xs);
7468
+ --bw-control-icon-size: var(--bw-size-control-icon-xs);
7469
+ --bw-control-gap: var(--bw-size-control-gap-xs);
7470
+ --bw-control-font-size: var(--bw-font-size-xs);
7471
+ }
7472
+
5948
7473
  .bw-avatar--size-sm {
5949
- inline-size: var(--bw-size-control-height-sm);
5950
- block-size: var(--bw-size-control-height-sm);
7474
+ --bw-control-height: var(--bw-size-control-height-sm);
7475
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-sm);
7476
+ --bw-control-icon-size: var(--bw-size-control-icon-sm);
7477
+ --bw-control-gap: var(--bw-size-control-gap-sm);
7478
+ --bw-control-font-size: var(--bw-font-size-sm);
5951
7479
  }
5952
7480
 
5953
7481
  .bw-avatar--size-md {
5954
- inline-size: var(--bw-size-control-height-md);
5955
- block-size: var(--bw-size-control-height-md);
7482
+ --bw-control-height: var(--bw-size-control-height-md);
7483
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
7484
+ --bw-control-icon-size: var(--bw-size-control-icon-md);
7485
+ --bw-control-gap: var(--bw-size-control-gap-md);
7486
+ --bw-control-font-size: var(--bw-font-size-md);
5956
7487
  }
5957
7488
 
5958
7489
  .bw-avatar--size-lg {
5959
- inline-size: var(--bw-size-control-height-lg);
5960
- block-size: var(--bw-size-control-height-lg);
7490
+ --bw-control-height: var(--bw-size-control-height-lg);
7491
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-lg);
7492
+ --bw-control-icon-size: var(--bw-size-control-icon-lg);
7493
+ --bw-control-gap: var(--bw-size-control-gap-lg);
7494
+ --bw-control-font-size: var(--bw-font-size-lg);
7495
+ }
7496
+
7497
+ .bw-avatar--size-xl {
7498
+ --bw-control-height: var(--bw-size-control-height-xl);
7499
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-xl);
7500
+ --bw-control-icon-size: var(--bw-size-control-icon-xl);
7501
+ --bw-control-gap: var(--bw-size-control-gap-xl);
7502
+ --bw-control-font-size: var(--bw-font-size-xl);
5961
7503
  }
5962
7504
 
5963
7505
  /* circle is the documented default shape (#120/#130): restates the base
@@ -5971,33 +7513,44 @@ input.bw-input[type="datetime-local"]:hover::-webkit-calendar-picker-indicator {
5971
7513
  }
5972
7514
 
5973
7515
  .bw-avatar__image {
7516
+ display: block;
5974
7517
  inline-size: 100%;
5975
7518
  block-size: 100%;
5976
7519
  object-fit: cover;
5977
7520
  }
5978
7521
 
5979
7522
  .bw-avatar__initials {
5980
- font-size: calc(var(--bw-size-control-height-md) * 0.375);
5981
7523
  font-weight: var(--bw-font-weight-semibold);
5982
7524
  line-height: 1;
5983
7525
  letter-spacing: 0.02em;
5984
7526
  text-transform: uppercase;
7527
+ white-space: nowrap;
5985
7528
  max-inline-size: 100%;
5986
7529
  overflow: hidden;
5987
7530
  }
5988
7531
 
5989
- .bw-avatar--size-sm .bw-avatar__initials {
5990
- font-size: calc(var(--bw-size-control-height-sm) * 0.375);
5991
- }
5992
-
5993
- .bw-avatar--size-lg .bw-avatar__initials {
5994
- font-size: calc(var(--bw-size-control-height-lg) * 0.375);
7532
+ /* The letters content shape (initials fallback, no image). The ink is the full
7533
+ * foreground so the letters clear 4.5:1 on the sunken fill in both themes
7534
+ * (AVR-014, section 4.3 of the craft document). */
7535
+ .bw-avatar--initials {
7536
+ color: var(--bw-color-fg);
5995
7537
  }
5996
7538
 
5997
7539
  .bw-avatar--overflow {
5998
7540
  background: var(--bw-color-surface-raised);
5999
7541
  color: var(--bw-color-fg);
6000
7542
  border-color: var(--bw-color-border);
7543
+ /* Wide counts such as +120 must not clip; grow the box on the inline axis.
7544
+ * The box is the minimum; the inline padding is half the step's control gap. */
7545
+ inline-size: auto;
7546
+ min-inline-size: var(--bw-control-height);
7547
+ padding-inline: calc(var(--bw-control-gap) * 0.5);
7548
+ }
7549
+
7550
+ .bw-avatar--overflow .bw-avatar__initials {
7551
+ max-inline-size: none;
7552
+ overflow: visible;
7553
+ text-transform: none;
6001
7554
  }
6002
7555
 
6003
7556
  .bw-avatar-group {
@@ -6009,23 +7562,78 @@ input.bw-input[type="datetime-local"]:hover::-webkit-calendar-picker-indicator {
6009
7562
  box-shadow: 0 0 0 var(--bw-size-border-thick) var(--bw-color-surface);
6010
7563
  }
6011
7564
 
7565
+ /* Overlap follows each avatar's --bw-control-gap (set by its size class). */
6012
7566
  .bw-avatar-group .bw-avatar + .bw-avatar {
6013
- margin-inline-start: calc(var(--bw-space-2) * -1);
7567
+ margin-inline-start: calc(var(--bw-control-gap) * -1);
6014
7568
  }
6015
7569
 
6016
- /* --- Chip / filter chip (Beat Phase B, #542) ------------------------------- */
7570
+ /* --- Chip (R09, A04; docs/components/chip.md) ----------------------------- */
7571
+
7572
+ /* Size grammar (CHP-003): bw-chip--size-xs to -xl re-point the five control
7573
+ * role variables at the step they name, exactly as Button, Radio and Switch do
7574
+ * (ADR-125, ADR-126 section 4), and name the matching container inset step in
7575
+ * the block-private --bw-chip-inset (the inset axis, SIZE-COVERAGE gate 6).
7576
+ * There is no bare spelling. A bare .bw-chip inherits the role variables in
7577
+ * force (md from :root) and falls back to the md inset; emit the class to pin
7578
+ * a step. */
7579
+ .bw-chip--size-xs {
7580
+ --bw-control-height: var(--bw-size-control-height-xs);
7581
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-xs);
7582
+ --bw-control-icon-size: var(--bw-size-control-icon-xs);
7583
+ --bw-control-gap: var(--bw-size-control-gap-xs);
7584
+ --bw-control-font-size: var(--bw-font-size-xs);
7585
+ --bw-chip-inset: var(--bw-size-inset-xs);
7586
+ }
7587
+ .bw-chip--size-sm {
7588
+ --bw-control-height: var(--bw-size-control-height-sm);
7589
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-sm);
7590
+ --bw-control-icon-size: var(--bw-size-control-icon-sm);
7591
+ --bw-control-gap: var(--bw-size-control-gap-sm);
7592
+ --bw-control-font-size: var(--bw-font-size-sm);
7593
+ --bw-chip-inset: var(--bw-size-inset-sm);
7594
+ }
7595
+ .bw-chip--size-md {
7596
+ --bw-control-height: var(--bw-size-control-height-md);
7597
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
7598
+ --bw-control-icon-size: var(--bw-size-control-icon-md);
7599
+ --bw-control-gap: var(--bw-size-control-gap-md);
7600
+ --bw-control-font-size: var(--bw-font-size-md);
7601
+ --bw-chip-inset: var(--bw-size-inset-md);
7602
+ }
7603
+ .bw-chip--size-lg {
7604
+ --bw-control-height: var(--bw-size-control-height-lg);
7605
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-lg);
7606
+ --bw-control-icon-size: var(--bw-size-control-icon-lg);
7607
+ --bw-control-gap: var(--bw-size-control-gap-lg);
7608
+ --bw-control-font-size: var(--bw-font-size-lg);
7609
+ --bw-chip-inset: var(--bw-size-inset-lg);
7610
+ }
7611
+ .bw-chip--size-xl {
7612
+ --bw-control-height: var(--bw-size-control-height-xl);
7613
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-xl);
7614
+ --bw-control-icon-size: var(--bw-size-control-icon-xl);
7615
+ --bw-control-gap: var(--bw-size-control-gap-xl);
7616
+ --bw-control-font-size: var(--bw-font-size-xl);
7617
+ --bw-chip-inset: var(--bw-size-inset-xl);
7618
+ }
6017
7619
 
6018
7620
  .bw-chip {
6019
7621
  display: inline-flex;
6020
7622
  align-items: center;
6021
- gap: var(--bw-space-1);
6022
- padding-block: var(--bw-space-1);
6023
- padding-inline: var(--bw-space-3);
7623
+ /* Gap, text and the interactive height floor read the role variables
7624
+ * (CHP-010). Padding is the compact-pill model: a fixed fraction of the
7625
+ * container inset step the size names (inline three quarters, block a
7626
+ * quarter), so a chip stays a pill at every step and tracks density through
7627
+ * --bw-size-inset-<step>. At comfortable md that is 0.75rem and 0.25rem. */
7628
+ gap: var(--bw-control-gap);
7629
+ padding-block: calc(var(--bw-chip-inset, var(--bw-size-inset-md)) / 4);
7630
+ padding-inline: calc(var(--bw-chip-inset, var(--bw-size-inset-md)) * 0.75);
7631
+ margin: 0;
6024
7632
  border: var(--bw-size-border-hairline) solid transparent;
6025
7633
  border-radius: var(--bw-radius-full);
6026
- font-size: var(--bw-text-caption-size);
7634
+ font-size: var(--bw-control-font-size);
6027
7635
  font-weight: var(--bw-font-weight-medium);
6028
- line-height: var(--bw-text-caption-line-height);
7636
+ line-height: var(--bw-font-line-height-tight);
6029
7637
  background: var(--bw-color-surface-sunken);
6030
7638
  color: var(--bw-color-fg-muted);
6031
7639
  text-decoration: none;
@@ -6033,22 +7641,27 @@ input.bw-input[type="datetime-local"]:hover::-webkit-calendar-picker-indicator {
6033
7641
  transition: var(--bw-transition-colors);
6034
7642
  }
6035
7643
 
7644
+ /* Interactive chips (a toggle button, a link). WCAG 2.5.8 floor: never below
7645
+ * 1.5rem however small the density resolves; above it the floor follows the
7646
+ * control height (CHP-011). Only the font family is inherited: the size, weight
7647
+ * and line height stay the chip's own. */
6036
7648
  button.bw-chip,
6037
7649
  a.bw-chip {
7650
+ justify-content: center;
7651
+ min-block-size: max(1.5rem, calc(var(--bw-control-height) * 0.6));
7652
+ min-inline-size: 1.5rem;
7653
+ font-family: inherit;
6038
7654
  cursor: pointer;
6039
- font: inherit;
6040
7655
  }
6041
7656
 
6042
- .bw-chip--size-sm {
6043
- padding-block: var(--bw-space-0-5);
6044
- padding-inline: var(--bw-space-2);
7657
+ button.bw-chip:where(:hover:not(:disabled)),
7658
+ a.bw-chip:where(:hover:not([aria-disabled="true"])) {
7659
+ background-image: linear-gradient(var(--bw-state-hover-overlay), var(--bw-state-hover-overlay));
6045
7660
  }
6046
-
6047
- /* md is the documented default chip size (#120/#130): restates the base
6048
- * padding so the emitted class has a named rule. */
6049
- .bw-chip--size-md {
6050
- padding-block: var(--bw-space-1);
6051
- padding-inline: var(--bw-space-3);
7661
+ button.bw-chip:where(:active:not(:disabled)),
7662
+ a.bw-chip:where(:active:not([aria-disabled="true"])) {
7663
+ background-image: linear-gradient(var(--bw-state-active-overlay), var(--bw-state-active-overlay));
7664
+ transition-duration: var(--bw-duration-instant);
6052
7665
  }
6053
7666
 
6054
7667
  .bw-chip--neutral {
@@ -6075,35 +7688,193 @@ a.bw-chip {
6075
7688
  border-color: var(--bw-color-danger-border);
6076
7689
  }
6077
7690
 
6078
- .bw-chip--info {
6079
- background: var(--bw-color-info-subtle);
6080
- color: var(--bw-color-info-fg);
6081
- border-color: var(--bw-color-info-border);
7691
+ .bw-chip--info {
7692
+ background: var(--bw-color-info-subtle);
7693
+ color: var(--bw-color-info-fg);
7694
+ border-color: var(--bw-color-info-border);
7695
+ }
7696
+
7697
+ /* Pressed / selected paint is owned by Segmented (APP-003 / SEG-020). Chip
7698
+ * filter membership keeps .bw-chip--selected as the class name; the treatment
7699
+ * matches .bw-segmented__item[aria-pressed="true"]. GAP-CHP-1 closed by R11.
7700
+ */
7701
+ .bw-chip--selected {
7702
+ background: var(--bw-color-accent-subtle);
7703
+ color: var(--bw-component-nav-item-active-text);
7704
+ border-color: var(--bw-color-accent);
7705
+ box-shadow: none;
7706
+ }
7707
+
7708
+ /* Disabled (CHP-023): a disabled toggle, or an aria-disabled link. Outranks
7709
+ * the tone classes so the chip is flat whatever its tone. */
7710
+ button.bw-chip:disabled,
7711
+ a.bw-chip[aria-disabled="true"] {
7712
+ background: var(--bw-color-action-disabled-bg);
7713
+ background-image: none;
7714
+ color: var(--bw-color-action-disabled-text);
7715
+ border-color: var(--bw-color-action-disabled-border);
7716
+ box-shadow: none;
7717
+ cursor: not-allowed;
7718
+ }
7719
+
7720
+ /* The dismiss control (CHP-030): a real button inside a span chip. Its hit
7721
+ * area is at least 1.5rem square (WCAG 2.5.8); the negative block margin lets
7722
+ * that box overlap the chip's own padding so a dismissible chip is no taller
7723
+ * than a static one of the same step, and the negative end margin tucks it
7724
+ * into the inline padding. The glyph is the control icon size. */
7725
+ .bw-chip__close {
7726
+ display: inline-flex;
7727
+ align-items: center;
7728
+ justify-content: center;
7729
+ flex-shrink: 0;
7730
+ min-inline-size: 1.5rem;
7731
+ min-block-size: 1.5rem;
7732
+ margin-block: min(0px, calc((var(--bw-control-font-size) * var(--bw-font-line-height-tight) - 1.5rem) / 2));
7733
+ margin-inline-end: calc(var(--bw-control-gap) * -0.5);
7734
+ padding: 0;
7735
+ background: transparent;
7736
+ border: 0;
7737
+ border-radius: var(--bw-radius-full);
7738
+ color: inherit;
7739
+ cursor: pointer;
7740
+ transition: var(--bw-transition-colors);
7741
+ }
7742
+ .bw-chip__close .bw-icon,
7743
+ .bw-chip__close svg {
7744
+ inline-size: var(--bw-control-icon-size);
7745
+ block-size: var(--bw-control-icon-size);
7746
+ background: transparent;
7747
+ border-radius: 0;
7748
+ color: inherit;
7749
+ }
7750
+ .bw-chip__close:hover {
7751
+ background-color: var(--bw-state-hover-overlay);
7752
+ }
7753
+ .bw-chip__close:active {
7754
+ background-color: var(--bw-state-active-overlay);
7755
+ transition-duration: var(--bw-duration-instant);
7756
+ }
7757
+
7758
+ /* Dismissal exit, keyed on the marker bwDismissible stamps (CHP-032). The
7759
+ * global reduced-motion floor collapses it to an instant removal. */
7760
+ .bw-chip[data-bw-dismissing] {
7761
+ opacity: 0;
7762
+ transition: opacity var(--bw-duration-fast) var(--bw-ease-in);
7763
+ }
7764
+
7765
+ /* --- Segmented control (docs/components/segmented.md, R11 / C14) ------------ */
7766
+
7767
+ /* APP-003 pressed grammar owner. Size classes re-point the five control role
7768
+ * variables (SEG-010). Items read height, padding, gap and font from those
7769
+ * roles. Pressed paint is tinted fill, accent text and tinted border; the same
7770
+ * three tokens are applied to .bw-chip--selected and
7771
+ * .bw-button-group--segmented selected items (SEG-020). */
7772
+
7773
+ .bw-segmented--size-xs {
7774
+ --bw-control-height: var(--bw-size-control-height-xs);
7775
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-xs);
7776
+ --bw-control-icon-size: var(--bw-size-control-icon-xs);
7777
+ --bw-control-gap: var(--bw-size-control-gap-xs);
7778
+ --bw-control-font-size: var(--bw-font-size-xs);
7779
+ }
7780
+ .bw-segmented--size-sm {
7781
+ --bw-control-height: var(--bw-size-control-height-sm);
7782
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-sm);
7783
+ --bw-control-icon-size: var(--bw-size-control-icon-sm);
7784
+ --bw-control-gap: var(--bw-size-control-gap-sm);
7785
+ --bw-control-font-size: var(--bw-font-size-sm);
7786
+ }
7787
+ .bw-segmented--size-md {
7788
+ --bw-control-height: var(--bw-size-control-height-md);
7789
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
7790
+ --bw-control-icon-size: var(--bw-size-control-icon-md);
7791
+ --bw-control-gap: var(--bw-size-control-gap-md);
7792
+ --bw-control-font-size: var(--bw-font-size-md);
7793
+ }
7794
+ .bw-segmented--size-lg {
7795
+ --bw-control-height: var(--bw-size-control-height-lg);
7796
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-lg);
7797
+ --bw-control-icon-size: var(--bw-size-control-icon-lg);
7798
+ --bw-control-gap: var(--bw-size-control-gap-lg);
7799
+ --bw-control-font-size: var(--bw-font-size-lg);
7800
+ }
7801
+ .bw-segmented--size-xl {
7802
+ --bw-control-height: var(--bw-size-control-height-xl);
7803
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-xl);
7804
+ --bw-control-icon-size: var(--bw-size-control-icon-xl);
7805
+ --bw-control-gap: var(--bw-size-control-gap-xl);
7806
+ --bw-control-font-size: var(--bw-font-size-xl);
7807
+ }
7808
+
7809
+ .bw-segmented {
7810
+ display: inline-flex;
7811
+ flex-wrap: nowrap;
7812
+ align-items: stretch;
7813
+ gap: var(--bw-control-gap);
7814
+ padding: var(--bw-space-1);
7815
+ border-radius: var(--bw-radius-md);
7816
+ border: var(--bw-size-border-hairline) solid var(--bw-color-border);
7817
+ background: var(--bw-color-surface-sunken);
7818
+ vertical-align: middle;
7819
+ }
7820
+
7821
+ .bw-segmented__item {
7822
+ appearance: none;
7823
+ box-sizing: border-box;
7824
+ display: inline-flex;
7825
+ align-items: center;
7826
+ justify-content: center;
7827
+ margin: 0;
7828
+ min-block-size: max(1.5rem, var(--bw-control-height));
7829
+ padding-block: 0;
7830
+ padding-inline: var(--bw-control-padding-inline);
7831
+ border: var(--bw-size-border-hairline) solid transparent;
7832
+ border-radius: calc(var(--bw-radius-md) - 2px);
7833
+ background: transparent;
7834
+ color: var(--bw-color-fg-muted);
7835
+ font: inherit;
7836
+ font-size: var(--bw-control-font-size);
7837
+ line-height: 1;
7838
+ cursor: pointer;
7839
+ transition: var(--bw-transition-colors);
7840
+ }
7841
+
7842
+ .bw-segmented__item:hover:where(:not(:disabled):not([aria-pressed="true"]):not([data-bw-active])) {
7843
+ color: var(--bw-color-fg);
7844
+ background: var(--bw-state-hover-overlay);
7845
+ }
7846
+
7847
+ .bw-segmented__item[aria-pressed="true"],
7848
+ .bw-segmented__item[data-bw-active] {
7849
+ background: var(--bw-color-accent-subtle);
7850
+ color: var(--bw-component-nav-item-active-text);
7851
+ border-color: var(--bw-color-accent);
7852
+ }
7853
+
7854
+ .bw-segmented__item:focus-visible {
7855
+ outline: 2px solid var(--bw-color-focus-ring, var(--bw-color-accent));
7856
+ outline-offset: 2px;
7857
+ z-index: 1;
6082
7858
  }
6083
7859
 
6084
- .bw-chip--selected {
6085
- box-shadow: inset 0 0 0 var(--bw-size-border-thick) var(--bw-color-accent);
6086
- color: var(--bw-color-fg);
7860
+ .bw-segmented__item:disabled {
7861
+ color: var(--bw-color-action-disabled-text);
7862
+ background: transparent;
7863
+ border-color: transparent;
7864
+ cursor: not-allowed;
6087
7865
  }
6088
7866
 
6089
- .bw-chip__close {
6090
- display: inline-flex;
6091
- align-items: center;
6092
- justify-content: center;
6093
- margin-inline-end: calc(var(--bw-space-1) * -1);
6094
- padding: var(--bw-space-0-5);
6095
- background: transparent;
6096
- border: 0;
6097
- border-radius: var(--bw-radius-full);
6098
- color: inherit;
6099
- cursor: pointer;
6100
- opacity: 0.75;
7867
+ .bw-segmented__item:disabled[aria-pressed="true"],
7868
+ .bw-segmented__item:disabled[data-bw-active] {
7869
+ background: var(--bw-color-action-disabled-bg);
7870
+ color: var(--bw-color-action-disabled-text);
7871
+ border-color: var(--bw-color-action-disabled-border);
6101
7872
  }
6102
7873
 
6103
- .bw-chip__close:hover,
6104
- .bw-chip__close:focus-visible {
6105
- opacity: 1;
6106
- background: var(--bw-state-hover-overlay);
7874
+ @media (prefers-reduced-motion: reduce) {
7875
+ .bw-segmented__item {
7876
+ transition: none;
7877
+ }
6107
7878
  }
6108
7879
 
6109
7880
  /* --- Button group (Beat Phase B, #542) ------------------------------------- */
@@ -6167,11 +7938,15 @@ a.bw-chip {
6167
7938
  box-shadow: none;
6168
7939
  }
6169
7940
 
7941
+ /* Selected item uses the Segmented pressed grammar (APP-003 / SEG-020), not
7942
+ * a raised surface card. Elevation is not the selected cue. */
6170
7943
  .bw-button-group--segmented .bw-button-group__item--selected,
6171
- .bw-button-group--segmented .bw-button-group__item[aria-checked="true"] {
6172
- background: var(--bw-color-surface);
6173
- color: var(--bw-color-fg);
6174
- box-shadow: var(--bw-elevation-1);
7944
+ .bw-button-group--segmented .bw-button-group__item[aria-checked="true"],
7945
+ .bw-button-group--segmented .bw-button-group__item[aria-pressed="true"] {
7946
+ background: var(--bw-color-accent-subtle);
7947
+ color: var(--bw-component-nav-item-active-text);
7948
+ border-color: var(--bw-color-accent);
7949
+ box-shadow: none;
6175
7950
  }
6176
7951
 
6177
7952
  /* --- List item / media row (Beat Phase B, #542) ---------------------------- */
@@ -6291,8 +8066,8 @@ a.bw-chip {
6291
8066
  [data-theme="dark"] .bw-card--elevation-3 {
6292
8067
  box-shadow: var(--bw-elevation-3);
6293
8068
  }
6294
- [data-theme="dark"] .bw-card--interactive:hover,
6295
- [data-theme="dark"] .bw-card--interactive:focus-within,
8069
+ [data-theme="dark"] .bw-card--interactive:not(.bw-card--bordered):hover,
8070
+ [data-theme="dark"] .bw-card--interactive:not(.bw-card--bordered):focus-within,
6296
8071
  [data-theme="dark"] a.bw-stat:hover {
6297
8072
  box-shadow: var(--bw-elevation-2);
6298
8073
  }
@@ -6303,6 +8078,7 @@ a.bw-chip {
6303
8078
  [data-theme="dark"] .bw-dropdown__panel,
6304
8079
  [data-theme="dark"] .bw-version-switch__panel,
6305
8080
  [data-theme="dark"] .bw-theme-switch__panel,
8081
+ [data-theme="dark"] .bw-popover__panel,
6306
8082
  [data-theme="dark"] .bw-combobox__listbox {
6307
8083
  box-shadow: var(--bw-elevation-3);
6308
8084
  }
@@ -6312,9 +8088,6 @@ a.bw-chip {
6312
8088
  [data-theme="dark"] .bw-modal:is(.bw-modal--open, [data-bw-open]) .bw-modal__panel {
6313
8089
  box-shadow: var(--bw-elevation-4);
6314
8090
  }
6315
- [data-theme="dark"] .bw-slide-over[data-bw-open] .bw-slide-over__panel {
6316
- box-shadow: var(--bw-elevation-4);
6317
- }
6318
8091
 
6319
8092
  /* --- Token specimen (THM-016, icvoss/django-brickwork#268) ----------------
6320
8093
  * Live brand-token presentation: dual light/dark panes, swatch from the
@@ -6331,7 +8104,7 @@ a.bw-chip {
6331
8104
  .bw-token-specimen__heading {
6332
8105
  margin: 0;
6333
8106
  font-family: var(--bw-font-family-sans);
6334
- font-size: var(--bw-font-size-xl);
8107
+ font-size: var(--bw-font-size-2xl);
6335
8108
  font-weight: var(--bw-font-weight-semibold);
6336
8109
  color: var(--bw-color-fg);
6337
8110
  line-height: var(--bw-font-line-height-snug);
@@ -6791,6 +8564,44 @@ a.bw-article-meta__tag-link:focus-visible {
6791
8564
 
6792
8565
  /* --- Input group (prefix/suffix addons, #624) ------------------------------ */
6793
8566
 
8567
+ /* Size (ADR-125, ADR-126; SIZE-COVERAGE gate 2): the group re-points the
8568
+ * five control role variables so the field and every addon inherit one step.
8569
+ * Grammar matches bw-input--size-* / bw-btn--size-* / bw-combobox--size-*. */
8570
+ .bw-input-group--size-xs {
8571
+ --bw-control-height: var(--bw-size-control-height-xs);
8572
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-xs);
8573
+ --bw-control-icon-size: var(--bw-size-control-icon-xs);
8574
+ --bw-control-gap: var(--bw-size-control-gap-xs);
8575
+ --bw-control-font-size: var(--bw-font-size-xs);
8576
+ }
8577
+ .bw-input-group--size-sm {
8578
+ --bw-control-height: var(--bw-size-control-height-sm);
8579
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-sm);
8580
+ --bw-control-icon-size: var(--bw-size-control-icon-sm);
8581
+ --bw-control-gap: var(--bw-size-control-gap-sm);
8582
+ --bw-control-font-size: var(--bw-font-size-sm);
8583
+ }
8584
+ .bw-input-group--size-md {
8585
+ --bw-control-height: var(--bw-size-control-height-md);
8586
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
8587
+ --bw-control-icon-size: var(--bw-size-control-icon-md);
8588
+ --bw-control-gap: var(--bw-size-control-gap-md);
8589
+ --bw-control-font-size: var(--bw-font-size-md);
8590
+ }
8591
+ .bw-input-group--size-lg {
8592
+ --bw-control-height: var(--bw-size-control-height-lg);
8593
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-lg);
8594
+ --bw-control-icon-size: var(--bw-size-control-icon-lg);
8595
+ --bw-control-gap: var(--bw-size-control-gap-lg);
8596
+ --bw-control-font-size: var(--bw-font-size-lg);
8597
+ }
8598
+ .bw-input-group--size-xl {
8599
+ --bw-control-height: var(--bw-size-control-height-xl);
8600
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-xl);
8601
+ --bw-control-icon-size: var(--bw-size-control-icon-xl);
8602
+ --bw-control-gap: var(--bw-size-control-gap-xl);
8603
+ --bw-control-font-size: var(--bw-font-size-xl);
8604
+ }
6794
8605
  .bw-input-group {
6795
8606
  display: flex;
6796
8607
  align-items: stretch;
@@ -6813,12 +8624,14 @@ a.bw-article-meta__tag-link:focus-visible {
6813
8624
  display: inline-flex;
6814
8625
  flex: 0 0 auto;
6815
8626
  align-items: center;
6816
- gap: var(--bw-space-1);
6817
- padding-inline: var(--bw-density-control-padding-inline);
8627
+ gap: var(--bw-control-gap);
8628
+ padding-inline: var(--bw-control-padding-inline);
6818
8629
  border: var(--bw-size-border-hairline) solid var(--bw-color-border-control);
6819
8630
  background: var(--bw-color-surface-sunken);
6820
8631
  color: var(--bw-color-fg-muted);
6821
- font-size: var(--bw-text-body-sm-size);
8632
+ /* Size follows the control step (role variable), not a fixed body-sm role,
8633
+ * so an input-group--size-* class keeps the addon text with the field. */
8634
+ font-size: var(--bw-control-font-size);
6822
8635
  line-height: var(--bw-text-body-sm-line-height);
6823
8636
  white-space: nowrap;
6824
8637
  position: relative;
@@ -6865,3 +8678,328 @@ a.bw-article-meta__tag-link:focus-visible {
6865
8678
  .bw-input-group:has(.bw-input[aria-invalid="true"]) .bw-input-group__addon {
6866
8679
  border-color: var(--bw-color-danger);
6867
8680
  }
8681
+
8682
+
8683
+ /* --- Description list (D15 / R19) ------------------------------------------- */
8684
+
8685
+ /* A semantic <dl>-based key-value display atom: stacked (default) and inline
8686
+ * layouts, with an optional divided hairline between groups.
8687
+ *
8688
+ * Grammar (closed; DDL-004):
8689
+ * .bw-description-list root <dl>
8690
+ * .bw-description-list__term <dt> element
8691
+ * .bw-description-list__details <dd> element
8692
+ * .bw-description-list--inline modifier: term and details on one row
8693
+ * .bw-description-list--divided modifier: hairline between groups
8694
+ *
8695
+ * Tokens read (DDL-015; no raw colour):
8696
+ * --bw-size-gap-md row gap between pairs / groups
8697
+ * --bw-color-fg-muted term ink (DDL-013)
8698
+ * --bw-color-fg details ink (DDL-014)
8699
+ * --bw-color-border divided hairline colour (DDL-012)
8700
+ * --bw-size-border-hairline divided hairline width
8701
+ * --bw-component-description-list-term-size term column min-inline-size in inline layout
8702
+ *
8703
+ * Type utilities applied by HTML / React / Vue consumers (not set here):
8704
+ * bw-text-xs on <dt> (caption role; DDL-013)
8705
+ * bw-text-md on <dd> (body role; DDL-014)
8706
+ *
8707
+ * Logical properties throughout (DDL-016). No breakpoint switch on this
8708
+ * component. At 320 px, details text wraps within its remaining column space;
8709
+ * overflow-wrap: anywhere on <dd> handles long unbreakable strings (DDL-017).
8710
+ *
8711
+ * Grouping <div> wrappers are optional in stacked mode and required in inline
8712
+ * and divided mode for column alignment and correct hairline placement (DDL-003).
8713
+ * React auto-wraps pairs when layout="inline" or divided is set. */
8714
+
8715
+ .bw-description-list {
8716
+ /* Flex column so pair spacing can target successive groups (or bare
8717
+ * dt/dd pairs) without putting the same gap between a term and its own
8718
+ * details (DDL-010: term directly above details; gap between pairs). */
8719
+ display: flex;
8720
+ flex-direction: column;
8721
+ margin: 0;
8722
+ padding: 0;
8723
+ }
8724
+
8725
+ /* Gap between successive pairs when grouped in a <div>. */
8726
+ .bw-description-list > div + div {
8727
+ margin-block-start: var(--bw-size-gap-md);
8728
+ }
8729
+
8730
+ /* Gap between successive pairs when bare: after a details, before the next term. */
8731
+ .bw-description-list > .bw-description-list__details + .bw-description-list__term {
8732
+ margin-block-start: var(--bw-size-gap-md);
8733
+ }
8734
+
8735
+ .bw-description-list__term {
8736
+ /* dt inherits display: block; reset the UA margin. */
8737
+ margin: 0;
8738
+ color: var(--bw-color-fg-muted);
8739
+ }
8740
+
8741
+ .bw-description-list__details {
8742
+ /* dd has a UA margin-inline-start; reset it. */
8743
+ margin: 0;
8744
+ color: var(--bw-color-fg);
8745
+ /* Prevent long unbreakable strings from overflowing at 320 px (DDL-017). */
8746
+ overflow-wrap: anywhere;
8747
+ }
8748
+
8749
+ /* Inline layout: group <div>s become flex rows so term and details sit side
8750
+ * by side. The term's min-inline-size aligns columns across all pairs. The
8751
+ * details fill remaining inline space and wrap rather than overflow (DDL-011,
8752
+ * DDL-017). align-items: baseline keeps short labels optically level with
8753
+ * value text. */
8754
+ .bw-description-list--inline > div {
8755
+ display: flex;
8756
+ flex-wrap: wrap;
8757
+ align-items: baseline;
8758
+ }
8759
+
8760
+ .bw-description-list--inline .bw-description-list__term {
8761
+ min-inline-size: var(--bw-component-description-list-term-size);
8762
+ flex-shrink: 0;
8763
+ }
8764
+
8765
+ .bw-description-list--inline .bw-description-list__details {
8766
+ flex: 1 1 0;
8767
+ min-inline-size: 0;
8768
+ }
8769
+
8770
+ /* Divided mode: hairline border-block-end between successive groups.
8771
+ * :not(:last-child) omits the trailing hairline on the final row (DDL-012,
8772
+ * troubleshooting note). padding-block-end preserves the visual row gap
8773
+ * between the content and the hairline so the hairline floats between pairs
8774
+ * rather than abutting the lower row's term. Groups are required in divided
8775
+ * mode; bare dt/dd divided is not supported (DDL-003). */
8776
+ .bw-description-list--divided > div:not(:last-child) {
8777
+ border-block-end: var(--bw-size-border-hairline) solid var(--bw-color-border);
8778
+ padding-block-end: var(--bw-size-gap-md);
8779
+ }
8780
+
8781
+ /* --- Number stepper (docs/components/number-stepper.md, R50 / C19) ----------- */
8782
+
8783
+ /* .bw-number-stepper is the quantity adjuster: a flex row of a decrement
8784
+ * button, a native <input type="number">, and an increment button, all in a
8785
+ * connected group. The block reads the five control role variables only
8786
+ * (NST-010); size classes re-point them, same grammar as .bw-input--size-*
8787
+ * and .bw-switch--size-* (ADR-125). md is the default; React and Vue always
8788
+ * emit a size class.
8789
+ *
8790
+ * Connected group chrome (NST-012): outer corners carry --bw-radius-md via
8791
+ * logical properties; shared internal borders are single hairlines via
8792
+ * border-inline-end on the decrement button and border-inline-start on the
8793
+ * increment button; the input carries no additional side borders. No gap
8794
+ * between parts.
8795
+ *
8796
+ * RTL (NST-016): logical properties throughout. The flex row reverses through
8797
+ * direction inheritance so the decrement button (first in DOM) appears at the
8798
+ * inline end and the increment button at the inline start, which is the
8799
+ * correct UX in both directions. The internal side-border rules keep the
8800
+ * shared borders on the correct edges.
8801
+ *
8802
+ * Native spin arrows are suppressed (NST-013). No colour literals (NST-015).
8803
+ * Motion uses --bw-transition-colors (NST-017). */
8804
+
8805
+ .bw-number-stepper--size-xs {
8806
+ --bw-control-height: var(--bw-size-control-height-xs);
8807
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-xs);
8808
+ --bw-control-icon-size: var(--bw-size-control-icon-xs);
8809
+ --bw-control-gap: var(--bw-size-control-gap-xs);
8810
+ --bw-control-font-size: var(--bw-font-size-xs);
8811
+ }
8812
+ .bw-number-stepper--size-sm {
8813
+ --bw-control-height: var(--bw-size-control-height-sm);
8814
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-sm);
8815
+ --bw-control-icon-size: var(--bw-size-control-icon-sm);
8816
+ --bw-control-gap: var(--bw-size-control-gap-sm);
8817
+ --bw-control-font-size: var(--bw-font-size-sm);
8818
+ }
8819
+ .bw-number-stepper--size-md {
8820
+ --bw-control-height: var(--bw-size-control-height-md);
8821
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
8822
+ --bw-control-icon-size: var(--bw-size-control-icon-md);
8823
+ --bw-control-gap: var(--bw-size-control-gap-md);
8824
+ --bw-control-font-size: var(--bw-font-size-md);
8825
+ }
8826
+ .bw-number-stepper--size-lg {
8827
+ --bw-control-height: var(--bw-size-control-height-lg);
8828
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-lg);
8829
+ --bw-control-icon-size: var(--bw-size-control-icon-lg);
8830
+ --bw-control-gap: var(--bw-size-control-gap-lg);
8831
+ --bw-control-font-size: var(--bw-font-size-lg);
8832
+ }
8833
+ .bw-number-stepper--size-xl {
8834
+ --bw-control-height: var(--bw-size-control-height-xl);
8835
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-xl);
8836
+ --bw-control-icon-size: var(--bw-size-control-icon-xl);
8837
+ --bw-control-gap: var(--bw-size-control-gap-xl);
8838
+ --bw-control-font-size: var(--bw-font-size-xl);
8839
+ }
8840
+
8841
+ /* Root: flex row, no gap. The three children share borders to form one
8842
+ * connected group. */
8843
+ .bw-number-stepper {
8844
+ display: inline-flex;
8845
+ align-items: stretch;
8846
+ min-inline-size: 0;
8847
+ cursor: default;
8848
+ }
8849
+
8850
+ /* Buttons: square at the control height; centred icon; connected-group
8851
+ * outer corners via logical border-radius. */
8852
+ .bw-number-stepper__button {
8853
+ display: inline-flex;
8854
+ align-items: center;
8855
+ justify-content: center;
8856
+ flex: 0 0 auto;
8857
+ inline-size: var(--bw-control-height);
8858
+ block-size: var(--bw-control-height);
8859
+ min-block-size: 1.5rem;
8860
+ min-inline-size: 1.5rem;
8861
+ border: var(--bw-size-border-hairline) solid var(--bw-color-border-control);
8862
+ background: var(--bw-color-surface);
8863
+ color: var(--bw-color-fg);
8864
+ cursor: pointer;
8865
+ transition: var(--bw-transition-colors);
8866
+ /* Icon inside reads the control icon size role variable. */
8867
+ font-size: var(--bw-control-icon-size);
8868
+ line-height: 1;
8869
+ }
8870
+
8871
+ .bw-number-stepper__button--decrement {
8872
+ border-start-start-radius: var(--bw-radius-md);
8873
+ border-end-start-radius: var(--bw-radius-md);
8874
+ /* Outer corners only; border-inline-end (the shared hairline to the input)
8875
+ * is kept so the internal boundary is visible (NST-012). */
8876
+ }
8877
+
8878
+ .bw-number-stepper__button--increment {
8879
+ border-start-end-radius: var(--bw-radius-md);
8880
+ border-end-end-radius: var(--bw-radius-md);
8881
+ /* Outer corners only; border-inline-start (the shared hairline to the input)
8882
+ * is kept so the internal boundary is visible (NST-012). */
8883
+ }
8884
+
8885
+ /* Input: fills remaining inline space; native spin arrows suppressed;
8886
+ * centred numeric value. No side borders (they are on the buttons). */
8887
+ .bw-number-stepper__input {
8888
+ flex: 1 1 auto;
8889
+ min-inline-size: 2.5rem;
8890
+ block-size: var(--bw-control-height);
8891
+ min-block-size: 1.5rem;
8892
+ padding-inline: var(--bw-control-gap);
8893
+ border: var(--bw-size-border-hairline) solid var(--bw-color-border-control);
8894
+ border-inline: none;
8895
+ background: var(--bw-color-surface);
8896
+ color: var(--bw-color-fg);
8897
+ font: inherit;
8898
+ font-size: var(--bw-control-font-size);
8899
+ text-align: center;
8900
+ transition: var(--bw-transition-colors);
8901
+ /* Suppress native spin arrows (NST-013). */
8902
+ appearance: none;
8903
+ -moz-appearance: textfield;
8904
+ }
8905
+
8906
+ /* Suppress WebKit/Blink spin pseudo-elements. */
8907
+ .bw-number-stepper__input::-webkit-inner-spin-button,
8908
+ .bw-number-stepper__input::-webkit-outer-spin-button {
8909
+ -webkit-appearance: none;
8910
+ margin: 0;
8911
+ }
8912
+
8913
+ /* Placeholder: fg-muted, same floor as Input. */
8914
+ .bw-number-stepper__input::placeholder {
8915
+ color: var(--bw-color-fg-muted);
8916
+ opacity: 1;
8917
+ }
8918
+
8919
+ /* SVG icon inside the buttons: reads the icon-size role variable. */
8920
+ .bw-number-stepper__button .bw-icon {
8921
+ inline-size: var(--bw-control-icon-size);
8922
+ block-size: var(--bw-control-icon-size);
8923
+ flex-shrink: 0;
8924
+ fill: none;
8925
+ }
8926
+
8927
+ /* ---- Hover states (NST-032) ---- */
8928
+
8929
+ .bw-number-stepper__button:hover:where(:not(:disabled)) {
8930
+ background: var(--bw-color-surface-sunken);
8931
+ }
8932
+
8933
+ .bw-number-stepper__input:hover:where(:not(:disabled):not([readonly]):not(:focus-visible)) {
8934
+ border-color: color-mix(in oklab, var(--bw-color-border-control) 82%, var(--bw-color-fg));
8935
+ }
8936
+
8937
+ /* ---- Focus-visible (NST-033): ring on the focused element, not the group ---- */
8938
+
8939
+ .bw-number-stepper__button:focus-visible,
8940
+ .bw-number-stepper__input:focus-visible {
8941
+ outline: 2px solid var(--bw-color-focus-ring);
8942
+ outline-offset: 2px;
8943
+ position: relative;
8944
+ z-index: 1;
8945
+ }
8946
+
8947
+ .bw-number-stepper__input:focus-visible {
8948
+ border-color: var(--bw-color-accent);
8949
+ }
8950
+
8951
+ /* ---- Disabled (NST-040) ---- */
8952
+
8953
+ .bw-number-stepper:has(.bw-number-stepper__input:disabled) {
8954
+ cursor: not-allowed;
8955
+ }
8956
+
8957
+ .bw-number-stepper__button:disabled {
8958
+ background: var(--bw-color-action-disabled-bg);
8959
+ color: var(--bw-color-action-disabled-text);
8960
+ border-color: var(--bw-color-action-disabled-border);
8961
+ cursor: not-allowed;
8962
+ }
8963
+
8964
+ .bw-number-stepper__input:disabled {
8965
+ background: var(--bw-color-action-disabled-bg);
8966
+ color: var(--bw-color-action-disabled-text);
8967
+ border-color: var(--bw-color-action-disabled-border);
8968
+ cursor: not-allowed;
8969
+ }
8970
+
8971
+ .bw-number-stepper__input:disabled::placeholder {
8972
+ color: var(--bw-color-action-disabled-text);
8973
+ }
8974
+
8975
+ /* ---- Readonly (NST-041): input sunken; buttons disabled-looking ---- */
8976
+
8977
+ .bw-number-stepper__input[readonly] {
8978
+ background: var(--bw-color-surface-sunken);
8979
+ }
8980
+
8981
+ /* ---- Invalid (NST-053): danger border on the whole group ---- */
8982
+
8983
+ .bw-number-stepper__input[aria-invalid="true"],
8984
+ .bw-field--invalid .bw-number-stepper__input {
8985
+ border-color: var(--bw-color-danger);
8986
+ }
8987
+
8988
+ .bw-number-stepper__input[aria-invalid="true"] ~ .bw-number-stepper__button--increment,
8989
+ .bw-field--invalid .bw-number-stepper__button--increment {
8990
+ border-color: var(--bw-color-danger);
8991
+ }
8992
+
8993
+ .bw-number-stepper:has(.bw-number-stepper__input[aria-invalid="true"]) .bw-number-stepper__button--decrement,
8994
+ .bw-field--invalid .bw-number-stepper__button--decrement {
8995
+ border-color: var(--bw-color-danger);
8996
+ }
8997
+
8998
+ /* ---- Reduced motion (NST-017) ---- */
8999
+
9000
+ @media (prefers-reduced-motion: reduce) {
9001
+ .bw-number-stepper__button,
9002
+ .bw-number-stepper__input {
9003
+ transition: none;
9004
+ }
9005
+ }