/* EATYFIT — sistema visual "báscula de cocina" */
:root {
  --paper: #F5F6F2;
  --surface: #FFFFFF;
  --surface-2: #EEF0EA;
  --ink: #1C2420;
  --ink-2: #4A544F;
  --ink-3: #7C857F;
  --line: #E3E6DF;
  --line-strong: #CDD2C8;
  --protein: #C2413B;
  --carb: #D39A2C;
  --fat: #6E8B3D;
  --veg: #3E8E6A;
  --fruit: #D0643B;
  --dairy: #6F86B5;
  --protein-soft: #F6E3E1;
  --carb-soft: #F7ECD6;
  --fat-soft: #E7EDDC;
  --primary: #1C2420;
  --on-primary: #F5F6F2;
  --good: #3E8E6A;
  --warn: #C27A1E;
  --bad: #C2413B;
  --focus: #2F6FDB;
  --shadow-sheet: 0 -12px 40px rgba(28, 36, 32, .18);
  --shadow-float: 0 6px 24px rgba(28, 36, 32, .12);
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;
  --font-display: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #131B17;
    --surface: #1A231F;
    --surface-2: #222D28;
    --ink: #E9EEE8;
    --ink-2: #B9C2BC;
    --ink-3: #87918B;
    --line: #2A3530;
    --line-strong: #3A4741;
    --protein: #E4675F;
    --carb: #E5B24A;
    --fat: #97B55F;
    --veg: #5DB38B;
    --fruit: #E98659;
    --dairy: #8FA4D1;
    --protein-soft: #3A2422;
    --carb-soft: #3A3120;
    --fat-soft: #29331F;
    --primary: #E9EEE8;
    --on-primary: #131B17;
    --shadow-sheet: 0 -12px 40px rgba(0, 0, 0, .5);
    --shadow-float: 0 6px 24px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #131B17;
  --surface: #1A231F;
  --surface-2: #222D28;
  --ink: #E9EEE8;
  --ink-2: #B9C2BC;
  --ink-3: #87918B;
  --line: #2A3530;
  --line-strong: #3A4741;
  --protein: #E4675F;
  --carb: #E5B24A;
  --fat: #97B55F;
  --veg: #5DB38B;
  --fruit: #E98659;
  --dairy: #8FA4D1;
  --protein-soft: #3A2422;
  --carb-soft: #3A3120;
  --fat-soft: #29331F;
  --primary: #E9EEE8;
  --on-primary: #131B17;
  --shadow-sheet: 0 -12px 40px rgba(0, 0, 0, .5);
  --shadow-float: 0 6px 24px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Shell ---------- */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.main {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: calc(12px + var(--safe-t)) 16px calc(var(--tab-h) + 32px + var(--safe-b));
}
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(18px);
  -webkit-backdrop-filter: saturate(1.4) blur(18px);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; background: none; color: var(--ink-3); text-decoration: none;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
}
.tab svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab[aria-current="page"] { color: var(--ink); }
.tab[aria-current="page"] svg { stroke-width: 2.3; }

@media (min-width: 960px) {
  .app { flex-direction: row; }
  .tabbar {
    position: sticky; top: 0; left: auto; right: auto; bottom: auto;
    height: 100dvh; width: 232px; flex: none;
    display: flex; flex-direction: column; gap: 2px; padding: 28px 14px;
    border-top: 0; border-right: 1px solid var(--line); background: var(--surface);
  }
  .tabbar::before {
    content: "EATYFIT"; letter-spacing: -.03em; font-family: var(--font-display); font-weight: 700; font-size: 22px;
    letter-spacing: -.02em; padding: 0 12px 22px;
  }
  .tab { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 12px; border-radius: 12px; font-size: 15px; }
  .tab[aria-current="page"] { background: var(--surface-2); }
  .main { padding: 36px 32px 64px; }
}

