/* Home · Edit (.ce, from Website/variants/c) and Retouch (.rd, from Website/variants/d).
   Picked 2026-11-10: variant C's Edit, variant D's automatic Retouch. Shared pieces under .cx. */


.cx {
  --accent: #46fac8;            /* brand green: actions only */
  --accent-ink: #062b20;
  --warn: #ff9f0a;              /* orange: warnings only */
  --c-line: #ffffff1f;
  --c-fill: #ffffff0d;
  position: relative;
  isolation: isolate;
  padding: 0 var(--gutter);
  margin-top: clamp(96px, 14vw, 200px);
}
.cx::before {
  content: ''; position: absolute; z-index: -1;
  inset: 12% -10% -4%;
  filter: blur(90px);
  opacity: .38;
  pointer-events: none;
}
.ce::before { background: radial-gradient(40% 46% at 30% 52%, #c2412f, transparent 70%), radial-gradient(36% 40% at 72% 50%, #6f8f3a, transparent 70%); }
.cr::before { background: radial-gradient(34% 40% at 26% 50%, #482173, transparent 70%), radial-gradient(30% 36% at 52% 55%, #1e9b8a, transparent 70%), radial-gradient(26% 32% at 78% 48%, #c0df25aa, transparent 70%); opacity: .3; }

.cx__head { max-width: 760px; margin: 0 auto clamp(32px, 4vw, 52px); text-align: center; }
.cx__head .hud-label { color: var(--muted); }
.cx__head h2 {
  margin: 16px 0 0;
  font-size: clamp(34px, 5.4vw, 64px);
  letter-spacing: -0.035em; line-height: 1.02; text-wrap: balance;
  background: linear-gradient(180deg, #ffffff 30%, #aab5b0);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.cx__head p:last-child {
  max-width: 540px; margin: 18px auto 0;
  color: var(--muted); font-size: clamp(16px, 1.5vw, 18px); line-height: 1.5; text-wrap: balance;
}

.cx button { font-family: inherit; color: inherit; }
.cx :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.c-glass {
  border: 1px solid #ffffff24;
  background: linear-gradient(180deg, #1c1f1eb8, #121413c4);
  -webkit-backdrop-filter: blur(28px) saturate(1.5);
  backdrop-filter: blur(28px) saturate(1.5);
  box-shadow: inset 0 1px 0 #ffffff1f, 0 24px 60px #00000073;
}

.c-kbd {
  display: inline-grid; place-items: center;
  min-width: 20px; height: 18px; padding: 0 5px;
  border-radius: 5px; border: 1px solid #ffffff26; background: #ffffff0f;
  color: var(--text); font: 600 10px var(--mono); white-space: nowrap;
}

/* Glass segmented control (the app's Light & Color | Geometry and Before | After) */
.c-seg {
  --n: 2;
  position: relative;
  display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  padding: 3px;
  border: 1px solid #ffffff1a; border-radius: 999px;
  background: #ffffff0a;
}
.c-seg__thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px;
  width: calc((100% - 6px) / var(--n));
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff2b, #ffffff17);
  box-shadow: inset 0 1px 0 #ffffff38, 0 2px 8px #0005;
  transform: translateX(calc(var(--selected, 0) * 100%));
  transition: transform .16s ease-in-out;
  pointer-events: none;
}
.c-seg button {
  position: relative; z-index: 1;
  min-width: 0; min-height: 30px; padding: 0 12px;
  border: 0; border-radius: 999px; background: transparent;
  color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer;
}
.c-seg button[aria-selected="true"], .c-seg button:hover { color: var(--text); }
.c-seg button:disabled { color: var(--faint); cursor: default; }

/* ===================================================================== */
/* EDIT                                                                  */
/* ===================================================================== */

.ce__card {
  --panel-w: 304px;
  position: relative;
  width: min(100%, 1280px, calc((100svh - 150px) * 1.4995));
  min-width: min(100%, 900px);
  margin: 0 auto;
}
.ce__stage {
  position: relative;
  aspect-ratio: 1600 / 1067;
  border-radius: 28px;
  background: #000;
  box-shadow: 0 50px 120px #00000080, 0 0 0 1px #ffffff1c;
}
.ce__clip { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; }
.ce__frame {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  overflow: hidden;
  clip-path: inset(0);
  background: #1d2412;
  transition: left .4s, top .4s, width .4s, height .4s, clip-path .4s;
  transition-timing-function: cubic-bezier(.2, .7, .2, 1);
}
.ce__frame canvas, .ce__frame img {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%;
  transform: rotate(var(--rot, 0deg)) scale(var(--zoom, 1));
}
.ce__frame [hidden] { display: none; }
.ce.is-dragging .ce__frame, .ce.is-dragging .ce__crop { transition: none; }

/* Crop overlay (StackResultCropOverlayView): dim outside, rule of thirds, corner and edge handles */
.ce__crop {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  border: 1px solid #ffffffd9;
  box-shadow: 0 0 0 200vmax #000000a6;
  cursor: move;
  touch-action: none;
  opacity: 0; visibility: hidden;
  transition: left .4s, top .4s, width .4s, height .4s, opacity .25s, visibility .25s;
  transition-timing-function: cubic-bezier(.2, .7, .2, 1);
  background:
    linear-gradient(90deg, transparent calc(33.333% - .5px), #ffffff66 calc(33.333% - .5px) calc(33.333% + .5px), transparent calc(33.333% + .5px) calc(66.667% - .5px), #ffffff66 calc(66.667% - .5px) calc(66.667% + .5px), transparent calc(66.667% + .5px)),
    linear-gradient(180deg, transparent calc(33.333% - .5px), #ffffff66 calc(33.333% - .5px) calc(33.333% + .5px), transparent calc(33.333% + .5px) calc(66.667% - .5px), #ffffff66 calc(66.667% - .5px) calc(66.667% + .5px), transparent calc(66.667% + .5px));
}
.ce.is-cropping .ce__crop { opacity: 1; visibility: visible; }
.ce__crop i { position: absolute; width: 34px; height: 34px; }
.ce__crop i::after { content: ''; position: absolute; border: 0 solid #fff; }
.ce__crop i[data-h="nw"] { left: -17px; top: -17px; cursor: nwse-resize; }
.ce__crop i[data-h="ne"] { right: -17px; top: -17px; cursor: nesw-resize; }
.ce__crop i[data-h="sw"] { left: -17px; bottom: -17px; cursor: nesw-resize; }
.ce__crop i[data-h="se"] { right: -17px; bottom: -17px; cursor: nwse-resize; }
.ce__crop i[data-h="nw"]::after { left: 14px; top: 14px; width: 18px; height: 18px; border-width: 3px 0 0 3px; }
.ce__crop i[data-h="ne"]::after { right: 14px; top: 14px; width: 18px; height: 18px; border-width: 3px 3px 0 0; }
.ce__crop i[data-h="sw"]::after { left: 14px; bottom: 14px; width: 18px; height: 18px; border-width: 0 0 3px 3px; }
.ce__crop i[data-h="se"]::after { right: 14px; bottom: 14px; width: 18px; height: 18px; border-width: 0 3px 3px 0; }
.ce__crop i[data-h="n"], .ce__crop i[data-h="s"] { left: calc(50% - 17px); cursor: ns-resize; }
.ce__crop i[data-h="n"] { top: -17px; } .ce__crop i[data-h="s"] { bottom: -17px; }
.ce__crop i[data-h="e"], .ce__crop i[data-h="w"] { top: calc(50% - 17px); cursor: ew-resize; }
.ce__crop i[data-h="w"] { left: -17px; } .ce__crop i[data-h="e"] { right: -17px; }
.ce__crop i[data-h="n"]::after, .ce__crop i[data-h="s"]::after { left: 6px; top: 15px; width: 22px; height: 3px; background: #fff; border-radius: 2px; }
.ce__crop i[data-h="e"]::after, .ce__crop i[data-h="w"]::after { left: 15px; top: 6px; width: 3px; height: 22px; background: #fff; border-radius: 2px; }

/* Band on the photo: what the result is, its edits, Before | After (StackResultEditBandView's info row) */
.ce__band {
  position: absolute; left: 14px; bottom: 14px; right: calc(var(--panel-w) + 28px);
  display: flex; align-items: center; gap: 10px;
  padding: 6px 6px 6px 14px;
  border-radius: 999px;
  font-size: 12px; white-space: nowrap;
}
.ce__info { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-variant-numeric: tabular-nums; }
.ce__info b { color: var(--text); font-weight: 600; }
.ce__chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 26px; padding: 0 11px;
  border-radius: 999px; border: 1px solid #ffffff24; background: #ffffff12;
  font-size: 12px; font-weight: 600; cursor: pointer;
}
.ce__chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #c9cfcc; }
.ce__chip:hover { background: #ffffff1f; }
.ce__chip[hidden] { display: none; }
.ce__band .c-seg { margin-left: auto; flex: none; width: 150px; }
.ce__band .c-seg button { min-height: 26px; }

/* Inspector on glass */
.ce__panel {
  position: absolute; right: 14px; top: 14px; bottom: 14px; width: var(--panel-w);
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 14px 6px;
  border-radius: 20px;
  overflow: hidden;
}
.ce__title { display: flex; align-items: baseline; justify-content: space-between; margin: 0 2px; }
.ce__title b { font-size: 15px; font-weight: 700; }
.ce__title span { color: var(--muted); font-size: 12px; }
.ce__hist { position: relative; padding: 8px 10px 6px; border-radius: 12px; background: #00000047; box-shadow: inset 0 1px 0 #ffffff0a; }
.ce__hist canvas { display: block; width: 100%; height: 54px; }
.ce__hist em { position: absolute; right: 10px; top: 7px; color: var(--faint); font: 600 9px var(--font); letter-spacing: .04em; }
.ce__hist em.is-before { color: var(--text); }
.ce__hist p { display: flex; justify-content: space-between; gap: 8px; margin: 5px 0 0; color: var(--faint); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.ce__panes { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -14px; padding: 0 14px 8px; scrollbar-width: thin; scrollbar-color: #ffffff2e transparent; }
.ce__pane[hidden] { display: none; }

/* Foldable group: chevron, title, grey count, summary while folded, ↺ once edited */
.ce__group + .ce__group { border-top: 1px solid #ffffff14; }
.ce__ghead { display: flex; align-items: center; gap: 4px; min-height: 40px; }
.ce__gtoggle {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 7px;
  min-height: 40px; padding: 0; border: 0; background: none; text-align: left; cursor: pointer;
}
.ce__gtoggle svg { flex: none; color: var(--muted); }
.ce__gtoggle .chev { transition: transform .18s; }
.ce__group[data-open="false"] .chev { transform: rotate(-90deg); }
.ce__gtoggle b { font-size: 13px; font-weight: 700; }
.ce__badge { padding: 1px 7px; border-radius: 999px; background: #ffffff1c; color: #c9cfcc; font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ce__badge[hidden] { display: none; }
.ce__summary { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--faint); font-size: 11px; }
.ce__group[data-open="true"] .ce__summary { display: none; }
.ce__reset {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px;
  border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer;
}
.ce__reset:hover { background: #ffffff14; color: var(--text); }
.ce__reset[hidden] { display: none; }
.ce__gbody { padding: 0 2px 10px 0; }
.ce__group[data-open="false"] .ce__gbody { display: none; }
.ce__group.is-flash .ce__gtoggle b { animation: ce-flash 1s ease-out; }
@keyframes ce-flash { 0%, 40% { color: var(--accent); } 100% { color: inherit; } }

/* White balance pad: temperature across (mired scale), tint up and down, magenta on top */
.ce__pad {
  position: relative; height: 92px; margin: 2px 0 8px;
  border-radius: 8px; overflow: hidden;
  background:
    linear-gradient(180deg, #e06dd699, #e06dd600 50%, #6ed68200 50%, #6ed68299),
    linear-gradient(90deg, #5b86ff, #b9c2d6 52%, #ffb54f);
  box-shadow: inset 0 0 0 1px #ffffff1f;
  cursor: crosshair; touch-action: none;
}
.ce__pad::before, .ce__pad::after { content: ''; position: absolute; background: #ffffff66; pointer-events: none; }
.ce__pad::before { left: var(--px, 50%); top: 0; bottom: 0; width: 1px; }
.ce__pad::after { top: var(--py, 50%); left: 0; right: 0; height: 1px; }
.ce__pad i { position: absolute; bottom: 0; width: 1px; height: 6px; background: #0b0c0c99; }
.ce__puck {
  position: absolute; left: var(--px, 50%); top: var(--py, 50%); z-index: 1;
  width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border-radius: 50%; border: 2px solid #fff; background: #ffffff40;
  box-shadow: 0 1px 4px #0009; pointer-events: none;
}

/* Slider row: title, value at the far end (a reset button once edited), track filled from neutral */
.ce__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 1px 0; }
.ce__row label { color: #c3cac6; font-size: 12px; user-select: none; -webkit-user-select: none; }
.ce__val {
  min-width: 64px; min-height: 22px; padding: 0 0 0 8px;
  border: 0; background: none; text-align: right;
  color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums;
}
.ce__val:disabled { cursor: default; }
.ce__row.is-edited label { color: var(--text); }
.ce__row.is-edited .ce__val { color: var(--accent); cursor: pointer; }
.ce__row.is-edited .ce__val:hover span { display: none; }
.ce__row.is-edited .ce__val:hover::after { content: '↺'; font-size: 14px; }
.ce__row input { grid-column: 1 / -1; }

.cx input[type="range"] {
  --a: 50%; --b: 50%;
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; height: 24px; margin: 0;
  background: transparent; cursor: pointer; touch-action: pan-y;
}
.cx input[type="range"]:focus-visible { outline: none; }
.cx input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: var(--rail); }
.cx input[type="range"]::-moz-range-track { height: 3px; border-radius: 2px; background: var(--rail); }
.ce input[type="range"] { --rail: linear-gradient(90deg, #ffffff24 var(--a), #e9eeebd9 var(--a) var(--b), #ffffff24 var(--b)); }
.ce input.temp { --rail: linear-gradient(90deg, #6e96ff, #ffffff38, #ffb54f); }
.ce input.tint { --rail: linear-gradient(90deg, #6ed682, #ffffff38, #e06dd6); }
.ce input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 13px; margin-top: -5px;
  border-radius: 7px; border: 0; background: #dfe4e1;
  box-shadow: 0 1px 4px #0009, 0 0 0 .5px #0005;
}
.ce input[type="range"]::-moz-range-thumb { width: 20px; height: 13px; border-radius: 7px; border: 0; background: #dfe4e1; box-shadow: 0 1px 4px #0009; }
.ce input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px #46fac866, 0 1px 4px #0009; }

/* Geometry cards */
.ce__gcard { margin-top: 10px; padding: 10px 12px 12px; border-radius: 12px; border: 1px solid #ffffff14; background: #ffffff0a; }
.ce__gcard header { display: flex; align-items: center; justify-content: space-between; min-height: 28px; }
.ce__gcard header b { font-size: 13px; font-weight: 700; }
.ce__select {
  width: 100%; min-height: 30px; margin-top: 4px; padding: 0 10px;
  border-radius: 8px; border: 1px solid #ffffff1f; background: #ffffff12;
  color: var(--text); font: 500 13px var(--font);
}
.ce__note { margin: 10px 2px 0; color: var(--faint); font-size: 11px; line-height: 1.4; }


@media (max-width: 960px) {
  .ce__card { min-width: 0; width: min(100%, 720px); }
  .ce__stage { border-radius: 22px; }
  /* The band steps off the photo, under it. */
  .ce__stage { margin-bottom: 68px; }
  .ce__band { right: 0; left: 0; bottom: auto; top: calc(100% + 10px); padding-left: 6px; }
  .ce__info { display: none; }
  .ce__panel { position: static; width: auto; overflow: visible; }
  .ce__panes { overflow: visible; }
}

@media (prefers-reduced-motion: reduce) {
  .ce *, .ce *::before, .ce *::after { transition: none !important; animation: none !important; }
}

/* ===================================================================== */
/* RETOUCH                                                               */
/* ===================================================================== */

.rd::before {
  background:
    radial-gradient(34% 40% at 30% 50%, #2ab07f, transparent 70%),
    radial-gradient(30% 36% at 70% 52%, #482173, transparent 70%);
  opacity: .28;
}

.rd__card {
  width: min(100%, 1180px, calc((100svh - 190px) * 1.4995));
  min-width: min(100%, 860px);
  margin: 0 auto;
}

/* Glass over a bright photo: darker than c.css's so labels stay readable on the green */
.rd .c-glass { background: linear-gradient(180deg, #181b1ae0, #0f1110eb); border-color: #ffffff2e; }

/* ---------- the photo ---------- */
.rd__view { position: relative; }
.rd__stage {
  position: relative;
  aspect-ratio: 1600 / 1067;
  border-radius: 28px;
  overflow: hidden;
  background: #1d2412;
  box-shadow: 0 50px 120px #00000080, 0 0 0 1px #ffffff1c;
  pointer-events: none;           /* automatic only: the visitor's pointer passes straight through */
  -webkit-user-select: none; user-select: none;
}
.rd__stage > canvas {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%;
}
.rd__map { opacity: 0; transition: opacity .45s ease; pointer-events: none; }
.rd.is-map .rd__map { opacity: .8; }

/* The flaw marker: a dashed ring that leaves as soon as someone starts painting */
.rd__flaw {
  position: absolute; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.5px dashed #ffffffb3;
  box-shadow: 0 0 0 1px #0004, inset 0 0 0 1px #0003;
  pointer-events: none;
  transition: opacity .35s ease, transform .35s ease;
  animation: rd-breathe 2.4s ease-in-out infinite;
}
.rd__flaw span {
  position: absolute; left: 50%; bottom: calc(100% + 10px);
  transform: translateX(-50%);
  padding: 5px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.rd.is-map .rd__flaw span { opacity: 0; }
.rd__flaw span { transition: opacity .25s; }
.rd.is-touched .rd__flaw, .rd.is-fixed .rd__flaw { opacity: 0; transform: translate(-50%, -50%) scale(1.15); animation: none; }
@keyframes rd-breathe { 50% { border-color: #ffffff59; } }

/* Brush ring (also the demo's pointer) */
.rd__cursor {
  position: absolute; left: 0; top: 0;
  width: var(--d, 60px); height: var(--d, 60px);
  margin: calc(var(--d, 60px) / -2) 0 0 calc(var(--d, 60px) / -2);
  border-radius: 50%;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px #0007, inset 0 0 0 1px #0005;
  pointer-events: none;
  opacity: 0; transition: opacity .2s ease;
  will-change: transform;
}
.rd__cursor::after {               /* inner ring = the brush's opaque core */
  content: ''; position: absolute; inset: 19%;
  border-radius: 50%; border: 1px solid #ffffff59;
}
.rd__cursor.is-on { opacity: 1; }
.rd__cursor.is-click { animation: rd-click .45s ease-out; }
@keyframes rd-click { 0% { box-shadow: 0 0 0 0 #ffffffb0, 0 0 0 1px #0007; } 100% { box-shadow: 0 0 0 18px #fff0, 0 0 0 1px #0007; } }

/* Floating tag on the map: which frame made this spot */
.rd__tag {
  position: absolute; left: 0; top: 0;
  display: flex; align-items: center; gap: 9px;
  padding: 5px 12px 5px 5px; border-radius: 12px;
  font-size: 12px; line-height: 1.25; white-space: nowrap;
  pointer-events: none;
  opacity: 0; transition: opacity .18s ease;
  will-change: transform;
}
.rd__tag.is-on { opacity: 1; }
.rd__tag canvas { width: 72px; height: 48px; border-radius: 7px; object-fit: cover; display: block; box-shadow: 0 0 0 2px var(--sw, #fff); }
.rd__tag b { display: block; font-size: 13px; }
.rd__tag small { color: var(--muted); font-size: 11px; }

/* Source chip, top left: the frame the brush paints from */
.rd__source {
  position: absolute; left: 14px; top: 14px;
  display: flex; align-items: center; gap: 10px;
  padding: 5px 14px 5px 5px; border-radius: 14px;
  font-size: 12px; line-height: 1.25;
  pointer-events: none;
}
.rd__source canvas { width: 60px; height: 40px; border-radius: 9px; object-fit: cover; display: block; box-shadow: 0 0 0 2px var(--sw, #fff); transition: box-shadow .3s; }
.rd__source small { display: block; color: var(--muted); font-size: 11px; }
.rd__source b { font-size: 14px; }
.rd__source.is-flash { animation: rd-flash .6s ease-out; }
@keyframes rd-flash { 30% { transform: scale(1.06); } }

/* Bottom bar: Photo | Frame Map, legend, Undo, Replay */
.rd__bar {
  position: absolute; left: 14px; right: 14px; bottom: 14px;
  display: flex; align-items: center; gap: 10px;
  pointer-events: none;
}
.rd__bar > * { pointer-events: auto; }
.rd__bar .c-seg { width: 220px; flex: none; }
.rd__bar .c-seg.c-glass { padding: 3px; }
.rd__legend {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 999px;
  font: 600 11px var(--mono); color: var(--muted);
  opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s;
  pointer-events: none;
}
.rd.is-map .rd__legend { opacity: 1; transform: none; }
.rd__legend i { width: 120px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #440154, #482173, #433e85, #38588c, #2e6f8e, #25848e, #1e9b8a, #2ab07f, #50c46a, #84d44b, #c0df25, #fde725); }
.rd__spacer { flex: 1; }
.rd__btn {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 36px; padding: 0 14px;
  border-radius: 999px; cursor: pointer;
  font-size: 12px; font-weight: 600;
}
.rd__btn:disabled { color: var(--faint); cursor: default; }
.rd__btn[hidden] { display: none; }
.rd__btn--icon { width: 36px; padding: 0; justify-content: center; }

/* ---------- three steps under the photo ---------- */
.rd__steps {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 2vw, 28px);
  margin: 26px 0 0; padding: 0; list-style: none;
}
.rd__steps li {
  position: relative;
  padding: 14px 0 0;
  border-top: 2px solid #ffffff1a;
  color: var(--faint);
  transition: color .3s, border-color .3s;
}
.rd__steps li::before {           /* progress fill along the top rule */
  content: ''; position: absolute; left: 0; top: -2px; height: 2px; width: 0;
  background: var(--text); transition: width .5s ease;
}
.rd__steps li[aria-current="step"] { color: var(--text); }
.rd__steps li[aria-current="step"]::before { width: 40%; }
.rd__steps li.is-done { color: var(--muted); }
.rd__steps li.is-done::before { width: 100%; background: #ffffff59; }
.rd__steps b { display: block; font-size: 15px; letter-spacing: -.01em; }
.rd__steps p { margin: 5px 0 0; font-size: 13.5px; line-height: 1.45; }
.rd__steps em { font-style: normal; font-family: var(--mono); font-size: 11px; margin-right: 8px; opacity: .7; }

/* ---------- phones ---------- */
@media (max-width: 720px) {
  .rd__stage { border-radius: 18px; }
  .rd__source { left: 8px; top: 8px; padding: 4px 10px 4px 4px; gap: 8px; border-radius: 11px; }
  .rd__source canvas { width: 42px; height: 28px; border-radius: 7px; }
  .rd__source b { font-size: 12px; }
  .rd__bar { position: static; margin-top: 10px; gap: 6px; }
  .rd__bar .c-seg { width: 168px; }
  .rd__bar .c-seg button { min-height: 26px; padding: 0 8px; font-size: 11px; }
  .rd__legend { display: none; }
  .rd__btn { min-height: 32px; padding: 0 10px; font-size: 11px; }
  .rd__btn--icon { width: 32px; padding: 0; }
  .rd__flaw span { font-size: 11px; padding: 4px 9px; }
  .rd__steps { grid-template-columns: 1fr; gap: 14px; margin-top: 20px; }
  .rd__steps li { padding-top: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .rd__flaw { animation: none; }
  .rd__map, .rd__cursor, .rd__tag, .rd__legend { transition: none; }
}

/* ---------- On the home page ---------- */
#page-home > .stk + .cx { margin-top: 40px; }      /* the stacking section already ends on its own padding */
#page-home > .cx:last-child { padding-bottom: clamp(96px, 14vw, 200px); }
.cx__more { margin: clamp(28px, 3vw, 40px) 0 0; text-align: center; font-size: 15px; }
.cx__more a { color: var(--muted); text-decoration: none; }
.cx__more a:hover { color: var(--text); }
