@usableapp/cardds 0.7.176 → 0.7.178

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cardds.css CHANGED
@@ -404,6 +404,9 @@
404
404
  --signal-info-onlight: #2e5c98;
405
405
  /* highlights (Lh 2026-09-25): four atmosphere colours a palette may set for decoration — a count, a mark, a chart dot; the wireframe keeps them grey */
406
406
  --highlight-1: #3d3d3d; --highlight-2: #8a8a8a; --highlight-3: #5f5f5f; --highlight-4: #b0b0b0;
407
+ /* tones (cardds#219): six fills for a small box that carries the ondark ink (a `Lead tone`), to tell kinds of thing apart. Colour lives in palette.css only, so the
408
+ wireframe keeps six greys — darkened so white holds 4.5:1 on each (a project's theme may set them) */
409
+ --tone-blue: #111111; --tone-green: #2b2b2b; --tone-amber: #444444; --tone-red: #595959; --tone-pink: #666666; --tone-violet: #737373;
407
410
  --signal-error-onlight: #af2525; /* something went wrong — a field's edge, the words that say what */
408
411
  /* on a dark ground no shade of one hue holds 4.5:1 on every palette's dark fill and stays itself: a signal there is the ondark ink,
409
412
  and the icon and the words carry the meaning. A palette may give its own (orchard) */
@@ -413,6 +416,7 @@
413
416
  --outline: var(--action-border); /* control edges (palette.css softens) */
414
417
  --hairline: color-mix(in srgb, currentColor 18%, transparent); /* dividers inside cards */
415
418
  --ink-tint: color-mix(in srgb, currentColor 12%, transparent); /* hover, rails, rests */
419
+ --unread-bg: color-mix(in srgb, currentColor 4%, transparent); /* a very light grey over any ground: a row never read (Row unread) */
416
420
  --ink-rail: color-mix(in srgb, currentColor 30%, transparent); /* todo steps, ghost edges */
417
421
  --accent-soft: color-mix(in srgb, var(--accent) 22%, transparent); /* calendar marks */
418
422
  --accent-wash: color-mix(in srgb, var(--accent) 22%, var(--action-bg)); /* the same wash laid on the paper of fields and buttons, opaque: a soft chip reads the same on any card (Chip soft) */
@@ -483,7 +487,7 @@
483
487
  tile) takes its ground's side: `--dark: inherit`. inkGrounds() measures it; docs/reference.md "Ink follows its ground" */
484
488
  :where(body, [data-palette], [data-mode], .card, .tile, .modal__drawer, .postcard__front, .postcard__back, .sticky, .post-paper,
485
489
  .float-bar__pill, .snackbar__body, .track, .tile-badge, .avatar, .bubble__body, .map__hint, .map__pin, .sheet--paper > :is(.body, .foot),
486
- .postcard__band, .track__step, .toggle, .chip, .btn--warn, .card__face, .card--bands > :is(.head, .foot), .card--bands > .card__face > :is(.head, .foot)) {
490
+ .postcard__band, .track__step, .toggle, .chip, .btn--warn, .card__face, .card--bands > :is(.head, .foot), .card--bands > .card__face > :is(.head, .foot), .popup) {
487
491
  --card-ink: color-mix(in srgb, var(--ink-ondark) calc(var(--dark) * 100%), var(--ink-onlight));
488
492
  --card-muted: color-mix(in srgb, var(--ink-ondark-muted) calc(var(--dark) * 100%), var(--ink-onlight-muted));
489
493
  --on-accent: color-mix(in srgb, var(--ink-ondark) calc(var(--accent-dark) * 100%), var(--ink-onlight));
@@ -636,6 +640,13 @@
636
640
  --dot-a: #dd9787; --dot-b: #b08a5a;
637
641
  }
638
642
 
