/* The message-bubble tail: the one owner of the iOS 26 hook tail for every Messages demo and the blog's static threads. The path is the
   hero's, fitted to a real iOS 26 thread (static.md): a 21.5 x 11.6 pt hook whose point sits 7.1 pt below the bubble's bottom edge,
   at its outer side, reaching 1 pt up into the corner so bubble and tail never show a seam. The bubble keeps a fully rounded corner on
   every side; a squared-off corner is NOT how iOS draws a tail, and on a one-letter bubble it reads as a blob.

   Markup: add .bt-out (right side) or .bt-in (left side) to the bubble. The tail takes the bubble's own background (and its backdrop blur, for a
   translucent bubble), so the bubble must paint its fill with `background`. Host sets only --bt-u, the length of one iOS point in this demo (default 1px).
   Which bubbles carry a tail:
     auto (default)  the last bubble of a run: one followed by a sibling bubble of the same side loses it, and an incoming bubble followed
                     by the typing indicator (css/typing.css) too. Static threads (the blog, the use-case scenes) need nothing else.
     manual          a demo that decides in JS (a tapback starts a new run; rows live in separate wrappers) puts data-bt="manual" on the
                     thread and toggles .has-tail on the bubbles. It fades in and out as the run changes. */
.bt-in, .bt-out { position: relative; }
.bt-in::after, .bt-out::after {
  content: ""; position: absolute; bottom: calc(-7.1 * var(--bt-u, 1px)); width: calc(21.5 * var(--bt-u, 1px)); height: calc(12.6 * var(--bt-u, 1px));
  background: inherit; -webkit-backdrop-filter: inherit; backdrop-filter: inherit; pointer-events: none; opacity: 0; transition: opacity 120ms cubic-bezier(0, 0, .58, 1);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -1 21.5 12.6'%3E%3Cpath d='M.19 4.5C4.57 6.77 7.21 9.72 11.38 11Q13.53 11.47 13.34 10.53C12.37 8.3 8.5 4.42 13.83.25V-1H.19Z'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -1 21.5 12.6'%3E%3Cpath d='M.19 4.5C4.57 6.77 7.21 9.72 11.38 11Q13.53 11.47 13.34 10.53C12.37 8.3 8.5 4.42 13.83.25V-1H.19Z'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
}
.bt-out::after { right: 0; }
.bt-in::after { left: 0; transform: scaleX(-1); }
.bt-in:not(:has(+ .bt-in, + .ty))::after, .bt-out:not(:has(+ .bt-out))::after { opacity: 1; }
[data-bt="manual"] :is(.bt-in, .bt-out)::after { opacity: 0; }
[data-bt="manual"] :is(.bt-in, .bt-out).has-tail::after { opacity: 1; }
