/* MUTA 2 - design tokens
   Raio: cartões 22px, campos 14px, botões, chips e abas em pílula. Um acento (mutagen) para ação e progresso;
   cores de dados só em gráficos (proteína, carboidrato, gordura, água). */
:root {
  --bg: #0b0c0e;
  --bg-2: #111316;
  --surface: #15171b;
  --surface-2: #1c1f24;
  --surface-3: #252930;
  --line: rgb(255 255 255 / .07);
  --line-2: rgb(255 255 255 / .12);
  --ink: #f0f1ec;
  --ink-2: #a9aca5;
  --ink-3: #6f736c;
  --acc: #d4f23a;
  --acc-ink: #131607;
  --acc-text: #d4f23a;
  --acc-soft: rgb(212 242 58 / .12);
  --acc-glow: rgb(212 242 58 / .18);
  --danger: #ff6a4d;
  --d-p: #d4f23a;
  --d-c: #9db8ff;
  --d-f: #ffb46b;
  --d-w: #6fd3f5;
  --r-card: 22px;
  --r-field: 14px;
  --shadow: 0 24px 48px -24px rgb(0 0 0 / .7);
  --f-display: "Unbounded", "Geist", system-ui, sans-serif;
  --f-body: "Geist", system-ui, -apple-system, sans-serif;
  --f-mono: "Geist Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #eef0eb; --bg-2: #e6e9e3; --surface: #f9faf7; --surface-2: #ffffff; --surface-3: #eceee8;
    --line: rgb(20 24 10 / .08); --line-2: rgb(20 24 10 / .14);
    --ink: #121410; --ink-2: #545850; --ink-3: #80847c; --acc-text: #4c6200; --acc-soft: rgb(120 150 0 / .12); --acc-glow: rgb(160 200 0 / .22);
    --d-p: #7d9c00; --d-c: #4a6fd8; --d-f: #d9822b; --d-w: #1f9fcc;
    --shadow: 0 24px 48px -26px rgb(40 50 20 / .35); color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #eef0eb; --bg-2: #e6e9e3; --surface: #f9faf7; --surface-2: #ffffff; --surface-3: #eceee8;
  --line: rgb(20 24 10 / .08); --line-2: rgb(20 24 10 / .14);
  --ink: #121410; --ink-2: #545850; --ink-3: #80847c; --acc-text: #4c6200; --acc-soft: rgb(120 150 0 / .12); --acc-glow: rgb(160 200 0 / .22);
  --d-p: #7d9c00; --d-c: #4a6fd8; --d-f: #d9822b; --d-w: #1f9fcc;
  --shadow: 0 24px 48px -26px rgb(40 50 20 / .35); color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--f-body);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; min-height: 100dvh;
  background-image: radial-gradient(120% 60% at 50% -10%, var(--acc-glow), transparent 55%);
  background-attachment: fixed;
}
/* granulado fixo, fora do fluxo de rolagem */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
h1, h2, h3 { text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }

#app { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding: calc(14px + var(--safe-t)) 16px calc(128px + var(--safe-b)); }
.no-tabs #app { padding-bottom: calc(40px + var(--safe-b)); }

