/* MDS food-cost tool. Owner-selected hierarchy: neutral inputs, forest results,
   orange primary actions and editorial highlights. Native CSS; no homepage shell. */
@font-face { font-family: Outfit; src: url('/assets/fonts/outfit-variable.ttf') format('truetype'); font-style: normal; font-weight: 100 900; font-display: swap; }
:root { color-scheme: light; --page: #fbfdfc; --ink: #143e38; --muted: #4d6961; --green: #236e5f; --mist: #eaf4ef; --tint: #d9eee4; --line: #c5d9cf; --orange: #ffae73; --orange-light: #fff0e2; --orange-ink: #4c2a17; --error: #9a332b; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 28px; }
body { margin: 0; background: var(--page); color: var(--ink); font: 17px/1.55 Outfit, system-ui, sans-serif; }
a { color: inherit; text-underline-offset: 4px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
:focus, :focus-visible { outline: none; }
:is(input, textarea, select, button, a, summary):focus { box-shadow: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 500; letter-spacing: -.045em; line-height: 1.1; }
h2 { font-size: clamp(29px, 3.5vw, 36px); }
h3 { font-size: 25px; }
p { color: var(--muted); }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.wrap { width: min(760px, calc(100% - 48px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 20px; top: -100px; padding: 12px 20px; background: var(--ink); color: white; z-index: 2; }
.skip-link:focus { top: 10px; }
.site-header { height: 80px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 17px; font-weight: 600; letter-spacing: -.025em; line-height: 1.08; }
.site-header nav { display: flex; align-items: center; gap: 30px; font-size: 15px; }
.site-header nav > a:not(.button) { text-decoration: none; }
.site-header nav > a:hover { text-decoration: underline; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 13px 25px; border: 1px solid transparent; border-radius: 100px; background: var(--orange); color: var(--orange-ink); font-size: 16px; font-weight: 550; line-height: 1.2; text-decoration: none; white-space: nowrap; transition: background .18s, transform .18s; }
.button:hover { background: #ffbd8d; }
.button:active { transform: scale(.98); }
.button-small { min-height: 44px; font-size: 15px; padding: 10px 18px; background: var(--orange-light); }
.button-secondary { min-height: 44px; padding: 10px 18px; background: var(--orange-light); border-color: #efc6a8; font-size: 14px; }
.button-dark { background: var(--ink); color: var(--page); }
.button-dark:hover { background: var(--green); }
.quiet-button { background: none; border: 0; padding: 8px; color: var(--ink); font-size: 13px; min-height: 44px; text-decoration: underline; text-underline-offset: 4px; }
.eyebrow { color: #985024; text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 600; }
.hero { padding-block: 42px 46px; }
.hero h1 { font-size: clamp(36px, 4.7vw, 48px); }
.hero h1 span { color: var(--green); }
.hero-copy { max-width: 650px; margin-top: 22px; font-size: 20px; }
.hero .button { margin-top: 24px; }
.calculator-top { display: flex; justify-content: space-between; align-items: end; gap: 24px; padding-bottom: 24px; }
.calculator-top h2 { font-size: 28px; }
.calculator-top p { font-size: 15px; margin-top: 8px; }
.currency-label { min-width: 118px; }
.calculator-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.inputs-panel { min-width: 0; border: 1px solid var(--line); border-radius: 28px; background: white; padding: 28px; }
.input-section { min-width: 0; border: 0; padding: 0; margin: 0; }
.input-section + .input-section { margin-top: 30px; }
.input-section legend { width: 100%; padding: 0; margin-bottom: 14px; font-size: 23px; font-weight: 500; letter-spacing: -.025em; }
.step-number { display: inline-grid; place-items: center; vertical-align: middle; width: 30px; height: 30px; margin-right: 8px; border-radius: 50%; background: var(--orange-light); color: #8b471d; font-size: 15px; font-weight: 600; }
.section-intro { margin-bottom: 20px; font-size: 14px; }
label { display: block; font-size: 13px; line-height: 1.4; font-weight: 500; }
input, select { width: 100%; min-width: 0; min-height: 46px; border: 1px solid #adc5b8; border-radius: 9px; background: #fff; color: var(--ink); padding: 10px; margin-top: 7px; font-size: 16px; line-height: 1.25; font-weight: 400; font-variant-numeric: tabular-nums; }
input::placeholder { color: var(--muted); opacity: 1; }
input[aria-invalid=true], select[aria-invalid=true] { border-color: var(--error); background: #fff8f6; }
.ingredient-row { margin-bottom: 16px; }
.ingredient-fields { display: grid; grid-template-columns: minmax(120px,1.3fr) minmax(120px,1fr) minmax(90px,.8fr) 44px; gap: 14px; align-items: end; }
.amount-field { display: grid; grid-template-columns: minmax(0,1fr) 55px; gap: 4px; }
.unit-label { align-self: end; }
.unit-label select { padding-inline: 4px; font-size: 14px; }
.ingredient-fields input::-webkit-inner-spin-button { -webkit-appearance: none; }
.icon-button { display: grid; place-items: center; width: 44px; min-height: 46px; border: 0; background: none; color: var(--muted); border-radius: 10px; }
.icon-button:hover { background: var(--orange-light); color: var(--orange-ink); }
.ingredient-error { color: var(--error); font-size: 12px; margin-top: 8px; }
#add-ingredient { margin-top: 4px; }
.field-help { margin-top: 14px; font-size: 13px; line-height: 1.55; }
.field-help strong { color: var(--ink); font-weight: 500; }
.cost-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.recipe-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 13px; margin-top: 24px; }
.recipe-toolbar > div { margin-left: auto; }
#recipe-state { color: var(--muted); font-size: 12px; }
.results-panel { min-width: 0; align-self: stretch; }
.results-sticky { padding: 30px; border-radius: 28px; background: var(--ink); color: #f5fcf8; }
.results-header { display: flex; align-items: center; gap: 12px; }
.results-header h2 { font-size: 25px; }
.results-header .material-symbols-rounded { color: var(--orange); font-size: 28px; }
.results-context { color: #c5dbd3; font-size: 12px; margin-top: 10px; }
.result-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 30px; }
.result-pair > div { min-width: 0; }
.result-pair span { display: block; color: #c5dbd3; font-size: 12px; }
.result-pair output { display: block; font-size: clamp(29px, 3.1vw, 43px); font-weight: 500; line-height: 1.2; letter-spacing: -.045em; margin-top: 7px; overflow-wrap: anywhere; }
.contribution-result { padding: 22px 0; margin-top: 22px; border-block: 1px solid #52776d; }
.contribution-result > span { display: block; color: #e1ece7; font-size: 14px; }
.contribution-result output { display: block; color: var(--orange); font-size: 62px; font-weight: 500; line-height: 1.2; letter-spacing: -.055em; overflow-wrap: anywhere; }
.contribution-result p { color: #c5dbd3; font-size: 12px; margin-top: 5px; }
.contribution-result[data-negative=true] output { color: #ffb0a3; }
.cost-breakdown { margin: 22px 0 0; font-size: 14px; }
.cost-breakdown > div { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; margin-top: 9px; }
.cost-breakdown dt { color: #c5dbd3; }
.cost-breakdown dd { margin: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cost-breakdown .total-line { border-top: 1px solid #52776d; margin-top: 16px; padding-top: 13px; font-weight: 500; }
.cost-breakdown .total-line dt { color: #f5fcf8; }
.result-insight { color: #d4e6dd; margin-top: 20px; font-size: 14px; }
.download-button { width: 100%; margin-top: 24px; }
.download-help { color: #c5dbd3; font-size: 12px; text-align: center; margin-top: 11px; }
.notice { padding: 15px; border: 1px solid #dbaba2; border-radius: 12px; background: #fff2ed; margin-top: 18px; color: var(--error); font-size: 13px; }
.notice p { color: var(--error); }
.notice ul { padding-left: 18px; margin-bottom: 0; }
.notice a { color: var(--error); }
.section-heading { max-width: 820px; }
.section-heading > p:not(.eyebrow) { margin-top: 20px; max-width: 680px; font-size: 18px; }
.section-heading > .eyebrow { margin-bottom: 17px; }
.how-section { padding-block: 64px; }
.explanation-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; margin-top: 28px; }
.formula { padding: 32px; border-radius: 26px; background: var(--mist); }
.formula > span { font-size: 15px; color: var(--muted); }
.formula strong { display: block; font-size: clamp(28px, 3vw, 36px); line-height: 1.2; letter-spacing: -.05em; font-weight: 500; margin-top: 15px; }
.formula p { margin-top: 16px; font-size: 13px; }
.explanation-copy h3 { font-size: 25px; }
.explanation-copy p { margin-top: 16px; font-size: 16px; }
.resources { padding-top: 20px; }
.resource-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 28px; }
.resource-card { display: block; border: 1px solid var(--line); border-radius: 28px; overflow: hidden; text-decoration: none; background: white; transition: transform .2s, border-color .2s; }
.resource-card:hover { transform: translateY(-3px); border-color: var(--green); }
.resource-image { overflow: hidden; }
.resource-image img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1.65; }
.resource-copy { padding: 30px; }
.resource-type { display: block; font-size: 13px; color: var(--green); margin-bottom: 14px; }
.resource-copy h3 { font-size: 32px; line-height: 1.12; }
.resource-copy p { margin-top: 14px; font-size: 16px; max-width: 450px; }
.resource-action { display: flex; align-items: center; gap: 12px; margin-top: 24px; font-size: 15px; font-weight: 500; }
.resource-action > .material-symbols-rounded { width: 36px; height: 36px; border-radius: 50%; background: var(--orange-light); color: var(--orange-ink); }
.resource-orange { background: var(--orange); border-color: transparent; color: var(--orange-ink); }
.resource-orange .resource-type, .resource-orange p { color: #674026; }
.resource-orange .resource-action > .material-symbols-rounded { background: #ffe1c9; }
.resource-photo { display: grid; grid-template-columns: .7fr 1fr; background: var(--mist); border-color: transparent; }
.resource-photo .resource-image { height: 100%; }
.resource-photo .resource-image img { height: 100%; aspect-ratio: auto; }
.resource-photo .resource-copy { padding: 25px; }
.resource-photo h3 { font-size: 27px; }
.reading-guides { margin-top: 36px; }
.guide { padding: 22px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 28px; }
.guide summary, .faq summary { font-size: 20px; cursor: pointer; font-weight: 500; }
.guide > div { max-width: 850px; padding-top: 18px; }
.guide p + p { margin-top: 14px; }
.guide a { display: inline-block; margin-top: 16px; font-weight: 500; }
.faq { padding-block: 60px; }
.faq-list { max-width: 920px; margin-top: 30px; }
.faq details { padding: 22px 0; border-bottom: 1px solid var(--line); }
.faq details p { padding-top: 16px; font-size: 16px; max-width: 800px; }
.closing { padding: 32px; border-radius: 28px; background: var(--orange); color: var(--orange-ink); }
.closing h2 { font-size: clamp(29px, 3vw, 36px); }
.closing p { max-width: 630px; color: #674026; margin-top: 16px; }
.closing .button { margin-top: 24px; }
.site-footer { padding-block: 38px; display: flex; align-items: center; justify-content: space-between; gap: 20px; font-size: 13px; }
.site-footer .brand { font-size: 14px; }
.site-footer p { font-size: 13px; }
@media (max-width: 767px) {
  .wrap { width: min(760px, calc(100% - 32px)); }
  .site-header { height: 74px; }
  .site-header nav > a:not(.button) { display: none; }
  .brand { font-size: 14px; }
  .brand img { width: 32px; height: 32px; }
  .button-small { font-size: 13px; padding-inline: 14px; }
  .hero { padding-block: 30px 34px; }
  .hero h1 { font-size: clamp(36px,7.5vw,48px); }
  .hero-copy { font-size: 18px; }
  .eyebrow { font-size: 10px; }
  .hero .button { font-size: 15px; }
  .calculator-top { gap: 15px; align-items: start; }
  .calculator-top h2 { font-size: 23px; }
  .calculator-top p { font-size: 13px; }
  .currency-label { min-width: 90px; max-width: 100px; flex-shrink: 0; }
  .currency-label select { font-size: 14px; }
  .inputs-panel { padding: 20px 16px; border-radius: 24px; }
  .input-section legend { font-size: 21px; }
  .ingredient-row { padding-bottom: 16px; margin-bottom: 17px; border-bottom: 1px solid #e2eae5; }
  .ingredient-fields { grid-template-columns: minmax(0,1.25fr) minmax(0,1fr) 40px; gap: 10px; }
  .ingredient-name-label { grid-column: 1/3; }
  .ingredient-fields > .remove-ingredient { grid-column: 3; grid-row: 1; }
  .ingredient-fields > .amount-field { grid-column: 1; }
  .ingredient-fields > label:last-of-type { grid-column: 2/4; }
  .ingredient-fields label { font-size: 12px; }
  .icon-button { width: 40px; }
  .cost-fields { gap: 16px 12px; }
  .cost-fields label { font-size: 12px; }
  .quiet-button { font-size: 12px; padding: 6px; }
  .results-sticky { padding: 26px; border-radius: 24px; }
  .result-pair output { font-size: 42px; }
  .how-section { padding-block: 60px; }
  .explanation-grid { gap: 26px; }
  .formula { padding: 27px; }
  .section-heading > p:not(.eyebrow) { font-size: 17px; }
  .resources { padding-top: 10px; }
  .resource-grid { gap: 18px; }
  .resource-copy { padding: 26px; }
  .resource-copy h3 { font-size: 29px; }
  .resource-photo .resource-copy { padding: 22px; }
  .resource-photo h3 { font-size: 25px; }
  .resource-photo p { font-size: 14px; }
  .resource-photo .resource-action { font-size: 13px; gap: 8px; }
  .guide summary, .faq summary { font-size: 18px; }
  .guide p { font-size: 16px; }
  .closing { padding: 30px; }
  .closing h2 { font-size: 33px; }
  .closing p { font-size: 16px; }
  .site-footer { flex-wrap: wrap; padding-block: 30px; }
  .site-footer p { width: 100%; order: 3; }
  .site-footer > a:last-child { font-size: 12px; }
}
@media (max-width: 380px) {
  .resource-photo { display: block; }
  .resource-photo .resource-image { display: none; }
  .hero h1 { font-size: 35px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .button:active, .resource-card:hover { transform: none; }
}
@media print {
  .site-header, .hero .button, .recipe-toolbar, .icon-button, #add-ingredient, .download-button, .download-help, .site-footer, .resources, .faq, .closing, .how-section { display: none !important; }
  .wrap { width: 100%; }
  .hero { padding: 0 0 20px; }
  .hero h1 { font-size: 30px; }
  .hero-copy { font-size: 14px; }
  .calculator-layout { display: block; }
  .results-sticky { position: static; margin-top: 24px; background: white; color: #143e38; }
  .results-sticky p, .results-sticky dt, .results-sticky span, .results-sticky output { color: #143e38; }
  .input-section, .ingredient-row, .results-sticky { break-inside: avoid; }
}

/* Pointer presses are momentary. Keyboard navigation uses fill, never a ring. */
button:not(:disabled), .button { transition: background-color .12s, color .12s, transform .12s; }
button:not(:disabled):active, .button:active { transform: scale(.98); }
html[data-keyboard-nav] :is(button, a, summary):focus-visible { background-color: var(--tint); color: var(--ink); }
@media (prefers-reduced-motion: reduce) {
  button:not(:disabled):active, .button:active { transform: none; }
}
