:root{--ink:#16251d;--muted:#708078;--paper:#f4f2eb;--card:#fff;--green:#83ad73;--green-dark:#345d45;--orange:#e89950;--line:#e2e4dc;--shadow:0 12px 30px rgba(35,55,43,.07)}
*{box-sizing:border-box}html{background:var(--paper);color:var(--ink);font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}body{margin:0;padding-bottom:92px}button,input{font:inherit}button{cursor:pointer}.auth-screen{position:fixed;inset:0;z-index:100;background:var(--ink);display:grid;place-items:center;padding:20px;background-image:radial-gradient(circle at 70% 10%,rgba(131,173,115,.22),transparent 38%)}.auth-screen.hidden{display:none}.auth-card{width:min(430px,100%);background:#fbfaf5;border-radius:28px;padding:34px;box-shadow:0 28px 70px rgba(0,0,0,.28)}.auth-mark{width:52px;height:52px;display:grid;place-items:center;border-radius:16px;background:var(--ink);color:white;font:1.55rem Georgia,serif;margin-bottom:24px}.auth-mark span{color:var(--orange)}.auth-card h2{font:2rem Georgia,serif;margin:0 0 10px}.auth-card p{color:var(--muted);line-height:1.5;margin:0 0 22px}.auth-card label+label{margin-top:14px}.auth-note{display:block;color:var(--muted);line-height:1.4;margin-top:16px}.topbar{height:92px;display:flex;align-items:center;justify-content:space-between;max-width:1100px;margin:auto;padding:18px 24px}.eyebrow{display:block;font-size:.68rem;font-weight:800;letter-spacing:.16em;color:#809087;margin-bottom:5px}.topbar h1{font-family:Georgia,serif;font-size:2rem;line-height:1;margin:0}.topbar h1 span{color:var(--orange)}.top-actions{display:flex;align-items:center;gap:8px}.top-actions>span{font-size:.72rem;color:var(--muted);max-width:190px;overflow:hidden;text-overflow:ellipsis}.icon-button{border:1px solid #d7dcd4;border-radius:99px;background:rgba(255,255,255,.55);padding:10px 15px;color:var(--green-dark);font-size:.78rem;font-weight:800}main{max-width:1100px;margin:auto;padding:0 24px}.view{display:none;animation:rise .25s ease}.view.active{display:block}@keyframes rise{from{opacity:.3;transform:translateY(5px)}}.hero{background:var(--ink);color:white;min-height:190px;border-radius:30px;padding:34px 40px;display:flex;justify-content:space-between;align-items:center;box-shadow:var(--shadow);background-image:radial-gradient(circle at 70% 0,rgba(131,173,115,.2),transparent 35%)}.hero .eyebrow{color:#9aae9f}.hero-number{display:flex;align-items:baseline;gap:9px}.hero-number strong{font:4.5rem/.9 Georgia,serif}.hero-number small{color:#b8c5bb}.ring{--progress:0deg;width:116px;height:116px;border-radius:50%;display:grid;place-items:center;background:conic-gradient(var(--orange) var(--progress),#36483e 0);position:relative}.ring:after{content:"";position:absolute;inset:9px;border-radius:50%;background:var(--ink)}.ring span{position:relative;z-index:1;font-weight:800}.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin:18px 0}.metric,.panel{background:var(--card);border:1px solid rgba(52,93,69,.08);box-shadow:var(--shadow)}.metric{padding:20px;border-radius:18px}.metric span{display:block;color:var(--muted);font-size:.78rem}.metric strong{font:2rem Georgia,serif;margin-right:4px}.metric small{color:var(--muted)}.panel{border-radius:22px;padding:24px;margin:18px 0}.panel h2,.panel h3,.section-title h2{font-family:Georgia,serif;margin:0}.panel-head,.section-title{display:flex;align-items:center;justify-content:space-between;gap:16px}.legend{color:var(--muted);font-size:.75rem}.legend i{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:5px}.green{background:var(--green)}.orange{background:var(--orange)}.chart{height:220px;margin-top:18px}.chart svg{width:100%;height:100%;overflow:visible}.chart .grid{stroke:#e8ebe5;stroke-width:1}.chart .label{fill:#89958e;font-size:10px}.chart .weight-line{fill:none;stroke:var(--green-dark);stroke-width:3;stroke-linecap:round;stroke-linejoin:round}.chart .weight-area{fill:url(#weightGradient)}.chart .bar{fill:var(--orange);opacity:.82}.chart .target{stroke:#90a097;stroke-dasharray:5 5}.recent-row,.meal-row,.food-row{display:grid;align-items:center;border-top:1px solid var(--line);padding:14px 0;gap:12px}.recent-row{grid-template-columns:1fr auto auto}.recent-row:first-child,.meal-row:first-child{border-top:0}.recent-row span,.meal-row small,.food-row small{color:var(--muted)}.recent-row strong{min-width:74px;text-align:right}.text-button{border:0;background:none;color:var(--green-dark);font-weight:800}.section-title{margin:12px 2px 18px}.section-title h2{font-size:2.3rem}.section-title input{border:1px solid var(--line);background:white;border-radius:12px;padding:10px;color:var(--ink)}.weight-entry{display:flex;justify-content:space-between;align-items:center}.inline-input{display:flex;align-items:center;border:1px solid var(--line);border-radius:14px;overflow:hidden}.inline-input input{border:0;width:90px;padding:13px;background:#fafbf8;text-align:right;outline:none}.inline-input span{color:var(--muted);padding:0 8px}.inline-input button{border:0;background:var(--green-dark);color:white;padding:14px 17px;font-weight:800}.meal-entry h3,.food-entry h3{font-size:1.55rem;margin-bottom:20px}label{display:block;color:var(--muted);font-size:.76rem;font-weight:700}input{width:100%;border:1px solid var(--line);border-radius:12px;padding:13px;margin-top:7px;background:#fafbf8;color:var(--ink);outline:none}input:focus{border-color:var(--green);box-shadow:0 0 0 3px rgba(131,173,115,.15)}.form-row{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:14px}.suffix{position:relative}.suffix span{position:absolute;right:14px;bottom:13px;color:var(--muted)}.preview{border:1px dashed #ccd4cc;border-radius:12px;padding:10px 14px;align-self:end;min-height:46px}.preview span{display:block;color:var(--muted);font-size:.66rem}.primary{width:100%;border:0;border-radius:13px;background:var(--ink);color:#fff;padding:14px 18px;font-weight:800;margin-top:18px}.primary:hover{background:var(--green-dark)}.daily-total .panel-head>span{color:var(--muted);font-size:.78rem}.meal-row{grid-template-columns:1fr auto auto}.meal-row strong{display:block}.meal-row .cal{text-align:right;font-weight:800}.delete{border:0;border-radius:50%;width:30px;height:30px;background:#f4eee8;color:#9b5c45}.empty{padding:35px 5px;text-align:center;color:var(--muted)}.form-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:14px 0}.count{background:#e5ece3;color:var(--green-dark);border-radius:99px;padding:7px 12px;font-size:.75rem;font-weight:800}.search-wrap{position:sticky;top:8px;z-index:2}.search-wrap input{box-shadow:var(--shadow);background:#fff}.food-list{background:white;border-radius:20px;padding:0 22px;margin:14px 0;box-shadow:var(--shadow)}.food-row{grid-template-columns:1.5fr repeat(4,.65fr) auto}.food-row>span{text-align:right}.food-row strong{display:block}.food-row small{display:block}.food-row button{opacity:0}.food-row:hover button{opacity:1}.bottom-nav{position:fixed;left:50%;transform:translateX(-50%);bottom:16px;z-index:5;width:min(520px,calc(100% - 28px));height:68px;background:rgba(22,37,29,.96);border-radius:22px;display:grid;grid-template-columns:repeat(3,1fr);padding:7px;box-shadow:0 15px 35px rgba(12,25,17,.25);backdrop-filter:blur(12px)}.bottom-nav button{border:0;background:none;color:#93a098;border-radius:16px}.bottom-nav b,.bottom-nav span{display:block}.bottom-nav b{font-size:1.25rem}.bottom-nav span{font-size:.68rem;margin-top:2px}.bottom-nav button.active{background:#2d4236;color:white}#toast{position:fixed;left:50%;bottom:98px;transform:translate(-50%,20px);background:#16251d;color:#fff;border-radius:99px;padding:11px 18px;opacity:0;pointer-events:none;transition:.2s;z-index:10;font-size:.82rem}#toast.show{opacity:1;transform:translate(-50%,0)}
.ocr-box{border:1px dashed #bdcbbf;background:#f6f8f3;border-radius:18px;padding:16px;margin:0 0 20px}.ocr-copy strong,.ocr-copy span{display:block}.ocr-copy span{color:var(--muted);font-size:.78rem;line-height:1.4;margin-top:4px}.ocr-upload{display:flex;align-items:center;justify-content:center;gap:8px;background:var(--green-dark);color:white;border-radius:12px;padding:12px;margin-top:14px;cursor:pointer}.ocr-upload input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.ocr-result{display:grid;grid-template-columns:64px 1fr;align-items:center;gap:12px;margin-top:14px}.ocr-result img{width:64px;height:64px;border-radius:10px;object-fit:cover}.ocr-result strong,.ocr-result span{display:block}.ocr-result span{color:var(--muted);font-size:.74rem;margin-top:3px}.ocr-box details{margin-top:12px;color:var(--muted);font-size:.75rem}.ocr-box pre{white-space:pre-wrap;max-height:170px;overflow:auto;background:white;border-radius:10px;padding:10px}.ocr-filled{border-color:var(--green)!important;background:#f2f8ef!important;box-shadow:0 0 0 3px rgba(131,173,115,.13)}.compact-grid{grid-template-columns:repeat(4,1fr)}
.auth-link{display:block;border:0;background:none;color:var(--green-dark);font-weight:800;margin:14px auto 0}.date-actions{display:flex;align-items:center;gap:8px}.soft-button{border:1px solid #cad4cb;border-radius:12px;background:#eef3ec;color:var(--green-dark);padding:10px 13px;font-weight:800}.soft-button.full{width:100%;margin-top:12px}.quick-foods{margin:0 0 16px}.quick-foods .quick-title{display:flex;justify-content:space-between;color:var(--muted);font-size:.7rem;font-weight:800;letter-spacing:.08em;margin:9px 0 7px}.chip-row{display:flex;gap:7px;overflow-x:auto;padding:2px 1px 6px;scrollbar-width:none}.food-chip{white-space:nowrap;border:1px solid #d8e0d7;background:#f7f9f5;color:var(--green-dark);border-radius:99px;padding:8px 11px;font-size:.75rem;font-weight:800}.food-chip.favorite{background:#e7efe3;border-color:#bed0b9}.meal-actions{display:flex;gap:5px}.edit{border:0;border-radius:50%;width:30px;height:30px;background:#eaf0e8;color:var(--green-dark)}.star-button{border:0;background:none;color:#b2bbb4;font-size:1.25rem;padding:4px}.star-button.on{color:#e89950}.settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.settings-grid .panel{margin:0}.settings-grid h3{font-size:1.45rem;margin-bottom:18px}.settings-grid label+label,.settings-grid form label+label{margin-top:13px}.settings-grid label{position:relative}.settings-grid label>small{position:absolute;right:12px;bottom:13px;color:var(--muted)}.muted{color:var(--muted);line-height:1.5;font-size:.82rem}.backup-state{background:#f3f6f1;border-radius:12px;padding:12px;color:var(--green-dark);font-size:.8rem;font-weight:800}.modal{position:fixed;inset:0;z-index:150;background:rgba(10,20,14,.72);display:grid;place-items:center;padding:18px}.modal[hidden]{display:none}.modal-card{width:min(440px,100%);background:#fff;border-radius:25px;padding:30px;text-align:center}.modal-card h2{font:2rem Georgia,serif;margin:6px 0 10px}.modal-card p{color:var(--muted);line-height:1.5}.modal-card>code{display:block;background:#eef3ec;color:var(--green-dark);border-radius:12px;padding:14px;font-size:1.2rem;font-weight:800;letter-spacing:.1em}.modal-card .text-button{margin-top:14px}.chart .trend-line{fill:none;stroke:var(--orange);stroke-width:3;stroke-dasharray:7 5;stroke-linecap:round}.bottom-nav{grid-template-columns:repeat(4,1fr);width:min(610px,calc(100% - 28px))}
@media(max-width:720px){body{padding-bottom:94px}.topbar{height:76px;padding:15px 16px}.top-actions>span{display:none}.top-actions .icon-button{padding:9px 10px;font-size:.68rem}main{padding:0 14px}.hero{min-height:165px;padding:26px 22px;border-radius:24px}.hero-number strong{font-size:3.4rem}.ring{width:88px;height:88px}.cards{grid-template-columns:1fr 1fr}.metric{padding:16px}.metric strong{font-size:1.65rem}.panel{padding:19px;border-radius:19px}.chart{height:190px}.section-title h2{font-size:1.95rem}.section-title{align-items:flex-start}.date-actions{display:grid;justify-items:end}.date-actions .soft-button{font-size:.68rem;padding:8px}.weight-entry{display:block}.inline-input{margin-top:16px}.inline-input input{flex:1;width:auto}.form-grid,.compact-grid{grid-template-columns:1fr 1fr}.food-row{grid-template-columns:1fr auto auto auto}.food-row .macro{display:none}.food-row button{opacity:1}.recent-row{grid-template-columns:1fr auto}.recent-row .weight{display:none}.settings-grid{grid-template-columns:1fr}.bottom-nav span{font-size:.6rem}}
@media(max-width:390px){.hero{padding:23px 18px}.hero-number strong{font-size:2.9rem}.ring{width:78px;height:78px}.cards{gap:9px}.metric{padding:14px}.metric strong{font-size:1.5rem}.form-row{grid-template-columns:1fr}.preview{margin-top:2px}}
@media(min-width:721px){.food-row{grid-template-columns:1.5fr repeat(4,.65fr) auto auto}}
.form-actions{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:end}.form-actions .soft-button{margin-top:18px;padding:14px 20px}
@media(max-width:390px){.form-actions{grid-template-columns:1fr}.form-actions .soft-button{margin-top:0}}
.barcode-box{border:1px solid #c9d8c8;background:#eef4eb;border-radius:18px;padding:16px;margin:0 0 14px}.barcode-row{display:grid;grid-template-columns:1fr auto auto;gap:8px;align-items:end;margin-top:12px}.barcode-row input{margin:0}.barcode-camera{display:flex;align-items:center;justify-content:center;cursor:pointer}.barcode-camera input{position:absolute;width:1px;height:1px;opacity:0}.barcode-status{margin-top:10px;padding:10px;border-radius:10px;background:white;color:var(--green-dark);font-size:.78rem;font-weight:800}.quantity-chips{display:flex;gap:7px;flex-wrap:wrap;margin-top:12px}.quantity-chips button{border:1px solid #d4ddd3;background:#f6f8f4;color:var(--green-dark);border-radius:99px;padding:8px 12px;font-weight:800}.food-search-tools{display:grid;grid-template-columns:1fr minmax(180px,.35fr);gap:10px}.food-search-tools select{border:1px solid var(--line);border-radius:12px;background:white;padding:0 12px;color:var(--ink);box-shadow:var(--shadow)}.food-actions{display:flex;gap:4px}.food-actions button{opacity:1}.duplicate{border:0;border-radius:50%;width:30px;height:30px;background:#eef0e8;color:#6b755c}
@media(max-width:720px){.barcode-row{grid-template-columns:1fr 1fr}.barcode-row input{grid-column:1/-1}.food-search-tools{grid-template-columns:1fr}.food-search-tools select{padding:12px}.food-row{grid-template-columns:1fr auto auto}.food-actions{grid-column:1/-1;justify-content:flex-end}}
@media(min-width:721px){.food-row{grid-template-columns:1.5fr repeat(4,.65fr) auto}}

/* Egységes telefonos nézet (az iPhone 15 Pro CSS-szélessége 393 px). */
@media(max-width:600px){
  html,body{max-width:100%;overflow-x:hidden}
  body{padding-bottom:86px}
  button,input,select{max-width:100%;min-width:0}
  .topbar{height:72px;padding:12px 10px;gap:8px}
  .topbar h1{font-size:1.55rem;white-space:nowrap}
  .top-actions{gap:4px;min-width:0}
  .top-actions .icon-button{padding:8px;font-size:.63rem}
  main{width:100%;padding:0 10px}
  .hero{min-height:148px;padding:22px 16px;border-radius:20px;gap:10px}
  .hero-number strong{font-size:2.75rem}
  .ring{width:74px;height:74px;flex:0 0 74px}
  .cards{grid-template-columns:1fr 1fr;gap:8px;margin:10px 0}
  .metric{padding:13px;min-width:0}
  .metric strong{font-size:1.38rem}
  .panel{padding:16px;border-radius:17px;margin:12px 0;min-width:0}
  .panel-head,.section-title{align-items:flex-start}
  .section-title{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;margin-bottom:12px}
  .section-title h2{font-size:1.75rem;overflow-wrap:anywhere}
  .date-actions{width:100%;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;justify-items:stretch}
  .date-actions input{width:100%;margin:0}
  .date-actions .soft-button{white-space:nowrap}
  .form-row,.form-grid,.compact-grid{grid-template-columns:minmax(0,1fr)}
  .form-row>*,.form-grid>*,.compact-grid>*{min-width:0}
  .form-actions{grid-template-columns:minmax(0,1fr)}
  .form-actions .soft-button{margin-top:0}
  .barcode-box,.ocr-box{padding:13px}
  .barcode-row{grid-template-columns:1fr 1fr}
  .barcode-row input{grid-column:1/-1}
  .barcode-row button,.barcode-camera{width:100%;padding-left:8px;padding-right:8px}
  .ocr-result{grid-template-columns:52px minmax(0,1fr)}
  .ocr-result img{width:52px;height:52px}
  .food-search-tools{grid-template-columns:minmax(0,1fr)}
  .food-row{grid-template-columns:minmax(0,1fr) auto;gap:7px}
  .food-row>span{text-align:right}
  .food-actions{grid-column:1/-1;justify-content:flex-end}
  .meal-row{grid-template-columns:minmax(0,1fr) auto;gap:8px}
  .meal-row .cal{align-self:start}
  .meal-actions{grid-column:2;justify-content:flex-end}
  .daily-total .panel-head{flex-direction:column;gap:5px}
  .recent-row{grid-template-columns:minmax(0,1fr) auto;gap:8px}
  .recent-row strong{min-width:0}
  .settings-grid{grid-template-columns:minmax(0,1fr);gap:12px}
  .quantity-chips button{flex:1 0 calc(33.333% - 7px)}
  .auth-card,.modal-card{padding:22px 18px;border-radius:20px}
  .bottom-nav{bottom:7px;width:calc(100% - 14px);height:64px;padding:6px;border-radius:19px}
  .bottom-nav b{font-size:1.05rem}
  .bottom-nav span{font-size:.55rem}
  #toast{max-width:calc(100% - 20px);text-align:center;white-space:normal}
}
@media(max-width:370px){
  .cards{grid-template-columns:minmax(0,1fr)}
  .top-actions .icon-button{padding:7px 6px}
  .hero-number strong{font-size:2.4rem}
}
