/* ===== Onboarding (first launch) =====
   Every colour goes through the app tokens: the dark theme comes for free. */
.ob-root {
    --ob-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --ob-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    position: fixed;
    inset: 0;
    z-index: 950;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    color: var(--text-primary);
    opacity: 0;
    transform: scale(1.02);
    transition: opacity 0.36s var(--ob-ease), transform 0.36s var(--ob-ease);
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
}

.ob-root[hidden] {
    display: none;
}

.ob-root.is-open {
    opacity: 1;
    transform: none;
}

body.ob-open {
    overflow: hidden;
}

/* ---------- Top bar: back + progress ---------- */
.ob-top {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    box-sizing: border-box;
    padding: calc(var(--safe-top, 0px) + 14px) 18px 4px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.ob-top.is-hidden {
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
}

.ob-back {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 2px solid var(--border);
    border-radius: 50%;
    background: var(--card-bg);
    color: var(--text-primary);
    box-shadow: 0 3px 0 var(--border);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s ease;
}

.ob-back:active {
    transform: translateY(3px);
    box-shadow: 0 0 0 var(--border);
}

.ob-back.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.ob-back svg {
    width: 20px;
    height: 20px;
}

.ob-progress {
    position: relative;
    flex: 1;
    height: 12px;
    border-radius: 999px;
    background: var(--bg-tertiary);
    overflow: hidden;
}

.ob-progress-fill {
    position: relative;
    height: 100%;
    border-radius: inherit;
    background: var(--grad-primary);
    transform-origin: left center;
    transform: scaleX(0);
    transition: transform 0.7s var(--ob-spring);
    overflow: hidden;
}

/* Light stripe on top, like a filled game gauge. */
.ob-progress-fill::before {
    content: '';
    position: absolute;
    left: 6px;
    right: 6px;
    top: 3px;
    height: 3px;
    border-radius: 999px;
    background: hsla(0, 0%, 100%, 0.35);
}

.ob-progress-fill.is-moving::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, hsla(0, 0%, 100%, 0.55), transparent);
    transform: translateX(-100%);
    animation: ob-shine 0.9s 0.25s var(--ob-ease) both;
}

@keyframes ob-shine {
    to { transform: translateX(100%); }
}

/* ---------- Screens ---------- */
.ob-stage {
    position: relative;
    z-index: 1;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.ob-screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    max-width: 560px;
    margin: 0 auto;
    padding: 14px 20px 12px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    transition: transform 0.42s var(--ob-ease), opacity 0.32s ease;
}

.ob-screen.is-entering.from-right { transform: translateX(48px); opacity: 0; }
.ob-screen.is-entering.from-left { transform: translateX(-48px); opacity: 0; }
.ob-screen.is-entering.from-fade { transform: translateY(14px); opacity: 0; }
.ob-screen.is-leaving { pointer-events: none; }
.ob-screen.is-leaving.to-left { transform: translateX(-48px); opacity: 0; }
.ob-screen.is-leaving.to-right { transform: translateX(48px); opacity: 0; }

.ob-head {
    margin: 6px 0 14px;
    text-align: center;
}

.ob-title {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.ob-sub {
    margin: 6px 0 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-secondary);
}

.is-pop {
    animation: ob-pop 0.36s var(--ob-spring);
}

@keyframes ob-pop {
    0% { transform: scale(1); }
    40% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

/* ---------- Footer ---------- */
.ob-footer {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    box-sizing: border-box;
    padding: 10px 20px calc(var(--safe-bottom, 0px) + 16px);
}

.ob-footer:empty {
    display: none;
}

.ob-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 58px;
    border: 0;
    border-radius: 20px;
    background: var(--grad-primary);
    color: #fff;
    font-family: inherit;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.01em;
    box-shadow: 0 5px 0 var(--primary-3d);
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.3s ease, filter 0.2s ease;
}

.ob-cta svg {
    width: 20px;
    height: 20px;
}

.ob-cta:active:not(:disabled) {
    transform: translateY(5px);
    box-shadow: 0 0 0 var(--primary-3d);
}

.ob-cta:disabled {
    filter: grayscale(1);
    opacity: 0.35;
    cursor: default;
}

.ob-footer.is-waiting .ob-cta {
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
}

.ob-link {
    padding: 10px;
    border: 0;
    background: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.ob-link:active {
    opacity: 0.6;
}

.ob-links.is-spacer {
    visibility: hidden;
    pointer-events: none;
}

.ob-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    column-gap: 4px;
}

/* ---------- 1. Goal: character pick ---------- */
.ob-screen-goal .ob-head {
    margin-bottom: 0;
}

.ob-pick {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
}