/* ---------- tipografia ---------- */
.display { font: 700 clamp(26px, 7.4vw, 36px)/1.05 var(--f-display); letter-spacing: -.025em; margin: 0; }
.display::first-letter { text-transform: uppercase; }
.h2 { font: 700 19px/1.15 var(--f-display); letter-spacing: -.015em; margin: 0; }
.h3 { font: 600 16px/1.3 var(--f-body); margin: 0; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.small { font-size: 13px; }
.label { display: block; font: 500 13px/1.2 var(--f-body); color: var(--ink-3); }
.big { display: block; font: 600 26px/1.1 var(--f-mono); letter-spacing: -.02em; margin-top: 2px; }
.big small { font: 500 13px var(--f-body); color: var(--ink-3); letter-spacing: 0; }

/* ---------- topo ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; margin-bottom: 20px; }
.brandmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brandmark .iso { width: 58px; height: auto; display: block; }
.brandmark b { font: 800 18px/1 var(--f-display); letter-spacing: .02em; }
.back { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 8px 0; color: var(--ink-2); font-weight: 500; justify-self: start; }
.back i { font-size: 20px; }
.icon-btn { flex: none; width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; font-size: 20px; color: var(--ink); text-decoration: none; transition: transform .2s var(--spring), background .2s; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.sm { width: 38px; height: 38px; font-size: 17px; background: transparent; border-color: transparent; color: var(--ink-3); }
.icon-btn.sm:hover { color: var(--ink); background: var(--surface-2); }
.icon-btn[disabled] { opacity: .35; pointer-events: none; }
.avatar { width: 44px; height: 44px; border-radius: 15px; display: grid; place-items: center; background: var(--acc); color: var(--acc-ink); font: 800 17px/1 var(--f-display); text-decoration: none; box-shadow: 0 10px 24px -12px var(--acc-glow); transition: transform .2s var(--spring); }
.avatar:active { transform: scale(.92); }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); font-weight: 600; white-space: nowrap;
  text-decoration: none; transition: transform .2s var(--spring), background .2s, box-shadow .2s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.97); }
.btn i { font-size: 19px; }
.btn.primary { background: var(--acc); color: var(--acc-ink); border-color: transparent; box-shadow: inset 0 1px 0 rgb(255 255 255 / .35), 0 12px 28px -14px var(--acc-glow); }
.btn.primary:hover { filter: brightness(1.04); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; }
.row > .btn.block { flex: 1; width: auto; min-width: 0; }
.btn.sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn.sm i { font-size: 17px; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.stack > *, .list > *, .field > * { min-width: 0; }
.stack.lg { gap: 22px; }
.section { margin-top: 30px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.link { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 6px 0; color: var(--acc-text); font-weight: 600; font-size: 14px; text-decoration: none; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

/* ---------- chips e tags ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: 14px; font-weight: 500; white-space: nowrap;
  text-decoration: none; color: var(--ink); transition: transform .2s var(--spring), background .2s;
}
.chip:hover { background: var(--surface-2); }
.chip:active { transform: scale(.95); }
.chip.on { background: var(--acc); color: var(--acc-ink); border-color: transparent; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); font-size: 12px; font-weight: 500; }
.tag.acc { background: var(--acc-soft); color: var(--acc-text); }

/* ---------- cartões ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 18px; }
.card.tap { text-align: left; width: 100%; display: block; color: inherit; text-decoration: none; transition: transform .2s var(--spring), border-color .2s, background .2s; }
.card.tap:hover { border-color: var(--line-2); }
.card.tap:active { transform: scale(.985); }
.card.tap.stack { display: grid; }
.card.tap.row { display: flex; }
.card.hero { position: relative; overflow: hidden; background: linear-gradient(160deg, var(--surface-2), var(--surface)); }
.card.hero::after {
  content: ""; position: absolute; right: -50px; top: -40px; width: 220px; height: 220px; pointer-events: none; opacity: .07;
  background: url("isotipo.png") center / contain no-repeat; filter: grayscale(1) brightness(1.6);
}
:root[data-theme="light"] .card.hero::after { filter: grayscale(1) brightness(0); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .card.hero::after { filter: grayscale(1) brightness(0); } }
.card.acc { background: var(--acc); color: var(--acc-ink); border-color: transparent; }
.card.acc .muted { color: rgb(19 22 7 / .72); }
.card.glow { position: relative; overflow: hidden; background: radial-gradient(120% 90% at 0% 0%, var(--acc-soft), transparent 60%), var(--surface); }
.duo { display: grid; grid-template-columns: 1.2fr 1fr; gap: 10px; }
.duo .card { display: grid; gap: 4px; align-content: start; min-height: 116px; }
.duo .card i { font-size: 24px; margin-bottom: 8px; }
.duo .card span { font-size: 13px; opacity: .75; }

/* ---------- semana ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.day { display: grid; gap: 4px; justify-items: center; padding: 10px 0; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; color: var(--ink-3); }
.day b { font: 700 14px/1 var(--f-display); color: var(--ink); }
.day.rest b { color: var(--ink-3); font-weight: 500; }
.day.today { border-color: var(--acc); background: var(--acc-soft); }
.day.today span { color: var(--acc-text); }

/* ---------- listas ---------- */
.list { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.item { display: flex; gap: 14px; align-items: center; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; text-decoration: none; color: inherit; width: 100%; text-align: left; transition: background .2s, transform .2s var(--spring); }
a.item:hover, button.item:hover { background: var(--surface-2); }
a.item:active, button.item:active { transform: scale(.99); }
.item .grow { flex: 1; min-width: 0; }
.item .title { font-weight: 600; line-height: 1.3; }
.item .sub { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.item.food { padding: 10px 8px 10px 14px; }
.letter { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-3); font: 700 14px/1 var(--f-display); font-size: 14px; }
.letter i { font-size: 20px; }
.letter.acc { background: var(--acc); color: var(--acc-ink); }
.chev { color: var(--ink-3); font-size: 18px; }

/* ---------- Hoje: calorias, macros, água ---------- */
.kcal-card { display: grid; gap: 18px; }
.kcal-grid { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.ring { position: relative; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 12; }
.ring-track { stroke: var(--surface-3); }
.ring-fill { stroke: var(--d-p); stroke-linecap: round; transition: stroke-dashoffset .9s var(--ease); }
.ring-fill.over { stroke: var(--d-f); }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-label b { font-size: clamp(20px, 6vw, 28px); font-weight: 600; letter-spacing: -.03em; line-height: 1; }
.ring-label span { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.macros { display: grid; gap: 10px; }
.macro .bar { height: 8px; border-radius: 8px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.macro .bar span { display: block; height: 100%; border-radius: 8px; transition: width .8s var(--ease); }
.m-p span { background: var(--d-p); } .m-c span { background: var(--d-c); } .m-f span { background: var(--d-f); }
.water { position: relative; overflow: hidden; display: grid; gap: 14px; isolation: isolate; }
.water-fill { position: absolute; inset: 0; z-index: -1; transform-origin: bottom; background: linear-gradient(to top, color-mix(in srgb, var(--d-w) 26%, transparent), color-mix(in srgb, var(--d-w) 8%, transparent)); transition: transform .8s var(--ease); }
.water-ico { font-size: 30px; color: var(--d-w); }
.water .chip { background: color-mix(in srgb, var(--surface) 70%, transparent); backdrop-filter: blur(8px); }
.empty.slim { display: flex; gap: 12px; align-items: center; text-align: left; width: 100%; padding: 16px; background: none; color: var(--ink-2); font-size: 14px; }
.empty.slim i { font-size: 26px; flex: none; }

/* ---------- Dieta ---------- */
.day-nav { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; text-align: center; }
.day-nav b { font: 700 17px var(--f-display); text-transform: capitalize; }
.meal { display: grid; gap: 10px; padding-top: 4px; }
.meal .section-head { margin-bottom: 0; }
.meal-name { flex: 1; min-width: 0; border: 0; border-bottom: 1px dashed var(--line-2); background: transparent; font: 600 16px var(--f-body); padding: 6px 0; }
.meal-name:focus { outline: none; border-bottom-color: var(--acc); }
.unit { position: relative; }
.unit .input { padding-right: 58px; }
.unit span { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--ink-3); pointer-events: none; }
.totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.totals div { display: grid; gap: 2px; padding: 12px 6px; border-radius: 16px; background: var(--surface-2); text-align: center; }
.totals b { font-size: 18px; font-weight: 600; }
.totals span { font-size: 11px; color: var(--ink-3); }

/* ---------- Corpo ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { position: relative; display: grid; gap: 4px; padding: 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); text-align: left; transition: border-color .2s, background .2s, transform .2s var(--spring); }
button.tile:active { transform: scale(.97); }
.tile span { font-size: 12px; color: var(--ink-3); }
.tile b { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.tile b small { font: 500 12px var(--f-body); color: var(--ink-3); }
.tile em { position: absolute; right: 12px; top: 12px; font-style: normal; font-size: 12px; color: var(--ink-2); }
.tile.on { border-color: var(--acc); background: var(--acc-soft); }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart-line { fill: none; stroke: var(--d-p); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { fill: var(--acc-soft); }
.chart-dot { fill: var(--bg); stroke: var(--d-p); stroke-width: 2; }

/* ---------- painel de registro rápido ---------- */
.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.q-item { display: grid; gap: 2px; justify-items: start; padding: 16px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); text-align: left; transition: transform .2s var(--spring), background .2s; }
.q-item:hover { background: var(--surface-2); }
.q-item:active { transform: scale(.96); }
.q-item i { font-size: 26px; color: var(--acc-text); margin-bottom: 8px; }
.q-item span { font-size: 12px; color: var(--ink-3); }
.act-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.act { display: grid; gap: 6px; justify-items: center; padding: 12px 4px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); font-size: 12px; font-weight: 500; transition: transform .2s var(--spring), border-color .2s, background .2s; }
.act i { font-size: 24px; color: var(--ink-2); }
.act:active { transform: scale(.94); }
.act.on { border-color: var(--acc); background: var(--acc-soft); }
.act.on i { color: var(--acc-text); }

/* ---------- exercício ---------- */
.ex { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; transition: opacity .2s, border-color .2s; }
.ex.off { opacity: .5; }
.ex.done { border-color: var(--acc); }
.ex-head { display: flex; gap: 12px; align-items: flex-start; padding: 16px; }
.ex-head .grow { flex: 1; min-width: 0; }
.ex-name { font-weight: 600; line-height: 1.3; }
.ex-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.check {
  flex: none; width: 34px; height: 34px; border-radius: 11px; border: 2px solid var(--line-2); background: transparent;
  display: grid; place-items: center; color: transparent; font-size: 18px; transition: background .15s, border-color .15s, transform .2s var(--spring);
}
.check:active { transform: scale(.88); }
.check.on { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.check[disabled] { opacity: .3; }
.check.round { border-radius: 999px; width: 40px; height: 40px; font-size: 20px; }
.lines { display: grid; gap: 0; padding: 0 16px 6px; }
.line { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; width: 100%; }
.line .k { flex: none; width: 92px; font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--ink-3); }
.line .k.trabalho { color: var(--acc-text); }
.line .t { flex: 1; font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.line.nota .t, .line.intervalo .t { font-style: italic; }
.line .mini { flex: none; width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--line-2); display: grid; place-items: center; color: transparent; font-size: 13px; }
.line.checked .mini { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.line.checked .t { color: var(--ink-3); text-decoration: line-through; }
.ex-tools { display: flex; gap: 6px; padding: 0 12px 12px; flex-wrap: wrap; }
.tool { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); font-size: 13px; font-weight: 500; text-decoration: none; color: var(--ink-2); }
.tool i { font-size: 16px; }
.tool.acc { color: var(--acc-text); border-color: color-mix(in srgb, var(--acc) 40%, var(--line)); }
.cue { margin: 0 16px 10px; font-size: 13px; color: var(--acc-text); display: flex; gap: 6px; align-items: center; }
.load { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px 14px; }
.load .last { grid-column: 1 / -1; font-size: 12px; color: var(--ink-3); }

/* ---------- formulário ---------- */
.field { display: grid; gap: 8px; }
.field label { font-weight: 500; font-size: 14px; }
.input, select.input {
  width: 100%; min-height: 52px; padding: 0 16px; border-radius: var(--r-field); border: 1px solid var(--line-2); background: var(--surface-2);
  font-size: 16px; color: var(--ink); appearance: none; transition: border-color .2s, box-shadow .2s;
}
.input::placeholder { color: var(--ink-3); }
.input:focus { border-color: var(--acc); outline: none; box-shadow: 0 0 0 4px var(--acc-soft); }
.input:disabled { opacity: .6; }
.input.sm { min-height: 44px; padding: 0 12px; }
.help { font-size: 13px; color: var(--ink-3); }
.error { font-size: 13px; color: var(--danger); }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice.three .opt { padding: 14px 10px; }
.choice.three .opt b { font-size: 14px; }
.opt {
  min-width: 0; display: grid; gap: 6px; padding: 18px 14px; border-radius: 18px; border: 1.5px solid var(--line-2); background: var(--surface); text-align: left;
  transition: border-color .15s, background .15s, transform .2s var(--spring);
}
.opt:active { transform: scale(.97); }
.opt i { font-size: 26px; color: var(--ink-2); }
.opt b { font-weight: 600; }
.opt span { font-size: 12px; color: var(--ink-3); line-height: 1.35; }
.opt.on { border-color: var(--acc); background: var(--acc-soft); }
.opt.on i { color: var(--acc-text); }
.steps { display: flex; gap: 6px; margin: 4px 0 26px; }
.steps span { height: 4px; flex: 1; border-radius: 4px; background: var(--line-2); }
.steps span.on { background: var(--acc); }
.pass { position: relative; }
.pass .input { padding-right: 56px; }
.eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--ink-2); display: grid; place-items: center; font-size: 22px; }
.eye:active { transform: translateY(-50%) scale(.92); }
.eye[aria-pressed="true"] { color: var(--acc-text); }