643
+ /* TONES (cardds#219): the six fills of a `Lead tone`, a white icon on a colour to tell kinds of thing apart — in coloured mode, whatever the palette (a project's own
644
+ `data-palette` too). Each holds the ondark ink at 4.5:1 or more on every palette cardds ships, the dimmest ink (clay's #f4efe4) included; the lowest is blue on clay, 4.74.
645
+ A project whose own ondark ink is dimmer than that retunes the tone it fails (inkGrounds() names it), or sets it in its theme.css. The wireframe's are greys (tokens.css) */
646
+ [data-palette] {
647
+ --tone-blue: #2a6f9e; --tone-green: #52613d; --tone-amber: #8a5a12; --tone-red: #c22d12; --tone-pink: #b8285e; --tone-violet: #5b4a8a;
648
+ }
649
+
639
650
  /* Colored palettes trade wireframe outlines for soft elevation. */
640
651
  [data-palette] :is(.card, .band-stack) { box-shadow: var(--shadow-card); }
641
652
  /* COLOURED MODE is the attribute, whatever its value: a project with colours of its own (the five
@@ -1163,7 +1174,7 @@ button:enabled { cursor: pointer; } /* a disabled one keeps the arrow */
1163
1174
  .card__press { position: absolute; inset: 0; width: var(--px); height: var(--px); padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); } /* Card onPress: the unseen button the keyboard and a screen reader press */
1164
1175
  .card--press:has(> .card__press:focus-visible) { outline: var(--focus); outline-offset: calc(-1 * var(--sp-1)); }
1165
1176
  .card__face:has(> .card__turn:focus-visible) { outline: var(--focus); outline-offset: calc(-1 * var(--sp-1)); }
1166
- .head > .chip-row > .chip > .icon { --icon-display: inline-block; --icon-align: middle; --icon-margin: 0 var(--chip-sm-gap, var(--sp-1)) 0 0; }
1177
+ .head > .chip-row > .chip > .icon, .head__chips .chip-row > .chip > .icon { --icon-display: inline-block; --icon-align: middle; --icon-margin: 0 var(--chip-sm-gap, var(--sp-1)) 0 0; }
1167
1178
 
1168
1179
  /* ---- bleed: a scrolling track that runs to the container's edges ----
1169
1180
  For a horizontal strip inside a padded container — .avatar-pick, .chip-row,
@@ -2976,7 +2987,7 @@ button:enabled { cursor: pointer; } /* a disabled one keeps the arrow */
2976
2987
  .tile-badge--stretch.tile-badge--sub-beside > :not(:first-child) { grid-column: auto; } /* the number and the month share the second line */
2977
2988
 
2978
2989
  /* where it sits in a head that leads with the date (card.css): the first cell, as tall as the chips beside it however many rows, so no cap */
2979
- .head:has(> .tile-badge:first-child + .chip-row) > .tile-badge--stretch:first-child { grid-column: 1; grid-row: 1; max-block-size: none; }
2990
+ .head:has(> .tile-badge:first-child + :is(.chip-row, .head__chips)) > .tile-badge--stretch:first-child { grid-column: 1; grid-row: 1; max-block-size: none; }
2980
2991
 
2981
2992
  /* corner badge: pin a tile badge on media (rating, price) — .card__media is relative */
2982
2993
  .tile-badge--corner { position: absolute; right: var(--sp-3); bottom: var(--sp-3); }
@@ -2993,6 +3004,10 @@ button:enabled { cursor: pointer; } /* a disabled one keeps the arrow */
2993
3004
  font: var(--note-row-font, var(--type-caption));
2994
3005
  color: var(--note-row-ink, var(--card-muted));
2995
3006
  }
3007
+ /* NoteRows: the lines of ONE thing (a place, a person) stand close, a step apart — not the card's gap, which parts one thing from the next */
3008
+ .note-rows { display: grid; gap: var(--note-rows-gap, var(--sp-1)); }
3009
+ /* Was: the replaced value, struck through after the new one, in the muted ink of its ground */
3010
+ .was-value { text-decoration: line-through; color: var(--was-ink, var(--card-muted)); }
2996
3011
 
