.performance-preview {
  max-width: 980px;
  margin: clamp(2rem, 6vw, 4rem) auto 0;
  padding: clamp(1.25rem, 4vw, 2.75rem);
  border: 1px solid #dce5df;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 48px rgb(29 57 48 / 9%);
  color: #243b31;
  text-align: left;
}

.performance-preview h2 {
  margin: .5rem 0;
}

.performance-weights {
  display: grid;
  grid-template-columns: 7fr 3fr;
  gap: 4px;
  height: .6rem;
  margin: 1.25rem 0;
  overflow: hidden;
  border-radius: 999px;
}

.performance-weights span:first-child { background: #f2673a; }
.performance-weights span:last-child { background: #769789; }

.performance-stages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 155px), 1fr));
  gap: .625rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: performance-stage;
}

.performance-stages li {
  padding: .75rem;
  border-radius: 12px;
  background: #f0f5f2;
  counter-increment: performance-stage;
}

.performance-stages li::before {
  content: counter(performance-stage, decimal-leading-zero);
  display: block;
  color: #9c371a;
  font-weight: 700;
}

#performance-features,
#performance-screens { scroll-margin-top: 100px; }

.performance-window,
.performance-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
}

.performance-window {
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid #dce5df;
}

.performance-switch { margin: 1rem 0 1.5rem; }
.performance-switch[hidden],
.performance-screen[hidden] { display: none; }

.performance-switch button {
  flex: 1 1 12rem;
  padding: .65rem .8rem;
  border: 1px solid #dce5df;
  border-radius: 12px;
  background: #f0f5f2;
  color: #243b31;
  font-weight: 600;
}

.performance-switch button[aria-pressed="true"] {
  border-color: #f2673a;
  background: #fff0e8;
  color: #86351e;
}

.performance-switch button:focus-visible { outline: 2px solid #86351e; outline-offset: 2px; }
.performance-screen { margin-top: 1rem; }
.performance-screen h2 { font-size: clamp(1.35rem, 3vw, 2rem); }

.performance-screen-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  margin-top: 1rem;
}

.performance-panel {
  min-width: 0;
  padding: 1rem;
  border: 1px solid #dce5df;
  border-radius: 12px;
  background: #f8faf9;
}

.performance-panel h3 { margin: 0 0 .5rem; font-size: 1.05rem; }
.performance-panel p:last-child { margin-bottom: 0; }
.performance-data { margin: 0; }
.performance-data div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .25rem .75rem;
  padding: .55rem 0;
  border-bottom: 1px solid #dce5df;
}
.performance-data div:last-child { border-bottom: 0; }
.performance-data dd { margin: 0; font-weight: 600; }
.performance-task-list { grid-template-columns: minmax(0, 1fr); }
.performance-task-list small { display: block; color: #526d62; }
.performance-panel .performance-score { font-size: 2.25rem; line-height: 1.25; font-weight: 700; margin: .6rem 0; }
.performance-score span { font-size: 1rem; color: #526d62; }

@media (max-width: 650px) {
  .performance-screen-grid { grid-template-columns: minmax(0, 1fr); }
}

.performance-page .pm-example {
  max-width: none;
  margin: 0;
  padding: clamp(1rem, 3vw, 1.75rem);
}

.pm-example-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  margin-bottom: 1rem;
  padding-bottom: .85rem;
  border-bottom: 1px solid #dce5df;
}

.performance-page .pm-example-header :is(h3, h4) { margin: 0; }
.pm-review-rows { margin: 0; }
.pm-review-rows > div {
  display: grid;
  grid-template-columns: minmax(6rem, .45fr) minmax(0, 2fr) minmax(0, max-content);
  align-items: center;
  gap: .55rem 1rem;
  padding: .8rem;
  margin-bottom: .45rem;
  background: #f5f8f6;
  border-radius: 10px;
}
.pm-review-rows dt { font-weight: 700; }
.pm-review-rows dd { margin: 0; }
.pm-review-rows small { display: block; color: #526d62; }
.pm-chip {
  justify-self: start;
  padding: .25rem .6rem;
  border-radius: 999px;
  background: #e3efe9;
  color: #264b3d;
  font-size: .82rem;
  font-weight: 600;
}
.pm-chip-warm { background: #fff0e8; color: #86351e; }
.pm-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 5vw, 4rem);
}

.pm-split-reverse > .pm-copy { grid-column: 2; grid-row: 1; }
.pm-split-reverse > .pm-example { grid-column: 1; grid-row: 1; }
.pm-copy { display: grid; gap: 1.5rem; }
.pm-copy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 3rem; }
.pm-copy > div,
.pm-plan-copy {
  padding-inline-start: clamp(.85rem, 2vw, 1.3rem);
  border-inline-start: 3px solid #f2673a;
}

