/* Each Roots equation replaces its icon in place. Icon dimensions stay unchanged. */
.premaculture-topic-panel--roots .roots-formula-trigger {
  appearance: none;
  position: relative;
  overflow: visible;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #000 !important;
  cursor: pointer;
  padding: 0 !important;
}

.premaculture-topic-panel--roots .roots-formula-trigger > .roots-formula-icon-image,
.premaculture-topic-panel--roots .roots-formula-trigger > .roots-result-icon-title {
  opacity: 1;
  transition: opacity 180ms ease;
}

.premaculture-topic-panel--roots .roots-formula-trigger.is-revealed > .roots-formula-icon-image,
.premaculture-topic-panel--roots .roots-formula-trigger > .roots-result-icon-title {
  opacity: 0;
}

.premaculture-topic-panel--roots .roots-formula-trigger > .roots-result-icon-title {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.premaculture-topic-panel--roots .roots-formula-trigger.is-showing-result > .roots-result-icon-title {
  opacity: 1;
}

.premaculture-topic-panel--roots .roots-inline-formula {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: min(32vw, 22rem);
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: opacity 180ms ease;
  visibility: hidden;
}

.premaculture-topic-panel--roots .roots-formula-trigger.is-revealed .roots-inline-formula {
  opacity: 1;
  visibility: visible;
}

.premaculture-topic-panel--roots .roots-inline-formula h2 {
  display: none !important;
}

.premaculture-topic-panel--roots .roots-inline-formula.roots-formula-panel--simplicity {
  --roots-result-circle: #4b947e;
  --roots-result-text: #000;
}

.premaculture-topic-panel--roots .roots-inline-formula.roots-formula-panel--sustainability {
  --roots-result-circle: #f8d563;
  --roots-result-text: #000;
}

.premaculture-topic-panel--roots .roots-inline-formula.roots-formula-panel--spirituality {
  --roots-result-circle: #040707;
  --roots-result-text: #fff;
}

.premaculture-topic-panel--roots [data-root-formula-panel="quality"] {
  --roots-result-x: 50.2568%;
  --roots-result-y: 51.7979%;
}

.premaculture-topic-panel--roots [data-root-formula-panel="quantity"] {
  --roots-result-x: 49.5719%;
  --roots-result-y: 51.7123%;
}

.premaculture-topic-panel--roots [data-root-formula-panel="essentiality"] {
  --roots-result-x: 49.9144%;
  --roots-result-y: 51.7979%;
}

.premaculture-topic-panel--roots [data-root-formula-panel="accessibility"] {
  --roots-result-x: 50.2568%;
  --roots-result-y: 51.4555%;
}

.premaculture-topic-panel--roots [data-root-formula-panel="feasibility"] {
  --roots-result-x: 50.0856%;
  --roots-result-y: 51.7123%;
}

.premaculture-topic-panel--roots [data-root-formula-panel="practicality"] {
  --roots-result-x: 49.9144%;
  --roots-result-y: 51.4555%;
}

.premaculture-topic-panel--roots [data-root-formula-panel="biodiversity"] {
  --roots-result-x: 50.0856%;
  --roots-result-y: 52.0548%;
}

.premaculture-topic-panel--roots [data-root-formula-panel="productivity"] {
  --roots-result-x: 50.0856%;
  --roots-result-y: 52.1404%;
}

.premaculture-topic-panel--roots [data-root-formula-panel="harmony"] {
  --roots-result-x: 50.2568%;
  --roots-result-y: 51.9692%;
}

.premaculture-topic-panel--roots .roots-inline-formula p,
.premaculture-topic-panel--roots .roots-inline-formula dl,
.premaculture-topic-panel--roots .roots-inline-formula dt,
.premaculture-topic-panel--roots .roots-inline-formula dd {
  margin: 0 !important;
  padding: 0 !important;
}

.premaculture-topic-panel--roots .roots-formula-table-note {
  color: #000 !important;
  font-family: Georgia, "Times New Roman", serif !important;
  font-size: clamp(0.55rem, 1vw, 0.78rem) !important;
  font-style: italic;
  font-weight: 400 !important;
  line-height: 1.12 !important;
  text-align: left;
}

.premaculture-topic-panel--roots .roots-formula-explanation {
  width: 100%;
  margin-top: 0.45rem !important;
  color: #000 !important;
  font-family: Georgia, "Times New Roman", serif !important;
  font-size: clamp(0.5rem, 0.9vw, 0.7rem) !important;
  font-style: italic;
  font-weight: 400 !important;
  line-height: 1.14 !important;
  text-align: left;
  white-space: normal !important;
  overflow-wrap: anywhere;
}

.premaculture-topic-panel--roots .roots-formula-explanation strong {
  font-weight: 700 !important;
}

.premaculture-topic-panel--roots .roots-formula-definitions {
  display: grid;
  gap: 0.2rem;
  width: 100%;
  margin-top: 0.35rem !important;
}

.premaculture-topic-panel--roots .roots-formula-definitions > div {
  display: grid;
  grid-template-columns: minmax(3.8rem, 0.7fr) minmax(0, 1.8fr);
  gap: 0.35rem;
  align-items: center;
}

.premaculture-topic-panel--roots .roots-formula-definitions dt {
  text-align: right;
}

.premaculture-topic-panel--roots .roots-formula-definitions dd {
  color: #000 !important;
  font-family: Georgia, "Times New Roman", serif !important;
  font-size: clamp(0.52rem, 0.95vw, 0.72rem) !important;
  font-style: italic;
  font-weight: 400 !important;
  line-height: 1.08 !important;
  text-align: left;
  white-space: normal !important;
  overflow-wrap: anywhere;
}

.premaculture-topic-panel--roots .roots-inline-formula .roots-formula-result {
  position: absolute;
  z-index: 2;
  top: var(--roots-result-y);
  left: var(--roots-result-x);
  gap: 0;
  width: 78.4247%;
  aspect-ratio: 1;
  box-sizing: border-box;
  margin: 0 !important;
  padding: clamp(0.55rem, 1.1vw, 0.75rem) !important;
  border-radius: 50%;
  background: var(--roots-result-circle);
  color: var(--roots-result-text) !important;
  font-family: Raleway, Helvetica, Arial, sans-serif !important;
  font-size: clamp(0.78rem, 1.65vw, 1.05rem) !important;
  font-weight: 600 !important;
  line-height: 1.18 !important;
  text-align: center;
  transform: translate(-50%, -50%);
}

.premaculture-topic-panel--roots .roots-formula-result[hidden] {
  display: none !important;
}

.premaculture-topic-panel--roots .roots-formula-trigger.is-showing-result .roots-inline-formula {
  width: min(100%, 180px);
  aspect-ratio: 1;
}

.premaculture-topic-panel--roots .roots-formula-trigger.is-showing-result .roots-inline-formula > :not(.roots-formula-result) {
  display: none !important;
}

.premaculture-topic-panel--roots .roots-formula-trigger.is-showing-result .roots-formula-result {
  display: grid !important;
  align-content: center;
  place-items: center;
}

.premaculture-topic-panel--roots .roots-formula-result span {
  display: block;
  max-width: 100%;
  white-space: normal;
}

.premaculture-topic-panel--roots .roots-equation {
  display: grid;
  place-items: center;
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
}

.premaculture-topic-panel--roots .roots-equation math,
.premaculture-topic-panel--roots .roots-equation math *,
.premaculture-topic-panel--roots .roots-formula-definitions math,
.premaculture-topic-panel--roots .roots-formula-definitions math * {
  font-family: "STIX Two Math", "Cambria Math", "Times New Roman", serif !important;
}

.premaculture-topic-panel--roots .roots-equation math {
  display: block;
  width: max-content;
  min-width: max-content;
  max-width: none;
  margin: 0 auto;
  color: #000;
  font-size: clamp(0.82rem, 1.7vw, 1.25rem) !important;
  white-space: nowrap !important;
}

.premaculture-topic-panel--roots .roots-formula-definitions math {
  color: #000;
  font-size: clamp(0.68rem, 1.25vw, 1rem) !important;
}

.premaculture-topic-panel--roots .roots-equation--biodiversity {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 0.55rem;
}

.premaculture-topic-panel--roots .roots-equation--biodiversity math {
  font-size: clamp(0.62rem, 1.3vw, 0.95rem) !important;
}

.premaculture-topic-panel--roots .roots-equation--stacked math {
  font-size: clamp(0.62rem, 1.3vw, 0.96rem) !important;
}

.premaculture-topic-panel--roots .roots-formula-trigger:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

@media (min-width: 768px) and (max-width: 980px) {
  .premaculture-topic-panel--roots .roots-formula-trigger.is-showing-result .roots-inline-formula {
    width: min(100%, 276px);
  }
}

@media (max-width: 767px) {
  .premaculture-topic-panel--roots .roots-inline-formula {
    width: min(30vw, 8.5rem);
  }

  .premaculture-topic-panel--roots .roots-formula-trigger.is-showing-result .roots-inline-formula {
    width: min(100%, 188px);
  }

  .premaculture-topic-panel--roots .roots-formula-table-note {
    font-size: clamp(0.3rem, 1.55vw, 0.48rem) !important;
  }

  .premaculture-topic-panel--roots .roots-formula-explanation {
    margin-top: 0.2rem !important;
    font-size: clamp(0.25rem, 1.25vw, 0.4rem) !important;
    line-height: 1.08 !important;
  }

  .premaculture-topic-panel--roots .roots-formula-definitions {
    gap: 0.08rem;
    margin-top: 0.15rem !important;
  }

  .premaculture-topic-panel--roots .roots-formula-definitions > div {
    grid-template-columns: minmax(2.1rem, 0.7fr) minmax(0, 1.8fr);
    gap: 0.14rem;
  }

  .premaculture-topic-panel--roots .roots-formula-definitions dd {
    font-size: clamp(0.27rem, 1.4vw, 0.43rem) !important;
  }

  .premaculture-topic-panel--roots .roots-equation math {
    font-size: clamp(0.45rem, 2.4vw, 0.72rem) !important;
  }

  .premaculture-topic-panel--roots .roots-formula-definitions math {
    font-size: clamp(0.38rem, 1.9vw, 0.58rem) !important;
  }

  .premaculture-topic-panel--roots .roots-equation--biodiversity math {
    font-size: clamp(0.38rem, 1.9vw, 0.58rem) !important;
  }

  .premaculture-topic-panel--roots .roots-equation--stacked math {
    font-size: clamp(0.34rem, 1.72vw, 0.54rem) !important;
  }

  .premaculture-topic-panel--roots .roots-inline-formula .roots-formula-result {
    margin: 0 !important;
    padding: clamp(0.35rem, 1.6vw, 0.55rem) !important;
    font-size: clamp(0.52rem, 2.4vw, 0.72rem) !important;
    line-height: 1.15 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .premaculture-topic-panel--roots .roots-formula-trigger > img,
  .premaculture-topic-panel--roots .roots-inline-formula {
    transition: none;
  }
}

/* Formula view stays inside the icon cell: centered equation, left-aligned description. */
.premaculture-topic-panel--roots .roots-children-row[data-row="1"] {
  --roots-formula-zone-height: 8rem;
}

.premaculture-topic-panel--roots .roots-children-row[data-row="2"] {
  --roots-formula-zone-height: 5rem;
}

.premaculture-topic-panel--roots .roots-children-row[data-row="3"] {
  --roots-formula-zone-height: 6rem;
}

.premaculture-topic-panel--roots .roots-children-grid:has(.roots-cell-content.is-showing-formula) {
  gap: clamp(3.5rem, 7vw, 5rem) !important;
}

.premaculture-topic-panel--roots .roots-cell-content.is-showing-formula {
  align-items: center !important;
}

.premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula {
  --roots-definition-label-width: clamp(3.75rem, 5vw, 4.75rem);
  --roots-definition-column-gap: 0.4rem;
  --roots-quality-legend-width: clamp(1.57rem, 2.65vw, 2.08rem);
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  margin-inline: auto !important;
  text-align: initial !important;
}

.premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula:focus-visible {
  outline: 0;
}

.premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula > .roots-formula-icon-image,
.premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula > .roots-result-icon-title {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
}

.premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula .roots-inline-formula {
  position: static;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  opacity: 1;
  visibility: visible;
  transform: none;
}

.premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula .roots-inline-formula h2 {
  display: none !important;
}

.premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula .roots-equation {
  align-self: center;
  align-content: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  height: var(--roots-formula-zone-height);
  aspect-ratio: auto;
  box-sizing: border-box;
  margin: 0 auto 1rem !important;
  padding: clamp(0.55rem, 1.2vw, 0.9rem) 0 clamp(0.25rem, 0.65vw, 0.5rem) !important;
  place-items: center;
}

.premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula .roots-equation math {
  font-size: clamp(1rem, 2.2vw, 1.35rem) !important;
}

.premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula .roots-equation--stacked math {
  font-size: clamp(0.88rem, 1.9vw, 1.16rem) !important;
}

.premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula .roots-equation--stacked {
  gap: clamp(0.75rem, 1.5vw, 1rem);
}

.premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula .roots-equation--biodiversity {
  grid-template-columns: repeat(2, max-content);
  gap: 0.35rem 0.8rem;
}

.premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula .roots-equation--biodiversity math {
  font-size: clamp(0.88rem, 1.9vw, 1.16rem) !important;
}

.premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula .roots-equation--terms {
  grid-template-columns: repeat(3, max-content);
  gap: clamp(0.45rem, 0.9vw, 0.75rem);
}

.premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula .roots-equation--availability {
  grid-template-columns: repeat(2, max-content);
}

.premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula .roots-formula-table-note,
.premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula .roots-formula-details,
.premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula .roots-formula-explanation,
.premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula .roots-formula-definitions {
  width: min(94%, 20rem);
  margin: 0 auto 0.35rem !important;
  padding: 0 !important;
  border: 0 !important;
  color: #000 !important;
  text-align: left !important;
}

.premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula .roots-formula-table-note,
.premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula .roots-formula-details,
.premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula .roots-formula-explanation,
.premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula .roots-formula-definitions dd {
  font-family: Georgia, "Times New Roman", serif !important;
  font-size: clamp(0.5rem, 0.72vw, 0.62rem) !important;
  font-style: italic;
  font-weight: 400 !important;
  line-height: 1.2 !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
}

.premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula .roots-formula-definitions {
  display: grid;
  gap: 0.18rem;
}

.premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula .roots-formula-definitions > div {
  display: grid;
  grid-template-columns: var(--roots-definition-label-width) minmax(0, 1fr);
  gap: var(--roots-definition-column-gap);
  align-items: baseline;
}

.premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula [data-root-formula-panel="quality"] .roots-formula-table-note {
  box-sizing: border-box;
  padding-inline-start: calc(var(--roots-definition-label-width) - var(--roots-quality-legend-width)) !important;
}

.premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula .roots-formula-definitions dt {
  text-align: right;
}

.premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula .roots-formula-definitions math {
  font-size: clamp(0.68rem, 1.15vw, 0.9rem) !important;
}

.premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula .roots-formula-explanation--separated {
  margin-top: 0 !important;
  padding-top: 0 !important;
  border-top: 0 !important;
}

@media (max-width: 767px) {
  .premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula {
    --roots-definition-label-width: clamp(2.2rem, 11vw, 3rem);
    --roots-definition-column-gap: 0.16rem;
    --roots-quality-legend-width: clamp(1.05rem, 5.1vw, 1.57rem);
  }

  .premaculture-topic-panel--roots .roots-children-row[data-row="1"] {
    --roots-formula-zone-height: 6.5rem;
  }

  .premaculture-topic-panel--roots .roots-children-row[data-row="2"] {
    --roots-formula-zone-height: 4.5rem;
  }

  .premaculture-topic-panel--roots .roots-children-row[data-row="3"] {
    --roots-formula-zone-height: 5.5rem;
  }

  .premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula .roots-formula-table-note,
  .premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula .roots-formula-details,
  .premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula .roots-formula-explanation,
  .premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula .roots-formula-definitions dd {
    font-size: clamp(0.3rem, 1.25vw, 0.42rem) !important;
    line-height: 1.12 !important;
  }

  .premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula .roots-formula-definitions > div {
    grid-template-columns: var(--roots-definition-label-width) minmax(0, 1fr);
    gap: var(--roots-definition-column-gap);
  }

  .premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula .roots-equation math,
  .premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula .roots-formula-definitions math {
    font-size: clamp(0.55rem, 2.8vw, 0.85rem) !important;
  }

  .premaculture-topic-panel--roots .roots-formula-trigger.is-showing-formula .roots-formula-definitions math {
    font-size: clamp(0.45rem, 2.2vw, 0.68rem) !important;
  }
}