/* The stage takes all the height left: the bigger the phone, the bigger the rhino. */
.ob-pick-stage {
    --burst: var(--primary);
    position: relative;
    flex: 1 1 auto;
    min-height: 280px;
    max-height: 440px;
    margin: 0 -20px;
    touch-action: pan-y;
    cursor: grab;
}

.ob-pick-stage.is-dragging {
    cursor: grabbing;
}

/* Starburst behind the character: two sets of rays turning in opposite
   directions, fading out from a soft core. */
.ob-pick-burst {
    position: absolute;
    left: 50%;
    top: 54%;
    width: min(150%, 620px);
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--violet) 26%, transparent) 0%, color-mix(in srgb, var(--primary) 10%, transparent) 26%, transparent 48%);
    pointer-events: none;
}

.ob-pick-burst span {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--burst) 16%, transparent) 0deg 8deg, transparent 8deg 22.5deg);
    -webkit-mask: radial-gradient(circle, #000 10%, transparent 62%);
    mask: radial-gradient(circle, #000 10%, transparent 62%);
    animation: ob-spin 70s linear infinite;
}

.ob-pick-burst span + span {
    background: repeating-conic-gradient(from 11deg, color-mix(in srgb, var(--violet) 12%, transparent) 0deg 3deg, transparent 3deg 22.5deg);
    -webkit-mask: radial-gradient(circle, #000 6%, transparent 48%);
    mask: radial-gradient(circle, #000 6%, transparent 48%);
    animation-duration: 90s;
    animation-direction: reverse;
}

html[data-theme="dark"] .ob-pick-burst span {
    background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--burst) 26%, transparent) 0deg 8deg, transparent 8deg 22.5deg);
}

html[data-theme="dark"] .ob-pick-burst span + span {
    background: repeating-conic-gradient(from 11deg, color-mix(in srgb, var(--violet) 20%, transparent) 0deg 3deg, transparent 3deg 22.5deg);
}

@keyframes ob-spin {
    to { transform: rotate(360deg); }
}

@keyframes ob-pulse {
    0% { opacity: 0.9; transform: scale(0.94); }
    100% { opacity: 0; transform: scale(1.2); }
}

.ob-pick-shadow {
    position: absolute;
    left: 50%;
    bottom: 10px;
    width: 170px;
    height: 20px;
    margin-left: -85px;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(30, 27, 75, 0.24), transparent);
}

html[data-theme="dark"] .ob-pick-shadow {
    background: radial-gradient(closest-side, rgba(0, 0, 0, 0.45), transparent);
}

/* Position, size and fade are set inline every frame by
   layoutOnboardingGoal() (drag and spring alike), so no transition here.
   Every rhino stands the same height; --fit lets a raised prop overflow. */
.ob-hero {
    --fit: 1;
    position: absolute;
    left: 50%;
    bottom: 16px;
    z-index: 2;
    width: 300px;
    height: min(77%, 340px);
    margin-left: -150px;
    padding: 0;
    border: 0;
    outline: none;
    background: none;
    transform-origin: 50% 100%;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    will-change: transform, opacity;
}

