@layer components {
  /* A verdict is always three things: the word, its color and its icon shape
   * (a tick for pass, a cross for fail), so color is never the only signal.
   * Drawn as the homepage draws "Passed" and "Failed". */
  .chip {
    align-items: center;
    background: var(--chip-background);
    border-radius: var(--rounded-full);
    box-shadow: var(--chip-ring, none);
    color: var(--chip-color, var(--color-ink));
    display: inline-flex;
    font: 600 13px/18px var(--font-sans);
    gap: 4px;
    padding: 4px 11px 4px 7px;
    white-space: nowrap;

    &::before {
      background-color: currentColor;
      block-size: 15px;
      content: "";
      flex-shrink: 0;
      inline-size: 15px;
      mask: var(--chip-icon) center / contain no-repeat;
    }
  }

  /* Pale mint, charcoal text, a tick. */
  .chip--pass {
    --chip-background: var(--color-accent-soft);
    --chip-icon: url("/assets/icons/verdict-pass-3165ab8b.svg");
  }

  /* Warm white with a red outline, red text, a cross. */
  .chip--fail {
    --chip-background: var(--color-ground);
    --chip-color: var(--color-fail);
    --chip-icon: url("/assets/icons/verdict-fail-0a4711b3.svg");
    --chip-ring: inset 0 0 0 1px currentColor;
  }

  /* A fail where red isn't used, as in the admin, whose red is the applicant's alone: warm white, charcoal
   * text and ring, a cross. */
  .chip--cross {
    --chip-background: var(--color-ground);
    --chip-icon: url("/assets/icons/verdict-fail-0a4711b3.svg");
    --chip-ring: inset 0 0 0 1px currentColor;
  }

  /* Not checked: a check that waits on one that failed. Neither verdict: sand, charcoal
   * text, a ring of its own. */
  .chip--wait {
    --chip-background: var(--color-surface);
    --chip-icon: url("/assets/icons/verdict-wait-7df8e90c.svg");
    --chip-ring: inset 0 0 0 1px var(--color-hairline);
  }
}
