/* Smallplate: shared look for the marketing site and the app.
   Direction: calm sage-white, deep green accent, soft rounded shapes, big numbers.
   Shape rule: buttons and chips are pills, cards 20px, inputs 14px. One accent (green). */
:root {
  --bg: #f1f6f2;
  --surface: #ffffff;
  --ink: #1b2a26;
  --muted: #526660;
  --line: #d6e2dc;
  --accent: #2b6b5c;
  --accent-ink: #ffffff;
  --accent-soft: #dcece5;
  --warm: #fde9d9;
  --warm-ink: #6e3a12;
  --shadow: 0 1px 2px rgba(27, 60, 50, .06), 0 8px 24px rgba(27, 60, 50, .07);
  --r-card: 20px;
  --r-input: 14px;
  --tab-h: 68px;
  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111a17; --surface: #1a2622; --ink: #e8f1ed; --muted: #a2b6ae; --line: #2c3c36;
    --accent: #86cdb9; --accent-ink: #0d1815; --accent-soft: #223630;
    --warm: #3b2d22; --warm-ink: #f4d3b8;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1.0625rem/1.55 var(--font); /* 17px */
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.015em; font-weight: 700; }
h1 { font-size: clamp(2.1rem, 8vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 5.5vw, 2.3rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.muted { color: var(--muted); }
.small { font-size: 1rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 680px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: 0 1.4em; border-radius: 999px; border: 2px solid transparent;
  font: 600 1.0625rem/1 var(--font); text-decoration: none; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:active { transform: scale(.98); }
.btn.quiet { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn.soft { background: var(--accent-soft); color: var(--ink); }
.btn.big { min-height: 60px; padding: 0 2em; font-size: 1.2rem; }
.btn.block { width: 100%; }
.btn.danger { background: transparent; color: #a1301f; border-color: #a1301f; }
@media (prefers-color-scheme: dark) { .btn.danger { color: #f0a090; border-color: #f0a090; } }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; padding: 12px 4px; min-height: 44px; }

/* cards, chips, fields */
.card { background: var(--surface); border-radius: var(--r-card); padding: 20px; box-shadow: var(--shadow); }
.card + .card, .card + .stack, .stack > * + * { margin-top: 16px; }
.warm { background: var(--warm); color: var(--warm-ink); box-shadow: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink); font: 500 1rem/1 var(--font); cursor: pointer;
  display: inline-flex; align-items: center;
}
.chip[aria-pressed="true"], .chip[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
label { display: block; font-weight: 600; margin-bottom: 6px; }
input[type=text], input[type=number], input[type=email], input[type=search], textarea, select {
  width: 100%; min-height: 48px; padding: 10px 14px; font: 400 1rem/1.4 var(--font);
  color: var(--ink); background: var(--surface); border: 1.5px solid #8ba198; border-radius: var(--r-input);
}
@media (prefers-color-scheme: dark) { input, textarea, select { border-color: #587068 !important; } }
textarea { min-height: 88px; resize: vertical; }
.help { color: var(--muted); font-size: 1rem; margin-top: 6px; }
.err { color: #a1301f; font-weight: 600; margin-top: 6px; }
@media (prefers-color-scheme: dark) { .err { color: #f0a090; } }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap-row { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.seg { display: inline-flex; border: 1.5px solid var(--accent); border-radius: 999px; overflow: hidden; }
.seg button { min-height: 44px; min-width: 56px; padding: 0 16px; border: 0; background: transparent; color: var(--accent); font: 600 1rem var(--font); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); font-size: 1rem; line-height: 1.4; }

/* ------- site chrome ------- */
.site-head { padding: 14px 0; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.25rem; color: var(--ink); text-decoration: none; min-height: 44px; white-space: nowrap; flex-shrink: 0; }
.brand img { width: 32px; height: 32px; border-radius: 9px; }
.site-nav { display: flex; gap: 6px; align-items: center; }
.site-nav a:not(.btn) { padding: 10px 12px; color: var(--ink); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.site-nav .btn { min-height: 44px; padding: 0 1.1em; }
@media (max-width: 560px) { .site-nav a.hide-s { display: none; } }
.site-foot { margin-top: 80px; padding: 40px 0 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: 1rem; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 16px; }
.site-foot nav a { color: var(--ink); min-height: 44px; display: inline-flex; align-items: center; }
.site-foot p { margin-bottom: .6em; }
.section { padding: 56px 0; }
.section.tint { background: var(--surface); }
.prose { max-width: 680px; }
.prose h2 { margin-top: 1.6em; font-size: 1.5rem; }
.prose li { margin-bottom: .4em; }

/* hero */
.hero { padding: 20px 0 40px; }
.hero .wrap { display: grid; gap: 28px; align-items: center; }
.hero .eyebrow { display: inline-block; background: var(--accent-soft); padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: 1rem; margin-bottom: 16px; }
.hero h1 { margin-bottom: .4em; }
.hero .lede { font-size: 1.2rem; color: var(--muted); max-width: 34ch; }
.hero .shot { justify-self: center; width: min(300px, 78vw); border-radius: 28px; box-shadow: var(--shadow); border: 1px solid var(--line); }
@media (max-width: 819px) {
  .hero { padding-bottom: 0; }
  .hero h1 { font-size: 2rem; }
  .hero .lede { font-size: 1.0625rem; margin-bottom: 14px; }
  .hero .hide-m { display: none; }
  .hero .eyebrow { margin-bottom: 10px; padding: 4px 12px; }
  .hero .shot { width: min(300px, 80vw); height: 190px; object-fit: cover; object-position: top; border-radius: 28px 28px 0 0; border-bottom: 0; }
  .hero .wrap { gap: 14px; }
}
@media (min-width: 820px) {
  .hero { padding: 48px 0 72px; }
  .hero .wrap { grid-template-columns: 1.2fr .8fr; gap: 56px; }
  .hero .shot { width: 320px; justify-self: end; }
}
.steps { display: grid; gap: 28px; margin-top: 28px; padding: 0; list-style: none; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 52px 1fr; gap: 16px; align-items: start; counter-increment: s; }
.steps li::before { content: counter(s); width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: 1.3rem; }
.steps h3 { margin-bottom: .15em; }
.steps p { margin: 0; color: var(--muted); }
.split { display: grid; gap: 28px; align-items: center; }
@media (min-width: 820px) { .split { grid-template-columns: .8fr 1.2fr; gap: 56px; } .split.flip { grid-template-columns: 1.2fr .8fr; } }
.mini-meals { display: grid; gap: 12px; margin: 20px 0; padding: 0; list-style: none; }
.mini-meals li { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; background: var(--bg); border-radius: 16px; }
.mini-meals b { font-size: 1.25rem; white-space: nowrap; }
.plans { display: grid; gap: 16px; margin-top: 24px; }
@media (min-width: 720px) { .plans { grid-template-columns: 1fr 1fr; } }
.plans .card { padding: 28px; }
.price { font-size: 2.2rem; font-weight: 700; letter-spacing: -.02em; }
.plans ul { padding-left: 1.2em; margin: 16px 0; }
.plans li { margin-bottom: .4em; }
details.faq { border-bottom: 1px solid var(--line); }
details.faq summary { min-height: 56px; padding: 14px 0; cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; font-size: 1.5rem; color: var(--accent); }
details.faq[open] summary::after { content: "−"; }
details.faq p { color: var(--muted); }
.callout { background: var(--accent-soft); border-radius: var(--r-card); padding: 16px 18px; }

/* ------- app ------- */
body.app { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); }
.app-main { width: 100%; max-width: 560px; margin: 0 auto; padding: 16px 16px 24px; }
.app-top { display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin-bottom: 8px; }
.app-top .date { color: var(--muted); }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); height: calc(var(--tab-h) + env(safe-area-inset-bottom));
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 56px; color: var(--muted); text-decoration: none; font-size: 1rem; font-weight: 600;
}
.tabbar a[aria-current="page"] { color: var(--accent); }
.tabbar svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ringcard { text-align: center; padding: 24px 16px 22px; }
.ring { position: relative; width: min(240px, 66vw); aspect-ratio: 1; margin: 0 auto 8px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 14; stroke-linecap: round; }
.ring .track { stroke: var(--accent-soft); }
.ring .fill { stroke: var(--accent); transition: stroke-dashoffset .6s ease; }
.ring .center { position: absolute; inset: 0; display: grid; place-content: center; }
.bignum { font-size: 4.2rem; line-height: 1; font-weight: 700; letter-spacing: -.04em; }
.bignum small { font-size: 1.4rem; font-weight: 600; letter-spacing: 0; margin-left: 2px; }
.ring-caption { font-size: 1.25rem; font-weight: 600; margin: 0; }
.met { background: var(--accent-soft); border-radius: var(--r-card); padding: 18px 20px; margin-top: 16px; }
.met b { display: block; font-size: 1.2rem; margin-bottom: 4px; }
.sec-title { margin: 28px 0 10px; font-size: 1.3rem; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); min-height: 60px; }
.list > li:last-child { border-bottom: 0; }
.list .name { font-weight: 600; line-height: 1.3; }
.list .sub { color: var(--muted); font-size: 1rem; line-height: 1.3; }
.list .g { font-weight: 700; white-space: nowrap; }
.add-btn { min-width: 64px; min-height: 44px; border-radius: 999px; border: 0; background: var(--accent-soft); color: var(--ink); font: 700 1rem var(--font); cursor: pointer; }
.add-btn:active { transform: scale(.96); }
.x-btn { min-width: 44px; min-height: 44px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); font-size: 1.5rem; cursor: pointer; }
details.group { border-bottom: 1px solid var(--line); }
details.group > summary { min-height: 56px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; font-weight: 700; list-style: none; }
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary::after { content: "+"; color: var(--accent); font-size: 1.4rem; }
details.group[open] > summary::after { content: "−"; }
.meal { padding: 18px; }
.meal + .meal { margin-top: 14px; }
.meal-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.meal h3 { margin: 0 0 4px; font-size: 1.15rem; }
.meal .prot { font-size: 1.9rem; font-weight: 700; line-height: 1; letter-spacing: -.03em; white-space: nowrap; }
.meal .prot small { font-size: 1rem; font-weight: 600; }
.meal .meta { color: var(--muted); font-size: 1rem; margin: 2px 0 10px; }
.meal .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.meal details { margin: 6px 0 12px; }
.meal summary { cursor: pointer; color: var(--accent); font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.meal ul { margin: 0 0 8px; padding-left: 1.2em; }
.fit { color: var(--warm-ink); background: var(--warm); border-radius: 12px; padding: 6px 12px; font-size: 1rem; display: inline-block; margin-bottom: 10px; }
.plot { position: relative; height: 170px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; border-bottom: 2px solid var(--line); }
.plot .col { height: 100%; display: flex; align-items: flex-end; justify-content: center; position: relative; z-index: 1; }
.plot i { display: block; width: 100%; max-width: 40px; border-radius: 10px 10px 4px 4px; background: #9cc5b8; min-height: 4px; }
.plot .col.met i { background: var(--accent); }
.plot .col.today i { outline: 2px dashed var(--accent); outline-offset: 2px; }
.targetline { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--warm-ink); z-index: 2; opacity: .55; pointer-events: none; }
.plot-labels { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; text-align: center; margin-top: 6px; }
.plot-labels b { display: block; font-size: 1rem; }
.plot-labels span { font-size: 1rem; color: var(--muted); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.stat { background: var(--surface); border-radius: var(--r-card); padding: 16px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 2rem; letter-spacing: -.03em; line-height: 1.1; }
.scale { display: flex; gap: 8px; }
.scale button { flex: 1; min-height: 52px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: 700 1.1rem var(--font); cursor: pointer; }
.scale button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.scale-lab { display: flex; justify-content: space-between; color: var(--muted); font-size: 1rem; margin-top: 4px; }
.lock { text-align: center; }
.lock .btn { margin-top: 8px; }
dialog.sheet { border: 0; padding: 0; width: min(560px, 100%); max-height: 92dvh; margin: auto auto 0; border-radius: 24px 24px 0 0; background: var(--surface); color: var(--ink); overflow: auto; }
dialog.sheet::backdrop { background: rgba(10, 25, 20, .5); }
dialog.sheet .inner { padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); }
@media (min-width: 600px) { dialog.sheet { margin: auto; border-radius: 24px; } }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); z-index: 40;
  background: var(--ink); color: var(--bg); padding: 12px 8px 12px 18px; border-radius: 999px; display: flex; align-items: center; gap: 8px;
  max-width: calc(100% - 32px); box-shadow: var(--shadow);
}
.toast button { background: transparent; border: 0; color: inherit; font: 700 1rem var(--font); text-decoration: underline; min-height: 44px; padding: 0 12px; cursor: pointer; }
.app-foot { margin-top: 40px; color: var(--muted); font-size: 1rem; }
.app-foot a { color: var(--muted); }
.app-foot nav { display: flex; flex-wrap: wrap; gap: 0 14px; }
.app-foot nav a { min-height: 44px; display: inline-flex; align-items: center; }
.setup-n { font-size: 3.4rem; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper button { width: 52px; height: 52px; border-radius: 50%; border: 1.5px solid var(--accent); background: transparent; color: var(--accent); font-size: 1.6rem; cursor: pointer; }
.stepper input { text-align: center; font-size: 1.5rem; font-weight: 700; max-width: 120px; }
.empty { text-align: center; color: var(--muted); padding: 20px 8px; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* inline links in running text: 44px tap area without changing layout */
main p a, main li a, .app-foot p a, .site-foot p a { display: inline-block; padding: 12px 0; margin: -12px 0; }
.site-nav .btn { padding-left: 14px; padding-right: 14px; white-space: nowrap; }
