:root {
  --background: #f8fafc;
  --foreground: #020617;
  --title: #020617;
  --card: #fff;
  --primary: #7f1395;
  --primary-foreground: #fff;
  --muted: #e1e7ef;
  --muted-foreground: #65758b;
  --border: #e1e7ef;
  --comparison-before: #f50029;
  --comparison-before-soft: #feecef;
  --comparison-goal: #00bd4f;
  --comparison-goal-soft: #edfcf4;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: var(--background);
  color: var(--foreground);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--background);
}
.bar-track { height: 4px; width: 100%; background: var(--muted); }
.bar-fill {
  height: 100%;
  background: var(--primary);
  transition: width .5s ease-out;
}
.bar-spacer { height: 2.5rem; }

.stage {
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}
.layers { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1rem; }
.layer { min-width: 0; flex-basis: 100%; max-width: 100%; }

.funnel-prose { color: var(--foreground); font-size: 1rem; line-height: 1.5; overflow-wrap: break-word; }
.funnel-prose h1, .funnel-prose h2, .funnel-prose h3, .funnel-prose h4 {
  color: var(--title); font-size: 1.5rem; font-weight: 700; line-height: 1.25; margin: 0;
}
.funnel-prose h3 { font-size: 1.25rem; }
.funnel-prose p { margin: 0; font-size: 1rem; }
.funnel-prose p + p, .funnel-prose h2 + p, .funnel-prose p + h2 { margin-top: .5rem; }
.funnel-prose strong, .funnel-prose b { font-weight: 700; }
.funnel-prose em { font-style: italic; }
.funnel-prose u { text-decoration: underline; }
.ql-align-center { text-align: center; }
.ql-align-right { text-align: right; }
.ql-align-justify { text-align: justify; }
.metric-subtitle .funnel-prose { font-size: .875rem; line-height: 1.25rem; }

.pic { display: flex; width: 100%; justify-content: center; }
.pic img { height: auto; border-radius: 1rem; object-fit: contain; }

.cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.5rem;
  padding: .75rem 1rem;
  border: 0;
  border-radius: 1rem;
  background: var(--primary);
  color: var(--primary-foreground);
  font: 600 1rem/1.3 Inter, sans-serif;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
}
.cta:disabled { cursor: not-allowed; opacity: .5; }
.cta.pulse { animation: soft-pulse 1.8s ease-in-out infinite; }
@keyframes soft-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 45%, transparent); transform: scale(1); }
  50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--primary) 0%, transparent); transform: scale(1.02); }
}

.options { display: grid; width: 100%; gap: .75rem; }
.options.cols-2 { grid-template-columns: 1fr 1fr; }
.opt {
  display: flex;
  align-items: center;
  gap: .75rem;
  width: 100%;
  min-height: 3.5rem;
  padding: .75rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--card);
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.options.cols-2 .opt { gap: .5rem; }
.opt.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, white); }
.opt:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.opt.stack { flex-direction: column; align-items: stretch; }
.opt img.thumb { width: 3rem; height: 3rem; object-fit: cover; border-radius: .75rem; flex-shrink: 0; }
.opt img.cover { width: 100%; height: auto; object-fit: cover; border-radius: .75rem; }
.opt img.contain { object-fit: contain; background: transparent; }
.funnel-option-label { min-width: 0; flex: 1; }
.funnel-option-label p { margin: 0; font-size: .95rem; }
.chev { width: 1.25rem; height: 1.25rem; flex-shrink: 0; color: var(--muted-foreground); }
.check {
  display: flex; align-items: center; justify-content: center;
  width: 1.5rem; height: 1.5rem; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: 999px; background: var(--background);
}
.check.on { border-color: var(--primary); background: var(--primary); color: #fff; }

.field { width: 100%; display: flex; flex-direction: column; gap: .5rem; }
.field label { font-size: .875rem; font-weight: 500; }
.field input {
  height: 3.5rem; width: 100%;
  border: 1px solid var(--border); border-radius: 1rem;
  background: var(--card); padding: 0 1rem;
  font: 1rem Inter, sans-serif; color: var(--foreground); outline: none;
}
.field input:focus { border-color: var(--primary); }
.field input::placeholder { color: var(--muted-foreground); }

.slider {
  width: 100%; padding: 1rem;
  border: 1px solid var(--border); border-radius: 1rem; background: var(--card);
}
.slider .read { text-align: center; }
.slider .num { font-size: 3rem; font-weight: 700; }
.slider .unit { margin-left: .25rem; font-size: 1.25rem; font-weight: 600; color: var(--muted-foreground); }
.slider input[type="range"] {
  width: 100%; margin: 1rem 0 .5rem; accent-color: var(--primary);
}
.slider .ends { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted-foreground); }

.alert {
  width: 100%;
  border-left: 4px solid var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, white);
  border-radius: 1rem;
  padding: 1rem;
}

.loading { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 1.5rem 0; }
.loading h2 { margin: 0; text-align: center; font-size: 1.5rem; }
.loading .track { height: .5rem; width: 100%; overflow: hidden; border-radius: 999px; background: var(--muted); }
.loading .fill { height: 100%; border-radius: inherit; background: var(--primary); }
.loading .pct { font-size: 1.875rem; font-weight: 700; color: var(--primary); }