.ob-hero img {
    position: absolute;
    left: 50%;
    bottom: 0;
    display: block;
    width: auto;
    max-width: none;
    height: calc(100% * var(--fit));
    transform: translateX(-50%);
    pointer-events: none;
    transition: filter 0.35s var(--ob-ease);
    -webkit-mask-image: linear-gradient(to bottom, #000 90%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 90%, transparent 100%);
}

/* Neighbours lose their colour. A fixed filter, not one recomputed per
   frame: repainting big images under the finger is what made it stutter. */
.ob-hero:not(.is-center) img {
    filter: saturate(0.2) brightness(0.88);
}

.ob-hero:focus-visible img {
    filter: drop-shadow(0 0 6px var(--primary));
}

.ob-hero.is-center.is-pop {
    animation: ob-hero-hop 0.5s var(--ob-spring);
}

@keyframes ob-hero-hop {
    0% { translate: 0 0; }
    35% { translate: 0 -14px; }
    100% { translate: 0 0; }
}

.ob-hero.is-far {
    pointer-events: none;
}

/* Objects floating around the character, one set per goal. */
.ob-pick-floats {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 1;
    width: min(86vw, 340px);
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.ob-float {
    position: absolute;
    width: 40px;
    height: 40px;
    opacity: 0;
    transform: scale(0.3) rotate(-30deg);
    transition: opacity 0.3s ease, transform 0.45s var(--ob-spring);
}

.ob-float svg {
    display: block;
    width: 100%;
    height: 100%;
    animation: ob-bob 3.2s ease-in-out infinite;
}

.ob-float-1 { top: 8%; left: 2%; }
.ob-float-2 { top: 2%; right: 6%; width: 34px; height: 34px; }
.ob-float-3 { top: 50%; right: -2%; width: 30px; height: 30px; }
.ob-float-4 { top: 58%; left: -2%; width: 32px; height: 32px; }

.ob-float-2 svg { animation-delay: -0.8s; animation-duration: 3.8s; }
.ob-float-3 svg { animation-delay: -1.6s; animation-duration: 2.9s; }
.ob-float-4 svg { animation-delay: -2.2s; animation-duration: 3.5s; }

.ob-pick[data-goal="muscle"] .ob-float[data-for="muscle"],
.ob-pick[data-goal="fat"] .ob-float[data-for="fat"],
.ob-pick[data-goal="recomp"] .ob-float[data-for="recomp"],
.ob-pick[data-goal="strength"] .ob-float[data-for="strength"],
.ob-pick[data-goal="restart"] .ob-float[data-for="restart"] {
    opacity: 1;
    transform: none;
    transition-delay: calc(var(--d, 0) * 1ms);
}

.ob-float-2 { --d: 60; }
.ob-float-3 { --d: 120; }
.ob-float-4 { --d: 180; }

@keyframes ob-bob {
    0%, 100% { transform: translateY(0) rotate(-6deg); }
    50% { transform: translateY(-10px) rotate(8deg); }
}

/* Title between two round 3D arrows. */
.ob-pick-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.ob-pick-arrow {
    flex: none;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 2px solid var(--border);
    border-radius: 50%;
    background: var(--card-bg);
    box-shadow: 0 4px 0 var(--border);
    color: var(--text-primary);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.2s ease;
}

.ob-pick-arrow svg {
    width: 22px;
    height: 22px;
}

.ob-pick-arrow.is-next svg {
    transform: scaleX(-1);
}

.ob-pick-arrow:active:not(:disabled) {
    transform: translateY(4px);
    box-shadow: 0 0 0 var(--border);
}

.ob-pick-arrow:disabled {
    opacity: 0.3;
    cursor: default;
}

.ob-pick-copy {
    flex: 1;
    min-width: 0;
    text-align: center;
}

@keyframes ob-copy-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

.ob-pick-title {
    margin: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: clamp(20px, 6.2vw, 26px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.ob-pick-sub {
    margin: 4px 0 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
}

.ob-pick-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
}

.ob-pick-dots span {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--border);
    transition: width 0.35s var(--ob-spring), background 0.25s ease;
}

.ob-pick-dots span.is-on {
    width: 22px;
    background: var(--primary);
}


/* ---------- 2. Level: growing bars ---------- */
.ob-level {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding-bottom: 12px;
}

.ob-bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 18px;
    height: clamp(150px, 26vh, 210px);
    margin-bottom: 12px;
}

.ob-bar {
    --f: 0;
    position: relative;
    width: 66px;
    height: calc(var(--h) * 100%);
    padding: 0;
    border: 0;
    border-radius: 20px;
    /* Pale bar in both themes, like the level illustration. */
    background: hsl(246, 56%, 93%);
    box-shadow: 0 5px 0 hsl(248, 42%, 85%);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.35s var(--ob-spring), box-shadow 0.2s ease;
}

.ob-bar-fill {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--grad-primary);
    transform-origin: 50% 100%;
    transform: scaleY(var(--f));
    transition: transform 0.14s ease-out;
}

/* Light reflection on filled bars */
.ob-bar-fill::after {
    content: '';
    position: absolute;
    left: 10px;
    top: 10px;
    width: 8px;
    height: 34%;
    border-radius: 999px;
    background: hsla(0, 0%, 100%, 0.28);
}

.ob-bar.is-full {
    box-shadow: 0 5px 0 var(--primary-3d);
}

.ob-bar.is-current {
    transform: translateY(-6px);
}

.ob-level-copy {
    text-align: center;
    min-height: 66px;
}

.ob-level-title {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.ob-level-sub {
    margin: 4px 0 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
}

.ob-range {
    --fill: 50%;
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    max-width: 340px;
    height: 14px;
    margin: 18px 0 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary) 0 var(--fill), var(--bg-tertiary) var(--fill) 100%);
    outline: none;
    touch-action: pan-y;
}

.ob-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 5px solid var(--primary);
    box-shadow: 0 4px 0 var(--primary-3d);
    cursor: grab;
    transition: transform 0.15s ease;
}

.ob-range:active::-webkit-slider-thumb {
    transform: scale(1.15);
    cursor: grabbing;
}

.ob-range::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 5px solid var(--primary);
    box-shadow: 0 4px 0 var(--primary-3d);
    cursor: grab;
}

