:root {
  color-scheme: light;
  --paper: #f8f7f0;
  --white: #fffefb;
  --ink: #1d3126;
  --green: #214638;
  --green-deep: #18372d;
  --muted: #58675b;
  --line: #dde2d5;
  --lime: #e4edaa;
  --warm: #f3e8d8;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; line-height: 1.5; min-width: 280px; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid #6d5624; outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
.wrap { width: min(1100px, calc(100% - 48px)); margin-inline: auto; }
.topbar { background: var(--white); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 70px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 1.02rem; font-weight: 780; letter-spacing: -.025em; }
.brand-accent { color: #3d684b; }
.brand-icon { width: 34px; height: 34px; flex: none; border-radius: 11px; background: var(--green); display: grid; place-items: center; }
.brand-icon span { width: 15px; height: 10px; border: 1.6px solid var(--lime); border-radius: 2px 2px 7px 7px; position: relative; transform: rotate(-12deg); }
.brand-icon span::before { content: ""; position: absolute; height: 2px; width: 6px; border-radius: 1px; background: var(--lime); top: 0; left: 12px; }
.brand-icon span::after { content: ""; position: absolute; height: 4px; width: 2px; border-radius: 2px; background: var(--lime); top: -7px; left: 6px; }
.topbar nav { display: flex; gap: 7px; }
.nav-button { color: var(--muted); border: 0; border-radius: 999px; padding: 8px 13px; background: transparent; text-align: center; font-size: .89rem; font-weight: 650; line-height: 1.25; min-height: 40px; }
.nav-button:hover, .nav-button.current { background: #eef0e2; color: var(--green); }
.hero { margin-top: 26px; display: grid; grid-template-columns: 1fr 1.04fr; background: var(--green); border-radius: 24px; overflow: hidden; }
.hero-copy { min-width: 0; padding: clamp(30px, 5.4vw, 65px); align-self: center; }
.hero h1 { color: var(--white); font: 700 clamp(3rem, 6vw, 5.1rem)/.96 Georgia, serif; letter-spacing: -.067em; }
.hero h1 em { color: var(--lime); font-weight: inherit; }
.hero p { color: #f2f3e9; max-width: 26rem; margin-top: 22px; }
.hero-image { width: 100%; height: 100%; min-height: 270px; max-height: 365px; object-fit: cover; object-position: center; display: block; }
.workspace { display: grid; grid-template-columns: 1.86fr 1fr; gap: 16px; margin-top: 18px; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: 20px; background: var(--white); padding: clamp(17px, 2.4vw, 27px); }
.panel h2 { font-size: clamp(1.23rem, 2.7vw, 1.6rem); line-height: 1.25; letter-spacing: -.042em; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.panel-heading p, .section-heading p, .pantry-fold p, .picked p { color: var(--muted); margin-top: 5px; }
.counter { background: #edf1df; color: var(--green); font-size: .88rem; min-width: 57px; text-align: center; border-radius: 99px; padding: 5px 8px; white-space: nowrap; font-weight: 720; }
.ingredient-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ingredient { display: flex; justify-content: flex-start; align-items: center; gap: 8px; min-height: 46px; color: var(--ink); border-radius: 10px; border: 1px solid var(--line); background: #fbfbf6; padding: 6px 9px; font-weight: 650; text-align: left; font-size: .91rem; }
.ingredient:hover, .ingredient[aria-pressed="true"] { border-color: #557252; background: #e9efce; }
.ingredient[aria-pressed="true"] { box-shadow: inset 0 0 0 1px #557252; }
.ingredient .emoji { font-size: 1.07rem; line-height: 1; }
.inline-status { margin-top: 9px; color: #79501d; font-size: .9rem; }
.inline-status:empty, #choose-status:empty, #study-info:empty { display: none; }
.picked { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-height: 50px; margin-bottom: 3px; }
.picked p { margin: 0; }
.picked .token { display: inline-flex; align-items: center; gap: 7px; border: 1px solid #c0ccb1; border-radius: 999px; background: #eef2df; padding: 3px 9px; color: var(--green); font-size: .88rem; font-weight: 650; }
.pantry-fold { padding: 10px 0 12px; border-top: 1px solid var(--line); }
.pantry-fold summary { cursor: pointer; color: var(--green); min-height: 30px; font-weight: 680; font-size: .94rem; }
.summary-count { padding-left: 4px; color: var(--muted); font-size: .86rem; font-weight: 400; }
.pantry-fold p { font-size: .91rem; }
.pantry-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; padding-top: 8px; }
.pantry-grid label { display: flex; gap: 5px; min-height: 32px; align-items: center; font-size: .9rem; }
input[type="checkbox"] { accent-color: var(--green); width: 16px; height: 16px; margin: 0; flex: none; }
.primary, .secondary { min-height: 47px; border-radius: 11px; font-weight: 730; padding: 10px 16px; }
.primary { width: 100%; border: 1px solid var(--green); background: var(--green); color: white; }
.primary:hover { background: var(--green-deep); }
.primary:disabled { cursor: default; background: #edf0e6; border-color: #e4e8dc; color: #62705f; }
.secondary { border: 1px solid #b8c7b9; background: var(--white); color: var(--green); }
.secondary:hover { background: #eef2e4; }
.results { margin-top: 27px; scroll-margin-top: 15px; }
.section-heading { margin-bottom: 14px; }
.section-heading h2, .catalog h1 { font-family: Georgia, serif; font-size: clamp(1.75rem, 4vw, 2.9rem); line-height: 1.1; letter-spacing: -.048em; }
.catalog { margin-top: 32px; }
.recipe-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.recipe-card { display: block; text-align: left; color: var(--ink); width: 100%; padding: 15px; background: var(--white); border: 1px solid var(--line); border-radius: 15px; min-height: 120px; }
.recipe-card:hover { border-color: #6c896c; background: #fffffb; }
.recipe-kicker { color: #456549; font-weight: 680; font-size: .87rem; }
.recipe-title { display: block; margin: 5px 0; font-weight: 780; font-size: 1.1rem; letter-spacing: -.02em; line-height: 1.25; }
.recipe-description { display: block; font-size: .94rem; color: var(--muted); }
.missing-line { color: #6d431d; background: var(--warm); border-radius: 9px; padding: 7px 9px; margin: 7px 0; }
.recipe-card .missing-line { display: block; font-size: .85rem; margin-bottom: 0; }
.footer { padding-block: 21px 26px; display: flex; gap: 8px 18px; align-items: center; flex-wrap: wrap; margin-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .91rem; }
.footer > span:first-child { font-weight: 680; color: var(--green); }
#study-status { margin-inline-end: auto; }
.text-button { padding: 5px 0; border: 0; background: none; color: var(--green); text-decoration: underline; text-underline-offset: .2em; }
dialog { position: fixed; inset: 0; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 20px; padding: 0; width: min(560px, calc(100% - 22px)); max-height: min(90dvh, 720px); box-shadow: 0 20px 80px #152a2454; }
dialog::backdrop { background: #142d25a0; }
.dialog-inner { position: relative; padding: 26px; }
.dialog-inner h2 { font-family: Georgia, serif; font-size: clamp(1.65rem, 5vw, 2.3rem); line-height: 1.06; letter-spacing: -.04em; max-width: calc(100% - 42px); margin-bottom: 16px; }
.dialog-inner h3 { font-size: 1.03rem; margin-top: 15px; }
.dialog-inner .recipe-kicker { margin-bottom: 5px; }
.close-button { display: grid; place-items: center; position: absolute; top: 13px; right: 13px; border: 1px solid var(--line); background: #f4f6ec; color: var(--ink); width: 38px; height: 38px; line-height: 1; border-radius: 99px; font-size: 1.45rem; }
.recipe-ingredients, .recipe-steps { margin: 6px 0 12px; padding-left: 21px; }
.recipe-ingredients li, .recipe-steps li { margin-bottom: 5px; }
.choose-area { margin-top: 18px; }
#choose-status, #study-info { margin-top: 9px; color: var(--green); }
.study-inner > p { margin-bottom: 12px; }
.dialog-actions { display: grid; gap: 7px; margin-top: 18px; }

@media (max-width: 750px) {
  .wrap { width: calc(100% - 28px); }
  .topbar-inner { min-height: 63px; }
  .workspace { grid-template-columns: 1fr; gap: 9px; margin-top: 12px; }
  .hero { grid-template-columns: 1.14fr 1fr; margin-top: 14px; border-radius: 17px; }
  .hero-copy { padding: 25px 15px 25px 22px; }
  .hero h1 { font-size: clamp(2.3rem, 8.8vw, 4.8rem); }
  .hero p { margin-top: 12px; font-size: .94rem; }
  .hero-image { min-height: 185px; object-position: 59% center; }
  .panel { border-radius: 15px; }
  .recipe-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 430px) {
  .brand { font-size: .85rem; gap: 6px; }
  .brand-icon { width: 29px; height: 29px; border-radius: 9px; }
  .topbar-inner { gap: 4px; }
  .topbar nav { gap: 2px; }
  .nav-button { padding: 7px; font-size: .78rem; }
  .hero-copy { padding: 19px 13px 19px 15px; }
  .hero h1 { font-size: clamp(2.04rem, 8.4vw, 2.6rem); }
  .hero p { font-size: .88rem; }
  .hero-image { min-height: 176px; }
  .ingredient-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ingredient { justify-content: flex-start; gap: 5px; }
  .recipe-grid { grid-template-columns: 1fr; }
  .dialog-inner { padding: 20px; }
}

@media (prefers-reduced-motion: no-preference) {
  .ingredient, .primary, .nav-button, .recipe-card { transition: background-color 120ms ease, border-color 120ms ease; }
}
