/* Compact native choices for public forms and organization editors. */
.reference-choices label,
.org-choices:not(:has(.org-gallery-choice)) label,
.single-checkbox,
.org-check,
.lifecycle-confirm label,
.filter-choices .choice-card {
  min-height: 32px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--page-text);
}

.draft-panel .reference-choices label {
  min-height: 32px;
  padding: 0;
}

.reference-choices label,
.org-choices:not(:has(.org-gallery-choice)) label,
.single-checkbox,
.org-check,
.lifecycle-confirm label {
  gap: 9px;
}

.reference-choices label:hover,
.org-choices:not(:has(.org-gallery-choice)) label:hover,
.single-checkbox:hover,
.org-check:hover,
.lifecycle-confirm label:hover,
.filter-choices .choice-card:hover,
.filter-choices .choice-card:has(input:checked):hover {
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--page-text);
}

.reference-choices label:has(input:checked),
.org-choices:not(:has(.org-gallery-choice)) label:has(input:checked),
.single-checkbox:has(input:checked),
.org-check:has(input:checked),
.lifecycle-confirm label:has(input:checked) {
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--page-text);
}

.filter-choices .choice-card {
  align-items: center;
  gap: 9px;
}

.filter-choices .choice-card input {
  position: relative;
  width: 18px;
  flex: 0 0 18px;
  min-width: 18px;
  height: 18px;
  margin: 0;
  clip-path: none;
  overflow: visible;
}

.filter-choices .choice-card span {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

.filter-choices .choice-card:hover span,
.filter-choices .choice-card input:checked + span,
.filter-choices .choice-card:has(input:checked):hover span {
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--page-text);
}

.filter-choices .choice-card input:focus-visible + span { outline: 0; }

.filter-choices .choice-card .choice-icon,
.filter-choices .choice-card input:checked + span .choice-icon { background: transparent; }
.filter-choices .choice-card input:checked + span img { filter: var(--icon-filter); }

.reference-choices input[type="checkbox"],
.org-choices:not(:has(.org-gallery-choice)) input[type="checkbox"],
.single-checkbox input[type="checkbox"],
.org-check input[type="checkbox"],
.lifecycle-confirm input[type="checkbox"],
.filter-choices .choice-card input[type="checkbox"],
.org-choices:not(:has(.org-gallery-choice)) input[type="radio"],
.filter-choices .choice-card input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-content: center;
  width: 18px;
  flex: 0 0 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  border: 1.5px solid var(--page-input-line);
  background: var(--page-surface);
  color: var(--page-accent-text);
}

.reference-choices input:not(:disabled):hover,
.org-choices:not(:has(.org-gallery-choice)) input:not(:disabled):hover,
.single-checkbox input:not(:disabled):hover,
.org-check input:not(:disabled):hover,
.lifecycle-confirm input:not(:disabled):hover,
.filter-choices .choice-card input:not(:disabled):hover { border-color: var(--page-accent-text); }

.reference-choices input[type="checkbox"],
.org-choices:not(:has(.org-gallery-choice)) input[type="checkbox"],
.single-checkbox input[type="checkbox"],
.org-check input[type="checkbox"],
.lifecycle-confirm input[type="checkbox"],
.filter-choices .choice-card input[type="checkbox"] { border-radius: 4px; }

.org-choices:not(:has(.org-gallery-choice)) input[type="radio"],
.filter-choices .choice-card input[type="radio"] { border-radius: 50%; }

.reference-choices input[type="checkbox"]::after,
.org-choices:not(:has(.org-gallery-choice)) input[type="checkbox"]::after,
.single-checkbox input[type="checkbox"]::after,
.org-check input[type="checkbox"]::after,
.lifecycle-confirm input[type="checkbox"]::after,
.filter-choices .choice-card input[type="checkbox"]::after {
  width: 14px;
  height: 14px;
  position: static;
  inset: auto;
  top: auto;
  left: auto;
  margin: 0;
  background: currentColor;
  mask: url("icons/check.82cc024e9e1f.svg") center / contain no-repeat;
  content: "";
  opacity: 0;
  transform: scale(.8);
}

.org-choices:not(:has(.org-gallery-choice)) input[type="radio"]::after,
.filter-choices .choice-card input[type="radio"]::after {
  width: 7px;
  height: 7px;
  position: static;
  inset: auto;
  top: auto;
  left: auto;
  border-radius: 50%;
  background: currentColor;
  content: "";
  opacity: 0;
  transform: scale(.6);
}

.reference-choices input:checked,
.org-choices:not(:has(.org-gallery-choice)) input:checked,
.single-checkbox input:checked,
.org-check input:checked,
.lifecycle-confirm input:checked,
.filter-choices .choice-card input:checked { border-color: currentColor; }

.reference-choices input:checked::after,
.org-choices:not(:has(.org-gallery-choice)) input:checked::after,
.single-checkbox input:checked::after,
.org-check input:checked::after,
.lifecycle-confirm input:checked::after,
.filter-choices .choice-card input:checked::after { opacity: 1; transform: scale(1); }

.reference-choices label:has(input:focus-visible),
.org-choices:not(:has(.org-gallery-choice)) label:has(input:focus-visible),
.single-checkbox:has(input:focus-visible),
.org-check:has(input:focus-visible),
.lifecycle-confirm label:has(input:focus-visible),
.filter-choices .choice-card:has(input:focus-visible) { outline: 2px solid var(--page-focus); outline-offset: 3px; }

.reference-choices label:has(input:disabled),
.org-choices:not(:has(.org-gallery-choice)) label:has(input:disabled),
.single-checkbox:has(input:disabled),
.org-check:has(input:disabled),
.lifecycle-confirm label:has(input:disabled),
.filter-choices .choice-card:has(input:disabled) { cursor: not-allowed; opacity: .52; }

.field-invalid .reference-choices input,
.field-invalid .single-checkbox input,
.org-field-invalid .org-choices:not(:has(.org-gallery-choice)) input,
.org-field-invalid .org-check input,
.lifecycle-confirm:has(.field-errors) input,
.filter-choices input[aria-invalid="true"],
.filter-choices:has(.errorlist) .choice-card input { border-color: var(--page-error, #a43b32); }

.field-invalid .reference-choices label,
.field-invalid .single-checkbox,
.org-field-invalid .org-choices:not(:has(.org-gallery-choice)) label,
.org-field-invalid .org-check {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.lifecycle-confirm input[type="checkbox"] {
  flex: 0 0 18px;
  margin: 3px 0 0;
}

.lifecycle-confirm input:focus-visible { outline: 0; }

@media (pointer: coarse) {
  .reference-choices label,
  .org-choices:not(:has(.org-gallery-choice)) label,
  .single-checkbox,
  .org-check,
  .lifecycle-confirm label,
  .filter-choices .choice-card,
  .draft-panel .reference-choices label { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .filter-choices .choice-card,
  .filter-choices .choice-card span { transition: none; }
}
