:root {
  --navy: #0C2340;
  --navy-2: #13304F;
  --navy-3: #1B3D63;
  --line: rgba(255,255,255,.12);
  --green: #2E7D6F;
  --green-2: #5CC8B0;
  --gold: #F2C14E;
  --text: #FFFFFF;
  --muted: #A9BACB;
  --radius: 16px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--navy); color: var(--text); }
body { -webkit-font-smoothing: antialiased; line-height: 1.45; font-size: 16px; }
a { color: var(--green-2); }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.2; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1rem 0 .4rem; }
p { margin: .3rem 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--green-2); outline-offset: 2px; }

.screen { max-width: 520px; margin: 0 auto; padding: calc(16px + env(safe-area-inset-top)) 16px 24px; }
.screen.with-nav { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.page-title { margin: 8px 0 4px; }
.sub-title { margin: 20px 0 10px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.empty { color: var(--muted); font-size: .9rem; padding: 12px 0; }
.error { color: #FF9B8A; font-size: .9rem; min-height: 1.2em; }
.label { font-weight: 600; margin: 14px 0 8px; font-size: .95rem; }

.card { background: var(--navy-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; }
.card.highlight { border-color: var(--green-2); background: linear-gradient(180deg, rgba(46,125,111,.25), var(--navy-2)); }
.card.tip p { color: var(--muted); }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.section-title h2 { margin: 0; }

label { display: block; font-size: .9rem; font-weight: 600; margin: 12px 0 0; }
input[type=email], input[type=number], input[type=time], input:not([type]), select {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px; background: var(--navy);
  border: 1px solid var(--line); border-radius: 12px; font-weight: 400; min-height: 48px;
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 16px;
  padding: 14px 18px; min-height: 48px; border: 0; border-radius: 12px; background: var(--green); color: #fff;
  font-weight: 700; text-decoration: none; transition: filter .15s; }
.btn:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.sm { width: auto; min-height: 40px; padding: 8px 14px; margin-top: 0; font-size: .9rem; }
.btn-done { background: var(--navy-3); color: var(--green-2); border: 1px solid var(--green-2); }
.row-btns { display: flex; gap: 10px; align-items: center; }
.row-btns .btn { flex: 1; }
.icon-btn { background: none; border: 0; font-size: 1.5rem; color: var(--muted); padding: 4px 8px; min-width: 44px; min-height: 44px; }
.icon-btn.on { color: var(--gold); }

/* Auth & quiz */
.auth { text-align: center; padding-top: 6vh; }
.auth .logo { margin-bottom: 12px; }
.auth h1 { font-size: 2rem; }
.auth .card { text-align: left; margin-top: 24px; }
.tagline { color: var(--green-2); font-weight: 600; }
.progress { height: 6px; background: var(--navy-3); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress div { height: 100%; background: var(--green-2); transition: width .3s; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choices.col { grid-template-columns: 1fr; }
.choice { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px; min-height: 48px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--navy); font-weight: 600; font-size: .95rem; text-align: center; }
.choice.on, .choice.radio:has(input:checked) { border-color: var(--green-2); background: rgba(46,125,111,.35); }
.choice.radio { margin: 0; cursor: pointer; }
.choice.radio input { position: absolute; opacity: 0; pointer-events: none; }

.building { text-align: center; padding-top: 18vh; }
.spinner { width: 56px; height: 56px; margin: 0 auto 24px; border-radius: 50%; border: 5px solid var(--navy-3); border-top-color: var(--green-2); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.build-steps { list-style: none; padding: 0; color: var(--muted); }
.build-steps li { opacity: 0; animation: fadein .4s forwards; padding: 4px 0; }
.build-steps li::before { content: '✓ '; color: var(--green-2); }
.build-steps li:nth-child(1) { animation-delay: .3s; } .build-steps li:nth-child(2) { animation-delay: .9s; }
.build-steps li:nth-child(3) { animation-delay: 1.5s; } .build-steps li:nth-child(4) { animation-delay: 2.1s; }
@keyframes fadein { to { opacity: 1; } }

/* Home */
.hello { padding: 8px 0 4px; }
.phase-pill { display: inline-block; background: rgba(46,125,111,.35); border: 1px solid var(--green); color: #DFF5EF;
  padding: 6px 12px; border-radius: 99px; font-size: .85rem; font-weight: 600; }
.energy { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.energy .choice { flex-direction: column; font-size: .8rem; padding: 10px 4px; gap: 2px; }
.energy .choice span { font-size: 1.4rem; }
.dots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 8px 0; }
.dot { height: 12px; border-radius: 99px; background: var(--navy-3); }
.dot.on { background: var(--green-2); }
.dot.today { outline: 2px solid var(--gold); outline-offset: 2px; }
.bar { height: 6px; background: var(--navy-3); border-radius: 99px; overflow: hidden; }
.bar div { height: 100%; background: var(--green-2); }
.glasses { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.glass { width: 40px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--navy); font-size: 1.2rem; filter: grayscale(1) opacity(.45); }
.glass.on { filter: none; border-color: var(--green-2); background: rgba(46,125,111,.3); }
.move-short { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.plan { list-style: none; padding: 0; margin: 0; }
.plan li { display: grid; grid-template-columns: 54px 1fr; gap: 2px 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.plan li span { color: var(--muted); font-size: .85rem; grid-row: span 2; }
.plan li small { color: var(--muted); }
.plan li.today b { color: var(--green-2); }

/* Images */
.logo-img { border-radius: 18px; display: inline-block; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.auth { position: relative; }
.auth-hero { display: block; width: calc(100% + 32px); margin: calc(-16px - env(safe-area-inset-top) - 6vh) -16px 0; height: 220px; object-fit: cover;
  -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.auth-hero + .logo { margin-top: -56px; position: relative; }
.recipe-photo { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; margin-bottom: 12px; background: var(--navy-3); }
.row-wrap.open .recipe-photo { margin-top: 2px; }
.row-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.thumb { flex-shrink: 0; width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--navy-3); }
.thumb.icon { display: grid; place-items: center; font-size: 1.3rem; }
.row { padding: 10px 14px; }

/* Recipe */
.recipe-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.eyebrow { color: var(--green-2); font-size: .8rem; font-weight: 600; margin-bottom: 4px; }
.flag { display: inline-block; font-size: .8rem; background: rgba(242,193,78,.15); color: var(--gold); border: 1px solid rgba(242,193,78,.4); padding: 4px 10px; border-radius: 99px; margin-top: 4px; }
.ings { list-style: none; padding: 0; margin: 0; }
.ings li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ings li:last-child { border-bottom: 0; }
.tag { font-style: normal; font-size: .72rem; background: var(--navy-3); color: var(--green-2); padding: 2px 8px; border-radius: 99px; margin-left: 4px; white-space: nowrap; }
.swap { flex-shrink: 0; font-size: .8rem; background: transparent; border: 1px solid var(--line); border-radius: 99px; padding: 6px 10px; min-height: 34px; color: var(--muted); }
.swap:hover { color: #fff; border-color: var(--green-2); }
.steps { padding-left: 1.2rem; margin: 0; }
.steps li { padding: 3px 0; }
.why { margin-top: 14px; background: rgba(46,125,111,.2); border-left: 3px solid var(--green-2); padding: 10px 12px; border-radius: 0 10px 10px 0; }
.why p { color: #D6E4EE; font-size: .92rem; }

/* Library */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0; scrollbar-width: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip { flex-shrink: 0; padding: 8px 14px; min-height: 40px; border-radius: 99px; border: 1px solid var(--line); background: var(--navy-2); font-size: .88rem; font-weight: 600; white-space: nowrap; }
.chip.on { background: var(--green); border-color: var(--green); }
.list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 14px 16px; min-height: 52px;
  background: var(--navy-2); border: 1px solid var(--line); border-radius: 14px; font-weight: 600; }
.row.locked { color: var(--muted); font-weight: 500; }
.row.locked small { flex-shrink: 0; font-size: .75rem; }
.row-wrap.open { background: var(--navy-2); border: 1px solid var(--green); border-radius: 14px; }
.row-wrap.open .row { border: 0; }
.row-wrap.open .recipe { padding: 0 16px 16px; }
.chev { color: var(--muted); font-size: 1.3rem; line-height: 1; }
.star { color: var(--gold); }
.when { margin: 0; }

/* Progress */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.stat { background: var(--navy-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 6px; text-align: center; }
.stat b { display: block; font-size: 1.4rem; color: var(--green-2); }
.stat span { font-size: .72rem; color: var(--muted); }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); }
.chart .phase-line { stroke: rgba(255,255,255,.25); stroke-dasharray: 3 4; }
.chart .axis { fill: var(--muted); font-size: 10px; }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.badge { text-align: center; font-size: .78rem; color: var(--muted); padding: 10px 4px; border-radius: 12px; background: var(--navy); border: 1px solid var(--line); }
.badge span { display: block; font-size: 1.6rem; filter: grayscale(1) opacity(.5); }
.badge.on { color: #fff; border-color: var(--gold); }
.badge.on span { filter: none; }
.history { list-style: none; padding: 0; margin: 0; }
.history li { display: grid; grid-template-columns: 1fr 1fr 1fr; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.history li span:last-child { text-align: right; }

/* Guide */
.hydro { text-align: center; }
.hydro .big { font-size: 2.6rem; font-weight: 800; color: var(--green-2); }
.seq { list-style: none; padding: 0; margin: 8px 0 0; }
.seq li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.seq li:last-child { border: 0; }
.seq-icon { font-size: 1.6rem; }
.seq p, .sci p { color: var(--muted); font-size: .92rem; }
.tips { padding-left: 1.2rem; margin: 6px 0 0; }
.tips li { padding: 4px 0; }
.sci { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sci-card { margin: 0; padding: 12px; }
.sci-card small { color: var(--green-2); font-size: .75rem; }
.disclaimer { color: var(--muted); font-size: .78rem; margin-top: 20px; }

/* Profile */
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.check, .switch { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 6px 0; }
.check input, .switch input { width: 20px; height: 20px; accent-color: var(--green); }
.switch small { color: var(--muted); }
.toggle { display: grid; grid-template-columns: 1fr 1fr; background: var(--navy); border-radius: 12px; padding: 4px; border: 1px solid var(--line); }
.toggle button { border: 0; background: transparent; padding: 10px; min-height: 44px; border-radius: 9px; font-weight: 600; font-size: .9rem; color: var(--muted); }
.toggle button.on { background: var(--green); color: #fff; }
form.inline { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
form.inline input { margin: 0; }
.dev summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.dev .btn.ghost { margin-top: 10px; }

/* Accordion & Daily Move */
.acc { background: var(--navy-2); border: 1px solid var(--line); border-radius: var(--radius); margin: 12px 0; overflow: hidden; }
.acc.open { border-color: var(--green); }
.acc-head { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; background: none; border: 0; padding: 16px; min-height: 56px; }
.acc-head small { display: block; color: var(--muted); font-size: .8rem; font-weight: 400; margin-top: 2px; }
.acc-body { padding: 0 16px 16px; }
.sub-block { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.sub-block + .sub-block { margin-top: 16px; }
.sub-block h3 small, .moves small { color: var(--green-2); font-weight: 600; font-size: .8rem; }
.moves { list-style: none; padding: 0; margin: 10px 0 0; }
.moves li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.moves li:last-child { border: 0; }
.moves p { color: var(--muted); font-size: .9rem; }
.num { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--green); display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wday { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; min-height: 60px; border-radius: 12px; border: 1px solid var(--line); background: var(--navy); }
.wday small { color: var(--muted); font-size: .72rem; }
.wday span { font-weight: 800; color: var(--green-2); height: 1.2em; }
.wday.on { background: rgba(46,125,111,.35); border-color: var(--green-2); }
.wday.today { outline: 2px solid var(--gold); outline-offset: 1px; }
.wday:disabled { opacity: .4; cursor: default; }
.prog { list-style: none; padding: 0; margin: 0; }
.prog li { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.prog li p { grid-column: 1 / -1; color: var(--muted); font-size: .9rem; }
.mins { color: var(--green-2); font-weight: 700; }
.tips3 { display: grid; gap: 8px; margin-top: 12px; }
.tips3 div { background: var(--navy); border-radius: 12px; padding: 10px 12px; }
.tips3 p { color: var(--muted); font-size: .88rem; }

/* Auth extras */
.center { text-align: center; }
.oktext { color: var(--green-2); font-size: .9rem; }
.auth .back { display: inline-block; margin-bottom: 10px; font-size: .9rem; text-decoration: none; }
.auth input[type=password] { display: block; width: 100%; margin-top: 6px; padding: 12px 14px; background: var(--navy);
  border: 1px solid var(--line); border-radius: 12px; font-weight: 400; min-height: 48px; }
.auth .card h2 { margin-bottom: 4px; }

/* Daily Move offer (upsell) */
.offer-hero { text-align: center; padding: 20px 4px 8px; }
.offer-hero h1 { font-size: 2rem; margin: 6px 0 4px; }
.offer-sub { color: #D6E4EE; margin: 0 auto 12px; max-width: 34ch; }
.offer-pills { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.offer-pills span { font-size: .78rem; font-weight: 600; padding: 5px 10px; border-radius: 99px; background: rgba(46,125,111,.3); border: 1px solid var(--green); }
.offer-item { display: flex; gap: 12px; align-items: flex-start; }
.offer-item h3 { margin: 2px 0 4px; }
.offer-item p { color: var(--muted); font-size: .92rem; }
.offer-icon { flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px; background: var(--navy-3); display: grid; place-items: center; font-size: 1.4rem; }
.offer-tag { color: var(--gold); font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.offer-buy { text-align: center; border-color: var(--green-2); background: linear-gradient(180deg, rgba(46,125,111,.28), var(--navy-2)); }
.offer-price { font-size: 2.6rem; font-weight: 800; color: #fff; }
.guarantee { margin-top: 12px; font-weight: 600; color: #DFF5EF; }
.btn:disabled { opacity: .55; cursor: default; filter: none; }
.move-teaser { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; border-color: var(--green); }
.move-teaser small { display: block; color: var(--muted); font-size: .85rem; margin-top: 2px; }
.move-teaser .chev { margin-left: auto; font-size: 1.6rem; }
.tabbar a.locked span { position: relative; }
.tabbar a.locked span::after { content: '🔒'; position: absolute; right: -10px; top: -4px; font-size: .62rem; filter: none; }

/* Tab bar & toast */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(var(--n), 1fr);
  background: rgba(12,35,64,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); max-width: 520px; margin: 0 auto; }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; min-height: 52px; justify-content: center;
  color: var(--muted); text-decoration: none; font-size: .7rem; font-weight: 600; border-radius: 10px; }
.tabbar a span { font-size: 1.25rem; filter: grayscale(1) opacity(.7); }
.tabbar a.on { color: #fff; background: rgba(46,125,111,.3); }
.tabbar a.on span { filter: none; }
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #fff; color: var(--navy); padding: 10px 18px; border-radius: 99px; font-weight: 600; font-size: .9rem;
  box-shadow: 0 6px 24px rgba(0,0,0,.35); max-width: calc(100% - 32px); text-align: center; z-index: 10; }

@media (max-width: 360px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .sci, .checks { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition: none !important; } }
