/* Create meal plan: the question flow.
   Calm and card based: a light neutral page, one question per screen,
   white answer cards, a thin progress bar and one big friendly button. */

#wizard-section,
#pre-pricing-loading {
    --ob-bg: #f6f7f4;
    --ob-ink: #17241e;
    --ob-text: #46544d;
    --ob-muted: #66746d;          /* 4.5:1 on --ob-bg, 4.9:1 on white */
    --ob-faint: #9aa59f;          /* placeholders and idle chips only */
    --ob-line: #e3e7e2;
    --ob-line-strong: #c9d1cb;
    --ob-track: #e2e7e3;
    --ob-icon-bg: #f2f4f0;
    --ob-green: #03875f;          /* 4.5:1 with white text */
    --ob-green-hover: #02734f;
    --ob-green-text: #047857;     /* small green text on --ob-bg (5:1) */
    --ob-sel-bg: #effaf4;
    --ob-sel-border: #059669;
    --ob-sel-ink: #035c41;
    --ob-red: #b42318;
    --ob-red-bg: #fdeceb;
    --ob-macro-p: #059669;        /* protein, carbs, fat: same everywhere */
    --ob-macro-c: #e0a100;
    --ob-macro-f: #d6456c;
    --ob-shadow-sm: 0 1px 2px rgba(23, 36, 30, .05);
    --ob-shadow: 0 1px 2px rgba(23, 36, 30, .04), 0 6px 16px -8px rgba(23, 36, 30, .12);
    --ob-shadow-lg: 0 2px 4px rgba(23, 36, 30, .04), 0 16px 32px -14px rgba(23, 36, 30, .2);
    --ob-ease-out: cubic-bezier(.22, 1, .36, 1);
    --ob-ease-spring: cubic-bezier(.34, 1.56, .64, 1);
    --ob-bar-h: 96px;
}

/* Tailwind's .hidden and this file's display rules have equal weight and
   this file loads later, so pin it: hidden always wins inside the flow. */
#wizard-section .hidden,
#wizard-section.hidden,
#wizard-section [hidden] { display: none !important; }

/* ---------- Page takeover while the flow is on screen ---------- */
html:has(#wizard-section:not(.hidden)),
body:has(#wizard-section:not(.hidden)) { background: #f6f7f4; }
body:has(#wizard-section:not(.hidden)) #main-nav { display: none; }

#wizard-section.ob-app {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--ob-bg);
    color: var(--ob-text);
    -webkit-tap-highlight-color: transparent;
}
#wizard-section button,
#wizard-section a,
#wizard-section label { touch-action: manipulation; }
/* style.css lifts every button 2px on hover. In a list you scan top to
   bottom, that reads as the page twitching under the cursor. */
#wizard-section button:hover { transform: none; }
#wizard-section .selection-card:hover { transform: none; box-shadow: none; }
#wizard-section h2:focus { outline: none; }
#wizard-section button:focus-visible,
#wizard-section a:focus-visible,
#wizard-section .selection-card:has(input:focus-visible) > .ob-opt {
    outline: 2px solid var(--ob-green);
    outline-offset: 3px;
}

/* ---------- Top bar ---------- */
.ob-top {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(246, 247, 244, .92);
    -webkit-backdrop-filter: saturate(1.2) blur(10px);
    backdrop-filter: saturate(1.2) blur(10px);
    padding-top: env(safe-area-inset-top);
}
.ob-top-inner {
    position: relative;
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
}
.ob-icon-btn {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: var(--ob-muted);
    font-size: 19px;
    transition: background-color .15s ease, color .15s ease, transform .1s ease;
}
.ob-icon-btn:hover { background: rgba(23, 36, 30, .06); color: var(--ob-ink); }
#wizard-section .ob-icon-btn:active { transform: scale(.92); }

.ob-progress {
    position: relative;
    flex: 1;
    min-width: 0;
    height: 6px;
    border-radius: 999px;
    background: var(--ob-track);
    overflow: hidden;
}
.ob-progress-fill {
    height: 100%;
    width: 6px;
    border-radius: 999px;
    background: var(--ob-green);
    transition: width .5s var(--ob-ease-out);
}
.ob-progress-shine { display: none; }
.ob-progress-fill.is-bump { animation: obBarGlow .6s ease-out; }
@keyframes obBarGlow {
    0%, 100% { filter: none; }
    35% { filter: brightness(1.25); }
}
/* A right-hand spacer the size of the back button keeps the bar centred. */
.ob-top-inner::after { content: ''; flex: 0 0 44px; }

/* Chapter-complete pill, over the bar. */
.ob-toast {
    position: absolute;
    left: 50%;
    top: calc(50% + env(safe-area-inset-top) / 2);
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px 7px 10px;
    border: 1px solid var(--ob-line);
    border-radius: 999px;
    background: #fff;
    box-shadow: var(--ob-shadow-lg);
    color: var(--ob-sel-ink);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    transform: translate(-50%, -50%) scale(.92);
    pointer-events: none;
    transition: opacity .2s ease, transform .3s var(--ob-ease-out);
}
.ob-toast.is-on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.ob-toast .mm-mascot { width: 24px; }

/* ---------- Main column ---------- */
.ob-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 4px 16px 24px;
    overflow-x: hidden;
    overflow-x: clip;
}
/* Questions start at the same height on every screen, so the page doesn't
   jump as the number of answers changes. */
.ob-stage {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding-top: clamp(4px, 2vh, 20px);
}
/* A few screens are grids of cards that need more room than one column. */
.ob-stage[data-screen="testimonial"] { max-width: 820px; }

.ob-eyebrow {
    margin: 0 0 8px;
    color: var(--ob-green-text);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-align: center;
    text-transform: uppercase;
}
.ob-eyebrow:empty { display: none; }
.ob-top .ob-eyebrow { margin: 0; font-size: 11px; }

#ob-content { position: relative; display: flex; flex-direction: column; flex: 1; }
#wizard-section .ob-screen { width: 100%; min-width: 0; }
#wizard-section .ob-screen:not(.hidden) { display: flex; flex-direction: column; }
/* Centred blocks (mx-auto + max-w-*) would otherwise shrink to their
   content inside the column flexbox. */
#ob-content > .ob-screen > [class*="max-w-"] { width: 100%; }
/* Pip moments sit in the middle of the room they have. */
#wizard-section .ob-screen:has(> .mm-stage):not(.hidden) { flex: 1; justify-content: center; padding-bottom: 4vh; }

/* Question heading block */
#wizard-section .ob-screen h2 {
    color: var(--ob-ink);
    font-size: clamp(1.5rem, 1.2rem + 1.2vw, 1.875rem);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -.02em;
    text-wrap: balance;
}
#wizard-section .ob-screen > .text-center:first-child,
#wizard-section .goal-set .text-center { margin-bottom: 24px; }
#wizard-section .ob-screen > .text-center:first-child p,
#wizard-section .ob-screen > .goal-set .text-center p {
    color: var(--ob-muted);
    font-size: 15px;
    line-height: 1.5;
    max-width: 30rem;
    margin-left: auto;
    margin-right: auto;
    text-wrap: pretty;
}
/* Tailwind's gray-500 is a touch too light on the tinted page. */
#wizard-section .ob-screen .text-gray-500,
#wizard-section .ob-screen p.text-gray-400 { color: var(--ob-muted); }

.ob-reassurance {
    margin: 24px auto 0;
    color: var(--ob-muted);
    font-size: 13px;
    text-align: center;
}

/* ---------- Answer cards ---------- */
#wizard-section .ob-opt {
    position: relative;
    background: #fff;
    border: 1px solid var(--ob-line);
    border-radius: 16px;
    box-shadow: var(--ob-shadow-sm);
    color: var(--ob-ink);
    cursor: pointer;
    transition: transform .12s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease, color .18s ease;
    -webkit-user-select: none;
    user-select: none;
}
#wizard-section button.ob-opt.w-full { min-height: 64px; }
#wizard-section .ob-opt .text-gray-800,
#wizard-section .ob-opt .text-gray-900 { color: var(--ob-ink); transition: color .18s ease; }
#wizard-section .ob-opt .text-gray-400 { color: var(--ob-muted); }
#wizard-section .ob-opt .font-extrabold,
#wizard-section .ob-opt .font-bold { font-weight: 600; }
/* List rows: a readable 16px label, a quieter sub line. */
#wizard-section .space-y-3 > button.ob-opt .text-sm { font-size: 16px; line-height: 1.35; font-weight: 500; }
#wizard-section .space-y-3 > button.ob-opt .text-xs { margin-top: 1px; font-size: 13px; font-weight: 400; }
#wizard-section .grid > button.ob-opt { gap: 10px; padding-left: 12px; padding-right: 12px; }
#wizard-section .grid > button.ob-opt .text-sm,
#wizard-section .grid > button.ob-opt > .text-xs { font-size: 15px; font-weight: 500; min-width: 0; }
@media (max-width: 399px) {
    #wizard-section .grid > button.ob-opt .text-sm,
    #wizard-section .grid > button.ob-opt > .text-xs { font-size: 14px; }
}

