/* NutriLoop AI — main stylesheet
   Mobile-first. Breakpoints: 640px (large phone), 768px (tablet), 1100px (desktop nav), 1280px (wide).
   Design tokens follow the developer specification, section 02. */

@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-var.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --forest: #064B32;
  --forest-700: #0A5E40;
  --forest-900: #04331F;
  --fresh: #83C441;
  --fresh-100: #E7F3D9;
  --orange: #F59A23;
  --orange-100: #FDEBD3;
  --orange-ink: #8A4B00;      /* orange family dark enough for text (AA on white) */
  --surface: #F6F8F2;
  --white: #FFFFFF;
  --ink: #202B25;
  --muted: #4E5B53;
  --line: #D9E0D3;
  --danger: #A61B1B;
  --danger-100: #FBE9E9;
  --success-100: #E5F2E9;

  --font-head: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* 8px spacing scale */
  --s1: .5rem; --s2: 1rem; --s3: 1.5rem; --s4: 2rem; --s5: 2.5rem; --s6: 3rem; --s8: 4rem; --s10: 5rem; --s12: 6rem;

  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 24px;
  --gutter: 1.25rem;
  --header-h: 72px;
  --focus: 0 0 0 3px var(--white), 0 0 0 6px var(--forest);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
figure { margin: 0; }
img, svg, picture { display: block; max-width: 100%; height: auto; }
a { color: var(--forest); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
main:focus { outline: none; }

h1, h2, h3, h4 { font-family: var(--font-head); color: var(--forest-900); line-height: 1.12; margin: 0 0 var(--s2); letter-spacing: -.015em; }
h1 { font-size: clamp(2.25rem, 1.6rem + 3.2vw, 4.25rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.02; }
h2 { font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.625rem); font-weight: 800; letter-spacing: -.02em; }
h3 { font-size: clamp(1.2rem, 1.1rem + .4vw, 1.4rem); font-weight: 700; }
h4 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 var(--s2); }
.lead { font-size: clamp(1.125rem, 1.05rem + .35vw, 1.3rem); color: var(--muted); max-width: 40em; }
.measure { max-width: 42em; }
.small { font-size: .9rem; color: var(--muted); }
ul, ol { padding-left: 1.2em; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: var(--s2); top: -100px; z-index: 100; background: var(--forest); color: var(--white); padding: .75rem 1rem; border-radius: var(--radius-sm); font-weight: 600; }
.skip-link:focus { top: var(--s2); }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter); }
@media (min-width: 768px) { :root { --gutter: 2rem; } }

.section { padding-block: var(--s8); }
@media (min-width: 1100px) { .section { padding-block: var(--s12); } }
.section-alt { background: var(--surface); }
.section-dark { background: var(--forest); color: #E9F2EC; }
.section-dark h2, .section-dark h3 { color: var(--white); }
.section-dark a:not(.btn) { color: var(--white); }
.section-head { max-width: 46rem; margin-bottom: var(--s6); }
.section-head p { color: var(--muted); }
.section-dark .section-head p { color: #CFE2D6; }

.grid { display: grid; gap: var(--s3); }
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 640px) and (max-width: 1099px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.split { display: grid; gap: var(--s5); align-items: start; }
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s8); }
  .split-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-reverse > :first-child { order: 2; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .75rem 1.4rem;
  font: 600 1rem/1.2 var(--font-body);
  border-radius: 999px; border: 2px solid transparent;
  text-decoration: none; cursor: pointer; text-align: center;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--forest); color: var(--white); }
.btn-primary:hover { background: var(--forest-900); }
.btn-secondary { background: transparent; color: var(--forest); border-color: var(--forest); }
.btn-secondary:hover { background: var(--fresh-100); }
.btn-light { background: var(--white); color: var(--forest); }
.btn-light:hover { background: var(--fresh-100); }
.btn-ghost-light { background: transparent; color: var(--white); border-color: rgba(255,255,255,.7); }
.btn-ghost-light:hover { background: rgba(255,255,255,.1); }
.btn-small { min-height: 40px; padding: .5rem 1rem; font-size: .925rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }
@media (max-width: 479px) { .btn-row .btn { width: 100%; } }

