@bwui/css 0.1.9 → 0.1.12

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.
@@ -143,7 +143,7 @@
143
143
  * .bw-btn--solid is the early-draft name of primary. It is DEPRECATED, kept
144
144
  * here as an alias through :is() (class weight) for the window ADR-125 sets
145
145
  * for the bare size classes, and removed with them. Its old standalone rule
146
- * 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
147
147
  * shim (GAP-BTN-6). */
148
148
  :is(.bw-btn--primary, .bw-btn--solid) {
149
149
  background: var(--bw-color-accent);
@@ -285,70 +285,115 @@
285
285
  }
286
286
  }
287
287
 
288
- /* --- Badges ---------------------------------------------------------------- */
288
+ /* --- Badges (docs/components/badge.md) ------------------------------------- */
289
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). */
290
296
  .bw-badge {
291
297
  display: inline-flex;
292
298
  align-items: center;
293
299
  gap: var(--bw-space-1);
294
- padding-block: var(--bw-space-0-5);
295
- 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);
296
303
  /* transparent hairline so intent variants (tinted borders) keep the same
297
304
  geometry as the neutral badge */
298
305
  border: var(--bw-size-border-hairline) solid transparent;
299
306
  border-radius: var(--bw-radius-full);
300
307
  font-size: var(--bw-text-caption-size);
301
308
  font-weight: var(--bw-font-weight-medium);
309
+ line-height: var(--bw-text-caption-line-height);
302
310
  font-variant-numeric: tabular-nums;
303
311
  background: var(--bw-color-surface-sunken);
304
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);
305
324
  }
306
- /* The documented default variant (#100): bw_badge's no-args default is
307
- * variant="neutral", so the contract needs a real .bw-badge--neutral rule,
308
- * not a look left implicit in the base class. The values restate the base's
309
- * neutral chip treatment (sunken surface, muted fg, the transparent hairline
310
- * that keeps every variant on the same geometry); fg-muted on surface-sunken
311
- * measures AA in both themes (the same pairing muted body text already
312
- * relies on). Neutral is the correct default per the badge-vs-alert rule
313
- * (STA-008): a badge carries neutral information, never error communication. */
325
+
314
326
  .bw-badge--neutral {
315
327
  background: var(--bw-color-surface-sunken);
316
328
  color: var(--bw-color-fg-muted);
317
329
  border-color: transparent;
318
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
+
319
341
  .bw-badge--success {
320
342
  background: var(--bw-color-success-subtle);
321
343
  color: var(--bw-color-success-fg);
322
344
  border-color: var(--bw-color-success-border);
323
345
  }
346
+
324
347
  .bw-badge--warning {
325
348
  background: var(--bw-color-warning-subtle);
326
349
  color: var(--bw-color-warning-fg);
327
350
  border-color: var(--bw-color-warning-border);
328
351
  }
352
+
329
353
  .bw-badge--danger {
330
354
  background: var(--bw-color-danger-subtle);
331
355
  color: var(--bw-color-danger-fg);
332
356
  border-color: var(--bw-color-danger-border);
333
357
  }
358
+
334
359
  .bw-badge--info {
335
360
  background: var(--bw-color-info-subtle);
336
361
  color: var(--bw-color-info-fg);
337
362
  border-color: var(--bw-color-info-border);
338
363
  }
339
364
 
340
- /* --- 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) ------------------------------------ */
341
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). */
342
377
  .bw-alert {
343
378
  display: flex;
379
+ align-items: flex-start;
344
380
  gap: var(--bw-space-3);
345
381
  padding: var(--bw-space-4);
346
382
  border-radius: var(--bw-radius-lg); /* joins the card radius family */
347
383
  border: var(--bw-size-border-hairline) solid var(--bw-color-border);
348
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 */
349
394
  }
350
395
  /* The text region between the icon and the optional close button
351
- * (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
352
397
  * collapses to content width instead of filling the row, matching
353
398
  * .bw-toast__message and .bw-modal__body's own flex: 1 1 auto. min-inline-size:
354
399
  * 0 lets it actually shrink below its content's natural width (the row is
@@ -371,10 +416,14 @@
371
416
  font-size: var(--bw-text-body-sm-size);
372
417
  font-weight: var(--bw-text-body-sm-weight);
373
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);
374
423
  }
375
424
  /* Variant borders use the per-intent tint-border tokens (decorative tint,
376
425
  * softer than the full-strength intent colour and not relied on for
377
- * 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. */
378
427
  .bw-alert--info {
379
428
  background: var(--bw-color-info-subtle);
380
429
  border-color: var(--bw-color-info-border);
@@ -415,7 +464,7 @@
415
464
  .bw-alert--danger .bw-alert__title {
416
465
  color: var(--bw-color-danger-fg);
417
466
  }
418
- /* 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
419
468
  * does not compress, matching .bw-modal__close/.bw-slide-over__close/
420
469
  * .bw-toast__close. No margin-inline-start: auto needed here: .bw-alert__body
421
470
  * already carries flex: 1 1 auto, so it fills the remaining row space and
@@ -424,6 +473,149 @@
424
473
  flex-shrink: 0;
425
474
  }
426
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
+
427
619
  /* --- Form fields ----------------------------------------------------------- */
428
620
 
429
621
  /* Forms hold the designed measure: the max-width-form token caps the field
@@ -445,18 +637,25 @@
445
637
  .bw-field {
446
638
  display: flex;
447
639
  flex-direction: column;
448
- gap: var(--bw-space-1);
449
- 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);
450
645
  max-inline-size: var(--bw-size-max-width-form);
451
646
  }
452
647
  .bw-field__label {
648
+ color: var(--bw-color-fg);
649
+ font-family: var(--bw-text-label-family);
453
650
  font-size: var(--bw-text-label-size);
454
651
  font-weight: var(--bw-text-label-weight);
455
652
  line-height: var(--bw-text-label-line-height);
653
+ letter-spacing: var(--bw-text-label-tracking);
456
654
  }
457
655
  .bw-field__required {
458
656
  /* danger-fg, not raw danger: the text-duty tier holds AA at caption size. */
459
657
  color: var(--bw-color-danger-fg);
658
+ font-weight: var(--bw-text-label-weight);
460
659
  }
461
660
  /* The widget wrapper (icvoss/django-brickwork#130): every field renderer
462
661
  * (_field.html, _combobox.html, _dropzone.html, _tag_input.html) wraps its
@@ -469,15 +668,66 @@
469
668
  display: block;
470
669
  min-inline-size: 0;
471
670
  }
472
- .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 {
473
719
  inline-size: 100%;
474
- block-size: var(--bw-density-control-height);
475
- padding-inline: var(--bw-density-control-padding-inline);
720
+ block-size: var(--bw-control-height);
721
+ padding-inline: var(--bw-control-padding-inline);
476
722
  border: var(--bw-size-border-hairline) solid var(--bw-color-border-control);
477
723
  border-radius: var(--bw-radius-md);
478
724
  background: var(--bw-color-surface);
479
725
  color: var(--bw-color-fg);
480
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);
481
731
  /* Inner top hairline (0.7.0 craft): black at 4% alpha, the faint recessed
482
732
  * top edge that makes the field read as a well rather than a flat rectangle
483
733
  * (the button bevel's counterpart, same black-literal shadow convention as
@@ -488,20 +738,33 @@
488
738
  /* Textareas share .bw-input chrome but must honour rows= (and grow with
489
739
  * content). Fixed block-size on .bw-input collapsed every textarea to a
490
740
  * single-line control height (icvoss/django-brickwork#521). */
491
- textarea.bw-input {
741
+ textarea.bw-input,
742
+ .bw-textarea {
492
743
  block-size: auto;
493
- min-block-size: calc(var(--bw-density-control-height) * 3);
494
- 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);
495
746
  resize: vertical;
496
747
  field-sizing: content;
497
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
+ }
498
760
  /* Hover pre-light: one perceptible step from the control border toward ink.
499
761
  * Mixing toward fg (82% border-control, 18% fg) is theme-correct in both
500
762
  * directions automatically, because fg flips with the theme: measured 4.47:1
501
763
  * against the light surface and 4.61:1 against the dark (the resting border's
502
764
  * 3.23/3.39 stays the 1.4.11 floor). :where() keeps the guards at zero
503
765
  * specificity so the later focus-visible and invalid border rules still win. */
504
- .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)) {
505
768
  border-color: color-mix(in oklab, var(--bw-color-border-control) 82%, var(--bw-color-fg));
506
769
  }
507
770
  /* The focus ring itself comes from the global :focus-visible rule; the border
@@ -511,134 +774,310 @@ textarea.bw-input {
511
774
  * the surface, purely decorative) hugs the input's own radius beneath the
512
775
  * offset outline, so focus reads at the control edge as well as the ring;
513
776
  * the inner hairline is restated so the well doesn't pop flat on focus. */
514
- .bw-input:focus-visible {
777
+ .bw-input:focus-visible,
778
+ .bw-textarea:focus-visible {
515
779
  border-color: var(--bw-color-accent);
516
780
  box-shadow:
517
781
  inset 0 1px 2px 0 oklch(0 0 0 / 0.04),
518
782
  0 0 0 3px color-mix(in oklab, var(--bw-color-accent) 18%, transparent);
519
783
  }
520
- /* Select (0.7.0 craft): the UA chrome goes, the input's own drawing stays, and
521
- * the affordance is an embedded chevron (--bw-component-select-indicator, a component
522
- * token carrying a data-URI SVG; its baked mid-grey and measured ratios are
523
- * documented on the token). Sized to the sm icon step, seated inside the
524
- * control padding; the end padding clears glyph plus a breathing space.
525
- * background-position has no logical form, so RTL swaps the corner via
526
- * [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,
527
845
  select.bw-input {
528
846
  appearance: none;
529
- background-image: var(--bw-component-select-indicator);
530
- background-repeat: no-repeat;
531
- background-position: right var(--bw-density-control-padding-inline) center;
532
- 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). */
533
852
  padding-inline-end: calc(
534
- 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)
535
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);
536
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,
537
873
  [dir="rtl"] select.bw-input {
538
- background-position: left var(--bw-density-control-padding-inline) center;
874
+ background-position: left var(--bw-control-padding-inline) center;
539
875
  }
540
- /* background-color, not the shorthand: the shorthand also reset
541
- * background-image, so a disabled select.bw-input lost its chevron (the
542
- * select rule is less specific than these state rules). */
543
- .bw-input[readonly] {
544
- 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));
545
879
  }
546
- .bw-input:disabled {
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);
886
+ }
887
+ .bw-select:disabled,
888
+ select.bw-input:disabled {
547
889
  background-color: var(--bw-color-action-disabled-bg);
548
890
  color: var(--bw-color-action-disabled-text);
549
891
  border-color: var(--bw-color-action-disabled-border);
550
892
  cursor: not-allowed;
551
893
  }
552
- .bw-field--invalid .bw-input,
553
- .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"] {
554
898
  border-color: var(--bw-color-danger);
555
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
+ }
556
909
 
557
- /* --- Checkbox + radio (drawn controls, 0.7.0 craft) ------------------------- */
910
+ /* --- Checkbox (R05) + Radio (R06) ------------------------------------------- */
558
911
 
559
912
  /* appearance:none swaps the UA widget for a control drawn on our tokens (the
560
913
  * moderncss pattern: with appearance removed, every modern engine renders the
561
914
  * input as a plain box, including its ::before). inline-grid centres the
562
915
  * glyph; vertical-align + the end margin seat the control against label
563
- * text. The resting border is border-control (the WCAG 1.4.11 boundary,
564
- * measured 3.23:1 light / 3.39:1 dark, same contract as .bw-input); the focus
565
- * ring comes from the global :where(input):focus-visible rule. Every selector
566
- * is input-qualified: RadioSelect/CheckboxSelectMultiple rendering puts the
567
- * class on the group wrapper div as well as on each option input (the
568
- * 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.
569
922
  *
570
- * icvoss/django-brickwork#208: both controls render as bare native inputs
571
- * with no wrapping label (the data table's select-all/select-row cells, and
572
- * bw_field_widget's own .bw-field__control), so there is no clickable
573
- * wrapper to extend the hit area through; the box itself IS the whole
574
- * target. The box is 1.5rem (24px), the exact WCAG 2.5.8 floor, grown from
575
- * the previous 1.125rem (18px). This does change the control's visual
576
- * size (the issue's own "changing visual weight is a regression in its own
577
- * right" applies), but a clip/padding trick to keep an 18px-looking box
578
- * inside a 24px hit area needs the border moved off `border` onto a layered
579
- * box-shadow to stop it tracking the padding box, which is exactly the kind
580
- * of fragile, non-obvious CSS this codebase avoids elsewhere; growing the
581
- * real box is the KISS option and is verified not to unbalance the label
582
- * row (row height already had headroom: the data table's select column and
583
- * .bw-field__control both size to the row/control height, not to the
584
- * checkbox). */
585
- input.bw-checkbox,
586
- 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 {
587
930
  appearance: none;
588
931
  display: inline-grid;
589
932
  place-content: center;
590
- inline-size: 1.5rem;
591
- block-size: 1.5rem;
933
+ inline-size: var(--bw-control-height);
934
+ block-size: var(--bw-control-height);
592
935
  flex-shrink: 0;
593
936
  margin: 0;
594
- margin-inline-end: var(--bw-space-2);
937
+ margin-inline-end: var(--bw-control-gap);
595
938
  vertical-align: middle;
596
939
  border: var(--bw-size-border-hairline) solid var(--bw-color-border-control);
940
+ border-radius: var(--bw-radius-sm);
597
941
  background: var(--bw-color-surface);
598
942
  transition: var(--bw-transition-colors);
599
943
  }
600
- input.bw-checkbox {
601
- 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);
602
952
  }
603
- input.bw-radio {
604
- 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);
605
959
  }
606
- /* Shared hover pre-light, the input's own mix (constant documented there). */
607
- input.bw-checkbox:hover:where(:not(:disabled):not(:checked)),
608
- input.bw-radio:hover:where(:not(:disabled):not(:checked)) {
609
- 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);
610
966
  }
611
- /* Checked: solid accent fill (measured 5.11:1 light / 7.14:1 dark against the
612
- * surface, the 1.4.11 state boundary). */
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);
973
+ }
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). */
613
1046
  input.bw-checkbox:checked,
1047
+ input.bw-checkbox:indeterminate,
614
1048
  input.bw-radio:checked {
615
1049
  border-color: var(--bw-color-accent);
616
1050
  background-color: var(--bw-color-accent);
617
1051
  }
618
- /* The tick: --bw-component-checkbox-glyph is a colour-free alpha shape consumed as a
619
- * mask and PAINTED with fg-on-accent, so the glyph ink flips with the theme
620
- * like every other ink-on-accent (white on the light accent, near-black on
621
- * the lighter dark accent; measured 5.11:1 light / 7.52:1 dark against the
622
- * fill; a baked white tick would fail dark at 2.63:1, documented on the
623
- * token). No entrance animation: the fill change is feedback enough and the
624
- * reduced-motion floor stays trivially honoured. */
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. */
625
1056
  input.bw-checkbox:checked::before {
626
1057
  content: "";
627
- inline-size: 1rem; /* 16px glyph centred in the 24px box, same ~66% fill ratio as the previous 12px-in-18px */
628
- block-size: 1rem;
1058
+ inline-size: var(--bw-control-icon-size);
1059
+ block-size: var(--bw-control-icon-size);
629
1060
  background-color: var(--bw-color-fg-on-accent);
630
1061
  mask-image: var(--bw-component-checkbox-glyph);
631
1062
  mask-repeat: no-repeat;
632
1063
  mask-size: 100% 100%;
633
1064
  }
634
- /* The radio dot uses the border-width trick, the cleanest cross-browser
635
- * drawing: the accent border thickens and the background becomes the dot
636
- * (the same theme-correct ink pair as the tick). No pseudo-element, no
637
- * image; box-sizing: border-box keeps the geometry fixed so nothing shifts
638
- * on check. Border width scaled with the 18px->24px box (#208) to keep the
639
- * same ~duplicate dot-to-box proportion as before. */
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);
1075
+ }
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). */
640
1079
  input.bw-radio:checked {
641
- 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);
642
1081
  background-color: var(--bw-color-fg-on-accent);
643
1082
  }
644
1083
  input.bw-checkbox:disabled,
@@ -647,17 +1086,31 @@ input.bw-radio:disabled {
647
1086
  background: var(--bw-color-action-disabled-bg);
648
1087
  cursor: not-allowed;
649
1088
  }
