/* Compact source-status icons for Person Query / Rapid Intake search results. */
.cl-person-search-status-native {
  display: none !important;
}

.cl-person-search-status-icons {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  margin-bottom: 0.5rem;
  padding: 8px 10px;
  border: 1px solid hsl(var(--border));
  border-radius: 0.375rem;
  background: hsl(var(--muted) / 0.5);
  overflow-x: auto;
  scrollbar-width: thin;
}

.cl-search-source {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 8px;
  border: 1px solid currentColor;
  background: color-mix(in srgb, currentColor 12%, transparent);
  opacity: 0.96;
  transition: transform 120ms ease, opacity 120ms ease, box-shadow 120ms ease;
}

.cl-search-source:hover {
  transform: translateY(-1px);
  opacity: 1;
  box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 16%, transparent);
}

.cl-search-source svg.cl-source-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cl-search-source[data-source="local"] { color: #94a3b8; }
.cl-search-source[data-source="ujs"] { color: #3b82f6; }
.cl-search-source[data-source="doc"] { color: #f97316; }
.cl-search-source[data-source="nsopw"] { color: #a855f7; }
.cl-search-source[data-source="megansLaw"] { color: #f43f5e; }
.cl-search-source[data-source="ctVop"] { color: #60a5fa; }

.cl-search-source[data-state="complete"] {
  border-color: #22c55e;
}

.cl-search-source[data-state="no-results"] {
  opacity: 0.72;
}

.cl-search-source[data-state="error"],
.cl-search-source[data-state="unavailable"] {
  border-color: #ef4444;
}

.cl-source-status {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 17px;
  height: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 2px solid hsl(var(--background));
  background: #64748b;
  color: white;
}

.cl-source-status svg {
  width: 10px;
  height: 10px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cl-search-source[data-state="searching"] .cl-source-status {
  background: currentColor;
}
.cl-search-source[data-state="complete"] .cl-source-status { background: #22c55e; }
.cl-search-source[data-state="no-results"] .cl-source-status { background: #64748b; }
.cl-search-source[data-state="error"] .cl-source-status,
.cl-search-source[data-state="unavailable"] .cl-source-status { background: #ef4444; }

.cl-search-source[data-state="searching"] .cl-source-status svg {
  animation: cl-search-spin 0.8s linear infinite;
}

.cl-source-count {
  position: absolute;
  left: -5px;
  top: -6px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: hsl(var(--background));
  border: 1px solid currentColor;
  font-size: 9px;
  line-height: 1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.cl-search-source[data-state="searching"] {
  animation: cl-search-breathe 1.25s ease-in-out infinite;
}

@keyframes cl-search-spin {
  to { transform: rotate(360deg); }
}

@keyframes cl-search-breathe {
  0%, 100% { opacity: 0.78; }
  50% { opacity: 1; }
}

@media (max-width: 640px) {
  .cl-person-search-status-icons {
    gap: 7px;
    min-height: 50px;
    padding: 7px 8px;
  }
  .cl-search-source {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }
}