/* ---------- Header & navigation ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--white); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: var(--s2); }
.brand { display: inline-flex; flex-shrink: 0; border-radius: 6px; }
.brand img { width: 200px; height: auto; }
@media (min-width: 480px) { .brand img { width: 240px; } }

.menu-toggle {
  display: none; align-items: center; gap: .6rem;
  min-height: 44px; padding: .5rem .9rem;
  background: var(--white); color: var(--forest); border: 2px solid var(--forest); border-radius: 999px;
  font: 600 .95rem var(--font-body); cursor: pointer;
}
.menu-toggle-bars, .menu-toggle-bars::before, .menu-toggle-bars::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative; transition: transform .2s ease, background-color .2s ease; }
.menu-toggle-bars::before, .menu-toggle-bars::after { content: ""; position: absolute; left: 0; }
.menu-toggle-bars::before { top: -6px; }
.menu-toggle-bars::after { top: 6px; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

.nav-list, .sub-list { list-style: none; margin: 0; padding: 0; }
.nav-item > a, .sub-toggle {
  display: flex; align-items: center; min-height: 44px; padding: .5rem .8rem;
  font: 600 .975rem/1.2 var(--font-body); color: var(--ink); text-decoration: none;
  background: none; border: 0; border-radius: 999px; cursor: pointer; width: 100%;
}
.nav-item > a:hover, .sub-toggle:hover { color: var(--forest); background: var(--surface); }
.nav-item > a[aria-current="page"], .nav-item.is-active > .sub-toggle { color: var(--forest); box-shadow: inset 0 -2px 0 var(--fresh); border-radius: 0; }
.nav-cta > a.btn { color: var(--white); background: var(--forest); padding-inline: 1.2rem; }
.nav-cta > a.btn:hover { background: var(--forest-900); color: var(--white); }
.nav-cta > a.btn[aria-current="page"] { box-shadow: none; border-radius: 999px; }
.sub-toggle::after { content: ""; width: 7px; height: 7px; margin-left: .5rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .15s ease; }
.sub-toggle[aria-expanded="true"]::after { transform: translateY(2px) rotate(-135deg); }
.sub-list a { display: block; padding: .65rem 1rem; color: var(--ink); text-decoration: none; border-radius: var(--radius-sm); font-weight: 500; }
.sub-list a:hover { background: var(--surface); color: var(--forest); }
.sub-list a[aria-current="page"] { color: var(--forest); font-weight: 700; background: var(--fresh-100); }

/* Desktop navigation */
@media (min-width: 1100px) {
  .nav-list { display: flex; align-items: center; gap: .25rem; }
  .nav-home { display: none; }
  .has-sub { position: relative; }
  .sub-list {
    position: absolute; top: calc(100% + 8px); left: 0; min-width: 230px; padding: .5rem;
    background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 0 18px 40px -18px rgba(6, 75, 50, .35);
    display: none;
  }
  .has-sub:hover .sub-list, .has-sub:focus-within .sub-list, .sub-toggle[aria-expanded="true"] + .sub-list { display: block; }
  .js .has-sub:hover .sub-list { display: block; }
  .nav-cta { margin-left: .75rem; }
}

