/* =====================================================================
   Modal Path Ethics formal-symbol support v0.3
   Ghost-safe formula tokens render through CSS classes, avoiding broken
   pasted DOCX equation objects. The symbols are typographic, not badges.
   ===================================================================== */

.mpe-formal-spine {
  margin: 4.2rem 0;
}

.mpe-formal-spine h2,
.mpe-formal-spine h3 {
  margin-top: 1.85em;
}

.mpe-formula-line {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1.35em auto 1.15em;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.mpe-formula-line + p {
  margin-top: 0.45em;
}

.mpe-formula-stack {
  display: grid;
  gap: 0.7rem;
  justify-items: center;
  margin: 1.45em auto;
}

.mpe-eq {
  --mpe-eq-color: currentColor;
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
  font-family: "STIX Two Math", "Cambria Math", "DejaVu Serif", "Times New Roman", serif;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.005em;
  color: var(--color-darker-gray, #202124);
  text-rendering: geometricPrecision;
  vertical-align: baseline;
}

html[data-color-scheme="dark"] .mpe-eq {
  color: rgba(245, 246, 248, 0.94);
}

/* Display formulas are plain formulas, not pills/badges. */
.mpe-formula-line > .mpe-eq,
.mpe-formula-stack > .mpe-eq {
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  font-size: clamp(1.62rem, 1.1vw + 1.12rem, 2.18rem);
  line-height: 1.55;
}

.mpe-eq-inline {
  display: inline-flex;
  align-items: baseline;
  vertical-align: baseline;
  transform: translateY(0.02em);
  line-height: 1;
}

/* Hide Ghost-safe fallback tokens once CSS loads. */
.mpe-eq--Et,
.mpe-eq--Et-inline,
.mpe-eq--reach,
.mpe-eq--reach-inline,
.mpe-eq--satisfies,
.mpe-eq--satisfies-inline,
.mpe-eq--diamond-reach,
.mpe-eq--diamond-reach-inline,
.mpe-eq--diamond-reach-def,
.mpe-eq--future,
.mpe-eq--branch-future,
.mpe-eq--branch-not-reach,
.mpe-eq--resistance-profile,
.mpe-eq--resistance-profile-inline,
.mpe-eq--zero-resistance,
.mpe-eq--damage,
.mpe-eq--prior-tail,
.mpe-eq--settled-past,
.mpe-eq--field-retention,
.mpe-eq--history-remainder,
.mpe-eq--remainder-resistance,
.mpe-eq--zero-conclusion,
.mpe-eq--hist,
.mpe-eq--rem,
.mpe-eq--tail,
.mpe-eq--history-resistance,
.mpe-eq--not-zero,
.mpe-eq--enabled,
.mpe-eq--better,
.mpe-eq--transition,
.mpe-eq--harm-foreclosure,
.mpe-eq--harm-thickening {
  font-size: 0 !important;
}

.mpe-eq--Et::before,
.mpe-eq--Et-inline::before,
.mpe-eq--reach::before,
.mpe-eq--reach-inline::before,
.mpe-eq--satisfies::before,
.mpe-eq--satisfies-inline::before,
.mpe-eq--diamond-reach::before,
.mpe-eq--diamond-reach-inline::before,
.mpe-eq--diamond-reach-def::before,
.mpe-eq--future::before,
.mpe-eq--branch-future::before,
.mpe-eq--branch-not-reach::before,
.mpe-eq--resistance-profile::before,
.mpe-eq--resistance-profile-inline::before,
.mpe-eq--zero-resistance::before,
.mpe-eq--damage::before,
.mpe-eq--prior-tail::before,
.mpe-eq--settled-past::before,
.mpe-eq--field-retention::before,
.mpe-eq--history-remainder::before,
.mpe-eq--remainder-resistance::before,
.mpe-eq--zero-conclusion::before,
.mpe-eq--hist::before,
.mpe-eq--rem::before,
.mpe-eq--tail::before,
.mpe-eq--history-resistance::before,
.mpe-eq--not-zero::before,
.mpe-eq--enabled::before,
.mpe-eq--better::before,
.mpe-eq--transition::before,
.mpe-eq--harm-foreclosure::before,
.mpe-eq--harm-thickening::before {
  font-size: clamp(1.55rem, 1.05vw + 1.08rem, 2.18rem);
}

/* Inline operators need an absolute fallback size because the token span itself is font-size:0. */
.mpe-eq-inline::before,
.mpe-eq--Et-inline::before,
.mpe-eq--reach-inline::before,
.mpe-eq--satisfies-inline::before,
.mpe-eq--diamond-reach-inline::before,
.mpe-eq--resistance-profile-inline::before,
.mpe-eq--damage::before {
  font-size: max(1.05rem, 0.92em);
}

.kg-card .mpe-eq-inline::before,
.post-content .mpe-eq-inline::before,
.gh-content .mpe-eq-inline::before {
  font-size: max(1.45rem, 0.92em);
}

.mpe-eq--Et::before,
.mpe-eq--Et-inline::before { content: "Eₜ"; }
.mpe-eq--reach::before,
.mpe-eq--reach-inline::before { content: "Reach₍Eₜ₎(ℓ, κ)"; }
.mpe-eq--satisfies::before,
.mpe-eq--satisfies-inline::before { content: "κ ⊨ φ"; }
.mpe-eq--diamond-reach::before,
.mpe-eq--diamond-reach-inline::before { content: "◇ᴱᵗ,ℓᵣ φ"; }
.mpe-eq--diamond-reach-def::before { content: "◇ᴱᵗ,ℓᵣ φ := ∃κ (Reach₍Eₜ₎(ℓ,κ) ∧ κ ⊨ φ)"; }
.mpe-eq--future::before { content: "Fφ"; }
.mpe-eq--branch-future::before { content: "◇ᴮFφ"; }
.mpe-eq--branch-not-reach::before { content: "◇ᴮFφ ⇏ ◇ᴱᵗ,ℓᵣ φ"; }
.mpe-eq--resistance-profile::before,
.mpe-eq--resistance-profile-inline::before { content: "ℛ(Eₜ)"; }
.mpe-eq--zero-resistance::before { content: "Z(Eₜ) ⇔ ℛ(Eₜ) = ∅"; }
.mpe-eq--damage::before { content: "D"; }
.mpe-eq--prior-tail::before { content: "D → GPD"; }
.mpe-eq--settled-past::before { content: "D@m → G□ₛPD"; }
.mpe-eq--field-retention::before { content: "□ₛPD → Hist₍Eₜ₎(D)"; }
.mpe-eq--history-remainder::before { content: "Hist₍Eₜ₎(D) → Rem₍Eₜ₎(D)"; }
.mpe-eq--remainder-resistance::before { content: "Rem₍Eₜ₎(D) → ℛ(Eₜ) ≠ ∅"; }
.mpe-eq--zero-conclusion::before { content: "D@m → G¬Z(Eₜ)"; }
.mpe-eq--hist::before { content: "Hist₍Eₜ₎(φ)"; }
.mpe-eq--rem::before { content: "Rem₍Eₜ₎(χ)"; }
.mpe-eq--tail::before { content: "Tail₍Eₜ₎(χ) ⇔ Hist₍Eₜ₎(χ) ∧ Rem₍Eₜ₎(χ)"; }
.mpe-eq--history-resistance::before { content: "Hist₍Eₜ₎(ψ) → rψ ∈prof ℛ(Eₜ)"; }
.mpe-eq--not-zero::before { content: "ℛ(Eₜ) ≠ ∅"; }
.mpe-eq--enabled::before { content: "Enabled₍Eₜ₎(a)"; }
.mpe-eq--better::before { content: "Better_C(a,Eₜ) ⇔ Enabled₍Eₜ₎(a) ∧ ¬∃b(Enabled₍Eₜ₎(b) ∧ b ≺_C a)"; }
.mpe-eq--transition::before { content: "Eₜ ⟶ᵃ Eₜ₊₁"; }
.mpe-eq--harm-foreclosure::before { content: "Harm_F(a,Eₜ,Eₜ₊₁,ℓ) ⇔ ∃κ(Reach₍Eₜ₎(ℓ,κ) ∧ ¬Reach₍Eₜ₊₁₎(ℓ,κ))"; }
.mpe-eq--harm-thickening::before { content: "Harm_R(a,Eₜ,Eₜ₊₁,ℓ) ⇔ ∃κ(Reach₍Eₜ₎(ℓ,κ) ∧ Reach₍Eₜ₊₁₎(ℓ,κ) ∧ Thickens(a,Eₜ,Eₜ₊₁,ℓ,κ))"; }

.mpe-formal-note {
  margin: 2.3rem 0;
  padding: 1.25rem 1.35rem;
  border-left: 2px solid rgba(127,127,127,0.32);
  background: transparent;
  color: var(--color-secondary-text, #666);
  font-size: 0.96em;
}

html[data-color-scheme="dark"] .mpe-formal-note {
  border-left-color: rgba(255,255,255,0.19);
  color: rgba(245,246,248,0.72);
}

@media (max-width: 640px) {
  .mpe-formula-line {
    justify-content: flex-start;
  }

  .mpe-formula-line > .mpe-eq,
  .mpe-formula-stack > .mpe-eq {
    font-size: 1.44rem;
  }
}
