/* ==========================================================================
   Plait redesign proposal (October 7, 2026) — design system, phase 1.

   Loaded only while the proposal flag is on (public/redesign.js injects this sheet), so the
   current product is untouched. Every rule is prefixed .px-* (or scoped under html.px-on), and
   the visual system follows the Multiplai redesign: warm paper, ink, hairlines and ONE accent;
   Inter to say things, Instrument Serif italic in the accent to underline a word; big confident
   statement type; 24px cards with soft shadows; pill buttons that lift; spring motion.

   Accent: "basil" #2F7F2A — a fresh leafy green that reads as food rather than fintech. It passes
   WCAG AA for body text on paper (4.76:1) and on white cards (5.01:1), and white text on it
   (5.01:1), so it is safe for links, selected states and filled buttons alike.
   ========================================================================== */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/inter-latin-var.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/instrument-serif-italic-latin.woff2') format('woff2');
}

/* ------------------------------------------------------------------ tokens */
.px,
.px-pill,
.px-sheet-host,
.px-toast-host,
html.px-on :is(#paymentModal, [data-px-ghost='paymentModal']),
html.px-on body {
  --px-paper: #faf9f6;
  --px-paper-2: #f3f0e9;
  --px-card: #ffffff;
  --px-ink: #121a1b;
  --px-ink2: #4a4f52;
  --px-muted: #8b9091; /* hairline icons and decoration only (3.1:1) */
  --px-muted-ink: #5f6466; /* small text that must pass AA (5.7:1 on paper, 5.3:1 on paper-2) */
  --px-line: rgba(18, 26, 27, 0.1);
  --px-line-strong: rgba(18, 26, 27, 0.18);
  --px-accent: #2f7f2a;
  --px-accent-hover: #276b23;
  --px-accent-tint: #e8f3e2;
  --px-accent-ink: #276b23; /* accent text on the tint at badge sizes (5.7:1) */
  --px-on-accent: #ffffff;
  --px-protein: #c2562f;
  --px-carbs: #c99a1d;
  --px-fat: #3f6fb0;
  --px-danger: #b3261e;
  --px-shadow: 0 1px 0 rgba(18, 26, 27, 0.04), 0 14px 34px rgba(18, 26, 27, 0.06),
    inset 0 0 0 1px rgba(18, 26, 27, 0.06);
  --px-shadow-lift: 0 1px 0 rgba(18, 26, 27, 0.04), 0 26px 54px rgba(18, 26, 27, 0.12),
    inset 0 0 0 1px rgba(18, 26, 27, 0.06);
  /* Motion (docs/redesign-parity.md "Motion spec"): transform and opacity only; no overshoot
     except the plan reveal's one celebration. */
  --px-ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --px-ease-sheet: cubic-bezier(0.32, 0.72, 0, 1);
  --px-ease-exit: cubic-bezier(0.4, 0, 1, 1);
  --px-ease-push: cubic-bezier(0.2, 0.8, 0.2, 1);
  --px-ease-snap: cubic-bezier(0.2, 0.9, 0.3, 1);
  --px-dur-1: 150ms;
  --px-dur-2: 250ms;
  --px-dur-3: 400ms;
  /* Retired as a spring: everything that used it is a critically damped state change now. */
  --px-spring: var(--px-ease-standard);
  --px-spring-reveal: cubic-bezier(0.34, 1.56, 0.64, 1); /* the reveal's count-up and bars only */
  --px-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --px-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial,
    sans-serif;
  --px-serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --px-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --px-r: 24px;
  --px-r-sm: 16px;
  --px-focus: 0 0 0 3px var(--px-paper), 0 0 0 5px var(--px-accent);
  --px-safe-t: env(safe-area-inset-top, 0px);
  --px-safe-b: env(safe-area-inset-bottom, 0px);
  --px-safe-l: env(safe-area-inset-left, 0px);
  --px-safe-r: env(safe-area-inset-right, 0px);
}

/* Dark is an override; light paper is the default. You -> Appearance (redesign.js) can pin either:
   html[data-px-theme='light'] keeps paper on a dark system, html[data-px-theme='dark'] uses the
   dark palette on a light one; without the attribute the system decides. */
@media (prefers-color-scheme: dark) {
  html:not([data-px-theme='light']) .px,
  html:not([data-px-theme='light']) .px-sheet-host,
  html:not([data-px-theme='light']) .px-toast-host,
  html.px-on:not([data-px-theme='light']) :is(#paymentModal, [data-px-ghost='paymentModal']),
  html.px-on:not([data-px-theme='light']) body {
    --px-paper: #111614;
    --px-paper-2: #18201d;
    --px-card: #1a221f;
    --px-ink: #eef1ec;
    --px-ink2: #c2c8c3;
    --px-muted: #7d8681;
    --px-muted-ink: #a3aba6;
    --px-line: rgba(238, 241, 236, 0.1);
    --px-line-strong: rgba(238, 241, 236, 0.2);
    --px-accent: #7dd87a;
    --px-accent-hover: #93e290;
    --px-accent-tint: rgba(125, 216, 122, 0.14);
    --px-accent-ink: #7dd87a;
    --px-on-accent: #0e1412;
    --px-protein: #ec8a63;
    --px-carbs: #e7c35a;
    --px-fat: #86aee6;
    --px-danger: #ff8a80;
    --px-shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 14px 34px rgba(0, 0, 0, 0.35),
      inset 0 0 0 1px rgba(238, 241, 236, 0.06);
    --px-shadow-lift: 0 26px 54px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(238, 241, 236, 0.08);
  }
}
html[data-px-theme='dark'] .px,
html[data-px-theme='dark'] .px-sheet-host,
html[data-px-theme='dark'] .px-toast-host,
html.px-on[data-px-theme='dark'] :is(#paymentModal, [data-px-ghost='paymentModal']),
html.px-on[data-px-theme='dark'] body {
  --px-paper: #111614;
  --px-paper-2: #18201d;
  --px-card: #1a221f;
  --px-ink: #eef1ec;
  --px-ink2: #c2c8c3;
  --px-muted: #7d8681;
  --px-muted-ink: #a3aba6;
  --px-line: rgba(238, 241, 236, 0.1);
  --px-line-strong: rgba(238, 241, 236, 0.2);
  --px-accent: #7dd87a;
  --px-accent-hover: #93e290;
  --px-accent-tint: rgba(125, 216, 122, 0.14);
  --px-accent-ink: #7dd87a;
  --px-on-accent: #0e1412;
  --px-protein: #ec8a63;
  --px-carbs: #e7c35a;
  --px-fat: #86aee6;
  --px-danger: #ff8a80;
  --px-shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 14px 34px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(238, 241, 236, 0.06);
  --px-shadow-lift: 0 26px 54px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(238, 241, 236, 0.08);
}

/* ------------------------------------------------------------------ first paint */
/* The canvas itself is paper (or the dark paper) from the first frame: the server renders the
   html classes and these sheets (services/redesignFirstPaint.js), so nothing dark from the
   legacy styles can paint first, in either scheme or a pinned Appearance. */
html.px-on {
  background: #faf9f6;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  html.px-on:not([data-px-theme='light']) {
    background: #111614;
    color-scheme: dark;
  }
}
html.px-on[data-px-theme='dark'] {
  background: #111614;
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */
.px {
  /* The dashboard's element rules (body.dash-v2 input, textarea…) read these tokens; inside the
     proposal they resolve to the paper system instead of the dark theme. */
  --surface: var(--px-card);
  --surface-2: var(--px-card);
  --surface-3: var(--px-paper-2);
  --text: var(--px-ink);
  --text-muted: var(--px-ink2);
  --text-subtle: var(--px-muted-ink);
  --border: var(--px-line);
  --border-strong: var(--px-line-strong);
  --accent: var(--px-accent);
  --focus-ring: 0 0 0 3px var(--px-accent-tint);
  background: var(--px-paper);
  color: var(--px-ink);
  font-family: var(--px-sans);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
.px *,
.px *::before,
.px *::after {
  box-sizing: border-box;
}
.px :where(h1, h2, h3, p, ul, ol, fieldset, legend) {
  margin: 0;
  padding: 0;
}
.px :where(button, input, select, textarea) {
  font: inherit;
  color: inherit;
}
.px :where(button) {
  cursor: pointer;
  background: none;
  border: 0;
}
.px em,
.px-pill em {
  font-family: var(--px-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--px-accent);
}
.px :focus-visible {
  outline: none;
  box-shadow: var(--px-focus);
}
.px .px-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.px [hidden] {
  display: none !important;
}

/* ------------------------------------------------------------------ type scale */
.px-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 600 12px/1.3 var(--px-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--px-accent);
}
.px-eyebrow .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--px-accent);
  box-shadow: 0 0 0 5px var(--px-accent-tint);
}
.px-eyebrow.is-muted {
  color: var(--px-muted-ink);
}
.px-h1 {
  font-weight: 650;
  font-size: clamp(34px, 9.2vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.px-h1 em {
  letter-spacing: -0.02em;
}
.px-h2 {
  font-weight: 650;
  font-size: clamp(26px, 6.4vw, 40px);
  line-height: 1.06;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.px-h3 {
  font-weight: 650;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.px-lead {
  font: 400 clamp(16px, 4.2vw, 19px) / 1.45 var(--px-sans);
  color: var(--px-ink2);
  max-width: 40ch;
  text-wrap: pretty;
}
.px-small {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--px-muted-ink);
}
.px-k {
  font: 600 11.5px/1.2 var(--px-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--px-muted-ink);
}
.px-num {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

/* ------------------------------------------------------------------ buttons */
.px-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 16px 26px;
  border-radius: 999px;
  background: var(--px-ink);
  color: var(--px-paper) !important;
  font: 600 16px/1 var(--px-sans);
  letter-spacing: -0.005em;
  box-shadow: 0 12px 28px rgba(18, 26, 27, 0.18);
  transition:
    transform var(--px-dur-1) var(--px-ease-standard),
    background 0.18s,
    box-shadow 0.18s,
    opacity var(--px-dur-1);
  white-space: nowrap;
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
/* Lifts only where there is a real hover (a mouse); on touch a press shrinks and dims. */
@media (hover: hover) and (pointer: fine) {
  .px-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(18, 26, 27, 0.24);
  }
}
.px-btn:active {
  transform: scale(0.97);
  opacity: 0.88;
  transition-duration: 80ms;
}
.px-btn[disabled],
.px-btn[aria-disabled='true'] {
  opacity: 0.55;
  cursor: progress;
  transform: none;
}
.px-btn-accent {
  background: var(--px-accent);
  color: var(--px-on-accent) !important;
  box-shadow: 0 12px 28px rgba(47, 127, 42, 0.28);
}
@media (hover: hover) and (pointer: fine) {
  .px-btn-accent:hover {
    background: var(--px-accent-hover);
  }
}
.px-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 14px 20px;
  border-radius: 999px;
  font: 600 15px/1 var(--px-sans);
  color: var(--px-ink);
  background: color-mix(in srgb, var(--px-card) 70%, transparent);
  box-shadow: inset 0 0 0 1px var(--px-line-strong);
  transition:
    transform var(--px-dur-1) var(--px-ease-standard),
    background var(--px-dur-1),
    opacity var(--px-dur-1);
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) and (pointer: fine) {
  .px-btn-ghost:hover {
    background: var(--px-card);
    transform: translateY(-2px);
  }
}
.px-btn-ghost:active {
  transform: scale(0.97);
  opacity: 0.85;
  transition-duration: 80ms;
}
.px-btn-block {
  width: 100%;
}
.px-btn .arrow {
  transition: transform var(--px-dur-1) var(--px-ease-standard);
}
@media (hover: hover) and (pointer: fine) {
  .px-btn:hover .arrow {
    transform: translateX(3px);
  }
}
.px-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 6px;
  font: 600 14.5px/1.2 var(--px-sans);
  color: var(--px-ink2);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--px-line-strong);
  border-radius: 8px;
}
@media (hover: hover) and (pointer: fine) {
  .px-link:hover {
    color: var(--px-ink);
    text-decoration-color: currentColor;
  }
}
.px-link:active {
  opacity: 0.6;
}

/* ------------------------------------------------------------------ cards */
.px-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: clamp(18px, 4.6vw, 28px);
  border-radius: var(--px-r);
  background: var(--px-card);
  box-shadow: var(--px-shadow);
  transition:
    transform var(--px-dur-2) var(--px-ease-standard),
    box-shadow var(--px-dur-2);
}
@media (hover: hover) and (pointer: fine) {
  .px-card.is-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--px-shadow-lift);
  }
}