/* The icon or emoji box on the left: one calm neutral, whatever its hue. */
#wizard-section .ob-opt > .tile-emoji,
#wizard-section .ob-opt > .rounded-xl:first-child {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--ob-icon-bg);
    font-size: 18px;
    transition: background-color .18s ease;
}
#wizard-section .ob-opt > .tile-emoji { font-size: 22px; }
#wizard-section .grid > .ob-opt > .rounded-xl:first-child { width: 40px; height: 40px; font-size: 16px; }

@media (hover: hover) {
    #wizard-section .ob-opt:hover { background: #fff; border-color: var(--ob-line-strong); box-shadow: var(--ob-shadow); }
}
#wizard-section .ob-opt:active,
#wizard-section .selection-card:active > .ob-opt { transform: scale(.985); }

/* Selected: a green ring (border plus an inset 1px, so nothing shifts) on a
   faint green tint. JS sets .border-brand-600 / aria-pressed; radios use
   :checked. */
#wizard-section .ob-opt.border-brand-600,
#wizard-section .ob-opt[aria-pressed="true"],
#wizard-section .selection-card input:checked + .ob-opt {
    background: var(--ob-sel-bg) !important;
    border-color: var(--ob-sel-border) !important;
    box-shadow: inset 0 0 0 1px var(--ob-sel-border), var(--ob-shadow-sm) !important;
    color: var(--ob-sel-ink);
}
#wizard-section .ob-opt.border-brand-600 .text-gray-800,
#wizard-section .ob-opt.border-brand-600 .text-gray-900,
#wizard-section .ob-opt[aria-pressed="true"] .text-gray-800,
#wizard-section .ob-opt[aria-pressed="true"] .text-gray-900,
#wizard-section .ob-opt[aria-pressed="true"] > span:first-child,
#wizard-section .selection-card input:checked + .ob-opt .text-gray-800 { color: var(--ob-sel-ink) !important; }
#wizard-section .ob-opt.border-brand-600 > .tile-emoji,
#wizard-section .ob-opt.border-brand-600 > .rounded-xl:first-child,
#wizard-section .ob-opt[aria-pressed="true"] > .rounded-xl:first-child { background: #fff; }

/* A small give when something gets picked. */
#wizard-section .ob-opt.ob-pop { animation: obPop .3s var(--ob-ease-out); }
#wizard-section .ob-opt.ob-pop:not(.ob-pic) > :first-child { animation: obIconBounce .45s var(--ob-ease-spring); }
@keyframes obPop {
    0%, 100% { transform: scale(1); }
    35% { transform: scale(.975); }
}
@keyframes obIconBounce {
    0%, 100% { transform: scale(1); }
    40% { transform: scale(1.08); }
}

/* Check: list rows show an empty ring until picked (a square one for
   select-all-that-apply), so every row reads as tappable. Grid tiles keep
   the check hidden until picked. */
#wizard-section .ob-opt .tile-check {
    background: var(--ob-green);
    transform: scale(.4);
    transition: opacity .15s ease, transform .3s var(--ob-ease-spring), background-color .15s ease, border-color .15s ease;
}
#wizard-section .ob-opt .tile-check.opacity-100 { transform: scale(1); }
#wizard-section .ob-opt .tile-check:not(.absolute) {
    opacity: 1;
    transform: none;
    border: 1.5px solid var(--ob-line-strong);
    background: #fff;
}
#wizard-section .ob-opt .tile-check:not(.absolute) i { opacity: 0; transform: scale(.4); transition: opacity .12s ease, transform .3s var(--ob-ease-spring); }
#wizard-section .ob-opt .tile-check.opacity-100:not(.absolute) { border-color: var(--ob-green); background: var(--ob-green); }
#wizard-section .ob-opt .tile-check.opacity-100:not(.absolute) i { opacity: 1; transform: none; }
#wizard-section .ob-opt[onclick*="toggleMulti"] .tile-check { border-radius: 7px; }

/* Keyboard hints (desktop): app.js adds <kbd class="ob-key">n</kbd> to list
   rows; pressing that number picks the row. The key sits where the ring
   would, so the ring waits until the row is picked. */
.ob-key { display: none; }
@media (hover: hover) and (pointer: fine) {
    #wizard-section .ob-opt:has(.ob-key) { padding-right: 56px; }
    .ob-key {
        position: absolute;
        right: 16px;
        top: 50%;
        display: grid;
        place-items: center;
        width: 24px;
        height: 24px;
        margin-top: -12px;
        border: 1px solid var(--ob-line-strong);
        border-radius: 7px;
        color: var(--ob-muted);
        font-family: inherit;
        font-size: 12px;
        font-weight: 600;
        line-height: 1;
        transition: opacity .12s ease;
    }
    #wizard-section .ob-opt:has(.ob-key) .tile-check { position: absolute; right: 16px; top: 50%; margin-top: -12px; }
    #wizard-section .ob-opt:has(.ob-key) .tile-check.opacity-0 { opacity: 0; }
    #wizard-section .ob-opt.border-brand-600 .ob-key,
    #wizard-section .ob-opt[aria-pressed="true"] .ob-key { opacity: 0; }
}

/* Photo and icon cards (gender, goal) */
#wizard-section .ob-pic { padding: 8px 8px 14px; overflow: hidden; }
#wizard-section .ob-pic .font-extrabold { font-size: 16px; }
#wizard-section .planner-portrait {
    width: 100%;
    height: 180px;
    object-fit: cover;
    object-position: 50% 25%;
    border-radius: 11px;
    margin-bottom: 12px;
    background: #f0f1e8;
}
@media (min-width: 640px) { #wizard-section .planner-portrait { height: 220px; } }
@media (min-width: 640px) and (max-height: 860px) { #wizard-section .planner-portrait { height: 176px; } }
#wizard-section .gender-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #fff;
    border-radius: 999px;
    background: rgba(255, 255, 255, .7);
    color: transparent;
    font-size: 11px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
    transition: background-color .15s ease, transform .3s var(--ob-ease-spring);
}
#wizard-section .selection-card input:checked + .ob-opt .gender-check { background: var(--ob-green); transform: scale(1.06); }
#wizard-section .selection-card input:checked + .ob-opt .gender-check i { color: #fff !important; transform: none; }
/* style.css scales + recolors every icon inside a checked selection card. */
#wizard-section .selection-card input:checked + .ob-opt i { transform: none; }
#wizard-section .ob-pic > .w-16.h-16 { background-color: var(--ob-icon-bg); transition: background-color .18s ease; }
#wizard-section .selection-card input:checked + .ob-opt .w-16.h-16 { background-color: #fff !important; }

/* Age rows */
#wizard-section .age-card > span:first-child { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
#wizard-section .age-card > span + span { font-size: 12px; font-weight: 500; letter-spacing: .08em; }

/* Cooking days: label on the left, the same ring/check as list rows on the
   right (drawn here, the tile has no .tile-check). */
#wizard-section button.ob-opt.tile-cookday {
    min-height: 56px;
    padding-left: 18px;
    padding-right: 48px;
    font-size: 15px;
    font-weight: 500;
    text-align: left;
}
#wizard-section .tile-cookday::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 16px;
    width: 22px;
    height: 22px;
    margin-top: -11px;
    border: 1.5px solid var(--ob-line-strong);
    border-radius: 7px;
    background: #fff no-repeat center / 12px;
    transition: background-color .15s ease, border-color .15s ease;
}
#wizard-section .tile-cookday.border-brand-600::after,
#wizard-section .tile-cookday[aria-pressed="true"]::after {
    border-color: var(--ob-green);
    background-color: var(--ob-green);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 5 8.6l4.6-5' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Chip grids (diet, cuisine and any other wrap of vertical tiles): an even
   two-up grid on phones rather than a ragged row of fixed-width tiles. */
#wizard-section .ob-opt.flex-col { padding: 14px 10px 12px; gap: 8px; }
#wizard-section .ob-opt.flex-col > .rounded-xl:first-child { width: 40px; height: 40px; font-size: 16px; }
#wizard-section .ob-opt.flex-col .text-sm { font-size: 14px; font-weight: 500; }
@media (max-width: 479px) {
    #wizard-section .ob-screen .flex-wrap:has(> .ob-opt.flex-col) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    #wizard-section .flex-wrap > .ob-opt.flex-col { width: 100%; }
}
@media (min-width: 480px) {
    #wizard-section .flex-wrap > .ob-opt.flex-col { width: 156px; }
}

/* Store tiles and other two-up grids */
#wizard-section .tile-store { min-height: 58px; }
#wizard-section [data-ob="store"] .grid,
#wizard-section [data-ob="allergies"] .grid { gap: 12px; }

/* Budget presets */
#wizard-section .budget-preset-btn {
    min-height: 44px;
    border: 1px solid var(--ob-line-strong);
    border-radius: 999px;
    background: #fff;
    box-shadow: none;
    color: var(--ob-text);
    font-size: 14px;
    font-weight: 600;
    transition: transform .12s ease, border-color .15s ease, background-color .15s ease, color .15s ease;
}
#wizard-section .budget-preset-btn.border-brand-600 {
    border-color: var(--ob-sel-border);
    background: var(--ob-sel-bg);
    box-shadow: inset 0 0 0 1px var(--ob-sel-border);
    color: var(--ob-sel-ink);
}
#wizard-section .budget-preset-btn:active { transform: scale(.96); }