/* ---------- Tipografía ---------- */
h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: -.02em; line-height: 1.1; }
h1 { font-size: 30px; font-weight: 700; }
h2 { font-size: 21px; font-weight: 650; }
h3 { font-size: 17px; font-weight: 650; }
p { margin: 0; }
.muted { color: var(--ink-3); }
.small { font-size: 13.5px; }
.tiny { font-size: 12px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 8px 0 18px; }
.page-head .sub { color: var(--ink-3); font-size: 14.5px; margin-top: 4px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 15px; white-space: nowrap; text-decoration: none;
  transition: transform .08s ease, background .15s ease;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.danger { color: var(--bad); }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn svg, .icon-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center; flex: none;
  border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.icon-btn.on { color: var(--carb); }
.icon-btn.on.ban { color: var(--bad); }
.icon-btn.on svg { fill: currentColor; }
.icon-btn.on.ban svg { fill: none; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Formularios ---------- */
.field { display: grid; gap: 6px; }
.field > span { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12.5px; color: var(--ink-3); font-weight: 400; }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 16px; font-variant-numeric: tabular-nums;
}
.input:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }
.input::placeholder { color: var(--ink-3); opacity: .55; font-weight: 400; }
.input-unit { position: relative; }
.input-unit .input { padding-right: 52px; }
.input-unit em { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--ink-3); font-size: 14px; pointer-events: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stack { display: grid; gap: 14px; }
.stack-lg { display: grid; gap: 28px; }

.seg { display: flex; padding: 3px; gap: 3px; border-radius: 999px; background: var(--surface-2); overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1; min-height: 38px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; font-weight: 600; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; }
.switch input { appearance: none; width: 50px; height: 30px; border-radius: 999px; background: var(--line-strong); position: relative; flex: none; transition: background .2s; cursor: pointer; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.switch input:checked { background: var(--good); }
.switch input:checked::after { transform: translateX(20px); }
.switch .lbl { display: grid; gap: 2px; }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 14px; font-weight: 600; color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- Secciones ---------- */
.section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.section + .section { margin-top: 14px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }
.note { padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); color: var(--ink-2); font-size: 14px; }
.note.warn { background: var(--carb-soft); }
.note.bad { background: var(--protein-soft); }
.note.good { background: var(--fat-soft); }

/* ---------- Tira de días ---------- */
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 18px; }
.day {
  position: relative; display: grid; justify-items: center; gap: 2px; padding: 8px 0 10px;
  border-radius: 14px; border: 1px solid transparent; background: transparent; color: var(--ink-2);
}
.day b { font-family: var(--font-display); font-size: 19px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.day small { font-size: 11.5px; font-weight: 600; }
.day .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); margin-top: 3px; }
.day.plan .dot { background: var(--fat); }
.day.train .dot { background: var(--protein); box-shadow: 8px 0 0 var(--fat); transform: translateX(-4px); }
.day.today small { color: var(--protein); }
.day[aria-pressed="true"] { background: var(--surface); border-color: var(--line-strong); box-shadow: var(--shadow-float); }

.week-nav { display: flex; align-items: center; gap: 6px; }

