/*
 * Cancelling a unit's queue from its card. The cancel button sits over the
 * right half of the queue line, so the card never changes size or moves when
 * it appears. It shows as a cross before the queue's words.
 */
.card {
  position: relative;
}

.card__cancel {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 55%;
  height: 1.5rem;
  padding: 0 var(--space-2);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border: 0;
  border-radius: var(--radius-inner);
  background: transparent;
  color: var(--danger);
  font: 700 var(--text-sm) / 1 var(--font-mono);
  cursor: pointer;
}

.card__cancel::before {
  content: '✕';
}

.card__cancel[hidden] {
  display: none;
}

/* Room for the cross at the end of the queue's words, only while it shows. */
.card:has(.card__cancel:not([hidden])) .card__queue {
  padding-right: 1.1rem;
}

.card__cancel:hover,
.card__cancel:focus-visible {
  background: color-mix(in srgb, var(--danger) 16%, transparent);
  outline: 1px solid color-mix(in srgb, var(--danger) 60%, transparent);
}
