/*
 * Syndrome diagnostic-criteria tools — polished UI.
 * ceddkey-inspired interaction patterns (clickable criterion cards, segmented
 * toggles, soft tinted verdict cards) built entirely from endobora's own
 * design tokens (brand blue #2980b9, slate text, Inter, Font Awesome).
 */

.crit-subtitle {
  margin: -4px 0 16px;
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.4;
}

/* ---- Field with label above a control ---- */
.crit-field { margin-bottom: 16px; }
.crit-field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
}

/* ---- Segmented control (replaces radio groups) ---- */
.seg {
  display: flex;
  gap: 4px;
  width: 100%;
  box-sizing: border-box;
  padding: 4px;
  background: #f1f5f9;
  border-radius: 9px;
}
.seg-btn {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #64748b;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
body.theme-modern .seg-btn input { position: absolute; inset: 0; width: 100%; height: 100%; min-width: 0; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.seg-btn:hover { color: #1e293b; }
.seg-btn:has(input:checked) {
  background: #ffffff;
  color: #2980b9;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.10);
}

/* ---- Section heading with live counter ---- */
.crit-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 18px 0 8px;
}
.crit-head h4 {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #64748b;
  text-transform: none;
}
.crit-count { font-size: 0.8rem; color: #94a3b8; font-variant-numeric: tabular-nums; }

/* ---- Criterion cards: self-contained clickable rows ---- */
.crit-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 13px;
  margin-bottom: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #ffffff;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.crit-row:hover { background: #f8fafc; border-color: #cbd5e1; }
.crit-row:has(input:checked) { background: #f0f7fc; border-color: rgba(41, 128, 185, 0.45); }
body.theme-modern .crit-row input { position: absolute; inset: 0; width: 100%; height: 100%; min-width: 0; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }

.crit-check {
  margin-top: 1px;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid #cbd5e1;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: background 0.15s, border-color 0.15s;
}
.crit-check i { font-size: 11px; opacity: 0; transition: opacity 0.15s; }
.crit-row:has(input:checked) .crit-check { background: #2980b9; border-color: #2980b9; }
.crit-row:has(input:checked) .crit-check i { opacity: 1; }

.crit-body { flex: 1; min-width: 0; }
.crit-title { display: block; font-size: 0.9rem; font-weight: 500; color: #1e293b; line-height: 1.35; }
.crit-desc { display: block; margin-top: 2px; font-size: 0.78rem; color: #64748b; line-height: 1.4; }

/* ---- Beighton-style maneuver rows (label + side chips) ---- */
.crit-maneuver {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  margin-bottom: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #ffffff;
}
.crit-maneuver-body { flex: 1; min-width: 0; }
.crit-chips { display: flex; gap: 6px; flex-shrink: 0; }
.crit-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 32px;
  padding: 0 12px;
  border-radius: 7px;
  border: 1px solid #d1d9e6;
  background: #fff;
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
body.theme-modern .crit-chip input { position: absolute; inset: 0; width: 100%; height: 100%; min-width: 0; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.crit-chip:hover { border-color: rgba(41, 128, 185, 0.5); color: #2980b9; }
.crit-chip:has(input:checked) { background: #2980b9; border-color: #2980b9; color: #fff; }

/* ---- Result container override (criteria tools) ---- */
.result.crit-result { background: transparent; padding: 0; margin-top: 18px; }

/* ---- Verdict card ---- */
.verdict {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
  border: 1px solid;
  border-radius: 10px;
  margin-bottom: 14px;
}
.verdict-icon { font-size: 1.15rem; line-height: 1; margin-top: 1px; }
.verdict-body { flex: 1; min-width: 0; }
.verdict-main { font-size: 1.02rem; font-weight: 700; line-height: 1.25; }
.verdict-sub { font-size: 0.82rem; margin-top: 3px; opacity: 0.9; }
.verdict-score { text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.verdict-score b { display: block; font-size: 1.7rem; font-weight: 800; line-height: 1; }
.verdict-score span { font-size: 0.72rem; opacity: 0.8; }

.verdict.attention { background: #fffbeb; border-color: #f7d488; color: #92400e; }
.verdict.attention .verdict-icon { color: #d97706; }
.verdict.good { background: #ecfdf5; border-color: #9ce0c1; color: #047857; }
.verdict.good .verdict-icon { color: #059669; }
.verdict.neutral { background: #eff6ff; border-color: #bcd7fb; color: #1d4ed8; }
.verdict.neutral .verdict-icon { color: #2563eb; }

/* ---- Stat row (major/minor counts) ---- */
.crit-stats { display: flex; gap: 30px; margin-bottom: 14px; padding: 0 2px; }
.crit-stat-label { font-size: 0.76rem; color: #64748b; }
.crit-stat-value { margin-top: 1px; font-size: 1.15rem; font-weight: 700; color: #1e293b; font-variant-numeric: tabular-nums; }

/* ---- Rule / threshold explainer ---- */
.crit-rule {
  border-top: 1px solid #e2e8f0;
  margin-top: 6px;
  padding-top: 12px;
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.55;
}
.crit-rule b { display: block; margin-bottom: 3px; font-weight: 600; color: #475569; }

/* ---- Callout (molecular note, genetic note, CAH-X) ---- */
.crit-callout {
  display: flex;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 8px;
  background: #f4f8fb;
  border-left: 3px solid #2980b9;
  margin-bottom: 14px;
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.5;
}
.crit-callout i { margin-top: 2px; color: #2980b9; flex-shrink: 0; }
.crit-callout b { display: block; margin-bottom: 2px; color: #334155; }
.crit-callout.warn { background: #fffbeb; border-left-color: #d97706; }
.crit-callout.warn i { color: #d97706; }

/* ---- Copy result button ---- */
.crit-copy {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  padding: 7px 13px;
  border: 1px solid #d1d9e6;
  border-radius: 7px;
  background: #fff;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.crit-copy:hover { border-color: rgba(41, 128, 185, 0.5); color: #2980b9; background: #f4f8fb; }
.crit-copy.copied { border-color: #059669; color: #047857; background: #ecfdf5; }

/* ---- RSS (Rickets Severity Score) grade sections ---- */
.rss-head { margin: 18px 0 4px; font-size: 0.82rem; font-weight: 600; color: #64748b; }
.rss-head:first-child { margin-top: 0; }
.rss-hint { margin: 0 0 12px; font-size: 0.8rem; color: #94a3b8; line-height: 1.4; }
.rss-def { margin-top: 6px; }