.ob-range-scale {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 340px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-muted);
}

/* ---------- 3. Rhythm: sessions slider + duration ring ---------- */
.ob-screen-rhythm .ob-head {
    margin-bottom: 8px;
}

.ob-rhythm {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    gap: 16px;
}

.ob-block-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.ob-block-label {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
}

.ob-block-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
}

.ob-block-value b {
    display: inline-block;
    font-family: 'Nunito', 'Inter', sans-serif;
    font-size: 22px;
    font-weight: 900;
    color: var(--primary);
}

/* Sessions: a big number, then a chunky slider with seven notches. */
.ob-days-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    margin: 4px 0 10px;
}

.ob-days-value b {
    display: inline-block;
    font-family: 'Nunito', 'Inter', sans-serif;
    font-size: 72px;
    font-weight: 900;
    line-height: 1;
    color: var(--text-primary);
}

.ob-days-value span {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-secondary);
}

.ob-days {
    --p: 0.33;
    position: relative;
    height: 44px;
    touch-action: none;
    cursor: pointer;
    outline: none;
}

.ob-days-track {
    position: absolute;
    left: 18px;
    right: 18px;
    top: 50%;
    height: 14px;
    margin-top: -7px;
    border-radius: 999px;
    background: var(--bg-tertiary);
}

.ob-days-fill {
    position: absolute;
    left: -18px;
    top: 0;
    bottom: 0;
    width: calc(18px + (100% * var(--p)));
    border-radius: 999px;
    background: var(--grad-primary);
    transition: width 0.3s var(--ob-spring);
}

.ob-days-notch {
    position: absolute;
    top: 50%;
    left: calc(18px + (100% - 36px) * var(--n));
    width: 6px;
    height: 6px;
    margin: -3px 0 0 -3px;
    border-radius: 50%;
    background: var(--text-muted);
    opacity: 0.5;
    pointer-events: none;
}

.ob-days-notch.is-on {
    background: #fff;
    opacity: 0.85;
}

.ob-days-thumb {
    position: absolute;
    top: 50%;
    left: calc(18px + (100% - 36px) * var(--p));
    width: 36px;
    height: 36px;
    margin: -21px 0 0 -18px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--primary);
    box-shadow: 0 4px 0 var(--primary-3d);
    transition: left 0.3s var(--ob-spring), transform 0.2s var(--ob-spring);
    pointer-events: none;
}

.ob-days.is-active .ob-days-thumb {
    transform: scale(1.15);
}

.ob-days.is-active .ob-days-fill,
.ob-days.is-active .ob-days-thumb {
    transition-duration: 0.18s;
}

.ob-days:focus-visible .ob-days-thumb {
    outline: 3px solid var(--tint-primary-strong);
    outline-offset: 2px;
}

.ob-days-scale {
    display: flex;
    justify-content: space-between;
    padding: 0 13px;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-muted);
}

/* Duration: one thick ring and a knob to drag round it. */
.ob-dial {
    position: relative;
    width: min(220px, 30vh);
    aspect-ratio: 1;
    margin: 0 auto;
    touch-action: none;
    cursor: pointer;
    outline: none;
}

.ob-dial svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.ob-dial-track,
.ob-dial-arc {
    fill: none;
    stroke-width: 20;
}

.ob-dial-track {
    stroke: var(--bg-tertiary);
}

