@font-face { font-family: "Inter"; src: url("fonts/Inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
:root {
  --k0: #FFFFFF; --k1: #F6F6F5; --k2: #EEEEEC; --k3: #E4E3E0; --k4: #A3A29E; --k5: #6E6D69; --k6: #111111;
  --acc: #E8590C; --acc-bg: #FDF0E9;
  --hair: 1px solid var(--k3);
  --sb: env(safe-area-inset-bottom, 0px); --st: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--k0); color: var(--k6); font-family: "Inter", -apple-system, system-ui, sans-serif; -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1, "cv11" 1; }
body { font-size: 15px; line-height: 1.4; overscroll-behavior-y: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; }
input[type=number] { -moz-appearance: textfield; } input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; }
:focus-visible { outline: 2px solid var(--k6); outline-offset: 2px; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

#app { max-width: 560px; margin: 0 auto; min-height: 100vh; padding: calc(var(--st) + 12px) 0 calc(var(--sb) + 104px); }
body.full #app { padding-top: 0; }
body.full .tabs { display: none; }

/* typography */
.eyebrow { font-size: 13px; color: var(--k5); font-weight: 500; }
h1.title { font-size: 34px; font-weight: 700; letter-spacing: -.035em; line-height: 1.05; }
h2 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.big { font-weight: 700; letter-spacing: -.045em; line-height: .95; }
.u { font-size: .42em; font-weight: 500; color: var(--k5); letter-spacing: 0; margin-left: .25em; }
.mute { color: var(--k5); } .small { font-size: 13px; } .acc { color: var(--acc); }
.link { background: none; border: 0; padding: 0; color: inherit; font-size: 14px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--k4); }

/* layout */
.pad { padding: 0 20px; }
.head { display: flex; justify-content: space-between; align-items: flex-start; padding: 8px 20px 4px; gap: 12px; }
.sec { padding: 26px 20px 0; }
.sec-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.card { background: var(--k1); border-radius: 22px; padding: 18px; }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.list > * + * { border-top: var(--hair); }
.empty { padding: 26px 0; text-align: center; color: var(--k5); font-size: 14px; }