/* Budget slider (app.js paints the filled track inline) */
#wizard-section .budget-slider { height: 6px; margin: 16px 0 12px; }
#wizard-section .budget-slider::-webkit-slider-thumb {
    width: 28px;
    height: 28px;
    border: 3px solid var(--ob-green);
    box-shadow: 0 2px 8px rgba(23, 36, 30, .18);
}
#wizard-section .budget-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border: 3px solid var(--ob-green);
    box-shadow: 0 2px 8px rgba(23, 36, 30, .18);
}
#wizard-section .budget-slider:focus-visible { outline: 2px solid var(--ob-green); outline-offset: 8px; }

/* ---------- Inputs ---------- */
#wizard-section .ob-input {
    background: #fff;
    border: 1px solid #cfd6d1;
    border-radius: 16px;
    box-shadow: var(--ob-shadow-sm);
    color: var(--ob-ink);
    caret-color: var(--ob-green);
    transition: border-color .15s ease, box-shadow .15s ease;
}
#wizard-section input.ob-input[type="number"] { font-size: 32px; font-weight: 600; padding: 16px 20px; letter-spacing: -.02em; }
#wizard-section input.ob-input#wizard-name { font-size: 22px; font-weight: 600; }
#wizard-section input.ob-input#allergies-other { font-size: 16px; font-weight: 400; }
#wizard-section .ob-input::placeholder { color: var(--ob-faint); font-weight: 400; }
#wizard-section .ob-input:focus {
    border-color: var(--ob-green);
    box-shadow: 0 0 0 4px rgba(3, 135, 95, .14);
    outline: none;
    transform: none;
}
#wizard-section .ob-input[aria-invalid="true"] { border-color: var(--ob-red); box-shadow: 0 0 0 4px rgba(180, 35, 24, .12); }
/* the kg / lbs label inside the box */
#wizard-section .ob-input + span { color: var(--ob-muted); font-weight: 600; }
#wizard-section input[type="number"]::-webkit-outer-spin-button,
#wizard-section input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#wizard-section input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
@media (max-width: 639px) {
    /* Never below 16px, or iOS zooms the page on focus. */
    #wizard-section input.ob-input[type="number"] { font-size: 30px; }
}

/* Unit toggles: a soft pill track, the active unit a white thumb. */
#wizard-section .ob-seg {
    background: #e9ede8;
    border: 0;
    border-radius: 999px;
    padding: 4px;
    box-shadow: none;
}
#wizard-section .ob-seg button {
    min-width: 84px;
    min-height: 40px;
    border-radius: 999px;
    color: var(--ob-muted);
    font-size: 14px;
    font-weight: 600;
    transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
#wizard-section .ob-seg button:hover { background: transparent; color: var(--ob-ink); }
#wizard-section .ob-seg button.bg-brand-600 {
    background: #fff;
    color: var(--ob-ink);
    box-shadow: 0 1px 3px rgba(23, 36, 30, .14);
}

/* ---------- Insight / result cards ---------- */
#wizard-section .ob-screen .rounded-3xl.border,
#wizard-section .ob-screen .rounded-2xl.border.bg-white:not(.ob-opt),
#wizard-section .ob-barrier {
    border-width: 1px;
    border-color: var(--ob-line);
    box-shadow: var(--ob-shadow);
}
#wizard-section .ob-screen img.rounded-3xl { box-shadow: var(--ob-shadow); }

/* Staged reveal for the story screens: headline, then picture, then copy. */
#wizard-section .ob-screen.ob-enter .ob-reveal { animation: obRise .5s var(--ob-ease-out) backwards; }
#wizard-section .ob-screen.ob-enter .ob-reveal:nth-child(2) { animation-delay: .12s; }
#wizard-section .ob-screen.ob-enter .ob-reveal:nth-child(3) { animation-delay: .24s; }
@keyframes obRise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

/* ---------- Screen motion ---------- */
/* Incoming screen slides in; the outgoing one slides off the other way at
   the same time (it's taken out of flow while it leaves, see app.js). */
#wizard-section .ob-screen.ob-enter { animation: obSlideIn .34s var(--ob-ease-out); }
#wizard-section .ob-screen.ob-enter[data-direction="back"] { animation-name: obSlideInBack; }
#wizard-section .ob-screen.ob-leave {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    pointer-events: none;
    animation: obSlideOut .22s ease-in forwards;
}
#wizard-section .ob-screen.ob-leave[data-direction="back"] { animation-name: obSlideOutBack; }
@keyframes obSlideIn { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes obSlideInBack { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes obSlideOut { to { opacity: 0; transform: translateX(-28px); } }
@keyframes obSlideOutBack { to { opacity: 0; transform: translateX(28px); } }

/* Options settle in one after another. --i is set per option by app.js. */
#wizard-section .ob-screen.ob-enter .ob-opt {
    animation: obOptIn .38s var(--ob-ease-out) backwards;
    animation-delay: calc(var(--i, 0) * 35ms + 60ms);
}
@keyframes obOptIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Wrong / missing answer: a quick head shake. */
#wizard-section .ob-screen.ob-shake { animation: obShake .4s ease; }
@keyframes obShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(7px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(2px); }
}

/* ---------- Bottom action bar ---------- */
.ob-bar {
    position: sticky;
    bottom: 0;
    z-index: 30;
    background: var(--ob-bg);
    padding-bottom: env(safe-area-inset-bottom);
}
/* A soft fade instead of a hard line where cards scroll under the bar. */
.ob-bar::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 20px;
    background: linear-gradient(to top, var(--ob-bg), rgba(246, 247, 244, 0));
    pointer-events: none;
}
.ob-bar-inner {
    max-width: 592px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 6px 16px 16px;
}
.ob-bar-msg { min-width: 0; display: flex; align-items: center; justify-content: center; gap: 10px; }
/* Nothing to say: drop the row (and its gap). :where keeps it weak enough
   for the cheer state to bring the row back. */
.ob-bar-msg:where(:not(:has(> :not(.hidden):not(.ob-cheer):not(.ob-bar-pip)))) { display: none; }
.ob-context { margin: 0; color: var(--ob-muted); font-size: 13px; text-align: center; }
.ob-context:empty { display: none; }
.ob-bar-actions { display: flex; gap: 8px; }
.ob-bar-actions .ob-btn { flex: 1; }
.ob-bar-actions .ob-btn-ghost { flex: 0 0 auto; }

/* Cheer ("Nice!"), played by app.obCheer() when an answer lands: a short
   line with mini Pip above the button. The bar itself stays calm. */
.ob-cheer {
    display: none;
    align-items: center;
    margin: 0;
    color: var(--ob-green-text);
    font-size: 16px;
    font-weight: 600;
}
.ob-bar.is-cheer .ob-bar-msg { display: flex; }
.ob-bar.is-cheer .ob-cheer { display: flex; animation: obCheerIn .3s var(--ob-ease-out); }
.ob-bar.is-cheer .ob-context,
.ob-bar.is-cheer .ob-error { display: none; }
@keyframes obCheerIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Error: the message sits in a soft red pill above the button. */
.ob-error {
    margin: 0;
    color: var(--ob-red);
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ob-error:focus { outline: none; }
.ob-bar.is-error .ob-bar-msg {
    align-self: center;
    max-width: 100%;
    padding: 4px 16px 4px 6px;
    border-radius: 14px;
    background: var(--ob-red-bg);
}
.ob-bar.is-error .ob-context { display: none; }

/* Buttons */
.ob-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 56px;
    padding: 0 28px;
    border-radius: 999px;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
    transition: transform .12s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease;
}
.ob-btn-primary {
    background: var(--ob-green);
    color: #fff;
    box-shadow: 0 8px 20px -10px rgba(3, 135, 95, .7);
}
@media (hover: hover) { #wizard-section .ob-btn-primary:hover { background: var(--ob-green-hover); } }
#wizard-section .ob-btn-primary:active { transform: scale(.98); }
/* Not answered yet: quiet grey. Still clickable, so a tap can say what's
   missing instead of doing nothing. */
#wizard-section .ob-btn-primary[aria-disabled="true"] {
    background: #e1e6e2;
    color: #6f7c76;
    box-shadow: none;
    cursor: default;
}
#wizard-section .ob-btn-primary[aria-disabled="true"]:active { transform: none; }
#wizard-section .ob-bar.is-cheer .ob-btn-primary { background: var(--ob-green); color: #fff; box-shadow: 0 8px 20px -10px rgba(3, 135, 95, .7); }
.ob-btn-ghost {
    padding: 0 20px;
    background: transparent;
    color: var(--ob-muted);
}
@media (hover: hover) { .ob-btn-ghost:hover { background: rgba(23, 36, 30, .05); color: var(--ob-ink); } }
#wizard-section .ob-btn-ghost:active { transform: scale(.97); }
.ob-btn-generate i { font-size: 15px; }
/* Generate gets a slow, faint shine, like the pricing CTA. */
#wizard-section #ob-generate { position: relative; overflow: hidden; }
#wizard-section #ob-generate::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -40%;
    width: 30%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .22), transparent);
    transform: skewX(-18deg);
    animation: obShine 4s ease-in-out 1.6s infinite;
    pointer-events: none;
}
@keyframes obShine { 0% { left: -40%; } 35%, 100% { left: 130%; } }

