:root {
  --green: #2F6B4F; --green-d: #1F4A37; --green-l: #E6F0EA;
  --coral: #F26B4F; --coral-l: #FDECE7;
  --bg: #FBF8F3; --card: #FFFFFF; --ink: #1E2421; --muted: #6B7570; --line: #ECE6DC;
  --r: 18px; --shadow: 0 2px 14px rgba(30, 36, 33, .06);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 Inter, system-ui, sans-serif; }
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; padding-bottom: env(safe-area-inset-bottom); }
h1, h2, h3, h4 { font-family: Fraunces, Georgia, serif; line-height: 1.2; margin: .3em 0; }
h1 { font-size: 30px; } h2 { font-size: 24px; } h3 { font-size: 19px; } h4 { font-size: 17px; }
a { color: var(--green); }
p { margin: .4em 0; }
.small { font-size: 13px; color: var(--muted); }
.center { text-align: center; }

.btn { display: block; width: 100%; border: 0; border-radius: 999px; padding: 15px 20px; font: 600 16px Inter, sans-serif; cursor: pointer; text-align: center; text-decoration: none; margin: 12px 0; }
.btn.primary { background: var(--coral); color: #fff; box-shadow: 0 6px 18px rgba(242, 107, 79, .35); }
.btn.primary:disabled { opacity: .45; box-shadow: none; }
.btn.ghost { background: transparent; border: 2px solid var(--green); color: var(--green); }
.btn.big { font-size: 18px; padding: 18px; }
.link { background: none; border: 0; color: var(--green); font: 500 14px Inter; display: block; margin: 10px auto; cursor: pointer; text-decoration: underline; }

.avatar { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; background: var(--green-l); border: 3px solid #fff; box-shadow: var(--shadow); display: block; margin: 0 auto; }
.avatar.lg { width: 140px; height: 140px; } .avatar.sm { width: 64px; height: 64px; }

/* HOME */
.home { padding: 20px 20px 30px; }
.hero { text-align: center; padding-top: 6px; }
.brand { font: 700 22px Fraunces, serif; color: var(--green); letter-spacing: .5px; margin-bottom: 16px; }
.hello { color: var(--coral); font-weight: 600; margin-top: 14px; }
.social { color: var(--muted); }
.trust { font-size: 13px; color: var(--muted); }
.includes { background: var(--card); border-radius: var(--r); padding: 18px 20px; margin-top: 18px; box-shadow: var(--shadow); }
.includes h3 { font-size: 17px; }
.includes ul { list-style: none; padding: 0; margin: 10px 0 0; }
.includes li { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.includes li:last-child { border: 0; }
.includes li span { font-size: 22px; }
.foot { text-align: center; font-size: 13px; color: var(--muted); padding: 22px 0 8px; }

/* QUIZ */
.quiz { padding: 14px 20px 30px; }
.qtop { display: flex; align-items: center; gap: 12px; }
.back { background: none; border: 0; font-size: 24px; cursor: pointer; padding: 4px 8px; color: var(--ink); }
.bar { flex: 1; height: 8px; background: var(--line); border-radius: 9px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--green); border-radius: 9px; transition: width .3s; }
.qn { font-size: 12px; color: var(--muted); }
.qbody { padding-top: 26px; }
.qsub { color: var(--muted); margin-bottom: 16px; }
.opts { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.opt { display: flex; align-items: center; gap: 14px; background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 15px 16px; font: 500 16px Inter; text-align: left; cursor: pointer; color: var(--ink); }
.opt.sel { border-color: var(--green); background: var(--green-l); }
.oe { font-size: 24px; width: 30px; text-align: center; }
.chk { margin-left: auto; color: var(--green); font-weight: 700; }
.inp { width: 100%; padding: 16px; border: 2px solid var(--line); border-radius: 14px; font: 500 18px Inter; background: #fff; margin-top: 16px; }
.inp:focus { outline: none; border-color: var(--green); }
.numrow { display: flex; align-items: center; gap: 10px; }
.num { font-size: 28px; text-align: center; }
.unit { font: 600 18px Inter; color: var(--muted); margin-top: 16px; }
.unitsw { display: inline-flex; background: var(--line); border-radius: 999px; padding: 4px; margin-top: 10px; }
.unitsw button { border: 0; background: none; padding: 8px 18px; border-radius: 999px; font: 600 14px Inter; cursor: pointer; }
.unitsw .on { background: #fff; box-shadow: var(--shadow); }
.hint { color: var(--muted); font-size: 14px; }
.err { color: #C0392B; font-size: 14px; min-height: 20px; }
.info-card { background: var(--green-l); border-radius: var(--r); padding: 28px; text-align: center; margin: 16px 0; }
.info-e { font-size: 56px; }

/* PAGES */
.page { padding: 18px 20px 110px; }
.page.center { text-align: center; padding-top: 50px; }
.back-link { display: inline-block; text-decoration: none; font-weight: 500; margin-bottom: 8px; }
.card { display: block; background: var(--card); border-radius: var(--r); padding: 16px 18px; margin: 12px 0; box-shadow: var(--shadow); text-decoration: none; color: inherit; }
.card small { color: var(--muted); font-size: 13px; display: block; }
.note { background: #FFF6E5; border-radius: 14px; padding: 12px 14px; font-size: 14px; margin: 12px 0; }
.checks { list-style: none; padding: 0; margin: 8px 0; }
.checks li { padding: 6px 0 6px 28px; position: relative; }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 700; }

.building .bsteps { list-style: none; padding: 0; text-align: left; max-width: 300px; margin: 26px auto; }
.bsteps li { padding: 10px 0; color: var(--muted); display: flex; align-items: center; gap: 12px; transition: color .3s; }
.bsteps .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: inline-block; transition: all .3s; }
.bsteps li.done { color: var(--ink); font-weight: 600; }
.bsteps li.done .dot { background: var(--green); border-color: var(--green); box-shadow: inset 0 0 0 4px #fff; }

.result h2 { text-align: center; } .result .qsub { text-align: center; }
.chart { width: 100%; height: auto; margin: 8px 0; }
.chart .ct { font: 600 12px Inter; fill: var(--ink); }
.arrive { font-size: 17px; }
.bmibar { height: 10px; border-radius: 9px; background: linear-gradient(90deg, #7FB3D5, #58B07B 30%, #F4C04E 60%, #E5735A); position: relative; margin: 14px 0 8px; }
.bmibar i { position: absolute; top: -5px; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); transform: translateX(-50%); }
.bmil { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.bmil .on { color: var(--ink); font-weight: 700; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { background: var(--card); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); }
.stat small { color: var(--muted); font-size: 12px; display: block; } .stat b { font-size: 18px; }
.sticky { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 20px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); max-width: 480px; margin: 0 auto; }

/* TODAY */
.today { padding: 18px 20px 40px; }
.thead { display: flex; justify-content: space-between; align-items: center; }
.thead .avatar { margin: 0; }
.pills { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 6px; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pill { flex: none; border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; font: 600 13px Inter; cursor: pointer; color: var(--ink); }
.pill.on { background: var(--green); border-color: var(--green); color: #fff; }
.pill.lock { color: var(--muted); }
.unlock { width: 100%; border: 0; border-radius: 14px; background: var(--coral-l); color: var(--coral); font: 700 15px Inter; padding: 14px; margin: 8px 0; cursor: pointer; }
.goal { font-size: 15px; color: var(--muted); }
.meal { background: var(--card); border-radius: var(--r); padding: 12px 14px; margin: 10px 0; box-shadow: var(--shadow); display: flex; align-items: center; gap: 8px; }
.meal.ate { opacity: .65; }
.mlink { display: flex; gap: 12px; align-items: center; flex: 1; text-decoration: none; color: inherit; min-width: 0; }
.me { font-size: 32px; width: 44px; text-align: center; flex: none; }
.mtx { display: flex; flex-direction: column; min-width: 0; }
.mtx small { color: var(--muted); font-size: 12px; } .mtx b { font-size: 15px; line-height: 1.3; } .mtx em { font-style: normal; font-size: 12px; color: var(--muted); }
.ate-btn { flex: none; border: 2px solid var(--green); background: #fff; color: var(--green); border-radius: 999px; padding: 7px 11px; font: 600 12px Inter; cursor: pointer; margin-left: auto; }
.meal.ate .ate-btn, .move.ok .ate-btn { background: var(--green); color: #fff; }
.drink, .move { display: flex; align-items: center; gap: 12px; }
.drink b, .move b { display: block; }
.arrow { margin-left: auto; font-size: 22px; color: var(--muted); }
.water { display: grid; grid-template-columns: 1fr auto; align-items: center; }
.wbtns button { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--green); background: #fff; color: var(--green); font: 700 20px Inter; margin-left: 6px; cursor: pointer; }
.glasses { grid-column: 1 / -1; margin-top: 8px; letter-spacing: 2px; }
.glasses span { opacity: .25; } .glasses span.full { opacity: 1; }
.tip { background: var(--green-l); }
.sec { margin-top: 24px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { background: #fff; border-radius: var(--r); padding: 18px 12px; text-align: center; font-size: 30px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.tile span { display: block; font: 600 14px Inter; margin-top: 4px; }

/* DETAIL */
.dhead { text-align: center; margin-bottom: 10px; }
.de { font-size: 64px; display: block; }
.badge { display: inline-block; background: var(--coral-l); color: var(--coral); border-radius: 999px; padding: 4px 12px; font: 600 12px Inter; }
.ing { padding-left: 0; list-style: none; }
.ing li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.steps { padding-left: 22px; } .steps li { padding: 6px 0; }
.tipbox { background: var(--green-l); border-radius: 14px; padding: 12px 14px; margin: 12px 0; font-size: 15px; }
.blur { filter: blur(6px); pointer-events: none; user-select: none; max-height: 340px; overflow: hidden; }
.lockbox { background: #fff; border-radius: var(--r); padding: 18px; text-align: center; box-shadow: 0 -10px 30px rgba(0,0,0,.08); margin-top: -60px; position: relative; }

/* LIBRARY */
.tabs { display: flex; gap: 8px; margin: 12px 0 4px; }
.tabs a { flex: 1; text-align: center; padding: 9px; border-radius: 999px; background: #fff; text-decoration: none; color: var(--ink); font: 600 14px Inter; border: 2px solid var(--line); }
.tabs a.on { background: var(--green); color: #fff; border-color: var(--green); }
.search { font-size: 15px; padding: 12px 14px; }
.items { margin-top: 10px; }
.item { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 14px; padding: 10px 14px; margin: 8px 0; text-decoration: none; color: inherit; box-shadow: var(--shadow); }
.item b { display: block; font-size: 15px; } .item small { color: var(--muted); font-size: 12px; }
.shop { list-style: none; padding: 0; }
.shop li { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.shop small { color: var(--muted); font-size: 12px; }
.shop input { width: 18px; height: 18px; margin-right: 8px; accent-color: var(--green); vertical-align: -3px; }

/* PAYWALL */
.overlay { position: fixed; inset: 0; background: rgba(20, 25, 22, .55); display: flex; align-items: flex-end; justify-content: center; z-index: 50; animation: fade .2s; }
.sheet { background: var(--bg); width: 100%; max-width: 480px; border-radius: 24px 24px 0 0; padding: 22px 22px calc(22px + env(safe-area-inset-bottom)); position: relative; max-height: 92vh; overflow-y: auto; animation: up .25s; }
.sheet h2 { text-align: center; }
.x { position: absolute; right: 14px; top: 10px; border: 0; background: none; font-size: 30px; color: var(--muted); cursor: pointer; }
.price { background: #fff; border: 2px solid var(--green); border-radius: 16px; padding: 14px; text-align: center; margin: 14px 0 4px; }
.price b { display: block; font: 700 22px Fraunces, serif; color: var(--green); } .price span { color: var(--muted); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.spinner { width: 42px; height: 42px; border-radius: 50%; border: 4px solid var(--green-l); border-top-color: var(--green); margin: 26px auto; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
