:root {
  color-scheme: light;
  --bg: #f4f8f6;
  --surface: #ffffff;
  --ink: #17231f;
  --muted: #63716b;
  --line: #d8e5df;
  --green: #246b54;
  --blue: #245fa8;
  --coral: #d36d4c;
  --gold: #c69332;
  --shadow: 0 24px 60px rgba(23, 35, 31, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  background:
    linear-gradient(135deg, rgba(36, 107, 84, 0.12), transparent 34rem),
    linear-gradient(225deg, rgba(211, 109, 76, 0.1), transparent 28rem),
    var(--bg);
  color: var(--ink);
  margin: 0;
}

body,
.hero > *,
.tool-panel > *,
.resource-section > *,
.boundary-section > * {
  min-width: 0;
}

a { color: inherit; }

.site-header, .site-footer {
  align-items: center;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 72px);
}

.site-header {
  background: rgba(244, 248, 246, 0.96);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand, .site-header nav, .site-footer nav, .hero-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
}

.brand {
  font-size: 1.18rem;
  font-weight: 850;
  gap: 12px;
  text-decoration: none;
}

.brand img {
  border: 1px solid var(--line);
  border-radius: 12px;
}

.site-header nav, .site-footer nav { gap: 12px 24px; }

.site-header a, .site-footer a {
  font-weight: 760;
  text-decoration-color: rgba(36, 95, 168, 0.28);
  text-underline-offset: 6px;
}

.hero {
  align-items: center;
  display: grid;
  gap: clamp(28px, 5vw, 70px);
  grid-template-columns: minmax(320px, 0.85fr) minmax(420px, 1.15fr);
  padding: clamp(44px, 6vw, 86px) clamp(20px, 5vw, 72px) 36px;
}

.hero-copy { max-width: 610px; }

.section-tag {
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0;
  margin: 0 0 14px;
  text-transform: uppercase;
}

.section-tag.subtle { color: var(--coral); }

h1, h2, p { margin-top: 0; }

h1 {
  font-size: clamp(2.4rem, 5vw, 5rem);
  letter-spacing: 0;
  line-height: 0.96;
  margin-bottom: 24px;
}

h2 {
  font-size: clamp(1.65rem, 3vw, 2.55rem);
  letter-spacing: 0;
  line-height: 1.05;
  margin-bottom: 14px;
}

p {
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.65;
}

.hero-actions { gap: 12px; margin-top: 26px; }

.button {
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font-size: 0.96rem;
  font-weight: 850;
  justify-content: center;
  min-height: 44px;
  padding: 12px 16px;
  text-decoration: none;
}

.button.primary {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
}

.button.secondary, .button.small {
  background: #ffffff;
  color: var(--ink);
}

.button.small { min-height: 38px; }

.note {
  color: var(--coral);
  font-size: 0.92rem;
  font-weight: 750;
  margin-top: 16px;
}

.product-shot, .boundary-section, .tool-panel, .resource-section {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.product-shot {
  margin: 0;
  overflow: hidden;
}

.product-shot img, .boundary-section img {
  display: block;
  height: auto;
  max-width: 100%;
  width: 100%;
}

figcaption {
  color: var(--muted);
  font-size: 0.86rem;
  padding: 12px 16px 16px;
}

.tool-panel, .resource-section, .boundary-section {
  margin: 24px clamp(20px, 5vw, 72px);
  padding: clamp(22px, 4vw, 38px);
}

.tool-heading, .boundary-section {
  align-items: center;
  display: flex;
  gap: 24px;
  justify-content: space-between;
}

.field-grid, .result-grid, .resource-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label, .result-card, .resource-link, .check-row {
  background: #f8fbfa;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: grid;
  font-size: 0.92rem;
  font-weight: 750;
  gap: 8px;
  padding: 14px;
}

input, select {
  background: #ffffff;
  border: 1px solid #cbdad3;
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  min-height: 42px;
  padding: 10px 12px;
  width: 100%;
}

.meal-rows { display: grid; gap: 10px; }

.meal-row {
  align-items: center;
  grid-template-columns: 92px minmax(160px, 1fr) 120px 120px;
}

.meal-rows.compact .meal-row {
  grid-template-columns: 74px minmax(150px, 1fr) 110px 150px;
}

.result-grid { margin-top: 18px; }

.result-card strong, .resource-link strong {
  color: var(--ink);
  font-size: 1.1rem;
}

.resource-section {
  box-shadow: none;
}

.section-copy { max-width: 720px; }

.resource-link {
  text-decoration: none;
}

.resource-link:hover {
  border-color: rgba(36, 95, 168, 0.55);
}

.home-link {
  background: #fff7ed;
  border-color: rgba(198, 147, 50, 0.35);
}

.boundary-section {
  display: grid;
  grid-template-columns: minmax(260px, 0.62fr) minmax(280px, 0.38fr);
  margin-bottom: 44px;
}

.boundary-section img {
  border-radius: 8px;
}

.text-link {
  color: var(--blue);
  font-weight: 850;
  text-underline-offset: 6px;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
}

@media (max-width: 900px) {
  body {
    overflow-x: hidden;
  }

  .hero, .boundary-section, .field-grid, .result-grid, .resource-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 24px;
    padding: 32px 18px 28px;
  }

  .hero-copy,
  .product-shot {
    max-width: 100%;
    width: 100%;
  }

  h1 {
    font-size: clamp(1.85rem, 8.8vw, 2.35rem);
    line-height: 1.04;
    overflow-wrap: break-word;
  }

  p {
    font-size: 0.98rem;
  }

  .meal-row, .meal-rows.compact .meal-row {
    grid-template-columns: 1fr;
  }

  .tool-heading, .site-header, .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand {
    font-size: 1rem;
    max-width: 100%;
  }

  .brand span {
    overflow-wrap: anywhere;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    text-align: center;
    width: 100%;
  }
}

@media (max-width: 430px) {
  .site-header,
  .site-footer {
    padding: 14px 16px;
  }

  .tool-panel,
  .resource-section,
  .boundary-section {
    margin-left: 16px;
    margin-right: 16px;
    padding: 20px;
  }
}