/* range de minutos */
.range { width: 100%; accent-color: var(--acc); height: 32px; }
.minutes { font: 700 56px/1 var(--f-display); letter-spacing: -.04em; }
.minutes small { font: 600 16px var(--f-body); color: var(--ink-2); margin-left: 6px; letter-spacing: 0; }
.seg { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.seg.three { grid-template-columns: repeat(3, 1fr); }
.seg button { min-height: 40px; border: 0; background: none; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink-2); transition: background .2s, color .2s; }
.seg button.on { background: var(--surface-3); color: var(--ink); box-shadow: 0 6px 16px -10px rgb(0 0 0 / .5); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.switch input { width: 50px; height: 30px; appearance: none; border-radius: 999px; background: var(--surface-3); position: relative; transition: background .2s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 999px; background: var(--ink); transition: transform .25s var(--spring); }
.switch input:checked { background: var(--acc); }
.switch input:checked::after { transform: translateX(20px); background: var(--acc-ink); }

/* ---------- barra de ações fixa ---------- */
.dock { position: fixed; left: 0; right: 0; bottom: calc(96px + var(--safe-b)); z-index: 20; padding: 0 16px; pointer-events: none; }
.no-tabs .dock { bottom: calc(14px + var(--safe-b)); }
.dock-inner {
  max-width: 528px; margin: 0 auto; pointer-events: auto; display: flex; gap: 10px; align-items: center; padding: 8px 8px 8px 18px;
  border-radius: 999px; background: color-mix(in srgb, var(--surface-2) 88%, transparent); border: 1px solid var(--line-2);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); box-shadow: var(--shadow);
}
.dock-inner .grow { flex: 1; min-width: 0; }
.dock-inner .btn { min-height: 46px; }

