:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #302c2a;
  background: #fbf6f0;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #302c2a;
  --muted: #817975;
  --muted-light: #a39b95;
  --paper: #fffdfb;
  --line: #eee5dd;
  --rose: #b94d65;
  --rose-dark: #96364d;
  --rose-light: #fff0f2;
  --green: #287b63;
  --shadow: 0 18px 45px rgba(83, 48, 38, 0.055);
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 8% 1%, rgba(236, 199, 187, .24), transparent 26rem),
    #fbf6f0;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }

.page-shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 84px;
  border-bottom: 1px solid rgba(104, 81, 70, .1);
}

.brand { display: inline-flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; }
.brand-icon { display: grid; width: 36px; height: 36px; place-items: center; color: var(--rose); }
.brand-icon svg { width: 36px; height: 36px; }
.brand-name { color: #413a37; font-size: 18px; font-weight: 750; letter-spacing: -.065em; }
.brand-name span { color: var(--rose); }
.header-side { display: flex; align-items: center; gap: 16px; }
.home-link { color: var(--green); font-size: 11px; font-weight: 750; text-decoration: none; white-space: nowrap; }
.home-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.header-note { color: #817873; font-size: 12px; font-weight: 550; letter-spacing: .02em; }

.intro { padding: 43px 0 30px; max-width: 700px; }
.eyebrow { display: flex; align-items: center; gap: 9px; margin: 0 0 14px; color: var(--rose); font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.eyebrow span { width: 7px; height: 7px; border-radius: 50%; background: var(--rose); box-shadow: 0 0 0 4px rgba(185, 77, 101, .12); }
h1, h2, p { margin-top: 0; }
.intro h1 { margin-bottom: 11px; color: #302a27; font-family: Georgia, "Times New Roman", serif; font-size: clamp(34px, 4.4vw, 51px); font-weight: 500; letter-spacing: -.047em; line-height: 1.08; }
.intro-copy { max-width: 585px; margin-bottom: 0; color: #716965; font-size: 14px; line-height: 1.7; }

.example-notice { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 0 0 16px; padding: 14px 16px; border: 1px solid #d7e5d9; border-radius: 12px; background: #f0f7ef; color: #345945; }
.example-notice[hidden] { display: none; }
.example-notice div { display: grid; gap: 3px; }
.example-notice strong { font-size: 12px; }
.example-notice span { color: #68796c; font-size: 10px; }
.example-reset { min-height: 34px; padding: 0 11px; border: 1px solid #c9dccb; border-radius: 8px; background: #fff; color: #2f6249; font-size: 10px; font-weight: 750; white-space: nowrap; }
.example-reset:hover { background: #e8f2e7; }

.saved-bar { display: flex; align-items: center; gap: 11px; min-height: 70px; margin: 0 0 18px; padding: 12px 16px; border: 1px solid rgba(228, 215, 205, .9); border-radius: 13px; background: rgba(255, 253, 251, .72); }
.saved-copy { display: flex; flex: 1; align-items: center; gap: 10px; min-width: 165px; }
.saved-icon { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 9px; background: #f7e8e6; color: var(--rose); font-size: 15px; }
.saved-copy div { display: flex; flex-direction: column; gap: 2px; }
.saved-copy strong { color: #453d39; font-size: 12px; font-weight: 700; }
.saved-copy span { color: #938984; font-size: 10px; }
.saved-select-wrap { width: min(240px, 28vw); }
.saved-select-wrap select { width: 100%; min-width: 0; height: 38px; padding: 0 31px 0 11px; border: 1px solid #e9dfd7; border-radius: 8px; outline: none; background: #fffdfb; color: #6c625d; font-size: 11px; }
.saved-select-wrap select:focus-visible { border-color: #cc8593; box-shadow: 0 0 0 3px rgba(185, 77, 101, .1); }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 13px; border: 1px solid transparent; border-radius: 8px; font-size: 11px; font-weight: 700; transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button-quiet { border-color: #eadfd8; background: #fffdfb; color: #655b56; }
.button-quiet:hover:not(:disabled), .button-outline:hover:not(:disabled) { border-color: #d8b9b5; background: #fff7f5; }
.button-danger { padding: 0 10px; background: transparent; color: #9b555e; }
.button-danger:hover:not(:disabled) { background: #fff0f1; }
.button-outline { border-color: #e7d9d1; background: #fffdfb; color: #5f534e; }
.button-primary { border-color: var(--rose); background: var(--rose); color: white; box-shadow: 0 6px 13px rgba(185, 77, 101, .18); }
.button-primary:hover { border-color: var(--rose-dark); background: var(--rose-dark); }
.add-button { white-space: nowrap; }
.add-button span { color: var(--rose); font-size: 17px; font-weight: 400; line-height: 0; }

.calculator-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 18px; }
.form-column { display: grid; gap: 14px; min-width: 0; }
.card { padding: 21px 22px; border: 1px solid #eee5dd; border-radius: 13px; background: var(--paper); box-shadow: 0 7px 24px rgba(83, 48, 38, .025); }
.section-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.section-heading-spread { align-items: center; justify-content: space-between; gap: 12px; }
.heading-with-number { display: flex; align-items: flex-start; gap: 12px; }
.section-number { display: grid; flex: 0 0 29px; width: 29px; height: 29px; place-items: center; border: 1px solid #efdadb; border-radius: 8px; background: #fff6f5; color: var(--rose); font-size: 10px; font-weight: 800; }
.section-heading h2 { margin: 1px 0 4px; color: #37312e; font-size: 14px; font-weight: 750; letter-spacing: -.02em; }
.section-heading p { margin: 0; color: #958b85; font-size: 11px; line-height: 1.45; }

.recipe-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(205px, .47fr); gap: 13px; padding-left: 41px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; color: #625954; font-size: 11px; font-weight: 650; }
.field input, .field select { width: 100%; height: 39px; padding: 0 11px; border: 1px solid #e7ded8; border-radius: 8px; outline: none; background: #fff; color: #3b3532; font-size: 12px; font-weight: 500; transition: border .15s ease, box-shadow .15s ease; }
.field input::placeholder { color: #b5aca7; }
.field input:focus, .field select:focus { border-color: #cd8794; box-shadow: 0 0 0 3px rgba(185, 77, 101, .09); }
.field input[aria-invalid="true"] { border-color: #c94b5a; box-shadow: 0 0 0 3px rgba(201, 75, 90, .09); }
.input-suffix, .currency-input, .percent-input { display: flex; align-items: center; height: 39px; border: 1px solid #e7ded8; border-radius: 8px; background: white; }
.input-suffix:focus-within, .currency-input:focus-within, .percent-input:focus-within { border-color: #cd8794; box-shadow: 0 0 0 3px rgba(185, 77, 101, .09); }
.input-suffix input, .currency-input input, .percent-input input { height: 37px; border: 0; border-radius: 8px; box-shadow: none !important; }
.input-suffix input { min-width: 0; padding-right: 3px; }
.input-suffix > span { padding: 0 10px 0 4px; color: #9a908a; font-size: 10px; font-weight: 500; white-space: nowrap; }

.measurement-hint { display: flex; align-items: flex-start; gap: 9px; margin: 0 0 15px 41px; padding: 10px 12px; border-radius: 8px; background: #fbf5f0; }
.hint-icon { display: grid; flex: 0 0 16px; width: 16px; height: 16px; place-items: center; border-radius: 50%; background: #e9d3cc; color: #745e55; font-family: Georgia, serif; font-size: 10px; font-style: italic; font-weight: 700; }
.measurement-hint p { margin: 0; color: #766b65; font-size: 10px; line-height: 1.5; }
.measurement-hint strong { color: #594d48; }
.ingredient-rows { display: grid; gap: 9px; }
.ingredient-row { padding: 13px 14px 12px; border: 1px solid #eee6df; border-radius: 10px; background: #fffdfa; transition: border-color .15s ease, background .15s ease; }
.ingredient-row.is-incomplete { border-color: #e6c5c4; background: #fffafa; }
.ingredient-row-top { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 11px; }
.ingredient-row-top .field { flex: 1; }
.ingredient-row .field { gap: 5px; color: #8b817a; font-size: 9px; font-weight: 650; }
.ingredient-row .field input, .ingredient-row .field select { height: 35px; padding: 0 9px; font-size: 11px; }
.ingredient-row .field select { padding-right: 24px; }
.remove-row { display: grid; flex: 0 0 31px; width: 31px; height: 35px; place-items: center; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #a49791; font-size: 17px; }
.remove-row:hover { border-color: #f0d9dc; background: #fff2f3; color: #ad5061; }
.ingredient-grid { display: grid; grid-template-columns: minmax(100px, 1fr) 93px minmax(100px, 1fr) minmax(100px, 1fr); gap: 9px; }
.ingredient-result { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-height: 22px; margin-top: 7px; color: #968a83; font-size: 10px; }
.ingredient-result strong { color: #51443e; font-size: 11px; font-weight: 750; }
.ingredient-row.is-incomplete .ingredient-result strong { color: #a45b60; font-size: 9px; font-weight: 600; }
.ingredient-note { margin: 12px 0 0; color: #988e87; font-size: 10px; line-height: 1.5; }

.cost-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; padding-left: 41px; }
.cost-fields .field small { margin-top: -2px; color: #a09690; font-size: 9px; font-weight: 450; }
.currency-input > span { padding-left: 11px; color: #988d86; font-size: 11px; font-weight: 600; }
.currency-input input { padding-left: 7px; }
.margin-field { max-width: 230px; margin-left: 41px; }
.percent-input { width: 132px; }
.percent-input input { text-align: center; }
.percent-input > span { padding: 0 13px 0 6px; color: #867a74; font-size: 13px; }
.formula-note { display: flex; align-items: flex-start; gap: 8px; margin: 14px 0 0 41px; color: #93877f; font-size: 10px; line-height: 1.55; }
.formula-note span { color: var(--rose); font-size: 14px; font-weight: 700; }

.summary-card { position: sticky; top: 18px; overflow: hidden; padding: 23px 22px 19px; border: 1px solid #e9d9d4; border-radius: 14px; background: linear-gradient(145deg, #fffdfb 0%, #fffaf7 100%); box-shadow: var(--shadow); }
.summary-card::before { position: absolute; top: 0; right: 0; left: 0; height: 3px; background: linear-gradient(90deg, #d88291, #b94d65 56%, #e6b9ad); content: ""; }
.summary-topline { display: flex; align-items: center; gap: 9px; color: #9a6965; font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.summary-icon { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 7px; background: #f9e9e7; color: var(--rose); }
.summary-icon svg { width: 16px; height: 16px; }
.summary-card h2 { margin: 19px 0 5px; color: #3b302d; font-family: Georgia, "Times New Roman", serif; font-size: 22px; font-weight: 500; letter-spacing: -.04em; }
.summary-description { margin: 0; color: #948983; font-size: 10px; line-height: 1.55; }
.suggested-price { overflow: hidden; margin: 10px 0 10px; color: #ac425a; font-size: clamp(34px, 3vw, 42px); font-weight: 750; letter-spacing: -.065em; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.target-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 30px; background: #f5ebe5; color: #7b655b; font-size: 9px; }
.target-chip strong { color: #6e514d; font-size: 10px; }
.target-dot { width: 6px; height: 6px; border-radius: 50%; background: #c66a77; }
.summary-divider { height: 1px; margin: 19px 0 13px; background: #eee4dd; }
.summary-list { display: grid; gap: 11px; margin: 0; }
.summary-list > div, .batch-price-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.summary-list dt, .batch-price-row span { color: #827771; font-size: 10px; }
.summary-list dd, .batch-price-row strong { margin: 0; color: #514640; font-size: 11px; font-weight: 650; }
.summary-list .summary-total { margin-top: 3px; padding-top: 11px; border-top: 1px dashed #e9ddd6; }
.summary-list .summary-total dt { color: #5c4d47; font-weight: 700; }
.summary-list .summary-total dd { color: #423631; font-size: 12px; font-weight: 800; }
.per-unit-box { display: grid; gap: 8px; margin-top: 14px; padding: 12px; border-radius: 9px; background: #f8f1ec; }
.per-unit-box div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.per-unit-box span { color: #897c74; font-size: 9px; }
.per-unit-box strong { color: #51443e; font-size: 10px; font-weight: 750; }
.batch-price-row { margin-top: 13px; padding: 0 1px; }
.batch-price-row strong { color: #a9475d; font-size: 12px; }
.calculation-status { min-height: 32px; margin: 12px 0 11px; color: #a07168; font-size: 9px; line-height: 1.5; }
.calculation-status.is-error { color: #a13f4d; }
.save-button { width: 100%; min-height: 42px; font-size: 11px; }
.privacy-note { display: flex; align-items: flex-start; gap: 6px; margin: 12px 0 0; color: #9a9089; font-size: 9px; line-height: 1.5; }
.privacy-note span { color: #579078; font-size: 13px; line-height: 1; }
.learning-card { display: grid; gap: 6px; margin-top: 16px; padding: 14px; border: 1px solid #d9e7dc; border-radius: 11px; background: #f1f7f0; }
.learning-card > span { color: #6e8b72; font-size: 8px; font-weight: 850; letter-spacing: .13em; }
.learning-card strong { color: #335a42; font-size: 11px; line-height: 1.4; }
.learning-card p { margin: 0; color: #6e7e71; font-size: 9px; line-height: 1.5; }
.learning-card a { display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 2px; color: #286143; font-size: 10px; font-weight: 800; text-decoration: none; }
.learning-card a:hover { text-decoration: underline; text-underline-offset: 3px; }
.learning-card a span { font-size: 15px; }

.site-footer { display: flex; justify-content: space-between; gap: 15px; padding: 24px 2px 29px; color: #a1968f; font-size: 9px; }
.footer-separator { padding: 0 4px; color: #c77a85; }
.sr-only { position: absolute; overflow: hidden; width: 1px; height: 1px; padding: 0; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

@media (max-width: 900px) {
  .page-shell { width: min(760px, calc(100% - 36px)); }
  .calculator-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 13px; }
  .card { padding: 19px 17px; }
  .summary-card { padding-right: 18px; padding-left: 18px; }
  .ingredient-grid { grid-template-columns: minmax(90px, 1fr) 78px minmax(90px, 1fr) minmax(90px, 1fr); gap: 7px; }
  .ingredient-row { padding-right: 11px; padding-left: 11px; }
  .saved-bar { gap: 8px; padding-right: 11px; padding-left: 11px; }
}

@media (max-width: 720px) {
  .page-shell { width: min(560px, calc(100% - 28px)); }
  .site-header { min-height: 68px; }
  .header-note { max-width: 120px; font-size: 10px; text-align: right; }
  .header-side { gap: 10px; }
  .intro { padding: 32px 0 23px; }
  .intro h1 { font-size: clamp(34px, 8vw, 45px); }
  .intro-copy { font-size: 12px; }
  .example-notice { align-items: flex-start; flex-direction: column; }
  .saved-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 9px; padding: 12px; }
  .saved-copy { grid-column: 1 / -1; }
  .saved-select-wrap { width: auto; grid-column: 1 / 2; }
  .saved-select-wrap select { height: 36px; }
  .saved-bar .button { min-height: 36px; padding: 0 10px; }
  .calculator-layout { grid-template-columns: 1fr; }
  .summary-card { position: static; grid-row: auto; }
  .summary-card h2 { margin-top: 13px; }
  .suggested-price { font-size: 40px; }
  .summary-divider { margin: 14px 0 11px; }
  .summary-list { gap: 9px; }
  .summary-card { padding: 20px; }
  .form-column { gap: 11px; }
  .card { padding: 18px 16px; }
}

@media (max-width: 480px) {
  .page-shell { width: calc(100% - 22px); }
  .brand-name { font-size: 16px; }
  .brand-icon, .brand-icon svg { width: 32px; height: 32px; }
  .header-note { max-width: 105px; font-size: 9px; }
  .home-link { font-size: 10px; }
  .intro { padding-top: 27px; }
  .intro h1 { font-size: 35px; }
  .desktop-break { display: none; }
  .saved-bar { grid-template-columns: minmax(0, 1fr) auto auto; }
  .saved-copy span { font-size: 9px; }
  .saved-bar .button { font-size: 10px; }
  .section-heading-spread { align-items: flex-start; flex-direction: column; }
  .section-heading-spread .add-button { align-self: stretch; }
  .recipe-fields, .cost-fields { grid-template-columns: 1fr; padding-left: 0; }
  .yield-field { max-width: 230px; }
  .measurement-hint { margin-left: 0; }
  .ingredient-row-top { align-items: flex-end; }
  .ingredient-grid { grid-template-columns: 1fr 1fr; }
  .ingredient-grid .field:nth-child(1), .ingredient-grid .field:nth-child(2) { grid-row: 1; }
  .ingredient-grid .field:nth-child(3), .ingredient-grid .field:nth-child(4) { grid-row: 2; }
  .ingredient-row .field { font-size: 9px; }
  .ingredient-row .field input, .ingredient-row .field select { font-size: 12px; }
  .ingredient-result { justify-content: flex-start; }
  .margin-field, .formula-note { margin-left: 0; }
  .site-footer { flex-direction: column; gap: 7px; padding-top: 18px; }
}

@media (max-width: 380px) {
  .saved-bar { grid-template-columns: minmax(0, 1fr) auto; }
  .saved-select-wrap { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
