/* ── Expression Explain popup ─────────────────────────────────────────────── */

/* Expression Explain — tree content only; structure comes from shared modals.css */


/* ── Header ──────────────────────────────────────────────────────────────── */


/* ── Body / tree rows ────────────────────────────────────────────────────── */

.explain-row {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 4px 12px 4px calc(12px + var(--explain-depth, 0) * 20px);
  border-bottom: 1px solid #f3f4f6;
  font-size: 13px;
  line-height: 1.4;
}
.explain-row:last-child { border-bottom: none; }

/* ── Result icon ─────────────────────────────────────────────────────────── */

.explain-icon {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  width: 14px;
  text-align: center;
}
.explain-icon--true  { color: #16a34a; }
.explain-icon--false { color: #dc2626; }
.explain-icon--err   { color: #f59e0b; }

/* ── Operator label (AND / OR / NOT) ─────────────────────────────────────── */

.explain-op {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 1px 6px;
  border-radius: 3px;
  text-transform: uppercase;
}
.explain-op--and { background: #eff6ff; color: #1d4ed8; }
.explain-op--or  { background: #fdf4ff; color: #7e22ce; }
.explain-op--not { background: #fff7ed; color: #c2410c; }

/* ── Leaf expression code ─────────────────────────────────────────────────── */

.explain-expr {
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 12px;
  color: #1f2937;
  word-break: break-all;
}

.explain-error {
  font-size: 11px;
  color: #dc2626;
  font-style: italic;
  margin-left: 4px;
}

/* ── Footer: raw FHIRPath ─────────────────────────────────────────────────── */

.explain-fhirpath {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 7px 12px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

.explain-fhirpath-label {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-top: 1px;
}

.explain-full-expr {
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 11px;
  color: #6b7280;
  word-break: break-all;
  white-space: pre-wrap;
}

.explain-parse-error {
  padding: 12px 14px;
  color: #dc2626;
  font-size: 12px;
}

/* ── Clickable calc badge hint ───────────────────────────────────────────── */

.calc-badge--explain,
.preview-condition-hint--explain {
  cursor: pointer;
}
.calc-badge--explain:hover,
.preview-condition-hint--explain:hover {
  filter: brightness(0.92);
}