/* ---------- navegação inferior flutuante ---------- */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 0 12px calc(12px + var(--safe-b)); pointer-events: none; }
.tabs nav {
  pointer-events: auto; max-width: 520px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  padding: 6px; border-radius: 28px; background: color-mix(in srgb, var(--surface) 86%, transparent); border: 1px solid var(--line-2);
  backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5); box-shadow: var(--shadow);
}
.tab { display: grid; justify-items: center; gap: 2px; padding: 8px 0; border-radius: 22px; text-decoration: none; color: var(--ink-3); font-size: 11px; font-weight: 500; background: none; border: 0; transition: color .2s, background .2s; }
.tab i { font-size: 22px; }
.tab.on { color: var(--ink); background: var(--surface-3); }
.tab.on i { color: var(--acc-text); }
.tab.fab { color: var(--ink-2); }
.tab.fab i { width: 48px; height: 48px; margin-top: -22px; border-radius: 17px; display: grid; place-items: center; background: var(--acc); color: var(--acc-ink); font-size: 24px; box-shadow: 0 12px 26px -10px var(--acc-glow), inset 0 1px 0 rgb(255 255 255 / .4); transition: transform .25s var(--spring); }
.tab.fab:active i { transform: scale(.9) rotate(90deg); }
.no-tabs .tabs { display: none; }
.panel-open .tabs, .panel-open .dock { visibility: hidden; }

