@font-face { font-family: "Manrope"; src: url("fonts/Manrope.ttf") format("truetype"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("fonts/SpaceGrotesk.ttf") format("truetype"); font-weight: 300 700; font-display: swap; }

:root {
  --bg: #F2F4EE;
  --surface: #FFFFFF;
  --surface-2: #E9EDE4;
  --ink: #15211A;
  --ink-2: #4A5A50;
  --ink-3: #6F7E74;
  --line: #DCE2D6;
  --accent: #C4F135;
  --accent-ink: #1B330C;
  --accent-text: #3B7310;
  --accent-soft: #EAF8C4;
  --carbo: #E39B2D;
  --gord: #5C86E0;
  --track: #E3E8DD;
  --warn-bg: #EEF1EA;
  --danger: #B3372B;
  --shadow: 0 1px 0 rgba(21,33,26,.04), 0 8px 24px -12px rgba(21,33,26,.18);
  --r-lg: 22px; --r-md: 14px; --r-sm: 10px;
  --num: "Space Grotesk", "Manrope", system-ui, sans-serif;
  color-scheme: light;
}
[data-tema="escuro"] {
  --bg: #0D1611;
  --surface: #15211A;
  --surface-2: #1D2B23;
  --ink: #EAF2E5;
  --ink-2: #AFC0B4;
  --ink-3: #849488;
  --line: #26372D;
  --accent: #C4F135;
  --accent-ink: #15260A;
  --accent-text: #C4F135;
  --accent-soft: #24361A;
  --carbo: #F0B14E;
  --gord: #7FA2F0;
  --track: #24342B;
  --warn-bg: #1B2820;
  --danger: #F07A6C;
  --shadow: 0 1px 0 rgba(0,0,0,.2), 0 10px 28px -14px rgba(0,0,0,.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 16px; line-height: 1.45;
  color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; border-radius: 8px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Moldura: no computador mostra um celular de 390px; no celular ocupa a tela */
.palco { min-height: 100vh; display: flex; justify-content: center; }
.app { position: relative; width: 100%; max-width: 430px; min-height: 100vh; background: var(--bg); padding-bottom: 104px; }
@media (min-width: 700px) {
  .palco { padding: 24px 0; background: #cfd6ca; }
  [data-tema="escuro"] .palco { background: #050906; }
  .app { min-height: 844px; border-radius: 36px; overflow: hidden; box-shadow: 0 30px 80px -30px rgba(0,0,0,.45); }
  .mapa { display: block !important; }
}
.mapa { display: none; position: fixed; left: 16px; top: 16px; width: 220px; font-size: 13px; background: var(--surface); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); }
.mapa a { display: block; color: var(--ink-2); text-decoration: none; padding: 3px 0; }
.mapa a:hover { color: var(--ink); }
.mapa b { display: block; margin: 8px 0 2px; font-size: 12px; color: var(--ink-3); font-weight: 600; }

.tela { padding: 12px 20px 24px; }
.topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0 10px; }
.topo h1 { font-family: var(--num); font-size: 26px; line-height: 1.1; margin: 0; font-weight: 600; letter-spacing: -.01em; }
.topo .sub { color: var(--ink-3); font-size: 14px; margin-top: 2px; }
.icone-btn { color: var(--ink); width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--surface); display: grid; place-items: center; box-shadow: var(--shadow); }
.avatar { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-family: var(--num); font-size: 17px; }
.voltar { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 8px 0; color: var(--ink-2); font-weight: 600; }

.cartao { background: var(--surface); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); }
.secao-titulo { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 2px 10px; }
.secao-titulo h2 { font-size: 18px; margin: 0; font-weight: 700; }
.secao-titulo span { color: var(--ink-3); font-size: 14px; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }

/* Anel do dia: o prato */
.hero { display: grid; grid-template-columns: 172px 1fr; gap: 16px; align-items: center; }
.anel { position: relative; width: 172px; height: 172px; }
.anel svg { display: block; }
.anel .centro { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.anel .valor { font-family: var(--num); font-size: 46px; font-weight: 600; line-height: 1; letter-spacing: -.02em; }
.anel .valor small { font-size: 20px; font-weight: 500; }
.anel .de { color: var(--ink-3); font-size: 14px; margin-top: 4px; }
.hero-txt .rotulo { font-size: 15px; color: var(--ink-2); font-weight: 600; }
.hero-txt .falta { font-family: var(--num); font-size: 30px; font-weight: 600; line-height: 1.1; margin: 4px 0 8px; letter-spacing: -.01em; }
.hero-txt .dica { font-size: 14px; color: var(--ink-2); background: var(--warn-bg); border-radius: 12px; padding: 8px 10px; }
.hero-txt .dica b { color: var(--ink); }

.macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.macro { background: var(--surface); border-radius: var(--r-md); padding: 12px; box-shadow: var(--shadow); }
.macro .nome { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.macro .v { font-family: var(--num); font-size: 20px; font-weight: 600; margin-top: 2px; }
.macro .v small { display: block; font-size: 13px; color: var(--ink-3); font-weight: 500; font-family: "Manrope"; }
.barra { height: 6px; border-radius: 6px; background: var(--track); margin-top: 8px; overflow: hidden; }
.barra i { display: block; height: 100%; border-radius: 6px; }

/* Lista de refeições: 1 linha por item */
.lista { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.linha { display: flex; align-items: center; gap: 12px; padding: 12px 14px; width: 100%; border: 0; background: none; text-align: left; border-top: 1px solid var(--line); }
.linha:first-child { border-top: 0; }
.linha .meio { flex: 1; min-width: 0; }
.linha .t { font-weight: 700; font-size: 16px; display: flex; gap: 8px; align-items: baseline; }
.linha .t span { color: var(--ink-3); font-weight: 500; font-size: 13px; }
.linha .s { color: var(--ink-2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.linha .dir { text-align: right; flex-shrink: 0; }
.linha .dir .p { font-family: var(--num); font-weight: 600; font-size: 18px; }
.linha .dir .k { color: var(--ink-3); font-size: 12px; }
.thumb { width: 52px; height: 52px; flex-shrink: 0; border-radius: 50%; }
.vazio-thumb { width: 52px; height: 52px; border-radius: 50%; border: 2px dashed var(--line); display: grid; place-items: center; color: var(--ink-3); flex-shrink: 0; }
.chip-acao { border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 700; border-radius: 999px; padding: 8px 14px; font-size: 14px; }

/* Navegação inferior */
.nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 430px; z-index: 20;
  display: grid; grid-template-columns: 1fr 1fr 96px 1fr 1fr; align-items: end; padding: 8px 8px 22px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
@media (min-width: 700px) { .nav { position: absolute; } }
.nav a { display: grid; justify-items: center; gap: 2px; color: var(--ink-3); text-decoration: none; font-size: 12px; font-weight: 600; padding: 6px 0; }
.nav a.ativo { color: var(--ink); }
.nav a.ativo svg { stroke: var(--ink); }
.nav .mais { justify-self: center; margin-top: -26px; width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 10px 24px -8px rgba(80,120,10,.6); border: 4px solid var(--bg); }
.nav .mais-rot { grid-column: 3; text-align: center; font-size: 12px; font-weight: 700; color: var(--ink); margin-top: 2px; }

/* Botões */
.btn { display: flex; width: 100%; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 16px; padding: 16px; font-weight: 800; font-size: 17px; }
.btn-pri { background: var(--accent); color: var(--accent-ink); }
.btn-sec { background: var(--surface-2); color: var(--ink); }
.link { background: none; border: 0; color: var(--ink-2); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; padding: 10px; }
.link-perigo { color: var(--danger); }

/* Folha (modal sobre a lista) */
.veu { position: fixed; inset: 0; background: rgba(8,14,10,.45); z-index: 30; }
@media (min-width: 700px) { .veu { position: absolute; } }
.folha { position: absolute; left: 0; right: 0; bottom: 0; top: 46px; background: var(--bg); border-radius: 26px 26px 0 0; overflow: auto; padding: 8px 20px 0; }
.puxador { width: 40px; height: 5px; border-radius: 5px; background: var(--line); margin: 6px auto 8px; }
.folha-topo { display: flex; gap: 14px; align-items: center; margin: 6px 0 14px; }
.folha-topo h2 { margin: 0; font-family: var(--num); font-weight: 600; font-size: 24px; }
.folha-topo .sub { color: var(--ink-3); font-size: 14px; }
.fechar { margin-left: auto; align-self: flex-start; }
.totais { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 4px; background: var(--surface); border-radius: var(--r-md); padding: 12px; box-shadow: var(--shadow); }
.totais div { text-align: center; }
.totais .v { font-family: var(--num); font-weight: 600; font-size: 19px; }
.totais .n { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.totais .prot .v { font-size: 24px; }
.totais .prot { border-right: 1px solid var(--line); }

.item { background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow); margin-top: 10px; }
.item-cab { display: flex; align-items: center; gap: 12px; padding: 13px 14px; width: 100%; border: 0; background: none; text-align: left; }
.item-cab .meio { flex: 1; min-width: 0; }
.item-cab .t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-cab .s { color: var(--ink-3); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-cab .p { font-family: var(--num); font-weight: 600; font-size: 18px; white-space: nowrap; }
.item-cab .p small { font-size: 12px; color: var(--ink-3); font-family: "Manrope"; font-weight: 600; }
.bolinha { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.item.aberto { outline: 2px solid var(--accent-text); }
.editor { padding: 0 14px 14px; border-top: 1px solid var(--line); }
.editor .rot { font-size: 13px; color: var(--ink-2); font-weight: 700; margin: 12px 0 6px; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 48px; height: 48px; border-radius: 14px; border: 0; background: var(--surface-2); font-size: 22px; font-weight: 700; }
.stepper .campo { flex: 1; height: 48px; border-radius: 14px; background: var(--bg); display: flex; align-items: center; justify-content: center; gap: 6px; font-family: var(--num); font-size: 22px; font-weight: 600; border: 1px solid var(--line); }
.stepper .campo small { font-size: 14px; color: var(--ink-3); font-family: "Manrope"; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 8px 12px; font-size: 14px; font-weight: 600; }
.chip.sel { background: var(--accent-soft); border-color: var(--accent-text); color: var(--ink); }
.editor .acoes { display: flex; justify-content: space-between; margin-top: 8px; }
.calc { margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.calc b { color: var(--ink); }
.fonte { color: var(--ink-3); font-size: 12px; margin-top: 16px; text-align: center; }

.busca { margin-top: 12px; }
.busca .entrada { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 2px solid var(--accent-text); border-radius: 14px; padding: 0 12px; height: 50px; }
.busca input { flex: 1; border: 0; background: none; outline: none; font-size: 16px; font-weight: 600; }
.res { display: flex; align-items: center; gap: 10px; padding: 11px 4px; border-bottom: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; }
.res .meio { flex: 1; min-width: 0; }
.res .t { font-weight: 600; font-size: 15px; line-height: 1.3; }
.res .s { font-size: 12px; color: var(--ink-3); }
.res .p { font-family: var(--num); font-weight: 600; white-space: nowrap; }
.res .p small { color: var(--ink-3); font-size: 11px; font-family: "Manrope"; }
.res.sel { background: var(--accent-soft); border-radius: 10px; padding-left: 8px; }

.rodape-fixo { position: sticky; bottom: 0; margin: 16px -20px 0; padding: 14px 20px 26px; background: linear-gradient(to top, var(--bg) 70%, transparent); }
.rodape-fixo .aviso { text-align: center; font-size: 13px; color: var(--ink-3); margin-bottom: 8px; }

/* Histórico */
.seg { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button, .seg a { border: 0; background: none; padding: 8px 16px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--ink-2); text-decoration: none; }
.seg .sel { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.media { display: flex; align-items: flex-end; gap: 16px; margin: 4px 0 14px; }
.media .grande { font-family: var(--num); font-size: 44px; font-weight: 600; line-height: 1; letter-spacing: -.02em; }
.media .grande small { font-size: 18px; font-weight: 500; color: var(--ink-2); }
.media .lado { font-size: 14px; color: var(--ink-2); padding-bottom: 4px; }
.media .lado b { color: var(--ink); }
.grafico { position: relative; }
.grafico svg { display: block; width: 100%; height: auto; overflow: visible; }
.grafico .eixo { font-size: 12px; fill: var(--ink-3); font-family: "Manrope"; font-weight: 600; }
.grafico .rotulo-meta { font-size: 12px; fill: var(--ink-2); font-weight: 700; font-family: "Manrope"; }
.grafico .rotulo-valor { font-size: 12px; fill: var(--ink); font-family: var(--num); font-weight: 600; }
.dica-graf { position: absolute; background: var(--ink); color: var(--bg); font-size: 13px; border-radius: 10px; padding: 6px 10px; pointer-events: none; white-space: nowrap; transform: translate(-50%, -110%); font-weight: 600; }
.legenda { display: flex; gap: 16px; font-size: 13px; color: var(--ink-2); margin-top: 10px; flex-wrap: wrap; }
.legenda i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 6px; }
.legenda .tr { width: 18px; height: 0; border-top: 2px dashed var(--ink-2); border-radius: 0; vertical-align: 3px; }
.dia-linha .ok { color: var(--accent-text); font-weight: 800; font-size: 13px; }
.dia-linha .nao { color: var(--ink-3); font-weight: 600; font-size: 13px; }

/* Metas */
.form-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.campo-f label { display: block; font-size: 13px; color: var(--ink-2); font-weight: 700; margin-bottom: 6px; }
.campo-f .caixa { display: flex; align-items: baseline; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.campo-f input { width: 100%; border: 0; background: none; outline: none; font-family: var(--num); font-size: 22px; font-weight: 600; padding: 0; }
.campo-f .un { color: var(--ink-3); font-size: 14px; }
.opcoes { display: grid; gap: 8px; }
.opcao { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-align: left; width: 100%; }
.opcao .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ink-3); flex-shrink: 0; }
.opcao.sel { border: 2px solid var(--accent-text); padding: 13px; }
.opcao.sel .radio { border: 7px solid var(--accent-text); }
.opcao .t { font-weight: 700; }
.opcao .s { font-size: 13px; color: var(--ink-3); }
.opcao .gk { margin-left: auto; font-family: var(--num); font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.resultado { background: var(--ink); color: var(--bg); border-radius: var(--r-lg); padding: 20px; }
[data-tema="escuro"] .resultado { background: var(--surface-2); color: var(--ink); }
.resultado .grande { font-family: var(--num); font-size: 52px; font-weight: 600; line-height: 1; letter-spacing: -.02em; color: var(--accent); }
.resultado .grande small { font-size: 20px; color: inherit; font-weight: 500; }
.resultado p { margin: 10px 0 0; font-size: 15px; opacity: .9; }
.resultado .conta { margin-top: 12px; display: inline-block; font-family: var(--num); font-weight: 600; background: rgba(196,241,53,.16); color: var(--accent); border-radius: 10px; padding: 6px 10px; }
.mini-metas { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 16px; }
.mini-metas > div { border-top: 1px solid rgba(255,255,255,.18); padding-top: 8px; }
[data-tema="escuro"] .mini-metas > div { border-color: var(--line); }
.mini-metas .v { font-family: var(--num); font-weight: 600; font-size: 18px; }
.mini-metas .n { font-size: 12px; opacity: .75; }
.saiba { font-size: 14px; color: var(--ink-2); margin-top: 10px; }
.saiba summary { font-weight: 700; color: var(--ink); cursor: pointer; padding: 6px 0; }
.ajuste { display: flex; align-items: center; justify-content: space-between; padding: 14px; }
.ajuste + .ajuste { border-top: 1px solid var(--line); }
.ajuste .s { font-size: 13px; color: var(--ink-3); }

/* Registrar */
.camera { position: relative; border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 1 / 1; background: #1a241d; display: grid; place-items: center; }
.camera .mira { position: absolute; inset: 14%; border-radius: 50%; border: 2px dashed rgba(255,255,255,.5); }
.camera .txt { position: relative; color: #fff; text-align: center; font-weight: 700; }
.camera .txt small { display: block; font-weight: 500; opacity: .75; margin-top: 4px; }
.modos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.caixa-texto { width: 100%; min-height: 96px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); padding: 14px; font-size: 16px; resize: none; }
.exemplos { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 2px; scrollbar-width: none; }
.exemplos .chip { white-space: nowrap; color: var(--ink-2); }
.tipo-sel { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.analise { display: flex; gap: 14px; align-items: center; }
.analise .foto { width: 96px; height: 96px; border-radius: 50%; flex-shrink: 0; }
.selo { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--accent-text); background: var(--accent-soft); border-radius: 999px; padding: 4px 10px; }
.conf { font-size: 12px; font-weight: 700; color: var(--ink-3); }
.aviso-cinza { background: var(--warn-bg); border-radius: 12px; padding: 10px 12px; font-size: 14px; color: var(--ink-2); display: flex; gap: 10px; align-items: flex-start; }
.aviso-cinza .x { margin-left: auto; background: none; border: 0; color: var(--ink-3); padding: 0 2px; font-size: 18px; line-height: 1; }

/* Login */
.login { min-height: 100vh; display: flex; flex-direction: column; padding: 28px 24px 32px; }
@media (min-width: 700px) { .login { min-height: 844px; } }
.marca { display: flex; align-items: center; gap: 10px; font-family: var(--num); font-weight: 700; font-size: 20px; }
.login .arte { flex: 1; display: grid; place-items: center; }
.login h1 { font-family: var(--num); font-weight: 600; font-size: 34px; line-height: 1.08; letter-spacing: -.02em; margin: 0 0 10px; }
.login p { color: var(--ink-2); margin: 0 0 22px; font-size: 16px; }
.login .seg-info { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-3); margin-top: 14px; }
.codigo-par { display: flex; justify-content: center; gap: 10px; margin: 8px 0 18px; }
.codigo-par span { width: 64px; height: 76px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; font-family: var(--num); font-size: 40px; font-weight: 600; }
.digitos { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 6px 0 8px; }
.digitos span { height: 60px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; font-family: var(--num); font-size: 28px; font-weight: 600; }
.digitos span.cursor { border: 2px solid var(--accent-text); }
.passos { margin: 0 0 20px; padding: 0; list-style: none; counter-reset: p; }
.passos li { counter-increment: p; display: flex; gap: 12px; padding: 8px 0; color: var(--ink-2); }
.passos li::before { content: counter(p); width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); color: var(--ink); font-weight: 800; font-size: 13px; display: grid; place-items: center; flex-shrink: 0; }
.espera { display: flex; align-items: center; gap: 10px; justify-content: center; color: var(--ink-3); font-size: 14px; margin: 6px 0 16px; }
.pulso { width: 10px; height: 10px; border-radius: 50%; background: var(--accent-text); animation: pulso 1.4s ease-in-out infinite; }
@keyframes pulso { 50% { opacity: .25; transform: scale(.7); } }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 112px; background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 14px; font-weight: 600; font-size: 14px; display: flex; gap: 16px; align-items: center; z-index: 50; white-space: nowrap; }
.toast button { background: none; border: 0; color: var(--accent); font-weight: 800; }
@media (min-width: 700px) { .toast { position: absolute; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