/* ---------- Cabecera del día: báscula ---------- */
.scale { padding: 20px 18px 18px; }
.scale-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.kcal-big { font-family: var(--font-display); font-weight: 700; font-size: 52px; line-height: .95; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.kcal-big small { font-family: var(--font-body); font-size: 16px; font-weight: 600; letter-spacing: 0; color: var(--ink-3); margin-left: 6px; }
.kcal-meta { font-size: 14px; color: var(--ink-3); margin-top: 6px; }
.delta { font-weight: 700; }
.delta.ok { color: var(--good); }
.delta.off { color: var(--warn); }

.mbar { margin-top: 18px; }
.mbar-track { position: relative; display: flex; height: 16px; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.mbar-track i { display: block; height: 100%; }
.mbar-track i.p { background: var(--protein); }
.mbar-track i.c { background: var(--carb); }
.mbar-track i.f { background: var(--fat); }
.mbar-ticks { position: relative; height: 10px; }
.mbar-ticks span { position: absolute; top: 2px; width: 2px; height: 8px; background: var(--ink); border-radius: 1px; transform: translateX(-1px); }
.macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.macro { display: grid; gap: 2px; }
.macro .k { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.macro .k::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--c); }
.macro .v { font-family: var(--font-display); font-size: 22px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.macro .v small { font-family: var(--font-body); font-size: 13px; color: var(--ink-3); font-weight: 500; letter-spacing: 0; }
.macro.plain .k::before { display: none; }
.macro.p { --c: var(--protein); }
.macro.c { --c: var(--carb); }
.macro.f { --c: var(--fat); }

/* ---------- Comidas ---------- */
.meal { margin-top: 26px; }
.meal-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 4px 8px; }
.meal-head h3 { font-size: 19px; }
.meal-head .num { color: var(--ink-3); font-size: 14px; font-weight: 600; }
.items { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.item {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px;
  width: 100%; padding: 12px 14px; border: 0; background: transparent; text-align: left;
}
.item + .item { border-top: 1px solid var(--line); }
.item:active { background: var(--surface-2); }
.thumb {
  width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); overflow: hidden;
  display: grid; place-items: center; position: relative;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .role { width: 14px; height: 14px; border-radius: 5px; background: var(--rc, var(--ink-3)); }
.thumb::after { content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 3px; background: var(--rc, transparent); }
.r-protein { --rc: var(--protein); }
.r-carb { --rc: var(--carb); }
.r-fat { --rc: var(--fat); }
.r-veg { --rc: var(--veg); }
.r-fruit { --rc: var(--fruit); }
.r-dairy { --rc: var(--dairy); }
.r-supp { --rc: var(--ink-2); }
.item-name { font-weight: 600; font-size: 15.5px; line-height: 1.25; }
.item-sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; }
.item-qty { text-align: right; }
.item-qty b { display: block; font-family: var(--font-display); font-size: 18px; font-weight: 650; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.item-qty span { font-size: 12.5px; color: var(--ink-3); }
.lock { display: inline-flex; align-items: center; gap: 3px; color: var(--ink-2); font-weight: 600; }
.lock svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.2; }
.add-row { display: flex; justify-content: center; padding: 6px; border-top: 1px solid var(--line); }

.free-day { text-align: center; padding: 40px 20px; }
.free-day h2 { margin-bottom: 8px; }

/* ---------- Listas genéricas ---------- */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.list-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; width: 100%; border: 0; background: transparent; text-align: left; }
.list-row + .list-row { border-top: 1px solid var(--line); }
.list-row > svg, .input-unit em svg { width: 22px; height: 22px; stroke: var(--ink-2); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.list-row > span { display: grid; }
.list-row .t { display: block; font-weight: 600; line-height: 1.25; }
.list-row .s { display: block; font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.list-empty { padding: 36px 20px; text-align: center; color: var(--ink-3); }
.group-title { font-family: var(--font-display); font-weight: 650; font-size: 16px; margin: 22px 4px 8px; color: var(--ink-2); }

.mini-macros { display: flex; gap: 10px; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.mini-macros b { font-weight: 700; }
.mini-macros .p b { color: var(--protein); }
.mini-macros .c b { color: var(--carb); }
.mini-macros .f b { color: var(--fat); }
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--surface-2); color: var(--ink-2); }
.badge.warn { background: var(--carb-soft); color: var(--warn); }
.badge.bad { background: var(--protein-soft); color: var(--bad); }
.badge.good { background: var(--fat-soft); color: var(--good); }

/* ---------- Compra ---------- */
.shop-total { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.shop-total .kcal-big { font-size: 44px; }
.check { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; width: 100%; border: 0; background: transparent; text-align: left; }
.check + .check { border-top: 1px solid var(--line); }
.check .box { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--line-strong); display: grid; place-items: center; }
.check .box svg { width: 14px; height: 14px; stroke: var(--on-primary); stroke-width: 3; fill: none; opacity: 0; }
.check.done .box { background: var(--good); border-color: var(--good); }
.check.done .box svg { opacity: 1; stroke: #fff; }
.check.done .t { text-decoration: line-through; color: var(--ink-3); }
.check .t { display: block; font-weight: 600; line-height: 1.25; }
.check .s { display: block; font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.check .price { font-family: var(--font-display); font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.check .price small { display: block; font-family: var(--font-body); font-size: 12px; color: var(--ink-3); font-weight: 500; }

/* ---------- Hoja inferior (modal) ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(15, 20, 18, .42); animation: fade .18s ease; }
.sheet {
  position: fixed; z-index: 51; left: 0; right: 0; bottom: 0;
  max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--shadow-sheet);
  padding: 10px 18px calc(24px + var(--safe-b));
  animation: rise .26s cubic-bezier(.2, .9, .3, 1);
}
.sheet::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 0 auto 14px; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
@media (min-width: 700px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: min(560px, 92vw); transform: translate(-50%, -50%); border-radius: var(--r-lg); max-height: 86dvh; animation: pop .2s ease; }
  .sheet::before { display: none; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40px); opacity: .4; } }
@keyframes pop { from { transform: translate(-50%, -46%); opacity: 0; } }

.stepper { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; gap: 10px; }
.stepper .icon-btn { width: 56px; height: 56px; }
.stepper .input { text-align: center; font-family: var(--font-display); font-size: 28px; font-weight: 650; min-height: 56px; }

.photos { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
.photos a { flex: none; width: 70%; max-width: 280px; scroll-snap-align: start; border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.photos img { aspect-ratio: 1; object-fit: contain; width: 100%; background: #fff; }

.alt-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 10px 4px; width: 100%; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; }
.alt-row:first-child { border-top: 0; }

/* ---------- Perfil: desglose del gasto ---------- */
.flow { display: grid; gap: 0; }
.flow-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 9px 0; border-top: 1px dashed var(--line); font-size: 14.5px; }
.flow-row:first-child { border-top: 0; }
.flow-row .num { font-weight: 600; }
.flow-row.total { border-top: 1px solid var(--ink); font-weight: 700; font-size: 16px; }
.flow-row.goal { font-family: var(--font-display); font-size: 22px; font-weight: 700; border-top: 0; padding-top: 4px; }
.flow-row small { display: block; color: var(--ink-3); font-size: 12.5px; font-weight: 400; }

.week-grid { display: grid; gap: 0; }
.wd { display: grid; grid-template-columns: 92px 1fr; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.wd:first-child { border-top: 0; }
.wd-name { font-weight: 700; padding-top: 8px; }
.wd-body { display: grid; gap: 8px; }
.act { display: grid; grid-template-columns: 1fr 96px 36px; gap: 8px; align-items: center; }
.act .input { min-height: 40px; padding: 6px 10px; font-size: 15px; }
.act .icon-btn { width: 36px; height: 36px; }

/* ---------- Gráfico de progreso ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--ink-3); font-size: 11px; font-family: var(--font-body); }
.chart .raw { fill: var(--ink-3); }
.chart .trend { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .waist { fill: none; stroke: var(--carb); stroke-width: 2; stroke-dasharray: 4 4; }
.chart .goal { stroke: var(--fat); stroke-width: 1.5; stroke-dasharray: 2 5; fill: none; }

/* ---------- Autenticación ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; }
.brand { font-family: var(--font-display); font-weight: 700; font-size: 40px; letter-spacing: -.04em; line-height: 1; }
.brand-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; margin: 18px 0 14px; width: 180px; }
.brand-bar i { display: block; height: 100%; }
.auth-lead { color: var(--ink-2); font-size: 17px; margin-bottom: 28px; max-width: 34ch; }

/* ---------- Toast y carga ---------- */
.toast {
  position: fixed; z-index: 70; left: 50%; bottom: calc(var(--tab-h) + 16px + var(--safe-b));
  transform: translateX(-50%); max-width: calc(100vw - 32px);
  background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 14px;
  font-weight: 600; font-size: 14.5px; box-shadow: var(--shadow-float); animation: rise .2s ease;
}
.toast.err { background: var(--bad); color: #fff; }
@media (min-width: 960px) { .toast { bottom: 24px; } }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 0%, var(--line) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--r-md); }
@keyframes shimmer { to { background-position: -200% 0; } }
.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--good); transition: width .3s; }
.offline-pill { position: fixed; top: calc(8px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 60; background: var(--carb); color: #1C2420; font-size: 12.5px; font-weight: 700; padding: 4px 12px; border-radius: 999px; }

@media (max-width: 380px) {
  .kcal-big { font-size: 44px; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .wd { grid-template-columns: 1fr; }
  .wd-name { padding-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.icon-btn.sm { width: 38px; height: 38px; }
.icon-btn.sm svg { width: 18px; height: 18px; }