/* ---------- sessão ---------- */
.progress { height: 6px; border-radius: 6px; overflow: hidden; background: var(--surface-3); }
.progress span { display: block; height: 100%; background: var(--acc); border-radius: 6px; transition: width .4s var(--ease); }
.timer { position: fixed; left: 0; right: 0; bottom: calc(84px + var(--safe-b)); z-index: 25; padding: 0 16px; }
.no-tabs .timer { bottom: calc(98px + var(--safe-b)); }
.timer-inner { max-width: 528px; margin: 0 auto; display: flex; align-items: center; gap: 14px; padding: 12px 12px 12px 20px; border-radius: 22px; background: var(--acc); color: var(--acc-ink); box-shadow: var(--shadow); }
.timer-inner .mono { font-size: 28px; font-weight: 600; }
.timer-inner .grow { flex: 1; }
.timer-inner button { border: 0; background: rgb(19 22 7 / .12); color: var(--acc-ink); min-height: 40px; padding: 0 14px; border-radius: 999px; font-weight: 600; }

/* ---------- folhas (sheets) ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: grid; align-items: end; background: rgb(0 0 0 / .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.sheet-wrap.fresh, .sheet-wrap:not(.panel-wrap) { animation: fade .2s var(--ease); }
.sheet { max-width: 560px; width: 100%; margin: 0 auto; max-height: 90dvh; display: grid; grid-template-rows: auto 1fr auto; background: var(--bg-2); border-radius: 28px 28px 0 0; border: 1px solid var(--line-2); border-bottom: 0; }
.fresh .sheet, .sheet-wrap:not(.panel-wrap) .sheet { animation: up .4s var(--ease); }
.sheet-head { padding: 12px 16px 10px; display: grid; gap: 12px; }
.sheet-head .grab { width: 40px; height: 5px; border-radius: 5px; background: var(--line-2); margin: 0 auto 4px; }
.sheet-body { overflow-y: auto; padding: 4px 16px 18px; overscroll-behavior: contain; }
.sheet-foot { padding: 12px 16px calc(14px + var(--safe-b)); border-top: 1px solid var(--line); }
@keyframes up { from { transform: translateY(48px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* ---------- vazio / toast ---------- */
.empty { text-align: center; padding: 30px 18px; border: 1.5px dashed var(--line-2); border-radius: var(--r-card); display: grid; gap: 10px; justify-items: center; }
.empty i { font-size: 32px; color: var(--ink-3); }
.toast { position: fixed; left: 50%; top: calc(14px + var(--safe-t)); transform: translateX(-50%); z-index: 60; padding: 12px 18px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 14px; box-shadow: var(--shadow); animation: up .3s var(--ease); max-width: calc(100% - 32px); }

