/* Stage1Energy — visual dossier showcase on /example-report.
   Verdict → Money → Roof → Energy → Risks. Charts lead; copy is minimal. */

/* ---------- Intro + jump nav ---------- */

.dossier-intro {
  background: var(--ink);
  border-top: 1px solid var(--ink-line);
  border-bottom: 1px solid var(--ink-line);
  padding-block: var(--section-pad-compact);
}

.dossier-intro .d2 {
  margin-top: 20px;
  max-width: 28ch;
}

.er-chapters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 4px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--ink-line);
}

.er-chapters__link {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-mute);
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

.er-chapters__link:hover {
  color: var(--paper);
}

.er-chapters__link.is-active {
  color: var(--paper);
  border-color: var(--ink-line);
  background: var(--ink-2);
}

/* ---------- Shared ---------- */

.er-chapter-head .d2 {
  margin-top: 20px;
}

.er-pdf-link {
  margin-top: 28px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.er-pdf-link--paper {
  /* inherits paper section link colour */
}

/* ---------- Verdict ---------- */

.s4 {
  border-top: 1px solid var(--ink-line);
  padding-block: var(--section-pad);
}

.s4__kpis {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--gutter);
}

.s4 .kpi--verdict .kpi__value--text {
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.15;
  color: var(--paper);
  font-variant-numeric: normal;
}

.s4 [data-reveal].is-in {
  animation: s4-reveal-in 600ms cubic-bezier(0.16, 1, 0.3, 1) var(--reveal-delay, 0ms) both;
  transition: none;
}

@keyframes s4-reveal-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Money ---------- */

.s5 {
  background: var(--paper);
  color: var(--text-dark);
  padding-block: var(--section-pad);
}

.s5__chart {
  margin-top: 48px;
  position: relative;
}

.er-year1 {
  margin-top: 56px;
  max-width: 720px;
}

.er-year1 .eyebrow {
  margin-bottom: 20px;
}

.er-year1__chart {
  position: relative;
  min-height: 200px;
}

/* ---------- Roof ---------- */

.s3 {
  border-bottom: 0;
  padding-block: var(--section-pad);
}

.s3__grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 48px;
  align-items: start;
  margin-top: 48px;
}

.s3__map {
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-md);
  transition: outline-color 200ms ease;
}

.s3__map.is-zone-active {
  outline: 2px solid var(--lime);
  outline-offset: 4px;
}

.er-zone-rank .eyebrow {
  margin-bottom: 20px;
}

.er-zone-rank__chart {
  position: relative;
  min-height: 240px;
}

.zone-rank-row.is-active rect {
  stroke: var(--lime);
  stroke-width: 2;
}

/* ---------- Energy ---------- */

.s6 {
  background: var(--paper);
  color: var(--text-dark);
  border-top: 1px solid var(--line);
  padding-block: var(--section-pad);
}

.s6__chart {
  margin-top: 48px;
  position: relative;
}

.s6__split {
  margin-top: 48px;
  max-width: 720px;
}

.s6__split-bar {
  display: flex;
  height: 36px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.s6__split-bar .self {
  background: var(--moss);
  width: 45%;
  transition: width 900ms cubic-bezier(0.16, 1, 0.3, 1);
}

.s6__split-bar .exp {
  background: #D7DECF;
  width: 55%;
  transition: width 900ms cubic-bezier(0.16, 1, 0.3, 1);
}

.s6__split-bar.is-pending .self,
.s6__split-bar.is-pending .exp {
  width: 0 !important;
}

.s6__split-bar.is-animated .self {
  width: var(--split-pct, 45%);
}

.s6__split-bar.is-animated .exp {
  width: var(--split-pct, 55%);
}

.s7__chip.is-pending-flag {
  opacity: 0;
  transform: translateY(12px);
}

.s7__chip.is-in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 400ms ease, transform 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

.s6__split-legend {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 14px;
}

/* ---------- Chart tooltips ---------- */

.chart-tooltip {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  border-radius: var(--radius-md);
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -120%);
  transition: opacity 120ms ease;
}

.chart-tooltip.is-visible {
  opacity: 1;
}

/* ---------- Risks — compact status strip ---------- */

.s7 {
  background: var(--paper);
  color: var(--text-dark);
  padding-block: var(--section-pad);
  border-top: 1px solid var(--line);
}

.s7__strip {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gutter);
}

.s7__chip {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper-2);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 112px;
  justify-content: space-between;
}

.s7__chip-label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------- Close ---------- */

.er-close {
  background: var(--paper);
  color: var(--text-dark);
  border-top: 1px solid var(--line);
  padding-block: var(--section-pad);
}

.er-close .d2 {
  margin-top: 20px;
  max-width: 22ch;
}

.er-close__line {
  margin-top: 16px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-mute);
  max-width: 48ch;
}

.er-close__trace {
  margin-top: 16px;
}

.er-close__ctas {
  margin-top: 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  max-width: 560px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

/* ---------- FAQ ---------- */

.er-faq {
  background: var(--paper);
  color: var(--text-dark);
  border-top: 1px solid var(--line);
  padding-block: var(--section-pad);
}

.er-faq .d2 {
  margin-top: 20px;
}

.er-faq__list {
  margin-top: 40px;
  max-width: 640px;
}

.er-faq__item {
  border-top: 1px solid var(--line);
}

.er-faq__item:last-child {
  border-bottom: 1px solid var(--line);
}

.er-faq__item summary {
  list-style: none;
  cursor: pointer;
  padding-block: 18px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.3;
}

.er-faq__item summary::-webkit-details-marker {
  display: none;
}

.er-faq__item summary::after {
  content: "+";
  float: right;
  font-family: var(--mono);
  font-size: 16px;
  color: var(--text-mute);
}

.er-faq__item[open] summary::after {
  content: "–";
}

.er-faq__item p {
  padding-bottom: 20px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-mute);
  max-width: 52ch;
}

@media (max-width: 899px) {
  .s3__grid,
  .er-close__ctas {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .s4__kpis {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .s4__kpis .kpi--verdict {
    grid-column: 1 / -1;
  }

  .s7__strip {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 599px) {
  .s7__strip {
    grid-template-columns: 1fr;
  }
}
