/* Anchor Path — base styles and shared components. Uses tokens.css. */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--gold); }
a:hover { color: var(--gold-hover); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }

/* App frame: phone-width column, centred on larger screens */
#app {
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: max(env(safe-area-inset-top), 24px) var(--space-6) max(env(safe-area-inset-bottom), 24px);
}
.screen { display: flex; flex-direction: column; flex: 1; gap: var(--space-4); }

/* Type */
.display {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.display em { font-style: italic; color: var(--gold); }
.display-xl { font-size: var(--fs-3xl); }
.display-lg { font-size: var(--fs-2xl); }
.display-md { font-size: var(--fs-xl); }
.kicker {
  margin: 0;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--gold);
}
.muted { color: var(--muted); }
.lead { margin: 0; font-size: var(--fs-md); color: var(--muted); line-height: 1.55; }

/* Brand mark */
.brand { display: flex; align-items: center; gap: 10px; }
.brand span { font-size: 12px; font-weight: 600; letter-spacing: 0.28em; color: var(--gold); }

/* Buttons */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--btn-h); padding: 0 var(--space-6);
  border: none; border-radius: var(--r-pill);
  font-size: 16px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--gold); color: var(--on-gold); }
.btn-primary:hover { background: var(--gold-hover); color: var(--on-gold); }
.btn-ghost { background: transparent; color: var(--text); min-height: var(--tap); font-weight: 500; }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn[disabled] { opacity: 0.5; cursor: default; }
.icon-btn {
  width: var(--tap); height: var(--tap); border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--line); cursor: pointer; color: var(--text);
}

/* Cards */
.card { background: var(--surface); border-radius: var(--r-md); padding: var(--space-4); }
.card-gold { background: var(--surface-gold); border: 1px solid var(--line-gold); border-radius: var(--r-lg); padding: var(--space-5); }

/* Form fields */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
.input {
  min-height: var(--btn-h); padding: 0 var(--space-4);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  font: inherit; font-size: 16px; /* 16px stops iPhone zooming in */
}
.input:focus { border-color: var(--gold); outline: none; }
.msg { min-height: 20px; margin: 0; font-size: var(--fs-sm); }
.msg.error { color: var(--danger); }
.msg.ok { color: var(--sage); }

/* Bottom sheet (install steps, etc.) */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: flex-end; justify-content: center; z-index: 50;
}
.sheet {
  width: 100%; max-width: 480px; background: var(--surface);
  border-radius: var(--r-lg) var(--r-lg) 0 0; padding: var(--space-6) var(--space-6) max(env(safe-area-inset-bottom), 24px);
  display: flex; flex-direction: column; gap: var(--space-4);
}
.sheet ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--text-2); }

.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: var(--space-3); }

.preview-note {
  margin: 0; padding: 10px 14px; border-radius: var(--r-sm);
  background: var(--surface-gold); border: 1px solid var(--line-gold);
  font-size: var(--fs-sm); color: var(--text-2);
}