/* ---------- guia ---------- */
.prose { display: grid; gap: 14px; color: var(--ink-2); }
.prose h3 { color: var(--ink); font: 700 17px/1.25 var(--f-display); margin: 10px 0 0; }
.prose b { color: var(--ink); }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px; }
.kpi b { display: block; font: 700 20px/1.1 var(--f-display); }
.kpi span { font-size: 12px; color: var(--ink-3); }

/* ---------- entrada de tela ---------- */
.screen-in > .stack > * , .screen-in > .stack.lg > * { animation: rise .5s var(--ease) both; }
.screen-in > .stack > *:nth-child(2) { animation-delay: .04s; }
.screen-in > .stack > *:nth-child(3) { animation-delay: .08s; }
.screen-in > .stack > *:nth-child(4) { animation-delay: .12s; }
.screen-in > .stack > *:nth-child(n+5) { animation-delay: .16s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
@media (min-width: 640px) {
  #app { padding-top: calc(28px + var(--safe-t)); }
}
@media (max-width: 360px) {
  .kcal-grid { grid-template-columns: 1fr; justify-items: center; }
  .act-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- computador: barra lateral, mais largura, painéis no centro ---------- */
@media (min-width: 960px) {
  #app { max-width: 1120px; padding: 36px 48px 64px calc(132px + env(safe-area-inset-left, 0px)); }
  .no-tabs #app { max-width: 560px; padding-left: 16px; }
  .tabs { top: 0; right: auto; width: 104px; padding: 20px 0 20px max(16px, env(safe-area-inset-left, 0px)); display: flex; align-items: center; }
  .tabs nav { grid-template-columns: 1fr; grid-auto-rows: auto; gap: 6px; width: 84px; padding: 10px 6px; border-radius: 26px; }
  .tab { padding: 10px 0; }
  .tab.fab { order: -1; margin-bottom: 8px; }
  .tab.fab i { margin-top: 0; }
  .dock { left: 104px; bottom: 24px; }
  .timer { left: 104px; bottom: 96px; }
  .top { margin-bottom: 28px; }
  .display { font-size: 40px; }
  /* Hoje e Corpo em duas colunas */
  .route-inicio > .stack.lg { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; column-gap: 22px; }
  .route-inicio > .stack.lg > :first-child, .route-inicio > .stack.lg > a.card.acc { grid-column: 1 / -1; }
  .route-corpo .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .route-corpo > .stack.lg { max-width: 860px; }
  .route-dieta > .stack.lg, .route-treinos > .stack.lg, .route-metas > .stack.lg, .route-perfil > .stack.lg, .route-montar > .stack.lg { max-width: 760px; }
  .route-treinos .duo { grid-template-columns: 1fr 1fr; }
  .act-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  /* folhas viram janela no centro */
  .sheet-wrap { align-items: center; padding: 24px; }
  .sheet { max-width: 620px; max-height: 86vh; border-radius: 28px; border-bottom: 1px solid var(--line-2); }
  .sheet-head .grab { display: none; }
  .sheet-foot { padding-bottom: 16px; }
}