.performance-page :is(.pm-copy h3, .pm-plan-copy h3) {
  margin: 0 0 .45rem;
  color: #243b31;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  line-height: 1.35;
  text-wrap: pretty;
}

.performance-page :is(.pm-copy p, .pm-plan-copy p, .cx-heading p, .cx-steps p) {
  color: #40554b;
  font-size: clamp(1rem, 1.4vw, 1.075rem);
  line-height: 1.7;
}

.performance-page :is(.pm-copy p, .pm-plan-copy p) {
  max-inline-size: 62ch;
  margin: 0;
}
.pm-plan { display: grid; grid-template-rows: subgrid; grid-row: span 2; gap: 1rem; min-width: 0; }
@media (max-width: 767px) {
  .pm-split,
  .pm-copy-grid,
  .pm-review-rows > div { grid-template-columns: minmax(0, 1fr); }
  .pm-split-reverse > :is(.pm-copy, .pm-example) { grid-column: auto; grid-row: auto; }
}

@media (prefers-reduced-motion: no-preference) {
  .pm-copy > .is-motion-active,
  .pm-plan-copy.is-motion-active,
  .performance-page .cx-heading.is-motion-active {
    animation: pm-example-enter .38s ease-out both;
  }
  .performance-preview.is-motion-active :is(.performance-screen-grid > *, .pm-review-rows > div, .performance-stages > li) {
    animation: pm-example-enter .46s ease both;
  }
  .performance-preview.is-motion-active :is(.performance-screen-grid > *, .pm-review-rows > div, .performance-stages > li):nth-child(2) {
    animation-delay: .12s;
  }
  .performance-preview.is-motion-active :is(.pm-review-rows > div, .performance-stages > li):nth-child(3) {
    animation-delay: .24s;
  }
  .performance-preview.is-motion-active .performance-weights > span {
    transform-origin: left;
    animation: pm-weight-fill .72s .18s ease both;
  }
}