/* A large tappable answer (goal, sex). role=radio inside a role=radiogroup. */
.px-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  padding: 14px 16px;
  border-radius: 20px;
  background: var(--px-card);
  box-shadow: var(--px-shadow);
  text-align: left;
  transition:
    transform var(--px-dur-1) var(--px-ease-standard),
    box-shadow 0.18s,
    background 0.18s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) and (pointer: fine) {
  .px-option:hover {
    transform: translateY(-2px);
  }
}
.px-option:active {
  transform: scale(0.98);
  transition-duration: 80ms;
}
.px-option[aria-checked='true'],
.px-option[aria-pressed='true'] {
  box-shadow:
    inset 0 0 0 2px var(--px-accent),
    0 14px 30px rgba(47, 127, 42, 0.14);
}
.px-option .px-ico {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--px-paper-2);
  color: var(--px-ink);
  transition:
    background 0.18s var(--px-ease-standard),
    color 0.18s var(--px-ease-standard);
}
.px-option[aria-checked='true'] .px-ico,
.px-option[aria-pressed='true'] .px-ico {
  background: var(--px-accent);
  color: var(--px-on-accent);
}
.px-option .px-opt-t {
  display: block;
  font-weight: 650;
  font-size: 16.5px;
  letter-spacing: -0.015em;
}
.px-option .px-opt-d {
  display: block;
  margin-top: 2px;
  font-size: 13.5px;
  color: var(--px-ink2);
}
.px-option .px-check {
  margin-left: auto;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--px-line-strong);
  display: grid;
  place-items: center;
  color: transparent;
  transition:
    background 0.18s,
    box-shadow 0.18s,
    color 0.18s;
}
.px-option[aria-checked='true'] .px-check,
.px-option[aria-pressed='true'] .px-check {
  background: var(--px-accent);
  box-shadow: none;
  color: var(--px-on-accent);
}
.px-options {
  display: grid;
  gap: 10px;
}
.px-options.is-two {
  grid-template-columns: 1fr 1fr;
}
.px-options.is-two .px-option {
  flex-direction: column;
  align-items: flex-start;
  min-height: 132px;
  padding: 18px;
}
.px-options.is-two .px-check {
  position: absolute;
  top: 14px;
  right: 14px;
}

