:root{--bg:#0d0e10;--card:#17191d;--line:#2a2d33;--text:#f4f5f7;--muted:#9da3ad;--yellow:#ffe000;--green:#68d391;--red:#ff6b6b}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-family:Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;padding-bottom:76px}.top{padding:20px 18px 12px;position:sticky;top:0;background:rgba(13,14,16,.94);backdrop-filter:blur(12px);z-index:10;border-bottom:1px solid #17191d;display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.brand{font-weight:900;letter-spacing:.06em}.brand span{color:var(--yellow);font-size:1.35em}.phase{font-size:.82rem;color:var(--muted);margin-top:4px}.gear{color:var(--muted);text-decoration:none;font-size:1.25rem;padding:2px 7px}.wrap{max-width:980px;margin:0 auto;padding:16px}.wrap.narrow{max-width:700px}.hero{padding:18px 2px}.big{font-size:3.4rem;font-weight:900;line-height:.9}.big small{font-size:1rem;color:var(--muted)}.muted{color:var(--muted)}.ok{color:var(--green)}.grid2{display:grid;gap:14px}.card{background:var(--card);border:1px solid var(--line);border-radius:18px;padding:18px;margin-bottom:14px;box-shadow:0 8px 30px rgba(0,0,0,.18)}h1,h2,h3{margin:0 0 14px}h2{font-size:.86rem;letter-spacing:.12em;color:var(--muted)}.metric,.logrow,.statusline{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 0;border-bottom:1px solid var(--line)}.metric:last-child,.statusline:last-child{border-bottom:0}.submetric{font-size:.78rem;color:var(--muted);text-align:right;margin-top:7px}.meter{font-size:1.25rem;margin-bottom:10px}.bar{height:8px;background:#282b31;border-radius:999px;overflow:hidden;margin-top:10px}.bar i{display:block;height:100%;background:var(--yellow)}.workout-badge{display:inline-block;background:var(--yellow);color:#111;font-weight:900;padding:7px 10px;border-radius:9px;margin-bottom:12px}.btn{appearance:none;border:1px solid #3b3f47;background:#25282e;color:white;border-radius:12px;padding:12px 15px;font-weight:800;text-decoration:none;text-align:center;cursor:pointer}.btn.primary{background:var(--yellow);border-color:var(--yellow);color:#111}.btn.full{display:block;width:100%;margin-top:16px}.quick{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.quick label,.stack label,.weight{font-size:.78rem;color:var(--muted);display:flex;flex-direction:column;gap:5px}input,select{width:100%;background:#0f1114;color:var(--text);border:1px solid #343840;border-radius:10px;padding:11px;font-size:1rem}.food-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.food-tile,.cardio-tile{background:#111317;border:1px solid var(--line);border-radius:15px;padding:14px;min-height:150px;display:flex;flex-direction:column}.food-tile h3,.cardio-tile h3{font-size:1rem}.food-tile small,.cardio-tile small{color:var(--muted);margin-top:4px}.tile-top{display:flex;justify-content:space-between;gap:8px;align-items:flex-start}.tile-top h3{margin-bottom:10px}.delete-tile{border:0;background:transparent;color:var(--muted);font-size:1.4rem;line-height:1;padding:0 2px;cursor:pointer}.tile-actions{margin-top:auto;display:flex;gap:8px;padding-top:12px}.tile-actions select{width:auto;flex:1}.plus{width:44px;border:0;border-radius:11px;background:var(--yellow);font-size:1.5rem;font-weight:900}.iconbtn{background:none;color:var(--muted);border:0;font-size:1.4rem}.totals{font-weight:900;padding-top:14px}.exercise{padding:15px 0;border-bottom:1px solid var(--line)}.exercise-head{display:flex;flex-direction:column;gap:2px}.weight{width:120px;margin:10px 0}.sets{display:grid;grid-template-columns:repeat(var(--sets,4),minmax(0,1fr));gap:8px}.sets input{text-align:center;font-weight:900;font-size:1.15rem}.cardio-grid{display:grid;grid-template-columns:repeat(1,minmax(0,1fr));gap:10px}.cardio-tile{min-height:140px}.today-cardio{margin-top:18px}.bottom{position:fixed;bottom:0;left:0;right:0;background:rgba(19,21,25,.97);border-top:1px solid var(--line);display:grid;grid-template-columns:repeat(4,1fr);z-index:20;padding-bottom:env(safe-area-inset-bottom)}.bottom a{padding:17px 6px;text-align:center;color:var(--muted);text-decoration:none;font-size:.72rem;font-weight:900}.bottom a.active{color:var(--yellow)}.setup{min-height:100vh;display:grid;place-items:center;padding:20px}.auth-card{width:min(520px,100%);background:var(--card);border:1px solid var(--line);border-radius:20px;padding:24px}.stack{display:grid;gap:12px}.stack hr{width:100%;border:0;border-top:1px solid var(--line)}.alert{background:#401d1d;border:1px solid #763333;padding:11px;border-radius:10px;margin:10px 0;color:#ffd1d1}.success{background:#173523;border:1px solid #2d6842;padding:11px;border-radius:10px;margin:10px 0;color:#c9f7d7}details summary{cursor:pointer;font-weight:800}.form-spaced{margin-top:16px}canvas{width:100%;display:block}@media(min-width:760px){.grid2{grid-template-columns:1fr 1fr}.food-grid{grid-template-columns:repeat(3,1fr)}.cardio-grid{grid-template-columns:repeat(2,1fr)}.quick{grid-template-columns:repeat(6,1fr)}.big{font-size:4.6rem}.wrap{padding:22px}.bottom{left:50%;transform:translateX(-50%);max-width:620px;border:1px solid var(--line);border-bottom:0;border-radius:16px 16px 0 0}}

.done-banner{background:#173523;border:1px solid #2d6842;color:#c9f7d7;border-radius:12px;padding:12px 14px;font-weight:900;margin:8px 0 4px}.plan-manager>summary{font-size:.88rem;letter-spacing:.06em}.plan-list{display:grid;gap:8px;margin:16px 0}.plan-item{background:#111317;border:1px solid var(--line);border-radius:13px;padding:10px}.exercise-config{display:grid;grid-template-columns:2fr 1fr .7fr .8fr .8fr .8fr auto;gap:8px;align-items:end}.exercise-config label{font-size:.72rem;color:var(--muted);display:flex;flex-direction:column;gap:4px}.remove-exercise{text-align:right;margin-top:4px}.text-danger{border:0;background:transparent;color:var(--red);font-weight:700;cursor:pointer}.add-exercise{background:#111317;border:1px solid var(--line);border-radius:13px;padding:10px;margin-top:8px}.restore-title{margin-top:22px}.restore-row{display:flex;align-items:center;justify-content:space-between;gap:10px;border-bottom:1px solid var(--line);padding:8px 0}@media(max-width:700px){.sets{grid-template-columns:repeat(4,minmax(0,1fr))}.exercise-config{grid-template-columns:1fr 1fr}.exercise-config label:first-of-type{grid-column:1/-1}.exercise-config .btn{grid-column:1/-1}.plan-manager{padding:16px}}

/* v0.5 — dynamic calorie budget + yearly phase planner */
.budget-card{border-color:#3a3820}.budget-number{font-size:3.2rem;font-weight:950;line-height:.95;color:var(--yellow);margin-top:4px}.budget-number small{font-size:1rem;color:var(--muted)}.budget-number.over{color:var(--red)}.budget-label{font-weight:900;letter-spacing:.08em;font-size:.78rem;margin:8px 0 14px}.budget-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:16px}.budget-grid>div{background:#111317;border:1px solid var(--line);border-radius:12px;padding:11px}.budget-grid span{display:block;color:var(--muted);font-size:.72rem;margin-bottom:3px}.budget-grid b{font-size:.95rem}.phase-balance{margin-top:12px;font-size:.8rem;color:var(--muted)}.textlink{display:inline-block;margin-top:14px;color:var(--yellow);text-decoration:none;font-weight:800;font-size:.8rem}.bottom.five{grid-template-columns:repeat(5,1fr)}.bottom.five a{font-size:.66rem;padding-left:2px;padding-right:2px}
.phase-plan-card.current-phase{border-color:#837515;box-shadow:0 0 0 1px rgba(255,224,0,.08),0 8px 30px rgba(0,0,0,.18)}.phase-plan-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}.phase-plan-head h3{margin:3px 0 4px}.phase-type{font-size:.7rem;letter-spacing:.12em;font-weight:900;color:var(--yellow)}.phase-dates{font-size:.76rem;color:var(--muted);white-space:nowrap}.phase-summary{color:var(--muted);font-size:.88rem;margin-bottom:14px}.phase-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-top:14px}.phase-form label{font-size:.72rem;color:var(--muted);display:flex;flex-direction:column;gap:4px}.phase-form .btn{grid-column:1/-1}.extend-row{display:flex;align-items:center;flex-wrap:wrap;gap:7px;border-top:1px solid var(--line);margin-top:14px;padding-top:12px}.extend-row>span{color:var(--muted);font-size:.78rem;margin-right:3px}.btn.mini{padding:8px 10px;font-size:.72rem}.phase-delete{text-align:right;margin-top:8px}@media(max-width:520px){.budget-number{font-size:2.7rem}.budget-grid{grid-template-columns:1fr 1fr}.phase-plan-head{display:block}.phase-dates{margin-bottom:10px}.phase-form{grid-template-columns:1fr}.bottom.five a{font-size:.61rem}}

/* v0.6 — richer PROGRESS + horizontal swipe */
.progress-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin:2px 0 10px}.progress-head h1{margin-bottom:4px}.progress-arrows{display:flex;gap:7px}.progress-arrow{width:40px;height:40px;border-radius:12px;border:1px solid var(--line);background:var(--card);color:var(--text);font-size:1.7rem;line-height:1;cursor:pointer}.progress-dots{display:flex;gap:7px;overflow-x:auto;padding:0 0 10px;scrollbar-width:none}.progress-dots::-webkit-scrollbar{display:none}.progress-dots button{border:1px solid var(--line);background:#111317;color:var(--muted);border-radius:999px;padding:8px 12px;font-size:.68rem;font-weight:900;letter-spacing:.06em;white-space:nowrap}.progress-dots button.active{background:var(--yellow);border-color:var(--yellow);color:#111}.progress-carousel{display:flex;gap:14px;overflow-x:auto;scroll-snap-type:x mandatory;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;scrollbar-width:none;padding-bottom:4px}.progress-carousel::-webkit-scrollbar{display:none}.progress-slide{flex:0 0 100%;scroll-snap-align:start;scroll-snap-stop:always;margin-bottom:0;min-width:0}.progress-slide-title{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:8px}.progress-kpi{font-size:1.5rem;font-weight:950}.progress-mini{color:var(--muted);font-size:.8rem;padding-top:2px}.progress-chart{height:270px!important;min-height:270px;margin-top:4px}.chart-note{color:var(--muted);font-size:.74rem;line-height:1.45;margin:8px 0 0}.history-list{margin-top:12px}.history-list .metric{font-size:.82rem}.history-list .metric small{color:var(--muted)}
@media(max-width:520px){.progress-arrows{display:none}.progress-slide{padding:16px}.progress-chart{height:255px!important;min-height:255px}.progress-kpi{font-size:1.28rem}}

.balance-deficit{color:var(--green)!important}.balance-surplus{color:var(--red)!important}


/* v0.6.2 — compact mobile TODAY + sync freshness */
.weight-summary-card{padding:15px 16px;margin-bottom:10px}.weight-summary-top{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.weight-summary-top h2{margin-bottom:7px}.weight-current{font-size:3.15rem;font-weight:950;line-height:1.02;letter-spacing:-.035em;white-space:nowrap}.weight-current small{font-size:1rem;font-weight:800;color:var(--muted);letter-spacing:0;margin-left:5px}.weight-goal-chip{border:1px solid #3a3e46;background:#111317;color:var(--muted);border-radius:999px;padding:7px 9px;font-size:.68rem;font-weight:900;white-space:nowrap}.weight-summary-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-top:13px}.weight-summary-grid>div{background:#111317;border:1px solid var(--line);border-radius:11px;padding:9px}.weight-summary-grid span{display:block;color:var(--muted);font-size:.63rem;margin-bottom:3px}.weight-summary-grid b{font-size:.78rem;line-height:1.2}.budget-card{padding:16px;margin-bottom:10px}.budget-card h2{margin-bottom:8px}.budget-number{font-size:2.85rem}.budget-label{margin:6px 0 10px}.budget-grid{margin-top:12px;gap:7px}.budget-grid>div{padding:9px}.budget-footer{display:flex;justify-content:space-between;gap:8px;color:var(--muted);font-size:.72rem;margin-top:10px}.forecast-details{margin-top:7px;color:var(--muted);font-size:.7rem}.forecast-details summary{font-weight:800;color:var(--muted);cursor:pointer}.forecast-details>div{margin-top:5px;line-height:1.4}.compact-card{padding:15px 16px}.card-title-row{display:flex;align-items:center;justify-content:space-between;gap:10px}.card-title-row h2{margin-bottom:0}.sync-pill{font-size:.59rem;font-weight:950;border-radius:999px;padding:5px 7px;letter-spacing:.04em}.sync-pill.fresh{color:#c9f7d7;background:#173523;border:1px solid #2d6842}.sync-pill.stale{color:#ffd1d1;background:#401d1d;border:1px solid #763333}.sync-time{font-size:.66rem;color:var(--muted);text-align:right;margin-top:8px}
@media(max-width:520px){.wrap{padding:12px}.top{padding:15px 16px 10px}.weight-summary-card{border-radius:16px}.weight-current{font-size:2.85rem}.weight-summary-grid{gap:5px}.weight-summary-grid>div{padding:8px 7px}.weight-summary-grid b{font-size:.72rem}.budget-number{font-size:2.65rem}.budget-grid span{font-size:.66rem}.budget-grid b{font-size:.87rem}.budget-footer{font-size:.68rem}.card{border-radius:16px}.grid2{gap:10px}}

/* v0.6.3 — untracked strength activity + safer TDEE floor */
.tracking-meta{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin:10px 0 16px;padding:12px;background:#111317;border:1px solid var(--line);border-radius:13px}.tracking-meta.saved{margin-top:10px}.tracking-meta label{display:flex;flex-direction:column;gap:5px;color:var(--muted);font-size:.72rem;font-weight:800}.tracking-meta label span{display:inline;color:var(--muted)}.tracking-meta input,.tracking-meta select{margin-top:2px}.tracking-hint,.tracking-estimate{grid-column:1/-1;color:var(--muted);font-size:.72rem;line-height:1.4}.tracking-estimate{color:#c9f7d7;font-weight:800}.tracking-meta .btn{grid-column:1/-1}.forecast-details div+div{margin-top:4px}
@media(max-width:520px){.tracking-meta{grid-template-columns:1fr}.tracking-hint,.tracking-estimate,.tracking-meta .btn{grid-column:1}.tracking-meta{padding:10px}}

/* v0.6.5 — edit historical FOOD / TRAINING days */
.date-editor{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 16px}.date-editor h2{margin:0 0 8px}.date-editor-main{display:flex;align-items:center;gap:8px}.date-picker-form{display:flex;align-items:center;gap:8px}.date-picker-form input[type=date]{min-width:150px}.date-arrow{width:38px;height:38px;display:grid;place-items:center;border:1px solid var(--line);background:#111317;color:var(--text);border-radius:11px;text-decoration:none;font-size:1.55rem;font-weight:900;line-height:1}.date-arrow.disabled{opacity:.28;cursor:default}.date-editor-side{text-align:right;display:flex;flex-direction:column;align-items:flex-end;gap:2px}.date-editor-side b{font-size:.92rem}.date-editor-side .textlink{margin-top:2px;font-size:.7rem}.history-edit-row{gap:10px}.history-edit-right{display:flex;align-items:center;justify-content:flex-end;gap:10px}.history-edit-link{font-size:.62rem;font-weight:950;letter-spacing:.06em;color:var(--yellow);text-decoration:none;border:1px solid #4b4520;border-radius:999px;padding:5px 7px;white-space:nowrap}
@media(max-width:620px){.date-editor{align-items:stretch;flex-direction:column;gap:10px}.date-editor-main{width:100%}.date-picker-form{flex:1}.date-picker-form input[type=date]{min-width:0;width:100%}.date-picker-form .btn{padding:9px 10px}.date-editor-side{align-items:flex-start;text-align:left}.history-edit-right{gap:6px}.history-edit-link{font-size:.58rem;padding:4px 6px}}


/* v0.7 — libraries, ordering, compact progress */
.progress-carousel{align-items:flex-start;overflow-y:hidden;transition:height .18s ease}
.progress-slide{align-self:flex-start;height:auto!important;min-height:0!important}

.section-title-row{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.section-title-row h1{margin-bottom:8px}.sort-status{color:var(--green);font-size:.7rem;font-weight:850;white-space:nowrap;padding-top:4px}
.food-tile{position:relative}.food-tile.dragging{opacity:.62;outline:2px solid var(--yellow);z-index:4}.tile-top{align-items:flex-start}.food-drag{flex:0 0 auto;width:28px;height:28px;border:1px solid var(--line);border-radius:8px;background:#202329;color:var(--muted);font-weight:950;font-size:1.1rem;line-height:1;cursor:grab;touch-action:none}.food-drag:active{cursor:grabbing}.tile-title{flex:1;min-width:0}.tile-title h3{margin:0 0 5px}.meal-chip{display:inline-block;font-size:.54rem;letter-spacing:.08em;font-weight:950;color:var(--muted);border:1px solid var(--line);border-radius:999px;padding:3px 5px}.tile-tools{display:flex;align-items:flex-start;gap:5px}.tile-editor{position:relative}.tile-editor>summary{list-style:none;width:26px;height:26px;display:grid;place-items:center;border:0;background:transparent;color:var(--muted);font-size:1.05rem;cursor:pointer}.tile-editor>summary::-webkit-details-marker{display:none}.tile-editor[open]{position:static}.tile-editor[open]>.tile-edit-form{display:grid}.tile-edit-form{display:none;position:absolute;z-index:30;left:10px;right:10px;top:42px;background:#0f1114;border:1px solid #454a53;border-radius:13px;padding:12px;box-shadow:0 16px 40px rgba(0,0,0,.55);gap:8px}.tile-edit-form label,.food-create-form label{font-size:.7rem;color:var(--muted);display:flex;flex-direction:column;gap:4px}.edit-grid-2{display:grid;grid-template-columns:1fr 1fr;gap:7px}.food-create-form{display:grid;grid-template-columns:1fr 1fr;gap:9px}.food-create-form>label:first-of-type,.food-create-form>.edit-grid-2,.food-create-form>.btn{grid-column:1/-1}.plus.color-yellow{background:var(--yellow);color:#111}.plus.color-red{background:#ff6b6b;color:#111}.plus.color-green{background:#68d391;color:#111}.plus.color-white{background:#f4f5f7;color:#111}.add-food-card summary{font-size:.86rem;letter-spacing:.04em}.tiny{font-size:.67rem!important}

.cardio-library-card>h2,.training-card>h2{font-size:1rem;color:var(--text);letter-spacing:.11em;margin-bottom:12px}.cardio-tile{position:relative}.cardio-tile .tile-top{margin-bottom:6px}.cardio-tile .tile-editor[open]>.tile-edit-form{top:46px}.cardio-add-tile{justify-content:center;border-style:dashed;min-height:140px}.cardio-add-tile>summary{list-style:none;display:flex;align-items:center;justify-content:center;gap:9px;min-height:96px;text-align:center;cursor:pointer;font-size:.78rem}.cardio-add-tile>summary::-webkit-details-marker{display:none}.cardio-add-tile[open]>summary{min-height:auto;justify-content:flex-start;margin-bottom:8px}.cardio-add-tile .tile-edit-form{display:grid;position:static;box-shadow:none;border:0;padding:0;background:transparent}.add-cardio-plus{display:grid;place-items:center;width:32px;height:32px;border-radius:9px;background:var(--yellow);color:#111;font-size:1.35rem;font-weight:950}

@media(max-width:620px){
  .section-title-row{display:block}.sort-status{display:block;min-height:16px;padding:0 0 5px}
  .food-tile{padding:12px}.food-drag{width:25px;height:25px}.tile-tools{gap:1px}.tile-edit-form{left:6px;right:6px}
  .food-create-form{grid-template-columns:1fr}.food-create-form>label:first-of-type,.food-create-form>.edit-grid-2,.food-create-form>.btn{grid-column:1}
}