.audio {
  display: flex; align-items: center; gap: .75rem; width: 100%;
  border: 1px solid var(--border); border-radius: 1rem; background: var(--card); padding: .75rem;
}
.audio img { width: 3rem; height: 3rem; border-radius: 999px; object-fit: cover; }
.audio .play {
  width: 2.5rem; height: 2.5rem; flex-shrink: 0; border: 0; border-radius: 999px;
  background: var(--primary); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.audio .mid { min-width: 0; flex: 1; }
.audio .track { height: .375rem; width: 100%; overflow: hidden; border-radius: 999px; background: var(--muted); }
.audio .fill { height: 100%; border-radius: inherit; background: var(--primary); }
.audio .time { margin-top: .25rem; font-size: .75rem; color: var(--muted-foreground); }

.player { width: 100%; max-width: 400px; margin: 0 auto; }
.player-ph { width: 100%; background: #020617; padding-top: 177.78%; }

.metric { width: 100%; padding: .25rem; }
.metric .head { display: flex; align-items: flex-end; justify-content: space-between; gap: .75rem; padding-bottom: .5rem; font-size: .875rem; }
.metric .title { font-weight: 600; }
.metric .rail { position: relative; display: flex; align-items: center; height: .5rem; border-radius: .5rem; background: var(--muted); }
.metric .segs { display: flex; width: 100%; gap: .5rem; margin: 0 -.1rem; }
.metric .seg { height: .5rem; width: 100%; border-radius: 1rem; }
.metric .seg:nth-child(1) { background: linear-gradient(to right, #14b8a6, #a5c368); }
.metric .seg:nth-child(2) { background: linear-gradient(to right, #a5c368, #facc15); }
.metric .seg:nth-child(3) { background: linear-gradient(to right, #facc15, #facc15); }
.metric .seg:nth-child(4) { background: linear-gradient(to right, #facc15, #e96827); }
.metric .seg:nth-child(5) { background: linear-gradient(to right, #e96827, #dc2626); }
.metric .dot {
  position: absolute; top: 50%;
  width: .8rem; height: .8rem; padding: .4rem; box-sizing: content-box;
  border: 4px solid var(--primary); border-radius: 999px; background: var(--card);
  transform: translate(-50%, -50%);
  transition: left 1s ease-out;
}
.metric .legs { display: flex; justify-content: space-between; gap: .25rem; padding-top: .25rem; font-size: .875rem; font-weight: 600; }
.metric .legs span { flex: 1; text-align: center; }
.metric .legs span:first-child { text-align: left; }
.metric .legs span:last-child { text-align: right; }

.quotes { display: flex; flex-direction: column; gap: .75rem; width: 100%; }
.quote { border: 1px solid var(--border); border-radius: 1rem; background: var(--card); padding: 1rem; }
.quote .who { display: flex; align-items: center; gap: .75rem; }
.quote img { width: 3rem; height: 3rem; border-radius: 999px; object-fit: cover; }
.quote .name { font-size: .875rem; font-weight: 600; }
.quote .city { font-size: .75rem; color: var(--muted-foreground); }
.stars { margin-top: .5rem; color: #facc15; letter-spacing: .05rem; }
.quote p { margin: .5rem 0 0; }

.args { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; width: 100%; }
.arg { display: flex; flex-direction: column; gap: .5rem; border: 1px solid var(--border); border-radius: 1rem; background: var(--card); padding: .75rem; }
.arg img { width: 100%; height: auto; border-radius: .75rem; object-fit: cover; }
.arg .funnel-prose { font-size: .875rem; }

.comparison-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.comparison-column {
  display: flex; flex-direction: column; min-width: 0;
  border: 1px solid var(--border); background: var(--card);
  border-radius: 20px; padding: 6px 10px 10px;
}
.comparison-before { --comparison-color: var(--comparison-before); --comparison-soft: var(--comparison-before-soft); }
.comparison-goal { --comparison-color: var(--comparison-goal); --comparison-soft: var(--comparison-goal-soft); }
.comparison-photo { width: 100%; aspect-ratio: 2/3; object-fit: contain; }
.comparison-label {
  align-self: center; width: 80%; margin: 6px 0 10px; padding: 6px;
  background: var(--comparison-soft); text-align: center; border-radius: 999px;
  font-size: 1.25rem; font-weight: 700; line-height: 1.2;
}
.comparison-description { text-align: center; flex: 1; margin-bottom: 14px; }
.comparison-description .funnel-prose { font-size: 1rem; line-height: 1.35; }
.comparison-meter { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.comparison-track { position: relative; flex: 1; height: 8px; border-radius: 999px; background: var(--muted); }
.comparison-fill { height: 100%; border-radius: inherit; background: var(--comparison-color); transition: width 1s ease-out; }
.comparison-dot {
  position: absolute; top: 50%; width: 18px; height: 18px;
  border: 3px solid var(--border); background: var(--card); border-radius: 50%;
  transform: translate(-50%, -50%); transition: left 1s ease-out;
}
.comparison-percent { flex-shrink: 0; font-size: .875rem; font-weight: 700; }
.comparison-callout {
  display: flex; align-items: center; gap: 8px; flex: 1;
  background: var(--comparison-soft); border-radius: 12px; padding: 10px 8px;
}
.comparison-callout svg { width: 24px; height: 32px; color: var(--comparison-color); fill: currentColor; flex-shrink: 0; }
.comparison-callout .funnel-prose { font-size: .875rem; line-height: 1.35; }
.comparison-callout strong { color: var(--comparison-color); }
@media (max-width: 400px) {
  .comparison-grid { gap: 8px; }
  .comparison-column { padding: 4px 6px 8px; }
  .comparison-description .funnel-prose { font-size: .875rem; }
  .comparison-callout { gap: 4px; padding: 8px 5px; }
  .comparison-callout .funnel-prose { font-size: .8125rem; }
}