@keyframes pm-example-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pm-weight-fill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.performance-page .pm-feature-cards h3 { margin-top: 0; }
.performance-page .pm-feature-cards p { color: #40554b; }

.pm-research-stat {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 1rem;
  text-align: center;
}
.performance-page .pm-research-stat p { margin: 0; max-width: 38ch; }
.pm-research-ring {
  display: grid;
  place-items: center;
  inline-size: clamp(7rem, 16vw, 9.5rem);
  aspect-ratio: 1;
  padding: .65rem;
  border-radius: 50%;
  background: conic-gradient(#f2673a var(--pm-share), #e6eeea 0);
  color: #9c371a;
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.pm-research-ring > span {
  display: grid;
  place-items: center;
  inline-size: 100%;
  block-size: 100%;
  border-radius: 50%;
  background: #fff;
}
.pm-research-source { margin: 1rem 0 0; text-align: center; }
.pm-research-source a { color: #86351e; text-decoration: underline; }
.pm-screen-stages { margin-top: 1rem; }
.pm-screen-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .5rem;
  margin: 1rem 0 0;
}
.pm-screen-metrics > div {
  display: flex;
  flex-direction: column-reverse;
  justify-content: start;
  gap: .25rem;
  padding: clamp(.5rem, 2vw, 1rem);
  border-radius: 12px;
  background: #f0f5f2;
  overflow-wrap: anywhere;
}
.pm-screen-metrics > div:nth-child(2) { background: #fff0e8; }
.pm-screen-metrics dd { margin: 0; font-size: clamp(1.35rem, 3vw, 2rem); font-weight: 700; }
.pm-quarter-chart { margin-top: 1rem; }
.pm-quarter-chart h5 { margin: 0 0 .5rem; font-size: .95rem; }
.pm-chart-row {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(2rem, 1fr) auto;
  align-items: center;
  gap: .5rem;
  margin-top: .45rem;
  font-size: .875rem;
}
.pm-chart-track {
  height: .5rem;
  overflow: hidden;
  border-radius: 999px;
  background: #dce5df;
}
.pm-chart-track > span {
  display: block;
  height: 100%;
  width: var(--pm-value);
  transform-origin: left;
  border-radius: inherit;
  background: #b94c29;
}

@media (prefers-reduced-motion: no-preference) {
  .performance-preview.is-motion-active .is-selected :is(.pm-screen-metrics > div, .pm-screen-stages > li) {
    animation: pm-example-enter .46s ease-out both;
  }
  .performance-preview.is-motion-active :is(.pm-quarter-chart, .is-selected) .pm-chart-track > span {
    animation: pm-weight-fill .75s ease-out both;
  }
  .performance-preview.is-motion-active :is(.pm-chart-row:nth-child(3), .pm-screen-metrics > :nth-child(2), .pm-screen-stages > :nth-child(2)),
  .performance-preview.is-motion-active .pm-chart-row:nth-child(3) .pm-chart-track > span { animation-delay: .1s; }
  .performance-preview.is-motion-active :is(.pm-screen-metrics > :nth-child(3), .pm-screen-stages > :nth-child(3)),
  .performance-preview.is-motion-active .pm-chart-row:nth-child(4) .pm-chart-track > span { animation-delay: .2s; }
  .performance-preview.is-motion-active .pm-screen-stages > :nth-child(4),
  .performance-preview.is-motion-active .pm-chart-row:nth-child(5) .pm-chart-track > span { animation-delay: .3s; }
}

.pm-plan-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 1rem clamp(1.5rem, 4vw, 3rem);
}

.pm-score-report {
  display: grid;
  grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr);
  align-items: center;
  gap: 1rem;
}

.pm-score-result {
  display: grid;
  gap: .35rem;
  padding: 1rem;
  border-radius: 12px;
  background: #e6f0eb;
}

.pm-score-result strong { font-size: clamp(1.7rem, 4vw, 2.7rem); line-height: 1.15; }
.pm-score-result small { font-size: .9rem; }
.pm-score-breakdown { margin: 0; }
.pm-score-breakdown > div + div { margin-top: .7rem; }
.pm-score-breakdown dd { display: flex; align-items: center; gap: .6rem; margin: 0; }
.pm-score-breakdown meter { width: 100%; min-width: 0; }
.pm-score-breakdown dt { font-size: .875rem; }
.performance-page .pm-example-note { margin: .85rem 0 0; font-size: .9rem; }

.pm-progression-track {
  list-style: none;
  margin: 0;
  padding: 0;
  border-inline-start: 2px solid #e7b29e;
}

.pm-progression-track li { position: relative; padding: .25rem 0 .65rem 1.1rem; }
.pm-progression-track li::before {
  content: '';
  position: absolute;
  inset-inline-start: -.35rem;
  top: .6rem;
  width: .6rem;
  height: .6rem;
  border-radius: 50%;
  background: #c45531;
}

.pm-progression-result {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .55rem;
  padding: .8rem;
  border-radius: 10px;
  background: #fff0e8;
  color: #86351e;
}

@media (max-width: 767px) {
  .pm-plan-layout { grid-template-columns: minmax(0, 1fr); row-gap: 1.5rem; }
  .pm-plan-layout .pm-plan { grid-template-rows: auto; grid-row: auto; }
}

@media (max-width: 420px) {
  .pm-score-report { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: no-preference) {
  .pm-feature-cards > .is-motion-active,
  .performance-preview.is-motion-active :is(.pm-score-result, .pm-score-breakdown, .pm-progression-track, .pm-progression-result) {
    animation: pm-example-enter .42s ease-out both;
  }
  .performance-preview.is-motion-active :is(.pm-score-breakdown, .pm-progression-result) { animation-delay: .14s; }
}
