:root {
  --cream: #fbf6ec;
  --cream-2: #f6ecd9;
  --paper: #ffffff;
  --ink: #2a211c;
  --muted: #7a6d63;
  --line: #eadfcd;
  --tomato: #c8361f;
  --tomato-dark: #a52a17;
  --basil: #2f6b3a;
  --basil-soft: #e4efe3;
  --gold: #e9a23b;
  --radius: 20px;
  --shadow: 0 1px 2px rgba(60, 35, 20, 0.06), 0 8px 24px rgba(60, 35, 20, 0.08);
  --shadow-lg: 0 2px 4px rgba(60, 35, 20, 0.08), 0 18px 40px rgba(60, 35, 20, 0.16);
  --cal: #c8361f;
  --pro: #2f6b3a;
  --carb: #d48a1f;
  --fat: #7a5cc4;
  --sug: #d1477a;
  --check: repeating-conic-gradient(var(--tomato) 0 25%, #fff 0 50%) 0 0 / 28px 28px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 16px/1.5 Inter, system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}
h1, h2, h3, .brand { font-family: Fraunces, Georgia, serif; letter-spacing: -0.015em; }
button { font: inherit; cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; }

.flag { display: flex; height: 5px; }
.flag.thin { height: 3px; width: 72px; margin: 0 auto 12px; border-radius: 3px; overflow: hidden; }
.flag span { flex: 1; }
.flag span:nth-child(1) { background: var(--basil); }
.flag span:nth-child(2) { background: #fff; }
.flag span:nth-child(3) { background: var(--tomato); }

.top {
  max-width: 1080px; margin: 0 auto; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 1.5rem; font-weight: 800; color: var(--tomato); text-decoration: none; }
.brand img { border-radius: 8px; }
.brand em { color: var(--basil); font-style: italic; }
.scans { font-size: 0.8rem; color: var(--muted); background: var(--paper); border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.scans.pro { background: var(--gold); border-color: var(--gold); color: #3b2500; font-weight: 700; }

main { max-width: 1080px; margin: 0 auto; padding: 0 16px 24px; }
#screen-results, #screen-loading { max-width: 560px; margin: 0 auto; }

/* ---------- Hero ---------- */
.hero { display: grid; gap: 28px; align-items: center; padding: 12px 0 28px; }
.eyebrow { display: inline-block; margin: 0 0 12px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--basil); background: var(--basil-soft); padding: 5px 10px; border-radius: 999px; }
.hero h1 { font-size: clamp(2.3rem, 9vw, 3.9rem); line-height: 1.02; margin: 0 0 14px; font-weight: 800; }
.hero h1 em { color: var(--tomato); }
.lede { font-size: 1.08rem; color: #4d4038; margin: 0 0 22px; max-width: 34ch; }
.hero-ctas { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-ctas .btn { width: auto; flex: 1 1 180px; text-align: center; text-decoration: none; }
.trust { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.86rem; color: var(--muted); font-weight: 600; }

.hero-art { position: relative; display: grid; justify-items: center; gap: 0; }
.marco-wrap { position: relative; display: flex; align-items: flex-start; gap: 6px; width: 100%; max-width: 380px; }
.marco-big { width: 120px; height: 120px; flex: none; filter: drop-shadow(0 8px 18px rgba(60, 35, 20, .18)); animation: bob 3.2s ease-in-out infinite; }
.bubble {
  background: var(--paper); border-radius: 18px 18px 18px 4px; padding: 12px 14px; box-shadow: var(--shadow);
  font-size: 0.92rem; font-weight: 500; margin-top: 8px;
}
.pop { animation: pop .5s .3s both cubic-bezier(.2, 1.4, .4, 1); }
.preview-card {
  width: 100%; max-width: 380px; margin-top: -6px;
  background: var(--paper); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-lg);
  transform: rotate(-1.2deg); border-top: 6px solid transparent; border-image: var(--check) 6;
}
.preview-kicker { margin: 0; font-size: 0.72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--tomato); }
.preview-card h3 { margin: 2px 0 12px; font-size: 1.4rem; }
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 70px 44px 1fr; align-items: center; gap: 8px; font-size: 0.82rem; }
.bar span { color: var(--muted); font-weight: 600; }
.bar b { text-align: right; font-variant-numeric: tabular-nums; }
.bar i { height: 8px; border-radius: 99px; background: var(--cream-2); position: relative; overflow: hidden; }
.bar i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--c); border-radius: 99px; animation: grow 1s .4s both ease-out; }
.preview-foot { margin: 12px 0 0; font-size: 0.8rem; color: var(--muted); }

@keyframes bob { 50% { transform: translateY(-6px) rotate(-2deg); } }
@keyframes pop { from { opacity: 0; transform: scale(.8) translateY(6px); } }
@keyframes grow { from { width: 0; } }

.tablecloth { height: 28px; background: var(--check); opacity: .9; border-radius: 6px; margin: 4px 0 30px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.06); }