/* ------------------------------------------------------------------ segmented control */
.px-seg {
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  border-radius: 999px;
  background: var(--px-paper-2);
  box-shadow: inset 0 0 0 1px var(--px-line);
  max-width: 100%;
}
.px-seg button {
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 999px;
  font: 600 14px/1.1 var(--px-sans);
  color: var(--px-ink2);
  white-space: nowrap;
  transition:
    background 0.25s,
    color 0.2s,
    box-shadow 0.18s,
    transform var(--px-dur-1) var(--px-ease-standard);
  touch-action: manipulation;
}
.px-seg button:active {
  transform: scale(0.96);
}
.px-seg button[aria-checked='true'],
.px-seg button[aria-pressed='true'] {
  background: var(--px-card);
  color: var(--px-ink);
  box-shadow: 0 2px 8px rgba(18, 26, 27, 0.12);
}
.px-seg.is-block {
  display: flex;
  width: 100%;
}
.px-seg.is-block button {
  flex: 1;
  min-height: 48px;
}

/* ------------------------------------------------------------------ chips */
.px-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.px-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--px-card);
  box-shadow: inset 0 0 0 1px var(--px-line-strong);
  font: 550 14.5px/1.1 var(--px-sans);
  color: var(--px-ink);
  transition:
    background 0.2s,
    color 0.2s,
    box-shadow 0.2s,
    transform var(--px-dur-1) var(--px-ease-standard);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.px-chip:active {
  transform: scale(0.96);
  transition-duration: 80ms;
}
.px-chip[aria-pressed='true'] {
  background: var(--px-accent);
  color: var(--px-on-accent);
  box-shadow: none;
}
.px-chip[aria-pressed='true'].is-avoid {
  background: var(--px-ink);
  color: var(--px-paper);
}
.px-chip .px-chip-mark {
  font-weight: 700;
}
.px .px-input {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border-radius: 16px !important;
  border: 0 !important;
  background: var(--px-card) !important;
  box-shadow: inset 0 0 0 1px var(--px-line-strong);
  font: 400 16px/1.4 var(--px-sans) !important;
  color: var(--px-ink) !important;
}
.px .px-input:focus {
  box-shadow: inset 0 0 0 2px var(--px-accent) !important;
}
.px-input::placeholder {
  color: var(--px-muted-ink);
}
textarea.px-input {
  min-height: 92px;
  resize: vertical;
}

/* ------------------------------------------------------------------ progress, skeleton */
.px-progress {
  position: relative;
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--px-line);
  overflow: hidden;
}
.px-progress > i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  border-radius: inherit;
  background: var(--px-accent);
  transform-origin: left center;
  transform: scaleX(var(--p, 0));
  transition: transform 0.3s var(--px-ease-standard);
}
.px-skel {
  border-radius: 12px;
  background:
    linear-gradient(
        90deg,
        transparent 0,
        color-mix(in srgb, var(--px-card) 70%, transparent) 50%,
        transparent 100%
      )
      0 0 / 200% 100% no-repeat,
    var(--px-paper-2);
  animation: px-shimmer 1.4s linear infinite;
}
@keyframes px-shimmer {
  from {
    background-position:
      150% 0,
      0 0;
  }
  to {
    background-position:
      -50% 0,
      0 0;
  }
}