650
- input.bw-checkbox:disabled:checked {
1089
+ input.bw-checkbox:disabled:checked,
1090
+ input.bw-checkbox:disabled:indeterminate {
651
1091
  border-color: var(--bw-color-action-disabled-border);
652
1092
  background-color: var(--bw-color-action-disabled-text);
653
1093
  }
654
- input.bw-checkbox:disabled:checked::before {
1094
+ input.bw-checkbox:disabled:checked::before,
1095
+ input.bw-checkbox:disabled:indeterminate::before {
655
1096
  background-color: var(--bw-color-action-disabled-bg);
1097
+ box-shadow: none;
656
1098
  }
657
1099
  input.bw-radio:disabled:checked {
658
1100
  border-color: var(--bw-color-action-disabled-text);
659
1101
  background-color: var(--bw-color-action-disabled-bg);
660
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
+ }
661
1114
 
662
1115
  /* --- Toggle switch (0.13.0, BR-BW-INPUT-001, brickwork#57) ------------------ */
663
1116
 
@@ -760,27 +1213,540 @@ input.bw-toggle:disabled::after {
760
1213
  border-color: var(--bw-color-action-disabled-border);
761
1214
  background: var(--bw-color-action-disabled-bg);
762
1215
  }
763
- input.bw-toggle:disabled:checked::after {
764
- border-color: var(--bw-color-action-disabled-border);
765
- background: var(--bw-color-action-disabled-text);
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;
1701
+ }
1702
+ .bw-copy[data-bw-copy-state="copied"] .bw-copy__mark--done {
1703
+ display: inline-flex;
1704
+ }
1705
+ .bw-copy[data-bw-copy-state="failed"] .bw-copy__mark--fail {
1706
+ display: inline-flex;
766
1707
  }
767
- input.bw-toggle:disabled::before {
768
- box-shadow: none;
1708
+ .bw-copy__label {
1709
+ color: inherit;
769
1710
  }
770
1711
  @media (prefers-reduced-motion: reduce) {
771
- input.bw-toggle::before {
1712
+ .bw-copy {
772
1713
  transition: none;
773
1714
  }
774
1715
  }
775
- .bw-toggle-field {
776
- display: inline-flex;
777
- align-items: center;
778
- 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);
779
1722
  }
780
- .bw-toggle-field__label {
781
- font-size: var(--bw-text-label-size);
782
- font-weight: var(--bw-text-label-weight);
783
- 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);
784
1750
  }
785
1751
 
786
1752
  /* --- Theme switch (icvoss/django-brickwork#117) ----------------------------- */
@@ -998,9 +1964,15 @@ input.bw-toggle:disabled::before {
998
1964
  }
999
1965
  }
1000
1966
 
1001
- .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 {
1002
1973
  margin: 0;
1003
1974
  color: var(--bw-color-fg-muted);
1975
+ font-family: var(--bw-text-caption-family);
1004
1976
  font-size: var(--bw-text-caption-size);
1005
1977
  font-weight: var(--bw-text-caption-weight);
1006
1978
  line-height: var(--bw-text-caption-line-height);
@@ -1013,6 +1985,7 @@ input.bw-toggle:disabled::before {
1013
1985
  /* danger-fg, not raw danger: the smallest text on the form carries the most
1014
1986
  * important message, so it gets the text-duty danger tier (AA at 12px). */
1015
1987
  color: var(--bw-color-danger-fg);
1988
+ font-family: var(--bw-text-caption-family);
1016
1989
  font-size: var(--bw-text-caption-size);
1017
1990
  font-weight: var(--bw-text-caption-weight);
1018
1991
  line-height: var(--bw-text-caption-line-height);
@@ -1059,7 +2032,7 @@ input.bw-toggle:disabled::before {
1059
2032
  * fight (grid: capping a field's width mid-column) the row's own layout, so
1060
2033
  * they are neutralised here and the row takes over spacing/sizing. */
1061
2034
  .bw-form-fields--stacked .bw-field-row {
1062
- margin-block-end: var(--bw-density-stack-gap);
2035
+ margin-block-end: var(--bw-size-gap-md);
1063
2036
  }
1064
2037
  .bw-form-fields--stacked .bw-field-row:last-child {
1065
2038
  margin-block-end: 0;
@@ -1074,7 +2047,7 @@ input.bw-toggle:disabled::before {
1074
2047
  .bw-field-row--grouped {
1075
2048
  display: flex;
1076
2049
  flex-wrap: wrap;
1077
- gap: var(--bw-space-3);
2050
+ gap: var(--bw-size-gap-sm);
1078
2051
  }
1079
2052
  .bw-field-row--grouped .bw-field {
1080
2053
  flex: 1 1 0;
@@ -1092,7 +2065,7 @@ input.bw-toggle:disabled::before {
1092
2065
  .bw-form-fields--grid {
1093
2066
  display: grid;
1094
2067
  grid-template-columns: repeat(var(--bw-form-grid-columns, 2), minmax(0, 1fr));
1095
- gap: var(--bw-density-stack-gap) var(--bw-space-4);
2068
+ gap: var(--bw-size-gap-md) var(--bw-size-gap-md);
1096
2069
  max-inline-size: none;
1097
2070
  }
1098
2071
  .bw-form-fields--grid .bw-field-row {
@@ -1136,7 +2109,14 @@ input.bw-toggle:disabled::before {
1136
2109
  color-mix(in oklab, var(--bw-color-fg) 10%, var(--bw-color-surface-sunken));
1137
2110
  border-radius: var(--bw-radius-lg);
1138
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). */
1139
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);
1140
2120
  flex: 1 1 12rem;
1141
2121
  min-inline-size: 0;
1142
2122
  }
@@ -1156,6 +2136,7 @@ input.bw-toggle:disabled::before {
1156
2136
  letter-spacing: var(--bw-text-heading-xl-tracking);
1157
2137
  }
1158
2138
  .bw-page-header__description {
2139
+ flex: 1 1 100%;
1159
2140
  margin: var(--bw-space-1) 0 0;
1160
2141
  color: var(--bw-color-fg-muted);
1161
2142
  font-size: var(--bw-text-body-md-size);
@@ -1294,40 +2275,26 @@ input.bw-toggle:disabled::before {
1294
2275
  .bw-data-table-wrap {
1295
2276
  overflow-x: auto;
1296
2277
  background: var(--bw-color-surface);
1297
- /* Edge + ambient match zero-kwargs .bw-card so the table reads on white;
1298
- * sunken header, zebra, hover and selected stay on the inner rows. */
1299
2278
  border: var(--bw-size-border-hairline) solid
1300
2279
  color-mix(in oklab, var(--bw-color-fg) 12%, var(--bw-color-surface));
1301
2280
  border-radius: var(--bw-radius-lg);
1302
- box-shadow:
1303
- var(--bw-elevation-1),
1304
- 0 4px 14px -4px oklch(0 0 0 / 0.1);
1305
- /* Wide tables scroll inside the card: thin, border-toned scrollbar so the
1306
- * 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);
1307
2283
  scrollbar-width: thin;
1308
2284
  scrollbar-color: var(--bw-color-border) transparent;
1309
- /* Paint containment: without it, an ancestor that still blows out (a
1310
- * consumer's own wrapper, not just the .bw-card/.bw-section-stack fixed
1311
- * above) can let this wrap's overflow paint outside its own box instead of
1312
- * clipping to it, which is what let the wide table drag the PAGE sideways
1313
- * rather than scrolling within its own card (icvoss/django-brickwork#136).
1314
- * contain: paint guarantees this element is the clipping boundary for its
1315
- * own descendants regardless of what an ancestor does. */
1316
2285
  contain: paint;
1317
2286
  }
1318
- /* density="compact" (Beat Phase C): ops/console tables with tighter rows. */
1319
2287
  .bw-data-table-wrap--density-compact .bw-data-table__th,
1320
2288
  .bw-data-table-wrap--density-compact .bw-data-table__td {
1321
2289
  padding-block: var(--bw-space-2);
1322
2290
  padding-inline: var(--bw-space-3);
1323
- font-size: var(--bw-text-body-sm-size);
1324
2291
  }
1325
2292
  .bw-data-table {
1326
2293
  inline-size: 100%;
1327
2294
  border-collapse: collapse;
1328
2295
  }
1329
- /* Column headers speak in the small tracked-uppercase voice so the sunken band
1330
- * 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. */
1331
2298
  .bw-data-table__th {
1332
2299
  text-align: start;
1333
2300
  padding: var(--bw-density-row-padding-block) var(--bw-density-row-padding-inline);
@@ -1335,16 +2302,25 @@ input.bw-toggle:disabled::before {
1335
2302
  border-block-end: var(--bw-size-border-hairline) solid var(--bw-color-border-strong);
1336
2303
  color: var(--bw-color-fg-muted);
1337
2304
  font-size: var(--bw-font-size-xs);
1338
- font-weight: var(--bw-font-weight-semibold);
1339
- line-height: var(--bw-text-label-line-height);
1340
- letter-spacing: var(--bw-font-tracking-wide);
1341
- 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);
1342
2323
  }
1343
- /* icvoss/django-brickwork#208: inline-flex with no minimum sized the target
1344
- * to whatever the label's line-height gave it (measured 74x16 at 375px),
1345
- * under the WCAG 2.5.8 floor. min-block-size only: the label text already
1346
- * centres via align-items, so this changes no visual weight, just the
1347
- * clickable/tappable extent above and below the text. */
1348
2324
  .bw-data-table__sort {
1349
2325
  display: inline-flex;
1350
2326
  align-items: center;
@@ -1357,11 +2333,13 @@ input.bw-toggle:disabled::before {
1357
2333
  .bw-data-table__sort:hover {
1358
2334
  color: var(--bw-color-accent);
1359
2335
  }
1360
- /* Idle sort arrows are noise until pointed at: hidden at rest, revealed on
1361
- * hover and (for keyboard users) focus-visible; the affordance also stays in
1362
- * the accessible name. Opacity transition only, so the reduced-motion floor
1363
- * caps it globally. */
2336
+ /* Idle sort chevron: CSS triangle, no letter glyph (CB-14). */
1364
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;
1365
2343
  opacity: 0;
1366
2344
  transition: var(--bw-transition-opacity);
1367
2345
  }
@@ -1372,40 +2350,28 @@ input.bw-toggle:disabled::before {
1372
2350
  .bw-data-table__td {
1373
2351
  padding: var(--bw-density-row-padding-block) var(--bw-density-row-padding-inline);
1374
2352
  border-block-end: var(--bw-size-border-hairline) solid var(--bw-color-border);
1375
- font-size: var(--bw-text-body-sm-size);
1376
- line-height: var(--bw-text-body-sm-line-height);
1377
- 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);
1378
2357
  }
1379
- /* The last row's bottom hairline would double against the card's own border. */
1380
2358
  .bw-data-table__row:last-child > .bw-data-table__td,
1381
2359
  .bw-data-table__row:last-child > .bw-data-table__th--label {
1382
2360
  border-block-end: 0;
1383
2361
  }
1384
- /* Records-variant zebra + hover. Even rows stripe so row 1 stays on the plain
1385
- surface next to the sunken header band. Hover is an overlay image so it
1386
- composes with the stripe rather than replacing it (DESIGN.md 4.6 stacking
1387
- order). The definition variant stays plain: key/value reads better without
1388
- stripes. */
1389
- .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) {
1390
2366
  background-color: var(--bw-color-surface-sunken);
1391
2367
  }
1392
- /* Selected row (records rows carry the hook): equal specificity to the zebra
1393
- rule, later in source order, so selection beats the stripe; hover still
1394
- layers its overlay image on top. */
1395
2368
  .bw-data-table:not(.bw-data-table--definition) .bw-data-table__row.bw-data-table__row--selected {
1396
2369
  background-color: var(--bw-state-selected-bg);
1397
2370
  }
1398
- .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 {
1399
2373
  background-image: linear-gradient(var(--bw-state-hover-overlay), var(--bw-state-hover-overlay));
1400
2374
  }
1401
-
1402
- /* A clickable record row (row.url, #10): the row-link fills its cell and
1403
- inherits colour, so the whole first cell is the target and the row reads as
1404
- actionable. The hover already comes from the records-variant row hover.
1405
- min-block-size (#208): the compact density's row padding leaves less than
1406
- 24px of line-height alone, so the row-link's own tap target fell under
1407
- the WCAG 2.5.8 floor there; comfortable/spacious density already clear it
1408
- without this, so the floor is a no-op visual change for them. */
1409
2375
  .bw-data-table__row-link {
1410
2376
  display: block;
1411
2377
  min-block-size: 1.5rem;
@@ -1415,21 +2381,123 @@ input.bw-toggle:disabled::before {
1415
2381
  .bw-data-table__row-link:hover {
1416
2382
  text-decoration: underline;
1417
2383
  }
1418
-
1419
- /* Definition-list mode (#18): a key/value fact table for one entity. The label
1420
- is a row header; give it the muted body-sm treatment (no header background,
1421
- the column is a key, not chrome). The table fills its card; the 1% nowrap
1422
- 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
+ }
1423
2495
  .bw-data-table--definition {
1424
2496
  inline-size: 100%;
1425
2497
  }
1426
- /* A key/value fact card hugs its facts rather than stretching the workspace.
1427
- Graceful no-op in engines without :has(). */
1428
2498
  .bw-data-table-wrap:has(.bw-data-table--definition) {
1429
2499
  max-inline-size: var(--bw-size-max-width-prose);
1430
2500
  }
1431
- /* The value is the payload: muted-regular key against medium value gives the
1432
- quiet two-rank rhythm. */
1433
2501
  .bw-data-table--definition .bw-data-table__td {
1434
2502
  font-weight: var(--bw-font-weight-medium);
1435
2503
  }
@@ -1441,20 +2509,12 @@ input.bw-toggle:disabled::before {
1441
2509
  padding-inline-end: var(--bw-space-6);
1442
2510
  vertical-align: baseline;
1443
2511
  color: var(--bw-color-fg-muted);
1444
- font-size: var(--bw-text-body-sm-size);
1445
- line-height: var(--bw-text-body-sm-line-height);
1446
- /* Reset the column-header voice: this cell also carries __th, but it is a
1447
- row key, not chrome, so it keeps the plain body-sm treatment. */
1448
- 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);
1449
2515
  letter-spacing: var(--bw-font-tracking-normal);
1450
2516
  text-transform: none;
1451
2517
  }
1452
-
1453
- /* --- Data table: bulk selection, sticky header, responsive (brickwork#54) -- */
1454
-
1455
- /* The leading checkbox column: 1% width hugs the control (the __th--label
1456
- * inline-size:1% trick reused), centred so it does not drag the header text
1457
- * baseline off the other columns. */
1458
2518
  .bw-data-table__th--select,
1459
2519
  .bw-data-table__td--select {
1460
2520
  inline-size: 1%;
@@ -1462,9 +2522,6 @@ input.bw-toggle:disabled::before {
1462
2522
  text-align: center;
1463
2523
  vertical-align: middle;
1464
2524
  }
1465
- /* Column alignment vocabulary (icvoss/django-brickwork#522): closed set
1466
- * start (default, no modifier) | center | end, applied to both header and
1467
- * body cells from the column dict's align key. */
1468
2525
  .bw-data-table__th--center,
1469
2526
  .bw-data-table__td--center {
1470
2527
  text-align: center;
@@ -1474,14 +2531,6 @@ input.bw-toggle:disabled::before {
1474
2531
  text-align: end;
1475
2532
  font-variant-numeric: tabular-nums;
1476
2533
  }
1477
-
1478
- /* loading=True skeleton (icvoss/django-brickwork#137): without padding of its
1479
- * own the placeholder bars sit flush to the wrap's card border, then jump
1480
- * inward once real rows arrive with their __td/__th row-density padding. Uses
1481
- * the same row-density tokens as the real cells so the loading and loaded
1482
- * states share one inset, and .bw-skeleton-group's own stack-with-gap shape
1483
- * (flex column, --bw-space-2 gap) so the bars read as the same house pattern
1484
- * for stacked skeletons rather than a one-off. */
1485
2534
  .bw-data-table__skeleton {
1486
2535
  display: flex;
1487
2536
  flex-direction: column;
@@ -1489,31 +2538,14 @@ input.bw-toggle:disabled::before {
1489
2538
  padding-block: var(--bw-density-row-padding-block);
1490
2539
  padding-inline: var(--bw-density-row-padding-inline);
1491
2540
  }
1492
-
1493
- /* scroll_container / sticky_header: the wrap keeps its own scroll (unchanged
1494
- * from the plain wrap), the <thead> pins to the top of that scroll region.
1495
- * The header cells need an opaque background of their own (they already
1496
- * carry --bw-color-surface-sunken) so scrolled body rows do not show through
1497
- * underneath the pinned band; the z-index keeps it above the body but below
1498
- * any overlay chrome (the shared --bw-z-sticky token, the same one the
1499
- * shell topbar uses, so a table's sticky head never fights the app chrome
1500
- * for stacking). */
1501
2541
  .bw-data-table-wrap--sticky {
1502
2542
  max-block-size: 100%;
1503
2543
  }
1504
- .bw-data-table-wrap--sticky .bw-data-table__th {
2544
+ .bw-data-table-wrap--sticky thead .bw-data-table__th {
1505
2545
  position: sticky;
1506
2546
  inset-block-start: 0;
1507
2547
  z-index: var(--bw-z-sticky);
1508
2548
  }
1509
-
1510
- /* responsive="stack": below the breakpoint each row becomes a labelled card
1511
- * (data-label per cell, stamped by the template from the column list) and
1512
- * the header row is hidden (the labels replace it). Above the breakpoint
1513
- * this is a no-op: the table renders exactly as the scroll default. The
1514
- * breakpoint matches the shell's own mobile cut (DESIGN.md's sidebar
1515
- * collapse breakpoint), so a table's card mode and the shell's mobile nav
1516
- * change together. */
1517
2549
  @media (width < --theme(--breakpoint-md)) {
1518
2550
  .bw-data-table--stack thead {
1519
2551
  position: absolute;
@@ -1546,19 +2578,14 @@ input.bw-toggle:disabled::before {
1546
2578
  border-block-end: 0;
1547
2579
  text-align: end;
1548
2580
  }
1549
- /* The stamped label reads as the row's own column key, in the same muted
1550
- * voice _data_table.html--definition uses for its row headers, so a
1551
- * stacked card and a definition table share one "key: value" language. */
1552
2581
  .bw-data-table--stack .bw-data-table__td[data-label]::before {
1553
2582
  content: attr(data-label);
1554
2583
  flex: 0 0 auto;
1555
2584
  color: var(--bw-color-fg-muted);
1556
- font-size: var(--bw-text-body-sm-size);
2585
+ font-size: var(--bw-font-size-xs);
1557
2586
  font-weight: var(--bw-font-weight-medium);
1558
2587
  text-align: start;
1559
2588
  }
1560
- /* The select column carries no data-label (it is a control, not a fact);
1561
- * it stays a plain leading row instead of a fake "key: value" pair. */
1562
2589
  .bw-data-table--stack .bw-data-table__td--select {
1563
2590
  justify-content: flex-start;
1564
2591
  }
@@ -1807,7 +2834,9 @@ button.bw-account-menu__item {
1807
2834
  }
1808
2835
 
1809
2836
  .bw-filter-bar__actions {
1810
- margin-block-end: var(--bw-space-1);
2837
+ /* No trailing margin: .bw-field__errors:empty is display:none, so the field
2838
+ * stack ends at the control and flex-end already shares that bottom edge. */
2839
+ margin-block-end: 0;
1811
2840
  }
1812
2841
 
1813
2842
  /* --- Search (#155) --------------------------------------------------------- */
@@ -2020,7 +3049,7 @@ button.bw-account-menu__item {
2020
3049
  }
2021
3050
  .bw-skeleton--row {
2022
3051
  inline-size: var(--bw-skeleton-w, 100%);
2023
- block-size: var(--bw-skeleton-h, var(--bw-density-control-height));
3052
+ block-size: var(--bw-skeleton-h, var(--bw-control-height));
2024
3053
  margin-block-end: var(--bw-space-2);
2025
3054
  }
2026
3055
  /* Filled rectangle (0.12.0, #56): a chart/image placeholder with no natural
@@ -2067,15 +3096,36 @@ button.bw-account-menu__item {
2067
3096
  gap: var(--bw-space-2);
2068
3097
  }
2069
3098
  .bw-progress__track {
3099
+ position: relative;
2070
3100
  flex: 1 1 auto;
2071
3101
  block-size: var(--bw-component-progress-track-height);
2072
3102
  background: var(--bw-color-surface-sunken);
2073
3103
  border-radius: var(--bw-radius-full);
3104
+ /* Default track clips the fill to the trough. When an elapsed/pace marker
3105
+ * is present (APP-010), overflow must be visible so the tick can sit
3106
+ * slightly proud of the track. */
2074
3107
  overflow: hidden;
2075
3108
  /* The track's own visible contrast against the fill is the non-colour
2076
3109
  * signal STA-007 requires: a sunken trough is legible even if the fill
2077
3110
  * hue is indistinguishable to the viewer. */
2078
3111
  }
3112
+ .bw-progress__track:has(> .bw-progress__elapsed) {
3113
+ overflow: visible;
3114
+ }
3115
+ /* Pace marker (APP-010 / R25): a 2px tick at --bw-progress-elapsed (0-100).
3116
+ * Sibling of the fill inside the track. aria-hidden: the progressbar's
3117
+ * accessible name states both used and elapsed. */
3118
+ .bw-progress__elapsed {
3119
+ position: absolute;
3120
+ inset-block-start: -0.2rem;
3121
+ inset-inline-start: calc(var(--bw-progress-elapsed, 0) * 1%);
3122
+ inline-size: 0.125rem;
3123
+ block-size: calc(var(--bw-component-progress-track-height) + 0.4rem);
3124
+ background: var(--bw-color-fg-muted);
3125
+ border-radius: var(--bw-radius-full);
3126
+ transform: translateX(-50%);
3127
+ pointer-events: none;
3128
+ }
2079
3129
  .bw-progress__fill {
2080
3130
  block-size: 100%;
2081
3131
  background: var(--bw-color-accent);
@@ -2089,32 +3139,163 @@ button.bw-account-menu__item {
2089
3139
  width: calc(var(--bw-progress-value, 0) * 1%);
2090
3140
  transition: width var(--bw-duration-normal) var(--bw-ease-standard);
2091
3141
  }
2092
- .bw-progress__value {
2093
- color: var(--bw-color-fg-muted);
2094
- font-size: var(--bw-text-caption-size);
2095
- font-weight: var(--bw-text-caption-weight);
2096
- line-height: var(--bw-text-caption-line-height);
2097
- font-variant-numeric: tabular-nums;
2098
- white-space: nowrap;
3142
+ .bw-progress__value {
3143
+ color: var(--bw-color-fg-muted);
3144
+ font-size: var(--bw-text-caption-size);
3145
+ font-weight: var(--bw-text-caption-weight);
3146
+ line-height: var(--bw-text-caption-line-height);
3147
+ font-variant-numeric: tabular-nums;
3148
+ white-space: nowrap;
3149
+ }
3150
+ /* Indeterminate: a fixed-width segment sweeps the track. Gated behind
3151
+ * no-preference (STA-005); reduced motion falls back to a static partial
3152
+ * fill (below) rather than a frozen mid-sweep segment, so "work is in
3153
+ * progress" still reads without relying on the animation. */
3154
+ .bw-progress__fill--indeterminate {
3155
+ width: 40%;
3156
+ }
3157
+ @media (prefers-reduced-motion: no-preference) {
3158
+ .bw-progress__fill--indeterminate {
3159
+ animation: bw-progress-sweep var(--bw-duration-shimmer) var(--bw-ease-standard) infinite;
3160
+ }
3161
+ }
3162
+ @keyframes bw-progress-sweep {
3163
+ 0% {
3164
+ margin-inline-start: -40%;
3165
+ }
3166
+ 100% {
3167
+ margin-inline-start: 100%;
3168
+ }
3169
+ }
3170
+
3171
+
3172
+
3173
+ /* --- Stat summary strip (APP-010 second tier) ------------------------------- */
3174
+
3175
+ /* Plain supporting metrics under a primary bw-stat-grid. Hairline column
3176
+ * dividers; not a card and not the marketing bw-stat-band. */
3177
+ .bw-stat-summary {
3178
+ display: grid;
3179
+ grid-template-columns: repeat(4, minmax(0, 1fr));
3180
+ margin-block: var(--bw-space-4) var(--bw-space-5);
3181
+ }
3182
+ .bw-stat-summary > * {
3183
+ display: flex;
3184
+ flex-wrap: wrap;
3185
+ align-items: baseline;
3186
+ gap: var(--bw-space-2);
3187
+ padding-inline: var(--bw-space-4);
3188
+ border-inline-end: var(--bw-size-border-hairline) solid var(--bw-color-border);
3189
+ }
3190
+ .bw-stat-summary > *:first-child {
3191
+ padding-inline-start: 0;
3192
+ }
3193
+ .bw-stat-summary > *:last-child {
3194
+ border-inline-end: 0;
3195
+ }
3196
+ .bw-stat-summary__label {
3197
+ color: var(--bw-color-fg-muted);
3198
+ font-size: var(--bw-font-size-xs);
3199
+ }
3200
+ .bw-stat-summary__value {
3201
+ font-size: var(--bw-font-size-sm);
3202
+ font-weight: var(--bw-font-weight-semibold);
3203
+ font-variant-numeric: tabular-nums;
3204
+ color: var(--bw-color-fg);
3205
+ }
3206
+ @media (width < --theme(--breakpoint-md)) {
3207
+ .bw-stat-summary {
3208
+ grid-template-columns: repeat(2, minmax(0, 1fr));
3209
+ row-gap: var(--bw-space-3);
3210
+ }
3211
+ .bw-stat-summary > *:nth-child(2) {
3212
+ border-inline-end: 0;
3213
+ }
3214
+ .bw-stat-summary > *:nth-child(3) {
3215
+ padding-inline-start: 0;
3216
+ }
3217
+ }
3218
+
3219
+ /* --- Reporting window control (APP craft date chip) ------------------------- */
3220
+
3221
+ .bw-window-control {
3222
+ display: inline-flex;
3223
+ align-items: center;
3224
+ gap: var(--bw-space-2);
3225
+ border: var(--bw-size-border-hairline) solid var(--bw-color-border);
3226
+ border-radius: var(--bw-radius-md);
3227
+ background: var(--bw-color-surface);
3228
+ padding: var(--bw-space-2) var(--bw-space-3);
3229
+ color: var(--bw-color-fg);
3230
+ }
3231
+ .bw-window-control__icon {
3232
+ display: inline-flex;
3233
+ color: var(--bw-color-fg-muted);
3234
+ flex-shrink: 0;
3235
+ }
3236
+ .bw-window-control select,
3237
+ .bw-window-control .bw-select {
3238
+ border: 0;
3239
+ background: transparent;
3240
+ color: inherit;
3241
+ font: inherit;
3242
+ font-size: var(--bw-font-size-sm);
3243
+ padding: 0 var(--bw-space-1);
3244
+ max-inline-size: 100%;
3245
+ }
3246
+ .bw-window-control__stack {
3247
+ display: flex;
3248
+ flex-direction: column;
3249
+ align-items: flex-end;
3250
+ gap: var(--bw-space-1);
3251
+ }
3252
+ .bw-window-control__hint {
3253
+ margin: 0;
3254
+ color: var(--bw-color-fg-muted);
3255
+ font-size: var(--bw-font-size-xs);
3256
+ }
3257
+
3258
+ /* --- Insight notes (APP craft under dense tables) --------------------------- */
3259
+
3260
+ .bw-insight-grid {
3261
+ display: grid;
3262
+ grid-template-columns: repeat(3, minmax(0, 1fr));
3263
+ gap: var(--bw-space-4);
3264
+ }
3265
+ .bw-insight {
3266
+ display: flex;
3267
+ align-items: flex-start;
3268
+ gap: var(--bw-space-3);
3269
+ padding: var(--bw-space-3) var(--bw-space-4);
3270
+ border: var(--bw-size-border-hairline) solid var(--bw-color-border);
3271
+ border-radius: var(--bw-radius-md);
3272
+ background: var(--bw-color-surface);
2099
3273
  }
2100
- /* Indeterminate: a fixed-width segment sweeps the track. Gated behind
2101
- * no-preference (STA-005); reduced motion falls back to a static partial
2102
- * fill (below) rather than a frozen mid-sweep segment, so "work is in
2103
- * progress" still reads without relying on the animation. */
2104
- .bw-progress__fill--indeterminate {
2105
- width: 40%;
3274
+ .bw-insight__icon {
3275
+ display: grid;
3276
+ place-items: center;
3277
+ inline-size: 1.7rem;
3278
+ block-size: 1.7rem;
3279
+ border-radius: var(--bw-radius-md);
3280
+ background: color-mix(in oklab, var(--bw-color-accent) 16%, var(--bw-color-surface));
3281
+ color: var(--bw-color-accent);
3282
+ flex-shrink: 0;
2106
3283
  }
2107
- @media (prefers-reduced-motion: no-preference) {
2108
- .bw-progress__fill--indeterminate {
2109
- animation: bw-progress-sweep var(--bw-duration-shimmer) var(--bw-ease-standard) infinite;
2110
- }
3284
+ .bw-insight__title {
3285
+ margin: 0 0 var(--bw-space-1);
3286
+ font-size: var(--bw-font-size-xs);
3287
+ font-weight: var(--bw-font-weight-semibold);
3288
+ color: var(--bw-color-fg);
2111
3289
  }
2112
- @keyframes bw-progress-sweep {
2113
- 0% {
2114
- margin-inline-start: -40%;
2115
- }
2116
- 100% {
2117
- margin-inline-start: 100%;
3290
+ .bw-insight__body {
3291
+ margin: 0;
3292
+ color: var(--bw-color-fg-muted);
3293
+ font-size: var(--bw-font-size-xs);
3294
+ line-height: 1.65;
3295
+ }
3296
+ @media (width < --theme(--breakpoint-lg)) {
3297
+ .bw-insight-grid {
3298
+ grid-template-columns: 1fr;
2118
3299
  }
2119
3300
  }
2120
3301
 
@@ -2147,10 +3328,19 @@ button.bw-account-menu__item {
2147
3328
  box-shadow:
2148
3329
  var(--bw-elevation-1),
2149
3330
  0 4px 14px -4px oklch(0 0 0 / 0.1);
2150
- padding: var(--bw-density-card-padding);
2151
- }
2152
- /* Flat-design variant (CMP-015): the hairline carries the boundary alone. */
3331
+ /* The active inset is declared once as a component variable (the same
3332
+ * inline-token mechanism as --bw-component-stat-tile-value-size), so the
3333
+ * padding and every bleed margin below read one value and a size step
3334
+ * cannot leave a bleed region short or long (CRD-012). */
3335
+ --bw-component-card-inset: var(--bw-size-inset-md);
3336
+ padding: var(--bw-size-inset-md);
3337
+ }
3338
+ /* Flat mode (CMP-015, APP-002, CRD-020): the hairline carries the boundary
3339
+ alone. The edge is the app hairline token, not the soft ink-mix edge the
3340
+ elevated default keeps for marketing depth. Opt-in: the default card stays
3341
+ elevation-1 plus ambient. An explicit elevation modifier below still wins. */
2153
3342
  .bw-card--bordered {
3343
+ border-color: var(--bw-color-border);
2154
3344
  box-shadow: var(--bw-elevation-0);
2155
3345
  }
2156
3346
  /* Appearance suite (docs/APPEARANCE.md, #535): CSS-only surface / elevation /
@@ -2205,6 +3395,15 @@ button.bw-account-menu__item {
2205
3395
  var(--bw-elevation-1),
2206
3396
  0 4px 14px -4px oklch(0 0 0 / 0.1);
2207
3397
  }
3398
+ /* Flat mode outranks the recipe and inverse ambient stacks above (two classes
3399
+ against one), and loses to an explicit elevation compound below. */
3400
+ .bw-card--bordered.bw-card--surface-inverse,
3401
+ .bw-card--bordered.bw-card--header-inverse,
3402
+ .bw-card--bordered.bw-card--header-muted,
3403
+ .bw-card--bordered.bw-card--header-accent,
3404
+ .bw-card--bordered.bw-card--media-bleed {
3405
+ box-shadow: var(--bw-elevation-0);
3406
+ }
2208
3407
  .bw-card--surface-inverse.bw-card--elevation-0,
2209
3408
  .bw-card--header-inverse.bw-card--elevation-0,
2210
3409
  .bw-card--header-muted.bw-card--elevation-0,
@@ -2226,16 +3425,21 @@ button.bw-account-menu__item {
2226
3425
  .bw-card--media-bleed.bw-card--elevation-3 {
2227
3426
  box-shadow: var(--bw-elevation-3);
2228
3427
  }
2229
- /* padding arg (04-interfaces): md restates the density default so an explicit
2230
- padding="md" and the bare card always agree. */
3428
+ /* padding arg (04-interfaces), ADR-126 section 5 / SIZE-COVERAGE gate 6: the
3429
+ container inset scale (--bw-size-inset-*, md = --bw-density-card-padding).
3430
+ md restates the default so an explicit padding="md" and the bare card
3431
+ always agree; every step is density-aware (no absolute --bw-space-*). */
2231
3432
  .bw-card--size-sm {
2232
- padding: var(--bw-space-3);
3433
+ --bw-component-card-inset: var(--bw-size-inset-sm);
3434
+ padding: var(--bw-size-inset-sm);
2233
3435
  }
2234
3436
  .bw-card--size-md {
2235
- padding: var(--bw-density-card-padding);
3437
+ --bw-component-card-inset: var(--bw-size-inset-md);
3438
+ padding: var(--bw-size-inset-md);
2236
3439
  }
2237
3440
  .bw-card--size-lg {
2238
- padding: var(--bw-space-6);
3441
+ --bw-component-card-inset: var(--bw-size-inset-lg);
3442
+ padding: var(--bw-size-inset-lg);
2239
3443
  }
2240
3444
  /* Card-as-link (CMP-017): the whole card is an anchor; content keeps its own
2241
3445
  ink and no underline smears across the card. The focus ring comes from the
@@ -2248,17 +3452,39 @@ a.bw-card {
2248
3452
  /* Interactive variant (MOT-010, AC-BW-071): the shadow raises 1 to 2 on
2249
3453
  hover/focus-within, never a transform; elevation 2+ pairs with the raised
2250
3454
  surface in both themes (DESIGN.md 4.1: in light the raised surface equals
2251
- surface, so only the shadow moves; in dark the surface lightens too). */
3455
+ surface, so only the shadow moves; in dark the surface lightens too).
3456
+ Flat cards (CRD-021, APP-002) never gain a shadow on hover: the hairline
3457
+ steps to the strong border and the surface to raised instead. */
2252
3458
  .bw-card--interactive {
2253
3459
  transition: var(--bw-transition-shadow), var(--bw-transition-colors);
2254
3460
  }
2255
- .bw-card--interactive:hover,
2256
- .bw-card--interactive:focus-within {
3461
+ .bw-card--interactive:not(.bw-card--bordered):hover,
3462
+ .bw-card--interactive:not(.bw-card--bordered):focus-within {
2257
3463
  box-shadow:
2258
3464
  var(--bw-elevation-2),
2259
3465
  0 8px 20px -6px oklch(0 0 0 / 0.12);
2260
3466
  background: var(--bw-color-surface-raised);
2261
3467
  }
3468
+ .bw-card--bordered.bw-card--interactive:hover,
3469
+ .bw-card--bordered.bw-card--interactive:focus-within {
3470
+ border-color: var(--bw-color-border-strong);
3471
+ background: var(--bw-color-surface-raised);
3472
+ }
3473
+ /* A tinted, muted or inverse fill keeps its own fill on hover (CRD-022):
3474
+ swapping in the raised surface would leave inverse text on a light fill. */
3475
+ .bw-card--interactive.bw-card--surface-tint:hover,
3476
+ .bw-card--interactive.bw-card--surface-tint:focus-within {
3477
+ background: var(--bw-color-surface-marketing-tint);
3478
+ }
3479
+ .bw-card--interactive.bw-card--surface-muted:hover,
3480
+ .bw-card--interactive.bw-card--surface-muted:focus-within {
3481
+ background: var(--bw-color-surface-sunken);
3482
+ }
3483
+ .bw-card--interactive.bw-card--surface-inverse:hover,
3484
+ .bw-card--interactive.bw-card--surface-inverse:focus-within {
3485
+ background: var(--bw-color-surface-inverse);
3486
+ border-color: transparent;
3487
+ }
2262
3488
  .bw-card__header {
2263
3489
  display: flex;
2264
3490
  align-items: flex-start;
@@ -2275,18 +3501,18 @@ a.bw-card {
2275
3501
  }
2276
3502
  .bw-card__header--muted,
2277
3503
  .bw-card--header-muted .bw-card__header {
2278
- margin: calc(-1 * var(--bw-density-card-padding));
3504
+ margin: calc(-1 * var(--bw-component-card-inset, var(--bw-size-inset-md)));
2279
3505
  margin-block-end: var(--bw-space-3);
2280
- padding: var(--bw-density-card-padding);
3506
+ padding: var(--bw-component-card-inset, var(--bw-size-inset-md));
2281
3507
  background: var(--bw-color-surface-sunken);
2282
3508
  border-start-start-radius: inherit;
2283
3509
  border-start-end-radius: inherit;
2284
3510
  }
2285
3511
  .bw-card__header--inverse,
2286
3512
  .bw-card--header-inverse .bw-card__header {
2287
- margin: calc(-1 * var(--bw-density-card-padding));
3513
+ margin: calc(-1 * var(--bw-component-card-inset, var(--bw-size-inset-md)));
2288
3514
  margin-block-end: var(--bw-space-3);
2289
- padding: var(--bw-density-card-padding);
3515
+ padding: var(--bw-component-card-inset, var(--bw-size-inset-md));
2290
3516
  background: var(--bw-color-surface-inverse);
2291
3517
  color: var(--bw-color-fg-on-inverse);
2292
3518
  border-start-start-radius: inherit;
@@ -2294,9 +3520,9 @@ a.bw-card {
2294
3520
  }
2295
3521
  .bw-card__header--accent,
2296
3522
  .bw-card--header-accent .bw-card__header {
2297
- margin: calc(-1 * var(--bw-density-card-padding));
3523
+ margin: calc(-1 * var(--bw-component-card-inset, var(--bw-size-inset-md)));
2298
3524
  margin-block-end: var(--bw-space-3);
2299
- padding: var(--bw-density-card-padding);
3525
+ padding: var(--bw-component-card-inset, var(--bw-size-inset-md));
2300
3526
  background: var(--bw-color-accent-subtle);
2301
3527
  border-block-end: var(--bw-size-border-hairline) solid var(--bw-color-accent);
2302
3528
  border-start-start-radius: inherit;
@@ -2331,6 +3557,36 @@ a.bw-card {
2331
3557
  color: var(--bw-color-fg-on-inverse);
2332
3558
  background-color: var(--bw-state-hover-overlay);
2333
3559
  }
3560
+ /* Description (CRD-014): the supporting line under a title, on muted ink in
3561
+ the body-sm role. React CardDescription emits it; Django's caption and body
3562
+ strings use .bw-card__footer and .bw-card__body. */
3563
+ .bw-card__description {
3564
+ margin: 0;
3565
+ color: var(--bw-color-fg-muted);
3566
+ font-size: var(--bw-text-body-sm-size);
3567
+ font-weight: var(--bw-text-body-sm-weight);
3568
+ line-height: var(--bw-text-body-sm-line-height);
3569
+ text-wrap: pretty;
3570
+ }
3571
+ .bw-card__title + .bw-card__description {
3572
+ margin-block-start: var(--bw-space-1);
3573
+ }
3574
+ /* Whole-card inverse fill (CRD-023): the region ink flips to the on-inverse
3575
+ token. Without this the title and body (which speak in --bw-color-fg) would
3576
+ paint the inverse fill's own colour on itself. */
3577
+ .bw-card--surface-inverse .bw-card__title,
3578
+ .bw-card--surface-inverse .bw-card__description,
3579
+ .bw-card--surface-inverse .bw-card__body,
3580
+ .bw-card--surface-inverse .bw-card__footer {
3581
+ color: var(--bw-color-fg-on-inverse);
3582
+ }
3583
+ .bw-card--surface-inverse .bw-card__footer {
3584
+ border-block-start-color: color-mix(
3585
+ in oklab,
3586
+ var(--bw-color-fg-on-inverse) 30%,
3587
+ var(--bw-color-surface-inverse)
3588
+ );
3589
+ }
2334
3590
  /* Plain include-path body string (APPEARANCE.md): escaped text, not rich HTML. */
2335
3591
  .bw-card__body {
2336
3592
  margin: 0;
@@ -2341,6 +3597,7 @@ a.bw-card {
2341
3597
  text-wrap: pretty;
2342
3598
  }
2343
3599
  .bw-card__title + .bw-card__body,
3600
+ .bw-card__description + .bw-card__body,
2344
3601
  .bw-card__header + .bw-card__body,
2345
3602
  .bw-card__media + .bw-card__body,
2346
3603
  .bw-card__media + .bw-card__header,
@@ -2367,7 +3624,7 @@ a.bw-card {
2367
3624
  }
2368
3625
  .bw-card__media--bleed,
2369
3626
  .bw-card--media-bleed .bw-card__media {
2370
- margin: calc(-1 * var(--bw-density-card-padding));
3627
+ margin: calc(-1 * var(--bw-component-card-inset, var(--bw-size-inset-md)));
2371
3628
  margin-block-end: 0;
2372
3629
  border-start-start-radius: inherit;
2373
3630
  border-start-end-radius: inherit;
@@ -2404,9 +3661,9 @@ a.bw-card {
2404
3661
  }
2405
3662
  .bw-card__footer--muted,
2406
3663
  .bw-card--footer-muted .bw-card__footer {
2407
- margin-inline: calc(-1 * var(--bw-density-card-padding));
2408
- margin-block-end: calc(-1 * var(--bw-density-card-padding));
2409
- padding: var(--bw-space-3) var(--bw-density-card-padding);
3664
+ margin-inline: calc(-1 * var(--bw-component-card-inset, var(--bw-size-inset-md)));
3665
+ margin-block-end: calc(-1 * var(--bw-component-card-inset, var(--bw-size-inset-md)));
3666
+ padding: var(--bw-space-3) var(--bw-component-card-inset, var(--bw-size-inset-md));
2410
3667
  background: var(--bw-color-surface-sunken);
2411
3668
  border-block-start: var(--bw-size-border-hairline) solid var(--bw-color-border);
2412
3669
  border-end-start-radius: inherit;
@@ -2434,14 +3691,20 @@ a.bw-card {
2434
3691
  display: flex;
2435
3692
  flex-direction: column;
2436
3693
  gap: var(--bw-space-1);
3694
+ /* APP-002 (STA-002): hairline + tinted ground separate tiles; no ambient
3695
+ shadow at rest (the raw oklch drop shadow is removed). Shadow is
3696
+ reserved for overlays and linked-tile hover elevation only. */
2437
3697
  background: var(--bw-color-surface);
2438
3698
  border: var(--bw-size-border-hairline) solid
2439
- color-mix(in oklab, var(--bw-color-fg) 12%, var(--bw-color-surface));
3699
+ color-mix(in oklab, var(--bw-color-fg) 50%, var(--bw-color-surface));
2440
3700
  border-radius: var(--bw-radius-lg);
2441
- box-shadow:
2442
- var(--bw-elevation-1),
2443
- 0 4px 14px -4px oklch(0 0 0 / 0.1);
2444
- padding: var(--bw-density-card-padding);
3701
+ /* Value-size component token: points at 2xl (1.5rem at comfortable) per
3702
+ APP-CRAFT section 4 (kpi-value pick). Re-stated here so an explicit
3703
+ size="md" and the bare tile agree. The token is re-emitted for every
3704
+ density in @bwui/tokens so density cascades work without a component-
3705
+ level density block. */
3706
+ --bw-component-stat-tile-value-size: var(--bw-font-size-2xl);
3707
+ padding: var(--bw-size-inset-md);
2445
3708
  }
2446
3709
  /* Clickable tile (VIZ-024): an anchor stat is definitionally hoverable, so it
2447
3710
  takes the interactive card's shadow raise; same no-transform rule. */
@@ -2451,11 +3714,16 @@ a.bw-stat {
2451
3714
  transition: var(--bw-transition-shadow), var(--bw-transition-colors);
2452
3715
  }
2453
3716
  a.bw-stat:hover {
2454
- box-shadow:
2455
- var(--bw-elevation-2),
2456
- 0 8px 20px -6px oklch(0 0 0 / 0.12);
3717
+ /* APP-002: linked hover may use elevation tokens only (no raw oklch, CB-16). */
3718
+ box-shadow: var(--bw-elevation-2);
2457
3719
  background: var(--bw-color-surface-raised);
2458
3720
  }
3721
+ /* Optional leading icon (decorative; Django bw_icon sizes it). */
3722
+ .bw-stat__icon {
3723
+ block-size: var(--bw-space-5);
3724
+ inline-size: var(--bw-space-5);
3725
+ flex-shrink: 0;
3726
+ }
2459
3727
  /* Overline voice for the label (uppercase applied here at the component, per
2460
3728
  the role contract), on muted ink. */
2461
3729
  .bw-stat__label {
@@ -2469,14 +3737,17 @@ a.bw-stat:hover {
2469
3737
  }
2470
3738
  .bw-stat__value {
2471
3739
  margin: 0;
2472
- /* The component token scales the numeral (VIZ-001, AC-BW-075); until it is
2473
- emitted by the token build it falls back to the 4xl step (ADR-127: the
2474
- 2.5rem the default tile has always rendered at comfortable), the same
2475
- inline-token-with-fallback mechanism as .bw-spinner's size. */
2476
- font-size: var(--bw-component-stat-tile-value-size, var(--bw-font-size-4xl));
3740
+ /* The component token scales the numeral (VIZ-001, AC-BW-075). Token is
3741
+ now emitted by the token build (2xl, 1.5rem at comfortable, APP-CRAFT
3742
+ section 4 kpi-value pick); the fallback retains the token so the cascade
3743
+ always wins when the stylesheet ships. */
3744
+ font-size: var(--bw-component-stat-tile-value-size, var(--bw-font-size-2xl));
2477
3745
  font-weight: var(--bw-font-weight-semibold);
2478
3746
  line-height: var(--bw-font-line-height-tight);
2479
- font-variant-numeric: tabular-nums; /* a column of tiles never jitters as digits change */
3747
+ /* STA-007 (CB-17 typography, APP-001): tight tracking on large numerals
3748
+ (tabular-nums + tight tracking together reduce jitter in KPI rows). */
3749
+ letter-spacing: var(--bw-font-tracking-tight);
3750
+ font-variant-numeric: tabular-nums;
2480
3751
  }
2481
3752
  /* The trend row itself (icvoss/django-brickwork#334): _stat.html now
2482
3753
  {% include %}s _trend_indicator.html rather than rendering its own trend
@@ -2486,13 +3757,23 @@ a.bw-stat:hover {
2486
3757
  consumer stylesheet that selects .bw-stat__trend directly; #334). */
2487
3758
  /* size arg (VIZ-027): modifiers re-point the value-size component token, so
2488
3759
  the numeral rule itself never forks. */
3760
+ /* Padding rides the container inset scale (ADR-126 section 5, gate 6); md
3761
+ restates the default so an explicit size="md" and the bare tile agree. */
3762
+ /* Size steps (STA-003, CB-17 subset sm|md|lg matching Card's own subset):
3763
+ re-point the value-size token coherently with the md base (xl→sm, 2xl→md,
3764
+ 3xl→lg). Padding rides the container inset scale (ADR-126 section 5). md
3765
+ restates the base so an explicit size="md" and the bare tile agree. */
2489
3766
  .bw-stat--sm, .bw-stat--size-sm {
2490
- --bw-component-stat-tile-value-size: var(--bw-font-size-3xl);
2491
- padding: var(--bw-space-3);
3767
+ --bw-component-stat-tile-value-size: var(--bw-font-size-xl);
3768
+ padding: var(--bw-size-inset-sm);
3769
+ }
3770
+ .bw-stat--md, .bw-stat--size-md {
3771
+ --bw-component-stat-tile-value-size: var(--bw-font-size-2xl);
3772
+ padding: var(--bw-size-inset-md);
2492
3773
  }
2493
3774
  .bw-stat--lg, .bw-stat--size-lg {
2494
- --bw-component-stat-tile-value-size: var(--bw-font-size-5xl);
2495
- padding: var(--bw-space-6);
3775
+ --bw-component-stat-tile-value-size: var(--bw-font-size-3xl);
3776
+ padding: var(--bw-size-inset-lg);
2496
3777
  }
2497
3778
  /* chrome="plain" (#694): proof figures without card chrome. Default remains
2498
3779
  the KPI card (border, elevation, card padding). Size modifiers' padding is
@@ -2642,14 +3923,14 @@ a.bw-stat--chrome-plain:hover {
2642
3923
  display: flex;
2643
3924
  flex-direction: column;
2644
3925
  gap: var(--bw-space-1);
3926
+ /* APP-002 (STA-002): same hairline-only resting chrome as .bw-stat above;
3927
+ raw oklch drop shadow removed (CB-16). */
3928
+ --bw-component-stat-tile-value-size: var(--bw-font-size-2xl);
2645
3929
  background: var(--bw-color-surface);
2646
3930
  border: var(--bw-size-border-hairline) solid
2647
- color-mix(in oklab, var(--bw-color-fg) 12%, var(--bw-color-surface));
3931
+ color-mix(in oklab, var(--bw-color-fg) 50%, var(--bw-color-surface));
2648
3932
  border-radius: var(--bw-radius-lg);
2649
- box-shadow:
2650
- var(--bw-elevation-1),
2651
- 0 4px 14px -4px oklch(0 0 0 / 0.1);
2652
- padding: var(--bw-density-card-padding);
3933
+ padding: var(--bw-size-inset-md);
2653
3934
  }
2654
3935
  .bw-stat-comparison__label {
2655
3936
  color: var(--bw-color-fg-muted);
@@ -2662,9 +3943,10 @@ a.bw-stat--chrome-plain:hover {
2662
3943
  }
2663
3944
  .bw-stat-comparison__current {
2664
3945
  margin: 0;
2665
- font-size: var(--bw-component-stat-tile-value-size, var(--bw-font-size-4xl));
3946
+ font-size: var(--bw-component-stat-tile-value-size, var(--bw-font-size-2xl));
2666
3947
  font-weight: var(--bw-font-weight-semibold);
2667
3948
  line-height: var(--bw-font-line-height-tight);
3949
+ letter-spacing: var(--bw-font-tracking-tight);
2668
3950
  font-variant-numeric: tabular-nums;
2669
3951
  }
2670
3952
  /* The previous-period value and its period_label caption share one line:
@@ -2680,16 +3962,21 @@ a.bw-stat--chrome-plain:hover {
2680
3962
  .bw-stat-comparison__period {
2681
3963
  color: var(--bw-color-fg-muted);
2682
3964
  }
2683
- /* size arg (mirrors _stat.html's VIZ-027 seam): modifiers re-point the
2684
- same value-size component token _stat.html uses, so a comparison tile
2685
- sits at the same scale as a plain stat tile sharing its grid. */
3965
+ /* size arg (mirrors _stat.html's VIZ-027 seam, STA-003): modifiers re-point
3966
+ the same value-size component token _stat.html uses, so a comparison tile
3967
+ sits at the same scale as a plain stat tile sharing its grid. Steps are
3968
+ coherent with .bw-stat: sm→xl, (md default→2xl), lg→3xl. */
2686
3969
  .bw-stat-comparison--sm, .bw-stat-comparison--size-sm {
2687
- --bw-component-stat-tile-value-size: var(--bw-font-size-3xl);
2688
- padding: var(--bw-space-3);
3970
+ --bw-component-stat-tile-value-size: var(--bw-font-size-xl);
3971
+ padding: var(--bw-size-inset-sm);
3972
+ }
3973
+ .bw-stat-comparison--md, .bw-stat-comparison--size-md {
3974
+ --bw-component-stat-tile-value-size: var(--bw-font-size-2xl);
3975
+ padding: var(--bw-size-inset-md);
2689
3976
  }
2690
3977
  .bw-stat-comparison--lg, .bw-stat-comparison--size-lg {
2691
- --bw-component-stat-tile-value-size: var(--bw-font-size-5xl);
2692
- padding: var(--bw-space-6);
3978
+ --bw-component-stat-tile-value-size: var(--bw-font-size-3xl);
3979
+ padding: var(--bw-size-inset-lg);
2693
3980
  }
2694
3981
  /* The trend row (_trend_indicator.html's css_class seam, matching #334's own
2695
3982
  .bw-stat__trend alias above): this template passes
@@ -3023,6 +4310,49 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
3023
4310
  flex-direction: column;
3024
4311
  gap: var(--bw-space-4);
3025
4312
  }
4313
+ /* Optional chrome above the mount (APP craft trend panel): title row with
4314
+ * optional metric segmented control, then an inline total + delta. Engine
4315
+ * ownership stays with the consumer; these classes are layout only. */
4316
+ .bw-chart-card__head {
4317
+ display: flex;
4318
+ justify-content: space-between;
4319
+ align-items: flex-start;
4320
+ gap: var(--bw-space-3);
4321
+ flex-wrap: wrap;
4322
+ }
4323
+ .bw-chart-card__title {
4324
+ margin: 0;
4325
+ font-size: var(--bw-font-size-sm);
4326
+ font-weight: var(--bw-font-weight-semibold);
4327
+ line-height: var(--bw-font-line-height-snug, 1.4);
4328
+ color: var(--bw-color-fg);
4329
+ }
4330
+ .bw-chart-card__subtitle {
4331
+ margin: var(--bw-space-1) 0 0;
4332
+ color: var(--bw-color-fg-muted);
4333
+ font-size: var(--bw-font-size-xs);
4334
+ }
4335
+ .bw-chart-card__total-row {
4336
+ display: flex;
4337
+ align-items: baseline;
4338
+ gap: var(--bw-space-2);
4339
+ flex-wrap: wrap;
4340
+ }
4341
+ .bw-chart-card__total {
4342
+ font-size: var(--bw-font-size-xl);
4343
+ font-weight: var(--bw-font-weight-semibold);
4344
+ letter-spacing: var(--bw-font-tracking-tight);
4345
+ font-variant-numeric: tabular-nums;
4346
+ color: var(--bw-color-fg);
4347
+ }
4348
+ .bw-chart-card__delta {
4349
+ font-size: var(--bw-font-size-xs);
4350
+ color: var(--bw-color-success);
4351
+ }
4352
+ .bw-chart-card__delta.is-down,
4353
+ .bw-chart-card__delta[data-bw-trend="down"] {
4354
+ color: var(--bw-color-warning);
4355
+ }
3026
4356
  .bw-chart-card--legend-bottom {
3027
4357
  flex-direction: column-reverse;
3028
4358
  }
@@ -3061,7 +4391,13 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
3061
4391
  display: block;
3062
4392
  inline-size: 100%;
3063
4393
  min-block-size: var(--bw-chart-mount-min-height, auto);
4394
+ /* Prefer an explicit height reservation when the consumer sets one; Chart.js
4395
+ * (and other engines that size the canvas from parent clientHeight) need a
4396
+ * definite block-size, not only min-block-size, or the canvas intrinsic
4397
+ * ratio expands the box past the CHT-024 reservation. */
4398
+ block-size: var(--bw-chart-mount-height, auto);
3064
4399
  aspect-ratio: var(--bw-chart-mount-aspect-ratio, auto);
4400
+ overflow: hidden;
3065
4401
  }
3066
4402
  /* The consumer's engine draws a <canvas> or <svg> into the mount; either
3067
4403
  * fills the reserved box exactly rather than adding its own intrinsic
@@ -3208,21 +4544,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
3208
4544
  block-size: 100%;
3209
4545
  }
3210
4546
 
3211
- /* Visually hidden, screen-reader-available text: the stat trend's directional
3212
- fallback ("increased"/"decreased", AC-BW-074) and any other markup whose
3213
- meaning must survive with CSS colour stripped. Standard clip pattern; the
3214
- px token keeps it out of the literal ban. */
3215
- .bw-visually-hidden {
3216
- position: absolute;
3217
- inline-size: var(--bw-space-px);
3218
- block-size: var(--bw-space-px);
3219
- margin: calc(var(--bw-space-px) * -1);
3220
- padding: 0;
3221
- overflow: hidden;
3222
- clip-path: inset(50%);
3223
- white-space: nowrap;
3224
- border: 0;
3225
- }
4547
+ /* .bw-visually-hidden lives in layout.css (F01 / R20). */
3226
4548
 
3227
4549
  /* --- Scorecard (VIZ-011/012, CHT-026) --------------------------------------- */
3228
4550
 
@@ -3588,14 +4910,14 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
3588
4910
  transition-duration: var(--bw-duration-instant);
3589
4911
  }
3590
4912
  /* Active tab: the nav band recipe (accent-duty text tier + accent marker).
3591
- * Two equivalent state carriers, one rule: the server-rendered floor marks
3592
- * the active anchor with the --active class; bwTabs marks its JS-selected
3593
- * tab with [data-bw-active] as selection moves (the class is the floor's,
3594
- * the attribute the enhancement's). The :hover restatement outranks the
4913
+ * Three equivalent state carriers, one rule: the server-rendered floor
4914
+ * marks the active anchor with the --active class; bwTabs marks its
4915
+ * JS-selected tab with [data-bw-active]; React and upgraded markup also
4916
+ * set aria-selected="true" (APP-003). The :hover restatement outranks the
3595
4917
  * plain hover rule so the active tab never dims back to fg on
3596
4918
  * pointer-over. */
3597
- .bw-tabs__tab:is(.bw-tabs__tab--active, [data-bw-active]),
3598
- .bw-tabs__tab:is(.bw-tabs__tab--active, [data-bw-active]):hover {
4919
+ .bw-tabs__tab:is(.bw-tabs__tab--active, [data-bw-active], [aria-selected="true"]),
4920
+ .bw-tabs__tab:is(.bw-tabs__tab--active, [data-bw-active], [aria-selected="true"]):hover {
3599
4921
  color: var(--bw-component-nav-item-active-text);
3600
4922
  border-block-end-color: var(--bw-component-nav-item-active-border);
3601
4923
  }
@@ -3615,10 +4937,12 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
3615
4937
  line-height: var(--bw-font-line-height-none);
3616
4938
  text-align: center;
3617
4939
  }
3618
- /* Pill style (CMP-024): no rail, no marker; selection is a selected-bg fill
3619
- * at radius-full. Hover/pressed take the overlay physics because a pill is
3620
- * a shape, not a rail position. The active pill's hover layers the overlay
3621
- * over the persistent fill (DESIGN.md 4.6 stacking). */
4940
+ /* Pill style (CMP-024): no rail, no underline marker; selection uses the
4941
+ * APP-003 pressed grammar owned by Segmented (accent-subtle fill, accent
4942
+ * text, accent border) at radius-full. Hover/pressed take the overlay
4943
+ * physics because a pill is a shape, not a rail position. The active
4944
+ * pill's hover layers the overlay over the persistent fill (DESIGN.md
4945
+ * 4.6 stacking). */
3622
4946
  /* --underline is the DOCUMENTED DEFAULT. It previously had no rule at all, so
3623
4947
  * the default variant emitted a class the stylesheet never matched (#120 defect
3624
4948
  * class). The underline treatment is the base .bw-tabs__tab marker, so this
@@ -3642,12 +4966,13 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
3642
4966
  background-color: var(--bw-state-active-overlay);
3643
4967
  transition-duration: var(--bw-duration-instant);
3644
4968
  }
3645
- .bw-tabs--pill .bw-tabs__tab:is(.bw-tabs__tab--active, [data-bw-active]),
3646
- .bw-tabs--pill .bw-tabs__tab:is(.bw-tabs__tab--active, [data-bw-active]):hover {
3647
- background-color: var(--bw-state-selected-bg);
4969
+ .bw-tabs--pill .bw-tabs__tab:is(.bw-tabs__tab--active, [data-bw-active], [aria-selected="true"]),
4970
+ .bw-tabs--pill .bw-tabs__tab:is(.bw-tabs__tab--active, [data-bw-active], [aria-selected="true"]):hover {
4971
+ background-color: var(--bw-color-accent-subtle);
3648
4972
  color: var(--bw-component-nav-item-active-text);
4973
+ border: var(--bw-size-border-hairline) solid var(--bw-color-accent);
3649
4974
  }
3650
- .bw-tabs--pill .bw-tabs__tab:is(.bw-tabs__tab--active, [data-bw-active]):hover {
4975
+ .bw-tabs--pill .bw-tabs__tab:is(.bw-tabs__tab--active, [data-bw-active], [aria-selected="true"]):hover {
3651
4976
  background-image: linear-gradient(var(--bw-state-hover-overlay), var(--bw-state-hover-overlay));
3652
4977
  }
3653
4978
  /* Panel spacing: the stack gap between the tablist and the panel. */
@@ -3690,6 +5015,10 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
3690
5015
  #bw-modal-root .bw-modal:not(.bw-modal--open):not([data-bw-open]) {
3691
5016
  display: none;
3692
5017
  }
5018
+ /* Floor and overlay roots never force the page wider than the viewport. */
5019
+ .bw-modal {
5020
+ max-inline-size: 100%;
5021
+ }
3693
5022
  /* The resting (floor) panel: the alone-on-a-page altitude of the auth and
3694
5023
  * centred panels (elevation-2), raised surface, the modal radius row.
3695
5024
  * Flex column so the header and footer hold still while the body scrolls
@@ -3698,11 +5027,11 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
3698
5027
  display: flex;
3699
5028
  flex-direction: column;
3700
5029
  inline-size: 100%;
3701
- max-inline-size: var(--bw-size-max-width-modal-md);
5030
+ max-inline-size: min(100%, var(--bw-size-max-width-modal-md));
3702
5031
  margin-inline: auto;
3703
5032
  background: var(--bw-color-surface-raised);
3704
5033
  border: var(--bw-size-border-hairline) solid
3705
- color-mix(in oklab, var(--bw-color-fg) 12%, var(--bw-color-surface-raised));
5034
+ color-mix(in oklab, var(--bw-color-fg) 50%, var(--bw-color-surface-raised));
3706
5035
  border-radius: var(--bw-radius-xl);
3707
5036
  box-shadow: var(--bw-elevation-2);
3708
5037
  }
@@ -3741,9 +5070,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
3741
5070
  position: relative;
3742
5071
  z-index: var(--bw-z-modal);
3743
5072
  max-block-size: 100%;
3744
- box-shadow:
3745
- var(--bw-elevation-4),
3746
- 0 16px 36px -10px oklch(0 0 0 / 0.16);
5073
+ box-shadow: var(--bw-elevation-4);
3747
5074
  animation: bw-modal-in var(--bw-duration-normal) var(--bw-ease-out);
3748
5075
  }
3749
5076
  @keyframes bw-modal-in {
@@ -3760,10 +5087,13 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
3760
5087
  * panel honours them too); full is full-viewport, gutterless, radius
3761
5088
  * squared off, and only means anything as an overlay. */
3762
5089
  .bw-modal--sm .bw-modal__panel, .bw-modal--size-sm .bw-modal__panel {
3763
- max-inline-size: var(--bw-size-max-width-modal-sm);
5090
+ max-inline-size: min(100%, var(--bw-size-max-width-modal-sm));
5091
+ }
5092
+ .bw-modal--md .bw-modal__panel, .bw-modal--size-md .bw-modal__panel {
5093
+ max-inline-size: min(100%, var(--bw-size-max-width-modal-md));
3764
5094
  }
3765
5095
  .bw-modal--lg .bw-modal__panel, .bw-modal--size-lg .bw-modal__panel {
3766
- max-inline-size: var(--bw-size-max-width-modal-lg);
5096
+ max-inline-size: min(100%, var(--bw-size-max-width-modal-lg));
3767
5097
  }
3768
5098
  .bw-modal--full:is(.bw-modal--open, [data-bw-open]), .bw-modal--size-full:is(.bw-modal--open, [data-bw-open]) {
3769
5099
  padding: 0;
@@ -3841,10 +5171,13 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
3841
5171
  /* --- Slide-over / side panel (0.14.0, brickwork#55) -------------------------- */
3842
5172
 
3843
5173
  /* Consumed by extending _slide_over.html; two render paths, one partial
3844
- * (BR-BW-HTMX-001), same shape as the modal above. Markup (per
3845
- * _slide_over.html):
5174
+ * (BR-BW-HTMX-001), same shape as the modal above. One unit (Sheet and
5175
+ * slide-over, docs/components/sheet.md): .bw-slide-over is the canonical
5176
+ * root, and .bw-sheet is its narrower mobile sheet mode (a modifier on the
5177
+ * same root, never a second primitive). The drawer (.bw-drawer) is the
5178
+ * Sidebar unit's, not this one. Markup (per _slide_over.html):
3846
5179
  *
3847
- * <div class="bw-slide-over bw-slide-over--sm|--md|--lg bw-slide-over--start|--end">
5180
+ * <div class="bw-slide-over bw-slide-over--size-sm|md|lg bw-slide-over--start|end [bw-sheet]">
3848
5181
  * <div class="bw-slide-over__scrim" aria-hidden="true"></div>
3849
5182
  * <div role="dialog" class="bw-slide-over__panel">
3850
5183
  * <header class="bw-slide-over__header">
@@ -3917,9 +5250,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
3917
5250
  position: relative;
3918
5251
  z-index: var(--bw-z-modal);
3919
5252
  max-block-size: 100%;
3920
- box-shadow:
3921
- var(--bw-elevation-4),
3922
- 0 16px 36px -10px oklch(0 0 0 / 0.16);
5253
+ box-shadow: var(--bw-elevation-4);
3923
5254
  animation-duration: var(--bw-duration-normal);
3924
5255
  animation-timing-function: var(--bw-ease-out);
3925
5256
  }
@@ -3977,20 +5308,28 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
3977
5308
  animation: none;
3978
5309
  }
3979
5310
  }
3980
- /* Size modifiers: reuse the modal's own width ramp. */
3981
- .bw-slide-over--sm .bw-slide-over__panel, .bw-slide-over--size-sm .bw-slide-over__panel {
5311
+ /* Size axis (SHT-003): the width ramp only, on the modal's own tokens
5312
+ * (--bw-size-max-width-modal-sm|md|lg, 28, 32 and 48rem). This is not the
5313
+ * xs to xl control-height axis and not the inset axis (SIZE-COVERAGE).
5314
+ * bw-slide-over--size-<step> is the only spelling; there is no bare
5315
+ * bw-slide-over--sm. md is the documented default and the template emits
5316
+ * it unconditionally, so it carries a real rule. */
5317
+ .bw-slide-over--size-sm .bw-slide-over__panel {
3982
5318
  max-inline-size: var(--bw-size-max-width-modal-sm);
3983
5319
  }
3984
- /* --md is the DOCUMENTED DEFAULT and the template emits it unconditionally, so
3985
- * it needs a real rule: without one the default size resolved to the panel's
3986
- * base width by accident rather than by declaration (the #120 defect class,
3987
- * found in the 3.0.0 options audit). */
3988
- .bw-slide-over--md .bw-slide-over__panel, .bw-slide-over--size-md .bw-slide-over__panel {
5320
+ .bw-slide-over--size-md .bw-slide-over__panel {
3989
5321
  max-inline-size: var(--bw-size-max-width-modal-md);
3990
5322
  }
3991
- .bw-slide-over--lg .bw-slide-over__panel, .bw-slide-over--size-lg .bw-slide-over__panel {
5323
+ .bw-slide-over--size-lg .bw-slide-over__panel {
3992
5324
  max-inline-size: var(--bw-size-max-width-modal-lg);
3993
5325
  }
5326
+ /* Sheet mode (SHT-004): the narrow mobile sheet, on either placement. It is
5327
+ * a modifier on the same root and overrides the size ramp with a fixed
5328
+ * narrower cap: the modal sm width less 4rem, which resolves to 24rem. The
5329
+ * panel is still fluid below the cap. */
5330
+ .bw-slide-over.bw-sheet .bw-slide-over__panel {
5331
+ max-inline-size: calc(var(--bw-size-max-width-modal-sm) - var(--bw-space-16));
5332
+ }
3994
5333
  /* Sticky header: title plus the always-present close control, divided
3995
5334
  * from the scrolling body by a hairline. Density card padding scales the
3996
5335
  * chrome with the density axis, matching the modal. */
@@ -4060,7 +5399,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
4060
5399
  * <svg class="bw-icon bw-toast__icon" aria-hidden="true">...</svg>
4061
5400
  * <p class="bw-toast__message">...</p>
4062
5401
  * [<a class="bw-toast__action" href="...">label</a>]
4063
- * <button class="bw-toast__close bw-btn bw-btn--ghost bw-btn--sm bw-btn--icon-only">...</button>
5402
+ * <button class="bw-toast__close bw-btn bw-btn--ghost bw-btn--size-sm bw-btn--icon-only">...</button>
4064
5403
  * </div>
4065
5404
  * <button class="bw-toast-region__more" hidden>+N more</button>
4066
5405
  * </div>
@@ -4130,9 +5469,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
4130
5469
  color-mix(in oklab, var(--bw-color-fg) 12%, var(--bw-color-surface-raised));
4131
5470
  border-inline-start: var(--bw-size-border-thick) solid var(--bw-color-border);
4132
5471
  border-radius: var(--bw-radius-xl);
4133
- box-shadow:
4134
- var(--bw-elevation-5),
4135
- 0 20px 44px -12px oklch(0 0 0 / 0.18);
5472
+ box-shadow: var(--bw-elevation-5);
4136
5473
  opacity: 0;
4137
5474
  transform: translateY(calc(-1 * var(--bw-space-2)));
4138
5475
  transition:
@@ -4715,10 +6052,19 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
4715
6052
  * removal closes the gap in one reflow exactly as reduced motion does
4716
6053
  * (the global floor collapses this fade to an instant removal). */
4717
6054
  .bw-alert[data-bw-dismissing],
4718
- .bw-badge[data-bw-dismissing] {
6055
+ .bw-badge[data-bw-dismissing],
6056
+ .bw-banner[data-bw-dismissing] {
4719
6057
  opacity: 0;
4720
6058
  transition: opacity var(--bw-duration-fast) var(--bw-ease-in);
4721
6059
  }
6060
+ /* reduced-motion: Banner dismiss must collapse to an instant removal; the
6061
+ * global floor (0.001ms) is not identical to 0s, so an explicit banner-only
6062
+ * override is needed to satisfy MOT-007's clear-quickly contract. */
6063
+ @media (prefers-reduced-motion: reduce) {
6064
+ .bw-banner[data-bw-dismissing] {
6065
+ transition-duration: var(--bw-duration-instant) !important;
6066
+ }
6067
+ }
4722
6068
  /* The badge's close control skips the bw-btn chrome (a control-height button
4723
6069
  * would dwarf the compact badge; the template notes the hit area is owned
4724
6070
  * here): an inline icon run with the overlay hover physics, inline content's
@@ -4776,27 +6122,186 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
4776
6122
  inset-inline-start: 50%;
4777
6123
  transform: translateX(-50%);
4778
6124
  }
4779
- .bw-tooltip--bottom .bw-tooltip__bubble {
4780
- inset-block-start: calc(100% + var(--bw-space-1));
4781
- inset-inline-start: 50%;
4782
- transform: translateX(-50%);
6125
+ .bw-tooltip--bottom .bw-tooltip__bubble {
6126
+ inset-block-start: calc(100% + var(--bw-space-1));
6127
+ inset-inline-start: 50%;
6128
+ transform: translateX(-50%);
6129
+ }
6130
+ /* Logical placements: inline-start/-end flip automatically under dir="rtl"
6131
+ * (BR-BW-TOK-005), unlike top/bottom which are block-axis and
6132
+ * direction-agnostic already. */
6133
+ .bw-tooltip--start .bw-tooltip__bubble {
6134
+ inset-inline-end: calc(100% + var(--bw-space-1));
6135
+ inset-block-start: 50%;
6136
+ transform: translateY(-50%);
6137
+ }
6138
+ .bw-tooltip--end .bw-tooltip__bubble {
6139
+ inset-inline-start: calc(100% + var(--bw-space-1));
6140
+ inset-block-start: 50%;
6141
+ transform: translateY(-50%);
6142
+ }
6143
+ [data-theme="dark"] .bw-tooltip__bubble {
6144
+ box-shadow: var(--bw-elevation-3);
6145
+ }
6146
+
6147
+ /* --- Popover (docs/components/popover.md, R39 / H15) -------------------------- */
6148
+
6149
+ /* The small, non-modal panel that opens beside the control that asked for it
6150
+ * and holds interactive content. The no-JS floor is a native <details> and
6151
+ * <summary> (POP-003); script (@bwui/js initPopover, the Django bwPopover
6152
+ * module, React, Vue) upgrades the same markup. The native HTML popover
6153
+ * attribute is never used, so the panel stays on the --bw-z-dropdown rung.
6154
+ * Expected markup:
6155
+ *
6156
+ * <details class="bw-popover bw-popover--bottom">
6157
+ * <summary class="bw-popover__trigger bw-btn bw-btn--secondary bw-btn--size-md">
6158
+ * label
6159
+ * </summary>
6160
+ * <div class="bw-popover__panel" id="p" role="dialog" aria-labelledby="p-title">
6161
+ * <div class="bw-popover__header">
6162
+ * <h2 class="bw-popover__title" id="p-title">Title</h2>
6163
+ * [<button class="bw-popover__close" aria-label="Close" data-bw-popover-close>
6164
+ * <svg class="bw-icon" aria-hidden="true">...</svg>
6165
+ * </button>]
6166
+ * </div>
6167
+ * <div class="bw-popover__body">...</div>
6168
+ * [<div class="bw-popover__footer">...</div>]
6169
+ * </div>
6170
+ * </details>
6171
+ *
6172
+ * Open state is carried by [open] on the floor details and by
6173
+ * [data-bw-open] on the root under script; React and Vue render a div root
6174
+ * and a [hidden] panel, so one entrance rule serves every delivery. Close is
6175
+ * an instant state removal (POP-015). A closed panel is hidden by the native
6176
+ * details behaviour or by the [hidden] floor restated in index-extras.css.
6177
+ * The panel never sets overflow (POP-005), so a combobox listbox or a
6178
+ * date-picker panel inside it is not clipped. Every value reads a --bw-*
6179
+ * token directly; the block keeps no private custom properties. */
6180
+ .bw-popover {
6181
+ position: relative;
6182
+ display: inline-block;
6183
+ }
6184
+ .bw-popover__trigger {
6185
+ cursor: pointer;
6186
+ list-style: none;
6187
+ }
6188
+ .bw-popover__trigger::-webkit-details-marker {
6189
+ display: none;
6190
+ }
6191
+ /* Panel surface: raised fill, hairline border, radius-xl, elevation-3 at the
6192
+ * dropdown rung (POP-010; dark reset list at the end of this file). Content
6193
+ * sized and capped at the viewport less space-8 (POP-011); padding is the
6194
+ * density-computed md inset. A root with no placement modifier resolves to
6195
+ * bottom: the panel's inline-start edge aligns to the root's, never centred
6196
+ * on the trigger (POP-012). */
6197
+ .bw-popover__panel {
6198
+ position: absolute;
6199
+ inset-block-start: calc(100% + var(--bw-space-1));
6200
+ inset-inline-start: 0;
6201
+ z-index: var(--bw-z-dropdown);
6202
+ box-sizing: border-box;
6203
+ display: flex;
6204
+ flex-direction: column;
6205
+ gap: var(--bw-space-3);
6206
+ inline-size: max-content;
6207
+ max-inline-size: calc(100vw - var(--bw-space-8));
6208
+ padding: var(--bw-size-inset-md);
6209
+ background: var(--bw-color-surface-raised);
6210
+ color: var(--bw-color-fg);
6211
+ border: var(--bw-size-border-hairline) solid var(--bw-color-border);
6212
+ border-radius: var(--bw-radius-xl);
6213
+ box-shadow: var(--bw-elevation-3);
6214
+ text-align: start;
6215
+ }
6216
+ .bw-popover--top .bw-popover__panel {
6217
+ inset-block-start: auto;
6218
+ inset-block-end: calc(100% + var(--bw-space-1));
6219
+ }
6220
+ /* start and end are logical: they flip under dir="rtl" (POP-016). The
6221
+ * panel's block-start edge aligns to the root's. */
6222
+ .bw-popover--start .bw-popover__panel {
6223
+ inset-block-start: 0;
6224
+ inset-inline-start: auto;
6225
+ inset-inline-end: calc(100% + var(--bw-space-1));
6226
+ }
6227
+ .bw-popover--end .bw-popover__panel {
6228
+ inset-block-start: 0;
6229
+ inset-inline-start: calc(100% + var(--bw-space-1));
6230
+ }
6231
+ .bw-popover[open] > .bw-popover__panel,
6232
+ .bw-popover[data-bw-open] > .bw-popover__panel {
6233
+ animation: bw-fade-in-up var(--bw-duration-normal) var(--bw-ease-out);
6234
+ }
6235
+ .bw-popover__header {
6236
+ display: flex;
6237
+ align-items: flex-start;
6238
+ justify-content: space-between;
6239
+ gap: var(--bw-space-3);
6240
+ }
6241
+ .bw-popover__title {
6242
+ margin: 0;
6243
+ color: var(--bw-color-fg);
6244
+ font-family: var(--bw-text-heading-sm-family);
6245
+ font-size: var(--bw-text-heading-sm-size);
6246
+ font-weight: var(--bw-text-heading-sm-weight);
6247
+ line-height: var(--bw-text-heading-sm-line-height);
6248
+ }
6249
+ .bw-popover__body {
6250
+ font-size: var(--bw-text-body-sm-size);
6251
+ line-height: var(--bw-text-body-sm-line-height);
6252
+ }
6253
+ .bw-popover__footer:empty {
6254
+ display: none;
6255
+ }
6256
+ .bw-popover__footer {
6257
+ display: flex;
6258
+ flex-wrap: wrap;
6259
+ justify-content: flex-end;
6260
+ gap: var(--bw-space-3);
6261
+ font-size: var(--bw-text-body-sm-size);
6262
+ line-height: var(--bw-text-body-sm-line-height);
6263
+ }
6264
+ /* Close control (POP-014): its own icon-only button, painted like the
6265
+ * combobox clear control. The 2rem box is above the 24px target floor. */
6266
+ .bw-popover__close {
6267
+ display: inline-flex;
6268
+ flex: none;
6269
+ align-items: center;
6270
+ justify-content: center;
6271
+ inline-size: calc(var(--bw-component-icon-size-sm) + 2 * var(--bw-space-2));
6272
+ block-size: calc(var(--bw-component-icon-size-sm) + 2 * var(--bw-space-2));
6273
+ margin-inline-start: auto;
6274
+ padding: 0;
6275
+ background: transparent;
6276
+ border: 0;
6277
+ border-radius: var(--bw-radius-full);
6278
+ color: var(--bw-color-fg-muted);
6279
+ cursor: pointer;
6280
+ transition: var(--bw-transition-colors);
6281
+ }
6282
+ .bw-popover__close .bw-icon,
6283
+ .bw-popover__close svg {
6284
+ inline-size: var(--bw-component-icon-size-sm);
6285
+ block-size: var(--bw-component-icon-size-sm);
6286
+ background: transparent;
6287
+ border-radius: 0;
6288
+ color: inherit;
4783
6289
  }
4784
- /* Logical placements: inline-start/-end flip automatically under dir="rtl"
4785
- * (BR-BW-TOK-005), unlike top/bottom which are block-axis and
4786
- * direction-agnostic already. */
4787
- .bw-tooltip--start .bw-tooltip__bubble {
4788
- inset-inline-end: calc(100% + var(--bw-space-1));
4789
- inset-block-start: 50%;
4790
- transform: translateY(-50%);
6290
+ .bw-popover__close:hover {
6291
+ background-color: var(--bw-state-hover-overlay);
6292
+ color: var(--bw-color-fg);
4791
6293
  }
4792
- .bw-tooltip--end .bw-tooltip__bubble {
4793
- inset-inline-start: calc(100% + var(--bw-space-1));
4794
- inset-block-start: 50%;
4795
- transform: translateY(-50%);
6294
+ .bw-popover__close:active {
6295
+ background-color: var(--bw-state-active-overlay);
6296
+ transition-duration: var(--bw-duration-instant);
4796
6297
  }
4797
- [data-theme="dark"] .bw-tooltip__bubble {
4798
- box-shadow: var(--bw-elevation-3);
6298
+ @media (prefers-reduced-motion: reduce) {
6299
+ .bw-popover[open] > .bw-popover__panel,
6300
+ .bw-popover[data-bw-open] > .bw-popover__panel {
6301
+ animation: none;
6302
+ }
4799
6303
  }
6304
+ /* --- end Popover --- */
4800
6305
 
4801
6306
  /* reduced-motion (interaction set): explicit caret overrides on top of the
4802
6307
  * global floor; a half-rotated caret reads as broken (DESIGN.md 8.4). The
@@ -5126,7 +6631,7 @@ input.bw-input[type="datetime-local"]:hover::-webkit-calendar-picker-indicator {
5126
6631
  box-shadow: var(--bw-elevation-3);
5127
6632
  padding: var(--bw-space-4);
5128
6633
  inline-size: max-content;
5129
- max-inline-size: calc(100vw - var(--bw-space-8));
6634
+ max-inline-size: 100%;
5130
6635
  }
5131
6636
  .bw-date-picker-chrome__panel[hidden] {
5132
6637
  display: none;
@@ -5928,38 +7433,75 @@ input.bw-input[type="datetime-local"]:hover::-webkit-calendar-picker-indicator {
5928
7433
  flex: 0 0 var(--bw-space-6);
5929
7434
  }
5930
7435
 
5931
- /* --- Avatar (Beat Phase B, #542) ------------------------------------------- */
5932
- /* Box size reuses shipped control-height tokens (DESIGN.md §10 keeps
5933
- --bw-avatar-size-* reserved until a consumer needs a distinct scale). */
7436
+ /* --- Avatar and avatar group (docs/components/avatar.md) --------------------- */
7437
+ /* Display atom. The box is the control height: the avatar reads only the five
7438
+ * control role variables (ADR-126 section 4), declared on :root and in every
7439
+ * [data-density] block (md at the density in force) and inherited here. A bare
7440
+ * .bw-avatar is md, a size class re-points them (ADR-125), and a control
7441
+ * container can set one step for its children. The avatar never reads a
7442
+ * density token or a --bw-size-control-* step token outside the size classes
7443
+ * (AVR-010). The 1.5rem target floor is carried by the height tokens, so a
7444
+ * linked avatar meets WCAG 2.5.8 at every step and density (AVR-052). There is
7445
+ * no bare spelling (bw-avatar--sm). --bw-avatar-size-* stays reserved. */
5934
7446
 
5935
7447
  .bw-avatar {
5936
7448
  display: inline-flex;
5937
7449
  align-items: center;
5938
7450
  justify-content: center;
5939
- inline-size: var(--bw-size-control-height-md);
5940
- block-size: var(--bw-size-control-height-md);
7451
+ inline-size: var(--bw-control-height);
7452
+ block-size: var(--bw-control-height);
5941
7453
  overflow: hidden;
5942
7454
  border-radius: var(--bw-radius-full);
5943
7455
  background: var(--bw-color-surface-sunken);
5944
7456
  color: var(--bw-color-fg-muted);
5945
7457
  border: var(--bw-size-border-hairline) solid color-mix(in oklab, var(--bw-color-fg) 12%, var(--bw-color-surface));
7458
+ /* Type follows the step (ADR-127 section 6): the letters take the fifth role
7459
+ * variable, the ladder step of the same name, floored by the ladder. They
7460
+ * are not a ratio of the box (AVR-013). */
7461
+ font-size: var(--bw-control-font-size);
7462
+ line-height: 1;
5946
7463
  vertical-align: middle;
5947
7464
  flex-shrink: 0;
5948
7465
  }
5949
7466
 
7467
+ .bw-avatar--size-xs {
7468
+ --bw-control-height: var(--bw-size-control-height-xs);
7469
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-xs);
7470
+ --bw-control-icon-size: var(--bw-size-control-icon-xs);
7471
+ --bw-control-gap: var(--bw-size-control-gap-xs);
7472
+ --bw-control-font-size: var(--bw-font-size-xs);
7473
+ }
7474
+
5950
7475
  .bw-avatar--size-sm {
5951
- inline-size: var(--bw-size-control-height-sm);
5952
- block-size: var(--bw-size-control-height-sm);
7476
+ --bw-control-height: var(--bw-size-control-height-sm);
7477
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-sm);
7478
+ --bw-control-icon-size: var(--bw-size-control-icon-sm);
7479
+ --bw-control-gap: var(--bw-size-control-gap-sm);
7480
+ --bw-control-font-size: var(--bw-font-size-sm);
5953
7481
  }
5954
7482
 
5955
7483
  .bw-avatar--size-md {
5956
- inline-size: var(--bw-size-control-height-md);
5957
- block-size: var(--bw-size-control-height-md);
7484
+ --bw-control-height: var(--bw-size-control-height-md);
7485
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
7486
+ --bw-control-icon-size: var(--bw-size-control-icon-md);
7487
+ --bw-control-gap: var(--bw-size-control-gap-md);
7488
+ --bw-control-font-size: var(--bw-font-size-md);
5958
7489
  }
5959
7490
 
5960
7491
  .bw-avatar--size-lg {
5961
- inline-size: var(--bw-size-control-height-lg);
5962
- block-size: var(--bw-size-control-height-lg);
7492
+ --bw-control-height: var(--bw-size-control-height-lg);
7493
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-lg);
7494
+ --bw-control-icon-size: var(--bw-size-control-icon-lg);
7495
+ --bw-control-gap: var(--bw-size-control-gap-lg);
7496
+ --bw-control-font-size: var(--bw-font-size-lg);
7497
+ }
7498
+
7499
+ .bw-avatar--size-xl {
7500
+ --bw-control-height: var(--bw-size-control-height-xl);
7501
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-xl);
7502
+ --bw-control-icon-size: var(--bw-size-control-icon-xl);
7503
+ --bw-control-gap: var(--bw-size-control-gap-xl);
7504
+ --bw-control-font-size: var(--bw-font-size-xl);
5963
7505
  }
5964
7506
 
5965
7507
  /* circle is the documented default shape (#120/#130): restates the base
@@ -5973,33 +7515,44 @@ input.bw-input[type="datetime-local"]:hover::-webkit-calendar-picker-indicator {
5973
7515
  }
5974
7516
 
5975
7517
  .bw-avatar__image {
7518
+ display: block;
5976
7519
  inline-size: 100%;
5977
7520
  block-size: 100%;
5978
7521
  object-fit: cover;
5979
7522
  }
5980
7523
 
5981
7524
  .bw-avatar__initials {
5982
- font-size: calc(var(--bw-size-control-height-md) * 0.375);
5983
7525
  font-weight: var(--bw-font-weight-semibold);
5984
7526
  line-height: 1;
5985
7527
  letter-spacing: 0.02em;
5986
7528
  text-transform: uppercase;
7529
+ white-space: nowrap;
5987
7530
  max-inline-size: 100%;
5988
7531
  overflow: hidden;
5989
7532
  }
5990
7533
 
5991
- .bw-avatar--size-sm .bw-avatar__initials {
5992
- font-size: calc(var(--bw-size-control-height-sm) * 0.375);
5993
- }
5994
-
5995
- .bw-avatar--size-lg .bw-avatar__initials {
5996
- font-size: calc(var(--bw-size-control-height-lg) * 0.375);
7534
+ /* The letters content shape (initials fallback, no image). The ink is the full
7535
+ * foreground so the letters clear 4.5:1 on the sunken fill in both themes
7536
+ * (AVR-014, section 4.3 of the craft document). */
7537
+ .bw-avatar--initials {
7538
+ color: var(--bw-color-fg);
5997
7539
  }
5998
7540
 
5999
7541
  .bw-avatar--overflow {
6000
7542
  background: var(--bw-color-surface-raised);
6001
7543
  color: var(--bw-color-fg);
6002
7544
  border-color: var(--bw-color-border);
7545
+ /* Wide counts such as +120 must not clip; grow the box on the inline axis.
7546
+ * The box is the minimum; the inline padding is half the step's control gap. */
7547
+ inline-size: auto;
7548
+ min-inline-size: var(--bw-control-height);
7549
+ padding-inline: calc(var(--bw-control-gap) * 0.5);
7550
+ }
7551
+
7552
+ .bw-avatar--overflow .bw-avatar__initials {
7553
+ max-inline-size: none;
7554
+ overflow: visible;
7555
+ text-transform: none;
6003
7556
  }
6004
7557
 
6005
7558
  .bw-avatar-group {
@@ -6011,23 +7564,78 @@ input.bw-input[type="datetime-local"]:hover::-webkit-calendar-picker-indicator {
6011
7564
  box-shadow: 0 0 0 var(--bw-size-border-thick) var(--bw-color-surface);
6012
7565
  }
6013
7566
 
7567
+ /* Overlap follows each avatar's --bw-control-gap (set by its size class). */
6014
7568
  .bw-avatar-group .bw-avatar + .bw-avatar {
6015
- margin-inline-start: calc(var(--bw-space-2) * -1);
7569
+ margin-inline-start: calc(var(--bw-control-gap) * -1);
6016
7570
  }
6017
7571
 
6018
- /* --- Chip / filter chip (Beat Phase B, #542) ------------------------------- */
7572
+ /* --- Chip (R09, A04; docs/components/chip.md) ----------------------------- */
7573
+
7574
+ /* Size grammar (CHP-003): bw-chip--size-xs to -xl re-point the five control
7575
+ * role variables at the step they name, exactly as Button, Radio and Switch do
7576
+ * (ADR-125, ADR-126 section 4), and name the matching container inset step in
7577
+ * the block-private --bw-chip-inset (the inset axis, SIZE-COVERAGE gate 6).
7578
+ * There is no bare spelling. A bare .bw-chip inherits the role variables in
7579
+ * force (md from :root) and falls back to the md inset; emit the class to pin
7580
+ * a step. */
7581
+ .bw-chip--size-xs {
7582
+ --bw-control-height: var(--bw-size-control-height-xs);
7583
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-xs);
7584
+ --bw-control-icon-size: var(--bw-size-control-icon-xs);
7585
+ --bw-control-gap: var(--bw-size-control-gap-xs);
7586
+ --bw-control-font-size: var(--bw-font-size-xs);
7587
+ --bw-chip-inset: var(--bw-size-inset-xs);
7588
+ }
7589
+ .bw-chip--size-sm {
7590
+ --bw-control-height: var(--bw-size-control-height-sm);
7591
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-sm);
7592
+ --bw-control-icon-size: var(--bw-size-control-icon-sm);
7593
+ --bw-control-gap: var(--bw-size-control-gap-sm);
7594
+ --bw-control-font-size: var(--bw-font-size-sm);
7595
+ --bw-chip-inset: var(--bw-size-inset-sm);
7596
+ }
7597
+ .bw-chip--size-md {
7598
+ --bw-control-height: var(--bw-size-control-height-md);
7599
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
7600
+ --bw-control-icon-size: var(--bw-size-control-icon-md);
7601
+ --bw-control-gap: var(--bw-size-control-gap-md);
7602
+ --bw-control-font-size: var(--bw-font-size-md);
7603
+ --bw-chip-inset: var(--bw-size-inset-md);
7604
+ }
7605
+ .bw-chip--size-lg {
7606
+ --bw-control-height: var(--bw-size-control-height-lg);
7607
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-lg);
7608
+ --bw-control-icon-size: var(--bw-size-control-icon-lg);
7609
+ --bw-control-gap: var(--bw-size-control-gap-lg);
7610
+ --bw-control-font-size: var(--bw-font-size-lg);
7611
+ --bw-chip-inset: var(--bw-size-inset-lg);
7612
+ }
7613
+ .bw-chip--size-xl {
7614
+ --bw-control-height: var(--bw-size-control-height-xl);
7615
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-xl);
7616
+ --bw-control-icon-size: var(--bw-size-control-icon-xl);
7617
+ --bw-control-gap: var(--bw-size-control-gap-xl);
7618
+ --bw-control-font-size: var(--bw-font-size-xl);
7619
+ --bw-chip-inset: var(--bw-size-inset-xl);
7620
+ }
6019
7621
 
6020
7622
  .bw-chip {
6021
7623
  display: inline-flex;
6022
7624
  align-items: center;
6023
- gap: var(--bw-space-1);
6024
- padding-block: var(--bw-space-1);
6025
- padding-inline: var(--bw-space-3);
7625
+ /* Gap, text and the interactive height floor read the role variables
7626
+ * (CHP-010). Padding is the compact-pill model: a fixed fraction of the
7627
+ * container inset step the size names (inline three quarters, block a
7628
+ * quarter), so a chip stays a pill at every step and tracks density through
7629
+ * --bw-size-inset-<step>. At comfortable md that is 0.75rem and 0.25rem. */
7630
+ gap: var(--bw-control-gap);
7631
+ padding-block: calc(var(--bw-chip-inset, var(--bw-size-inset-md)) / 4);
7632
+ padding-inline: calc(var(--bw-chip-inset, var(--bw-size-inset-md)) * 0.75);
7633
+ margin: 0;
6026
7634
  border: var(--bw-size-border-hairline) solid transparent;
6027
7635
  border-radius: var(--bw-radius-full);
6028
- font-size: var(--bw-text-caption-size);
7636
+ font-size: var(--bw-control-font-size);
6029
7637
  font-weight: var(--bw-font-weight-medium);
6030
- line-height: var(--bw-text-caption-line-height);
7638
+ line-height: var(--bw-font-line-height-tight);
6031
7639
  background: var(--bw-color-surface-sunken);
6032
7640
  color: var(--bw-color-fg-muted);
6033
7641
  text-decoration: none;
@@ -6035,22 +7643,27 @@ input.bw-input[type="datetime-local"]:hover::-webkit-calendar-picker-indicator {
6035
7643
  transition: var(--bw-transition-colors);
6036
7644
  }
6037
7645
 
7646
+ /* Interactive chips (a toggle button, a link). WCAG 2.5.8 floor: never below
7647
+ * 1.5rem however small the density resolves; above it the floor follows the
7648
+ * control height (CHP-011). Only the font family is inherited: the size, weight
7649
+ * and line height stay the chip's own. */
6038
7650
  button.bw-chip,
6039
7651
  a.bw-chip {
7652
+ justify-content: center;
7653
+ min-block-size: max(1.5rem, calc(var(--bw-control-height) * 0.6));
7654
+ min-inline-size: 1.5rem;
7655
+ font-family: inherit;
6040
7656
  cursor: pointer;
6041
- font: inherit;
6042
7657
  }
6043
7658
 
6044
- .bw-chip--size-sm {
6045
- padding-block: var(--bw-space-0-5);
6046
- padding-inline: var(--bw-space-2);
7659
+ button.bw-chip:where(:hover:not(:disabled)),
7660
+ a.bw-chip:where(:hover:not([aria-disabled="true"])) {
7661
+ background-image: linear-gradient(var(--bw-state-hover-overlay), var(--bw-state-hover-overlay));
6047
7662
  }
6048
-
6049
- /* md is the documented default chip size (#120/#130): restates the base
6050
- * padding so the emitted class has a named rule. */
6051
- .bw-chip--size-md {
6052
- padding-block: var(--bw-space-1);
6053
- padding-inline: var(--bw-space-3);
7663
+ button.bw-chip:where(:active:not(:disabled)),
7664
+ a.bw-chip:where(:active:not([aria-disabled="true"])) {
7665
+ background-image: linear-gradient(var(--bw-state-active-overlay), var(--bw-state-active-overlay));
7666
+ transition-duration: var(--bw-duration-instant);
6054
7667
  }
6055
7668
 
6056
7669
  .bw-chip--neutral {
@@ -6083,29 +7696,187 @@ a.bw-chip {
6083
7696
  border-color: var(--bw-color-info-border);
6084
7697
  }
6085
7698
 
7699
+ /* Pressed / selected paint is owned by Segmented (APP-003 / SEG-020). Chip
7700
+ * filter membership keeps .bw-chip--selected as the class name; the treatment
7701
+ * matches .bw-segmented__item[aria-pressed="true"]. GAP-CHP-1 closed by R11.
7702
+ */
6086
7703
  .bw-chip--selected {
6087
- box-shadow: inset 0 0 0 var(--bw-size-border-thick) var(--bw-color-accent);
7704
+ background: var(--bw-color-accent-subtle);
7705
+ color: var(--bw-component-nav-item-active-text);
7706
+ border-color: var(--bw-color-accent);
7707
+ box-shadow: none;
7708
+ }
7709
+
7710
+ /* Disabled (CHP-023): a disabled toggle, or an aria-disabled link. Outranks
7711
+ * the tone classes so the chip is flat whatever its tone. */
7712
+ button.bw-chip:disabled,
7713
+ a.bw-chip[aria-disabled="true"] {
7714
+ background: var(--bw-color-action-disabled-bg);
7715
+ background-image: none;
7716
+ color: var(--bw-color-action-disabled-text);
7717
+ border-color: var(--bw-color-action-disabled-border);
7718
+ box-shadow: none;
7719
+ cursor: not-allowed;
7720
+ }
7721
+
7722
+ /* The dismiss control (CHP-030): a real button inside a span chip. Its hit
7723
+ * area is at least 1.5rem square (WCAG 2.5.8); the negative block margin lets
7724
+ * that box overlap the chip's own padding so a dismissible chip is no taller
7725
+ * than a static one of the same step, and the negative end margin tucks it
7726
+ * into the inline padding. The glyph is the control icon size. */
7727
+ .bw-chip__close {
7728
+ display: inline-flex;
7729
+ align-items: center;
7730
+ justify-content: center;
7731
+ flex-shrink: 0;
7732
+ min-inline-size: 1.5rem;
7733
+ min-block-size: 1.5rem;
7734
+ margin-block: min(0px, calc((var(--bw-control-font-size) * var(--bw-font-line-height-tight) - 1.5rem) / 2));
7735
+ margin-inline-end: calc(var(--bw-control-gap) * -0.5);
7736
+ padding: 0;
7737
+ background: transparent;
7738
+ border: 0;
7739
+ border-radius: var(--bw-radius-full);
7740
+ color: inherit;
7741
+ cursor: pointer;
7742
+ transition: var(--bw-transition-colors);
7743
+ }
7744
+ .bw-chip__close .bw-icon,
7745
+ .bw-chip__close svg {
7746
+ inline-size: var(--bw-control-icon-size);
7747
+ block-size: var(--bw-control-icon-size);
7748
+ background: transparent;
7749
+ border-radius: 0;
7750
+ color: inherit;
7751
+ }
7752
+ .bw-chip__close:hover {
7753
+ background-color: var(--bw-state-hover-overlay);
7754
+ }
7755
+ .bw-chip__close:active {
7756
+ background-color: var(--bw-state-active-overlay);
7757
+ transition-duration: var(--bw-duration-instant);
7758
+ }
7759
+
7760
+ /* Dismissal exit, keyed on the marker bwDismissible stamps (CHP-032). The
7761
+ * global reduced-motion floor collapses it to an instant removal. */
7762
+ .bw-chip[data-bw-dismissing] {
7763
+ opacity: 0;
7764
+ transition: opacity var(--bw-duration-fast) var(--bw-ease-in);
7765
+ }
7766
+
7767
+ /* --- Segmented control (docs/components/segmented.md, R11 / C14) ------------ */
7768
+
7769
+ /* APP-003 pressed grammar owner. Size classes re-point the five control role
7770
+ * variables (SEG-010). Items read height, padding, gap and font from those
7771
+ * roles. Pressed paint is tinted fill, accent text and tinted border; the same
7772
+ * three tokens are applied to .bw-chip--selected and
7773
+ * .bw-button-group--segmented selected items (SEG-020). */
7774
+
7775
+ .bw-segmented--size-xs {
7776
+ --bw-control-height: var(--bw-size-control-height-xs);
7777
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-xs);
7778
+ --bw-control-icon-size: var(--bw-size-control-icon-xs);
7779
+ --bw-control-gap: var(--bw-size-control-gap-xs);
7780
+ --bw-control-font-size: var(--bw-font-size-xs);
7781
+ }
7782
+ .bw-segmented--size-sm {
7783
+ --bw-control-height: var(--bw-size-control-height-sm);
7784
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-sm);
7785
+ --bw-control-icon-size: var(--bw-size-control-icon-sm);
7786
+ --bw-control-gap: var(--bw-size-control-gap-sm);
7787
+ --bw-control-font-size: var(--bw-font-size-sm);
7788
+ }
7789
+ .bw-segmented--size-md {
7790
+ --bw-control-height: var(--bw-size-control-height-md);
7791
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
7792
+ --bw-control-icon-size: var(--bw-size-control-icon-md);
7793
+ --bw-control-gap: var(--bw-size-control-gap-md);
7794
+ --bw-control-font-size: var(--bw-font-size-md);
7795
+ }
7796
+ .bw-segmented--size-lg {
7797
+ --bw-control-height: var(--bw-size-control-height-lg);
7798
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-lg);
7799
+ --bw-control-icon-size: var(--bw-size-control-icon-lg);
7800
+ --bw-control-gap: var(--bw-size-control-gap-lg);
7801
+ --bw-control-font-size: var(--bw-font-size-lg);
7802
+ }
7803
+ .bw-segmented--size-xl {
7804
+ --bw-control-height: var(--bw-size-control-height-xl);
7805
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-xl);
7806
+ --bw-control-icon-size: var(--bw-size-control-icon-xl);
7807
+ --bw-control-gap: var(--bw-size-control-gap-xl);
7808
+ --bw-control-font-size: var(--bw-font-size-xl);
7809
+ }
7810
+
7811
+ .bw-segmented {
7812
+ display: inline-flex;
7813
+ flex-wrap: nowrap;
7814
+ align-items: stretch;
7815
+ gap: var(--bw-control-gap);
7816
+ padding: var(--bw-space-1);
7817
+ border-radius: var(--bw-radius-md);
7818
+ border: var(--bw-size-border-hairline) solid var(--bw-color-border);
7819
+ background: var(--bw-color-surface-sunken);
7820
+ vertical-align: middle;
7821
+ }
7822
+
7823
+ .bw-segmented__item {
7824
+ appearance: none;
7825
+ box-sizing: border-box;
7826
+ display: inline-flex;
7827
+ align-items: center;
7828
+ justify-content: center;
7829
+ margin: 0;
7830
+ min-block-size: max(1.5rem, var(--bw-control-height));
7831
+ padding-block: 0;
7832
+ padding-inline: var(--bw-control-padding-inline);
7833
+ border: var(--bw-size-border-hairline) solid transparent;
7834
+ border-radius: calc(var(--bw-radius-md) - 2px);
7835
+ background: transparent;
7836
+ color: var(--bw-color-fg-muted);
7837
+ font: inherit;
7838
+ font-size: var(--bw-control-font-size);
7839
+ line-height: 1;
7840
+ cursor: pointer;
7841
+ transition: var(--bw-transition-colors);
7842
+ }
7843
+
7844
+ .bw-segmented__item:hover:where(:not(:disabled):not([aria-pressed="true"]):not([data-bw-active])) {
6088
7845
  color: var(--bw-color-fg);
7846
+ background: var(--bw-state-hover-overlay);
7847
+ }
7848
+
7849
+ .bw-segmented__item[aria-pressed="true"],
7850
+ .bw-segmented__item[data-bw-active] {
7851
+ background: var(--bw-color-accent-subtle);
7852
+ color: var(--bw-component-nav-item-active-text);
7853
+ border-color: var(--bw-color-accent);
7854
+ }
7855
+
7856
+ .bw-segmented__item:focus-visible {
7857
+ outline: 2px solid var(--bw-color-focus-ring, var(--bw-color-accent));
7858
+ outline-offset: 2px;
7859
+ z-index: 1;
6089
7860
  }
6090
7861
 
6091
- .bw-chip__close {
6092
- display: inline-flex;
6093
- align-items: center;
6094
- justify-content: center;
6095
- margin-inline-end: calc(var(--bw-space-1) * -1);
6096
- padding: var(--bw-space-0-5);
7862
+ .bw-segmented__item:disabled {
7863
+ color: var(--bw-color-action-disabled-text);
6097
7864
  background: transparent;
6098
- border: 0;
6099
- border-radius: var(--bw-radius-full);
6100
- color: inherit;
6101
- cursor: pointer;
6102
- opacity: 0.75;
7865
+ border-color: transparent;
7866
+ cursor: not-allowed;
6103
7867
  }
6104
7868
 
6105
- .bw-chip__close:hover,
6106
- .bw-chip__close:focus-visible {
6107
- opacity: 1;
6108
- background: var(--bw-state-hover-overlay);
7869
+ .bw-segmented__item:disabled[aria-pressed="true"],
7870
+ .bw-segmented__item:disabled[data-bw-active] {
7871
+ background: var(--bw-color-action-disabled-bg);
7872
+ color: var(--bw-color-action-disabled-text);
7873
+ border-color: var(--bw-color-action-disabled-border);
7874
+ }
7875
+
7876
+ @media (prefers-reduced-motion: reduce) {
7877
+ .bw-segmented__item {
7878
+ transition: none;
7879
+ }
6109
7880
  }
6110
7881
 
6111
7882
  /* --- Button group (Beat Phase B, #542) ------------------------------------- */
@@ -6169,11 +7940,15 @@ a.bw-chip {
6169
7940
  box-shadow: none;
6170
7941
  }
6171
7942
 
7943
+ /* Selected item uses the Segmented pressed grammar (APP-003 / SEG-020), not
7944
+ * a raised surface card. Elevation is not the selected cue. */
6172
7945
  .bw-button-group--segmented .bw-button-group__item--selected,
6173
- .bw-button-group--segmented .bw-button-group__item[aria-checked="true"] {
6174
- background: var(--bw-color-surface);
6175
- color: var(--bw-color-fg);
6176
- box-shadow: var(--bw-elevation-1);
7946
+ .bw-button-group--segmented .bw-button-group__item[aria-checked="true"],
7947
+ .bw-button-group--segmented .bw-button-group__item[aria-pressed="true"] {
7948
+ background: var(--bw-color-accent-subtle);
7949
+ color: var(--bw-component-nav-item-active-text);
7950
+ border-color: var(--bw-color-accent);
7951
+ box-shadow: none;
6177
7952
  }
6178
7953
 
6179
7954
  /* --- List item / media row (Beat Phase B, #542) ---------------------------- */
@@ -6293,8 +8068,8 @@ a.bw-chip {
6293
8068
  [data-theme="dark"] .bw-card--elevation-3 {
6294
8069
  box-shadow: var(--bw-elevation-3);
6295
8070
  }
6296
- [data-theme="dark"] .bw-card--interactive:hover,
6297
- [data-theme="dark"] .bw-card--interactive:focus-within,
8071
+ [data-theme="dark"] .bw-card--interactive:not(.bw-card--bordered):hover,
8072
+ [data-theme="dark"] .bw-card--interactive:not(.bw-card--bordered):focus-within,
6298
8073
  [data-theme="dark"] a.bw-stat:hover {
6299
8074
  box-shadow: var(--bw-elevation-2);
6300
8075
  }
@@ -6305,6 +8080,7 @@ a.bw-chip {
6305
8080
  [data-theme="dark"] .bw-dropdown__panel,
6306
8081
  [data-theme="dark"] .bw-version-switch__panel,
6307
8082
  [data-theme="dark"] .bw-theme-switch__panel,
8083
+ [data-theme="dark"] .bw-popover__panel,
6308
8084
  [data-theme="dark"] .bw-combobox__listbox {
6309
8085
  box-shadow: var(--bw-elevation-3);
6310
8086
  }
@@ -6314,9 +8090,6 @@ a.bw-chip {
6314
8090
  [data-theme="dark"] .bw-modal:is(.bw-modal--open, [data-bw-open]) .bw-modal__panel {
6315
8091
  box-shadow: var(--bw-elevation-4);
6316
8092
  }
6317
- [data-theme="dark"] .bw-slide-over[data-bw-open] .bw-slide-over__panel {
6318
- box-shadow: var(--bw-elevation-4);
6319
- }
6320
8093
 
6321
8094
  /* --- Token specimen (THM-016, icvoss/django-brickwork#268) ----------------
6322
8095
  * Live brand-token presentation: dual light/dark panes, swatch from the
@@ -6793,6 +8566,44 @@ a.bw-article-meta__tag-link:focus-visible {
6793
8566
 
6794
8567
  /* --- Input group (prefix/suffix addons, #624) ------------------------------ */
6795
8568
 
8569
+ /* Size (ADR-125, ADR-126; SIZE-COVERAGE gate 2): the group re-points the
8570
+ * five control role variables so the field and every addon inherit one step.
8571
+ * Grammar matches bw-input--size-* / bw-btn--size-* / bw-combobox--size-*. */
8572
+ .bw-input-group--size-xs {
8573
+ --bw-control-height: var(--bw-size-control-height-xs);
8574
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-xs);
8575
+ --bw-control-icon-size: var(--bw-size-control-icon-xs);
8576
+ --bw-control-gap: var(--bw-size-control-gap-xs);
8577
+ --bw-control-font-size: var(--bw-font-size-xs);
8578
+ }
8579
+ .bw-input-group--size-sm {
8580
+ --bw-control-height: var(--bw-size-control-height-sm);
8581
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-sm);
8582
+ --bw-control-icon-size: var(--bw-size-control-icon-sm);
8583
+ --bw-control-gap: var(--bw-size-control-gap-sm);
8584
+ --bw-control-font-size: var(--bw-font-size-sm);
8585
+ }
8586
+ .bw-input-group--size-md {
8587
+ --bw-control-height: var(--bw-size-control-height-md);
8588
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
8589
+ --bw-control-icon-size: var(--bw-size-control-icon-md);
8590
+ --bw-control-gap: var(--bw-size-control-gap-md);
8591
+ --bw-control-font-size: var(--bw-font-size-md);
8592
+ }
8593
+ .bw-input-group--size-lg {
8594
+ --bw-control-height: var(--bw-size-control-height-lg);
8595
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-lg);
8596
+ --bw-control-icon-size: var(--bw-size-control-icon-lg);
8597
+ --bw-control-gap: var(--bw-size-control-gap-lg);
8598
+ --bw-control-font-size: var(--bw-font-size-lg);
8599
+ }
8600
+ .bw-input-group--size-xl {
8601
+ --bw-control-height: var(--bw-size-control-height-xl);
8602
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-xl);
8603
+ --bw-control-icon-size: var(--bw-size-control-icon-xl);
8604
+ --bw-control-gap: var(--bw-size-control-gap-xl);
8605
+ --bw-control-font-size: var(--bw-font-size-xl);
8606
+ }
6796
8607
  .bw-input-group {
6797
8608
  display: flex;
6798
8609
  align-items: stretch;
@@ -6815,12 +8626,14 @@ a.bw-article-meta__tag-link:focus-visible {
6815
8626
  display: inline-flex;
6816
8627
  flex: 0 0 auto;
6817
8628
  align-items: center;
6818
- gap: var(--bw-space-1);
6819
- padding-inline: var(--bw-density-control-padding-inline);
8629
+ gap: var(--bw-control-gap);
8630
+ padding-inline: var(--bw-control-padding-inline);
6820
8631
  border: var(--bw-size-border-hairline) solid var(--bw-color-border-control);
6821
8632
  background: var(--bw-color-surface-sunken);
6822
8633
  color: var(--bw-color-fg-muted);
6823
- font-size: var(--bw-text-body-sm-size);
8634
+ /* Size follows the control step (role variable), not a fixed body-sm role,
8635
+ * so an input-group--size-* class keeps the addon text with the field. */
8636
+ font-size: var(--bw-control-font-size);
6824
8637
  line-height: var(--bw-text-body-sm-line-height);
6825
8638
  white-space: nowrap;
6826
8639
  position: relative;
@@ -6867,3 +8680,328 @@ a.bw-article-meta__tag-link:focus-visible {
6867
8680
  .bw-input-group:has(.bw-input[aria-invalid="true"]) .bw-input-group__addon {
6868
8681
  border-color: var(--bw-color-danger);
6869
8682
  }
8683
+
8684
+
8685
+ /* --- Description list (D15 / R19) ------------------------------------------- */
8686
+
8687
+ /* A semantic <dl>-based key-value display atom: stacked (default) and inline
8688
+ * layouts, with an optional divided hairline between groups.
8689
+ *
8690
+ * Grammar (closed; DDL-004):
8691
+ * .bw-description-list root <dl>
8692
+ * .bw-description-list__term <dt> element
8693
+ * .bw-description-list__details <dd> element
8694
+ * .bw-description-list--inline modifier: term and details on one row
8695
+ * .bw-description-list--divided modifier: hairline between groups
8696
+ *
8697
+ * Tokens read (DDL-015; no raw colour):
8698
+ * --bw-size-gap-md row gap between pairs / groups
8699
+ * --bw-color-fg-muted term ink (DDL-013)
8700
+ * --bw-color-fg details ink (DDL-014)
8701
+ * --bw-color-border divided hairline colour (DDL-012)
8702
+ * --bw-size-border-hairline divided hairline width
8703
+ * --bw-component-description-list-term-size term column min-inline-size in inline layout
8704
+ *
8705
+ * Type utilities applied by HTML / React / Vue consumers (not set here):
8706
+ * bw-text-xs on <dt> (caption role; DDL-013)
8707
+ * bw-text-md on <dd> (body role; DDL-014)
8708
+ *
8709
+ * Logical properties throughout (DDL-016). No breakpoint switch on this
8710
+ * component. At 320 px, details text wraps within its remaining column space;
8711
+ * overflow-wrap: anywhere on <dd> handles long unbreakable strings (DDL-017).
8712
+ *
8713
+ * Grouping <div> wrappers are optional in stacked mode and required in inline
8714
+ * and divided mode for column alignment and correct hairline placement (DDL-003).
8715
+ * React auto-wraps pairs when layout="inline" or divided is set. */
8716
+
8717
+ .bw-description-list {
8718
+ /* Flex column so pair spacing can target successive groups (or bare
8719
+ * dt/dd pairs) without putting the same gap between a term and its own
8720
+ * details (DDL-010: term directly above details; gap between pairs). */
8721
+ display: flex;
8722
+ flex-direction: column;
8723
+ margin: 0;
8724
+ padding: 0;
8725
+ }
8726
+
8727
+ /* Gap between successive pairs when grouped in a <div>. */
8728
+ .bw-description-list > div + div {
8729
+ margin-block-start: var(--bw-size-gap-md);
8730
+ }
8731
+
8732
+ /* Gap between successive pairs when bare: after a details, before the next term. */
8733
+ .bw-description-list > .bw-description-list__details + .bw-description-list__term {
8734
+ margin-block-start: var(--bw-size-gap-md);
8735
+ }
8736
+
8737
+ .bw-description-list__term {
8738
+ /* dt inherits display: block; reset the UA margin. */
8739
+ margin: 0;
8740
+ color: var(--bw-color-fg-muted);
8741
+ }
8742
+
8743
+ .bw-description-list__details {
8744
+ /* dd has a UA margin-inline-start; reset it. */
8745
+ margin: 0;
8746
+ color: var(--bw-color-fg);
8747
+ /* Prevent long unbreakable strings from overflowing at 320 px (DDL-017). */
8748
+ overflow-wrap: anywhere;
8749
+ }
8750
+
8751
+ /* Inline layout: group <div>s become flex rows so term and details sit side
8752
+ * by side. The term's min-inline-size aligns columns across all pairs. The
8753
+ * details fill remaining inline space and wrap rather than overflow (DDL-011,
8754
+ * DDL-017). align-items: baseline keeps short labels optically level with
8755
+ * value text. */
8756
+ .bw-description-list--inline > div {
8757
+ display: flex;
8758
+ flex-wrap: wrap;
8759
+ align-items: baseline;
8760
+ }
8761
+
8762
+ .bw-description-list--inline .bw-description-list__term {
8763
+ min-inline-size: var(--bw-component-description-list-term-size);
8764
+ flex-shrink: 0;
8765
+ }
8766
+
8767
+ .bw-description-list--inline .bw-description-list__details {
8768
+ flex: 1 1 0;
8769
+ min-inline-size: 0;
8770
+ }
8771
+
8772
+ /* Divided mode: hairline border-block-end between successive groups.
8773
+ * :not(:last-child) omits the trailing hairline on the final row (DDL-012,
8774
+ * troubleshooting note). padding-block-end preserves the visual row gap
8775
+ * between the content and the hairline so the hairline floats between pairs
8776
+ * rather than abutting the lower row's term. Groups are required in divided
8777
+ * mode; bare dt/dd divided is not supported (DDL-003). */
8778
+ .bw-description-list--divided > div:not(:last-child) {
8779
+ border-block-end: var(--bw-size-border-hairline) solid var(--bw-color-border);
8780
+ padding-block-end: var(--bw-size-gap-md);
8781
+ }
8782
+
8783
+ /* --- Number stepper (docs/components/number-stepper.md, R50 / C19) ----------- */
8784
+
8785
+ /* .bw-number-stepper is the quantity adjuster: a flex row of a decrement
8786
+ * button, a native <input type="number">, and an increment button, all in a
8787
+ * connected group. The block reads the five control role variables only
8788
+ * (NST-010); size classes re-point them, same grammar as .bw-input--size-*
8789
+ * and .bw-switch--size-* (ADR-125). md is the default; React and Vue always
8790
+ * emit a size class.
8791
+ *
8792
+ * Connected group chrome (NST-012): outer corners carry --bw-radius-md via
8793
+ * logical properties; shared internal borders are single hairlines via
8794
+ * border-inline-end on the decrement button and border-inline-start on the
8795
+ * increment button; the input carries no additional side borders. No gap
8796
+ * between parts.
8797
+ *
8798
+ * RTL (NST-016): logical properties throughout. The flex row reverses through
8799
+ * direction inheritance so the decrement button (first in DOM) appears at the
8800
+ * inline end and the increment button at the inline start, which is the
8801
+ * correct UX in both directions. The internal side-border rules keep the
8802
+ * shared borders on the correct edges.
8803
+ *
8804
+ * Native spin arrows are suppressed (NST-013). No colour literals (NST-015).
8805
+ * Motion uses --bw-transition-colors (NST-017). */
8806
+
8807
+ .bw-number-stepper--size-xs {
8808
+ --bw-control-height: var(--bw-size-control-height-xs);
8809
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-xs);
8810
+ --bw-control-icon-size: var(--bw-size-control-icon-xs);
8811
+ --bw-control-gap: var(--bw-size-control-gap-xs);
8812
+ --bw-control-font-size: var(--bw-font-size-xs);
8813
+ }
8814
+ .bw-number-stepper--size-sm {
8815
+ --bw-control-height: var(--bw-size-control-height-sm);
8816
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-sm);
8817
+ --bw-control-icon-size: var(--bw-size-control-icon-sm);
8818
+ --bw-control-gap: var(--bw-size-control-gap-sm);
8819
+ --bw-control-font-size: var(--bw-font-size-sm);
8820
+ }
8821
+ .bw-number-stepper--size-md {
8822
+ --bw-control-height: var(--bw-size-control-height-md);
8823
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
8824
+ --bw-control-icon-size: var(--bw-size-control-icon-md);
8825
+ --bw-control-gap: var(--bw-size-control-gap-md);
8826
+ --bw-control-font-size: var(--bw-font-size-md);
8827
+ }
8828
+ .bw-number-stepper--size-lg {
8829
+ --bw-control-height: var(--bw-size-control-height-lg);
8830
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-lg);
8831
+ --bw-control-icon-size: var(--bw-size-control-icon-lg);
8832
+ --bw-control-gap: var(--bw-size-control-gap-lg);
8833
+ --bw-control-font-size: var(--bw-font-size-lg);
8834
+ }
8835
+ .bw-number-stepper--size-xl {
8836
+ --bw-control-height: var(--bw-size-control-height-xl);
8837
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-xl);
8838
+ --bw-control-icon-size: var(--bw-size-control-icon-xl);
8839
+ --bw-control-gap: var(--bw-size-control-gap-xl);
8840
+ --bw-control-font-size: var(--bw-font-size-xl);
8841
+ }
8842
+
8843
+ /* Root: flex row, no gap. The three children share borders to form one
8844
+ * connected group. */
8845
+ .bw-number-stepper {
8846
+ display: inline-flex;
8847
+ align-items: stretch;
8848
+ min-inline-size: 0;
8849
+ cursor: default;
8850
+ }
8851
+
8852
+ /* Buttons: square at the control height; centred icon; connected-group
8853
+ * outer corners via logical border-radius. */
8854
+ .bw-number-stepper__button {
8855
+ display: inline-flex;
8856
+ align-items: center;
8857
+ justify-content: center;
8858
+ flex: 0 0 auto;
8859
+ inline-size: var(--bw-control-height);
8860
+ block-size: var(--bw-control-height);
8861
+ min-block-size: 1.5rem;
8862
+ min-inline-size: 1.5rem;
8863
+ border: var(--bw-size-border-hairline) solid var(--bw-color-border-control);
8864
+ background: var(--bw-color-surface);
8865
+ color: var(--bw-color-fg);
8866
+ cursor: pointer;
8867
+ transition: var(--bw-transition-colors);
8868
+ /* Icon inside reads the control icon size role variable. */
8869
+ font-size: var(--bw-control-icon-size);
8870
+ line-height: 1;
8871
+ }
8872
+
8873
+ .bw-number-stepper__button--decrement {
8874
+ border-start-start-radius: var(--bw-radius-md);
8875
+ border-end-start-radius: var(--bw-radius-md);
8876
+ /* Outer corners only; border-inline-end (the shared hairline to the input)
8877
+ * is kept so the internal boundary is visible (NST-012). */
8878
+ }
8879
+
8880
+ .bw-number-stepper__button--increment {
8881
+ border-start-end-radius: var(--bw-radius-md);
8882
+ border-end-end-radius: var(--bw-radius-md);
8883
+ /* Outer corners only; border-inline-start (the shared hairline to the input)
8884
+ * is kept so the internal boundary is visible (NST-012). */
8885
+ }
8886
+
8887
+ /* Input: fills remaining inline space; native spin arrows suppressed;
8888
+ * centred numeric value. No side borders (they are on the buttons). */
8889
+ .bw-number-stepper__input {
8890
+ flex: 1 1 auto;
8891
+ min-inline-size: 2.5rem;
8892
+ block-size: var(--bw-control-height);
8893
+ min-block-size: 1.5rem;
8894
+ padding-inline: var(--bw-control-gap);
8895
+ border: var(--bw-size-border-hairline) solid var(--bw-color-border-control);
8896
+ border-inline: none;
8897
+ background: var(--bw-color-surface);
8898
+ color: var(--bw-color-fg);
8899
+ font: inherit;
8900
+ font-size: var(--bw-control-font-size);
8901
+ text-align: center;
8902
+ transition: var(--bw-transition-colors);
8903
+ /* Suppress native spin arrows (NST-013). */
8904
+ appearance: none;
8905
+ -moz-appearance: textfield;
8906
+ }
8907
+
8908
+ /* Suppress WebKit/Blink spin pseudo-elements. */
8909
+ .bw-number-stepper__input::-webkit-inner-spin-button,
8910
+ .bw-number-stepper__input::-webkit-outer-spin-button {
8911
+ -webkit-appearance: none;
8912
+ margin: 0;
8913
+ }
8914
+
8915
+ /* Placeholder: fg-muted, same floor as Input. */
8916
+ .bw-number-stepper__input::placeholder {
8917
+ color: var(--bw-color-fg-muted);
8918
+ opacity: 1;
8919
+ }
8920
+
8921
+ /* SVG icon inside the buttons: reads the icon-size role variable. */
8922
+ .bw-number-stepper__button .bw-icon {
8923
+ inline-size: var(--bw-control-icon-size);
8924
+ block-size: var(--bw-control-icon-size);
8925
+ flex-shrink: 0;
8926
+ fill: none;
8927
+ }
8928
+
8929
+ /* ---- Hover states (NST-032) ---- */
8930
+
8931
+ .bw-number-stepper__button:hover:where(:not(:disabled)) {
8932
+ background: var(--bw-color-surface-sunken);
8933
+ }
8934
+
8935
+ .bw-number-stepper__input:hover:where(:not(:disabled):not([readonly]):not(:focus-visible)) {
8936
+ border-color: color-mix(in oklab, var(--bw-color-border-control) 82%, var(--bw-color-fg));
8937
+ }
8938
+
8939
+ /* ---- Focus-visible (NST-033): ring on the focused element, not the group ---- */
8940
+
8941
+ .bw-number-stepper__button:focus-visible,
8942
+ .bw-number-stepper__input:focus-visible {
8943
+ outline: 2px solid var(--bw-color-focus-ring);
8944
+ outline-offset: 2px;
8945
+ position: relative;
8946
+ z-index: 1;
8947
+ }
8948
+
8949
+ .bw-number-stepper__input:focus-visible {
8950
+ border-color: var(--bw-color-accent);
8951
+ }
8952
+
8953
+ /* ---- Disabled (NST-040) ---- */
8954
+
8955
+ .bw-number-stepper:has(.bw-number-stepper__input:disabled) {
8956
+ cursor: not-allowed;
8957
+ }
8958
+
8959
+ .bw-number-stepper__button:disabled {
8960
+ background: var(--bw-color-action-disabled-bg);
8961
+ color: var(--bw-color-action-disabled-text);
8962
+ border-color: var(--bw-color-action-disabled-border);
8963
+ cursor: not-allowed;
8964
+ }
8965
+
8966
+ .bw-number-stepper__input:disabled {
8967
+ background: var(--bw-color-action-disabled-bg);
8968
+ color: var(--bw-color-action-disabled-text);
8969
+ border-color: var(--bw-color-action-disabled-border);
8970
+ cursor: not-allowed;
8971
+ }
8972
+
8973
+ .bw-number-stepper__input:disabled::placeholder {
8974
+ color: var(--bw-color-action-disabled-text);
8975
+ }
8976
+
8977
+ /* ---- Readonly (NST-041): input sunken; buttons disabled-looking ---- */
8978
+
8979
+ .bw-number-stepper__input[readonly] {
8980
+ background: var(--bw-color-surface-sunken);
8981
+ }
8982
+
8983
+ /* ---- Invalid (NST-053): danger border on the whole group ---- */
8984
+
8985
+ .bw-number-stepper__input[aria-invalid="true"],
8986
+ .bw-field--invalid .bw-number-stepper__input {
8987
+ border-color: var(--bw-color-danger);
8988
+ }
8989
+
8990
+ .bw-number-stepper__input[aria-invalid="true"] ~ .bw-number-stepper__button--increment,
8991
+ .bw-field--invalid .bw-number-stepper__button--increment {
8992
+ border-color: var(--bw-color-danger);
8993
+ }
8994
+
8995
+ .bw-number-stepper:has(.bw-number-stepper__input[aria-invalid="true"]) .bw-number-stepper__button--decrement,
8996
+ .bw-field--invalid .bw-number-stepper__button--decrement {
8997
+ border-color: var(--bw-color-danger);
8998
+ }
8999
+
9000
+ /* ---- Reduced motion (NST-017) ---- */
9001
+
9002
+ @media (prefers-reduced-motion: reduce) {
9003
+ .bw-number-stepper__button,
9004
+ .bw-number-stepper__input {
9005
+ transition: none;
9006
+ }
9007
+ }