:root{color-scheme:dark;--bg:#111214;--card:#1b1d20;--muted:#c0c2c8;--line:#35373c;--red:#ee4054}*{box-sizing:border-box}body{margin:0 auto;max-width:720px;padding:20px clamp(18px,5vw,46px);background:var(--bg);color:#fafafa;font:16px/1.55 system-ui,sans-serif}header,footer,.row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}header{padding:8px 0 20px;border-bottom:1px solid var(--line)}header span,small{font-size:.8rem;color:var(--muted);font-weight:650}.wordmark{font-weight:950;letter-spacing:-.05em;font-size:1.5rem}.wordmark b{background:#bd192f;border-radius:7px;padding:4px 7px}h1{font-size:clamp(2.8rem,10vw,5rem);line-height:.98;letter-spacing:-.065em;margin:20px 0}h2{font-size:1.25rem;margin:0 0 8px}p{color:var(--muted)}main{padding-top:20px}.card{padding:18px;margin:14px 0;background:var(--card);border:1px solid var(--line);border-radius:18px}.accent{color:#ff7887}button,input,select{font:inherit}button{cursor:pointer;color:#fff;border:1px solid var(--line);background:#23252b;padding:10px 15px;border-radius:10px;font-weight:700;min-height:44px}.primary{background:#bd192f;border-color:#bd192f}.full{width:100%;margin:5px 0}label{display:grid;gap:7px;margin:13px 0}input,select{color:#fff;background:#141518;border:1px solid #666;padding:10px;border-radius:8px;width:100%}progress{width:100%;accent-color:var(--red)}footer{margin-top:28px;border-top:1px solid var(--line);padding-top:10px}footer button{background:none;border:0;padding:0}a{color:#92efd1}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid #92efd1;outline-offset:3px}#status:empty{display:none}#status{color:#c8f9e0}.count{font-size:2.4rem;font-weight:850;line-height:1}.tasks button{text-align:left}label.inline{display:flex;align-items:center}label.inline input{width:auto}.tabs{position:sticky;bottom:0;background:var(--bg);padding:9px 0;display:flex;gap:8px}.tabs button{flex:1}.tabs button[aria-current=page]{border-color:#70e6c0;color:#b5ffd7}button:disabled{opacity:.55}
[hidden]{display:none!important}

:root {
    --bg: #0b1617;
    --card: #142426;
    --line: #375350;
    --muted: #b7cfcb;
    --red: #b8f783;
}
body {
    max-width: 740px;
    min-height: 100dvh;
    background: radial-gradient(ellipse at 85% 0%, #174942 0%, transparent 38rem), var(--bg);
    font-family: "Avenir Next", system-ui, sans-serif;
}
body.has-tabs { padding-bottom: 108px; }
header { border-color: #c5fff318; }
.wordmark b { background: #2b7563; }
main { padding-top: 26px; }
h1 { font-size: clamp(2.45rem, 8vw, 4.5rem); line-height: 1.02; }
h1 em { font-style: normal; color: #b8f783; }
h3 { margin: 0; font-size: 1rem; }
.card {
    padding: clamp(16px, 4vw, 25px);
    margin: 18px 0;
    border-radius: 22px;
    background: linear-gradient(145deg, #193438, var(--card) 70%);
}
button { border-radius: 14px; background: #1a3534; transition: background .18s, border-color .18s; }
button:hover { border-color: #b8f783; }
button.primary {
    color: #102722;
    background: linear-gradient(107deg, #d7ff9e, #b8f783);
    border-color: #bcf38c;
    box-shadow: 0 8px 28px #b8f78326;
}
button.full { min-height: 52px; }
button.quiet { background: transparent; }
button[aria-pressed=true] { border-color: #a7f4cd; background: #244a40; }
.hero { position: relative; isolation: isolate; padding-top: 190px; }
.dashboard-hero { position: relative; isolation: isolate; padding: 12px 0; }
.orbital {
    position: absolute;
    z-index: -1;
    inset: 0 0 auto;
    height: 210px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: radial-gradient(ellipse at center, #56c2a63d, transparent 68%);
}
.dashboard-hero .orbital { left: auto; width: 165px; height: 112px; opacity: .65; }
.choices,.awards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 20px 0; }
.choice { display: grid; justify-items: start; gap: 16px; min-height: 100px; padding: 15px; text-align: left; font-size: 1.1rem; }
.symbol { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: #72efc823; color: #abeed8; font-size: 1.4rem; }
.segments { display: flex; gap: 4px; margin: 10px 0; padding: 0 2px; }
.segments span { flex: 1; height: 11px; transform: skewX(-20deg); background: #31514d; }
.segments .lit { background: linear-gradient(100deg,#d7ff9e,#71e4c6); box-shadow: 0 0 14px #61eaaa4a; }
.puff-card { background: radial-gradient(ellipse at top right,#235c4d,transparent 75%),var(--card); }
.puff-card .count { font: 900 clamp(3.8rem,13vw,6rem)/1 system-ui; letter-spacing: -.07em; font-variant-numeric: tabular-nums; }
.puff-card p { margin: 5px 0 14px; }
.puff-card .segments span { height: 21px; }
.scale { font-size: .75rem; color: var(--muted); }
.puff-actions { display: flex; gap: 8px; margin-top: 14px; }
.puff-actions .primary { flex: 1; }
.mission { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.mission:last-child { border-bottom: 0; }
.mission p { margin: 3px 0 0; font-size: .94rem; }
.mission button { flex: 0 0 auto; padding: 8px 10px; }
.awards { grid-template-columns: repeat(3,minmax(0,1fr)); margin-bottom: 0; gap: 8px; }
.award { display: grid; align-content: start; gap: 8px; border: 1px solid var(--line); padding: 10px; border-radius: 14px; overflow-wrap: anywhere; }
.award.earned { border-color: #e7a270; }
.award.earned .symbol { background: #ffcd9140; color: #ffdc9c; }
.tabs {
    position: fixed;
    z-index: 10;
    bottom: max(10px,env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    width: min(calc(100% - 24px), 600px);
    background: #112b2aee;
    border: 1px solid #466f65;
    border-radius: 22px;
    padding: 7px;
    box-shadow: 0 10px 35px #0009;
    backdrop-filter: blur(16px);
}
.tabs button { display: grid; justify-items: center; gap: 0; border-color: transparent; background: transparent; font-size: .78rem; padding: 4px 6px; }
.tabs button span { font-size: 1.45rem; line-height: 1.15; }
.tabs button[aria-current=page] { background: #225045; }

.next-step {
    padding: 14px 12px;
    border: 1px solid #8eeac6;
    border-radius: 14px;
    background: #1b433d;
}
.next-step:last-of-type { border-bottom: 1px solid #8eeac6; }
.habit-week {
    list-style: none;
    margin: 14px 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(7,minmax(0,1fr));
    gap: 4px;
}
.habit-week li {
    text-align: center;
    display: grid;
    justify-items: center;
    gap: 4px;
    padding: 5px 0;
    border-radius: 8px;
    font-size: .72rem;
    background: #21413e;
}
.habit-week .logged { color: #0d2423; background: #b8f783; }
.roadmap { margin: 10px 0 0; padding-left: 1.4rem; }
.roadmap li { padding: 6px 0 6px 5px; }
.roadmap li[aria-current=step] strong { color: #b8f783; }
.roadmap p { margin: 3px 0; }

.wordmark { display: flex; align-items: center; gap: 8px; }
.wordmark img { width: 30px; height: 30px; }
.brand-hero {
    width: 133px;
    transform: rotate(-8deg);
    filter: drop-shadow(0 14px 26px #081a15a0);
}
.dashboard-hero .brand-hero { width: 65px; }
.opening {
    position: fixed;
    inset: 0;
    z-index: 20;
    background: #f4fff9;
    color: #0d2523;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 13px;
    pointer-events: none;
    animation: opening-in 950ms both;
}
.opening img { width: 94px; }
.opening strong { letter-spacing: .16em; font-size: .86rem; }
@keyframes opening-in {
    0%, 58% { opacity: 1; }
    100% { opacity: 0; visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) {
    .opening { display: none; }
    button { transition: none; }
}
.savings-amount {
    font-size: clamp(2.8rem, 11vw, 5.2rem);
    font-weight: 900;
    letter-spacing: -.065em;
    line-height: 1.1;
    color: #b8f783;
}
.plan-answer { padding: 9px 0; border-bottom: 1px solid var(--line); }
.plan-answer:last-child { border-bottom: none; }
.fallback { border-left: 3px solid #8eeac6; padding-left: 12px; }

.portrait {
    background: #203a36 url('/portraits.jpg') no-repeat;
    background-size: 200% 400%;
    background-position: 0 var(--row,0%);
    aspect-ratio: 4/3;
    border-radius: 22px;
}
.portrait.person-1 { --row: 33.333%; }
.portrait.person-2 { --row: 66.667%; }
.portrait.person-3 { --row: 100%; }
.portrait.onward { background-position: 100% var(--row,0%); }
.portrait-hero { padding: 0; }
.portrait-hero .portrait { max-width: 440px; aspect-ratio: 4/3; margin: 0 auto; }
.wizard { position: relative; isolation: isolate; }
.wizard > .portrait {
    position: absolute;
    z-index: -1;
    right: 0;
    top: 0;
    width: min(74%,430px);
    opacity: .32;
    mask-image: linear-gradient(to bottom,black 15%,transparent 100%),linear-gradient(to left,black 45%,transparent 100%);
    mask-composite: intersect;
}
.wizard .choice { background: #1a3534ec; }
.wizard .choice[aria-pressed=true] { background: #245747; }
.portrait-reveal { display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; margin: 18px 0; }
.portrait-reveal .portrait { border-radius: 12px; }
.score-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.score-grid > div { display: grid; align-content: start; gap: 5px; padding: 8px; background: #213f3b; border-radius: 13px; }
.score-grid strong { color: #b8f783; font-size: clamp(1.1rem,4vw,1.65rem); }
.checkin-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.savings-jar { margin-top: 16px; display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 15px; background: #163933; }
.savings-jar strong { color: #b8f783; display: block; font-size: 1.7rem; }
.jar-icon { display: grid; place-items: center; flex: 0 0 50px; height: 62px; border: 2px solid #b8f783; border-top: 6px solid #b8f783; border-radius: 7px 7px 15px 15px; color: #b8f783; font-size: 1.5rem; font-weight: 800; }
.pace-chart { list-style: none; padding: 0; margin: 0; }
.pace-chart li { display: grid; grid-template-columns: 65px minmax(0,1fr) 44px; gap: 8px; align-items: center; font-size: .85rem; margin: 5px 0; }
.pace-chart meter { width: 100%; height: 12px; }
.pace-chart strong { text-align: right; }
.pace-line { display: block; width: 100%; max-height: 130px; }
.pace-axis,.pace-path { fill: none; stroke: #4a7568; stroke-width: 2; }
.pace-path { stroke: #b8f783; stroke-linejoin: round; stroke-width: 4; }
.sos-float { position: fixed; z-index: 11; right: max(14px,calc((100% - 600px)/2)); bottom: max(83px,calc(env(safe-area-inset-bottom) + 73px)); background: #b8f783; color: #102722; box-shadow: 0 7px 20px #0008; }
.breathing { text-align: center; }
.breath-orb { margin: 32px auto; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle at 35% 30%,#e4ffc3,#53bc99); box-shadow: 0 0 36px #84edb266; transform: scale(.78); }
.breath-orb[data-phase=in] { transform: scale(1.12); transition: transform 4s ease; }
.breath-orb[data-phase=hold] { transform: scale(1.12); }
.breath-orb[data-phase=out] { transform: scale(.78); transition: transform 6s ease; }
@media (prefers-reduced-motion: reduce) {
    .breath-orb[data-phase] { transform: scale(.88); transition: none; }
}

.portrait-reveal { grid-template-columns: 1.7fr 1fr; align-items: center; }
.portrait-strip { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; }
@media (max-width: 460px) {
    .portrait-reveal { grid-template-columns: 1fr; }
}

.portrait { background-image: url('/campaign-portraits.jpg'); }
.portrait-carousel {
    position: relative;
    aspect-ratio: 4/3;
    width: min(100%,420px);
    margin: 0 auto 18px;
    border-radius: 20px;
    overflow: hidden;
    background: #203a36;
}
.portrait-carousel .portrait {
    position: absolute;
    inset: 0;
    opacity: 0;
    animation: portrait-rotate 20s infinite;
}
.portrait-carousel .portrait:first-child { opacity: 1; }
.portrait-carousel .portrait:nth-child(2) { animation-delay: 5s; }
.portrait-carousel .portrait:nth-child(3) { animation-delay: 10s; }
.portrait-carousel .portrait:nth-child(4) { animation-delay: 15s; }
@keyframes portrait-rotate {
    0%,21% { opacity: 1; }
    25%,100% { opacity: 0; }
}
.portrait-carousel:hover .portrait { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
    .portrait-carousel .portrait { animation: none; }
}
.portrait-note { display: block; text-align: center; }

:root {
    color-scheme: light;
    --bg: #fff;
    --card: #f0f9f3;
    --line: #b8d4c2;
    --muted: #365547;
}
html { background: #fff; }
body {
    width: 100%;
    color: #122c23;
    background: #fff;
    padding-top: max(20px,env(safe-area-inset-top));
    padding-right: max(clamp(16px,5vw,46px),env(safe-area-inset-right));
    padding-left: max(clamp(16px,5vw,46px),env(safe-area-inset-left));
    padding-bottom: max(20px,env(safe-area-inset-bottom));
}
body.has-tabs { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
header { border-color: var(--line); }
h1 em, .savings-amount, .roadmap li[aria-current=step] strong { color: #236a49; }
a, #status { color: #215f45; }
button { color: #153528; background: #e6f3eb; }
button.primary { color: #102722; }
button[aria-pressed=true], .wizard .choice[aria-pressed=true] { color: #16382c; background: #d6f3df; border-color: #3d8060; }
button:hover { border-color: #398357; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible { outline-color: #246c4c; }
main .card { background: linear-gradient(155deg,#f3fbf5,#e6f4eb); }
.wizard .choice { background: #f0f9f3; }
.wizard .symbol, .symbol { color: #1c5d43; background: #d8eee0; }
input,select { min-width: 0; color: #132d23; background: #fff; border-color: #89ac96; font-size: 16px; min-height: 44px; }
.score-grid > div, .savings-jar, .habit-week li { background: #d7efdf; }
.score-grid strong, .savings-jar strong { color: #1f6747; }
.jar-icon { color: #24694a; border-color: #38805d; }
.habit-week .logged { background: #b8f783; color: #163725; }
.next-step { background: #d8f2e2; border-color: #529678; }
.next-step:last-of-type { border-bottom-color: #529678; }
.segments span { background: #9abbad; }
.pace-path { stroke: #26805a; }
.award.earned { border-color: #428663; }
.award.earned .symbol { background: #cfe8d8; color: #236a49; }
main .puff-card {
    --muted: #d6f0e4;
    color: #fff;
    background: radial-gradient(ellipse at top right,#2b795c,transparent 75%),#153c2f;
    border-color: #3e8468;
}
.puff-card button.quiet { color: #f1fff5; border-color: #a5c9b9; }
.puff-card .segments span { background: #4d7867; }
.segments .lit,.puff-card .segments .lit { background: linear-gradient(100deg,#d7ff9e,#71e4c6); }
.tabs { bottom: calc(8px + env(safe-area-inset-bottom)); }
.tabs button { color: #ecfff1; min-width: 0; }
.tabs button[aria-current=page] { color: #b8f783; }
.sos-float { bottom: calc(84px + env(safe-area-inset-bottom)); }
.record-page { max-width: 520px; }
.record-card h1 { font-size: clamp(1.8rem,8vw,2.6rem); margin: 0 0 10px; }
.record-card .count { display: block; font-size: clamp(4.8rem,25vw,8.5rem); }
.record-card .segments { margin: 22px 2px; }
.record-links a { min-height: 44px; display: inline-flex; align-items: center; }
.portrait { background-image: url('/mobile-portraits.jpg'); }
.habit-week, .score-grid, .choices, .awards { min-width: 0; }
@media (max-width: 420px) {
    .choices { gap: 8px; }
    .choice { padding: 10px; min-height: 84px; overflow-wrap: anywhere; }
    .wizard .portrait-carousel { width: min(100%,300px); }
    .mission { gap: 8px; }
    .mission > div { min-width: 0; }
    .mission button { font-size: .83rem; }
    .score-grid small { overflow-wrap: anywhere; }
}