/* ------------------------------------------------------------------ motion */
/* Something appearing: a fade and an 8px rise (toasts, the docked energy bar, tips). */
@keyframes px-pop {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
/* The reveal's plate and meal cards only: the one place a spring is allowed. */
@keyframes px-pop-reveal {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes px-toast-in {
  from {
    opacity: 0;
    transform: translate3d(0, 8px, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes px-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
/* Content marked data-rv fades in once as it enters view: opacity only, 200ms, no stagger and
   no blur on phones; a short rise on wide screens. Hidden only while JS is running. Inside the
   onboarding flow it is simply there: the step's push is the motion. */
html.px-js .px [data-rv] {
  opacity: 0;
  transition: opacity 0.2s var(--px-ease-standard);
}
html.px-js .px [data-rv].is-in {
  opacity: 1;
}
html.px-js .px-flow [data-rv] {
  opacity: 1;
  transition: none;
}
@media (min-width: 900px) and (hover: hover) {
  html.px-js .px:not(.px-flow) [data-rv] {
    transform: translateY(12px);
    transition:
      opacity 0.35s var(--px-ease-standard),
      transform 0.35s var(--px-ease-standard);
    transition-delay: min(var(--d, 0s), 0.12s);
  }
  html.px-js .px:not(.px-flow) [data-rv].is-in {
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  html.px-js .px [data-rv] {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }
  .px *,
  .px *::before,
  .px *::after,
  .px-pill,
  .px-toast,
  html.px-on .modal-shell,
  html.px-on .modal-shell > .modal-panel {
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.001ms !important;
  }
}

/* ------------------------------------------------------------------ sheet */
.px-sheet-host {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-family: var(--px-sans);
  color: var(--px-ink);
}
/* Presented, dragged and dismissed by the sheet engine (public/redesign.js): transform and
   opacity only, set inline. The scrim has no blur (it fades with the drag). */
.px-sheet-host {
  overscroll-behavior: contain;
}
.px-sheet-host.is-closing {
  pointer-events: none;
}
.px-sheet-scrim {
  position: absolute;
  inset: 0;
  background: rgba(18, 26, 27, 0.42);
  touch-action: none;
}
.px-sheet {
  position: relative;
  width: min(100%, 560px);
  max-height: min(92dvh, 900px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px max(22px, var(--px-safe-r)) calc(22px + var(--px-safe-b)) max(22px, var(--px-safe-l));
  border-radius: 28px 28px 0 0;
  background: var(--px-paper);
  /* The second shadow is the panel's paper continuing under the bottom edge, so the short
     resisted pull upward never shows a gap. */
  box-shadow:
    0 -18px 50px rgba(18, 26, 27, 0.22),
    0 48px 0 0 var(--px-paper);
  will-change: transform;
}
.px-sheet.is-dragging {
  transition: none;
}
/* A 44px handle: drag it, or tap it to close. */
.px-sheet-handle {
  display: block;
  width: 100%;
  height: 44px;
  margin: 0 0 -6px;
  touch-action: none;
  cursor: grab;
  border-radius: 12px;
  -webkit-tap-highlight-color: transparent;
}
.px-sheet-handle::before {
  content: '';
  display: block;
  width: 40px;
  height: 5px;
  margin: 6px auto 0;
  border-radius: 999px;
  background: var(--px-line-strong);
}
@media (min-width: 720px) {
  .px-sheet-host {
    align-items: center;
  }
  .px-sheet {
    border-radius: 28px;
    padding-bottom: 26px;
    box-shadow: 0 30px 80px rgba(18, 26, 27, 0.28);
  }
}

/* ------------------------------------------------------------------ toast */
.px-toast-host {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(96px + var(--px-safe-b));
  z-index: 10060;
  display: grid;
  justify-items: center;
  gap: 8px;
  pointer-events: none;
}
.px-toast {
  pointer-events: auto;
  max-width: min(92vw, 420px);
  padding: 13px 18px;
  border-radius: 999px;
  background: var(--px-ink);
  color: var(--px-paper);
  font: 550 14.5px/1.35 var(--px-sans);
  box-shadow: 0 18px 40px rgba(18, 26, 27, 0.3);
  animation: px-toast-in 0.22s ease-out both;
}
.px-toast.has-action {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 6px 6px 18px;
}
.px-toast-action {
  flex: none;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--px-accent-hover);
  font: 650 14.5px/1 var(--px-sans);
  cursor: pointer;
}
.px-toast-action:active {
  opacity: 0.7;
}
.px-toast-host .px-toast-action {
  color: #a8e6a5;
}

/* ------------------------------------------------------------------ proposal pill */
.px-pill {
  position: fixed;
  left: 0;
  right: 0;
  margin: 0 auto;
  bottom: calc(16px + var(--px-safe-b));
  z-index: 10030; /* above the flow, under sheets and the plan modal */
  width: fit-content;
  max-width: calc(100vw - 20px);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(18, 26, 27, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 18px 40px rgba(18, 26, 27, 0.3);
  font: 600 12.5px/1 var(--px-sans);
  color: #fff;
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  animation: px-pop 0.25s 0.4s var(--px-ease-standard) both;
}
.px-pill::-webkit-scrollbar {
  display: none;
}
.px-pill a,
.px-pill button {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  font: inherit;
  color: rgba(255, 255, 255, 0.76) !important;
  text-decoration: none;
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) {
  .px-pill a:hover,
  .px-pill button:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.1);
  }
}
.px-pill a:active,
.px-pill button:active {
  background: rgba(255, 255, 255, 0.14);
}
.px-pill .on {
  background: #fff;
  color: #121a1b !important;
}
.px-pill :focus-visible {
  outline: 2px solid #7dd87a;
  outline-offset: 1px;
}
.px-pill-k {
  flex: none;
  padding: 0 10px 0 12px;
  font: 600 10.5px/1 var(--px-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7dd87a;
}
.px-pill .px-pill-cur {
  color: #a8e6a5 !important;
}
.px-pill-sep {
  flex: none;
  width: 1px;
  height: 18px;
  margin: 0 3px;
  background: rgba(255, 255, 255, 0.18);
}
.px-pill .px-pill-screens {
  color: #fff !important;
  font-weight: 650;
}
.px-pill-sheet {
  display: grid;
  gap: 12px;
}
.px-pill-list {
  display: grid;
  gap: 8px;
}
.px-pill-list .px-option {
  min-height: 52px;
  font-weight: 650;
}
.px-pill-list .px-option.on {
  box-shadow: inset 0 0 0 2px var(--px-accent);
}
@media (prefers-color-scheme: dark) {
  html:not([data-px-theme='light']) .px-pill {
    box-shadow:
      0 18px 40px rgba(0, 0, 0, 0.4),
      inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  }
}
html[data-px-theme='dark'] .px-pill {
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.4),
    inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
/* While the full-screen flow is open the pill docks as a thin strip at the top, out of the
   thumb zone, so the sticky primary button stays where a real user will find it. */
html.px-flow-open .px-pill {
  top: calc(6px + var(--px-safe-t));
  bottom: auto;
  padding: 3px;
  font-size: 11.5px;
  animation: none;
}
html.px-flow-open .px-pill a,
html.px-flow-open .px-pill button {
  min-height: 28px;
  padding: 0 9px;
}
@media (max-width: 640px) {
  .px-pill-k,
  .px-pill-k + .px-pill-sep {
    display: none;
  }
}

/* ------------------------------------------------------------------ full-screen flow */
html.px-flow-open,
html.px-flow-open body {
  overflow: hidden !important;
}
.px-flow {
  --px-pill-space: 0px;
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100vh;
  height: 100dvh;
  padding: calc(var(--px-safe-t) + var(--px-pill-space)) var(--px-safe-r) 0 var(--px-safe-l);
  overflow: hidden;
  animation: px-fade 0.25s linear both;
}
html.px-has-pill .px-flow {
  --px-pill-space: 40px;
}
.px-flow-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100%, 680px);
  margin: 0 auto;
  padding: 10px 16px 6px;
}
.px-back {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--px-ink);
  background: var(--px-card);
  box-shadow: var(--px-shadow);
  transition:
    transform var(--px-dur-1) var(--px-ease-standard),
    opacity var(--px-dur-1);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) and (pointer: fine) {
  .px-back:hover {
    transform: translateX(-2px);
  }
}
.px-back:active {
  transform: scale(0.94);
  transition-duration: 80ms;
}
.px-back[aria-hidden='true'] {
  visibility: hidden;
}
.px-count {
  flex: none;
  min-width: 44px;
  text-align: right;
  font: 600 12.5px/1 var(--px-mono);
  letter-spacing: 0.06em;
  color: var(--px-muted-ink);
}
.px-skip {
  flex: none;
  min-height: 44px;
  min-width: 48px;
  padding: 0 4px 0 8px;
  font: 600 14px/1 var(--px-sans);
  color: var(--px-ink2);
  border-radius: 10px;
}
.px-brand {
  display: none;
  align-items: center;
  gap: 8px;
  font: 650 18px/1 var(--px-sans);
  letter-spacing: -0.03em;
  color: var(--px-ink);
  text-decoration: none;
}
.px-brand img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
}
.px-stage {
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  /* The footer (energy bar, button, safe area) is its own grid row, so nothing scrolls under it.
     Content leaving the stage fades instead of being sliced, and focus or scroll-into-view stops
     clear of that fade. */
  scroll-padding-bottom: 40px;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent);
}
.px-step {
  width: min(100%, 680px);
  min-height: 100%;
  margin: 0 auto;
  /* Bottom padding clears the stage's fade, so the last line always ends fully visible. */
  padding: 18px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.px-step.is-leaving {
  position: absolute;
  inset: 0 0 auto 0;
  pointer-events: none;
}
.px-step-head {
  display: grid;
  gap: 12px;
}
.px-step-head h1:focus {
  outline: none;
  box-shadow: none;
}
.px-flow-foot {
  width: min(100%, 680px);
  margin: 0 auto;
  padding: 12px 20px calc(14px + var(--px-safe-b));
  display: grid;
  gap: 2px;
  justify-items: center;
  background: linear-gradient(to bottom, transparent, var(--px-paper) 22%);
}
.px-flow-foot .px-btn {
  width: 100%;
  min-height: 56px;
  font-size: 16.5px;
}
.px-error {
  min-height: 1.3em;
  font: 550 14px/1.4 var(--px-sans);
  color: var(--px-danger);
  text-align: center;
}
.px-privacy {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--px-ink2);
}
.px-privacy svg {
  flex: none;
  color: var(--px-accent);
}
.px-group {
  display: grid;
  gap: 12px;
  border: 0;
}
.px-group > legend {
  margin-bottom: 10px;
}
.px-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.px-note {
  font-size: 14px;
  line-height: 1.45;
  color: var(--px-ink2);
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--px-paper-2);
}