/* Mobile/tablet navigation (JavaScript enhances it into a toggle panel) */
@media (max-width: 1099px) {
  .js .menu-toggle { display: inline-flex; }
  .site-nav { width: 100%; }
  .header-inner { flex-wrap: wrap; }
  .js .header-inner { flex-wrap: nowrap; }
  .js .site-nav {
    position: fixed; inset: var(--header-h) 0 0 0; z-index: 49;
    background: var(--white); overflow-y: auto; overscroll-behavior: contain;
    padding: var(--s2) var(--gutter) var(--s8);
    border-top: 1px solid var(--line);
    visibility: hidden; opacity: 0; transform: translateY(-8px);
    transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
  }
  .js .site-nav.is-open { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
  .nav-list { display: grid; gap: .25rem; padding-bottom: var(--s2); }
  .nav-item > a, .sub-toggle { font-size: 1.125rem; padding: .85rem .5rem; border-radius: var(--radius-sm); justify-content: space-between; }
  .nav-item > a[aria-current="page"], .nav-item.is-active > .sub-toggle { box-shadow: inset 3px 0 0 var(--fresh); border-radius: 0; padding-left: .9rem; }
  .sub-list { padding: 0 0 .5rem .75rem; }
  .js .sub-toggle[aria-expanded="false"] + .sub-list { display: none; }
  .nav-cta { margin-top: var(--s2); }
  .nav-cta > a.btn { width: 100%; justify-content: center; min-height: 52px; font-size: 1.05rem; }
  body.nav-open { overflow: hidden; }
}

.demo-banner { background: var(--orange-100); color: var(--ink); text-align: center; padding: .55rem var(--gutter); font-size: .925rem; font-weight: 600; border-bottom: 1px solid #F2C98F; }

/* ---------- Hero ---------- */
.hero { padding-block: var(--s6) var(--s8); background: linear-gradient(180deg, var(--white) 0%, var(--surface) 100%); overflow: hidden; }
@media (min-width: 1100px) { .hero { padding-block: var(--s10) var(--s12); } }
.hero-grid { display: grid; gap: var(--s6); align-items: center; }
@media (min-width: 1000px) { .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: var(--s8); } }
.hero h1 { max-width: 12ch; margin-bottom: var(--s3); }
.hero-sub { font-family: var(--font-head); font-weight: 700; font-size: clamp(1.15rem, 1rem + .6vw, 1.45rem); color: var(--forest); margin-bottom: var(--s2); }
.hero p.lead { margin-bottom: 0; }
.status-note { display: inline-flex; align-items: center; gap: .6rem; margin-bottom: var(--s3); font-family: var(--font-head); font-size: clamp(1rem, .95rem + .3vw, 1.15rem); font-weight: 700; color: var(--forest-900); background: var(--fresh-100); border: 1.5px solid var(--fresh); border-radius: 999px; padding: .5rem 1.1rem; }
.status-note::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--forest); flex-shrink: 0; }

