/* ═══════════════════════════════════════════════════════════════════════════
   EXEMPTION CURVE PICKER (API 579-1 Part 3)

   The typeahead over Table 3.2: a search field, a floating list of matches,
   and the selection it leaves behind.

   Colours come from the design system's tokens. A raw hex value here is a bug.
   ═══════════════════════════════════════════════════════════════════════════ */

.exemption-curve-results {
  position: absolute;
  top: calc(100% + var(--ds-space-2));
  right: 0;
  left: 0;
  z-index: 1080;
  max-height: 22rem;
  overflow-y: auto;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-md);
  background: var(--ds-surface);
  box-shadow: var(--ds-shadow-2);
}

.exemption-curve-results[hidden] {
  display: none !important;
}

.exemption-curve-result {
  display: flex;
  align-items: flex-start;
  width: 100%;
  gap: var(--ds-space-6);
  padding: var(--ds-space-6);
  border: 0;
  border-bottom: 1px solid var(--ds-border-subtle);
  background: var(--ds-surface);
  color: var(--ds-text);
  text-align: left;
}

.exemption-curve-result:last-child {
  border-bottom: 0;
}

.exemption-curve-result:hover,
.exemption-curve-result.active,
.exemption-curve-result:focus-visible {
  background: var(--ds-surface-sunken);
  outline: none;
}

/* A filled badge, so its foreground is --ds-solid-fg rather than white: the
   fills brighten in the dark palette and white on the result is too faint. */
.exemption-curve-badge {
  flex: 0 0 auto;
  min-width: 4.4rem;
  padding: var(--ds-space-2) var(--ds-space-4);
  border-radius: var(--ds-radius-pill);
  background: var(--ds-solid-bg);
  color: var(--ds-solid-fg);
  font-size: var(--ds-type-xs);
  font-weight: 700;
  text-align: center;
}

.exemption-curve-result-text {
  font-size: var(--ds-type-base);
  line-height: 1.35;
}

.exemption-curve-no-hits {
  padding: var(--ds-space-7);
  color: var(--ds-text-muted);
  text-align: center;
}

/* The curve that was chosen, which is an outcome rather than a label. */
.exemption-curve-selection {
  min-height: 1.4rem;
  color: var(--ds-pass);
  font-size: var(--ds-type-base);
}

@media (max-width: 991.98px) {

  .exemption-curve-results {
    max-height: 18rem;
  }

}