@media (min-width: 900px) {
  .px-step[data-step='size'] {
    padding-top: clamp(12px, 3vh, 32px);
  }
  .px-step[data-step='size'] .px-h1 {
    font-size: clamp(34px, 3.2vw, 46px);
  }
  .px-brand {
    display: inline-flex;
  }
  .px-flow-head {
    width: min(100%, 1120px);
    padding: 22px 32px 10px;
    gap: 24px;
  }
  .px-flow-head .px-progress {
    max-width: 420px;
    margin: 0 auto;
  }
  .px-step {
    padding-top: clamp(28px, 6vh, 64px);
    gap: 28px;
  }
  .px-h1 {
    font-size: clamp(44px, 4.6vw, 64px);
  }
  .px-flow-foot {
    padding-bottom: 32px;
  }
  .px-flow-foot .px-btn {
    width: auto;
    min-width: 280px;
  }
}

/* ------------------------------------------------------------------ age stepper */
.px-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border-radius: 22px;
  background: var(--px-card);
  box-shadow: var(--px-shadow);
}
.px-stepper button.px-step-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--px-paper-2);
  color: var(--px-ink);
  font: 500 28px/1 var(--px-sans);
  transition:
    transform var(--px-dur-1) var(--px-ease-standard),
    background var(--px-dur-1);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.px-stepper button.px-step-btn:active {
  transform: scale(0.92);
  transition-duration: 80ms;
}
.px-stepper-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}
.px .px-stepper-value input {
  width: 3.2ch;
  min-height: 56px;
  padding: 0;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none;
  text-align: center;
  font: 650 44px/1 var(--px-sans) !important;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--px-ink) !important;
  border-radius: 10px !important;
  -moz-appearance: textfield;
}
.px .px-stepper-value input::placeholder {
  color: var(--px-muted) !important;
}
.px-stepper-value input::-webkit-outer-spin-button,
.px-stepper-value input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.px-stepper-value span {
  font-size: 15px;
  color: var(--px-ink2);
}

/* ------------------------------------------------------------------ ruler slider */
.px-measure {
  display: grid;
  gap: 6px;
}
.px-measure-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.px-readout {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-height: 52px;
  padding: 0 6px;
  margin: 0 -6px;
  border-radius: 12px;
  font: 650 44px/1.1 var(--px-sans);
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  color: var(--px-ink);
  cursor: text;
}
.px-readout small {
  font-size: 17px;
  font-weight: 550;
  letter-spacing: -0.01em;
  color: var(--px-ink2);
}
.px-readout.is-suggested {
  color: var(--px-ink2);
}
.px-type {
  display: flex;
  align-items: center;
  gap: 8px;
}
.px .px-type input {
  width: 5.2ch;
  min-height: 52px;
  padding: 6px 10px;
  border: 0 !important;
  border-radius: 12px !important;
  background: var(--px-card) !important;
  box-shadow: inset 0 0 0 2px var(--px-accent) !important;
  font: 650 30px/1 var(--px-sans) !important;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--px-ink);
}
.px-type span {
  font-size: 16px;
  color: var(--px-ink2);
}
.px-ruler {
  position: relative;
  height: 76px;
  border-radius: 18px;
  background: var(--px-card);
  box-shadow: var(--px-shadow);
  overflow: hidden;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.px-ruler.is-dragging {
  cursor: grabbing;
}
.px-ruler::before,
.px-ruler::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 18%;
  z-index: 2;
  pointer-events: none;
}
.px-ruler::before {
  left: 0;
  background: linear-gradient(to right, var(--px-card), transparent);
}
.px-ruler::after {
  right: 0;
  background: linear-gradient(to left, var(--px-card), transparent);
}
.px-ruler-track {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  will-change: transform;
  background-image: linear-gradient(to right, var(--px-line-strong) 1.5px, transparent 1.5px),
    linear-gradient(to right, var(--px-muted) 2px, transparent 2px);
  background-size:
    var(--u) 18px,
    calc(var(--u) * var(--major)) 32px;
  background-repeat: repeat-x;
  background-position:
    0 14px,
    0 14px;
}
.px-ruler-track span {
  position: absolute;
  top: 50px;
  transform: translateX(-50%);
  font: 600 11.5px/1 var(--px-sans);
  color: var(--px-muted-ink);
  font-variant-numeric: tabular-nums;
}
.px-ruler-needle {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 8px;
  width: 4px;
  height: 42px;
  margin-left: -2px;
  border-radius: 999px;
  background: var(--px-accent);
  box-shadow: 0 0 0 4px var(--px-accent-tint);
  pointer-events: none;
}
.px-ruler:focus-visible {
  box-shadow: var(--px-focus);
}
.px-hint {
  font-size: 12.5px;
  color: var(--px-muted-ink);
}

/* The size step fits a phone: compact readouts, and the live energy stays in view while the
   rulers move (sticky to the bottom of the scrolling stage). */
.px-step[data-step='size'] {
  gap: 18px;
}
.px-step[data-step='size'] .px-readout {
  font-size: clamp(34px, 9.5vw, 44px);
  min-height: 46px;
}
.px-step[data-step='size'] .px-ruler {
  height: 70px;
}
.px-step[data-step='size'] .px-hint {
  flex: 1 1 160px;
  text-align: right;
}
@media (max-width: 420px) {
  .px-step[data-step='size'] .px-hint {
    text-align: left;
  }
}