/* Mini Pip in the action bar (cheer and error) */
.ob-bar-pip { display: none; width: 34px; flex-shrink: 0; }
.ob-bar-pip .mm-mascot { width: 100%; }
.ob-bar.is-cheer .ob-bar-pip,
.ob-bar.is-error .ob-bar-pip { display: block; animation: obCheerIn .3s var(--ob-ease-out); }
.ob-bar.is-cheer .ob-bar-pip .mm-svg { animation: mmHop .5s var(--ob-ease-spring); }
.ob-bar.is-error .ob-bar-pip .mm-svg { animation: obShake .4s ease; }
@keyframes mmHop { 0% { transform: scale(1.1, .9); } 40% { transform: translateY(-6px) scale(.96, 1.05) rotate(-6deg); } 100% { transform: none; } }

/* ---------- Tablet / desktop: one centred column ---------- */
@media (min-width: 768px) {
    #wizard-section { --ob-bar-h: 104px; }
    .ob-top-inner { padding: 14px 24px; gap: 16px; }
    .ob-main { padding: clamp(12px, 5vh, 56px) 24px 32px; }
    #wizard-section .ob-screen > .text-center:first-child,
    #wizard-section .goal-set .text-center { margin-bottom: 32px; }
    .ob-bar::before { height: 32px; }
    .ob-bar-inner { padding: 8px 16px 28px; }
    .ob-bar-actions { justify-content: center; }
    .ob-bar-actions .ob-btn-primary { flex: 0 1 400px; }
    .ob-bar-pip { width: 38px; }
}
/* Short landscape phones: keep the bars slim so the question has room. */
@media (max-height: 520px) and (orientation: landscape) {
    .ob-top-inner { padding-top: 4px; padding-bottom: 4px; }
    .ob-bar-inner { padding-top: 6px; padding-bottom: 8px; }
    .ob-btn { height: 46px; }
    .ob-bar-msg { display: none !important; }
}

