/* ==========================================================================
   HUMAN-IN-THE-LOOP — Reassurance UI emphasizing clinician ownership
   ========================================================================== */

/* ---- Reassurance banner on chart demographics ---- */
.sim-reassurance-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.10), rgba(99, 102, 241, 0.08));
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 10px;
  margin-bottom: var(--space-md);
  font-size: 13px;
  color: var(--text-secondary);
}
.sim-reassurance-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  animation: simReassurePulse 2s ease-out infinite;
  flex-shrink: 0;
}
@keyframes simReassurePulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.sim-reassurance-text {
  flex: 1;
  color: var(--text-primary);
  line-height: 1.4;
}
.sim-reassurance-text strong {
  color: #10b981;
  font-weight: 600;
}
.sim-reassurance-cta {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.sim-reassurance-cta:hover {
  background: rgba(99, 102, 241, 0.25);
  color: #fff;
}

/* ---- Care team strip on patient chart ---- */
.sim-care-team {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}
.sim-care-team-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.sim-care-team-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #a5b4fc;
}
.sim-care-team-sub {
  font-size: 11px;
  color: var(--text-muted);
}
.sim-care-team-members {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.sim-care-member,
.sim-care-ai-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  min-width: 0;
}
.sim-care-ai-chip {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.08));
  border-color: rgba(139, 92, 246, 0.3);
}
.sim-care-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sim-care-ai-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.sim-care-info,
.sim-care-ai-chip > div:last-child {
  min-width: 0;
}
.sim-care-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}
.sim-care-role {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.3;
}

/* ---- Audit trail: human reviewer banner ---- */
.audit-human-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(16, 185, 129, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 10px;
  margin-bottom: 16px;
}
.audit-human-avatars {
  display: flex;
  flex-shrink: 0;
}
.audit-human-avatars .audit-human-avatar + .audit-human-avatar {
  margin-left: -8px;
}
.audit-human-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #0f1220;
}
.audit-human-title {
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.4;
}
.audit-human-title strong { color: #a5b4fc; font-weight: 600; }
.audit-human-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
}

/* ---- Audit signature (bottom) ---- */
.audit-signature {
  margin-top: 20px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}
.audit-signature-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.audit-signature-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.audit-signature-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.audit-signature-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 2px;
}
.audit-signature-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.audit-signature-note {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---- Analyzer: human row under intro ---- */
.analyzer-human-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.analyzer-human-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  color: #10b981;
}
.analyzer-human-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  animation: simReassurePulse 2s ease-out infinite;
}

/* ---- Population Intel: team banner above KPIs ---- */
.pi-team-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 20px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.10), rgba(16, 185, 129, 0.06));
  border: 1px solid rgba(99, 102, 241, 0.22);
  border-radius: 12px;
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}
.pi-team-banner-stack {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}
.pi-team-banner-avatars {
  display: flex;
  flex-shrink: 0;
}
.pi-team-banner-avatars > div + div { margin-left: -10px; }
.pi-team-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #0f1220;
}
.pi-team-avatar-more {
  background: rgba(255, 255, 255, 0.1) !important;
  color: var(--text-primary) !important;
  font-size: 10px !important;
}
.pi-team-banner-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.pi-team-banner-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
}
.pi-team-banner-sub strong { color: #10b981; }
.pi-team-banner-stat {
  text-align: right;
  flex-shrink: 0;
}
.pi-team-banner-stat-value {
  font-size: 22px;
  font-weight: 800;
  color: #10b981;
  letter-spacing: -0.02em;
  line-height: 1;
}
.pi-team-banner-stat-label {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
  white-space: nowrap;
}
.pi-team-banner-stat { min-width: 180px; }

/* ---- Care Team overlay (full) ---- */
.care-team-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 20, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 10020;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}
.care-team-overlay.active { display: flex; }
.care-team-sheet {
  position: relative;
  width: 100%;
  max-width: 780px;
  background: #0f1220;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 36px 40px 32px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.care-team-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
}
.care-team-close:hover { background: rgba(255, 255, 255, 0.15); }
.care-team-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #a5b4fc;
  margin-bottom: 6px;
}
.care-team-title {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.care-team-lede {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0 0 22px;
}
.care-team-lede strong { color: #fff; }
.care-team-roster {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.care-team-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}
.care-team-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.care-team-card-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}
.care-team-card-role {
  font-size: 11px;
  color: #a5b4fc;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.care-team-card-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.45;
}
.care-team-ai-section {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.08));
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}
.care-team-ai-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.care-team-ai-badge {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 8px 12px;
  border-radius: 8px;
  flex-shrink: 0;
}
.care-team-ai-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
}
.care-team-ai-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.5;
}
.care-team-ai-sub strong { color: #10b981; }
.care-team-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.care-team-stat {
  text-align: center;
  padding: 14px 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}
.care-team-stat-value {
  font-size: 22px;
  font-weight: 800;
  color: #10b981;
  letter-spacing: -0.02em;
}
.care-team-stat-label {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .care-team-sheet { padding: 28px 24px; }
  .care-team-stats { grid-template-columns: 1fr; }
}
