:root{
  --bg: #f6f3ee;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: rgba(17,24,39,.08);
  --shadow: 0 10px 28px rgba(17,24,39,.08);

  --brand: #2aa6a0;     /* teal like mock */
  --brand2:#2fb7b0;
  --accent:#ef6351;    /* coral heart */
  --radius: 18px;

  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font: 14px/1.35 system-ui,-apple-system,Segoe UI,Roboto,Arial;
  color: var(--ink);
  background: #eee; /* desktop backdrop */
}

/* Centered “phone” surface on desktop; full width on mobile */
.appShell{
  min-height: 100vh;
  background: var(--bg);
  max-width: 430px;            /* iPhone-ish */
  margin: 0 auto;
  border-left: 1px solid rgba(0,0,0,.04);
  border-right: 1px solid rgba(0,0,0,.04);
  position: relative;
  padding-bottom: calc(84px + var(--safe-bottom)); /* for tabbar */
}

/* Top bar */
.topbar{
  height: 64px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 10px 14px;
  background: rgba(255,255,255,.55);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
}

.brand{
  display:flex; align-items:center; gap:10px;
}
.brandLogo{
  height: 28px;
  width: auto;
  display:block;
}

.iconBtn{
  border:0;
  background: transparent;
  padding:10px;
  border-radius: 12px;
  cursor:pointer;
  color: #4b5563;
}
.iconBtn:active{ transform: translateY(1px); }

.bell{
  position:relative;
  display:inline-flex;
  width: 26px; height: 26px;
  align-items:center; justify-content:center;
}
.bell svg{ width: 24px; height: 24px; }
.dot{
  position:absolute;
  right: 2px; top: 2px;
  width: 9px; height: 9px;
  background: #ff4d4d;
  border: 2px solid rgba(255,255,255,.9);
  border-radius: 99px;
}

/* Content layout */
.content{
  padding: 14px 14px 0;
}

.card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.focusCard{
  padding: 14px 14px 16px;
  background: rgba(255,255,255,.65);
}
.focusKicker{
  font-weight: 700;
  color: #8b8796;
  letter-spacing:.2px;
  margin-bottom: 6px;
}
.focusRow{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.focusTitle{
  font-size: 28px;
  font-weight: 850;
  letter-spacing: -0.6px;
}
.focusSub{
  margin-top: 4px;
  color: var(--muted);
  font-size: 15px;
}
.focusIcon{
  font-size: 24px;
  filter: saturate(1.1);
}

.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.statCard{ padding: 14px; }

.cardTitle{
  font-weight: 800;
  color: #6b7280;
  margin-bottom: 8px;
}

.bigNumber{
  font-size: 40px;
  font-weight: 900;
  letter-spacing: -0.8px;
}
.numTight{ letter-spacing:-0.8px; }
.muted{ color: var(--muted); }
.mutedStrong{ color: #374151; font-weight: 800; }
.mutedCenter{ color: var(--muted); text-align:center; margin-top: 10px; }

.barRow{
  display:flex;
  align-items:center;
  gap: 10px;
  margin-top: 10px;
}
.bar{
  flex:1;
  height: 14px;
  border-radius: 999px;
  background: rgba(17,24,39,.08);
  overflow:hidden;
}
.barFill{
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand2));
  border-radius: 999px;
}
.barPct{
  width: 44px;
  text-align:right;
  font-weight: 800;
  color: #6b7280;
}

.pillNote{
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(17,24,39,.04);
  color: #6b7280;
  font-weight: 700;
}

/* Donut macros (CSS-only, scaffold) */
.donutWrap{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  height: 150px;
  margin-top: 4px;
}
.donut{
  width: 128px;
  height: 128px;
  border-radius: 999px;
  /* Rough ratio; you’ll compute real angles later */
  background:
    conic-gradient(
      #58b04b 0 34%,
      #f2a93b 34% 49%,
      #2aa6a0 49% 100%
    );
  position:relative;
  box-shadow: 0 10px 18px rgba(17,24,39,.08);
}
.donut:after{
  content:"";
  position:absolute;
  inset: 30px;
  background: var(--card);
  border-radius: 999px;
  border: 1px solid rgba(17,24,39,.06);
}

