/* ==========================================================================
   FatoForma Alimentação — "Meu Dia" v0.1 (alimentacao.html). Logic: assets/js/nutrition.js + nutrition-targets.js.
   Same system as "Meu treino": white rounded cards on the mint paper, navy ink, Saúde teal for progress, Exercício coral
   only for "above the target". Reuses the account UI pieces (.loc-type option cards, .acct-secondary, .acct-alert).
   ========================================================================== */
.nt-section{padding-top:0}
.nt-section [data-nutrition-root]{min-width:0}
.nt-layout{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);gap:18px;align-items:start}
.nt-col{display:flex;flex-direction:column;gap:18px;min-width:0}
.nt-card{padding:20px 22px;border-radius:var(--radius-md);background:var(--card-bg);box-shadow:var(--card-shadow);min-width:0}
.nt-empty{display:flex;flex-direction:column;gap:12px;max-width:720px}
.nt-state{margin:0;max-width:60ch;color:var(--text);line-height:1.55}
.nt-eyebrow{margin:0;font:700 .72rem/1.2 var(--sans);letter-spacing:.12em;text-transform:uppercase;color:var(--health-dark)}
.nt-h{margin:0;font:700 1.15rem/1.25 var(--serif);color:var(--ink)}
.nt-h:focus,[data-nt-summary]:focus,.nt-ok:focus{outline:none}
.nt-hint{margin:0;font-size:.86rem;line-height:1.45;color:var(--muted)}
.nt-row{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.nt-btn{justify-content:center;min-height:48px;cursor:pointer}
.nt-btn-sm{min-height:44px;padding:0 16px}
.nt-link{min-height:40px;padding:0 2px;border:0;background:transparent;font:700 .9rem/1 var(--sans);color:var(--health-dark);text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.nt-link:focus-visible,.nt-icon:focus-visible,.nt-chip:focus-visible,.nt-res-btn:focus-visible,.nt-fav:focus-visible,.nt-qchip:focus-visible,.nt-x:focus-visible,.nt-back:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
.nt-ok{margin:0;padding:9px 12px;border-radius:var(--radius-sm);background:var(--health-soft);color:var(--health-dark);font-weight:700;font-size:.9rem}

/* Summary */
.nt-summary{display:flex;flex-direction:column;gap:16px;border-top:4px solid var(--health-primary)}
.nt-sum-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}
.nt-date{margin:2px 0 0;font:700 1.05rem/1.25 var(--serif);color:var(--ink)}
.nt-date::first-letter{text-transform:uppercase}
.nt-sum-body{display:grid;grid-template-columns:auto minmax(0,1fr);gap:22px;align-items:center}
.nt-cal{position:relative;width:148px;height:148px;flex:none}
.nt-ring{width:100%;height:100%;display:block}
.nt-ring circle{fill:none;stroke-width:11}
.nt-ring-track{stroke:var(--health-soft)}
.nt-ring-fill{stroke:var(--health-primary);stroke-linecap:round;transition:stroke-dasharray .5s ease}
.nt-ring.is-over .nt-ring-fill{stroke:var(--exercise-primary)}
.nt-cal-txt{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;line-height:1.1}
.nt-cal-l{font-size:.7rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.nt-cal-txt strong{font:800 1.7rem/1.1 var(--serif);color:var(--ink);font-variant-numeric:tabular-nums}
.nt-cal-t{font-size:.8rem;color:var(--muted);font-variant-numeric:tabular-nums}
.nt-macros{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:12px;min-width:0}
.nt-macro-h{display:flex;justify-content:space-between;align-items:baseline;gap:8px;margin-bottom:5px}
.nt-macro-h>span{font-weight:700;color:var(--ink);font-size:.92rem}
.nt-macro-h strong{font-size:1rem;color:var(--ink);font-variant-numeric:tabular-nums;white-space:nowrap}
.nt-macro-h strong span{font-weight:500;color:var(--muted);font-size:.86rem}
.nt-bar{display:block;height:9px;border-radius:5px;background:var(--health-soft);overflow:hidden}
.nt-bar>span{display:block;height:100%;border-radius:5px;background:var(--health-primary);transition:width .5s ease}
.nt-macro-c .nt-bar>span{background:var(--brand-mint)}
.nt-macro-f .nt-bar>span{background:var(--brand-navy)}
.nt-macro.is-over .nt-bar>span{background:var(--exercise-primary)}
.nt-left{padding:12px 14px;border-radius:var(--radius-sm);background:var(--grad-soft);border:1px solid var(--line)}
.nt-left-h{margin:0 0 6px;font:700 .72rem/1.2 var(--sans);letter-spacing:.1em;text-transform:uppercase;color:var(--health-dark)}
.nt-left ul{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:4px 16px;font-size:.92rem;color:var(--text)}
.nt-left strong{color:var(--ink);font-variant-numeric:tabular-nums}
.nt-left li.is-over,.nt-left li.is-over strong{color:var(--exercise-dark)}
.nt-add{width:100%;font-size:1rem}
.nt-add span{font-size:1.3rem;line-height:1;margin-right:4px}
.nt-why{font-size:.9rem}
.nt-why summary{display:inline-flex;align-items:center;min-height:44px;cursor:pointer;font-weight:700;color:var(--health-dark)}
.nt-why summary:focus-visible{outline:2px solid var(--focus);outline-offset:2px;border-radius:6px}
.nt-why ul{margin:4px 0 8px;padding-left:1.2em;line-height:1.55;color:var(--text)}
.nt-why p{margin:0 0 8px;line-height:1.55;color:var(--text)}

/* Target setup */
.nt-setup{display:flex;flex-direction:column;gap:14px}
.nt-profile{margin:0;font-size:.9rem;color:var(--text)}
.nt-opt .loc-type-card{min-height:52px;padding:8px 10px;line-height:1.2;flex-direction:column;gap:3px}
.nt-opt-sub{font-size:.76rem;font-weight:500;color:var(--muted)}
.nt-opt input:checked+.loc-type-card{border-color:var(--health-primary);box-shadow:inset 0 0 0 1px var(--health-primary);background:var(--health-soft);color:var(--health-dark)}
.nt-grid-act{grid-template-columns:repeat(auto-fill,minmax(170px,1fr))}
.nt-grid-goal{grid-template-columns:repeat(auto-fill,minmax(120px,1fr))}
.nt-grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.nt-calc{align-self:flex-start}
.nt-est{margin:0;padding:12px 14px;border-radius:var(--radius-sm);background:var(--health-soft);color:var(--ink);font-size:.88rem;line-height:1.5}
.nt-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.nt-field{display:flex;flex-direction:column;gap:6px;min-width:0}
.nt-field>span:first-child{font-size:.82rem;font-weight:700;color:var(--ink)}
.nt-input{display:flex;align-items:center;border:1px solid var(--line-strong);border-radius:var(--radius-sm);background:var(--input-bg);overflow:hidden}
.nt-input:focus-within{outline:2px solid var(--focus);outline-offset:1px}
.nt-input input{flex:1;min-width:0;height:48px;border:0;background:transparent;padding:0 10px;font:700 1.05rem/1 var(--sans);color:var(--ink);outline:none}
.nt-input em{padding-right:10px;font-style:normal;font-size:.85rem;color:var(--muted)}

/* Favourites */
.nt-favs{display:flex;flex-direction:column;gap:10px}
.nt-chips{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:8px}
.nt-chip{min-height:44px;padding:0 14px;border:1px solid var(--line-strong);border-radius:var(--radius-pill);background:var(--paper);font:600 .9rem/1.2 var(--sans);color:var(--ink);cursor:pointer;text-align:left}
.nt-chip span{color:var(--health-primary)}
.nt-chip:hover{background:var(--health-soft)}

/* Meals */
.nt-meals{display:flex;flex-direction:column;gap:14px}
.nt-meals-top{display:flex;justify-content:space-between;align-items:center;gap:10px}
.nt-add-sm{min-height:44px}
.nt-none{color:var(--muted)}
.nt-meal{border-top:1px solid var(--line);padding-top:12px}
.nt-meal-h{display:flex;justify-content:space-between;align-items:baseline;gap:8px;margin-bottom:6px}
.nt-meal-h h3{margin:0;font:700 .76rem/1.2 var(--sans);letter-spacing:.1em;text-transform:uppercase;color:var(--health-dark)}
.nt-meal-h span{font-size:.85rem;font-weight:700;color:var(--muted);font-variant-numeric:tabular-nums}
.nt-entries{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.nt-entry{display:flex;align-items:center;gap:8px;padding:8px 0;border-bottom:1px solid var(--line);min-width:0}
.nt-entry:last-child{border-bottom:0}
.nt-entry-main{flex:1;min-width:0}
.nt-entry-name{margin:0;font-weight:700;color:var(--ink);overflow-wrap:anywhere}
.nt-entry-name span{font-weight:500;color:var(--muted);white-space:nowrap}
.nt-entry-vals{margin:2px 0 0;font-size:.84rem;color:var(--muted);font-variant-numeric:tabular-nums}
.nt-entry-vals strong{color:var(--text)}
.nt-entry-act{display:flex;gap:2px;flex:none}
.nt-icon{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border:0;border-radius:50%;background:transparent;color:var(--muted);cursor:pointer}
.nt-icon:hover{background:var(--hover);color:var(--ink)}
.nt-entry.is-editing,.nt-entry.is-confirm{flex-direction:column;align-items:stretch;gap:8px;padding:10px 12px;margin:4px 0;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--paper)}
.nt-entry.is-confirm p{margin:0;color:var(--ink)}
.nt-edit{display:flex;flex-direction:column;gap:8px}
.nt-danger{border:0;border-radius:var(--radius-pill);background:#B3392D;color:#fff;font:700 .92rem/1 var(--sans);cursor:pointer}

/* Add-food dialog: centred on desktop, bottom sheet on phones */
html.nt-dlg-open{overflow:hidden}
.nt-dialog{width:min(560px,calc(100% - 32px));max-height:min(88vh,760px);padding:0;border:0;border-radius:var(--radius-lg);background:var(--card-bg);color:var(--text);box-shadow:var(--shadow-lift);overflow:hidden}
.nt-dialog::backdrop{background:#17324766}
.nt-dlg{display:flex;flex-direction:column;gap:12px;max-height:inherit;padding:18px 20px 20px;overflow-y:auto;overscroll-behavior:contain}
.nt-dlg-top{display:flex;justify-content:space-between;align-items:center;gap:10px}
.nt-x{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border:0;border-radius:50%;background:var(--soft);color:var(--ink);cursor:pointer;flex:none}
.nt-back{min-height:44px;padding:0 6px;border:0;background:transparent;font:700 .95rem/1 var(--sans);color:var(--health-dark);cursor:pointer}
.nt-search{display:flex;align-items:center;gap:8px;padding:0 12px;border:1px solid var(--line-strong);border-radius:var(--radius-pill);background:var(--input-bg);color:var(--muted)}
.nt-search:focus-within{outline:2px solid var(--focus);outline-offset:1px}
.nt-search input{flex:1;min-width:0;height:50px;border:0;background:transparent;font:500 1rem/1 var(--sans);color:var(--ink);outline:none}
.nt-results{display:flex;flex-direction:column;gap:8px;min-height:120px}
.nt-sub{margin:4px 0 0;font:700 .72rem/1.2 var(--sans);letter-spacing:.1em;text-transform:uppercase;color:var(--muted)}
.nt-reslist{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.nt-res{display:flex;align-items:center;gap:4px;border-bottom:1px solid var(--line)}
.nt-res-btn{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;min-height:56px;padding:8px 6px;border:0;background:transparent;text-align:left;font:inherit;color:inherit;cursor:pointer;border-radius:var(--radius-sm)}
.nt-res-btn:hover{background:var(--health-soft)}
.nt-res-name{font-weight:700;color:var(--ink);overflow-wrap:anywhere}
.nt-res-meta{font-size:.82rem;color:var(--muted)}
.nt-per100{opacity:.8}
.nt-fav{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;flex:none;border:0;border-radius:50%;background:transparent;color:var(--muted);cursor:pointer}
.nt-fav.is-on{color:#C9861A}
.nt-fav:hover{background:var(--hover)}
.nt-food-h{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}
.nt-cat{margin:2px 0 0;font-size:.86rem;color:var(--muted)}
.nt-per{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
.nt-per li{display:flex;flex-direction:column;gap:2px;padding:8px;border-radius:var(--radius-sm);background:var(--health-soft);min-width:0}
.nt-per span{font-size:.66rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--health-dark);overflow-wrap:anywhere}
.nt-per strong{font-size:.92rem;color:var(--ink);font-variant-numeric:tabular-nums}
.nt-src{font-size:.82rem;color:var(--muted)}
.nt-src summary{display:inline-flex;min-height:36px;align-items:center;cursor:pointer;font-weight:600}
.nt-src p{margin:0;overflow-wrap:anywhere}
.nt-src a{color:var(--health-dark);font-weight:700}
.nt-addform{display:flex;flex-direction:column;gap:12px}
.nt-qty{max-width:220px}
.nt-qchips{display:flex;flex-wrap:wrap;gap:6px}
.nt-qchip{min-height:40px;padding:0 14px;border:1px solid var(--line-strong);border-radius:var(--radius-pill);background:var(--paper);font:600 .88rem/1 var(--sans);color:var(--ink);cursor:pointer}
.nt-calc-out{margin:0;padding:10px 12px;border-radius:var(--radius-sm);background:var(--grad-soft);border:1px solid var(--line);font-size:.9rem;line-height:1.5;color:var(--text);font-variant-numeric:tabular-nums}
.nt-calc-out strong{color:var(--ink);font-size:1.02rem}
.nt-mealpick{margin:0;padding:0;border:0;min-width:0}
.nt-mealpick legend{padding:0;margin-bottom:6px;font-size:.82rem;font-weight:700;color:var(--ink)}
.nt-mealgrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.nt-mealgrid .loc-type-card{min-height:46px;font-size:.86rem}
.nt-submit{width:100%}

@media(max-width:980px){.nt-layout{grid-template-columns:minmax(0,1fr)}}
@media(max-width:760px){
.nt-card{padding:16px}
.nt-sum-body{grid-template-columns:minmax(0,1fr);justify-items:center;gap:16px}
.nt-macros{width:100%}
.nt-fields{grid-template-columns:repeat(2,minmax(0,1fr))}
.nt-grid-act{grid-template-columns:minmax(0,1fr)}
.nt-grid-goal{grid-template-columns:repeat(2,minmax(0,1fr))}
.nt-per{grid-template-columns:repeat(3,minmax(0,1fr))}
.nt-dialog{width:100%;max-width:none;max-height:92vh;margin:auto 0 0;border-radius:22px 22px 0 0}
.nt-dlg{padding:14px 16px calc(18px + env(safe-area-inset-bottom))}
.nt-row>.button,.nt-row>.acct-secondary{flex:1 1 140px}
.nt-meals-top .nt-add-sm{flex:none}
}
@media(max-width:380px){.nt-mealgrid{grid-template-columns:repeat(2,minmax(0,1fr))}.nt-cal{width:136px;height:136px}.nt-cal-txt strong{font-size:1.5rem}}
@media(prefers-reduced-motion:reduce){.nt-ring-fill,.nt-bar>span{transition:none}}
.nt-add-sm,.nt-calc{width:auto;flex-basis:auto}

/* v0.54 — Substituir + Complete meu dia (same dialog: centred on desktop, bottom sheet on phones) */
.nt-actions{display:flex;flex-wrap:wrap;gap:10px}
.nt-actions .nt-add{flex:1 1 220px;width:auto}
.nt-actions .nt-complete{flex:1 1 180px;width:auto;min-height:48px;border-color:var(--health-primary);color:var(--health-dark);font-weight:700}
.nt-left li.is-done,.nt-left li.is-done strong{color:var(--health-dark)}
.nt-swaplink{align-self:flex-start;display:inline-flex;align-items:center;gap:6px;text-decoration:none}
.nt-swap-src{margin:0;font-size:.9rem;color:var(--text);font-variant-numeric:tabular-nums}
.nt-modes{margin:0;padding:0;border:0;min-width:0}
.nt-modes legend{padding:0;margin-bottom:6px;font-size:.82rem;font-weight:700;color:var(--ink)}
.nt-modegrid{display:flex;flex-wrap:wrap;gap:6px}
.nt-mode{position:relative}
.nt-mode input{position:absolute;inset:0;opacity:0;margin:0;cursor:pointer}
.nt-mode span{display:inline-flex;align-items:center;min-height:40px;padding:0 14px;border:1px solid var(--line-strong);border-radius:var(--radius-pill);background:var(--paper);font:600 .86rem/1 var(--sans);color:var(--ink)}
.nt-mode input:checked+span{background:var(--health-block);border-color:var(--health-block);color:#fff}
.nt-mode input:focus-visible+span{outline:2px solid var(--focus);outline-offset:2px}
.nt-swaplist{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.nt-swap,.nt-copt{display:flex;flex-direction:column;gap:8px;padding:14px;border:1px solid var(--line);border-radius:var(--radius-md);background:var(--paper);min-width:0}
.nt-swap-h{display:flex;gap:10px;align-items:flex-start}
.nt-rank{flex:none;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;background:var(--health-block);color:#fff;font:700 .85rem/1 var(--serif)}
.nt-swap-t{min-width:0}
.nt-swap-name{margin:0;font-weight:700;color:var(--ink);overflow-wrap:anywhere}
.nt-star{color:#C9861A}
.nt-swap-q{margin:2px 0 0;font-size:.86rem;color:var(--muted)}
.nt-swap-q strong{color:var(--ink);font-size:.95rem}
.nt-eq{margin:0;padding:8px 10px;border-radius:var(--radius-sm);background:var(--health-soft);color:var(--health-dark);font-size:.88rem;font-weight:600;overflow-wrap:anywhere}
.nt-vals{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:4px 12px;font-size:.86rem;color:var(--muted);font-variant-numeric:tabular-nums}
.nt-vals strong{color:var(--ink)}
.nt-diff{margin:0;display:flex;flex-wrap:wrap;gap:2px 10px;font-size:.84rem;color:var(--text);font-variant-numeric:tabular-nums}
.nt-diff>span:first-child{flex-basis:100%;font-size:.72rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.nt-whybox{font-size:.86rem}
.nt-whybox summary{display:inline-flex;align-items:center;min-height:36px;cursor:pointer;font-weight:700;color:var(--health-dark)}
.nt-whybox summary:focus-visible{outline:2px solid var(--focus);outline-offset:2px;border-radius:6px}
.nt-whybox p{margin:0;line-height:1.5;color:var(--text)}
.nt-use{width:100%}
.nt-cmsg{margin:0;padding:10px 12px;border-radius:var(--radius-sm);background:var(--exercise-blue-soft);color:var(--ink);font-size:.9rem;line-height:1.5}
.nt-cmsg.is-final{background:var(--health-soft);color:var(--health-dark);font-weight:600}
.nt-copt-h{margin:0;font:700 .74rem/1.2 var(--sans);letter-spacing:.12em;text-transform:uppercase;color:var(--health-dark)}
.nt-copt-h:focus{outline:none}
.nt-copt-items{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.nt-copt-items li{display:flex;justify-content:space-between;align-items:baseline;gap:10px;padding:6px 0;border-bottom:1px solid var(--line);min-width:0}
.nt-copt-items li:last-child{border-bottom:0}
.nt-copt-items span{font-weight:700;color:var(--ink);overflow-wrap:anywhere;min-width:0}
.nt-copt-items strong{flex:none;color:var(--ink);font-variant-numeric:tabular-nums}
.nt-copt-items em{font-style:normal;font-weight:500;color:var(--muted);font-size:.84rem}
.nt-copt-tot{margin:0;font-size:.88rem;color:var(--text);font-variant-numeric:tabular-nums}
.nt-copt-q{margin:0;font-size:.88rem;font-weight:600;color:var(--health-dark)}
.nt-copt-act{display:flex;flex-wrap:wrap;gap:8px}
.nt-copt-act>*{flex:1 1 160px;width:auto}
@media(max-width:760px){.nt-copt-act>*{flex-basis:100%}.nt-actions>*{flex-basis:100%}}
