  :root {
    --bg: #0B1220;
    --surface: #121A2B;
    --surface2: #1A2438;
    --line: rgba(255,255,255,0.08);
    --text: #F4F7FC;
    --muted: #8E9BB3;
    --kcal: #40C8E0; /* neutro (antes vermelho); passar da meta usa --over */
    --protein: #0A84FF;
    --carbs: #FF9F0A;
    --fat: #30D158;
    --over: #FF9F0A;
    --suggest: #BF5AF2;
    --safe-top: env(safe-area-inset-top, 54px);
    --safe-bottom: env(safe-area-inset-bottom, 34px);
  }
  * { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
  html, body { height: 100%; }
  body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
  }
  .phone {
    min-height: 100%;
    max-width: 430px;
    margin: 0 auto;
    padding: calc(var(--safe-top) + 8px) 16px calc(var(--safe-bottom) + 20px);
    background:
      radial-gradient(ellipse 80% 40% at 50% -5%, rgba(10,132,255,0.22), transparent 60%),
      var(--bg);
  }
  .island {
    width: 126px; height: 37px; background: #000; border-radius: 20px; margin: 0 auto 14px;
  }
  .top {
    display: flex; justify-content: space-between; align-items: flex-end;
    margin-bottom: 18px;
  }
  .top h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
  .top .date { color: var(--muted); font-size: 13px; margin-top: 6px; font-weight: 500; }
  .top .peso { color: var(--muted); font-size: 13px; margin-top: 4px; font-weight: 600; }
  .pill {
    background: rgba(10,132,255,0.18); color: #64D2FF;
    font-size: 12px; font-weight: 700; padding: 8px 12px; border-radius: 999px;
  }
  .hero {
    background: linear-gradient(180deg, var(--surface2), var(--surface));
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 20px 18px 16px;
    margin-bottom: 14px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.35);
  }
  .ring-wrap {
    display: grid; grid-template-columns: 148px 1fr; gap: 14px; align-items: center;
  }
  .ring { width: 148px; height: 148px; position: relative; }
  .ring svg { transform: rotate(-90deg); width: 148px; height: 148px; }
  .ring .center {
    position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
  }
  .ring .center .big { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
  .ring .center .lbl { color: var(--muted); font-size: 11px; margin-top: 4px; font-weight: 600; }
  .remain-box .k { color: var(--muted); font-size: 12px; font-weight: 600; margin-bottom: 4px; }
  .remain-box .v { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; }
  .remain-box .sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
  .macros {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px;
  }
  .macro {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 10px 8px 12px;
    text-align: center;
  }
  .macro .name { font-size: 11px; font-weight: 700; margin-bottom: 8px; }
  .macro .name.p { color: var(--protein); }
  .macro .name.c { color: var(--carbs); }
  .macro .name.f { color: var(--fat); }
  .macro .track {
    height: 6px; background: rgba(255,255,255,0.08); border-radius: 999px; overflow: hidden; margin-bottom: 8px;
  }
  .macro .fill { height: 100%; border-radius: 999px; }
  .macro .fill.p { background: var(--protein); width: 0%; }
  .macro .fill.c { background: var(--carbs); width: 0%; }
  .macro .fill.f { background: var(--fat); width: 0%; }
  .macro .fill.--over { background: var(--over); }
  .macro .nums { font-size: 12px; font-weight: 700; }
  .macro .nums span { color: var(--muted); font-weight: 500; }
  .macro .nums .excesso { font-style: normal; color: var(--over); font-weight: 800; }
  .macro .nums .faltou { font-style: normal; color: var(--protein); font-weight: 800; }
  .alert {
    margin-top: 12px;
    background: rgba(255,159,10,0.12);
    border: 1px solid rgba(255,159,10,0.28);
    color: #FFD60A;
    border-radius: 14px;
    padding: 10px 12px;
    font-size: 12px; font-weight: 600;
  }
  .section-title {
    font-size: 13px; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.08em;
    margin: 18px 4px 10px;
  }
  .meal {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 14px;
    margin-bottom: 12px;
  }
  .meal.suggest {
    background: linear-gradient(180deg, rgba(191,90,242,0.12), var(--surface));
    border: 1px dashed rgba(191,90,242,0.45);
  }
  .meal-head {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 8px; margin-bottom: 10px;
  }
  .meal-head h3 { font-size: 17px; font-weight: 700; }
  .meal-head .tot { font-size: 12px; color: var(--muted); font-weight: 600; }
  .meal-head .tot b { color: var(--kcal); }
  .meal.suggest .meal-head .tot b { color: var(--suggest); }
  .badge {
    display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: 0.04em;
    color: #E9D5FF; background: rgba(191,90,242,0.28);
    padding: 4px 8px; border-radius: 999px; margin-bottom: 8px;
  }
  .hint {
    color: var(--muted); font-size: 11px; font-weight: 500; margin-bottom: 8px; line-height: 1.35;
  }
  .proj {
    margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(191,90,242,0.35);
    font-size: 12px; color: #E9D5FF; font-weight: 600;
  }
  .food {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 10px; padding: 10px 0;
    border-top: 1px solid var(--line);
  }
  .food:first-of-type { border-top: none; padding-top: 2px; }
  .food .left { min-width: 0; }
  .food .name { font-size: 14px; font-weight: 600; line-height: 1.25; }
  .food .qty { color: var(--muted); font-size: 12px; margin-top: 2px; }
  .food .right { text-align: right; flex-shrink: 0; }
  .food .cal { color: var(--kcal); font-size: 13px; font-weight: 800; }
  .meal.suggest .food .cal { color: var(--suggest); }
  .chips { display: flex; gap: 6px; justify-content: flex-end; margin-top: 4px; flex-wrap: wrap; }
  .chip {
    font-size: 10px; font-weight: 800; padding: 3px 7px; border-radius: 999px;
  }
  .chip.p { background: rgba(10,132,255,0.18); color: #64D2FF; }
  .chip.c { background: rgba(255,159,10,0.18); color: #FFD60A; }
  .chip.f { background: rgba(48,209,88,0.18); color: #30D158; }
  .suggest-meal { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(191,90,242,0.22); }
  .suggest-meal:first-of-type { margin-top: 0; padding-top: 0; border-top: none; }
  .footer {
    text-align: center; color: var(--muted); font-size: 11px;
    margin-top: 8px; padding-bottom: 4px;
  }

  .nav { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:14px; }
  .nav a {
    font-size:12px; font-weight:700; text-decoration:none;
    padding:8px 12px; border-radius:999px;
    background:rgba(255,255,255,0.06); color:#64D2FF; border:1px solid var(--line);
  }
  .nav a.active { background:rgba(10,132,255,0.22); }
  .hist-list a {
    display:flex; justify-content:space-between; align-items:center;
    padding:14px; margin-bottom:10px; border-radius:18px;
    background:var(--surface); border:1px solid var(--line);
    text-decoration:none; color:var(--text);
  }
  .hist-list .d { font-weight:700; font-size:16px; }
  .hist-list .m { color:var(--muted); font-size:12px; margin-top:4px; }
  .hist-list .r { text-align:right; color:var(--kcal); font-weight:800; font-size:14px; }



  .stamp {
    text-align: center;
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.02em;
    margin: 0 0 10px;
    opacity: 0.85;
  }
  .stale-banner {
    display: none;
    background: rgba(255, 214, 10, 0.16);
    border: 1px solid rgba(255, 214, 10, 0.45);
    color: #FFD60A;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    margin: 0 0 12px;
    text-align: center;
  }
  .stale-banner.show { display: block; }
  .load-error {
    background: rgba(255,69,58,0.12);
    border: 1px solid rgba(255,69,58,0.35);
    color: #FF8A80;
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin: 12px 0;
    text-align: center;
  }


  .hist-list .m span { color: var(--muted); }
  .hist-list .m span.over { color: var(--over); }
  .hist-list .d.over { color: var(--over); }
  .hist-warn {
    display: none;
    background: rgba(255,159,10,0.10);
    border: 1px solid rgba(255,159,10,0.22);
    color: #C4B5A0;
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 12px;
  }
  .hist-warn:not([hidden]) { display: block; }
  .hist-warn div + div { margin-top: 4px; }
  .hist-summary {
    background: linear-gradient(180deg, var(--surface2), var(--surface));
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 16px 16px 14px;
    margin-bottom: 8px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.28);
  }
  .hist-summary-title {
    font-size: 13px; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.08em;
    margin-bottom: 10px;
  }
  .hist-summary-avgs {
    display: flex; flex-wrap: wrap; gap: 10px 14px;
    font-size: 14px; font-weight: 600;
  }
  .hist-summary-avgs b { font-weight: 800; }
  .hist-summary-meta {
    margin-top: 10px; font-size: 13px; font-weight: 600; color: #64D2FF;
  }
  .hist-summary-peso {
    margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--muted);
  }
  .hist-summary-empty, .hist-empty {
    color: var(--muted); font-size: 13px; font-weight: 600;
    padding: 8px 2px;
  }

  /* sugestão: cada refeição recolhida, toque abre */
  details.suggest-meal > summary { list-style: none; cursor: pointer; margin-bottom: 0; }
  details.suggest-meal > summary::-webkit-details-marker { display: none; }
  details.suggest-meal > summary h3::after {
    content: '›'; display: inline-block; margin-left: 8px; color: var(--muted);
    transition: transform .15s ease;
  }
  details.suggest-meal[open] > summary h3::after { transform: rotate(90deg); }
  details.suggest-meal .suggest-items { margin-top: 8px; }
  details.suggest-meal:first-of-type { margin-top: 4px; }

  .fibra-linha { margin-top: 10px; font-size: 12px; font-weight: 600; color: var(--muted); }
  .fibra-linha b { color: var(--text); }

  /* contador de alimento com limite diário (ex.: acém) */
  .limites { margin-top: 10px; }
  .limite { font-size: 12px; font-weight: 600; color: var(--muted); }
  .limite b { color: var(--text); }
  .limite.over, .limite.over b { color: var(--over); }

  /* card "Próxima refeição" dentro do hero */
  .next-meal {
    margin-top: 12px; padding: 12px 14px; border-radius: 16px;
    background: rgba(191,90,242,0.10); border: 1px dashed rgba(191,90,242,0.45);
  }
  .next-label { font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #E9D5FF; opacity: .85; }
  .next-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 4px; }
  .next-head b { font-size: 17px; }
  .next-head span { font-size: 12px; font-weight: 700; color: var(--suggest); white-space: nowrap; }
  .next-items { margin-top: 6px; font-size: 13px; line-height: 1.45; color: var(--text); }
  .next-items span { color: var(--muted); }

  /* card de peso (histórico) */
  .peso-card { margin-top: 12px; }
  .peso-now { margin-top: 6px; font-size: 15px; }
  .peso-now b { font-size: 22px; letter-spacing: -0.02em; }
  .peso-now span, .peso-delta { color: var(--muted); font-size: 12px; font-weight: 600; }
  .peso-delta { margin-top: 2px; }
  .pc-legend { display: flex; gap: 14px; margin-top: 10px; font-size: 11px; color: var(--muted); font-weight: 600; }
  .pc-legend span { display: inline-flex; align-items: center; gap: 6px; }
  .pc-k-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text); display: inline-block; }
  .pc-k-line { width: 14px; height: 2px; border-radius: 2px; background: var(--protein); display: inline-block; }
  .pc-tip { margin-top: 6px; font-size: 12px; color: var(--text); min-height: 16px; }
  .pc-svg { width: 100%; height: auto; display: block; margin-top: 4px; }
  .pc-grid { stroke: var(--line); stroke-width: 1; }
  .pc-ax { fill: var(--muted); font-size: 10px; }
  .pc-line { fill: none; stroke: var(--protein); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
  .pc-dot { fill: var(--text); stroke: var(--surface); stroke-width: 2; }
  .pc-hit { fill: transparent; cursor: pointer; }
  /* barras de calorias/proteína (Histórico): cores do app; laranja = kcal acima da meta */
  .bc-rot { margin-top: 10px; font-size: 11px; color: var(--muted); font-weight: 700; display: flex; align-items: center; gap: 6px; }
  .bc-kcal { fill: var(--kcal); }
  .bc-kcal.bc-over { fill: var(--over); }
  .bc-p { fill: var(--protein); }
  .bc-inc { opacity: .35; }   /* dia com registro parcial/não confirmado: fora das médias */
  .sem-reg { color: var(--muted); font-weight: 600; }
  .bc-k-over { width: 10px; height: 10px; border-radius: 3px; background: var(--over); display: inline-block; }
  .bc-k-meta { width: 14px; height: 0; border-top: 2px dashed #64D2FF; display: inline-block; opacity: .8; }
  #barrasCard[hidden] { display: none; }
  /* proteína por refeição (Histórico) */
  .pr-card[hidden] { display: none; }
  .pr-card { margin-bottom: 4px; }
  .pr-linha { display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; }
  .pr-nome { color: var(--muted); font-weight: 700; }
  .pr-trilho { height: 8px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; }
  .pr-barra { display: block; height: 100%; background: var(--protein); border-radius: 4px; }
  .pr-val { font-weight: 800; color: var(--text); white-space: nowrap; }
  .pr-val i { font-style: normal; color: var(--muted); font-weight: 600; margin-left: 4px; }

  .hist-summary-comp { margin-top: 6px; font-size: 12px; color: var(--muted); font-weight: 600; line-height: 1.4; }
  .hist-summary-vsmeta { margin-top: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
  /* resumo da semana para compartilhar */
  .btn-resumo { margin-top: 12px; }
  .resumo-texto { width: 100%; box-sizing: border-box; min-height: 220px; margin-top: 10px; padding: 10px; border-radius: 12px;
    border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 12px/1.45 ui-monospace, Menlo, monospace; resize: vertical; }
  .resumo-acoes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
  .resumo-acoes .btn-csv { flex: 1 1 auto; margin-top: 0; }
  .resumo-status { margin-top: 6px; font-size: 12px; color: var(--muted); min-height: 16px; }
  #resumoPainel[hidden] { display: none; }
  .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .hist-summary-vsmeta .hm-acima { color: var(--over); font-weight: 800; }
  .hist-summary-vsmeta .hm-falta { color: var(--protein); font-weight: 800; }

  .hist-list .d span.over { color: var(--over); }

  /* objetivo com data alvo */
  .obj-card {
    background: linear-gradient(180deg, rgba(10,132,255,0.14), var(--surface));
    border: 1px solid rgba(10,132,255,0.30); border-radius: 22px;
    padding: 14px 16px; margin-bottom: 14px;
  }
  .obj-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 700; }
  .obj-nome { color: #64D2FF; }
  .obj-data { color: var(--muted); white-space: nowrap; }
  .obj-big { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; margin-top: 4px; }
  .obj-bar { height: 6px; background: rgba(255,255,255,0.08); border-radius: 999px; overflow: hidden; margin: 8px 0 6px; }
  .obj-bar div { height: 100%; background: #64D2FF; border-radius: 999px; }
  .obj-line { font-size: 13px; line-height: 1.45; margin-top: 4px; }
  .obj-muted { color: var(--muted); font-size: 12px; }
  .obj-ok { color: var(--fat); font-weight: 700; }
  .obj-warn { color: var(--over); font-weight: 700; }
  .pc-meta { stroke: #64D2FF; stroke-width: 1.5; stroke-dasharray: 5 4; opacity: .7; }
  .pc-k-meta { width: 14px; height: 0; border-top: 2px dashed #64D2FF; display: inline-block; opacity: .8; }

  /* página Alimentos */
  .ali-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
    padding: 12px 14px; margin-bottom: 8px;
  }
  .ali-head { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
  .ali-head::-webkit-details-marker { display: none; }
  .ali-head b { font-size: 15px; }
  .ali-mac { flex-basis: 100%; font-size: 12px; color: var(--muted); font-weight: 600; }
  .ali-fonte, .ali-tag { font-size: 10px; font-weight: 800; padding: 3px 7px; border-radius: 999px; letter-spacing: 0.03em; }
  .ali-fonte.ok { color: #30D158; background: rgba(48,209,88,0.14); }
  .ali-fonte.mid { color: #64D2FF; background: rgba(100,210,255,0.14); }
  .ali-fonte.warn { color: var(--over); background: rgba(255,159,10,0.16); }
  .ali-fonte.novo { color: #E9D5FF; background: rgba(191,90,242,0.28); }
  .ali-tag { color: #E9D5FF; background: rgba(191,90,242,0.28); }
  .ali-itens { margin-top: 8px; font-size: 13px; line-height: 1.45; }
  .ali-itens span { color: var(--muted); }
  .ali-obs { margin-top: 6px; font-size: 11px; color: var(--muted); line-height: 1.4; }
  .ali-dens { flex-basis: 100%; font-size: 12px; color: var(--muted); font-weight: 600; }
  .ali-dens .v { color: var(--protein); font-weight: 800; }
  /* + Adicionar do rótulo (Hoje) */
  .add-card { margin: 4px 0 14px; border: 1px dashed rgba(100,210,255,0.35); border-radius: 18px; background: var(--surface); padding: 0 14px; }
  .add-card > summary { min-height: 48px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; cursor: pointer; list-style: none;
    font-weight: 800; color: #64D2FF; font-size: 15px; }
  .add-card > summary::-webkit-details-marker { display: none; }
  .add-card > summary span { font-weight: 600; color: var(--muted); font-size: 12px; }
  .add-corpo { padding-bottom: 14px; }
  .add-linha { display: flex; gap: 8px; flex-wrap: wrap; }
  .add-campo { display: flex; flex-direction: column; gap: 4px; flex: 1 1 90px; margin-top: 8px; font-size: 11px; font-weight: 700; color: var(--muted); }
  .add-nome { flex-basis: 100%; }
  .add-campo input, .add-campo select { min-height: 44px; box-sizing: border-box; width: 100%; padding: 8px 10px; border-radius: 12px;
    border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-size: 16px; font-weight: 600; }
  .add-macros .add-campo { flex: 1 1 60px; }
  .add-campo select { -webkit-appearance: none; appearance: none; padding-right: 30px;
    background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238E9BB3' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center; }
  .add-campo input[type="time"] { -webkit-appearance: none; appearance: none; }
  .add-modo { display: flex; gap: 6px; margin-top: 10px; }
  .add-modo button { flex: 1; min-height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--muted);
    font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
  .add-modo button[aria-pressed="true"] { color: #64D2FF; border-color: rgba(100,210,255,0.45); background: rgba(100,210,255,0.12); }
  .add-dica { margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.4; }
  .add-check { display: flex; gap: 8px; align-items: center; margin-top: 10px; font-size: 13px; color: var(--text); }
  .add-check input { width: 20px; height: 20px; }
  .add-check[hidden], #addPorcao[hidden], #addTexto[hidden] { display: none; }
  .add-res { margin-top: 10px; font-size: 13px; font-weight: 700; min-height: 18px; }
  .add-res.ok { color: var(--text); }
  .add-res.erro { color: var(--over); }
  .btn-csv:disabled { opacity: .45; cursor: default; }
  /* Refeições frequentes + aviso da noite (Hoje) */
  .freq-aviso { margin: 4px 0 12px; padding: 12px 14px; border-radius: 14px; background: rgba(100,210,255,0.10);
    border: 1px solid rgba(100,210,255,0.28); color: #BFEFFF; font-size: 13px; line-height: 1.45; }
  .freq-card { margin: 4px 0 12px; padding: 12px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
  .freq-tit { font-size: 13px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
  .freq-tit span { font-weight: 600; color: var(--muted); font-size: 12px; }
  .freq-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 48px; margin-top: 6px;
    padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(100,210,255,0.28); background: var(--bg); color: var(--text);
    font: inherit; font-size: 14px; font-weight: 700; text-align: left; cursor: pointer; }
  .freq-nome i { font-style: normal; color: var(--muted); font-weight: 600; }
  .freq-meta { font-size: 12px; color: var(--muted); font-weight: 600; }
  /* ↻ Repetir hoje (refeições lançadas) */
  .rep-acoes { display: flex; justify-content: flex-end; margin-top: 8px; }
  .rep-btn { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(100,210,255,0.35); background: transparent;
    color: #64D2FF; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
  .rep-painel { margin-top: 6px; }
  .rep-painel[hidden] { display: none; }
  /* Onde foram as calorias (página do dia) */
  .onde-col { margin-top: 10px; }
  .onde-t { font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
  .onde ol { list-style: none; margin: 4px 0 0; padding: 0; }
  .onde li { display: grid; grid-template-columns: 1fr auto 38px; gap: 8px; align-items: baseline; padding: 5px 0; border-top: 1px solid var(--line); font-size: 13px; }
  .onde li:first-child { border-top: none; }
  .onde li b { font-weight: 800; white-space: nowrap; }
  .onde li i { font-style: normal; color: var(--muted); font-size: 12px; text-align: right; }
  .onde li .st-dias { display: inline; font-size: 11px; text-align: left; margin-left: 4px; }
  #semTopCard { margin-top: 12px; }
  .ali-ordem { display: flex; gap: 6px; margin: 0 0 10px; }
  .ali-ordem button { flex: 1; min-height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
    color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
  .ali-ordem button[aria-pressed="true"] { color: #64D2FF; border-color: rgba(100,210,255,0.45); background: rgba(100,210,255,0.12); }
  .ali-plano { font-size: 12px; color: var(--muted); font-weight: 600; margin: 0 2px 8px; }
  .ali-plano b { color: var(--text); }

  /* botão da planilha (Histórico) */
  .btn-csv {
    display: block; width: 100%; margin: 8px 0 4px; padding: 12px 14px;
    border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,0.06);
    color: #64D2FF; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  }
  .btn-csv[hidden] { display: none; }
  a.btn-csv { text-align: center; text-decoration: none; }
  .peso-velho { color: #FFD60A; }
  .pc-dot.pc-est { fill: var(--surface); stroke: var(--text); stroke-width: 1.5; }
  .pc-k-est { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--text); display: inline-block; box-sizing: border-box; }
  /* check-in semanal */
  .ck-sem { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
  .hist-summary-title + .ck-sem { border-top: none; padding-top: 0; }
  .ck-head { font-size: 14px; }
  .ck-head span { color: var(--muted); font-size: 12px; font-weight: 600; }
  .ck-l { font-size: 13px; line-height: 1.45; margin-top: 3px; }
  .ck-m { color: var(--muted); font-size: 12px; }

  /* marcos de peso (card do objetivo) */
  .obj-marcos { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
  /* explicações do cálculo do objetivo: recolhidas por padrão (o essencial fica à vista) */
  .obj-mais { margin-top: 8px; border-top: 1px solid var(--line); }
  .obj-mais > summary { min-height: 44px; display: flex; align-items: center; gap: 6px; cursor: pointer;
    font-size: 13px; font-weight: 700; color: #64D2FF; list-style: none; }
  .obj-mais > summary::-webkit-details-marker { display: none; }
  .obj-mais > summary::before { content: '▸'; transition: transform .15s; }
  .obj-mais[open] > summary::before { transform: rotate(90deg); }
  .obj-mais[open] > summary { margin-bottom: 2px; }
  .marcos-chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 8px; }
  .marco { font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 999px; color: var(--muted); background: rgba(255,255,255,0.05); border: 1px solid var(--line); }
  .marco.ok { color: #30D158; background: rgba(48,209,88,0.14); border-color: rgba(48,209,88,0.35); }
  .marco.prox { color: var(--text); border-color: #64D2FF; }
  .marcos-bar > div { background: #30D158; }

  /* link do cartão de sugestão para o planejador */
  .plan-link {
    display: block; margin-top: 10px; min-height: 44px; line-height: 44px; text-align: center;
    border-radius: 12px; font-size: 14px; font-weight: 700; text-decoration: none;
    color: #F3E8FF; background: rgba(191,90,242,0.22); border: 1px solid rgba(191,90,242,0.45);
  }