/* The loop: signature visual echoing the logo */
.loop-figure { margin: 0; }
.loop-wrap { position: relative; }
.loop-svg { width: 100%; height: auto; overflow: visible; }
.loop-track { fill: none; stroke: url(#loopGradient); stroke-width: 22; stroke-linecap: round; stroke-linejoin: round; }
.loop-track-soft { fill: none; stroke: #fff; stroke-opacity: .55; stroke-width: 4; stroke-dasharray: 2 14; stroke-linecap: round; }
.loop-node circle { fill: var(--white); stroke-width: 4; }
.loop-node.customer circle { stroke: var(--forest); }
.loop-node.kitchen circle { stroke: var(--orange); }
.loop-node text { font: 800 20px var(--font-head); fill: var(--forest-900); text-anchor: middle; dominant-baseline: central; }
.loop-runner { fill: var(--white); stroke: var(--forest); stroke-width: 3; }
.loop-side { font: 700 15px var(--font-head); fill: var(--muted); }
@media (prefers-reduced-motion: reduce) { .loop-runner { display: none; } }

.loop-legend { list-style: none; padding: 0; margin: var(--s3) 0 0; display: grid; gap: .5rem .75rem; counter-reset: stage; }
@media (min-width: 560px) { .loop-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .loop-legend { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.loop-legend li { counter-increment: stage; display: flex; align-items: center; gap: .6rem; font-size: .95rem; font-weight: 600; color: var(--ink); }
.loop-legend li::before { content: counter(stage); display: grid; place-items: center; flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--forest); background: var(--white); font: 800 .85rem var(--font-head); color: var(--forest-900); }
.loop-legend li.kitchen::before { border-color: var(--orange); }
.loop-caption { margin-top: var(--s2); font-size: .9rem; color: var(--muted); }

/* ---------- Page header (inner pages) ---------- */
.page-hero { padding-block: var(--s6) var(--s6); background: var(--surface); border-bottom: 1px solid var(--line); }
@media (min-width: 1100px) { .page-hero { padding-block: var(--s10) var(--s8); } }
.page-hero h1 { max-width: 18ch; font-size: clamp(2rem, 1.5rem + 2.6vw, 3.5rem); }
.page-hero .kicker { font-family: var(--font-head); font-weight: 700; color: var(--forest-700); margin-bottom: .5rem; font-size: 1.05rem; }
.breadcrumb { font-size: .9rem; margin-bottom: var(--s2); color: var(--muted); }
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.breadcrumb li + li::before { content: "/"; margin-right: .4rem; color: var(--line); }

/* ---------- Content blocks ---------- */
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s4); }
@media (min-width: 768px) { .panel { padding: var(--s5); } }
.panel-forest { background: var(--forest); color: #E3EFE7; border-color: var(--forest); }
.panel-forest h3, .panel-forest h2 { color: var(--white); }
.panel-forest a:not(.btn) { color: var(--white); }
.panel-meals { border-top: 6px solid var(--fresh); }
.panel-intel { border-top: 6px solid var(--orange); }
.panel .panel-label { font-family: var(--font-head); font-weight: 700; font-size: .95rem; margin-bottom: .75rem; color: var(--forest-700); }
.panel-forest .panel-label { color: var(--fresh); }

.check-list { list-style: none; padding: 0; margin: var(--s2) 0 0; display: grid; gap: .6rem; }
.check-list li { position: relative; padding-left: 1.75rem; }
.check-list li::before { content: ""; position: absolute; left: 0; top: .45em; width: 14px; height: 8px; border-left: 3px solid var(--fresh); border-bottom: 3px solid var(--fresh); transform: rotate(-45deg); }

/* Stage flow — a real sequence, so numbered */
.flow { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; counter-reset: flow; }
.flow li { counter-increment: flow; position: relative; padding: 0 0 var(--s3) 3.25rem; }
.flow li::before { content: counter(flow); position: absolute; left: 0; top: 0; width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border-radius: 50%; background: var(--forest); color: var(--white); font: 800 1rem var(--font-head); }
.flow li::after { content: ""; position: absolute; left: calc(1.125rem - 1px); top: 2.4rem; bottom: .2rem; width: 2px; background: var(--line); }
.flow li:last-child::after { display: none; }
.flow li.k::before { background: var(--white); color: var(--forest-900); box-shadow: inset 0 0 0 3px var(--orange); }
.flow h3 { font-size: 1.1rem; margin-bottom: .25rem; padding-top: .3rem; }
.flow p { margin: 0; color: var(--muted); font-size: .975rem; }
@media (min-width: 1000px) {
  .flow-row { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--s2); }
  .flow-row li { padding: 3.25rem 0 0; }
  .flow-row li::after { left: 2.5rem; right: -1rem; top: calc(1.125rem - 1px); bottom: auto; width: auto; height: 2px; }
  .flow-row li:last-child::after { display: block; right: 0; background: repeating-linear-gradient(90deg, var(--orange) 0 6px, transparent 6px 12px); }
}
.feedback-note { margin-top: var(--s3); display: flex; gap: .75rem; align-items: flex-start; padding: var(--s2) var(--s3); border-radius: var(--radius); background: var(--orange-100); color: var(--ink); font-size: .975rem; }
.feedback-note svg { flex-shrink: 0; margin-top: .15rem; }

/* Engine workflow (technology page) */
.engines { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); counter-reset: eng; }
.engine { counter-increment: eng; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3); position: relative; }
.engine h3 { display: flex; gap: .6rem; align-items: baseline; font-size: 1.15rem; }
.engine h3::before { content: "0" counter(eng); font: 800 .95rem var(--font-head); color: var(--forest-700); }
.engine dl { margin: 0; display: grid; gap: .5rem; font-size: .95rem; }
.engine dt { font-weight: 700; color: var(--forest-900); }
.engine dd { margin: 0; color: var(--muted); }
.engine .io-in { border-left: 3px solid var(--fresh); padding-left: .65rem; }
.engine .io-out { border-left: 3px solid var(--orange); padding-left: .65rem; }
@media (max-width: 999px) {
  .engine:not(:last-child)::after { content: ""; position: absolute; left: 50%; bottom: -1rem; width: 2px; height: 1rem; background: var(--forest); }
}
@media (min-width: 1000px) {
  .engines { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s3); }
  .engine:not(:last-child)::after { content: ""; position: absolute; top: 50%; right: calc(-1 * var(--s3)); width: var(--s3); height: 2px; background: var(--forest); }
}
.engine-feedback { margin-top: var(--s3); border: 2px dashed var(--orange); border-radius: var(--radius); padding: var(--s2) var(--s3); display: flex; gap: .75rem; align-items: center; background: var(--white); }
.engine-feedback strong { color: var(--forest-900); }

