.retraction-demo {
  --rd-ink: #263653;
  --rd-muted: #62718b;
  --rd-blue: #4979cf;
  --rd-purple: #8a6ac5;
  --rd-green: #389c8a;
  margin-block: 24px;
  padding: 20px 22px;
  color: var(--rd-ink);
  background: linear-gradient(120deg, #f3f9fc 0%, #f5f7ff 52%, #f7f4fe 100%);
  border: 1px solid #dce4f4;
  border-radius: 22px;
}

.retraction-demo-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.retraction-demo-heading .eyebrow { order: 2; margin: 0; }
.retraction-demo-heading h3 { margin: 0; font-size: 1.2rem; line-height: 1.4; }
.retraction-demo-heading p { margin: 0; color: var(--rd-muted); font-size: 1rem; line-height: 1.6; }
.retraction-demo-grid { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); align-items: center; gap: 20px; }
.retraction-mechanics, .retraction-images { min-width: 0; }
.retraction-equations { display: flex; flex-direction: column; align-items: center; gap: 0; text-align: center; font-size: clamp(1.06rem, 2.3vw, 1.45rem); line-height: 1.8; }
.retraction-equations > span { color: var(--rd-muted); font-size: 1rem; }
.retraction-definitions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 12px; }
.retraction-definitions > span { white-space: nowrap; }
.retraction-equations > strong { font-weight: 500; }
.retraction-equations p { margin: 0; }
.retraction-demo #retained-coefficient { color: var(--rd-blue); font-weight: 700; font-variant-numeric: tabular-nums; }
.retraction-path { margin: 8px auto 0; }
.retraction-endpoints { display: flex; justify-content: space-between; gap: 24px; color: var(--rd-muted); font-size: .9rem; line-height: 1.45; }
.retraction-endpoints > :first-child { color: #297f73; }
.retraction-endpoints > :last-child { text-align: right; color: #7756ac; }
.retraction-endpoints b { display: inline-block; white-space: nowrap; }
.retraction-path svg { display: block; width: 100%; height: auto; margin: 0; overflow: visible; }
.retraction-path svg text { font-family: inherit; font-size: 36px; fill: var(--rd-ink); text-anchor: middle; }
.retraction-svg-endpoint { display: none; }
.retraction-path-base { stroke: #e1e6f0; stroke-width: 5; stroke-linecap: round; }
#retained-segment { stroke: var(--rd-blue); stroke-width: 7; stroke-linecap: round; }
#retracted-segment { stroke: #baa8dd; stroke-width: 5; stroke-dasharray: 8 9; stroke-linecap: round; }
.retraction-source-point { fill: var(--rd-green); stroke: #fff; stroke-width: 3; }
.retraction-prefix-point { fill: var(--rd-purple); stroke: #fff; stroke-width: 3; }
#prediction-point { fill: var(--rd-blue); stroke: #fff; stroke-width: 4; }
#prediction-label { fill: #345eaa; font-weight: 650; }
.retraction-control { max-width: 700px; margin-inline: auto; }
.retraction-control-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.retraction-control label { font-weight: 600; font-size: .95rem; }
.retraction-control output { color: var(--rd-blue); font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
#retraction-slider { display: block; width: 100%; margin: 7px 0 3px; height: 28px; padding: 0; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; accent-color: var(--rd-blue); }
#retraction-slider::-webkit-slider-runnable-track { height: 7px; background: linear-gradient(90deg, #b6a4df, #8bafe6 55%, #88c8bc); border-radius: 8px; }
#retraction-slider::-moz-range-track { height: 7px; background: linear-gradient(90deg, #b6a4df, #8bafe6 55%, #88c8bc); border-radius: 8px; }
#retraction-slider::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 23px; height: 23px; margin-top: -8px; border: 3px solid #fff; border-radius: 50%; background: var(--rd-blue); box-shadow: 0 0 0 1px #4979cf80, 0 2px 7px #345eaa25; }
#retraction-slider::-moz-range-thumb { width: 17px; height: 17px; border: 3px solid #fff; border-radius: 50%; background: var(--rd-blue); box-shadow: 0 0 0 1px #4979cf80, 0 2px 7px #345eaa25; }
#retraction-slider:focus-visible { outline: 3px solid #4979cf99; outline-offset: 5px; border-radius: 6px; }
#retraction-slider:disabled { opacity: .6; cursor: default; }
.retraction-scale { display: flex; justify-content: space-between; gap: 22px; color: var(--rd-muted); font-size: .85rem; line-height: 1.4; }
.retraction-scale > :last-child { text-align: right; }
.retraction-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 11px auto 0; }
.retraction-stats > * { min-width: 0; display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 12px; font-size: .9rem; line-height: 1.5; }
.retraction-stat-label { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; font-size: .9rem; line-height: 1.5; }
.retraction-stat-label strong, .retraction-stat-label output { font-variant-numeric: tabular-nums; }
#retained-value { color: #345eaa; font-weight: 700; }
#retracted-value { color: #7756ac; font-weight: 700; }
.retraction-meter { grid-column: 1 / -1; height: 6px; overflow: hidden; margin-top: 5px; border-radius: 6px; background: #e1e8f3; }
#retained-meter, #retracted-meter { display: block; height: 100%; border-radius: inherit; }
#retained-meter { background: var(--rd-blue); }
#retracted-meter { background: var(--rd-purple); }
#retraction-description { margin: 8px 0 0; text-align: center; color: var(--rd-ink); font-size: 1rem; line-height: 1.6; }
.retraction-note { margin: 8px 0 0; color: var(--rd-muted); text-align: center; font-size: .85rem; line-height: 1.6; }
.retraction-images { max-width: 540px; width: 100%; margin-inline: auto; }
.retraction-image-headings, .retraction-image-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; gap: 10px; }
.retraction-image-headings { margin-bottom: 8px; color: var(--rd-muted); font-size: .9rem; line-height: 1.4; text-align: center; }
.retraction-image-headings > span { min-width: 0; }
.retraction-image-headings > :nth-child(2) { color: #345eaa; font-weight: 600; }
.retraction-case + .retraction-case { margin-top: 8px; }
.retraction-image-card { margin: 0; min-width: 0; }
.retraction-image-frame { position: relative; overflow: hidden; height: 124px; background: #fff; border: 1px solid #cfd9e9; border-radius: 9px; }
.retraction-image-frame img { display: block; width: 100%; height: 100%; object-fit: contain; transform: scale(var(--retraction-image-scale, 1)); transform-origin: var(--retraction-image-focus, 50% 50%); }
.retraction-case[data-case="1"] { --retraction-image-scale: 1.04; }
.retraction-case[data-case="2"] { --retraction-image-scale: 1.1; --retraction-image-focus: 75% 75%; }
.retraction-case[data-case="3"] { --retraction-image-scale: 1.08; --retraction-image-focus: 55% 50%; }
.retraction-image-frame [data-prefix-overlay] { position: absolute; inset: 0; }
.retraction-blend-card .retraction-image-frame { border: 2px solid #7d9bd5; box-shadow: 0 4px 16px #4979cf15; }
.retraction-image-card figcaption { margin-top: 7px; padding: 0; font-size: .9rem; line-height: 1.4; text-align: center; color: var(--rd-muted); }
.retraction-blend-card figcaption { color: #345eaa; font-weight: 600; }
.retraction-images .retraction-note { margin-top: 14px; }
.retraction-demo noscript { display: block; margin-top: 12px; color: var(--rd-muted); text-align: center; font-size: .85rem; line-height: 1.5; }

@media (max-width: 740px) {
  .retraction-demo-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .retraction-mechanics { max-width: 550px; width: 100%; margin-inline: auto; }
}

@media (max-width: 480px) {
  .retraction-demo { padding: 20px 16px; border-radius: 17px; }
  .retraction-demo-heading h3 { font-size: 1.1rem; }
  .retraction-demo-heading .eyebrow { max-width: 105px; text-align: right; }
  .retraction-equations { font-size: 1.05rem; }
  .retraction-endpoints { font-size: .875rem; gap: 16px; }
  .retraction-path svg text { font-size: 36px; }
  .retraction-path svg { min-height: 45px; }
  .retraction-stats { gap: 16px; }
  .retraction-stat-label { font-size: .85rem; }
  .retraction-stats > * { font-size: .875rem; column-gap: 7px; }
  .retraction-scale { font-size: .875rem; }
  .retraction-image-headings, .retraction-image-grid { gap: 7px; }
  .retraction-image-headings { font-size: .875rem; }
  .retraction-image-frame { height: clamp(78px, 25vw, 112px); }
  .retraction-image-card figcaption { font-size: .875rem; }
}