/* "Is that right?" on the size step is a confirmation, not an error: neutral ink, and the
   rulers still at their starting point get a gentle accent ring. */
.px-error.is-hint {
  color: var(--px-ink2);
}
.px-ruler.is-unconfirmed {
  box-shadow:
    var(--px-shadow),
    0 0 0 2px var(--px-accent);
}

/* Fields in the flow scroll clear of the footer; with the keyboard up (html.px-kb-open, from
   public/redesign.js) the flow fits the visible area and its footer keeps only the button. */
.px-flow :is(input, textarea, select, .px-type) {
  scroll-margin-top: 16px;
  scroll-margin-bottom: 32px;
}
html.px-kb-open .px-flow {
  top: var(--px-vvt, 0px);
  bottom: auto;
  height: var(--px-vvh, 100dvh);
}
html.px-kb-open .px-flow .px-energy-slot,
html.px-kb-open .px-flow .px-flow-foot .px-link {
  display: none;
}

/* Short phones (iPhone SE 375×667, Safari with its bars 390×664, Android 360×740): a compact
   flow so both rulers, the live energy and Continue fit without scrolling, and the age stepper
   sits clear of the footer. */
@media (max-height: 760px) {
  .px-flow-head {
    padding: 6px 16px 2px;
  }
  .px-flow-head .px-back {
    width: 44px;
    height: 44px;
  }
  .px-step {
    padding: 8px 20px 24px;
    gap: 14px;
  }
  .px-step .px-h1 {
    font-size: clamp(26px, 7.4vw, 32px);
  }
  .px-step .px-lead {
    font-size: 15px;
  }
  .px-flow-foot {
    padding: 8px 20px calc(8px + var(--px-safe-b));
  }
  .px-flow-foot .px-btn {
    min-height: 52px;
  }
  .px-flow-foot .px-error:empty {
    min-height: 0;
  }
  /* About you: the sex choices are rows, the stepper a little smaller. */
  .px-step:is([data-step='you'], [data-step='whoami']) .px-options.is-two .px-option {
    flex-direction: row;
    align-items: center;
    min-height: 64px;
    padding: 10px 14px;
  }
  .px-step:is([data-step='you'], [data-step='whoami']) .px-options.is-two .px-check {
    position: static;
    margin-left: auto;
  }
  .px-step:is([data-step='you'], [data-step='whoami']) .px-group {
    gap: 8px;
  }
  .px-stepper {
    padding: 6px;
  }
  .px-stepper button.px-step-btn {
    width: 48px;
    height: 48px;
  }
  .px .px-stepper-value input {
    min-height: 48px;
    font-size: 36px !important;
  }
  /* Height and weight: the progress bar names the step, so the eyebrow and hint line go. */
  .px-step[data-step='size'] {
    gap: 10px;
  }
  .px-step[data-step='size'] .px-eyebrow,
  .px-step[data-step='size'] .px-hint {
    display: none;
  }
  .px-step[data-step='size'] .px-group {
    gap: 8px;
  }
  .px-step[data-step='size'] .px-measure {
    gap: 4px;
  }
  .px-step[data-step='size'] .px-readout {
    font-size: 30px;
    min-height: 44px; /* it is the tap target for typing the value */
  }
  .px-step[data-step='size'] .px-readout small {
    font-size: 14px;
  }
  .px-step[data-step='size'] .px-ruler {
    height: 56px;
  }
  .px-step[data-step='size'] .px-ruler-track {
    background-size:
      var(--u) 12px,
      calc(var(--u) * var(--major)) 22px;
  }
  .px-step[data-step='size'] .px-ruler-track span {
    top: 39px;
  }
  .px-step[data-step='size'] .px-ruler-needle {
    top: 6px;
    height: 32px;
  }
  /* The live energy as a one-line strip above the button. */
  .px-energy-slot {
    margin-bottom: 6px;
  }
  .px-flow-foot .px-energy.is-bar {
    min-height: 44px;
    padding: 7px 16px;
    border-radius: 16px;
  }
  .px-flow-foot .px-energy.is-bar > div:not(.px-energy-goal) {
    display: grid;
    gap: 1px;
    min-width: 0;
  }
  .px-flow-foot .px-energy.is-bar .px-k {
    font-size: 10px;
    letter-spacing: 0.1em;
  }
  .px-flow-foot .px-energy.is-bar .px-energy-value {
    font-size: 20px;
    white-space: nowrap;
  }
  .px-flow-foot .px-energy.is-bar .px-energy-value small {
    font-size: 13px;
  }
  .px-flow-foot .px-energy-goal {
    font-size: 11.5px;
  }
  .px-flow-foot .px-energy-goal b {
    font-size: 15px;
  }
}

/* Landscape phones: a short head, the button and its link side by side, the rulers side by
   side, and the energy a single line, so the heading, the rulers and Continue fit. */
@media (max-height: 500px) {
  .px-flow-head {
    padding: 2px 16px 0;
  }
  .px-step {
    padding: 4px 20px 16px;
    gap: 10px;
  }
  .px-step .px-h1 {
    font-size: 24px;
  }
  .px-step .px-lead {
    font-size: 14px;
  }
  .px-step .px-eyebrow {
    display: none;
  }
  .px-flow-foot {
    width: min(100%, 820px);
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 12px;
    padding: 4px max(20px, var(--px-safe-r)) calc(6px + var(--px-safe-b))
      max(20px, var(--px-safe-l));
  }
  .px-flow-foot > .px-energy-slot,
  .px-flow-foot > .px-error {
    grid-column: 1 / -1;
  }
  .px-flow-foot .px-btn {
    min-height: 48px;
  }
  .px-step[data-step='size'] > .px-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .px-step[data-step='size'] .px-step-head {
    gap: 0;
  }
  .px-flow-foot .px-energy.is-bar {
    min-height: 40px;
    padding: 5px 16px;
  }
  .px-flow-foot .px-energy-goal {
    display: flex;
    align-items: baseline;
    gap: 6px;
  }
  .px-options.is-two .px-option {
    min-height: 64px;
  }
}

/* ------------------------------------------------------------------ live energy card */
.px-energy {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 4px;
  padding: 18px 20px;
  border-radius: var(--px-r);
  background: var(--px-ink);
  color: #fff;
  box-shadow: 0 18px 40px rgba(18, 26, 27, 0.22);
}
.px-energy .px-k {
  color: rgba(255, 255, 255, 0.7);
}
.px-energy-value {
  font: 650 clamp(30px, 8.4vw, 40px) / 1.05 var(--px-sans);
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}
.px-energy-value em {
  color: #a8e6a5;
}
.px-energy p {
  font-size: 13.5px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.78);
}
.px-energy-glow {
  position: absolute;
  right: -40px;
  top: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(125, 216, 122, 0.35), transparent 65%);
  pointer-events: none;
}
@media (prefers-color-scheme: dark) {
  html:not([data-px-theme='light']) .px .px-energy {
    background: #223028;
  }
}
html[data-px-theme='dark'] .px .px-energy {
  background: #223028;
}