.ob-dial-arc {
    stroke: url(#ob-dial-grad);
    stroke-linecap: round;
    transition: stroke-dasharray 0.3s var(--ob-ease);
}

.ob-dial-hand {
    transform-box: view-box;
    transform-origin: 110px 110px;
    transition: transform 0.3s var(--ob-ease);
}

.ob-dial-hand circle {
    fill: #fff;
    stroke: var(--primary);
    stroke-width: 5;
    transition: r 0.2s var(--ob-spring);
}

.ob-dial.is-active .ob-dial-hand circle {
    r: 20;
}

.ob-dial.is-active .ob-dial-arc,
.ob-dial.is-active .ob-dial-hand {
    transition-duration: 0.15s;
}

.ob-dial:focus-visible .ob-dial-track {
    stroke: var(--tint-primary-strong);
}

.ob-dial-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.ob-dial-center strong {
    font-family: 'Nunito', 'Inter', sans-serif;
    font-size: 56px;
    font-weight: 900;
    line-height: 1;
    color: var(--text-primary);
}

.ob-dial-center span {
    margin-top: 2px;
    font-size: 15px;
    font-weight: 800;
    color: var(--text-secondary);
}


/* ---------- 4. Focus: a checklist on paper ---------- */
.ob-note {
    position: relative;
    margin: 12px 4px 8px;
    padding: 18px 0 8px;
    border-radius: 6px 6px 20px 20px;
    background-color: var(--card-bg);
    /* Ruled lines under each item */
    background-image: linear-gradient(to bottom, transparent calc(100% - 1.5px), var(--border) calc(100% - 1.5px));
    background-size: 100% 46px;
    background-position: 0 18px;
    box-shadow: 0 4px 0 var(--border), 0 18px 30px -22px rgba(30, 27, 75, 0.45);
    transform: rotate(-0.8deg);
}

/* Masking tape: see-through, torn ends, the paper edge shows under it. */
.ob-note-tape {
    position: absolute;
    top: -15px;
    left: 50%;
    width: 108px;
    height: 30px;
    margin-left: -54px;
    background:
        linear-gradient(to bottom, rgba(255, 255, 255, 0.35), transparent 45%, rgba(255, 255, 255, 0.12)),
        repeating-linear-gradient(90deg, transparent 0 3px, rgba(255, 255, 255, 0.10) 3px 4px),
        color-mix(in srgb, var(--gold) 34%, transparent);
    clip-path: polygon(
        3% 0, 97% 0, 100% 12%, 96% 26%, 99.5% 41%, 96.5% 57%, 100% 71%, 97% 86%, 99% 100%,
        2% 100%, 0 87%, 3.5% 73%, 0.5% 58%, 4% 43%, 0 29%, 3% 15%, 0.5% 4%
    );
    transform: rotate(-3deg);
    pointer-events: none;
}

html[data-theme="dark"] .ob-note-tape {
    background:
        linear-gradient(to bottom, rgba(255, 255, 255, 0.14), transparent 45%),
        repeating-linear-gradient(90deg, transparent 0 3px, rgba(255, 255, 255, 0.05) 3px 4px),
        color-mix(in srgb, var(--gold) 42%, transparent);
}

.ob-note-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ob-note-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    height: 46px;
    padding: 0 18px;
    border: 0;
    background: none;
    color: var(--text-secondary);
    font-family: 'Nunito', 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s ease;
}

.ob-note-item.is-checked {
    color: var(--text-primary);
}

.ob-note-box {
    position: relative;
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border: 2.5px solid var(--text-muted);
    border-radius: 8px;
    transition: border-color 0.2s ease, transform 0.3s var(--ob-spring);
}

.ob-note-item.is-checked .ob-note-box {
    border-color: var(--primary-dark);
    transform: rotate(-4deg);
}

/* Checking = a highlighter swipe over the box and the word. */
.ob-note-ink {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.ob-note-ink > .ob-note-box,
.ob-note-ink > .ob-note-label {
    position: relative;
}

.ob-note-hl {
    position: absolute;
    left: -9px;
    right: -10px;
    top: 50%;
    width: calc(100% + 19px);
    height: 34px;
    margin-top: -17px;
    overflow: visible;
    fill: var(--violet);
    fill-opacity: 0.44;
    mix-blend-mode: multiply;
    transform: translateY(var(--hl-y, 0)) rotate(var(--hl-tilt, 0deg));
    clip-path: inset(-20% 100% -20% 0);
    opacity: 0;
    transition: clip-path 0s 0.18s, opacity 0.18s ease;
}

.ob-note-hl-pass {
    fill-opacity: 0.26;
}

.ob-note-item.is-checked .ob-note-hl {
    clip-path: inset(-20% -2% -20% 0);
    opacity: 1;
    transition: clip-path 0.34s var(--ob-ease), opacity 0s;
}

html[data-theme="dark"] .ob-note-hl {
    fill-opacity: 0.58;
    mix-blend-mode: normal;
}

html[data-theme="dark"] .ob-note-hl-pass {
    fill-opacity: 0.25;
}

.ob-note-label {
    min-width: 0;
}

.ob-note-icon {
    margin-left: auto;
    width: 30px;
    height: 30px;
    object-fit: contain;
    opacity: 0.55;
    filter: grayscale(0.6);
    transition: opacity 0.2s ease, filter 0.2s ease, transform 0.3s var(--ob-spring);
}

.ob-note-item.is-checked .ob-note-icon {
    opacity: 1;
    filter: none;
    transform: scale(1.1);
}

/* ---------- 5. Equipment: three places ---------- */
.ob-places {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    margin: 4px 0 8px;
}

.ob-place {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 112px;
    padding: 12px 12px 12px 18px;
    border: 2px solid var(--border);
    border-radius: 24px;
    background: var(--card-bg);
    box-shadow: 0 4px 0 var(--border);
    color: var(--text-primary);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    animation: ob-rise 0.5s var(--ob-spring) both;
    animation-delay: calc(var(--i) * 70ms);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.3s ease, transform 0.12s ease;
}

.ob-place:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 var(--border);
}