/* ---------- Scan card ---------- */
.scan-card { max-width: 640px; margin: 0 auto 40px; scroll-margin-top: 16px; }
.scan-head { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.scan-head img { flex: none; }
.scan-head h2 { margin: 0; font-size: 1.4rem; }
.scan-head p { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; }
.slots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.slot {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 140px; padding: 14px; text-align: center;
  background: var(--cream); border: 2px dashed #e0cfb4; border-radius: 16px;
  cursor: pointer; transition: border-color .15s, transform .1s, background .15s;
}
.slot:hover { border-color: var(--tomato); background: #fff; }
.slot:active { transform: scale(0.98); }
.slot-icon { font-size: 2.4rem; }
.slot-title { font-weight: 700; }
.slot-sub { font-size: 0.75rem; color: var(--muted); }

.thumbs { list-style: none; padding: 0; margin: 14px 0 0; display: flex; gap: 10px; flex-wrap: wrap; }
.thumbs:empty { display: none; }
.thumbs li { position: relative; }
.thumbs img { width: 78px; height: 78px; object-fit: cover; border-radius: 12px; display: block; box-shadow: var(--shadow); }
.thumbs .tag { position: absolute; left: 4px; bottom: 4px; font-size: 0.65rem; background: rgba(0,0,0,.6); color: #fff; padding: 1px 6px; border-radius: 6px; }
.thumbs .x { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; font-size: 0.75rem; }

/* ---------- Buttons ---------- */
.btn { display: block; width: 100%; border: 0; border-radius: 14px; padding: 14px 18px; font-weight: 700; font-size: 1rem; }
.btn.big { font-size: 1.05rem; padding: 16px 18px; margin-top: 16px; }
.btn.primary { background: var(--tomato); color: #fff; box-shadow: 0 4px 0 var(--tomato-dark); transition: transform .08s, box-shadow .08s; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.primary:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--tomato-dark); }
.btn.primary:disabled { background: #d9c9bb; box-shadow: none; cursor: not-allowed; filter: none; }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--ink); }
.btn.ghost:hover { background: var(--ink); color: #fff; }
.btn.secondary { background: var(--paper); color: var(--ink); border: 2px solid var(--line); }
.btn.link { background: none; color: var(--basil); text-decoration: underline; font-weight: 600; margin-top: 8px; }
.fine { color: var(--muted); font-size: 0.8rem; text-align: center; margin: 10px 0; }

/* ---------- Landing sections ---------- */
.section-title { font-size: clamp(1.6rem, 5vw, 2.2rem); margin: 0 0 8px; }
.section-sub { color: var(--muted); margin: 0 0 18px; }
.how, .pricing, .faq { max-width: 880px; margin: 0 auto 44px; text-align: center; }
.steps-grid { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 14px; text-align: left; }
.steps-grid li { background: var(--paper); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.steps-grid h3 { margin: 6px 0 4px; font-size: 1.2rem; }
.steps-grid p { margin: 0; color: #5a4c43; font-size: 0.93rem; }
.num { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--tomato); color: #fff; font-weight: 800; }

.feature { max-width: 880px; margin: 0 auto 44px; display: grid; gap: 18px; align-items: center; padding: 22px; }
.feature p { color: #5a4c43; margin: 0 0 14px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.mini-items { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.mini-items li { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: 10px; background: var(--cream); border-radius: 14px; padding: 10px 12px; }
.mini-items span { grid-row: span 2; font-size: 1.8rem; display: grid; place-items: center; }
.mini-items small { color: var(--muted); }

.price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 520px; margin: 0 auto; }
.price { position: relative; padding: 22px 14px; margin: 0; }
.price h3 { margin: 0; font-size: 1.1rem; }
.price.best { border: 2px solid var(--tomato); }
.amount-big { font-family: Fraunces, Georgia, serif; font-size: 2rem; font-weight: 800; margin: 6px 0 2px; }
.amount-big small { font-size: 0.9rem; color: var(--muted); font-family: Inter, sans-serif; font-weight: 600; }
.muted { color: var(--muted); margin: 0; font-size: 0.88rem; }
.tag { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); background: var(--tomato); color: #fff; font-size: 0.7rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }

.faq { text-align: left; max-width: 680px; }
.faq .section-title { text-align: center; }
.faq details { background: var(--paper); border-radius: 14px; padding: 4px 16px; margin-bottom: 10px; box-shadow: var(--shadow); border-top: 0; }
.faq summary { padding: 12px 0; }
.faq p { margin: 0 0 14px; color: #5a4c43; }

/* ---------- Loading ---------- */
.loading { text-align: center; padding: 60px 10px; }
.marco-think { animation: bob 1.4s ease-in-out infinite; filter: drop-shadow(0 8px 18px rgba(60,35,20,.18)); }
.quip { font-family: Fraunces, Georgia, serif; font-size: 1.35rem; font-weight: 600; min-height: 3.6em; margin: 16px 0 4px; }
.dots { display: flex; gap: 6px; justify-content: center; }
.dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--tomato); animation: blink 1s infinite; }
.dots span:nth-child(2) { animation-delay: .15s; background: #fff; border: 1.5px solid var(--line); }
.dots span:nth-child(3) { animation-delay: .3s; background: var(--basil); }
@keyframes blink { 50% { opacity: .25; transform: translateY(-3px); } }

/* ---------- Results ---------- */
.demo-banner { background: #fff4d6; border: 1px solid #f1d58a; color: #6b5313; border-radius: 12px; padding: 10px 12px; font-size: 0.85rem; margin-bottom: 12px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--paper); border-radius: 14px; padding: 4px; box-shadow: var(--shadow); margin-bottom: 12px; }
.tab { border: 0; background: none; padding: 10px; border-radius: 10px; font-weight: 700; color: var(--muted); }
.tab.active { background: var(--tomato); color: #fff; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1.5px solid var(--line); background: var(--paper); border-radius: 999px; padding: 7px 12px; font-size: 0.85rem; font-weight: 600; color: var(--ink); }
.chip.active { border-color: var(--basil); background: var(--basil-soft); color: var(--basil); }
.chip.static { cursor: default; }

.fit-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.fit-form label { font-size: 0.78rem; color: var(--muted); font-weight: 600; display: grid; gap: 4px; }
.fit-form input, .amount input {
  width: 100%; font: inherit; font-size: 16px; padding: 9px 10px;
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink);
}

.card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }

.meal { padding: 0; overflow: hidden; }
.meal-head { background: linear-gradient(135deg, #fff3e3, #fde3d6); padding: 16px 16px 12px; position: relative; }
.meal-head::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--check); }
.plate { font-size: 1.6rem; letter-spacing: 2px; margin: 4px 0 6px; }
.meal-body { padding: 4px 16px 16px; }
.meal h3 { margin: 0; font-size: 1.45rem; line-height: 1.15; }
.meal .eng { color: var(--muted); font-size: 0.88rem; margin: 2px 0 8px; }
.meal .says { background: var(--cream); border-left: 3px solid var(--tomato); padding: 8px 10px; border-radius: 0 10px 10px 0; font-style: italic; font-size: 0.9rem; margin: 10px 0; }
.meta { display: flex; gap: 12px; color: #6b5a4e; font-size: 0.82rem; font-weight: 600; }
.badge-best { display: inline-block; background: var(--basil); color: #fff; font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-bottom: 4px; }

.macros { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 10px 0 4px; }
.macro { text-align: center; background: var(--cream); border-radius: 12px; padding: 8px 2px 7px; border-top: 3px solid var(--mc, var(--line)); }
.macro b { display: block; font-size: 1.05rem; font-variant-numeric: tabular-nums; color: var(--mc); }
.macro span { font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 700; }
.macro.cal { --mc: var(--cal); } .macro.pro { --mc: var(--pro); } .macro.carb { --mc: var(--carb); }
.macro.fat { --mc: var(--fat); } .macro.sug { --mc: var(--sug); }
.macro-caption { font-size: 0.75rem; color: var(--muted); margin: 2px 0 0; }
.macro-caption strong { color: var(--ink); }

details { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
summary { font-weight: 700; cursor: pointer; padding: 4px 0; }
.ing { list-style: none; padding: 0; margin: 6px 0; }
.ing li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 0.88rem; }
.ing li small { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.steps { padding-left: 20px; margin: 6px 0; font-size: 0.9rem; }
.steps li { margin-bottom: 6px; }
.missing { font-size: 0.8rem; color: var(--muted); }

.totals { border-top: 6px solid transparent; border-image: var(--check) 6; }
.totals h3 { margin: 0 0 2px; font-size: 1.15rem; }
.items { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.item { display: grid; grid-template-columns: 48px 1fr; gap: 10px; align-items: start; }
.item .em { font-size: 1.9rem; width: 48px; height: 48px; display: grid; place-items: center; background: var(--cream); border-radius: 14px; }
.item h4 { margin: 0; font-size: 1rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.src { font-size: 0.62rem; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--basil-soft); color: var(--basil); }
.src.ai { background: #f3e9ff; color: #6b43b5; }
.check { font-size: 0.62rem; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: #fff0d4; color: #8a5a00; }
.per-unit { font-size: 0.8rem; color: var(--muted); margin: 2px 0 6px; }
.amount { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--muted); }
.amount input { width: 90px; padding: 6px 8px; }
.item .macros { grid-column: 1 / -1; margin: 6px 0 0; }
.item .macro b { font-size: 0.92rem; }
.remove { margin-left: auto; border: 0; background: none; color: var(--muted); font-size: 0.8rem; text-decoration: underline; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

/* ---------- Paywall ---------- */
dialog { border: 0; border-radius: 24px; padding: 0; width: min(420px, calc(100vw - 32px)); background: var(--cream); color: var(--ink); }
dialog::backdrop { background: rgba(30, 18, 10, 0.55); backdrop-filter: blur(2px); }
.paywall { padding: 26px 20px 16px; text-align: center; position: relative; }
.pay-marco { display: block; margin: 0 auto 6px; }
.paywall h2 { margin: 4px 0 6px; font-size: 1.55rem; }
.paywall p { margin: 0 0 12px; color: var(--muted); }
.close { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 1.1rem; color: var(--muted); }
.perks { list-style: none; padding: 0; margin: 0 0 18px; text-align: left; display: grid; gap: 6px; font-size: 0.92rem; }
.plans { display: grid; gap: 12px; }
.plan { position: relative; display: grid; gap: 2px; border: 2px solid var(--line); background: var(--paper); border-radius: 14px; padding: 14px; color: var(--ink); }
.plan strong { font-size: 1.1rem; } .plan small { color: var(--muted); }
.plan.best { border-color: var(--tomato); }
.plan .tag { left: auto; right: 12px; transform: none; }
.plan:disabled { opacity: 0.6; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 0.9rem; box-shadow: var(--shadow); max-width: calc(100vw - 32px); z-index: 10; }

.foot { max-width: 680px; margin: 0 auto; padding: 18px 16px 34px; text-align: center; }
.foot p { font-size: 0.75rem; color: var(--muted); margin: 0 0 4px; }

/* ---------- Larger screens ---------- */
@media (min-width: 760px) {
  .hero { grid-template-columns: 1.1fr 1fr; padding: 40px 0 44px; gap: 40px; }
  .marco-big { width: 150px; height: 150px; }
  .steps-grid { grid-template-columns: repeat(3, 1fr); }
  .feature { grid-template-columns: 1.2fr 1fr; padding: 30px; }
}
@media (max-width: 360px) {
  .macro b { font-size: 0.9rem; }
  .macro span { font-size: 0.56rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Shown only inside the iOS/Android apps */
.native-only { display: none; }
.native .native-only { display: block; }
.native .top { padding-top: max(14px, env(safe-area-inset-top)); }
.foot a, .paywall .fine a { color: var(--muted); }

.share { margin-top: 10px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: .85rem; }
.share:hover { border-color: var(--tomato); color: var(--tomato); }
.brand .tm { font: 600 .55rem Inter, sans-serif; color: var(--muted); margin-left: 1px; vertical-align: super; }
.plan-cta { margin-top: 14px; padding: 11px 14px; font-size: .95rem; }
.plan-cta:disabled { opacity: .6; }

/* Receipt slot: full width under the two photo slots on phones, a third column on wider screens */
.receipt-slot { grid-column: 1 / -1; min-height: 96px; }
@media (min-width: 640px) {
  .slots { grid-template-columns: repeat(3, 1fr); }
  .receipt-slot { grid-column: auto; min-height: 140px; }
}
.src.receipt { background: #fff0d4; color: #8a5a00; }
.menu-summary { margin: 2px 0 12px; color: var(--muted); font-size: .92rem; }
.menu-summary b { color: var(--ink); font-size: 1.05rem; }
.meal.locked .lock-blur { filter: blur(6px); opacity: .6; pointer-events: none; user-select: none; margin: 10px 0 12px; }
.meal.locked .unlock { width: 100%; }
.menu-summary a { color: var(--accent, #c8372d); font-weight: 600; }
