/* Marketing: answers of WebAsk forms and option counts of choice questions. */
@layer components {
  .form-card-stats {
    display: grid;
    gap: var(--space-1);
    margin: auto 0 0;
    padding: var(--space-2) 0 0;
    list-style: none;
    font-size: .9375rem;
    font-variant-numeric: tabular-nums;

    & li { margin: 0; }
    & strong { font-weight: 700; }
  }

  .product-card[aria-busy="true"] .form-card-stats strong {
    color: var(--color-text-muted);
    font-weight: 500;
  }

  .choice-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(22rem, 100%), 1fr));
    gap: var(--space-5) var(--space-6);
  }

  .choice-question {
    & h3 { margin: 0 0 var(--space-1); font-size: 1rem; font-weight: 600; text-wrap: pretty; }
    & p { margin: 0; }
  }

  .choice-bars {
    display: grid;
    gap: var(--space-2);
    margin: var(--space-3) 0 0;
    padding: 0;
    list-style: none;

    & li {
      display: flex;
      justify-content: space-between;
      gap: var(--space-3);
      padding: var(--space-1) var(--space-2);
      border-radius: var(--radius-s);
      background: linear-gradient(
        to right,
        color-mix(in oklab, var(--color-accent) 24%, transparent) var(--share),
        var(--color-surface-subtle) var(--share)
      );
      font-size: .875rem;
      overflow-wrap: anywhere;
    }
  }

  .choice-value {
    flex: none;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }

  .form-answers {
    & th, & td { vertical-align: top; }
    & th { min-inline-size: 8rem; }
    & td { max-inline-size: 28rem; white-space: pre-line; overflow-wrap: anywhere; }
    & :is(th, td):nth-child(-n+2) { min-inline-size: 0; white-space: nowrap; }
  }
}