.donutLabels{
  position:absolute;
  inset:0;
  pointer-events:none;
  display:flex;
  align-items:center;
  justify-content:center;
}
.dl{
  position:absolute;
  width: 86px;
  text-align:center;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 1px 10px rgba(0,0,0,.18);
}
.dl span{ display:block; font-weight: 800; opacity:.95; }
.dl1{ left: -4px; top: 36px; }
.dl2{ right: -4px; top: 34px; }
.dl3{ bottom: 10px; left: 50%; transform: translateX(-50%); }

/* Health list */
.healthList{ display:flex; flex-direction:column; gap: 10px; margin-top: 6px; }
.hRow{
  display:grid;
  grid-template-columns: 28px 1fr auto;
  align-items:center;
  gap: 10px;
}
.hIcon{
  width: 28px; height: 28px;
  display:flex; align-items:center; justify-content:center;
  border-radius: 10px;
  background: rgba(17,24,39,.05);
  font-size: 16px;
}
.hIcon.heart{ background: rgba(239,99,81,.14); color: var(--accent); }
.hIcon.dna{ background: rgba(42,166,160,.14); color: var(--brand); }
.hIcon.flame{ background: rgba(242,169,59,.16); color: #d97706; }

.hLabel{ font-weight: 800; color: #374151; }
.hVal{ font-weight: 900; color: #111827; }
.unit{ font-weight: 800; color: #6b7280; margin-left: 3px; }

/* Meals */
.mealsCard{ margin-top: 12px; padding: 14px; }
.mealsHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}
.mealsTitle{ font-size: 20px; font-weight: 900; letter-spacing: -.3px; }
.mealsSub{ margin-top: 2px; color: var(--muted); font-weight: 700; font-style: italic; }

.chevBtn{
  border:0; background: transparent;
  color: #9ca3af;
  width: 38px; height: 38px;
  border-radius: 14px;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
}
.chevBtn svg{ width: 22px; height: 22px; }




.mealImg{
  height: 84px;
  background: linear-gradient(135deg, rgba(42,166,160,.25), rgba(242,169,59,.22));
}
.mealImg.ph1{ background: linear-gradient(135deg, rgba(42,166,160,.22), rgba(239,99,81,.14)); }
.mealImg.ph2{ background: linear-gradient(135deg, rgba(242,169,59,.20), rgba(42,166,160,.18)); }

.mealMeta{ padding: 10px 10px 12px; }
.mealName{ font-weight: 900; }
.mealTag{ color: var(--muted); font-weight: 750; font-size: 12px; margin-top: 2px; }

/* Views / routing */
.view{ display:none; }
.view.active{ display:block; }

.placeholder{ padding: 16px; margin-top: 12px; }

/* Tab bar */
.tabbar{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(430px, 100vw);
  padding: 10px 10px calc(10px + var(--safe-bottom));
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display:grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.tab{
  border:0;
  background: transparent;
  padding: 8px 6px;
  border-radius: 16px;
  cursor:pointer;
  color: #9ca3af;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap: 4px;
}
.tabIcon{
  width: 22px;
  height: 22px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.tabIcon svg{ width: 22px; height: 22px; }
.tabText{ font-size: 12px; font-weight: 800; }

.tab.active{
  color: #111827;
}
.tab.active .tabIcon{
  color: var(--brand);
}

.bottomSpacer{ height: 10px; }

/* Larger screens: keep it “phone-like” */
@media (min-width: 860px){
  body{ background: #f3f4f6; }
  .appShell{
    margin: 18px auto;
    border-radius: 26px;
    overflow:hidden;
    box-shadow: 0 30px 70px rgba(17,24,39,.18);
  }
  .tabbar{ bottom: 18px; border-radius: 22px; }
}
/* =========================
   iOS Picker Bottom Sheet
   ========================= */
.iosOverlay{
  position:fixed; inset:0;
  background: rgba(15,23,42,.35);
  display:flex;
  align-items:flex-end;
  justify-content:center;
  z-index: 9999;
  padding: 10px 10px calc(10px + var(--safe-bottom));
}

.iosSheet{
  width: min(430px, 100%);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
  border-radius: 22px;
  border: 1px solid rgba(17,24,39,.10);
  box-shadow: 0 30px 80px rgba(17,24,39,.25);
  overflow:hidden;
  transform: translateY(0);
  animation: sheetUp .18s ease-out;
}
.iosOverlay.closing .iosSheet{
  animation: sheetDown .18s ease-in forwards;
}
@keyframes sheetUp{ from{ transform: translateY(14px); opacity:.6 } to{ transform: translateY(0); opacity:1 } }
@keyframes sheetDown{ from{ transform: translateY(0); opacity:1 } to{ transform: translateY(14px); opacity:0 } }

.iosSheetTop{
  display:grid;
  grid-template-columns: 1fr auto 1fr;
  align-items:center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(17,24,39,.08);
}
.iosTitle{ font-weight: 900; letter-spacing:-.2px; color:#111827; }
.iosBtn{
  justify-self:end;
  border:0;
  background: linear-gradient(90deg, var(--brand), var(--brand2));
  color:#fff;
  font-weight: 900;
  padding: 8px 12px;
  border-radius: 12px;
  cursor:pointer;
}
.iosBtn.ghost{
  justify-self:start;
  background: transparent;
  color:#6b7280;
  border: 1px solid rgba(17,24,39,.12);
}

/* Wheel geometry — keep these in sync with rowH in js/iosPicker.js.
   Viewport = 5 rows (220px); top/bottom padding = (viewport - 1 row)/2 = 88px,
   so scrollTop = index*44 lands the chosen row dead-center in the highlight band. */
.iosWheelWrap{
  position:relative;
  height: 220px;        /* 5 * 44 */
  padding: 0;
}
.iosWheel{
  height: 100%;
  overflow-y:auto;
  padding: 88px 0;      /* (220 - 44) / 2 — centers row 0 at scrollTop 0 */
  scrollbar-width: none;
  scroll-snap-type: y mandatory;        /* native, tight snapping */
  -webkit-overflow-scrolling: touch;    /* momentum on iOS */
  overscroll-behavior: contain;         /* don't scroll the page behind it */
}
.iosWheel::-webkit-scrollbar{ display:none; }

.iosItem{
  height: 44px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 900;
  font-size: 19px;
  color:#9aa0aa;
  letter-spacing:-.2px;
  scroll-snap-align: center;            /* each row is a snap target */
  transition: color .15s ease, transform .15s ease, opacity .15s ease;
}
.iosItem.active{
  color:#111827;
  transform: scale(1.08);
}

.iosWheelMask{
  position:absolute;
  left:0; right:0;
  top: 50%;
  transform: translateY(-50%);
  height: 44px;
  border-top: 1px solid rgba(17,24,39,.12);
  border-bottom: 1px solid rgba(17,24,39,.12);
  background: rgba(42,166,160,.06);
  pointer-events:none;
}
.iosWheelWrap:before,
.iosWheelWrap:after{
  content:"";
  position:absolute; left:0; right:0;
  height: 88px;
  z-index: 2;
  pointer-events:none;
}
.iosWheelWrap:before{
  top:0;
  background: linear-gradient(to bottom, rgba(255,255,255,.95), rgba(255,255,255,0));
}
.iosWheelWrap:after{
  bottom:0;
  background: linear-gradient(to top, rgba(255,255,255,.95), rgba(255,255,255,0));
}

/* Wizard visuals */
.wizCard{ padding: 16px; }
.wizKicker{ font-weight:900; color:#8b8796; }
.wizTitle{ font-size:22px; font-weight:950; letter-spacing:-.3px; margin-top:6px; }
.wizSub{ color:var(--muted); font-weight:700; margin-top:6px; }

.wizProgress{
  display:flex; gap:6px; margin-top:12px;
}
.wizDot{
  width: 8px; height: 8px; border-radius: 999px;
  background: rgba(17,24,39,.12);
}
.wizDot.on{ background: linear-gradient(90deg, var(--brand), var(--brand2)); }

.tapField{
  margin-top: 14px;
  border: 1px solid rgba(17,24,39,.10);
  background: rgba(255,255,255,.9);
  border-radius: 16px;
  padding: 12px 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  cursor:pointer;
}
.tapField .label{ font-weight:900; color:#6b7280; font-size:12px; }
.tapField .value{ font-weight:950; font-size:18px; letter-spacing:-.2px; }
.tapField .chev{ color:#9ca3af; }

.wizNav{
  display:flex;
  gap:10px;
  margin-top: 16px;
}
.wizBtn{
  border:0;
  border-radius: 16px;
  padding: 12px 14px;
  font-weight: 950;
  cursor:pointer;
  flex:1;
}
.wizBtn.primary{
  background: linear-gradient(90deg, var(--brand), var(--brand2));
  color:#fff;
}
.wizBtn.secondary{
  background: rgba(17,24,39,.06);
  color:#111827;
}
.wizBtn:disabled{ opacity:.55; cursor:not-allowed; } 
/* Pills / chips */
.pillRow{ display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.pill{
  display:inline-flex; align-items:center; gap:8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(17,24,39,.10);
  background: rgba(255,255,255,.9);
  font-weight: 900;
}
.pill .x{
  width: 20px; height: 20px;
  border-radius: 999px;
  display:flex; align-items:center; justify-content:center;
  background: rgba(17,24,39,.06);
  color:#6b7280;
  cursor:pointer;
  user-select:none;
}
.pillAdd{
  display:inline-flex; align-items:center; justify-content:center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px dashed rgba(17,24,39,.18);
  background: rgba(17,24,39,.03);
  font-weight: 950;
  color:#111827;
  cursor:pointer;
}
.pillHint{ color: var(--muted); font-weight:800; margin-top:8px; }
/* Topbar avatar */
.avatarBtn{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(17,24,39,.10);
  background: rgba(255,255,255,.9);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 950;
  letter-spacing: -.2px;
  color:#0f172a;
  cursor:pointer;
}
.avatarBtn:active{ transform: scale(.98); }

/* small popover menu */
.menuOverlay{
  position:fixed; inset:0;
  background: transparent;
  z-index: 9999;
}
.menuCard{
  position:fixed;
  top: 56px; /* just below topbar */
  right: 14px;
  width: 220px;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(17,24,39,.10);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(17,24,39,.18);
  overflow:hidden;
}
.menuHead{
  padding: 10px 12px;
  border-bottom: 1px solid rgba(17,24,39,.08);
}
.menuEmail{
  font-weight: 900;
  color:#111827;
  font-size: 12px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.menuItem{
  width:100%;
  border:0;
  background: transparent;
  padding: 12px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  cursor:pointer;
  font-weight: 950;
}
.menuItem:hover{ background: rgba(17,24,39,.04); }
.menuDanger{ color:#b91c1c; }
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 10px 14px;
}

.topbar .right{
  display:flex;
  align-items:center;
  gap: 10px;
}

/* Make icon buttons consistent */
.iconBtn{
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(17,24,39,.08);
  background: rgba(255,255,255,.8);
  display:flex;
  align-items:center;
  justify-content:center;
}

/* Fix bell sizing */
.iconBtn .bell svg{
  width: 20px;
  height: 20px;
}

/* Better Gmail-style avatar */
.avatarBtn{
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(135deg, rgba(42,166,160,.20), rgba(37,99,235,.18));
  color:#0f172a;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 950;
  letter-spacing: -.2px;
  box-shadow: inset 0 0 0 1px rgba(17,24,39,.08);
}

.avatarBtn:active{ transform: scale(.98); }
/* Labs */
#labsHelpBtn{
  font-weight: 950;
  color: #9ca3af;
}
#labsHelpBtn:active{ transform: translateY(1px); }
/* Labs sheet controls */
.labsForm{ padding: 12px 14px 16px; }
.labsField{ margin-top: 10px; }
.labsLabel{ font-weight: 900; color:#6b7280; font-size:12px; margin-bottom:6px; }

.labsControl{
  width: 100%;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(17,24,39,.12);
  background: rgba(255,255,255,.92);
  padding: 0 12px;
  font-weight: 850;
  color: #111827;
  outline: none;
}
.labsControl:focus{
  border-color: rgba(42,166,160,.55);
  box-shadow: 0 0 0 4px rgba(42,166,160,.14);
}
/* Labs action tiles (Add / Upload) */
.labsActions{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
  margin-top:12px;
}

.labsAction{
  width:100%;
  text-align:left;
  border:1px solid rgba(17,24,39,.10);
  background: rgba(255,255,255,.85);
  border-radius:16px;
  padding:12px 12px;
  display:flex;
  align-items:center;
  gap:10px;
  cursor:pointer;
  transition: transform .08s ease, box-shadow .15s ease, border-color .15s ease;
}

.labsAction:active{ transform: translateY(1px); }

.labsActionIcon{
  width:36px; height:36px;
  border-radius:12px;
  display:grid; place-items:center;
  font-weight:950;
  background: rgba(42,166,160,.14);
  color: rgba(17,24,39,.85);
  flex:0 0 auto;
}

.labsActionText{ min-width:0; flex:1; }
.labsActionLabel{ font-weight:950; }
.labsActionSub{
  margin-top:2px;
  font-size:12px;
  color:#6b7280;
  font-weight:750;
  line-height:1.25;
}

.labsActionChev{
  color:#9ca3af;
  font-size:18px;
  font-weight:950;
  flex:0 0 auto;
}

.labsAction.ghost{
  background: rgba(255,255,255,.55);
  color:#6b7280;
}
.labsAction.ghost .labsActionIcon{
  background: rgba(148,163,184,.18);
  color:#6b7280;
}
.labsAction[disabled]{
  opacity:.75;
  cursor:not-allowed;
}
@media (max-width: 420px){
  .labsActions{ grid-template-columns: 1fr; }
}
.labBadge{
  display:inline-block;
  padding:3px 8px;
  border-radius:999px;
  font-size:11px;
  font-weight:950;
  margin-right:8px;
  border:1px solid rgba(17,24,39,.08);
  background: rgba(255,255,255,.75);
  color:#111827;
}
.labBadge.optimal{ background: rgba(34,197,94,.14); }
.labBadge.borderline{ background: rgba(245,158,11,.16); }
.labBadge.high{ background: rgba(239,68,68,.14); }
.labBadge.low{ background: rgba(59,130,246,.14); }
/* Premium alignment for lab rows */
.labRow{
  align-items:center;
  gap:12px;
}
.labMain{
  min-width:0;
  flex:1;
}
.labRight{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  justify-content:center;
  gap:6px;
  min-width: 110px;      /* keeps right side consistent */
}
.labBadgeWrap{
  height: 22px;          /* reserves space so rows align even if no badge */
  display:flex;
  align-items:center;
}
.labValue{
  font-weight:950;
  color:#111827;
  white-space:nowrap;
}
.labValue .unit{
  margin-left:6px;
  font-weight:850;
  color:#6b7280;
}
.labsRanges{
  margin-top:10px;
  border:1px solid rgba(17,24,39,.08);
  background: rgba(255,255,255,.55);
  border-radius:14px;
  padding:10px 12px;
}
.labsRanges summary{
  cursor:pointer;
  font-weight:950;
  color:#374151;
  list-style:none;
}
.labsRanges summary::-webkit-details-marker{ display:none; }
.labsRanges summary:after{
  content:"›";
  float:right;
  color:#9ca3af;
  font-size:18px;
  transform: translateY(-1px);
}
.labsRanges[open] summary:after{
  content:"⌄";
}
.labsRangesBody{
  margin-top:10px;
}
.labRange{
  font-weight: 800;
  color:#6b7280;
  font-size: 12px;
  margin-left: 6px;
  white-space: nowrap;
}
/* Donut animation */
.donut{
  width:88px; height:88px; border-radius:999px;
  position:relative;
  box-shadow: inset 0 0 0 10px rgba(255,255,255,.85);
  transform: scale(.98);
  opacity: 0;
  animation: donutIn 420ms cubic-bezier(.2,.9,.2,1) forwards;
}

@keyframes donutIn{
  from{ opacity:0; transform:scale(.96) rotate(-35deg); filter: blur(2px); }
  to  { opacity:1; transform:scale(1)   rotate(0deg);  filter: blur(0); }
}

/* “Changed” pulse (we’ll toggle .is-updating in JS) */
.donut.is-updating{
  animation: donutUpdate 480ms cubic-bezier(.2,.9,.2,1);
}
@keyframes donutUpdate{
  0%   { transform: scale(1) rotate(0deg); }
  40%  { transform: scale(1.04) rotate(6deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* Optional: bars animate width */
.macroBarFill{
  width:0%;
  animation: barFill 520ms cubic-bezier(.2,.9,.2,1) forwards;
}
@keyframes barFill{
  from{ width:0%; }
  to  { width: var(--w); }
}
/* Full-width macro bar animation */
.macroFill{
  width: 0%;
  transition: width 650ms cubic-bezier(.2,.9,.2,1);
  will-change: width;
}

/* When we toggle this class, bars animate to their target widths */
.macroTrack.is-anim .macroFill{
  width: var(--w);
}

/* Optional: subtle “sheen” feel */
.macroTrack{
  position: relative;
}

.macroTrack.is-anim::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(90deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,.35) 50%,
    rgba(255,255,255,0) 100%
  );
  transform: translateX(-120%);
  animation: macroSheen 900ms cubic-bezier(.2,.9,.2,1) 1;
  pointer-events:none;
  mix-blend-mode: overlay;
}

@keyframes macroSheen{
  to{ transform: translateX(120%); }
}
.macroPreviewIn{
  opacity:0;
  transform: translateY(6px);
  animation: macroIn 260ms cubic-bezier(.2,.9,.2,1) forwards;
}
@keyframes macroIn{
  to{ opacity:1; transform: translateY(0); }
}
/* =========================================
   Filters (chips)
   ========================================= */
.recipeFilters{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:12px;
}

.chip{
  padding:6px 12px;
  border-radius:999px;
  border:1px solid var(--line,#e2e8f0);
  background:#fff;
  font-size:12px;
  font-weight:800;
  cursor:pointer;
}

.chip.active{
  background:#2563eb;
  color:#fff;
  border-color:#2563eb;
}

/* =========================================
   MEALS GRID (your actual UI)
   - fixed 2-col grid, equal cards, no masonry
   ========================================= */
.mealGrid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:16px;
  align-items:stretch;

  /* kill any accidental masonry/columns */
  columns: unset;
  column-count: unset;
  column-gap: unset;
}

/* On very narrow phones, 1 column */
@media (max-width: 420px){
  .mealGrid{ grid-template-columns: 1fr; }
}

/* Optional: on large screens, 3 columns */
@media (min-width: 1100px){
  .mealGrid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* =========================================
   Meal Tile (premium card)
   ========================================= */
.mealTile{
  background: var(--card, #fff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 0;

  box-shadow: 0 10px 26px rgba(0,0,0,.06);
  transition: transform .15s ease, box-shadow .15s ease;
}

.mealTile:hover{
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(0,0,0,.10);
}

/* Image area */
.mealMedia{
  position: relative;
}

.mealMedia img{
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}

.mealImgPh{
  width: 100%;
  height: 150px;
  background: rgba(17,24,39,.06);
}

/* Match badge */
.matchBadge{
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  background: rgba(15,23,42,.85);
  color: #fff;
  backdrop-filter: blur(6px);
}

/* Body */
.mealBody{
  padding: 12px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mealTitle{
  font-weight: 950;
  font-size: 14px;
  line-height: 1.15;
}

/* Macro line */
.mealMacros{
  font-size: 12px;
  color: var(--muted, #475569);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.mealMacros b{ color: var(--ink, #0f172a); }
.mealMacros .dot{ opacity: .6; }

/* Chips */
.mealChips{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mealChip{
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.55);
  background: rgba(148,163,184,.12);
  color: rgba(30,41,59,1);
}

.mealChip.signal{
  border-color: rgba(37,99,235,.35);
  background: rgba(37,99,235,.10);
  color: rgba(30,64,175,1);
}

/* Actions */
.mealActions{
  margin-top: 2px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mealActions .wizBtn{
  width: 100%;
  justify-content: center;
}
















.recipeChip{
  font-size:11px;
  padding:3px 8px;
  border-radius:999px;
  background:rgba(37,99,235,.10);
  color:#1e40af;
  border:1px solid rgba(37,99,235,.18);
}

.recipeChip.keto{
  background:rgba(34,197,94,.12);
  color:#166534;
}
/* ================================
   Filters (chips)
   ================================ */
.recipeFilters{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:12px;
}

.chip{
  padding:6px 12px;
  border-radius:999px;
  border:1px solid var(--line,#e2e8f0);
  background:#fff;
  font-size:12px;
  font-weight:800;
  cursor:pointer;
}

.chip.active{
  background:#2563eb;
  color:#fff;
  border-color:#2563eb;
}

/* ================================
   MEALS GRID — REAL GRID (2 cols)
   ================================ */
.mealGrid{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap:16px;
}

/* Mobile: 1 column */
@media (max-width: 500px){
  .mealGrid{
    grid-template-columns: 1fr;
  }
}

/* Desktop: optional 3 columns */
@media (min-width: 1200px){
  .mealGrid{
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ================================
   Meal Tile (card)
   ================================ */
.mealTile{
  background: var(--card, #fff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 16px;
  overflow: hidden;
  display:flex;
  flex-direction:column;
  height:100%;
  box-shadow: 0 8px 22px rgba(0,0,0,.06);
  transition: .15s ease;
}

.mealTile:hover{
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(0,0,0,.10);
}

/* Image */
.mealMedia img{
  width:100%;
  height:150px;
  object-fit:cover;
  display:block;
}

.mealImgPh{
  width:100%;
  height:150px;
  background:#f1f5f9;
}

/* Body */
.mealBody{
  padding:12px 14px 14px;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.mealTitle{
  font-weight:900;
  font-size:14px;
  line-height:1.2;
}

/* Macros */
.mealMacros{
  font-size:12px;
  color:var(--muted,#475569);
  display:flex;
  gap:6px;
  flex-wrap:wrap;
}

.mealMacros b{
  color:var(--ink,#0f172a);
}

/* Chips */
.mealChips{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
}

.mealChip{
  font-size:11px;
  padding:3px 8px;
  border-radius:999px;
  background:rgba(37,99,235,.08);
  border:1px solid rgba(37,99,235,.18);
  color:#1e40af;
}

/* Buttons */
.mealActions{
  margin-top:auto;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}
.mealLink{
  display:block;
  color:inherit;
  text-decoration:none;
}
#authArea {
  display: flex;
  align-items: center;
  margin-right: 6px;
}
.avatarBtn.isSignedOut{
  opacity: .75;
}
/* Auth sheet (mobile-style) */
.authOverlay{
  position:fixed; inset:0;
  background: rgba(15,23,42,.45);
  display:flex; align-items:flex-end; justify-content:center;
  padding: 14px;
  z-index: 9999;
}

.authSheet{
  width: min(520px, 100%);
  background: var(--card, #fff);
  color: var(--ink, #0f172a);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  overflow:hidden;
  transform: translateY(12px);
  animation: sheetIn .18s ease-out forwards;
}

@keyframes sheetIn { to { transform: translateY(0); } }

.authGrip{
  width: 44px; height: 5px;
  background: rgba(100,116,139,.35);
  border-radius: 999px;
  margin: 10px auto 6px;
}

.authHead{
  padding: 10px 16px 8px;
  display:flex; align-items:flex-start; justify-content:space-between;
  gap: 10px;
}

.authTitle{
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -.02em;
  margin: 2px 0 2px;
}
.authSub{
  font-size: 13px;
  color: var(--muted, #475569);
}

.authClose{
  border:0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  padding: 6px 8px;
  cursor:pointer;
  color: var(--muted, #475569);
}

.authBody{
  padding: 10px 16px 14px;
  display:grid;
  gap: 10px;
}

.authField{
  display:grid;
  gap: 6px;
}

.authLabel{
  font-size: 12px;
  color: var(--muted, #475569);
  font-weight: 700;
}

.authInputWrap{
  position: relative;
}

.authInput{
  width:100%;
  padding: 12px 12px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 12px;
  font-size: 16px; /* ✅ iOS: prevents zoom */
  outline: none;
  background: #fff;
}

.authInput:focus{
  border-color: rgba(37,99,235,.55);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

.authTogglePwd{
  position:absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: rgba(15,23,42,.06);
  color: var(--ink, #0f172a);
  border-radius: 10px;
  padding: 6px 10px;
  font-weight: 800;
  cursor: pointer;
}

.authErr{
  display:none;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(239,68,68,.08);
  color: #b91c1c;
  font-size: 13px;
  font-weight: 650;
}

.authActions{
  display:grid;
  gap: 10px;
  margin-top: 4px;
}

.authBtn{
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line, #e2e8f0);
  font-weight: 850;
  font-size: 15px;
  cursor: pointer;
}

.authBtnPrimary{
  background: var(--brand, #2563eb);
  border-color: transparent;
  color: #fff;
}

.authBtnGhost{
  background: transparent;
  color: var(--ink, #0f172a);
}

.authRow{
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 10px;
  margin-top: 2px;
}

.authLink{
  border: 0;
  background: transparent;
  color: var(--brand, #2563eb);
  font-weight: 850;
  cursor:pointer;
  padding: 6px 0;
}

.authSmall{
  font-size: 12px;
  color: var(--muted, #475569);
  line-height: 1.3;
}
.avatarBtn.isSignedOut{ opacity:.8; }