.ob-place-radio {
    flex: none;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2.5px solid var(--border);
    color: transparent;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.35s var(--ob-spring);
}

.ob-place-radio svg {
    width: 16px;
    height: 16px;
}

.ob-place-copy {
    flex: 1;
    min-width: 0;
}

.ob-place-copy strong {
    display: block;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.ob-place-copy small {
    display: block;
    margin-top: 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.ob-place-art {
    flex: none;
    width: 112px;
}

.ob-place-art svg {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.45s var(--ob-spring);
}

.ob-places.has-choice .ob-place:not(.is-selected) {
    opacity: 0.6;
}

.ob-place.is-selected {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 7%, var(--card-bg));
    box-shadow: 0 4px 0 var(--primary-3d);
}

.ob-place.is-selected .ob-place-radio {
    border-color: transparent;
    background: var(--primary);
    color: #fff;
    transform: scale(1.12);
}

.ob-place.is-selected .ob-place-art svg {
    transform: scale(1.1) rotate(-3deg);
}

@keyframes ob-rise {
    from { opacity: 0; transform: translateY(26px); }
    to { opacity: 1; transform: none; }
}


/* ---------- Building, then the ready program ---------- */
.ob-screen-building {
    justify-content: center;
}

.ob-build {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ob-loader {
    position: relative;
    width: min(78vw, 300px);
    aspect-ratio: 1;
    transition: transform 0.5s var(--ob-ease), opacity 0.35s ease;
}

.ob-loader svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.ob-loader-track,
.ob-loader-progress,
.ob-loader-sweep {
    fill: none;
    stroke-width: 18;
}

.ob-loader-track {
    stroke: var(--bg-tertiary);
}

.ob-loader-progress {
    stroke: url(#ob-loader-grad);
    stroke-linecap: round;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 0.6s var(--ob-ease);
}

/* A short light running round the ring the whole time. */
.ob-loader-sweep {
    stroke: #fff;
    stroke-opacity: 0.35;
    stroke-linecap: round;
    stroke-dasharray: 9 91;
    transform-box: view-box;
    transform-origin: 50% 50%;
    animation: ob-spin 1.3s linear infinite;
}

.ob-loader {
    animation: ob-loader-breathe 1.8s ease-in-out infinite;
}

@keyframes ob-loader-breathe {
    0%, 100% { scale: 1; }
    50% { scale: 1.03; }
}

.ob-loader-center {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: baseline;
    justify-content: center;
    padding-top: calc(50% - 34px);
    box-sizing: border-box;
    color: var(--text-primary);
}

.ob-loader-center strong {
    font-family: 'Nunito', 'Inter', sans-serif;
    font-size: 58px;
    font-weight: 900;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.ob-loader-center span {
    margin-left: 2px;
    font-family: 'Nunito', 'Inter', sans-serif;
    font-size: 24px;
    font-weight: 900;
    color: var(--text-secondary);
}

.ob-loader-text {
    margin: 26px 0 0;
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    transition: opacity 0.3s ease;
}

.ob-loader-text.is-swap {
    animation: ob-copy-in 0.3s var(--ob-ease);
}

.ob-ready {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    pointer-events: none;
    opacity: 0;
}

/* Green check popping out of a slow starburst. */
.ob-ready-hero {
    position: relative;
    width: 84px;
    height: 84px;
    margin: 0 auto 20px;
}

.ob-ready-rays {
    position: absolute;
    inset: -70px;
    border-radius: 50%;
    background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--success) 22%, transparent) 0deg 9deg, transparent 9deg 24deg);
    -webkit-mask: radial-gradient(circle, #000 20%, transparent 66%);
    mask: radial-gradient(circle, #000 20%, transparent 66%);
    animation: ob-spin 30s linear infinite;
}

.ob-ready-badge {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--grad-success);
    box-shadow: 0 6px 0 var(--success-3d);
    color: #fff;
}

.ob-ready-badge svg {
    width: 44px;
    height: 44px;
}

/* The sessions: one card, rows split by hairlines. */
.ob-ready-list {
    margin-top: 22px;
    border: 2px solid var(--border);
    border-radius: 24px;
    background: var(--card-bg);
    box-shadow: 0 4px 0 var(--border);
    text-align: left;
    overflow: hidden;
}

.ob-ready-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    opacity: 0;
}

.ob-ready-row + .ob-ready-row,
.ob-ready-more {
    border-top: 1px solid var(--border-light);
}

.ob-ready-swatch {
    flex: none;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: var(--session-accent);
    box-shadow: 0 3px 0 color-mix(in srgb, var(--session-accent) 70%, #000);
    color: #fff;
    font-size: 18px;
    font-weight: 900;
}

.ob-ready-body {
    flex: 1;
    min-width: 0;
}

.ob-ready-body strong,
.ob-ready-body small {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ob-ready-body strong {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
}

.ob-ready-body small {
    margin-top: 2px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.ob-ready-meta {
    flex: none;
    text-align: right;
}

.ob-ready-meta b {
    display: block;
    font-family: 'Nunito', 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 900;
    color: var(--text-primary);
}

.ob-ready-meta small {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.ob-ready-more {
    margin: 0;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    color: var(--text-secondary);
    opacity: 0;
}

.ob-build.is-ready .ob-loader {
    transform: scale(0.3);
    opacity: 0;
}

.ob-build.is-ready .ob-loader-text {
    opacity: 0;
}

.ob-build.is-ready .ob-ready {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.3s 0.15s ease;
}

.ob-build.is-ready .ob-ready-badge {
    animation: ob-badge-in 0.6s 0.15s var(--ob-spring) both;
}

.ob-build.is-ready .ob-ready-rays {
    animation: ob-rays-in 0.6s 0.2s var(--ob-ease) both, ob-spin 30s linear infinite;
}

.ob-build.is-ready .ob-ready .ob-title,
.ob-build.is-ready .ob-ready .ob-sub {
    animation: ob-copy-in 0.4s 0.3s var(--ob-ease) both;
}

.ob-build.is-ready .ob-ready-list {
    animation: ob-card-up 0.6s 0.4s var(--ob-spring) both;
}

.ob-build.is-ready .ob-ready-row,
.ob-build.is-ready .ob-ready-more {
    animation: ob-copy-in 0.4s var(--ob-ease) both;
    animation-delay: calc(560ms + var(--i) * 90ms);
}

@keyframes ob-badge-in {
    from { transform: scale(0) rotate(-40deg); }
    to { transform: none; }
}

@keyframes ob-rays-in {
    from { opacity: 0; scale: 0.4; }
    to { opacity: 1; scale: 1; }
}

@keyframes ob-card-up {
    from { opacity: 0; transform: translateY(60px) scale(0.96); }
    to { opacity: 1; transform: none; }
}


/* ---------- Name: centred in the screen ---------- */
.ob-screen-name {
    justify-content: center;
    padding-bottom: 8vh;
}

.ob-name {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.ob-input {
    width: 100%;
    box-sizing: border-box;
    height: 64px;
    padding: 0 20px;
    border: 2px solid var(--border);
    border-radius: 20px;
    background: var(--card-bg);
    box-shadow: 0 4px 0 var(--border);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 22px;
    font-weight: 800;
    text-align: center;
    outline: none;
    -webkit-user-select: text;
    user-select: text;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ob-input::placeholder {
    color: var(--text-muted);
    font-weight: 700;
}

.ob-input:focus {
    border-color: var(--primary);
    box-shadow: 0 4px 0 var(--primary-3d);
}

.ob-hint {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    color: var(--text-muted);
}

/* ---------- "I already have a program" ---------- */
.ob-own {
    display: flex;
    flex-direction: column;
    margin-top: 6px;
    border-radius: 24px;
    background: var(--card-bg);
    border: 2px solid var(--border-light);
    box-shadow: 0 4px 0 var(--border);
    overflow: hidden;
}

.ob-own-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border: 0;
    background: none;
    color: var(--text-primary);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.ob-own-row + .ob-own-row {
    border-top: 1px solid var(--border-light);
}

.ob-own-row:active {
    background: var(--tint-primary);
}

.ob-own-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.ob-own-icon svg {
    width: 24px;
    height: 24px;
}

.ob-own-copy strong {
    display: block;
    font-size: 16px;
    font-weight: 800;
}

.ob-own-copy small {
    display: block;
    margin-top: 2px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ---------- Calorie sheet: the coach pops out of the top edge ---------- */
.bottom-sheet.calorie-sheet > .sheet-content {
    overflow: visible;
    padding-top: 0;
    text-align: center;
}

.calorie-sheet .sheet-close {
    position: absolute;
    top: 14px;
    right: 14px;
    float: none;
    margin: 0;
    z-index: 3;
}

.calorie-art {
    position: relative;
    width: 220px;
    height: 150px;
    margin: -72px auto 12px;
    pointer-events: none;
}

/* A round bump of the sheet itself, tinted inside, with a slow orbit and a pulse. */
.calorie-disc {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 144px;
    height: 144px;
    margin-left: -72px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 46%, var(--tint-primary-strong) 0%, var(--tint-primary) 58%, transparent 70%),
        var(--card-bg);
    animation: calorie-disc-in 0.5s var(--ease-spring, cubic-bezier(0.34, 1.56, 0.64, 1)) both;
}

/* Light starburst behind the coach: soft rays fading outward. */
.calorie-burst {
    position: absolute;
    inset: -34px;
    border-radius: 50%;
    background: repeating-conic-gradient(from 0deg, var(--tint-primary) 0deg 7deg, transparent 7deg 22.5deg);
    -webkit-mask-image: radial-gradient(circle, transparent 36%, #000 52%, transparent 71%);
    mask-image: radial-gradient(circle, transparent 36%, #000 52%, transparent 71%);
    opacity: 0.9;
}

.calorie-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 3px solid var(--tint-primary-strong);
    animation: ob-pulse 2.8s ease-out infinite;
}

.calorie-art img {
    position: absolute;
    left: 50%;
    bottom: 2px;
    width: 176px;
    height: 176px;
    object-fit: contain;
    margin-left: -88px;
    animation: calorie-rhino-in 0.6s 0.12s var(--ease-spring, cubic-bezier(0.34, 1.56, 0.64, 1)) both;
}

@keyframes calorie-disc-in {
    from { transform: scale(0.6); opacity: 0; }
    to { transform: none; opacity: 1; }
}

@keyframes calorie-rhino-in {
    from { transform: translateY(36px) scale(0.85); opacity: 0; }
    to { transform: none; opacity: 1; }
}

.calorie-sheet .sheet-content h3 {
    position: relative;
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.calorie-sheet-text {
    max-width: 320px;
    margin: 0 auto 16px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-secondary);
}

.set-profile-stats.calorie-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 18px;
    text-align: left;
}

.calorie-stats .set-row.set-stat {
    padding: 14px 16px;
    border-radius: 18px;
    cursor: pointer;
}

.calorie-stats .set-stat .set-label {
    font-size: 13px;
}

.calorie-stats .set-stat .set-pick {
    font-size: 30px;
    cursor: pointer;
}

.calorie-sheet .calorie-enable,
.calorie-sheet .calorie-skip {
    width: 100%;
}

.calorie-sheet .calorie-skip {
    margin-top: 10px;
}

.calorie-later {
    margin: 12px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
    .calorie-pulse { animation: none; }
}

/* ---------- Short screens ---------- */
@media (max-height: 700px) {
    .ob-title { font-size: 23px; }
    .ob-head { margin-bottom: 8px; }
    .ob-note-item { height: 40px; font-size: 16.5px; }
    .ob-note { background-size: 100% 40px; }
    .ob-dial { width: min(190px, 28vh); }
    .ob-days-value b { font-size: 60px; }
}

@media (prefers-reduced-motion: reduce) {
    .ob-pick-burst span,
    .ob-float svg,
    .ob-loader,
    .ob-loader-sweep,
    .ob-ready-rays {
        animation: none;
    }

    .ob-hero,
    .ob-place,
    .ob-days-fill,
    .ob-days-thumb,
    .ob-progress-fill {
        transition-duration: 0.01ms;
    }
}

/* ===== Help bubbles (data-help="key", see onboarding.js) ===== */
.help-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.help-dot {
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-left: 4px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--tint-primary-strong);
    color: var(--primary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    vertical-align: middle;
    cursor: pointer;
}

.help-dot:active {
    transform: scale(0.9);
}

.help-sheet {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.help-sheet[hidden] {
    display: none;
}

.help-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(30, 27, 75, 0.42);
    opacity: 0;
    transition: opacity 0.22s ease;
}

.help-sheet-card {
    position: relative;
    width: 100%;
    max-width: 520px;
    box-sizing: border-box;
    padding: 22px 20px calc(var(--safe-bottom, 0px) + 18px);
    border-radius: 24px 24px 0 0;
    background: var(--card-bg);
    color: var(--text-primary);
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.help-sheet.is-open .help-sheet-backdrop {
    opacity: 1;
}

.help-sheet.is-open .help-sheet-card {
    transform: none;
}

.help-sheet-body h3 {
    margin: 0 0 10px;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.help-sheet-body p {
    margin: 0 0 10px;
    font-size: 15px;
    line-height: 1.45;
    color: var(--text-secondary);
}

.help-sheet-body strong {
    color: var(--text-primary);
}

.help-sheet-ok {
    width: 100%;
    min-height: 52px;
    margin-top: 8px;
    border: 0;
    border-radius: 16px;
    background: var(--grad-primary);
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 800;
    box-shadow: 0 4px 0 var(--primary-3d);
    cursor: pointer;
}

.help-sheet-ok:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 var(--primary-3d);
}