/* Meal cards */
.meal-grid { display: grid; gap: var(--s3); }
@media (min-width: 640px) { .meal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .meal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.meal-card { display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.meal-media { aspect-ratio: 4 / 3; background: var(--fresh-100); position: relative; }
.meal-media img { width: 100%; height: 100%; object-fit: cover; }
.meal-media .meal-illustration { width: 100%; height: 100%; }
.meal-tag { position: absolute; left: .75rem; top: .75rem; background: var(--white); color: var(--ink); font-size: .8rem; font-weight: 600; padding: .25rem .6rem; border-radius: 999px; }
.meal-body { padding: var(--s3); display: flex; flex-direction: column; gap: .75rem; flex: 1; }
.meal-body h3 { margin: 0; font-size: 1.2rem; }
.meal-facts { display: grid; grid-template-columns: auto 1fr; gap: .3rem .9rem; margin: 0; font-size: .925rem; }
.meal-facts dt { color: var(--muted); }
.meal-facts dd { margin: 0; font-weight: 600; }
.pending { color: var(--orange-ink); font-weight: 600; }
.meal-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; }
.meal-price { font-family: var(--font-head); font-weight: 800; color: var(--forest-900); }
.meal-card details { border-top: 1px solid var(--line); padding-top: .75rem; font-size: .925rem; }
.meal-card summary { cursor: pointer; font-weight: 600; color: var(--forest); min-height: 44px; display: flex; align-items: center; }

.price-band { display: grid; gap: var(--s3); }
@media (min-width: 768px) { .price-band { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.price-band .panel { padding: var(--s3); }
.price-figure { font: 800 2rem/1 var(--font-head); color: var(--forest-900); margin: .25rem 0 .5rem; }

/* Concept dashboard preview */
.concept { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--white); overflow: hidden; box-shadow: 0 30px 60px -40px rgba(6, 75, 50, .45); }
.concept-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: .75rem 1rem; background: var(--forest); color: var(--white); font-size: .875rem; font-weight: 600; }
.concept-flag { background: var(--orange-100); color: var(--ink); border-radius: 999px; padding: .15rem .6rem; font-size: .8rem; }
.concept-body { padding: var(--s3); display: grid; gap: var(--s2); }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
@media (min-width: 640px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { background: var(--surface); border-radius: var(--radius-sm); padding: .75rem; }
.kpi span { display: block; font-size: .8rem; color: var(--muted); }
.kpi strong { font: 800 1.4rem var(--font-head); color: var(--forest-900); }
.kpi.warn strong { color: var(--orange-ink); }

/* Tables */
.table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); }
.table-wrap:focus-visible { box-shadow: var(--focus); }
table { width: 100%; border-collapse: collapse; font-size: .925rem; }
caption { text-align: left; padding: .75rem 1rem; font-weight: 700; color: var(--forest-900); }
th, td { padding: .65rem 1rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
td.wrap, th.wrap { white-space: normal; min-width: 14rem; }
thead th { background: var(--surface); font-weight: 700; color: var(--forest-900); }
tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--surface); }
.badge-ok { background: var(--success-100); color: var(--forest-900); }
.badge-warn { background: var(--orange-100); color: var(--orange-ink); }
.badge-bad { background: var(--danger-100); color: var(--danger); }

/* FAQ */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: var(--s2); padding: var(--s3) 0; font: 700 1.125rem var(--font-head); color: var(--forest-900); min-height: 48px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.6rem; font-weight: 400; color: var(--forest); line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding-bottom: var(--s3); margin: 0; color: var(--muted); max-width: 42em; }