/* controls */
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; height: 54px; border-radius: 27px; width: 100%; font-weight: 600; font-size: 17px; }
.btn-primary { background: var(--k6); color: #fff; box-shadow: 0 10px 24px -14px rgba(0,0,0,.5); }
.btn-primary:active { transform: scale(.985); }
.btn-ghost { background: var(--k1); color: var(--k6); }
.btn-sm { height: 40px; border-radius: 20px; font-size: 15px; width: auto; padding: 0 16px; }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 21px; background: var(--k1); flex: none; }
.chip { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 14px; font-size: 13px; font-weight: 500; background: var(--k1); white-space: nowrap; }
.chip.on { background: var(--k6); color: #fff; }
.chip.acc { background: var(--acc-bg); color: var(--acc); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.seg { display: flex; background: var(--k1); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { flex: 1; height: 36px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--k5); }
.seg button.on { background: var(--k6); color: #fff; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; color: var(--k5); margin-bottom: 6px; font-weight: 500; }
.input { width: 100%; height: 50px; border-radius: 14px; border: 1px solid var(--k3); background: #fff; padding: 0 14px; font-size: 17px; outline: none; }
.input:focus { border-color: var(--k6); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.bar { height: 6px; background: var(--k3); border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--k6); border-radius: 3px; }
.bar.over > i { background: var(--acc); }

/* tabs */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px 8px calc(var(--sb) + 6px); background: rgba(255,255,255,.94); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-top: var(--hair); }
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; font-size: 11px; font-weight: 500; color: var(--k4); padding: 2px 0; }
.tabs a.on { color: var(--k6); } .tabs a.on span { font-weight: 700; }

/* home */
.saldo .big { font-size: 76px; }
.macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.macro .v { font-size: 15px; font-weight: 600; margin-bottom: 6px; } .macro .v small { color: var(--k5); font-weight: 500; }
.workout { border: var(--hair); border-radius: 22px; overflow: hidden; }
.workout .top { padding: 18px 18px 6px; }
.exrow { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 10px 18px; text-decoration: none; }
.exrow img, .thumb { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--k2); }
.exrow .n { font-weight: 600; } .exrow .t { font-size: 13px; color: var(--k5); }
.measure { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.measure .card { padding: 16px; }
.measure .big { font-size: 34px; }
.review li { list-style: none; display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 6px 0; font-size: 14.5px; }
.review li i { width: 8px; height: 8px; border-radius: 50%; background: var(--k6); margin-top: 7px; }
.review li.bad i { background: var(--acc); }
.review .adv { margin-top: 10px; padding-top: 12px; border-top: var(--hair); font-weight: 600; }

/* session */
.media { position: relative; height: min(46vh, 360px); background: var(--k1); overflow: hidden; }
.media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media img.b { animation: flip 2.4s steps(1) infinite; }
@keyframes flip { 0% { opacity: 0 } 50% { opacity: 1 } }
.media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(255,255,255,.6) 0, rgba(255,255,255,0) 26%, rgba(255,255,255,0) 55%, #fff 100%); pointer-events: none; }
.media .ov { position: absolute; left: 0; right: 0; z-index: 2; }
.media .ov.top { top: calc(var(--st) + 10px); display: flex; justify-content: space-between; align-items: center; padding: 0 14px; }
.media .icon-btn { background: rgba(255,255,255,.92); }
.pill { height: 36px; border-radius: 18px; background: rgba(255,255,255,.92); display: flex; align-items: center; padding: 0 14px; font-size: 14px; font-weight: 600; gap: 6px; }
.media .ov.name { bottom: 10px; padding: 0 20px; }
.media h1 { font-size: 44px; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.segs { display: flex; gap: 4px; padding: 12px 20px 0; }
.segs i { flex: 1; height: 4px; border-radius: 2px; background: var(--k3); }
.segs i.done { background: var(--k4); } .segs i.now { background: var(--k6); }
.cues { margin: 14px 20px 0; padding: 14px 16px; border-radius: 18px; background: var(--k1); }
.cues ol { list-style: none; counter-reset: c; }
.cues li { counter-increment: c; display: grid; grid-template-columns: 24px 1fr; padding: 4px 0; font-size: 14.5px; color: #333; }
.cues li::before { content: counter(c); font-weight: 700; }
.sets { margin: 10px 20px 0; }
.set { display: grid; grid-template-columns: 28px 1fr 1fr 44px; align-items: center; min-height: 52px; border-bottom: var(--hair); }
.set .n { font-weight: 600; color: var(--k5); }
.set .v { font-size: 24px; font-weight: 700; letter-spacing: -.03em; }
.set.todo .v { color: var(--k4); }
.set .st { justify-self: end; color: var(--k6); }
.set button.st { width: 40px; height: 40px; display: grid; place-items: center; }
.set.now { display: block; border: 1.5px solid var(--k6); border-radius: 20px; padding: 14px; margin: 10px 0; }
.set.now .lab { font-size: 13px; font-weight: 600; margin-bottom: 10px; display: flex; justify-content: space-between; }
.steppers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.step { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; background: var(--k1); border-radius: 14px; padding: 4px; }
.step button { height: 46px; border-radius: 11px; background: #fff; display: grid; place-items: center; }
.step input { width: 100%; text-align: center; border: 0; background: none; font-size: 30px; font-weight: 700; letter-spacing: -.03em; outline: none; min-width: 0; }
.step .cap { grid-column: 1 / -1; text-align: center; font-size: 12px; color: var(--k5); padding-bottom: 2px; }
.plates { display: flex; align-items: center; gap: 4px; margin-top: 12px; font-size: 13px; color: var(--k5); }
.plates .pl { width: 10px; border-radius: 2px; background: var(--k6); }
.rest { margin: 14px 20px 0; padding: 16px; border-radius: 20px; background: var(--k6); color: #fff; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; }
.rest .t { font-size: 48px; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.rest .l { font-size: 13px; color: #bbb; }
.rest .adj { display: flex; gap: 6px; }
.rest .adj button { height: 38px; padding: 0 12px; border-radius: 12px; background: rgba(255,255,255,.14); color: #fff; font-weight: 600; font-size: 14px; }
.rest.over { background: var(--acc); }
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; padding: 14px 20px calc(var(--sb) + 14px); background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 30%); }
.dock .inner { max-width: 520px; margin: 0 auto; display: flex; gap: 10px; }
.dock .btn-primary { flex: 1; height: 60px; font-size: 19px; border-radius: 30px; }

/* food */
.datenav { display: flex; align-items: center; justify-content: space-between; padding: 4px 20px 0; }
.meal { padding: 20px 20px 0; }
.meal .mh { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.meal .mh b { font-size: 17px; }
.fe { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 11px 0; align-items: center; width: 100%; text-align: left; }
.fe .n { font-weight: 500; } .fe .q { font-size: 13px; color: var(--k5); }
.fe .k { font-weight: 600; }
.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 14px; color: var(--k5); }
.search .input { padding-left: 44px; }
.result { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px 0; width: 100%; text-align: left; }
.badge { font-size: 11px; color: var(--k5); background: var(--k1); border-radius: 6px; padding: 1px 6px; margin-left: 6px; font-weight: 500; }

/* sheet */
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(17,17,17,.32); display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet .panel { background: #fff; width: 100%; max-width: 560px; border-radius: 26px 26px 0 0; padding: 10px 20px calc(var(--sb) + 20px); max-height: 92vh; overflow: auto; animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: .5 } }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--k3); margin: 0 auto 14px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--sb) + 96px); z-index: 60; background: var(--k6); color: #fff; padding: 10px 16px; border-radius: 14px; font-size: 14px; font-weight: 500; max-width: 90vw; }

/* guide */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 20px; }
.pair figure { position: relative; border-radius: 16px; overflow: hidden; background: var(--k1); aspect-ratio: 1; }
.pair img { width: 100%; height: 100%; object-fit: cover; }
.pair figcaption { position: absolute; left: 8px; bottom: 8px; background: rgba(255,255,255,.92); border-radius: 8px; padding: 2px 8px; font-size: 12px; font-weight: 600; }
.steps { list-style: none; counter-reset: c; }
.steps li { counter-increment: c; display: grid; grid-template-columns: 32px 1fr; padding: 10px 0; border-bottom: var(--hair); }
.steps li::before { content: counter(c); font-size: 20px; font-weight: 700; }
.mist li { list-style: none; padding: 6px 0 6px 18px; position: relative; font-size: 14.5px; }
.mist li::before { content: ""; position: absolute; left: 2px; top: 13px; width: 8px; height: 2px; background: var(--acc); }

/* stats */
.chart { width: 100%; height: auto; display: block; }
.chart text { font: 500 11px "Inter", sans-serif; fill: var(--k5); }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); }
.kpis > div + div { border-left: var(--hair); padding-left: 14px; }
.kpis .big { font-size: 30px; }
.vol { display: grid; grid-template-columns: 120px 1fr 34px; gap: 10px; align-items: center; padding: 6px 0; font-size: 14px; }
.vol .track { position: relative; height: 10px; background: var(--k1); border-radius: 5px; }
.vol .zone { position: absolute; top: 0; bottom: 0; background: var(--k3); border-radius: 5px; }
.vol .fill { position: absolute; top: 2px; bottom: 2px; left: 0; background: var(--k6); border-radius: 3px; }
.vol.low .fill { background: var(--acc); }
.lift { display: grid; grid-template-columns: 1fr 96px 70px; gap: 10px; align-items: center; padding: 10px 0; }
.dots { display: flex; gap: 6px; flex-wrap: wrap; }
.dots span { width: 26px; height: 26px; border-radius: 13px; display: grid; place-items: center; font-size: 11px; font-weight: 600; background: var(--k1); color: var(--k5); }
.dots span.hit { background: var(--k6); color: #fff; }

.done-hero { padding: calc(var(--st) + 40px) 20px 0; }
.done-hero .big { font-size: 64px; }
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--k5); }
.sync i { width: 7px; height: 7px; border-radius: 50%; background: var(--k4); }
.sync.ok i { background: var(--k6); } .sync.err i { background: var(--acc); }
@media (prefers-reduced-motion: reduce) { .media img.b { animation: none; display: none; } .sheet .panel { animation: none; } }

/* onboarding */
.ob { max-width: 520px; margin: 0 auto; min-height: 100vh; }
.ob-top { display: flex; align-items: center; gap: 14px; padding: calc(var(--st) + 12px) 20px 0; }
.obbar { flex: 1; height: 4px; border-radius: 2px; background: var(--k2); overflow: hidden; }
.obbar i { display: block; height: 100%; background: var(--k6); border-radius: 2px; transition: width .3s ease; }
.ob-body { padding-top: 34px; }
.ob .lead { color: var(--k5); font-size: 16px; margin: 10px 0 26px; line-height: 1.45; }
.input.xl { height: 58px; font-size: 22px; font-weight: 600; border-radius: 16px; }
.opt { display: block; width: 100%; text-align: left; padding: 18px 18px; border: 1.5px solid var(--k3); border-radius: 18px; margin-bottom: 12px; background: #fff; transition: border-color .15s, background .15s; }
.opt b { display: block; font-size: 18px; letter-spacing: -.01em; }
.opt span { display: block; font-size: 14px; color: var(--k5); margin-top: 3px; }
.opt.on { border-color: var(--k6); background: var(--k1); }
.opt:active { transform: scale(.99); }
.btn:disabled { background: var(--k3); color: var(--k5); box-shadow: none; }
.ob-welcome { padding: calc(var(--st) + 14vh) 24px 0; }
.ob-welcome .logo { width: 64px; height: 64px; border-radius: 18px; border: 1.5px solid var(--k3); display: grid; place-items: center; font-size: 34px; font-weight: 700; position: relative; margin-bottom: 26px; letter-spacing: -.04em; }
.ob-welcome .logo i { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--acc); right: 12px; bottom: 15px; }
.feat { list-style: none; margin-top: 8px; }
.feat li { padding: 14px 0; border-top: var(--hair); display: flex; justify-content: space-between; gap: 12px; }
.feat li span { color: var(--k5); font-size: 14px; text-align: right; }
.sh { font-size: 17px; margin: 22px 0 12px; }
details.adv { margin-top: 22px; border-top: var(--hair); padding-top: 14px; }
details.adv summary { font-weight: 600; font-size: 16px; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
details.adv summary::after { content: "+"; font-size: 20px; color: var(--k5); }
details.adv[open] summary::after { content: "–"; }
details.adv summary::-webkit-details-marker { display: none; }

/* foto makanan */
.photo-btn { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; margin-top: 14px; padding: 16px; border-radius: 18px; background: var(--k6); color: #fff; }
.photo-btn .i { width: 24px; height: 24px; flex: none; }
.photo-btn div { flex: 1; } .photo-btn b { display: block; font-size: 17px; } .photo-btn span { font-size: 13px; opacity: .7; }
.pjob img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; flex: none; margin-right: 12px; }
.pjob { justify-content: flex-start; } .pjob > div { flex: 1; text-align: left; }
.dot-acc { width: 9px; height: 9px; border-radius: 50%; background: var(--acc); margin-right: 8px; flex: none; }
.pitem { display: flex; align-items: center; gap: 8px; padding: 12px 0; border-bottom: var(--hair); }
.pitem .n { font-weight: 600; } .pitem .q { font-size: 13px; color: var(--k5); }
.pitem .input { width: 74px; height: 42px; text-align: right; font-weight: 600; padding: 0 10px; }
.pitem .icon-btn { width: 36px; height: 36px; }
.analyzing { display: flex; justify-content: center; gap: 8px; margin: 34px 0 18px; }
.analyzing i { width: 10px; height: 10px; border-radius: 50%; background: var(--k6); animation: pulse 1.2s infinite ease-in-out; }
.analyzing i:nth-child(2) { animation-delay: .15s; } .analyzing i:nth-child(3) { animation-delay: .3s; background: var(--acc); }
@keyframes pulse { 0%, 80%, 100% { transform: scale(.5); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .analyzing i { animation: none; } }
