/* ============================================================
   SparkPulse — Apple Guideline 1.4.1 + 2.5.1 compliance assets
   Inline citation chips, Sources & Methodology modal,
   and HealthKit identification badges.
   ============================================================ */

/* ─── Inline citation chip ───────────────────────────────── */
.sp-cite-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0;
  border: 1px solid rgba(13, 45, 74, 0.35);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #0d2d4a;
  font-size: 11px;
  font-weight: 700;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
  transition: background 120ms ease, transform 120ms ease;
}
.sp-cite-chip:hover,
.sp-cite-chip:focus-visible {
  background: #0d2d4a;
  color: #fff;
  outline: none;
  transform: scale(1.05);
}
.sp-cite-chip::before { content: "i"; }

/* ─── Sources & Methodology modal ───────────────────────── */
.sp-sources-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 45, 74, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 16px;
}
.sp-sources-overlay.open { display: flex; }

.sp-sources-dialog {
  width: 100%;
  max-width: 640px;
  max-height: 86vh;
  overflow-y: auto;
  background: #ffffff;
  color: #1f2937;
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
  padding: 24px 22px;
  font-size: 15px;
  line-height: 1.55;
}
.sp-sources-dialog h2 {
  margin: 0 0 4px;
  font-size: 20px;
  color: #0d2d4a;
}
.sp-sources-dialog p.sp-sources-subtitle {
  margin: 0 0 18px;
  font-size: 13px;
  color: #475569;
}
.sp-sources-dialog h3 {
  margin: 20px 0 6px;
  font-size: 15px;
  color: #0d2d4a;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 4px;
}
.sp-sources-dialog ul {
  margin: 6px 0 12px;
  padding-left: 20px;
}
.sp-sources-dialog li { margin: 4px 0; }
.sp-sources-dialog a {
  color: #0d2d4a;
  font-weight: 600;
  text-decoration: underline;
  word-break: break-word;
}
.sp-sources-dialog .sp-sources-close {
  position: sticky;
  top: 0;
  float: right;
  background: transparent;
  border: 0;
  color: #475569;
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
}

/* ─── HealthKit identification badge (Wearables) ────────── */
.sp-healthkit-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 6px;
  padding: 6px 10px;
  border: 1px solid rgba(13, 45, 74, 0.18);
  border-radius: 999px;
  background: linear-gradient(135deg, #fff 0%, #f1f5f9 100%);
  color: #0d2d4a;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.sp-healthkit-badge svg { display: block; }

.sp-healthkit-note {
  margin: 6px 0 0;
  font-size: 12px;
  color: #475569;
  line-height: 1.4;
}

/* ─── Settings HealthKit row ─────────────────────────────── */
.sp-settings-healthkit {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(13, 45, 74, 0.14);
  border-radius: 12px;
  background: #f8fafc;
}
.sp-settings-healthkit .sp-settings-healthkit-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #0d2d4a;
  margin-bottom: 4px;
}
.sp-settings-healthkit .sp-settings-healthkit-desc {
  font-size: 13px;
  color: #475569;
  line-height: 1.45;
  margin: 0;
}

/* ─── Sources global footer link inside the app ──────────── */
.sp-sources-footer-link {
  display: inline-block;
  margin-top: 6px;
  color: #0d2d4a;
  font-weight: 600;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}