2997
3012
  /* ---- css/actions.css — topbar, chips, buttons, CTA pack ---- */
2998
3013
  /* ============================================================
@@ -3049,6 +3064,7 @@ button:enabled { cursor: pointer; } /* a disabled one keeps the arrow */
3049
3064
  a .step cancels it to touch the bar. */
3050
3065
  .appbar__brand { flex: 1; display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
3051
3066
  .appbar__lead { flex: none; display: flex; align-items: center; } /* AppBar lead: its own button, left-most, outside the brand button */
3067
+ .appbar__action { flex: none; display: flex; align-items: center; gap: var(--appbar-action-gap, var(--sp-2)); } /* AppBar action: one or two controls at the right edge, the title (flex 1, min-width 0) takes the rest and ellipsises */
3052
3068
  .appbar__text { display: grid; min-width: 0; flex: 1; } /* pushes trailing button to the right edge */
3053
3069
  /* the mark + the words as ONE button (AppBar brandButton — the member's name opens their menu, Lh 2026-09-23): the same row, a tap target */
3054
3070
  .appbar__who {
@@ -3084,6 +3100,9 @@ button:enabled { cursor: pointer; } /* a disabled one keeps the arrow */
3084
3100
  /* a round's primary tone (Btn shape="round" tone="primary" carries both names; `invert` was its name until Lh 2026-10-29): the round's own
3085
3101
  invert knobs first — the themes' contract — then the pill's primary, so by default both shapes fill alike */
3086
3102
  :is(.icon-btn--invert, .icon-btn--primary) { background: var(--icon-btn-invert-bg, var(--btn-primary-bg, var(--accent))); color: var(--icon-btn-invert-ink, var(--btn-primary-ink, var(--on-accent))); border-color: transparent; }
3103
+ /* a count on a round (Btn count): the Badge sits on the top-right corner, half out; the button is positioned only when it carries one */
3104
+ .icon-btn--count { position: relative; }
3105
+ .icon-btn__count { position: absolute; inset: 0 0 auto auto; translate: 30% -30%; pointer-events: none; }
3087
3106
  .icon-btn--sm { width: var(--icon-btn-sm-size, var(--tap-sm)); height: var(--icon-btn-sm-size, var(--tap-sm)); font-size: var(--fs-title); }
3088
3107
  /* the bigger round sizes (`Btn shape="round" size`): lg is the hero control's size (--tap-lg), xl the biggest (--tap-xl), both on --tap-base like every size.
3089
3108
  What stands inside is a share of the circle (`--_ib`, its side), so it grows with it: the ICON is --icon-btn-icon of the side (1/2, below), and a WORD (a string child) keeps to --icon-btn-word-max of the side (0.45: a word of four letters stays inside) — it still
@@ -3261,6 +3280,13 @@ button:enabled { cursor: pointer; } /* a disabled one keeps the arrow */
3261
3280
  .chip--on { background: var(--chip-on-bg, var(--accent)); --dark: var(--accent-dark); color: var(--chip-on-ink, var(--card-ink)); border-color: transparent; }
3262
3281
  /* muted: an untouched default — the words wash out, the edge stays; emphasis is the difference from the neighbours (docs/reference.md 13) */
3263
3282
  .chip--muted { color: var(--chip-muted-ink, var(--card-muted)); } /* the chip's own fill's muted words: a muted chip on the dark card is still a light chip */
3283
+ /* tone: a signal as the chip's fill (Chip tone, cardds#216) — the palette's own shade for the paper's side (--action-dark, as the chip's own paper: --signal-*-onlight at rest, -ondark where a project makes its controls' paper dark), and the ink of the OTHER side so it holds 4.5:1 on it:
3284
+ the fill's side is the opposite of the paper's, so --dark flips and --card-ink follows it. Knobs --chip-tone-bg / --chip-tone-ink retune every tone at once */
3285
+ .chip--error { --_tone: color-mix(in srgb, var(--signal-error-ondark) calc(var(--action-dark) * 100%), var(--signal-error-onlight)); }
3286
+ .chip--warn { --_tone: color-mix(in srgb, var(--signal-warn-ondark) calc(var(--action-dark) * 100%), var(--signal-warn-onlight)); }
3287
+ .chip--ok { --_tone: color-mix(in srgb, var(--signal-ok-ondark) calc(var(--action-dark) * 100%), var(--signal-ok-onlight)); }
3288
+ .chip--info { --_tone: color-mix(in srgb, var(--signal-info-ondark) calc(var(--action-dark) * 100%), var(--signal-info-onlight)); }
3289
+ :is(.chip--error, .chip--warn, .chip--ok, .chip--info) { --dark: calc(1 - var(--action-dark)); background: var(--chip-tone-bg, var(--_tone)); color: var(--chip-tone-ink, var(--card-ink)); border-color: transparent; }
3264
3290
 
3265
3291
  .chip-row { display: flex; gap: var(--sp-2); }
3266
3292
  /* the words that lead the chips (ChipRow `lead`, "นัดที่" before a place, Lh 2026-10-21): the chips' own type and size, at the middle of their height */
@@ -3560,6 +3586,7 @@ button:enabled { cursor: pointer; } /* a disabled one keeps the arrow */
3560
3586
  .head > .chip-row { flex: 1 1 100%; order: 2; max-height: calc(2 * (round(down, calc(var(--fs-sm) * var(--chip-sm-line, var(--lh-body))), 1px) + 2 * var(--chip-sm-pad-y, var(--sp-0)) + 2 * var(--border-w)) + var(--sp-2)); overflow: hidden; }
3561
3587
  /* …beside a date that leads the head (card.css) they stand in the date's row, every chip in sight: the meeting place may take a line of its own */
3562
3588
  .head:has(> .tile-badge:first-child + .chip-row) > .chip-row { grid-column: 2; grid-row: 1; max-height: none; }
3589
+ .head__chips .chip { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /* two rows beside the date (parts.css): a chip is cut at the column's width */
3563
3590
  .head > .chip-row > .chip { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
3564
3591
  .foot > .btn { flex: 1 1 0; min-width: 0; }
3565
3592
  /* …unless the button says its own size: `Btn form` is as wide as its words in a foot too, centred (Lh 2026-10-10: one button filling
@@ -4443,6 +4470,18 @@ button.calendar__label:focus-visible { outline: var(--focus); outline-offset: va
4443
4470
  border-top: var(--border-w) solid var(--hairline);
4444
4471
  }
4445
4472
 
4473
+ /* a row not yet seen (`Row unread`, cardds#219): the whole row takes a very light grey fill, the token --unread-bg (4% of the ink over any ground) */
4474
+ .row--unread { background: var(--row-unread-bg, var(--unread-bg)); }
4475
+
4476
+ /* joined rows (`Rows joined`, cardds#219): no gap, every row a band edge to edge with its padding and a border under it (the last too), so a row with a fill
4477
+ touches the next and reads as a band. The between-rows hairline is not drawn (the border is the line); a list for a holder that fills its width (a Popup) */
4478
+ .rows.rows--joined { --rows-gap: 0rem; }
4479
+ .rows--joined > .row + .row::before { display: none; }
4480
+ .rows--joined > :is(.row, .row-expand) { border-bottom: var(--border-w) solid var(--rows-joined-border, var(--hairline)); }
4481
+ .rows--joined > .row, .rows--joined > .row-expand > summary { padding: var(--rows-joined-pad-y, var(--sp-3)) var(--rows-joined-pad-x, var(--sp-4)); }
4482
+ .rows--joined > .row-expand > .row-expand__more { padding: 0 var(--rows-joined-pad-x, var(--sp-4)) var(--rows-joined-pad-y, var(--sp-3)); }
4483
+ .rows--joined > .rows__head { padding: var(--rows-joined-pad-y, var(--sp-3)) var(--rows-joined-pad-x, var(--sp-4)) 0; }
4484
+
4446
4485
  /* ---- kv: label left, value right ----
4447
4486
  <dl class="kv"><div class="kv__row"><dt class="kv__key">Pay with</dt><dd class="kv__val">GHO</dd></div>…</dl> */
4448
4487
  .kv { margin: 0; display: grid; }
@@ -4633,6 +4672,17 @@ a.bubble { color: inherit; text-decoration: none; }
4633
4672
  }
4634
4673
  .feed-card > .head:has(> .t-caption) > .lead { grid-row: span 2; }
4635
4674
 
4675
+ /* a filled lead (`Lead tone`, cardds#219): one colour of the set (tokens.css greys, palette.css colours), no outline (its border colour is clear, in a row card too), the ondark ink on it. It declares its side (dark)
4676
+ so inkGrounds() reads it as a dark ground, and names the ink itself: its ground is its own fill, not the card's */
4677
+ .lead--tone, :is(.card--row, .feed-card > .head) > .lead--tone { border-color: transparent; }
4678
+ .lead--tone { --dark: 1; background: var(--lead-bg, var(--_lead-fill)); color: var(--lead-ink, var(--ink-ondark)); }
4679
+ .lead--blue { --_lead-fill: var(--tone-blue); }
4680
+ .lead--green { --_lead-fill: var(--tone-green); }
4681
+ .lead--amber { --_lead-fill: var(--tone-amber); }
4682
+ .lead--red { --_lead-fill: var(--tone-red); }
4683
+ .lead--pink { --_lead-fill: var(--tone-pink); }
4684
+ .lead--violet { --_lead-fill: var(--tone-violet); }
4685
+
4636
4686
  /* ---- words: the title over its meta, taking the room between the lead and the end ---- */
4637
4687
  .words { flex: 1; display: grid; gap: var(--words-gap, var(--sp-0)); }
4638
4688
  .row > .words { min-width: 0; }
@@ -4770,16 +4820,24 @@ a.bubble { color: inherit; text-decoration: none; }
4770
4820
 
4771
4821
  /* a head that LEADS with a date (Lh 2026-10-21, timebank's request card): a `Head` whose first child is a JourneyBadge and whose second is a
4772
4822
  ChipRow. The date stands at the left and the chips beside it, the two as tall as each other; the heading and its caption take the whole
4773
- width under them, so the heading sits right over the words of the middle. The date is always as tall as the chips. The gap under the date row is --head-lead-gap; the date and the chips place themselves (journey.css, actions.css).
4823
+ width under them, so the heading sits right over the words of the middle. The date is always as tall as the chips. The gap under the date row and the gap between the heading and its caption are --head-lead-gap (one chip row) or, with two rows, --head-group-gap and --head-words-gap; the date and the chips place themselves (journey.css, actions.css).
4774
4824
  Everything after the chips stands on rows of its own under them, in the order given.
4775
4825
  <div class="head"><span class="tile-badge tile-badge--stretch">…</span><div class="chip-row">…</div><div><h2 class="words__title t-h1">…</h2>…</div></div> */
4776
- .head:has(> .tile-badge:first-child + .chip-row) {
4826
+ .head:has(> .tile-badge:first-child + :is(.chip-row, .head__chips)) {
4777
4827
  display: grid;
4778
4828
  grid-template-columns: auto minmax(0, 1fr);
4779
4829
  align-items: center;
4780
4830
  row-gap: var(--head-lead-gap, var(--sp-3));
4781
4831
  }
4782
- .head:has(> .tile-badge:first-child + .chip-row) > :nth-child(n + 3) { grid-column: 1 / -1; grid-row: auto; }
4832
+ .head:has(> .tile-badge:first-child + :is(.chip-row, .head__chips)) > :nth-child(n + 3) { grid-column: 1 / -1; grid-row: auto; }
4833
+ /* TWO chip rows beside the date (Head `chips` over `chipsBelow`): a column as tall as the date, the upper row at its top (it keeps one small chip's height
4834
+ when it has no chip), the lower row at its foot, the gap between them the column gap's. The rows under it are --head-words-gap (--sp-1) apart (the title and
4835
+ its meta) and the title stands a GROUP gap (--head-group-gap, --sp-5) under the date row: the date and its chip column each keep a margin below that makes up the difference (the stretched date is still as tall as the chips), so the date
4836
+ and its chips read as one group and the words as another. One chip row keeps --head-lead-gap everywhere, untouched */
4837
+ .head:has(> .tile-badge:first-child + .head__chips) { row-gap: var(--head-words-gap, var(--sp-1)); }
4838
+ .head:has(> .tile-badge:first-child + .head__chips) > :is(.tile-badge:first-child, .head__chips) { margin-block-end: max(0rem, calc(var(--head-group-gap, var(--sp-5)) - var(--head-words-gap, var(--sp-1)))); } /* the date and its chips both keep it, so the stretched date stays as tall as the chips */
4839
+ .head__chips { grid-column: 2; grid-row: 1; align-self: stretch; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: var(--head-chips-gap, var(--head-col-gap, var(--sp-3))); }
4840
+ .head__chips-top { min-height: calc(round(down, calc(var(--fs-sm) * var(--chip-sm-line, var(--lh-body))), 1px) + 2 * var(--chip-sm-pad-y, var(--sp-0)) + 2 * var(--border-w)); } /* one small chip tall (actions.css: a head's chips) */
4783
4841
 
4784
4842
  /* a head that LEADS with a person or a thing (Lh 2026-10-28, timebank's welcome card; re-laid for a phone's width the same day): a `Head` whose
4785
4843
  first child is a `Lead`, an `Avatar` or an `AvatarStack` (a stamp in one) and whose second is the `Words` title. The lead at the left, as tall
@@ -5317,7 +5375,7 @@ a.bubble { color: inherit; text-decoration: none; }
5317
5375
  .sticky__head:has(> .sticky-date) { align-items: start; }
5318
5376
  .sticky__body { flex: 1 1 auto; min-width: 0; min-height: 0; overflow: clip; /* words past the note's room are cut, the foot keeps its place */ font: var(--sticky-font, var(--type-title)); overflow-wrap: anywhere; }
5319
5377
  .sticky--small .sticky__body { font: var(--sticky-small-font, var(--type-label)); } /* the note measured its words and they did not fit at its size (src/sticky/fit.ts) */
5320
- .sticky__paper > :not(.sticky__body) > .chip { --chip-border: transparent; --chip-bg: var(--sticky-chip-bg, color-mix(in srgb, var(--stamp-paper) 85%, transparent)); --dark: inherit; --chip-ink: var(--sticky-ink, var(--card-ink)); } /* a chip on a note is a label ON the paper (whose note it is): a pale ground nearly opaque (it may lie over words), no edge, the note's ink */
5378
+ .sticky__paper > :not(.sticky__body) > .chip:not(.chip--error, .chip--warn, .chip--ok, .chip--info) { --chip-border: transparent; --chip-bg: var(--sticky-chip-bg, color-mix(in srgb, var(--stamp-paper) 85%, transparent)); --dark: inherit; --chip-ink: var(--sticky-ink, var(--card-ink)); } /* a chip on a note is a label ON the paper (whose note it is): a pale ground nearly opaque (it may lie over words), no edge, the note's ink; a toned chip (Chip tone) keeps its own fill and ink */
5321
5379
  .sticky__foot { flex: none; font: var(--sticky-foot-font, var(--type-caption)); color: var(--sticky-muted-ink, var(--_muted)); padding-inline-end: var(--_fold); } /* the line stops before the fold */
5322
5380
  /* the flap: a square in the corner — the paper's cut takes its outer half, what is left is the triangle lying on the note */
5323
5381
  .sticky__fold {
@@ -6748,6 +6806,74 @@ a.bubble { color: inherit; text-decoration: none; }
6748
6806
  @starting-style { .menu:popover-open { opacity: 0; translate: 0 calc(-1 * var(--sp-2)); } }
6749
6807
  }
6750
6808
 
6809
+ /* ---- popup: a panel hung under the button that opens it — a head and `Rows joined` flush to its edges (cardds#219) ----
6810
+ <button class="btn" popovertarget="inbox">…</button>
6811
+ <div class="popup popup--end" id="inbox" popover role="group"><div class="popup__head"><span class="words">…</span><button class="btn">Read all</button></div>
6812
+ <div class="rows rows--joined"><a class="row">…</a>…</div></div>
6813
+ Native popover, as .menu: light dismiss, Esc, top layer, anchored to its invoker where anchor positioning exists. It is a paper of its own (the card-1 ground, so
6814
+ the words on it follow that side), never wider than the screen less a margin each side, and scrolls inside itself when the room under the button is short: the head
6815
+ is sticky, opaque, so a row's fill passes under it. Without anchor positioning (iOS before 26) it hangs under the top bar: the margin from the screen's start edge,
6816
+ or from its end edge (a margin in) with .popup--end. .popup--end = the button is at the screen's right: the popup's right edge is the button's, it grows leftwards (as .menu--end), its left margin kept by max-width. */
6817
+ .popup {
6818
+ --card-bg: var(--card-1-bg); /* the paper's own slot (a ring, a fold reads it); its side, the inks follow (tokens.css) */
6819
+ --dark: var(--card-1-dark);
6820
+ --_popup-w: calc(var(--tap-base) * 8); /* 384: the widest it grows */
6821
+ --_popup-max-h: calc(var(--tap-base) * 12); /* 576: the tallest it grows, short screens aside */
6822
+ --_popup-room: calc(100dvh - var(--safe-top) - var(--header-h) - var(--sp-2) - var(--popup-margin, var(--sp-3))); /* the room under the top bar; anchored, what is under the button (below) */
6823
+ display: none; /* explicit closed state — never display on the base rule */
6824
+ margin: 0;
6825
+ padding: 0;
6826
+ inset: auto;
6827
+ inset-block-start: calc(var(--safe-top) + var(--header-h) + var(--sp-2));
6828
+ inset-inline-start: var(--popup-margin, var(--sp-3));
6829
+ width: var(--popup-w, var(--_popup-w));
6830
+ max-width: calc(100% - 2 * var(--popup-margin, var(--sp-3)));
6831
+ max-height: min(var(--popup-max-h, var(--_popup-max-h)), var(--_popup-room));
6832
+ overflow-y: auto;
6833
+ overscroll-behavior: contain;
6834
+ background: var(--popup-bg, var(--card-bg));
6835
+ color: var(--card-ink);
6836
+ border: var(--border-w) solid var(--popup-border, var(--card-border));
6837
+ border-radius: var(--popup-radius, var(--r-card));
6838
+ box-shadow: var(--popup-shadow, var(--shadow-float));
6839
+ }
6840
+ .popup:popover-open { display: block; }
6841
+ .popup.\:popover-open { display: block; } /* the polyfill's open (iOS 16.4), its own rule as .menu's */
6842
+ .popup--end { inset-inline-start: auto; inset-inline-end: var(--popup-margin, var(--sp-3)); }
6843
+ .popup__head {
6844
+ position: sticky;
6845
+ inset-block-start: 0;
6846
+ z-index: var(--z-over);
6847
+ display: flex;
6848
+ align-items: center;
6849
+ gap: var(--popup-head-gap, var(--sp-3));
6850
+ padding: var(--popup-pad-y, var(--sp-3)) var(--popup-pad-x, var(--sp-4));
6851
+ background: var(--popup-bg, var(--card-bg)); /* opaque: what scrolls under it is hidden, a row's fill too */
6852
+ border-bottom: var(--border-w) solid var(--hairline);
6853
+ }
6854
+ .popup__head > .words { flex: 1; min-width: 0; }
6855
+ .popup__head > :not(.words) { flex: none; }
6856
+ @supports (anchor-name: --a) {
6857
+ .popup[popover] {
6858
+ position-area: block-end span-inline-end; /* from the button's start edge, rightwards */
6859
+ inset: auto;
6860
+ margin-block: var(--sp-2) var(--popup-margin, var(--sp-3));
6861
+ --_popup-room: calc(100% - var(--sp-2) - var(--popup-margin, var(--sp-3))); /* % of the area under the button */
6862
+ position-try-fallbacks: flip-block;
6863
+ }
6864
+ .popup--end[popover] { position-area: block-end span-inline-start; } /* the button's right edge, leftwards (as .menu--end): the bar's own inset is the margin */
6865
+ }
6866
+ @media (prefers-reduced-motion: no-preference) {
6867
+ .popup[popover] {
6868
+ opacity: 0;
6869
+ translate: 0 calc(-1 * var(--sp-2));
6870
+ transition: display var(--motion-quick) allow-discrete, overlay var(--motion-quick) allow-discrete, opacity var(--motion-quick), translate var(--motion-quick);
6871
+ }
6872
+ .popup:popover-open { opacity: 1; translate: 0 0; }
6873
+ .popup.\:popover-open { opacity: 1; translate: 0 0; }
6874
+ @starting-style { .popup:popover-open { opacity: 0; translate: 0 calc(-1 * var(--sp-2)); } }
6875
+ }
6876
+
6751
6877
  /* ---- banner: ONE band — the line that opens it and the body share one ground (Lh 2026-09-24: "ปุ่มกับเนื้อหาใช้พื้นที่เดียวกัน") ----
6752
6878
  <details class="banner"><summary class="banner__summary">Save 2 h… <svg class="icon icon--xs"/></summary>
6753
6879
  <div class="banner__body">…</div></details>
@@ -75,7 +75,7 @@ export function inkGrounds(root = document.body) {
75
75
  const SETS = ['--ink-onlight', '--ink-onlight-muted', '--ink-ondark', '--ink-ondark-muted', ...['ok', 'warn', 'error', 'info'].flatMap((s) => [`--signal-${s}-onlight`, `--signal-${s}-ondark`])];
76
76
  const INKS = ['--card-ink', '--card-muted', '--on-accent', '--accent-ink', '--accent', '--action-ink', '--action-muted', '--action-accent', '--on-surface', '--on-surface-muted',
77
77
  '--signal-ok', '--signal-warn', '--signal-error', '--signal-info'];
78
- const GROUNDS = ['--card-bg', '--accent', '--action-bg', '--surface', '--neg', '--pos', ...[1, 2, 3, 4, 5].map((t) => `--card-${t}-bg`), '--highlight-1', '--highlight-2', '--highlight-3', '--highlight-4'];
78
+ const GROUNDS = ['--card-bg', '--accent', '--action-bg', '--surface', '--neg', '--pos', ...[1, 2, 3, 4, 5].map((t) => `--card-${t}-bg`), '--highlight-1', '--highlight-2', '--highlight-3', '--highlight-4', ...['blue', 'green', 'amber', 'red', 'pink', 'violet'].map((t) => `--tone-${t}`)];
79
79
  const tokenOf = (el, colour, names) => {
80
80
  const want = rgba(colour).join();
81
81
  return names.find((n) => { const v = style(el).getPropertyValue(n).trim(); return v !== '' && rgba(v).join() === want; }) ?? '';