/* The docked bar above the button on the size step. */
.px-energy-slot {
  width: 100%;
  margin-bottom: 8px;
}
.px-energy.is-bar {
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 14px;
  padding: 12px 18px;
  border-radius: 20px;
  animation: px-pop 0.25s var(--px-ease-standard) both;
}
.px-energy.is-bar .px-energy-value {
  font-size: 28px;
}
.px-energy.is-bar .px-energy-value small {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.8);
}
.px-energy-goal {
  display: grid;
  justify-items: end;
  gap: 2px;
  text-align: right;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.78);
}
.px-energy-goal b {
  font-size: 16px;
  color: #a8e6a5;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ------------------------------------------------------------------ building */
.px-build {
  display: grid;
  gap: 26px;
  align-content: start;
}
.px-pot {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--px-card);
  box-shadow: var(--px-shadow);
}
.px-pot svg {
  animation: px-spin 6s linear infinite;
}
@keyframes px-spin {
  to {
    transform: rotate(360deg);
  }
}
.px-stages {
  list-style: none;
  display: grid;
  gap: 10px;
}
.px-stage-row {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border-radius: 20px;
  background: var(--px-card);
  box-shadow: var(--px-shadow);
  opacity: 0.55;
  transition:
    opacity 0.25s,
    transform 0.25s var(--px-ease-standard);
}
.px-stage-row.is-active,
.px-stage-row.is-done {
  opacity: 1;
}
.px-stage-row.is-active {
  transform: scale(1.01);
}
.px-stage-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--px-paper-2);
  color: var(--px-muted-ink);
}
.px-stage-row.is-active .px-stage-dot {
  background: var(--px-accent-tint);
  color: var(--px-accent);
}
.px-stage-row.is-active .px-stage-dot i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--px-accent);
  animation: px-breathe 1.2s var(--px-ease) infinite alternate;
}
@keyframes px-breathe {
  from {
    transform: scale(0.7);
    opacity: 0.6;
  }
  to {
    transform: scale(1.15);
    opacity: 1;
  }
}
.px-stage-row.is-done .px-stage-dot {
  background: var(--px-accent);
  color: var(--px-on-accent);
}
.px-stage-t {
  font-weight: 650;
  font-size: 16px;
  letter-spacing: -0.015em;
}
.px-stage-d {
  margin-top: 3px;
  font-size: 13.5px;
  color: var(--px-ink2);
}
.px-stage-d b {
  color: var(--px-ink);
  font-variant-numeric: tabular-nums;
}
.px-tip {
  display: grid;
  gap: 6px;
  min-height: 92px;
  padding: 16px 18px;
  border-radius: 20px;
  background: var(--px-paper-2);
}
.px-tip p {
  font-size: 15px;
  line-height: 1.45;
  color: var(--px-ink);
  animation: px-pop 0.25s var(--px-ease-standard) both;
}

/* ------------------------------------------------------------------ reveal */
.px-reveal {
  display: grid;
  gap: 26px;
}
.px-targets {
  display: grid;
  gap: 14px;
  padding: 22px 20px;
  border-radius: 28px;
  background: var(--px-card);
  box-shadow: var(--px-shadow);
}
.px-kcal {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font: 650 clamp(56px, 17vw, 96px) / 0.95 var(--px-sans);
  letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
}
.px-kcal small {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--px-ink2);
}
.px-why {
  font-size: 15px;
  line-height: 1.45;
  color: var(--px-ink2);
  text-wrap: pretty;
}
.px-macros {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.px-macro {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 16px;
  background: var(--px-paper-2);
}
.px-macro b {
  font: 650 22px/1 var(--px-sans);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.px-macro b small {
  font-size: 13px;
  font-weight: 600;
  color: var(--px-ink2);
}
.px-macro span {
  font-size: 12.5px;
  color: var(--px-ink2);
}
.px-macro i {
  display: block;
  height: 5px;
  border-radius: 999px;
  background: var(--c);
  transform-origin: left;
  transform: scaleX(var(--w, 0));
  transition: transform 1.1s var(--px-spring-reveal) 0.25s;
}
.px-plate-card {
  position: relative;
  margin: 0;
}
.px-plate-card figcaption {
  position: absolute;
  z-index: 1;
  top: 16px;
  left: 18px;
}
.px-plate-wrap {
  position: relative;
  height: 200px;
  border-radius: 28px;
  overflow: hidden;
  background: var(--px-paper-2);
}
.px-plate-wrap canvas,
.px-plate-wrap svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.px-meals {
  display: grid;
  gap: 12px;
}
.px-meal {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px 12px 12px;
  border-radius: 22px;
  background: var(--px-card);
  box-shadow: var(--px-shadow);
}
.px-meal-art {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--px-paper-2);
}
.px-meal-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.px-meal-type {
  font: 600 11px/1.2 var(--px-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--px-muted-ink);
}
.px-meal-name {
  margin-top: 3px;
  font-weight: 650;
  font-size: 15.5px;
  line-height: 1.25;
  letter-spacing: -0.015em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.px-meal-macros {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--px-ink2);
  font-variant-numeric: tabular-nums;
}
.px-meal-kcal {
  font: 650 17px/1 var(--px-sans);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.px-meal-kcal small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--px-muted-ink);
}
.px-pop-in {
  animation: px-pop-reveal 0.62s var(--px-spring-reveal) both;
  animation-delay: var(--d, 0s);
}
.px-week {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(78%, 280px);
  gap: 12px;
  margin: 0 -20px;
  padding: 4px 20px 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 20px;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.px-week::-webkit-scrollbar {
  display: none;
}
.px-day {
  scroll-snap-align: start;
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 16px;
  border-radius: 22px;
  background: var(--px-card);
  box-shadow: var(--px-shadow);
}
.px-day.is-today {
  box-shadow:
    inset 0 0 0 2px var(--px-accent),
    var(--px-shadow);
}
.px-day-name {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-weight: 650;
  font-size: 16px;
}
.px-day-name small {
  font: 600 12px/1 var(--px-sans);
  color: var(--px-muted-ink);
  font-variant-numeric: tabular-nums;
}
.px-day ul {
  list-style: none;
  display: grid;
  gap: 7px;
}
.px-day li {
  font-size: 13.5px;
  line-height: 1.3;
  color: var(--px-ink2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.px-day li b {
  color: var(--px-ink);
  font-weight: 600;
}
.px-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: -6px;
}
.px-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--px-line-strong);
  transition:
    width 0.2s var(--px-ease-standard),
    background 0.2s;
}
.px-dots i.on {
  width: 18px;
  border-radius: 999px;
  background: var(--px-accent);
}