/* CTA band */
.cta-band { background: var(--forest); color: #E3EFE7; border-radius: var(--radius-lg); padding: var(--s5) var(--s4); display: grid; gap: var(--s3); position: relative; overflow: hidden; }
@media (min-width: 900px) { .cta-band { grid-template-columns: 1.3fr 1fr; align-items: center; padding: var(--s8) var(--s6); } }
.cta-band h2 { color: var(--white); }
.cta-band p { margin: 0; }
.cta-band .btn-row { margin-top: 0; }
@media (min-width: 900px) { .cta-band .btn-row { justify-content: flex-end; } }
.cta-band::after { content: ""; position: absolute; right: -60px; bottom: -90px; width: 260px; height: 160px; border: 18px solid rgba(131, 196, 65, .35); border-radius: 50%; pointer-events: none; }

/* ---------- Forms ---------- */
.form-shell { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s3); }
@media (min-width: 768px) { .form-shell { padding: var(--s5); } }
.form-shell h2, .form-shell h3 { margin-bottom: .5rem; }
.lead-form { display: grid; gap: var(--s2) var(--s3); margin-top: var(--s3); }
@media (min-width: 640px) { .lead-form { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.field { display: grid; gap: .35rem; align-content: start; }
.field-wide, .form-status { grid-column: 1 / -1; }
.field label { font-weight: 600; color: var(--forest-900); }
.optional { font-weight: 400; color: var(--muted); }
.hint { margin: 0; font-size: .875rem; color: var(--muted); }
input[type="text"], input[type="email"], input[type="number"], input[type="password"], input[type="date"], select, textarea {
  width: 100%; min-height: 48px; padding: .7rem .9rem;
  font: 400 1rem/1.4 var(--font-body); color: var(--ink);
  background: var(--white); border: 1.5px solid #9AA89E; border-radius: var(--radius-sm);
  appearance: none; -webkit-appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--forest) 50%), linear-gradient(135deg, var(--forest) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 2.5rem; }
textarea { min-height: 120px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(6, 75, 50, .25); border-radius: var(--radius-sm); }
[aria-invalid="true"] { border-color: var(--danger) !important; }
.field-error { margin: 0; min-height: 0; font-size: .875rem; font-weight: 600; color: var(--danger); }
.field-error:empty { display: none; }
.field-check { grid-template-columns: auto 1fr; align-items: start; gap: .25rem .75rem; }
.field-check input { width: 22px; height: 22px; margin: .15rem 0 0; accent-color: var(--forest); }
.field-check label { font-weight: 400; color: var(--ink); font-size: .95rem; }
.field-check .field-error { grid-column: 2; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status { padding: .9rem 1rem; border-radius: var(--radius-sm); font-weight: 600; }
.form-status[data-state="success"] { background: var(--success-100); color: var(--forest-900); border-left: 4px solid var(--forest); }
.form-status[data-state="error"] { background: var(--danger-100); color: var(--danger); border-left: 4px solid var(--danger); }
.form-status[data-state="loading"] { background: var(--surface); color: var(--muted); }
.form-actions .btn { min-width: 14rem; }
@media (max-width: 479px) { .form-actions .btn { width: 100%; } }
.lead-form.is-sending button[type="submit"] { opacity: .7; cursor: progress; }

.form-picker { display: flex; flex-wrap: wrap; gap: .5rem; margin: var(--s3) 0 0; padding: 0; list-style: none; }
.form-picker a { display: inline-flex; align-items: center; min-height: 44px; padding: .5rem 1rem; border: 1.5px solid var(--forest); border-radius: 999px; text-decoration: none; font-weight: 600; }
.form-picker a:hover { background: var(--fresh-100); }

/* Notice */
.notice { border-left: 4px solid var(--orange); background: var(--orange-100); padding: var(--s2) var(--s3); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: .95rem; }
.notice p:last-child { margin: 0; }
.notice-info { border-left-color: var(--forest); background: var(--fresh-100); }

/* Prose pages (legal) */
.prose { max-width: 46rem; }
.prose h2 { font-size: 1.5rem; margin-top: var(--s6); }
.prose h3 { margin-top: var(--s4); }
.prose li { margin-bottom: .4rem; }

/* Founder */
.founder { display: grid; gap: var(--s3); align-items: center; }
@media (min-width: 640px) { .founder { grid-template-columns: auto 1fr; } }
.founder-mark { width: 96px; height: 96px; border-radius: 50%; background: var(--forest); color: var(--white); display: grid; place-items: center; font: 800 2rem var(--font-head); }

/* ---------- Footer ---------- */
.site-footer { background: var(--forest-900); color: #CFE2D6; padding-top: var(--s8); font-size: .95rem; }
.site-footer a { color: var(--white); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; gap: var(--s5); padding-bottom: var(--s6); }
@media (min-width: 640px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1.2fr; } }
.footer-brand img { background: var(--white); border-radius: var(--radius); padding: .75rem 1rem; width: 191px; height: auto; box-sizing: content-box; margin-bottom: var(--s2); }
.footer-brand p { max-width: 26rem; }
.footer-heading { font-size: 1rem; color: var(--white); margin-bottom: var(--s2); letter-spacing: 0; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.site-footer li a { display: inline-block; padding-block: .15rem; word-break: break-word; }
.footer-legal { border-top: 1px solid rgba(255,255,255,.15); padding-block: var(--s3); display: flex; flex-direction: column; gap: var(--s2); font-size: .875rem; }
.footer-legal p { margin: 0; }
.footer-legal ul { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
@media (min-width: 1000px) { .footer-legal { flex-direction: row; justify-content: space-between; align-items: center; } }
.site-footer :focus-visible { box-shadow: 0 0 0 3px var(--fresh); }

/* ---------- Demo hub ---------- */
.demo-tiles { display: grid; gap: var(--s3); }
@media (min-width: 768px) { .demo-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .demo-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.demo-tile { display: flex; flex-direction: column; gap: .75rem; padding: var(--s3); border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.demo-tile p { color: var(--muted); font-size: .95rem; margin: 0; }
.demo-tile .btn { margin-top: auto; align-self: flex-start; }
.demo-tile.is-live { border: 2px solid var(--forest); }

/* ---------- Innovation Lab ---------- */
.lab { display: grid; gap: var(--s4); }
@media (min-width: 1100px) { .lab { grid-template-columns: minmax(0, 380px) minmax(0, 1fr); align-items: start; } }
.lab-inputs { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s3); }
@media (min-width: 1100px) { .lab-inputs { position: sticky; top: calc(var(--header-h) + 16px); } }
.lab-inputs fieldset { border: 0; padding: 0; margin: 0 0 var(--s3); display: grid; gap: var(--s2); }
.lab-inputs legend { font: 700 1.1rem var(--font-head); color: var(--forest-900); margin-bottom: .75rem; padding: 0; }
.input-unit { display: flex; align-items: stretch; }
.input-unit input { border-top-right-radius: 0; border-bottom-right-radius: 0; text-align: right; font-variant-numeric: tabular-nums; }
.input-unit span { display: grid; place-items: center; min-width: 3.25rem; padding: 0 .75rem; background: var(--surface); border: 1.5px solid #9AA89E; border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-weight: 600; color: var(--muted); }
.lab-actions { display: grid; gap: .75rem; grid-template-columns: 1fr 1fr; }
.lab-actions .btn { width: 100%; padding-inline: .75rem; }

.lab-results { display: grid; gap: var(--s3); min-width: 0; }
.outputs { display: grid; gap: .75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .outputs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.out { border-radius: var(--radius); padding: var(--s2); background: var(--white); border: 1px solid var(--line); min-width: 0; }
.out .out-label { font-size: .85rem; color: var(--muted); display: block; }
.out .out-value { font: 800 clamp(1.35rem, 1.1rem + 1vw, 1.9rem)/1.15 var(--font-head); color: var(--forest-900); display: block; margin-top: .25rem; font-variant-numeric: tabular-nums; }
.out .out-kind { display: inline-block; margin-top: .4rem; font-size: .75rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; }
.out.confirmed { border-left: 6px solid var(--forest); }
.out.confirmed .out-kind { background: var(--success-100); color: var(--forest-900); }
.out.provisional { border-left: 6px solid var(--orange); }
.out.provisional .out-kind { background: var(--orange-100); color: var(--orange-ink); }
.out.total { border-left: 6px solid var(--ink); }
.out.total .out-kind { background: var(--surface); color: var(--ink); }

.chart-card, .breakdown-card, .batch-card, .saved-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s3); min-width: 0; }
.chart-card h2, .breakdown-card h2, .batch-card h2, .saved-card h2 { font-size: 1.25rem; margin-bottom: .75rem; }
.chart-svg { width: 100%; height: auto; }
.chart-svg text { font: 600 13px var(--font-body); fill: var(--ink); }
.chart-svg .axis { stroke: var(--line); }
.chart-legend { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; list-style: none; padding: 0; margin: .75rem 0 0; font-size: .875rem; }
.chart-legend li { display: flex; align-items: center; gap: .4rem; }
.swatch { width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; }
.sw-stock { background: var(--fresh); }
.sw-confirmed { background: var(--forest); }
.sw-buffer { background: var(--orange); background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.45) 0 3px, transparent 3px 6px); }

.breakdown { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.breakdown li { display: grid; grid-template-columns: minmax(0, 1fr); gap: .15rem; padding: .65rem .85rem; background: var(--surface); border-radius: var(--radius-sm); }
@media (min-width: 640px) { .breakdown li { grid-template-columns: 12rem minmax(0, 1fr); align-items: baseline; } }
.breakdown .b-label { font-weight: 600; font-size: .925rem; }
.breakdown code { font: 500 .95rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--forest-900); overflow-wrap: anywhere; }
.lab-errors { margin: 0; }
.lab-errors:empty { display: none; }
.excluded-note { margin-top: .75rem; font-size: .925rem; }
.saved-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.saved-list li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .5rem .75rem; background: var(--surface); border-radius: var(--radius-sm); flex-wrap: wrap; }
.saved-list .small { margin: 0; }
.batch-tools { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.batch-table input, .batch-table select { min-height: 40px; padding: .4rem .6rem; font-size: .925rem; }
.batch-table input[type="number"] { width: 6.5rem; text-align: right; }
.batch-table input[type="date"] { width: 10.5rem; }
.batch-table td { vertical-align: middle; }
.icon-btn { min-width: 40px; min-height: 40px; border: 1px solid var(--line); background: var(--white); border-radius: var(--radius-sm); cursor: pointer; color: var(--danger); font-weight: 700; }
.icon-btn:hover { background: var(--danger-100); }
.toast { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); z-index: 60; background: var(--forest-900); color: var(--white); padding: .75rem 1.1rem; border-radius: 999px; font-weight: 600; font-size: .95rem; max-width: calc(100% - 2rem); text-align: center; }

/* ---------- Admin ---------- */
.admin-wrap { padding-block: var(--s5); }
.admin-bar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: var(--s3); }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.filters a { padding: .4rem .9rem; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font-weight: 600; font-size: .9rem; }
.filters a[aria-current="true"] { background: var(--forest); color: var(--white); border-color: var(--forest); }
.login-box { max-width: 26rem; margin: var(--s8) auto; }

/* Utilities */
.mt-0 { margin-top: 0; } .mt-2 { margin-top: var(--s2); } .mt-4 { margin-top: var(--s4); } .mt-6 { margin-top: var(--s6); }
.mb-0 { margin-bottom: 0; }
.center { text-align: center; }
.stack > * + * { margin-top: var(--s2); }

@media print {
  .site-header, .site-footer, .menu-toggle, .btn-row, .demo-banner { display: none !important; }
  body { font-size: 11pt; }
}
.concept-cap { padding: 0 1.5rem 1rem; margin: 0; }

/* Innovation Lab bar chart (HTML bars so text stays readable on phones) */
.bars { display: grid; gap: var(--s3); }
.bar-head { display: flex; justify-content: space-between; gap: var(--s2); font-size: .95rem; margin-bottom: .4rem; }
.bar-label { font-weight: 600; }
.bar-head strong { font-family: var(--font-head); color: var(--forest-900); font-variant-numeric: tabular-nums; }
.bar-track { display: flex; height: 28px; background: var(--surface); border-radius: 6px; overflow: hidden; }
.bar-seg { height: 100%; transition: width .25s ease; }
.bar-seg + .bar-seg { border-left: 2px solid var(--white); }
.seg-stock { background: var(--fresh); }
.seg-confirmed { background: var(--forest); }
.seg-buffer { background: var(--orange); background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.45) 0 4px, transparent 4px 8px); }
.bar-note { margin: .35rem 0 0; font-size: .875rem; color: var(--muted); }
.h2 { font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.625rem); }
.demo-tile .badge { align-self: flex-start; }
.meal-illus-label { position: absolute; right: .6rem; bottom: .6rem; background: rgba(4, 51, 31, .82); color: #fff; font-size: .75rem; font-weight: 600; padding: .2rem .55rem; border-radius: 999px; }