/* ---------- Step 2 components ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.small { font-size: var(--fs-sm); }
.center { align-items: center; }
.center-text { text-align: center; }
.fineprint { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ring { position: relative; height: 256px; display: flex; align-items: center; justify-content: center; margin: 4px 0; }
.ring-label { position: absolute; text-align: center; }

/* Quiz */
.quiz-top { display: flex; align-items: center; gap: 14px; }
.progress { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--gold); transition: width .3s ease; }
.quiz-count { font-size: 12px; font-weight: 600; color: var(--muted); min-width: 40px; text-align: right; }
.quiz-body { margin-top: 8px; }
.opt {
  width: 100%; min-height: 64px; padding: 14px 16px;
  display: flex; align-items: center; gap: 14px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid rgba(242,238,232,.08); border-radius: var(--r-md);
  transition: border-color .15s, background .15s;
}
.opt:hover { border-color: var(--line-gold); }
.opt.on { background: var(--surface-gold); border: 1.5px solid var(--gold); }
.opt-icon { flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--gold); }
.opt-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.opt-label { font-size: 16px; font-weight: 600; color: var(--text); }
.opt-sub { font-size: 13px; color: var(--muted); }
.opt-dot { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid rgba(242,238,232,.3); }
.opt.on .opt-dot { background: var(--gold); border: 6px solid #3A3222; }
.opt-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.opt-sm { justify-content: center; text-align: center; min-height: 64px; padding: 12px 8px; }
.opt-sm .opt-text { align-items: center; }

.stepper { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.icon-btn-lg { width: 56px; height: 56px; }
.stepper-value { flex: 1; display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.stepper-value input {
  width: 140px; background: transparent; border: none; border-bottom: 1px solid var(--line-gold);
  color: var(--text); font-family: var(--font-display); font-weight: 600; font-size: 56px; text-align: center;
  -moz-appearance: textfield;
}
.stepper-value input { box-sizing: border-box; height: 78px; line-height: 1.3; padding: 8px 0 6px; overflow: visible; border-radius: 0; -webkit-appearance: none; appearance: none; }
.stepper-value input::-webkit-outer-spin-button, .stepper-value input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-value input:focus { outline: none; border-bottom-color: var(--gold); }
.stepper-value span { font-size: 16px; color: var(--muted); }
.stepper-value.ftin { gap: 6px; }
.stepper-value.ftin input { width: 1.3em; min-width: 0; text-align: center; }
.input-code { letter-spacing: .5em; font-size: 22px; text-align: center; }

/* Building */
.loader-arc { animation: ap-arc 2.6s ease forwards; }
@keyframes ap-arc { to { stroke-dashoffset: 0; } }
.build-steps { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 300px; }
.build-steps li { padding-left: 30px; position: relative; color: var(--muted); transition: color .3s; }
.build-steps li::before { content: ''; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--surface-2); transition: all .3s; }
.build-steps li.done { color: var(--text); }
.build-steps li.done::before { background: var(--gold); border-color: var(--gold); }

/* Tiles, cards */
.tile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { background: var(--surface); border-radius: var(--r-md); padding: 14px; display: flex; flex-direction: column; gap: 6px; border: none; text-align: left; color: var(--text); }
.tile-btn { cursor: pointer; }
.tile-btn:hover { background: #1F2522; }
.tile-k { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.tile-v { font-family: var(--font-display); font-weight: 600; font-size: 26px; line-height: 1.05; letter-spacing: -.02em; }
.tile-v small { font-family: var(--font-body); font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.tile-s { font-size: 12px; color: var(--muted); }
.week-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.week-list li { display: flex; justify-content: space-between; font-size: 15px; }
.week-list span { color: var(--muted); }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); background: rgba(229,140,122,.08); border: 1px solid rgba(229,140,122,.35); color: var(--text-2); }
.notice svg { flex-shrink: 0; color: var(--danger); margin-top: 2px; }
.notice p { margin: 0; font-size: 14px; line-height: 1.5; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span { font-size: 13px; color: var(--text-2); padding: 5px 10px; border-radius: var(--r-pill); background: rgba(242,238,232,.06); }

/* Paywall */
.perks { list-style: none; margin: 4px 0; padding: 0; display: flex; flex-direction: column; gap: 12px; color: var(--text-2); }
.perks li { display: flex; gap: 12px; align-items: center; }
.perks svg { color: var(--sage); flex: 0 0 18px; width: 18px; }
.plan-opt { justify-content: space-between; }
.plan-price { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.plan-price strong { font-size: 17px; }
.plan-price small { font-size: 12px; color: var(--muted); }
.badge { display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 800; letter-spacing: .08em; padding: 3px 8px; border-radius: 10px; background: var(--gold); color: var(--on-gold); vertical-align: middle; }

/* Main app */
.with-tabs { padding-bottom: 124px; }
/* Floating "liquid glass" tab bar (iOS-style). Content scrolls underneath and is blurred. */
.tabbar {
  position: fixed; z-index: 20;
  left: 16px; right: 16px; bottom: max(env(safe-area-inset-bottom), 14px);
  max-width: 448px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(var(--n, 5), 1fr);
  padding: 6px; border-radius: 34px;
  background: linear-gradient(180deg, rgba(48,54,51,.42), rgba(22,26,24,.38));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.22),
    inset 0 -1px 0 rgba(0,0,0,.30),
    0 12px 32px rgba(0,0,0,.45),
    0 2px 8px rgba(0,0,0,.25);
  transition: transform .35s cubic-bezier(.2,.8,.2,1), padding .3s ease;
}
/* soft light sheen across the top of the glass */
.tabbar::before {
  content: ''; position: absolute; inset: 1px 18px auto 18px; height: 45%;
  border-radius: 30px 30px 60% 60% / 30px 30px 20px 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,0));
  pointer-events: none;
}
/* the sliding glass lens behind the active tab */
.tab-lens {
  position: absolute; top: 6px; bottom: 6px; left: 6px;
  width: calc((100% - 12px) / var(--n, 5));
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(212,180,131,.22), rgba(212,180,131,.10));
  border: 1px solid rgba(212,180,131,.30);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 4px 14px rgba(0,0,0,.25);
  transform: translateX(calc(var(--i, 0) * 100%));
  transition: transform .45s cubic-bezier(.3,1.35,.5,1);
  pointer-events: none;
}
.tab { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 54px; justify-content: center; background: none; border: none; cursor: pointer; color: var(--muted); font-size: 11px; font-weight: 600; border-radius: 28px; transition: color .2s, transform .15s; }
.tab:active { transform: scale(.94); }
.tab.on { color: var(--gold); }
.tab span { transition: opacity .25s, max-height .3s; max-height: 16px; }
.tabbar[style*="--n:6"] .tab { font-size: 10px; letter-spacing: -.1px; }
/* minimised while scrolling down, like iOS */
.tabbar.compact { padding: 4px; }
.tabbar.compact .tab { min-height: 42px; }
.tabbar.compact .tab span { opacity: 0; max-height: 0; }
.tabbar.compact .tab-lens { top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / var(--n, 5)); }
@media (prefers-reduced-motion: reduce) { .tab-lens, .tabbar, .tab span { transition: none; } }
/* browsers without backdrop blur: solid fallback */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tabbar { background: rgba(26,31,29,.97); }
}
.week-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week-row > div { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.wd { font-size: 11px; color: var(--muted); }
.wdot { width: 30px; height: 30px; border-radius: 50%; background: var(--surface); }
.wdot.done { background: var(--gold); }
.wdot.now { background: transparent; border: 1.5px solid var(--gold); }
.soon { display: flex; flex-direction: column; gap: 8px; border: 1px dashed var(--line-gold); background: transparent; }
.soon h2 { margin: 0; }
.soon-tag { align-self: flex-start; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--surface); border-radius: var(--r-pill); }
.seg button { min-height: 40px; border: none; border-radius: var(--r-pill); background: transparent; color: var(--muted); font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--text); color: var(--bg); }