/* ------------------------------------------------------------------ offers */
.px-trial {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: 26px;
  background: var(--px-accent);
  color: var(--px-on-accent);
  box-shadow: 0 18px 40px rgba(47, 127, 42, 0.3);
}
.px-trial h2 {
  font-weight: 650;
  font-size: clamp(24px, 6.6vw, 32px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}
.px-trial h2 em {
  color: inherit;
}
.px-trial ul,
.px-pro ul {
  list-style: none;
  display: grid;
  gap: 8px;
}
.px-trial li,
.px-pro li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  font-size: 15px;
  line-height: 1.35;
}
.px-trial li svg {
  margin-top: 1px;
}
.px-trial .px-small {
  /* Full-strength text: white on basil is 5.0:1, any transparency drops it under AA. */
  color: inherit;
}
.px-trial .px-link {
  color: inherit;
  text-decoration-color: currentColor;
  justify-self: start;
  padding-left: 0;
}
.px-confetti {
  position: absolute;
  right: 14px;
  top: 14px;
  opacity: 0.9;
}
.px-pro {
  display: grid;
  gap: 14px;
  padding: 22px 20px;
  border-radius: 26px;
  background: var(--px-card);
  box-shadow: var(--px-shadow);
}
.px-pro li svg {
  color: var(--px-accent);
  margin-top: 1px;
}
.px-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
}
.px-price b {
  font: 650 30px/1 var(--px-sans);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.px-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--px-accent-tint);
  color: var(--px-accent-ink);
  font: 700 12px/1 var(--px-sans);
  letter-spacing: 0.02em;
}
.px-free-keeps {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--px-ink2);
  padding-top: 12px;
  border-top: 1px solid var(--px-line);
}
.px-credit {
  text-align: center;
  font-size: 12.5px;
  color: var(--px-muted-ink);
}
.px-credit a {
  color: inherit;
  text-underline-offset: 3px;
}

@media (min-width: 900px) {
  .px-step.is-wide {
    width: min(100%, 1120px);
  }
  .px-reveal-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
  }
  .px-week {
    grid-auto-columns: 240px;
    margin: 0;
    padding: 4px 0 16px;
  }
}

/* ------------------------------------------------------------------ payment modal as a sheet */
/* Flag on only: the existing payment modal and PayPal flow, restyled in the paper system and
   presented as a bottom sheet on phones. Its markup, listeners and checkout are unchanged. */
html.px-on :is(#paymentModal, [data-px-ghost='paymentModal']) {
  /* Above the full-screen flow, so the reveal's plan sheet opens over it. */
  z-index: 10040;
  --surface: var(--px-paper);
  --surface-2: var(--px-card);
  --surface-3: var(--px-paper-2);
  --text: var(--px-ink);
  --text-muted: var(--px-ink2);
  --text-subtle: var(--px-muted-ink);
  --border: var(--px-line);
  --border-strong: var(--px-line-strong);
  --accent: var(--px-accent);
  --accent-strong: var(--px-accent);
  --accent-soft: var(--px-accent-tint);
  --success: var(--px-accent);
  --gold: #7a5a00;
  font-family: var(--px-sans);
  background: rgba(18, 26, 27, 0.42);
}
html.px-on :is(#paymentModal, [data-px-ghost='paymentModal']) .modal-panel {
  border: 0;
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(18, 26, 27, 0.28);
}
html.px-on :is(#paymentModal, [data-px-ghost='paymentModal']) .modal-title {
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.035em;
}
html.px-on :is(#paymentModal, [data-px-ghost='paymentModal']) .plan-option {
  border-radius: 20px;
  box-shadow: var(--px-shadow);
  border-color: transparent;
}
html.px-on :is(#paymentModal, [data-px-ghost='paymentModal']) .plan-option.recommended,
html.px-on :is(#paymentModal, [data-px-ghost='paymentModal']) .plan-option.is-preselected {
  border-color: var(--px-accent);
  box-shadow:
    inset 0 0 0 1px var(--px-accent),
    0 14px 30px rgba(47, 127, 42, 0.14);
}
html.px-on :is(#paymentModal, [data-px-ghost='paymentModal']) .badge-gold {
  background: #f8edcc;
  border-color: transparent;
}
html.px-on :is(#paymentModal, [data-px-ghost='paymentModal']) .badge-accent,
html.px-on :is(#paymentModal, [data-px-ghost='paymentModal']) .badge-success {
  background: var(--px-accent-tint);
  color: var(--px-accent-ink);
  border-color: transparent;
}
html.px-on :is(#paymentModal, [data-px-ghost='paymentModal']) .modal-panel::before {
  content: none;
}
/* Plans first (annual on top), the Free/Pro comparison underneath. Same elements, same order in
   the DOM; only the visual order changes. */
html.px-on
  :is(#paymentModal, [data-px-ghost='paymentModal'])
  :is(#plan-selection, [data-px-ghost-id='plan-selection']):not(.hidden) {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
html.px-on
  :is(#paymentModal, [data-px-ghost='paymentModal'])
  :is(#plan-selection, [data-px-ghost-id='plan-selection'])
  > * {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
html.px-on
  :is(#paymentModal, [data-px-ghost='paymentModal'])
  :is(#plan-selection, [data-px-ghost-id='plan-selection'])
  > .plan-compare {
  order: 2;
}
html.px-on
  :is(#paymentModal, [data-px-ghost='paymentModal'])
  :is(#plan-selection, [data-px-ghost-id='plan-selection'])
  > p {
  order: 3;
}
html.px-on :is(#paymentModal, [data-px-ghost='paymentModal']) .plan-compare {
  column-gap: 0;
  background: var(--px-card);
}
html.px-on :is(#paymentModal, [data-px-ghost='paymentModal']) .plan-compare .head {
  background: var(--px-paper-2);
}
@media (max-width: 640px) {
  html.px-on :is(#paymentModal, [data-px-ghost='paymentModal']) {
    align-items: flex-end;
    padding: 0;
  }
  html.px-on :is(#paymentModal, [data-px-ghost='paymentModal']) .modal-panel {
    max-height: 92dvh;
    border-radius: 28px 28px 0 0;
    padding: 34px max(18px, var(--px-safe-r)) calc(22px + var(--px-safe-b))
      max(18px, var(--px-safe-l));
  }
  html.px-on :is(#paymentModal, [data-px-ghost='paymentModal']) .modal-panel::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    width: 40px;
    height: 5px;
    margin-left: -20px;
    border-radius: 999px;
    background: var(--px-line-strong);
  }
  html.px-on :is(#paymentModal, [data-px-ghost='paymentModal']) .modal-panel.is-dragging {
    transition: none;
  }
}

/* The dashboard's own toasts stay visible above the full-screen flow. */
html.px-flow-open #toast-stack {
  z-index: 10065;
}

/* ------------------------------------------------------------------ print */
@media print {
  .px-pill,
  .px-flow,
  .px-sheet-host,
  .px-toast-host {
    display: none !important;
  }
}
