/**
 * The dalcon shape.
 *
 * Rounded top-left and bottom-right corners, square top-right and bottom-left,
 * plus a concave "tail" that drops below the bottom-left corner. The tail is a
 * transparent pseudo-element whose box-shadow fills only the area outside its
 * elliptical top-left corner.
 *
 * Usage: add .dalcon to an element that has a background. The tail takes the
 * element's surface colour; override --dalcon-color if the background comes
 * from elsewhere. The element must not clip its overflow (put overflow: hidden
 * on an inner wrapper instead), and ::before is reserved for the tail.
 */
.dalcon {
  --dalcon-color: var(--surface-bg);
  position: relative;
  isolation: isolate;
  border-radius: var(--dalcon-radius) 0;
  margin-block-end: var(--dalcon-tail);
}

.dalcon::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset-block-end: calc(var(--dalcon-radius) * -2);
  inset-inline-start: 0;
  width: var(--dalcon-radius);
  height: calc(var(--dalcon-radius) * 2);
  border-start-start-radius: calc(var(--dalcon-radius) * 0.776) var(--dalcon-tail);
  background: transparent;
  box-shadow: 0 calc(var(--dalcon-radius) * -1) 0 0 var(--dalcon-color);
  pointer-events: none;
}

/* Chevron and other inline icons inherit the text colour. */
.icon {
  display: inline-block;
  flex: none;
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentcolor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.125em;
}