/* The site-wide cookie banner (#mmp-cc, cookie-consent.css) would otherwise sit on top of Continue. */
body:has(#wizard-section:not(.hidden)) #mmp-cc {
    bottom: calc(var(--ob-bar-h, 96px) + 8px + env(safe-area-inset-bottom));
}
@media (min-width: 768px) {
    body:has(#wizard-section:not(.hidden)) #mmp-cc { bottom: calc(var(--ob-bar-h, 104px) + 16px); }
}

/* ---------- Pip moments ---------- */
/* A soft green glow behind Pip, so the moment has a place to stand. */
:is(#wizard-section, #pre-pricing-loading) .mm-stage::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 48% 52% at 50% 60%, rgba(18, 184, 134, .13), rgba(18, 184, 134, 0) 100%);
    pointer-events: none;
}
#wizard-section .ob-screen h2.mm-loader-title,
#pre-pricing-loading .mm-loader-title { color: var(--ob-ink); font-weight: 600; }
:is(#wizard-section, #pre-pricing-loading) .mm-loader-line { color: var(--ob-muted); }
:is(#wizard-section, #pre-pricing-loading) .mm-kicker { color: var(--ob-green-text); font-weight: 600; letter-spacing: .08em; }
:is(#wizard-section, #pre-pricing-loading) .mm-track { height: 8px; background: var(--ob-track); }
:is(#wizard-section, #pre-pricing-loading) .mm-fill { min-width: 8px; background: var(--ob-green); }
:is(#wizard-section, #pre-pricing-loading) .mm-fill-shine { display: none; }
:is(#wizard-section, #pre-pricing-loading) .mm-pct { color: var(--ob-green-text); font-weight: 600; }
:is(#wizard-section, #pre-pricing-loading) .mm-checks li {
    border: 1px solid var(--ob-line);
    box-shadow: none;
    color: var(--ob-faint);
    font-weight: 500;
}
:is(#wizard-section, #pre-pricing-loading) .mm-checks li.is-active { color: var(--ob-ink); border-color: var(--ob-line-strong); }
:is(#wizard-section, #pre-pricing-loading) .mm-checks li.is-done { color: var(--ob-sel-ink); border-color: #b9e3cf; background: var(--ob-sel-bg); box-shadow: none; }
:is(#wizard-section, #pre-pricing-loading) .mm-checks li.is-done::before { background: var(--ob-green); }

/* Pip's speech bubble: a light card instead of a thick outlined one. */
#wizard-section .mm-say-bubble {
    border-width: 1px;
    box-shadow: var(--ob-shadow);
    font-weight: 500;
}
#wizard-section .mm-say-bubble::before {
    left: -8px;
    border-left-width: 1px;
    border-bottom-width: 1px;
}

/* Savings screen (moneyFact) */
.mm-stage-wow { width: 250px; height: 168px; margin-bottom: 4px; }
.mm-stage-wow .mm-loader-pip { width: 118px; margin-left: -59px; bottom: 12px; }
.mm-stage-wow .mm-shadow { width: 84px; margin-left: -42px; }
.mm-coin {
    position: absolute;
    left: 50%;
    top: 56%;
    z-index: 3;
    line-height: 0;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(var(--r));
}
.mm-coin svg { display: block; animation: mmFloat 2.4s ease-in-out infinite; filter: drop-shadow(0 3px 0 rgba(179, 122, 0, .25)); }
.mm-coin-1 { --x: -96px; --y: -40px; --r: -14deg; }
.mm-coin-2 { --x: 94px; --y: -52px; --r: 12deg; }
.mm-coin-3 { --x: -110px; --y: 26px; --r: 8deg; }
.mm-coin-4 { --x: 106px; --y: 20px; --r: -10deg; }
.mm-coin-5 { --x: 58px; --y: -86px; --r: 18deg; }
.mm-coin-2 svg { animation-delay: .4s; }
.mm-coin-3 svg { animation-delay: .8s; }
.mm-coin-4 svg { animation-delay: 1.2s; }
.mm-coin-5 svg { animation-delay: 1.6s; }
#wizard-section .ob-screen.ob-enter .mm-coin { animation: mmCoinOut .7s var(--ob-ease-spring) backwards; }
#wizard-section .ob-screen.ob-enter .mm-coin-1 { animation-delay: .35s; }
#wizard-section .ob-screen.ob-enter .mm-coin-2 { animation-delay: .42s; }
#wizard-section .ob-screen.ob-enter .mm-coin-3 { animation-delay: .49s; }
#wizard-section .ob-screen.ob-enter .mm-coin-4 { animation-delay: .56s; }
#wizard-section .ob-screen.ob-enter .mm-coin-5 { animation-delay: .63s; }
@keyframes mmCoinOut {
    from { opacity: 0; transform: translate(-50%, -50%) scale(.3) rotate(0); }
    to { opacity: 1; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1) rotate(var(--r)); }
}
@media (max-width: 359px) {
    .mm-stage-wow { width: 220px; }
    .mm-coin-3 { --x: -96px; } .mm-coin-4 { --x: 92px; }
}

#wizard-section .ob-screen h2.money-title { margin: 2px 0 0; font-size: clamp(1.25rem, 1rem + 1vw, 1.6rem); }
.money-hero { display: flex; align-items: baseline; justify-content: center; gap: 10px; margin: 4px 0 0; }
.money-hero-num {
    display: inline-block;
    color: var(--ob-green-text);
    font-size: clamp(3.2rem, 2.6rem + 3vw, 4.25rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -.04em;
    font-variant-numeric: tabular-nums;
}
.money-hero-unit { color: var(--ob-muted); font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.money-sub { margin: 2px 0 0; color: var(--ob-muted); font-size: 15px; }
.money-hero.is-landed .money-hero-num,
.money-stat.is-landed strong { animation: moneyLand .45s var(--ob-ease-spring); }
@keyframes moneyLand { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.1); } }

/* Stat cards (savings and review): white cards, a small label on top, the
   number below. --c is the one accent: an icon, or a dot by the label. */
.money-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: 100%; max-width: 380px; margin: 22px auto 0; }
.money-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 10px 16px;
    border: 1px solid var(--ob-line);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--ob-shadow);
}
.money-stat-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ob-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.money-stat-body { display: flex; align-items: center; justify-content: center; gap: 8px; }
.money-stat-body i { color: var(--c); font-size: 18px; }
.money-stat strong {
    display: inline-block;
    color: var(--ob-ink);
    font-size: clamp(1.35rem, 1.1rem + 1vw, 1.6rem);
    font-weight: 700;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}
.money-stat-month { --c: #059669; }
.money-stat-year { --c: #d99a00; }
.money-cite { max-width: 24rem; margin: 18px auto 0; color: var(--ob-muted); font-size: 12px; line-height: 1.5; text-align: center; text-wrap: balance; }
.money-cite i { margin-right: 4px; color: var(--ob-green); }
#wizard-section .ob-screen.ob-enter[data-ob="moneyFact"] .money-title { animation: obRise .45s var(--ob-ease-out) .12s backwards; }
#wizard-section .ob-screen.ob-enter[data-ob="moneyFact"] .money-hero,
#wizard-section .ob-screen.ob-enter[data-ob="moneyFact"] .money-sub { animation: obRise .45s var(--ob-ease-out) .3s backwards; }
#wizard-section .ob-screen.ob-enter .money-stat-month { animation: obRise .45s var(--ob-ease-out) .9s backwards; }
#wizard-section .ob-screen.ob-enter .money-stat-year { animation: obRise .45s var(--ob-ease-out) 1.02s backwards; }
#wizard-section .ob-screen.ob-enter[data-ob="moneyFact"] .money-cite { animation: obRise .45s var(--ob-ease-out) 1.2s backwards; }

/* Review: the "your plan is ready" moment */
.mm-stage-ready { width: 240px; height: 150px; margin-bottom: 2px; }
.mm-stage-ready .mm-loader-pip { width: 112px; margin-left: -56px; bottom: 10px; }
.mm-stage-ready .mm-shadow { width: 80px; margin-left: -40px; }
#wizard-section .ob-screen h2.review-title { margin: 0; font-size: clamp(1.55rem, 1.15rem + 1.6vw, 2rem); }
.review-sub { margin: 6px 0 0; color: var(--ob-muted); font-size: 15px; }
.review-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 440px; margin: 20px auto 0; }
.review-stat { padding: 12px 6px 14px; }
.review-stat strong { font-size: clamp(1.15rem, 1rem + .7vw, 1.4rem); }
.review-stat .money-stat-label::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.review-stat-cal { grid-column: 1 / -1; padding: 16px 12px 18px; }
.review-stat-cal .money-stat-label::before { display: none; }
.review-stat-cal .money-stat-body { gap: 10px; }
.review-stat-cal strong { font-size: clamp(2.1rem, 1.6rem + 2vw, 2.6rem); line-height: 1; }
.review-stat-cal small { color: var(--ob-muted); font-size: 14px; font-weight: 600; }
.review-stat-cal .money-stat-body i { font-size: 22px; }
.review-stat-cal { --c: #ea6a1f; }
.review-stat-p { --c: var(--ob-macro-p); }
.review-stat-c { --c: var(--ob-macro-c); }
.review-stat-f { --c: var(--ob-macro-f); }
.review-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 470px; margin: 18px auto 0; padding: 0; list-style: none; }
.review-chips li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--ob-line);
    border-radius: 999px;
    background: #fff;
    color: var(--ob-text);
    font-size: 13px;
    font-weight: 500;
}
.review-chips i { color: var(--ob-green); font-size: 12px; }
.review-profile { margin: 12px 0 0; color: var(--ob-muted); font-size: 12px; }
.review-note { max-width: 28rem; margin: 14px auto 0; color: var(--ob-muted); font-size: 12px; line-height: 1.5; }
#wizard-section [data-ob="review"] .ob-review-toggle { margin-top: 14px; }
#wizard-section .ob-screen.ob-enter[data-ob="review"] .review-title,
#wizard-section .ob-screen.ob-enter[data-ob="review"] .review-sub { animation: obRise .45s var(--ob-ease-out) .2s backwards; }
#wizard-section .ob-screen.ob-enter .review-stat-cal { animation: obRise .45s var(--ob-ease-out) .4s backwards; }
#wizard-section .ob-screen.ob-enter .review-stat-p { animation: obRise .45s var(--ob-ease-out) .55s backwards; }
#wizard-section .ob-screen.ob-enter .review-stat-c { animation: obRise .45s var(--ob-ease-out) .62s backwards; }
#wizard-section .ob-screen.ob-enter .review-stat-f { animation: obRise .45s var(--ob-ease-out) .69s backwards; }
#wizard-section .ob-screen.ob-enter[data-ob="review"] .review-chips { animation: obRise .45s var(--ob-ease-out) .85s backwards; }

/* ---------- Pre-pricing: a full-screen moment, no site nav ---------- */
#pre-pricing-loading.mm-screen:not(.hidden) {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
    background: var(--ob-bg);
}
.mm-screen-inner { position: relative; width: 100%; max-width: 420px; }
html:has(#pre-pricing-loading:not(.hidden)),
body:has(#pre-pricing-loading:not(.hidden)) { background: #f6f7f4; }
body:has(#pre-pricing-loading:not(.hidden)) #main-nav { display: none; }
#pre-pricing-loading .ob-confetti, #loading-screen .ob-confetti { position: absolute; }

/* short screens: shrink the stage rather than push the bar off screen */
@media (max-height: 640px) {
    .mm-stage { transform: scale(.82); transform-origin: 50% 100%; margin-top: -30px; }
}

@media (prefers-reduced-motion: reduce) {
    #wizard-section *,
    #wizard-section *::before,
    #wizard-section *::after,
    .mm-screen *,
    .mm-stage *,
    .mm-stage *::before {
        animation: none !important;
        transition: none !important;
    }
}

/* Phones: typing screens (height, weight, goal weight, name). The bar
   follows the field instead of hiding under the keyboard. */
@media (max-width: 767px) {
    #wizard-section.ob-typing { padding-bottom: 42vh; }
    #wizard-section.ob-typing .ob-stage { flex: 0 0 auto; padding-top: 4vh; }
    #wizard-section.ob-typing .ob-bar { position: static; background: transparent; }
    #wizard-section.ob-typing .ob-bar::before { display: none; }
    #wizard-section.ob-typing .ob-bar-inner { max-width: 416px; padding-top: 18px; }
}

/* Scenes: Pip illustrations for the fact screens */
.ps-scene {
    position: relative;
    width: 100%;
    max-width: 420px;
    aspect-ratio: 5 / 4;
    margin: 0 auto 24px;
    overflow: hidden;
    border: 1px solid var(--ps-line, #e2e8e4);
    border-radius: 24px;
    background: var(--ps-bg, #f3faf6);
    box-shadow: var(--ob-shadow);
    isolation: isolate;
    container-type: inline-size;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    transition: transform .12s ease;
}
.ps-scene:active { transform: scale(.99); }
.ps-scene .ps-pip { position: absolute; z-index: 2; transform-origin: 50% 100%; }
.ps-scene .ps-pip .mm-mascot { display: block; width: 100%; }
.ps-scene .ps-shadow {
    position: absolute; z-index: 1;
    height: 4.5%; border-radius: 50%;
    background: rgba(27, 42, 36, .13);
    animation: mmShadow 1.5s ease-in-out infinite;
}

/* Pip's eyes: follow the pointer (pip-scenes.js sets --ex/--ey in SVG units),
   and wander on their own until someone moves. */
.ps-scene .mm-eyes, .ps-scene .mm-eyes-happy { translate: var(--ex, 0) var(--ey, 0); transition: translate .18s ease-out; }
.ps-scene:not(.is-tracking) .mm-eyes { animation: mmBlink 4.2s infinite, psLook 7s ease-in-out 2.5s infinite; }
.ps-scene:not(.is-tracking) .mm-eyes-happy { animation: psLook 7s ease-in-out 2.5s infinite; }
@keyframes psLook {
    0%, 18%, 100% { translate: 0 0; }
    26%, 44% { translate: 4px -1px; }
    54%, 72% { translate: -4px 1px; }
}

/* tap: Pip cheers with a jump; pip-scenes.js adds .is-cheer and the burst bits */
.ps-scene.is-cheer .ps-pip .mm-svg { animation: psCheer .7s cubic-bezier(.34, 1.56, .64, 1) !important; }
@keyframes psCheer {
    0% { transform: translateY(0) scale(1.08, .9); }
    35% { transform: translateY(-26%) scale(.94, 1.08) rotate(-6deg); }
    60% { transform: translateY(-30%) scale(1) rotate(6deg); }
    85% { transform: translateY(0) scale(1.06, .94); }
    100% { transform: none; }
}
.ps-bit {
    position: absolute; z-index: 6; left: var(--x); top: var(--y);
    width: 2.6cqw; height: 2.6cqw; min-width: 7px; min-height: 7px;
    border-radius: 2px; background: var(--c);
    pointer-events: none;
    animation: psBit .85s cubic-bezier(.2, .7, .3, 1) forwards;
}
.ps-bit.is-round { border-radius: 50%; }
@keyframes psBit {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(.4) rotate(0); }
    70% { opacity: 1; }
    100% { opacity: 0; transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1) rotate(var(--r)); }
}

/* shared entrances */
@keyframes psPop { 0% { opacity: 0; transform: scale(.4); } 70% { opacity: 1; transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes psRise { 0% { opacity: 0; transform: translateY(30%) scale(.9, 1.1); } 60% { opacity: 1; transform: translateY(-6%) scale(1.04, .96); } 100% { transform: none; } }
@keyframes psFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes psFade { from { opacity: 0; } }

/* 1. cook: chef Pip, a week ticking itself off, a clock that settles */
.ps-cook { --ps-bg: #fff7e8; --ps-line: #f1dfb8; }
.ps-cook .ps-pip { left: 27%; bottom: 1%; width: 46%; animation: psRise .7s cubic-bezier(.34, 1.56, .64, 1) .1s backwards; }
.ps-cook .ps-shadow { left: 30%; bottom: 2%; width: 40%; animation: psFade .4s ease .3s backwards; }
.ps-cook .ps-cal-wrap { position: absolute; left: 5%; top: 9%; width: 28%; rotate: -6deg; animation: psPop .5s cubic-bezier(.34, 1.56, .64, 1) .25s backwards; }
.ps-cook .ps-cal { display: block; width: 100%; }
.ps-cook .ps-tick { stroke-dasharray: 20; stroke-dashoffset: 0; animation: psTick .3s ease var(--d) backwards; }
@keyframes psTick { from { stroke-dashoffset: 20; } to { stroke-dashoffset: 0; } }
.ps-cook .ps-badge {
    position: absolute; right: -12%; top: -10%; width: 36%; aspect-ratio: 1;
    display: grid; place-items: center;
    border-radius: 50%; background: #12b886; box-shadow: 0 3px 0 #0b8f68;
    animation: psPop .45s cubic-bezier(.34, 1.56, .64, 1) 2.15s backwards, psPulse 2.4s ease-in-out 2.8s infinite;
}
.ps-cook .ps-badge svg { width: 62%; height: auto; }
@keyframes psPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
.ps-cook .ps-clock { position: absolute; right: 6%; top: 8%; width: 23%; rotate: 5deg; animation: psPop .5s cubic-bezier(.34, 1.56, .64, 1) .4s backwards; }
.ps-cook .ps-hand-m, .ps-cook .ps-hand-h { transform-box: view-box; transform-origin: 36px 36px; }
.ps-cook .ps-hand-m { animation: psSpin 2.2s cubic-bezier(.15, .7, .2, 1) .5s backwards, psTurn 20s linear 2.7s infinite; }
.ps-cook .ps-hand-h { animation: psSpinSlow 2.2s cubic-bezier(.15, .7, .2, 1) .5s backwards; }
@keyframes psSpin { from { transform: rotate(-1440deg); } to { transform: rotate(0); } }
@keyframes psSpinSlow { from { transform: rotate(-360deg); } to { transform: rotate(0); } }
@keyframes psTurn { to { transform: rotate(360deg); } }
.ps-cook .ps-drop { position: absolute; z-index: 3; top: 6%; width: 9%; line-height: 0; opacity: 0; animation: psDrop 3.2s ease-in infinite; }
.ps-cook .ps-drop svg { width: 100%; height: auto; }
.ps-cook .ps-drop-1 { left: 40%; animation-delay: .9s; }
.ps-cook .ps-drop-2 { left: 47%; animation-delay: 1.7s; }
.ps-cook .ps-drop-3 { left: 53%; animation-delay: 2.5s; }
.ps-cook .ps-drop-4 { left: 45%; animation-delay: 3.3s; }
@keyframes psDrop {
    0% { opacity: 0; transform: translateY(-40%) rotate(0) scale(.8); }
    10% { opacity: 1; transform: translateY(0) rotate(30deg) scale(1); }
    48% { opacity: 1; transform: translateY(300%) rotate(170deg) scale(1); }
    56%, 100% { opacity: 0; transform: translateY(340%) rotate(200deg) scale(.6); }
}

/* 2. diets: rules crossed out one by one, stamped, pushed aside; Pip brings a plate */
.ps-diets { --ps-bg: #f1faf5; --ps-line: #d5ecdf; }
.ps-diets .ps-shadow { display: none; }
.ps-diets .ps-card { position: absolute; left: 5%; top: 12%; width: 41%; animation: psCardIn .55s cubic-bezier(.34, 1.56, .64, 1) .15s backwards; }
@keyframes psCardIn { from { opacity: 0; transform: translateY(-30%) scale(.6) rotate(8deg); } }
.ps-diets .ps-rules {
    position: relative;
    display: flex; flex-direction: column; gap: 1.4cqw;
    padding: 3.2cqw 3.2cqw 3.6cqw;
    border: 2px solid #dde3e0; border-radius: 4.4cqw;
    background: #fff; box-shadow: 0 4px 0 #dde3e0;
    color: #8a968f; font-size: clamp(11px, 3.3cqw, 15px); font-weight: 700; text-align: left;
    transform: rotate(-11deg) translateY(4%) scale(.95);
    opacity: .8;
    animation: psReject .5s ease 1.75s backwards, psShake .45s ease 1.3s;
}
@keyframes psReject { from { transform: rotate(-7deg); opacity: 1; } }
@keyframes psShake {
    0%, 100% { transform: rotate(-7deg); opacity: 1; }
    20% { transform: rotate(-10deg) translateX(-3%); }
    45% { transform: rotate(-4deg) translateX(3%); }
    70% { transform: rotate(-9deg) translateX(-2%); }
}
.ps-diets .ps-rules b { color: #5d6a63; font-size: 1.08em; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.ps-diets .ps-rule { position: relative; padding: .3em .6em; border-radius: .6em; background: #f1f3f2; }
.ps-diets .ps-strike {
    position: absolute; left: .4em; right: .4em; top: 52%; height: 2.5px;
    border-radius: 2px; background: #e2493b;
    transform-origin: 0 50%;
    animation: psStrike .3s ease-out calc(.6s + var(--i) * .2s) backwards;
}
@keyframes psStrike { from { transform: scaleX(0); } }
.ps-diets .ps-stamp {
    position: absolute; right: -9%; top: -9%; width: 24%; aspect-ratio: 1;
    display: grid; place-items: center;
    border: 3px solid #e2493b; border-radius: 50%; background: #fff0ee; color: #e2493b;
    animation: psStamp .4s cubic-bezier(.34, 1.56, .64, 1) 1.25s backwards;
}
.ps-diets .ps-stamp svg { width: 58%; height: auto; }
@keyframes psStamp { 0% { opacity: 0; transform: scale(2.6) rotate(-30deg); } 100% { opacity: 1; transform: scale(1) rotate(0); } }
.ps-diets .ps-dust { position: absolute; right: 2%; top: 4%; width: 5%; aspect-ratio: 1; border-radius: 50%; background: #e7d9d6; opacity: 0; animation: psDust .6s ease-out 1.35s; }
.ps-diets .ps-dust-1 { --dx: 60%; --dy: -140%; }
.ps-diets .ps-dust-2 { --dx: 160%; --dy: -20%; }
.ps-diets .ps-dust-3 { --dx: 90%; --dy: 120%; }
@keyframes psDust { 0% { opacity: 1; transform: scale(.4); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.4); } }
.ps-diets .ps-arrow { position: absolute; left: 46%; top: 42%; width: 11%; line-height: 0; animation: psFade .2s ease 1.85s backwards, psNudge 1.4s ease-in-out 2.4s infinite; }
.ps-diets .ps-arrow svg { width: 100%; height: auto; }
.ps-diets .ps-arrow path { stroke-dasharray: 60; animation: psDraw .45s ease-out 1.85s backwards; }
@keyframes psDraw { from { stroke-dashoffset: 60; } to { stroke-dashoffset: 0; } }
@keyframes psNudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(14%); } }
.ps-diets .ps-pip { right: 9%; bottom: 23%; width: 33%; animation: psSlideIn .6s cubic-bezier(.34, 1.56, .64, 1) 1.75s backwards; }
@keyframes psSlideIn { 0% { opacity: 0; transform: translateX(70%) rotate(12deg); } 60% { opacity: 1; transform: translateX(-6%) rotate(-4deg); } 100% { transform: none; } }
.ps-diets .ps-plate { position: absolute; z-index: 3; right: 3%; bottom: 5%; width: 45%; animation: psPop .5s cubic-bezier(.34, 1.56, .64, 1) 1.85s backwards; }
.ps-diets .ps-food { transform-box: fill-box; transform-origin: 50% 100%; animation: psFoodIn .4s cubic-bezier(.34, 1.56, .64, 1) var(--d) backwards; }
@keyframes psFoodIn { from { opacity: 0; transform: translateY(-120%) scale(.5); } }
.ps-diets .ps-heart { position: absolute; z-index: 3; right: 9%; top: 6%; width: 11%; animation: psPop .5s cubic-bezier(.34, 1.56, .64, 1) 2.5s backwards, psBeat 1.3s ease-in-out 3s infinite; }
@keyframes psBeat { 0%, 60%, 100% { transform: scale(1); } 15% { transform: scale(1.18); } 30% { transform: scale(.96); } 45% { transform: scale(1.1); } }
.ps-diets .ps-mini-heart { position: absolute; z-index: 3; top: 12%; width: 5%; opacity: 0; animation: psHeartUp 3s ease-out infinite; }
.ps-diets .ps-mh-1 { right: 20%; animation-delay: 3s; }
.ps-diets .ps-mh-2 { right: 7%; animation-delay: 4s; }
.ps-diets .ps-mh-3 { right: 14%; animation-delay: 5s; }
@keyframes psHeartUp { 0% { opacity: 0; transform: translateY(40%) scale(.5); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(-160%) scale(1.1) rotate(12deg); } }

/* 3. nutrition: a ring that is mostly food; ingredients orbit an amazed Pip */
.ps-nutrition { --ps-bg: #f0faf6; --ps-line: #d2ecdf; }
.ps-nutrition .ps-ring { position: absolute; left: 50%; top: 50%; width: 64%; translate: -50% -50%; animation: psPop .6s cubic-bezier(.34, 1.56, .64, 1) .1s backwards; }
.ps-nutrition .ps-arc-food { animation: psArcFood 1.3s cubic-bezier(.3, .7, .2, 1) .45s backwards; }
.ps-nutrition .ps-arc-move { animation: psArcMove .6s ease 1.7s backwards; }
@keyframes psArcFood { from { stroke-dasharray: 0 100; } to { stroke-dasharray: 74 100; } }
@keyframes psArcMove { from { stroke-dasharray: 0 100; } to { stroke-dasharray: 14 100; } }
.ps-nutrition .ps-orbit {
    position: absolute; left: 50%; top: 50%; width: 64%; aspect-ratio: 1;
    translate: -50% -50%;
    animation: psFade .5s ease 2s backwards, psTurn 22s linear infinite;
}
.ps-nutrition .ps-orb { position: absolute; left: 50%; top: 50%; width: 15%; line-height: 0; transform: translate(-50%, -50%) rotate(var(--a)) translateY(-283%) rotate(calc(-1 * var(--a))); }
.ps-nutrition .ps-orb > span { display: block; animation: psTurn 22s linear infinite reverse; }
.ps-nutrition .ps-orb svg { width: 100%; height: auto; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .12)); }
.ps-nutrition .ps-orb-0 { --a: 40deg; }
.ps-nutrition .ps-orb-1 { --a: 130deg; }
.ps-nutrition .ps-orb-2 { --a: 220deg; }
.ps-nutrition .ps-orb-3 { --a: 310deg; }
.ps-nutrition .ps-pip { left: 50%; top: 50%; width: 30%; translate: -50% -54%; animation: psRise .7s cubic-bezier(.34, 1.56, .64, 1) .2s backwards; }
.ps-nutrition .ps-chip {
    position: absolute; z-index: 3;
    display: inline-flex; align-items: center; gap: .45em;
    padding: .45em .85em; border-radius: .9em;
    color: #fff; font-size: clamp(11px, 3.4cqw, 15px); font-weight: 800;
}
.ps-nutrition .ps-chip i { font-size: .85em; }
.ps-nutrition .ps-chip-food { left: 4%; bottom: 8%; background: #03875f; box-shadow: 0 3px 0 #026447; animation: psPop .45s cubic-bezier(.34, 1.56, .64, 1) 1.5s backwards, psFloat 3s ease-in-out 2.2s infinite; }
.ps-nutrition .ps-chip-move { right: 4%; top: 8%; background: #1576b0; box-shadow: 0 3px 0 #0f5a87; font-size: clamp(10px, 3cqw, 13px); animation: psPop .45s cubic-bezier(.34, 1.56, .64, 1) 2.1s backwards, psFloat 3s ease-in-out 3s infinite; }

/* 4. sleep: Pip asleep on a drifting cloud; stars, a shooting star, z's */
.ps-sleep { --ps-line: #1f275a; background: linear-gradient(180deg, #232c63 0%, #3d4a93 100%); }
.ps-sleep .ps-moon { position: absolute; right: 8%; top: 8%; width: 17%; animation: psPop .6s cubic-bezier(.34, 1.56, .64, 1) .2s backwards, psFloat 4s ease-in-out 1s infinite; filter: drop-shadow(0 0 10px rgba(255, 226, 122, .45)); }
.ps-sleep .ps-star { position: absolute; width: 1.8cqw; height: 1.8cqw; min-width: 5px; min-height: 5px; border-radius: 2px; background: #ffe89a; transform: rotate(45deg); animation: psStar 2.6s ease-in-out var(--d) infinite; }
@keyframes psStar { 0%, 100% { opacity: .25; transform: rotate(45deg) scale(.6); } 50% { opacity: 1; transform: rotate(45deg) scale(1.15); } }
.ps-sleep .ps-shoot {
    position: absolute; left: 8%; top: 10%; width: 22%; height: 2px;
    border-radius: 2px; background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff);
    opacity: 0; transform: rotate(18deg);
    animation: psShoot 7s ease-in 2s infinite;
}
@keyframes psShoot {
    0% { opacity: 0; transform: rotate(18deg) translateX(0); }
    2% { opacity: 1; }
    9% { opacity: 0; transform: rotate(18deg) translateX(260%); }
    100% { opacity: 0; transform: rotate(18deg) translateX(260%); }
}
.ps-sleep .ps-cloud-wrap { position: absolute; z-index: 1; left: 18%; bottom: 6%; width: 64%; animation: psDrift 8s ease-in-out infinite; }
@keyframes psDrift { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(3%, -4%); } }
.ps-sleep .ps-cloud { display: block; width: 100%; }
.ps-sleep .ps-pip { left: 23%; bottom: 17%; width: 53%; animation: psBreathe 3.2s ease-in-out infinite; }
@keyframes psBreathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.03, .97); } }
/* asleep: closed eyes, a soft smile, arms and leaf still */
.ps-sleep .ps-asleep .mm-arm, .ps-sleep .ps-asleep .mm-svg, .ps-sleep .ps-asleep .mm-leaf { animation: none !important; }
.ps-sleep .ps-asleep .mm-grin { opacity: 0 !important; }
.ps-sleep .ps-asleep .mm-smile { opacity: 1 !important; }
.ps-sleep .ps-asleep .mm-eyes-happy { translate: 0 0 !important; animation: none !important; }
.ps-sleep .ps-cap { position: absolute; z-index: 3; left: 16%; top: -7%; width: 60%; transform: rotate(-14deg); }
.ps-sleep .ps-z { position: absolute; z-index: 3; left: 62%; top: 32%; color: #dfe4ff; font-size: clamp(16px, 5.6cqw, 24px); font-weight: 800; line-height: 1; opacity: 0; animation: psZ 3.6s ease-in infinite; }
.ps-sleep .ps-z-2 { animation-delay: 1.2s; font-size: clamp(13px, 4.4cqw, 19px); }
.ps-sleep .ps-z-3 { animation-delay: 2.4s; font-size: clamp(19px, 6.6cqw, 28px); }
@keyframes psZ { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(40px, -60px) scale(1.1) rotate(12deg); } }
/* tapped: Pip wakes with a start for a moment (pip-scenes.js toggles .is-awake) */
.ps-sleep.is-awake .ps-pip { animation: psStartle .5s cubic-bezier(.34, 1.56, .64, 1); }
/* the nightcap sits outside the SVG, so the whole Pip startles instead of the body jumping alone */
.ps-sleep.is-cheer .ps-pip .mm-svg { animation: none !important; }
.ps-sleep.is-awake .ps-z { visibility: hidden; }
@keyframes psStartle { 0% { transform: none; } 40% { transform: translateY(-14%) scale(.96, 1.06); } 100% { transform: none; } }

/* 5. bridge: what holds you back becomes steps; Pip climbs them and plants a flag */
.ps-bridge { --ps-bg: #eef6ff; --ps-line: #d3e5f7; }
.ps-bridge .ps-block {
    position: absolute; bottom: 8%;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: .3em;
    width: 25%; padding-top: 3.4cqw; border-radius: 4.6cqw 4.6cqw 3cqw 3cqw;
    color: #fff; font-size: clamp(11px, 3.4cqw, 15px); font-weight: 800;
    transform-origin: 50% 100%;
    animation: psBlock .55s cubic-bezier(.34, 1.56, .64, 1) backwards;
}
.ps-bridge .ps-block i { font-size: 1.5em; }
.ps-bridge .ps-b1 { left: 8%; height: 24%; background: #d97a00; box-shadow: 0 5px 0 #a85d00; animation-delay: .2s; }
.ps-bridge .ps-b2 { left: 37.5%; height: 36%; background: #e0415f; box-shadow: 0 5px 0 #b02a45; animation-delay: .4s; }
.ps-bridge .ps-b3 { left: 67%; height: 48%; background: #7a55e6; box-shadow: 0 5px 0 #5a3cc0; animation-delay: .6s; }
@keyframes psBlock { 0% { opacity: 0; transform: translateY(-140%); } 60% { opacity: 1; transform: translateY(4%) scale(1.06, .9); } 80% { transform: scale(.97, 1.04); } 100% { transform: none; } }
.ps-bridge .ps-pip { left: 66%; bottom: 56%; width: 23%; animation: psClimb 2.4s ease-in-out 1s backwards; }
@keyframes psClimb {
    0% { opacity: 0; transform: translate(-322%, 155%); }
    6% { opacity: 1; transform: translate(-310%, 155%) scale(1); }
    9% { transform: translate(-310%, 155%) scale(1.08, .9); }
    16% { transform: translate(-283%, 40%) scale(.95, 1.06); }
    24% { transform: translate(-256%, 78%) scale(1.1, .88); }
    29% { transform: translate(-256%, 78%) scale(1); }
    38% { transform: translate(-192%, -6%) scale(.95, 1.06); }
    47% { transform: translate(-128%, 39%) scale(1.1, .88); }
    52% { transform: translate(-128%, 39%) scale(1); }
    62% { transform: translate(-64%, -44%) scale(.95, 1.06); }
    72% { transform: translate(0, 0) scale(1.14, .84); }
    80% { transform: translate(0, -14%) scale(.96, 1.06); }
    88%, 100% { transform: none; }
}
.ps-bridge .ps-flag { position: absolute; z-index: 1; left: 86.5%; bottom: 55.5%; width: 7.5%; line-height: 0; transform-origin: 15% 100%; animation: psFlag .5s cubic-bezier(.34, 1.56, .64, 1) 3.1s backwards, psWave 2.2s ease-in-out 3.6s infinite; }
.ps-bridge .ps-flag svg { width: 100%; height: auto; }
@keyframes psFlag { from { opacity: 0; transform: scaleY(0); } }
@keyframes psWave { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-6deg); } }
.ps-bridge .ps-spark { position: absolute; width: 2.4cqw; height: 2.4cqw; min-width: 7px; min-height: 7px; border-radius: 2px; background: #ffc800; transform: rotate(45deg); opacity: 0; animation: psStar 2s ease-in-out calc(3.2s + var(--d)) infinite backwards; }

@media (prefers-reduced-motion: reduce) {
    .ps-scene, .ps-scene * { animation: none !important; transition: none !important; }
    .ps-cook .ps-drop, .ps-sleep .ps-z, .ps-sleep .ps-shoot, .ps-diets .ps-mini-heart, .ps-diets .ps-dust, .ps-bit { display: none; }
    .ps-bridge .ps-spark { opacity: 1; }
}

/* phones: fact screens use the room they have. The scene grows to the full
   width, and the words around it get bigger. */
@media (max-width: 639px) {
    #wizard-section .ob-screen:has(.ps-scene):not(.hidden) { flex: 1; justify-content: center; padding-bottom: 12px; }
    #wizard-section .ob-screen:has(.ps-scene) h2 { font-size: 26px !important; line-height: 1.2 !important; margin-bottom: 20px; }
    #wizard-section .ob-screen:has(.ps-scene) > p { font-size: 16px; line-height: 1.6; color: var(--ob-text); max-width: 26rem; }
    .ps-scene { max-width: none; margin-bottom: 22px; }
}

/* ---- Welcome-back note, food chips, daily target, BMI, goal timeline ---- */
.ob-resume {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 14px;
    padding: 4px 4px 4px 14px;
    border: 1px solid var(--ob-line);
    border-radius: 21px;   /* a pill on one line, a soft box if the text wraps */
    background: #fff;
    box-shadow: var(--ob-shadow-sm);
    color: var(--ob-text);
    font-size: 13px;
}
.ob-resume.hidden { display: none; }
.ob-resume span { min-width: 0; text-align: left; }
.ob-resume button {
    flex-shrink: 0;
    white-space: nowrap;
    min-height: 32px;
    padding: 0 8px;
    border-radius: 999px;
    color: var(--ob-green-text);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.ob-resume button:hover { background: var(--ob-sel-bg); }

.ob-group-label {
    width: 100%;
    max-width: 28rem;
    margin: 0 auto 10px;
    color: var(--ob-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.ob-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ob-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--ob-line-strong);
    border-radius: 999px;
    background: #fff;
    color: var(--ob-ink);
    font-size: 14px;
    font-weight: 600;
    transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}
.ob-chip:hover { border-color: var(--ob-sel-border); }
.ob-chip:active { transform: scale(.97); }
.ob-chip[aria-pressed="true"] {
    border-color: var(--ob-sel-border);
    background: var(--ob-sel-bg);
    color: var(--ob-sel-ink);
    box-shadow: inset 0 0 0 1px var(--ob-sel-border);
}
.ob-chip[hidden] { display: none; }

.ob-target-card,
.ob-bmi-card,
.ob-proj-card {
    width: 100%;   /* a flex item with auto margins would shrink to its content */
    max-width: 28rem;
    margin: 0 auto;
    padding: 20px;
    border: 1px solid var(--ob-line);
    border-radius: 20px;
    background: #fff;
    box-shadow: var(--ob-shadow);
    text-align: left;
}
.ob-bmi-card { margin-top: 12px; padding: 16px 20px 14px; }
.ob-proj-card { padding: 16px; }
#wizard-section .ob-proj-card .text-gray-400 { color: var(--ob-muted); }

.ob-target-top { display: flex; align-items: center; gap: 20px; }
.ob-donut-wrap { position: relative; width: 148px; height: 148px; flex-shrink: 0; }
.ob-donut { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }
.ob-donut circle { fill: none; stroke-width: 12; }
.ob-donut-track { stroke: var(--ob-track); }
.ob-donut-seg { stroke-dasharray: 0 100; transition: stroke-dasharray .9s var(--ob-ease-out); }
.ob-donut-p { stroke: var(--ob-macro-p); }
.ob-donut-c { stroke: var(--ob-macro-c); }
.ob-donut-f { stroke: var(--ob-macro-f); }
.ob-donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.ob-donut-center strong {
    color: var(--ob-ink);
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
}
.ob-donut-center span { margin-top: 2px; color: var(--ob-muted); font-size: 12px; font-weight: 600; }

.ob-macro-legend { flex: 1; min-width: 0; display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.ob-macro-legend li { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; column-gap: 8px; }
.ob-macro-legend .is-p { --c: var(--ob-macro-p); }
.ob-macro-legend .is-c { --c: var(--ob-macro-c); }
.ob-macro-legend .is-f { --c: var(--ob-macro-f); }
.ob-macro-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.ob-macro-name { color: var(--ob-text); font-size: 14px; font-weight: 600; }
.ob-macro-legend strong { color: var(--ob-ink); font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ob-macro-legend small { grid-column: 2 / 3; color: var(--ob-muted); font-size: 12px; line-height: 1.2; }

/* One grid for both rows (rows are display: contents), so the label column
   fits the longest label on one line and the bars still line up. */
.ob-compare { display: grid; grid-template-columns: max-content minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--ob-line); font-size: 13px; }
.ob-compare-row { display: contents; }
.ob-compare-label { color: var(--ob-muted); font-weight: 600; white-space: nowrap; }
.ob-compare-note { grid-column: 1 / -1; }
.ob-compare-track { height: 10px; border-radius: 999px; background: var(--ob-track); overflow: hidden; }
.ob-compare-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--ob-line-strong); transition: width .9s var(--ob-ease-out); }
.ob-compare-row.is-target .ob-compare-track i { background: var(--ob-green); }
.ob-compare-row strong { min-width: 3.3rem; color: var(--ob-ink); font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.ob-compare-row.is-target strong { color: var(--ob-green-text); }
.ob-compare-note { margin: 2px 0 0; color: var(--ob-muted); font-size: 13px; line-height: 1.45; }

.ob-bmi-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.ob-bmi-label { color: var(--ob-muted); font-size: 13px; font-weight: 600; }
.ob-bmi-head strong { color: var(--ob-ink); font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ob-bmi-pill { align-self: center; margin-left: auto; padding: 3px 10px; border-radius: 999px; background: #e3f5ec; color: #05603a; font-size: 12px; font-weight: 700; }
.ob-bmi-pill[data-cat="under"] { background: #e3f1fa; color: #075985; }
.ob-bmi-pill[data-cat="over"] { background: #fcf1d8; color: #7a4f00; }
.ob-bmi-pill[data-cat="obese"] { background: #fde7e5; color: #9b1c1c; }
.ob-bmi-track { position: relative; display: flex; gap: 3px; height: 8px; }
.ob-bmi-track span { height: 100%; border-radius: 999px; }
.ob-bmi-track .is-under, .ob-bmi-scale span:nth-child(1) { flex: 14; }
.ob-bmi-track .is-healthy, .ob-bmi-scale span:nth-child(2) { flex: 26; }
.ob-bmi-track .is-over, .ob-bmi-scale span:nth-child(3) { flex: 20; }
.ob-bmi-track .is-obese, .ob-bmi-scale span:nth-child(4) { flex: 40; }
.ob-bmi-track .is-under { background: #8ccbec; }
.ob-bmi-track .is-healthy { background: #3cb87f; }
.ob-bmi-track .is-over { background: #f0c55a; }
.ob-bmi-track .is-obese { background: #ec9187; }
.ob-bmi-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 3px solid var(--ob-ink);
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--ob-shadow-sm);
    transition: left .9s var(--ob-ease-out);
}
.ob-bmi-scale { display: flex; gap: 3px; margin-top: 8px; color: var(--ob-muted); font-size: 11px; font-weight: 600; }

.ob-fine { max-width: 28rem; margin: 12px auto 0; color: var(--ob-muted); font-size: 12px; line-height: 1.5; text-align: center; }

.ob-proj-svg { display: block; width: 100%; height: auto; overflow: visible; }
.ob-proj-goal-line { fill: none; stroke: var(--ob-sel-border); stroke-width: 1.5; stroke-dasharray: 4 5; opacity: .5; }
.ob-proj-flag rect { fill: var(--ob-green); }
.ob-proj-flag text { fill: #fff; font-family: inherit; font-size: 12px; font-weight: 700; }

@media (prefers-reduced-motion: no-preference) {
    #wizard-section .ob-screen.ob-enter .ob-proj-svg .ob-chart-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: obqDraw 1.1s var(--ob-ease-out) .2s forwards; }
    #wizard-section .ob-screen.ob-enter .ob-proj-area { animation: obqFade .6s ease .7s backwards; }
    #wizard-section .ob-screen.ob-enter .ob-proj-flag,
    #wizard-section .ob-screen.ob-enter .ob-proj-svg .ob-chart-end { animation: obqFade .35s ease 1.15s backwards; }
}
@media (prefers-reduced-motion: reduce) {
    .ob-donut-seg, .ob-compare-track i, .ob-bmi-dot { transition: none; }
}
@keyframes obqDraw { to { stroke-dashoffset: 0; } }
@keyframes obqFade { from { opacity: 0; } }

@media (max-width: 400px) {
    .ob-resume { padding-left: 12px; font-size: 12.5px; }
    .ob-resume button { padding: 0 6px; }
    .ob-target-card { padding: 16px; }
    .ob-target-top { gap: 14px; }
    .ob-donut-wrap { width: 124px; height: 124px; }
    .ob-donut-center strong { font-size: 25px; }
    .ob-compare { column-gap: 8px; }
}
@media (max-width: 340px) {
    .ob-target-top { flex-direction: column; }
    .ob-macro-legend { width: 100%; }
}
