/* 05/nov · Metas que se explicam + Gerar dieta · Painel Clínico */

/* ---------- metas: proteína, carbo e gordura ---------- */
.nm-macros { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.nm-topo { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
/* minmax(0,1fr) e min-width:0: o select tem largura própria (a da opção mais comprida) e sem isso vaza por cima do campo ao lado */
.nm-campo { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 4px; min-width: 0; font-size: 11px; color: var(--muted); }
.nm-campo select, .nm-campo input { width: 100%; min-width: 0; box-sizing: border-box; min-height: 38px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font: 13px var(--font-body); color: var(--ink); text-overflow: ellipsis; }
.nm-lin { display: grid; grid-template-columns: 120px minmax(0, 1fr) 170px; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.nm-lin:last-child { border-bottom: 0; padding-bottom: 0; }
.nm-rot { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.nm-rot em { display: none; font-style: normal; font-weight: 500; font-size: 10.5px; color: #8A6B26; }
.nm-lin.fecha .nm-rot em { display: block; }
.nm-ctl { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.nm-ctl input { width: 76px; min-height: 36px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 9px; font: 600 13px var(--font-body); color: var(--ink); background: #fff; }
.nm-ctl input:disabled { background: #F7F1E8; color: var(--ink); border-color: transparent; }
.nm-ctl select { min-height: 36px; padding: 5px 6px; border: 1px solid var(--line); border-radius: 9px; font: 12.5px var(--font-body); color: var(--ink); background: #fff; }
.nm-res { font-size: 13px; color: var(--ink); text-align: right; }
.nm-res b { font-weight: 600; }
.nm-res small { display: block; font-size: 10.5px; color: var(--muted); }
.nm-res small.nm-faixa.fora { color: #A5584E; }
.gd-rac small { display: block; margin-top: 4px; font-size: 11.5px; color: var(--muted); }
/* flex e não grid auto-fit: a linha de sinal ocupando a largura toda impedia a coluna vazia de sumir e deixava um vão à direita */
.nm-objetivo { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 14px; margin-bottom: 14px; border: 1px solid #E2CFA8; border-radius: 14px; background: #fff; }
.nm-objetivo > .nm-campo { flex: 1 1 200px; }
.nm-objetivo > .nm-campo + .nm-campo { flex: 3 1 280px; }
.nm-objetivo-sinal { flex: 1 1 100%; font-size: 12.5px; color: var(--ink); }
.nm-objetivo-sinal:empty { display: none; }
.nm-obj-aviso, .nm-obj-caminho, .nm-obj-falta { display: block; font-size: 12.5px; line-height: 1.5; font-weight: 400; }
.nm-obj-aviso { color: #A5584E; }
.nm-obj-aviso button { padding: 0; border: 0; background: none; cursor: pointer; font: inherit; font-weight: 600; color: #8A6D2F; text-decoration: underline; text-underline-offset: 2px; }
.nm-obj-caminho { color: var(--muted); }
.nm-obj-caminho.no_caminho { color: #5F6B4E; }
.nm-obj-falta { color: var(--muted); }
.nm-padrao-acao { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 0 2px; font-size: 12px; color: var(--muted); }
.nm-padrao-acao:empty { display: none; }
.nm-padrao-acao button { padding: 0; border: 0; background: none; cursor: pointer; font: inherit; font-weight: 600; color: #8A6D2F; text-decoration: underline; text-underline-offset: 2px; }
.nm-conta-wrap { margin-top: 12px; }
.nm-conta-tit { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.nm-conta { display: grid; gap: 6px; font-size: 12.5px; line-height: 1.5; color: var(--ink); }
.nm-passo { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 8px; }
.nm-passo b { font-weight: 600; font-size: 12px; }
.nm-passo small { display: block; font-size: 10.5px; color: var(--muted); }
.nm-avisos { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.nm-avisos p { margin: 0 0 5px; font-size: 12px; }
.nm-avisos p:last-child { margin: 0; }
.nm-padrao-nota { font-size: 11.5px; color: var(--muted); }
.nm-padrao-nota b { color: var(--ink); font-weight: 600; }
.nm-padrao-nota span { display: block; margin-top: 3px; font-size: 10.5px; }
.nm-padrao-nota a { color: inherit; text-decoration: underline; }
.nutri-modal.nm-janela { max-width: 880px; }
.nm-janela .nutri-card { border: 0; box-shadow: none; padding: 0; background: none; }
.nm-janela-pe { display: flex; justify-content: flex-end; margin-top: 14px; }

/* ---------- janela do gerador ---------- */
.nutri-modal.gd-modal { max-width: 980px; padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.gd-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 22px 12px; border-bottom: 1px solid var(--line); }
.gd-cab h3 { font-family: var(--font-display); font-weight: 600; font-size: 21px; margin: 4px 0 0; color: var(--ink); }
.gd-cab-acoes { display: flex; gap: 8px; align-items: center; }
.gd-k { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.gd-corpo { flex: 1; min-height: 0; overflow: auto; padding: 4px 22px 18px; }
.gd-corpo.ocupado { opacity: .55; pointer-events: none; }
.gd-sec { padding-top: 14px; }
.gd-sec h4 { margin: 0 0 8px; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.gd-sec textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; font: 13px/1.5 var(--font-body); color: var(--ink); resize: vertical; }
.gd-sec p { font-size: 13px; line-height: 1.5; color: var(--ink); margin: 0 0 6px; }
.gd-sec ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.55; color: var(--ink); }
.gd-metas .nutri-card { border: 0; box-shadow: none; padding: 0; background: none; }
.gd-metas .nutri-card-head, .gd-metas #nutri-metas-saved { display: none; }
.gd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gd-chip { display: inline-flex; align-items: baseline; gap: 6px; min-height: 36px; padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font: 500 12.5px var(--font-body); color: var(--ink); cursor: pointer; }
.gd-chip small { font-size: 10px; color: var(--muted); }
.gd-chip.on { background: #211D18; color: #F6F2EE; border-color: #211D18; }
.gd-chip.on small { color: #CAA967; }
.gd-ck { display: flex; align-items: center; gap: 8px; margin-top: 9px; font-size: 12.5px; color: var(--ink); cursor: pointer; }
.gd-ck input { width: 16px; height: 16px; flex: none; }
.gd-linhas { display: grid; gap: 4px; margin-top: 10px; font-size: 12.5px; color: var(--ink); }
.gd-linhas div { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px; }
.gd-linhas b { font-weight: 600; color: var(--muted); font-size: 11.5px; }
.gd-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 8px; }
.gd-card { display: flex; flex-direction: column; gap: 3px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; text-align: left; color: var(--ink); font-family: var(--font-body); }
.gd-card b { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.gd-card em { font-style: normal; font-size: 10.5px; font-weight: 600; color: #8A6B26; }
.gd-card em.c { color: #A5584E; }
.gd-card span { font-size: 11.5px; line-height: 1.4; color: var(--muted); }
.gd-card:hover { border-color: #CAA967; }
.gd-card.on { border-color: #211D18; box-shadow: inset 0 0 0 1px #211D18; }
.gd-card.contra:not(.on) { opacity: .6; }
.gd-sobre { margin-top: 10px; }
.gd-sobre p { font-size: 12.5px; margin: 0 0 5px; }
.gd-sobre b { font-weight: 600; }
.gd-contra { margin-top: 8px; padding: 11px 13px; border: 1px solid rgba(165,88,78,.45); border-radius: 10px; background: #fff; }
.gd-refs { display: grid; gap: 6px; }
.gd-ref { display: grid; grid-template-columns: minmax(0, 1fr) 118px 30px; gap: 6px; align-items: center; }
.gd-ref input { min-height: 36px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 9px; font: 13px var(--font-body); color: var(--ink); background: #fff; min-width: 0; }
.gd-refs > .inj-row-btn { justify-self: start; }
.gd-ops { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 10px; }
.gd-ops .gd-ck { margin: 0; }
.gd-seg { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--ink); }
.gd-seg span { margin-right: 6px; }
.gd-seg button { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: #fff; font: 600 13px var(--font-body); color: var(--ink); cursor: pointer; }
.gd-seg button.on { background: #211D18; border-color: #211D18; color: #F6F2EE; }
.gd-pe { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 14px; padding: 12px 22px; border-top: 1px solid var(--line); background: var(--card); }
.gd-pe > div { display: flex; gap: 8px; }
.gd-pe-nota { font-size: 11.5px; color: var(--muted); flex: 1 1 240px; }
.gd-gerando { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink); min-height: 36px; }
.gd-gerando i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: #8A6B26; animation: gd-gira 1s linear infinite; }
@keyframes gd-gira { to { transform: rotate(360deg); } }

/* ---------- por que esta dieta ---------- */
.gd-rac { font-family: var(--font-display); font-size: 16px; line-height: 1.5; color: var(--ink); margin: 14px 0 0; }
.gd-conf { display: grid; gap: 5px; }
.gd-conf-l { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 8px; align-items: baseline; font-size: 12.5px; line-height: 1.45; color: var(--ink); }
.gd-conf-l i { font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #5F6B4E; }
.gd-conf-l.atencao i { color: #8A6B26; }
.gd-conf-l.corrigir i { color: #A5584E; }
.gd-tab { display: grid; gap: 2px; font-size: 12.5px; }
.gd-tab-ref { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2px 10px; margin-top: 8px; padding-bottom: 3px; border-bottom: 1px solid var(--line); }
.gd-tab-ref b { font-weight: 600; color: var(--ink); }
.gd-tab-ref span { font-size: 11px; color: var(--muted); }
.gd-tab-op { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2px 10px; padding: 2px 0; color: var(--ink); }
.gd-tab-op span:last-child { font-variant-numeric: tabular-nums; font-size: 11.5px; color: var(--muted); }
.gd-refs-lista { list-style: none; padding: 0 !important; margin-top: 6px !important; }
.gd-refs-lista li { font-size: 12px; margin-bottom: 5px; }
.gd-refs-lista a { color: var(--ink); text-decoration: underline; }
.gd-refs-lista small { display: block; font-size: 11px; color: var(--muted); }

/* ---------- editor dos padrões ---------- */
.nutri-modal.gd-ed-modal { max-width: 1040px; height: 86vh; }
.gd-ed-grade { flex: 1; min-height: 0; display: grid; grid-template-columns: 220px minmax(0, 1fr); }
#gd-ed-lista { overflow: auto; padding: 12px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
#gd-ed-lista h5 { margin: 10px 0 4px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
#gd-ed-lista button { display: flex; justify-content: space-between; gap: 6px; min-height: 34px; padding: 6px 10px; border: 0; border-radius: 8px; background: none; text-align: left; font: 12.5px var(--font-body); color: var(--ink); cursor: pointer; }
#gd-ed-lista button:hover { background: #F7F1E8; }
#gd-ed-lista button.on { background: #211D18; color: #F6F2EE; }
#gd-ed-lista small { font-size: 10px; color: #CAA967; }
#gd-ed-lista .gd-novo { color: #8A6B26; font-weight: 600; }
#gd-ed-form { overflow: auto; padding: 14px 20px 18px; display: grid; gap: 10px; align-content: start; }
.gd-campo { display: grid; gap: 4px; font-size: 11.5px; color: var(--muted); }
.gd-campo i { font-style: normal; font-size: 10.5px; }
.gd-campo input, .gd-campo textarea, .gd-campo select { width: 100%; min-height: 36px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 9px; font: 13px/1.45 var(--font-body); color: var(--ink); background: #fff; }
.gd-ed-macros { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.gd-ed-refs { font-size: 11.5px; color: var(--muted); }
.gd-ed-refs ul { margin: 4px 0 0; padding-left: 16px; }
.gd-ed-refs a { color: var(--ink); }
.gd-ed-pe { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; position: sticky; bottom: -18px; padding: 10px 0; background: var(--card); }
.gd-ed-pe #ge-salvo { margin-left: auto; }

@media (max-width: 720px) {
  .nm-lin { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .nm-res { text-align: left; }
  .nm-res small { display: inline; margin-left: 6px; }
  .nm-res small.nm-faixa { display: block; margin-left: 0; }
  .nm-passo { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .nutri-modal.gd-modal { max-height: 94vh; }
  .gd-ed-grade { grid-template-columns: minmax(0, 1fr); grid-template-rows: 150px minmax(0, 1fr); }
  #gd-ed-lista { border-right: 0; border-bottom: 1px solid var(--line); }
  .gd-cab, .gd-corpo, .gd-pe { padding-left: 16px; padding-right: 16px; }
}

/* ---------- publicar: o que muda ---------- */
.nutri-modal.np-modal { max-width: 620px; }
.np-texto { font-size: 13px; line-height: 1.5; color: var(--ink); margin: 0 0 10px; }
.np-sec { margin-top: 12px; }
.np-k { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.np-dia { font-size: 13px; color: var(--ink); margin: 0 0 8px; }
.np-dia b { font-weight: 600; }
.np-ref { margin-top: 8px; font-size: 12.5px; color: var(--ink); }
.np-ref > b { font-weight: 600; }
.np-lista { margin: 3px 0 0; padding-left: 17px; font-size: 12.5px; line-height: 1.5; color: var(--ink); }
.np-conferido { margin-top: 8px; }
.np-conferido summary { font-size: 11.5px; color: var(--muted); cursor: pointer; min-height: 28px; }
.np-pe { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; }

/* 06/nov · de onde vem cada faixa */
.nm-origem { margin-top: 10px; font-size: 12.5px; }
.nm-origem summary { cursor: pointer; font-weight: 600; color: #241F1B; }
.nm-origem-nota { margin: 8px 0 0; color: #8D7B6A; }
.nm-origem-l { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(46,42,38,.07); }
.nm-origem-l:last-child { border-bottom: 0; }
.nm-origem-l b { font-weight: 600; color: #241F1B; }
.nm-origem-l span { color: #241F1B; }
.nm-origem-l small { display: block; margin-top: 2px; font-size: 11.5px; color: #8D7B6A; }

/* 06/nov · pesquisa do WellNutri */
.gd-pesq { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 4px 0 12px; }
#ge-pesq-res { flex: 1 0 100%; min-width: 0; }
.gd-pesq-caixa { padding: 14px; border: 1px solid rgba(46,42,38,.12); border-radius: 12px; background: #FBF9F5; font-size: 12.5px; }
.gd-pesq-caixa h6 { margin: 12px 0 6px; font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #8D7B6A; }
.gd-pesq-caixa h6:first-child { margin-top: 0; }
.gd-pesq-caixa p { margin: 0 0 8px; }
.gd-pesq-caixa ul { margin: 0 0 8px; padding-left: 16px; }
.gd-pesq-it { display: grid; grid-template-columns: 18px 1fr; gap: 8px; padding: 5px 0; cursor: pointer; }
.gd-pesq-it small { display: block; margin-top: 2px; font-size: 11px; color: #8D7B6A; }

/* 06/nov · objetivo de energia e ajuda das fórmulas */
.nm-ajuste { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.nm-ajuste select { flex: 1 1 110px; min-width: 0; }
.nm-ajuste-pct { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; }
.nm-ajuste-pct[hidden] { display: none; }
.nm-ajuste-pct input { width: 3.4em; }
.nm-ajuda { display: block; margin-top: 4px; font-size: 11px; line-height: 1.3; color: var(--muted); font-weight: 400; letter-spacing: 0; text-transform: none; }