/* ---------- Step 3: workouts ---------- */
.row-gap { display: flex; gap: 10px; align-items: center; }
.btn-sm { min-height: 44px; padding: 0 18px; font-size: 14px; }
.streak-pill { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 12px; border-radius: var(--r-pill); background: var(--surface-gold); border: 1px solid var(--line-gold); color: var(--gold); font-weight: 700; font-size: 13px; }
.done-line { margin: 0; display: flex; align-items: center; gap: 8px; color: var(--sage); font-weight: 600; }
.move-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface); border-radius: var(--r-sm); }
.move-badge { flex-shrink: 0; width: 52px; height: 42px; border-radius: 10px; background: var(--surface-2); overflow: hidden; display: block; }
.move-badge svg, .mv-th svg { width: 100%; height: 100%; display: block; }
.mv-th { flex: none; width: 52px; height: 42px; border-radius: 10px; overflow: hidden; display: block; background: var(--surface-2); }
.move-name { flex: 1; font-weight: 600; }
.sticky-cta { position: sticky; bottom: 0; padding: 16px 0 8px; background: linear-gradient(180deg, rgba(15,18,17,0), var(--bg) 35%); }
.player { gap: 14px; }
.move-media { height: 210px; border-radius: var(--r-lg); background: radial-gradient(120% 90% at 50% 0%, #232A27, #161A18); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); }
.move-media span { font-family: var(--font-display); font-size: 72px; font-weight: 600; color: var(--gold); opacity: .55; line-height: 1; }
.move-media small { font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.ring-timer { position: relative; width: 132px; height: 132px; flex-shrink: 0; }
.ring-timer span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 600; font-size: 34px; }
.ring-timer circle:last-child { transition: stroke-dashoffset .25s linear; }
.reps-box { flex-shrink: 0; min-width: 110px; display: flex; flex-direction: column; align-items: center; padding: 12px; border-radius: var(--r-md); background: var(--surface-gold); border: 1px solid var(--line-gold); }
.reps-n { font-family: var(--font-display); font-weight: 600; font-size: 30px; color: var(--gold); }
.variant-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px; background: var(--surface); border-radius: var(--r-pill); }
.vchip { min-height: 40px; border: none; border-radius: var(--r-pill); background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; }
.vchip.on { background: var(--surface-gold); color: var(--gold); box-shadow: inset 0 0 0 1px var(--line-gold); }
.cues { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; color: var(--text-2); }
.player-controls { margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 28px; padding-top: 8px; }
.play-btn { width: 78px; height: 78px; border-radius: 50%; border: none; background: var(--gold); color: var(--on-gold); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 8px 24px rgba(212,180,131,.25); }
.player-rest { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.big-timer { font-family: var(--font-display); font-weight: 600; font-size: 96px; line-height: 1; letter-spacing: -.03em; }
.done-badge { align-self: center; width: 96px; height: 96px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--surface-gold); border: 1px solid var(--line-gold); color: var(--gold); }
.tile-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.variant-note { margin: -4px 0 0; padding: 8px 12px; border-radius: var(--r-sm); background: var(--surface-gold); border: 1px solid var(--line-gold); color: var(--gold); font-size: 14px; font-weight: 600; }

/* ---- Charts (js/charts.js) and check-in ---- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .bar { transform-box: fill-box; transform-origin: 50% 100%; animation: bar-grow .6s cubic-bezier(.3,1.2,.5,1) both; opacity: .62; }
.chart .bar.now { opacity: 1; filter: drop-shadow(0 4px 10px rgba(212,180,131,.25)); }
.chart .bar.zero { fill: var(--surface-2); opacity: 1; animation: none; }
@keyframes bar-grow { from { transform: scaleY(0); } }
.chart .bar-v { fill: var(--text-2); font: 600 10px var(--font-body); }
.chart .bar-l { fill: var(--muted); font: 500 10px var(--font-body); }
.chart .bar-l.now { fill: var(--gold); font-weight: 700; }
.chart .bar-l.tgt { fill: var(--sage); font-size: 9px; letter-spacing: .02em; }
.chart .axis { stroke: rgba(242,238,232,.16); stroke-width: 1; }
.chart .grid { stroke: rgba(242,238,232,.06); stroke-width: 1; }
.chart .target { stroke: var(--sage); stroke-width: 1.2; stroke-dasharray: 4 4; opacity: .85; }
.chart .band { fill: rgba(159,184,165,.12); }
.chart .area-line { fill: none; stroke: var(--gold); stroke-width: 2.75; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; animation: line-draw 1s ease both; }
@keyframes line-draw { from { stroke-dashoffset: 1; } }
.chart .dot { fill: var(--surface); stroke: var(--gold); stroke-width: 2; }
.chart .dot.now { fill: var(--gold); stroke: var(--surface); stroke-width: 2.5; }
.chart .bubble rect { fill: var(--gold); }
.chart .bubble text { fill: var(--on-gold); font: 700 10px var(--font-body); }
.donut-wrap { display: flex; align-items: center; gap: 16px; }
.donut { width: 128px; height: 128px; flex: none; }
.dn-bg { fill: none; stroke: var(--surface-2); stroke-width: 13; }
.dn { fill: none; stroke-width: 13; stroke-linecap: round; animation: fade-in .7s ease both; }
.dn-gold { stroke: var(--gold); } .dn-sage { stroke: var(--sage); } .dn-sky { stroke: #8FA9C4; } .dn-clay { stroke: #E5A18F; }
@keyframes fade-in { from { opacity: 0; } }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.legend li span { flex: 1; }
.legend strong { color: var(--text); font-weight: 600; }
.sw { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.sw-gold { background: var(--gold); } .sw-sage { background: var(--sage); } .sw-sky { background: #8FA9C4; } .sw-clay { background: #E5A18F; }
.heat .hc { fill: var(--surface-2); }
.heat .hc.l1 { fill: rgba(212,180,131,.35); } .heat .hc.l2 { fill: rgba(212,180,131,.68); } .heat .hc.l3 { fill: var(--gold); }
.heat .hc.today { stroke: var(--text); stroke-width: 1.5; }
.chart-legend { display: flex; gap: 6px; align-items: center; justify-content: flex-end; font-size: 11px; color: var(--muted); }
.chart-legend i { width: 12px; height: 12px; border-radius: 4px; background: var(--surface-2); display: inline-block; }
.chart-legend i.l1 { background: rgba(212,180,131,.35); } .chart-legend i.l2 { background: rgba(212,180,131,.68); } .chart-legend i.l3 { background: var(--gold); }
@media (prefers-reduced-motion: reduce) { .chart .bar, .chart .area-line, .dn { animation: none; } }
.tile.flat { background: var(--surface-2); }
.btn-link { display: inline-flex; align-items: center; gap: 4px; min-height: var(--tap); padding: 0 6px; border: none; background: none; color: var(--gold); font: 600 14px var(--font-body); cursor: pointer; }
.btn-link:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 8px; }

/* ---- Eat + Sleep ---- */
.ring { width: 130px; height: 130px; flex: none; }
.ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 11; }
.ring-fg { fill: none; stroke: var(--gold); stroke-width: 11; stroke-linecap: round; transition: stroke-dasharray .5s ease; }
.ring-fg.over { stroke: var(--danger); }
.ring-n { fill: var(--text); font: 600 26px var(--font-display); }
.ring-s { fill: var(--muted); font: 500 11px var(--font-body); }
.ring-card { align-items: center; gap: 18px; }
.grow { flex: 1; min-width: 0; }
.big { font-family: var(--font-display); font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.meter { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--gold); border-radius: 99px; transition: width .4s ease; }
.macro { display: flex; flex-direction: column; gap: 6px; }
.btn.sm { min-height: 44px; padding: 0 14px; font-size: 14px; }
.food-line { display: grid; grid-template-columns: 1fr auto 40px; gap: 8px; align-items: center; }
.food-line > div { display: flex; flex-direction: column; min-width: 0; }
.icon-btn.mini { width: 40px; height: 40px; min-width: 40px; }
.btn-link.left { align-self: flex-start; padding-left: 0; }
.sheet.tall { max-height: 92vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.chip-scroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip-scroll::-webkit-scrollbar { display: none; }
.chipb { flex: none; min-height: 40px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line); background: transparent; color: var(--text-2); font: 600 14px var(--font-body); cursor: pointer; }
.chipb.on { background: var(--gold); color: var(--on-gold); border-color: var(--gold); }
.seg.two { grid-template-columns: repeat(2, 1fr); }
.food-list { display: flex; flex-direction: column; gap: 2px; }
.food-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 56px; padding: 8px 6px; border: none; border-bottom: 1px solid var(--line); background: none; color: var(--text); text-align: left; cursor: pointer; }
.food-row > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.food-row:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; border-radius: 8px; }
.stepper-row { display: flex; align-items: center; justify-content: center; gap: 24px; }
.qty { display: flex; flex-direction: column; align-items: center; min-width: 80px; font-size: 28px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.seg.mini { display: inline-grid; grid-template-columns: repeat(2, auto); padding: 3px; }
.seg.mini button { min-height: 38px; padding: 0 14px; font-size: 13px; }
.chart-key { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 12px; color: var(--muted); }
.chart-key i.dash { width: 18px; border-top: 2px dashed var(--sage); }
.chart-key i.band { width: 18px; height: 10px; border-radius: 3px; background: rgba(159,184,165,.3); }

/* ---- Meal planner ---- */
.plan-cta { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; color: var(--text); cursor: pointer; font: inherit; }
.plan-cta > span { display: flex; flex-direction: column; gap: 4px; }
.plan-cta-t { font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.plan-cta svg { color: var(--gold); flex: none; }
.food-line.plan { grid-template-columns: 1fr auto; }
.chips-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.check-row { display: flex; align-items: center; gap: 12px; min-height: 52px; border-bottom: 1px solid var(--line); cursor: pointer; }
.check-row input { width: 22px; height: 22px; accent-color: var(--gold); flex: none; }
.check-row > span { display: flex; flex-direction: column; }
.check-row input:checked + span strong { text-decoration: line-through; color: var(--muted); }

/* ---- My workouts / equipment ---- */
.routine { display: flex; flex-direction: column; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.routine > div:first-child { display: flex; flex-direction: column; }
.stepper-mini { display: inline-flex; align-items: center; gap: 8px; }
.stepper-mini button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.stepper-mini button:active { transform: scale(.92); }
.stepper-mini span { min-width: 64px; text-align: center; font-size: 13px; color: var(--muted); }
.stepper-mini strong { color: var(--text); font-size: 16px; }
.ex-card { background: var(--surface-2); }
.chipb.rm { display: inline-flex; align-items: center; gap: 6px; }
.icon-btn:disabled { opacity: .35; cursor: default; }

/* ---------- community ---------- */
.post { display: flex; flex-direction: column; gap: 12px; }
.post-head { display: flex; align-items: center; gap: 12px; }
.avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font: 600 17px var(--font-display); color: var(--on-gold); background: var(--gold); }
.avatar.lg { width: 64px; height: 64px; font-size: 28px; }
.post-who { flex: 1; min-width: 0; text-align: left; background: none; border: none; color: var(--text); cursor: pointer; padding: 0; }
.post-who strong { display: block; }
.post-body { margin: 0; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.stat-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.stat-strip span { padding: 6px 10px; border-radius: var(--r-pill); background: var(--surface-2, rgba(255,255,255,.06)); font-size: 13px; color: var(--text-2); }
.stat-strip b { color: var(--gold); font-weight: 700; }
.post-actions { display: flex; gap: 6px; align-items: center; }
.act { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: var(--r-pill); border: none; background: transparent; color: var(--muted); font: 600 14px var(--font-body); cursor: pointer; }
.act.on { color: var(--gold); }
.act.on svg { fill: currentColor; }
.comment { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.comment p { margin: 0; overflow-wrap: anywhere; }
.demo-note { border: 1px dashed var(--gold); border-radius: var(--r-md, 16px); padding: 10px 14px; color: var(--text-2); font-size: 13px; }
.count-line { text-align: right; font-size: 12px; color: var(--muted); margin: 0; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 4px; background: none; border: none; color: var(--text); font: 500 16px var(--font-body); cursor: pointer; text-align: left; }
.menu-item.danger { color: var(--danger); }
textarea.input { resize: vertical; min-height: 96px; font: inherit; }

/* ---------- visuals, rewards ---------- */
.banner { border-radius: var(--r-lg, 20px); overflow: hidden; border: 1px solid var(--line); height: 112px; background: #171B19; }
.banner svg { display: block; width: 100%; height: 100%; }
.move-art { display: block; width: 100%; height: 100%; }
.move-media { overflow: hidden; padding: 0; position: relative; justify-content: flex-start; }
.move-media svg { width: 100%; height: 190px; flex: none; }
.move-media small { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; }
.quote-card { margin: 0; padding: 16px 18px; border-radius: var(--r-lg, 20px); border: 1px solid var(--line); border-left: 3px solid var(--gold); background: linear-gradient(135deg, rgba(212,180,131,.10), rgba(212,180,131,0) 70%); font: italic 500 18px/1.45 var(--font-display); color: var(--text); }
.quote-card .kicker { display: block; font: 600 11px var(--font-body); font-style: normal; margin-bottom: 6px; }
.xp-card { display: flex; align-items: center; gap: 12px; width: 100%; cursor: pointer; color: var(--text); text-align: left; }
.lv-badge { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font: 700 17px var(--font-display); color: var(--on-gold); background: conic-gradient(from 200deg, #EFD9B0, #D4B483, #B8946A, #EFD9B0); box-shadow: 0 0 0 3px rgba(212,180,131,.18); }
.xp-bar { display: block; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.xp-bar > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #B8946A, #EFD9B0); transition: width .8s cubic-bezier(.2,.8,.2,1); }
.xp-bar.slim { height: 6px; margin-top: 6px; }
.hero-card { position: relative; overflow: hidden; }
.hero-card::after { content: ''; position: absolute; right: -40px; top: -50px; width: 190px; height: 190px; border-radius: 50%; background: radial-gradient(circle, rgba(239,217,176,.22), rgba(239,217,176,0) 68%); pointer-events: none; animation: heroPulse 5s ease-in-out infinite; }
@keyframes heroPulse { 0%,100% { transform: scale(.9); opacity: .7; } 50% { transform: scale(1.12); opacity: 1; } }
.plan-len { display: flex; flex-direction: column; gap: 10px; }
.stepper-row { display: flex; align-items: center; justify-content: space-between; }
.ach { display: flex; gap: 14px; align-items: center; opacity: .62; }
.ach.got { opacity: 1; border-color: rgba(212,180,131,.45); background: linear-gradient(135deg, rgba(212,180,131,.12), rgba(212,180,131,0) 70%); }
.ach-ic { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.ach.got .ach-ic { background: var(--gold); color: var(--on-gold); }
/* celebration */
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
.screen { position: relative; }
.done-badge.pop { width: 120px; height: 120px; background: none; border: none; margin: 0 auto; display: grid; place-items: center; animation: popIn .6s cubic-bezier(.3,1.5,.5,1) both; }
.done-ring { stroke-dasharray: 340; stroke-dashoffset: 340; animation: draw .9s .1s ease-out forwards; }
.done-tick { stroke-dasharray: 90; stroke-dashoffset: 90; animation: draw .5s .8s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes popIn { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.reward-line { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; animation: popIn .5s 1s cubic-bezier(.3,1.5,.5,1) both; }
.reward-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 99px; background: rgba(212,180,131,.16); border: 1px solid rgba(212,180,131,.4); color: var(--gold); font-weight: 700; }
.reward-card { align-items: stretch; text-align: center; display: flex; flex-direction: column; gap: 14px; animation: popIn .45s cubic-bezier(.3,1.4,.5,1) both; }
.reward-medal, .reward-sun { align-self: center; width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; color: var(--on-gold); background: conic-gradient(from 200deg, #EFD9B0, #D4B483, #B8946A, #EFD9B0); box-shadow: 0 0 0 8px rgba(212,180,131,.16), 0 0 40px rgba(212,180,131,.35); animation: medal 2.4s ease-in-out infinite; }
.reward-sun { width: 72px; height: 72px; }
@keyframes medal { 0%,100% { transform: rotate(-4deg) scale(1); } 50% { transform: rotate(4deg) scale(1.06); } }
.reward-pop, .welcome-pop { z-index: 80; align-items: center; }
.reward-pop .sheet, .welcome-pop .sheet { max-width: 360px; border-radius: 28px; margin: 0 16px; }
.xp-toast { position: fixed; z-index: 70; left: 50%; top: 18px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 99px; background: var(--gold); color: var(--on-gold); font: 700 14px var(--font-body); box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: toastIn .4s cubic-bezier(.3,1.4,.5,1) both, toastOut .3s 2.4s ease-in forwards; }
@keyframes toastIn { from { transform: translate(-50%, -30px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
@keyframes toastOut { to { opacity: 0; transform: translate(-50%, -20px); } }
@media (prefers-reduced-motion: reduce) { .hero-card::after, .reward-medal, .reward-sun, .done-badge.pop, .reward-line, .reward-card, .xp-toast { animation: none; } .done-ring, .done-tick { animation: none; stroke-dashoffset: 0; } }

.link-btn { background: none; border: none; padding: 8px 2px; color: var(--gold); font: inherit; text-decoration: underline; cursor: pointer; min-height: 40px; }
.center-text { text-align: center; }
.sheet.tall > * { flex-shrink: 0; }

/* solid cover behind the iPhone clock/notch so scrolling content never shows through it */
body::before { content: ''; position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top, 0px); background: var(--bg); z-index: 90; pointer-events: none; }

/* paywall: founding counter and trial timeline */
.spots { margin: 2px 0 4px; }
.spots-bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.spots-bar i { display: block; height: 100%; border-radius: 99px; background: var(--sage); }
.trial-steps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; border-left: 2px solid rgba(255,255,255,.12); padding-left: 14px; }
.trial-steps li { display: grid; gap: 2px; font-size: var(--fs-sm); }
.trial-steps li strong { font-size: var(--fs-sm); }
.trial-steps li span { color: var(--muted, #9aa49f); }
