/* Thriveness design system: warm ivory, cream cards, espresso text, burnt-orange actions. */
:root {
  --ivory: #FBF7F0; --cream: #FFFDF9; --card: #FFFFFF; --beige: #E9DFD0; --beige-2: #F2EADF;
  --espresso: #2B211A; --muted: #6E6257; --orange: #B8560F; --orange-hover: #A14A0C; --orange-tint: #FBF0E3; --orange-tint-2: #F6DFC6;
  --green: #3E7D45; --green-tint: #E8F1E6; --red: #B3341E; --red-tint: #FBE9E4;
  --radius: 14px; --radius-sm: 10px; --shadow: 0 1px 2px rgba(43,33,26,.05), 0 6px 18px rgba(43,33,26,.06);
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px); --nav-h: 64px; --max: 1180px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ivory); color: var(--espresso); font: 16px/1.5 var(--font); min-height: 100dvh; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--orange); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .35em; letter-spacing: -.01em; font-weight: 700; }
h1 { font-size: clamp(1.7rem, 2.4vw + 1rem, 2.3rem); } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 .75em; } small { font-size: .85em; } .muted { color: var(--muted); } .hint { color: var(--muted); font-size: .85rem; margin: .5rem 0 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--orange); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 6px; }
.eyebrow { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.ic { vertical-align: -.2em; flex: none; }
.shell { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.shell.wide { max-width: 900px; }
main.shell { padding-top: 20px; padding-bottom: calc(40px + var(--nav-h) + var(--safe-b)); }

/* header + nav */
.top { background: var(--cream); border-bottom: 1px solid var(--beige); position: sticky; top: 0; z-index: 20; }
.top-inner { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.15rem; color: var(--espresso); text-decoration: none; }
.topnav { display: flex; gap: 4px; margin-left: 8px; }
.topnav a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; color: var(--espresso); text-decoration: none; font-weight: 500; min-height: 44px; }
.topnav a:hover { background: var(--beige-2); }
.topnav a.active { background: var(--orange-tint); color: var(--orange); font-weight: 600; }
.account { margin-left: auto; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; color: var(--espresso); border: 1px solid var(--beige); background: var(--card); }
.bottomnav { display: none; }
.foot { padding: 24px 20px 32px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--beige); margin-top: 32px; }

/* cards + forms */
.card { background: var(--card); border: 1px solid var(--beige); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span:first-child, legend { font-weight: 600; font-size: .95rem; padding: 0; margin-bottom: 4px; }
input[type=text], input[type=number], input[type=email], input[type=password], input[type=date], select, textarea {
  font: inherit; color: inherit; background: var(--cream); border: 1px solid var(--beige); border-radius: var(--radius-sm); padding: 10px 12px; min-height: 44px; width: 100%; }
input:focus, select:focus { border-color: var(--orange); outline: 2px solid var(--orange-tint-2); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row2 > *, .field, .stepper, .select-wrap { min-width: 0; }
input, select { min-width: 0; max-width: 100%; }
fieldset { min-inline-size: 0; }
.plan-grid > *, .shop-grid > *, .shop-main > *, .recipe-cols > *, .recipe-hero > *, .settings > * { min-width: 0; }
.select-wrap { position: relative; display: flex; align-items: center; }
.select-wrap select { appearance: none; padding-right: 36px; }
.select-wrap::after { content: ""; position: absolute; right: 14px; width: 8px; height: 8px; border-right: 2px solid var(--espresso); border-bottom: 2px solid var(--espresso); transform: rotate(45deg); pointer-events: none; }
.select-wrap .lead { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.select-wrap .lead + select { padding-left: 38px; }
.select-wrap.accent select { background: var(--orange-tint); border-color: var(--orange-tint-2); font-weight: 600; }
.select-wrap.accent .lead { color: var(--orange); }
.stepper { display: flex; align-items: center; border: 1px solid var(--beige); border-radius: var(--radius-sm); background: var(--cream); overflow: hidden; }
.stepper input { border: 0; background: transparent; font-weight: 700; font-size: 1.25rem; min-width: 0; padding-left: 4px; }
.stepper input:focus { outline: none; }
.stepper .prefix { padding-left: 12px; font-weight: 700; font-size: 1.25rem; }
.stepper button { width: 44px; height: 44px; border: 0; border-left: 1px solid var(--beige); background: var(--cream); color: var(--espresso); cursor: pointer; display: grid; place-items: center; }
.stepper button:hover { background: var(--beige-2); }
.stepper.small { display: inline-flex; border-radius: 10px; }
.stepper.small button { width: 40px; height: 40px; border-left: 0; }
.stepper.small span { min-width: 34px; text-align: center; font-weight: 600; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice, .pill { position: relative; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--beige); background: var(--cream); border-radius: var(--radius-sm); padding: 10px 14px; cursor: pointer; min-height: 44px; user-select: none; }
.choice input, .pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice.on, .pill.on { background: var(--orange-tint); border-color: var(--orange); color: var(--orange); font-weight: 600; }
.choice:has(input:focus-visible), .pill:has(input:focus-visible) { outline: 3px solid var(--orange); outline-offset: 2px; }
.pill:has(input:checked), .choice:has(input:checked) { background: var(--orange-tint); border-color: var(--orange); color: var(--orange); font-weight: 600; }
.pill:not(:has(input:checked)), .choice:not(:has(input:checked)) { background: var(--cream); border-color: var(--beige); color: var(--espresso); font-weight: 400; }
.modes { display: grid; grid-template-columns: repeat(4, 1fr); }
.choice { flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 12px 8px; }
.choice .radio { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--muted); margin-bottom: 4px; }
.choice:has(input:checked) .radio { border-color: var(--orange); background: var(--orange); }
.choice b { font-weight: 600; } .choice small { color: var(--muted); } .choice:has(input:checked) small { color: var(--orange); }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--orange); }
details.staples summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
details.staples .choices { margin-top: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid var(--beige); background: var(--card); color: var(--espresso); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--beige-2); }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.primary:hover { background: var(--orange-hover); }
.btn.big { width: 100%; font-size: 1.05rem; min-height: 52px; }
.btn.small { min-height: 38px; padding: 6px 12px; font-size: .9rem; }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; padding: 4px 0; color: var(--orange); font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; text-decoration: none; min-height: 32px; }
.link.tiny { font-size: .8rem; font-weight: 500; }
.link.danger { color: var(--red); }
.link.info { color: var(--muted); min-height: 24px; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--beige); background: var(--card); color: var(--espresso); cursor: pointer; text-decoration: none; }
.flash-mobile { display: none; }
.flash { padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid; font-size: .95rem; margin: 0 0 12px; }
.flash.ok { background: var(--green-tint); border-color: #BBD3B6; } .flash.err { background: var(--red-tint); border-color: #E8B8AC; } .flash.info { background: var(--orange-tint); border-color: var(--orange-tint-2); }
.flash ul { margin: 6px 0 0; padding-left: 18px; }
form.inline { display: inline; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty h2, .empty h1 { color: var(--espresso); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.badge.sample { background: var(--orange-tint); color: var(--orange); border: 1px solid var(--orange-tint-2); }
.badge.soon { background: var(--orange); color: #fff; position: absolute; left: 50%; transform: translateX(-50%); bottom: 6px; white-space: nowrap; }
.badge.loc { position: absolute; top: 6px; right: 6px; background: var(--cream); border: 1px solid var(--beige); color: var(--muted); width: 26px; height: 26px; justify-content: center; padding: 0; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.tag.ok { background: var(--green-tint); color: var(--green); } .tag.miss { background: var(--red-tint); color: var(--red); } .tag.timer { background: var(--orange-tint); color: var(--orange); margin-left: 8px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.status.missing .dot { background: #D99A2B; } .status.blocked .dot { background: var(--red); }
.status.ready { color: var(--green); } .status.missing { color: #8A5A10; } .status.blocked { color: var(--red); }
.scroll-x { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.scroll-x > * { flex: none; }

/* plan */
.plan-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; grid-template-areas: "hero hero" "form preview"; }
.hero { grid-area: hero; padding: 0; overflow: hidden; position: relative; min-height: 260px; display: grid; }
.hero-img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.hero-text { position: relative; padding: 36px 32px; max-width: 420px; background: linear-gradient(90deg, rgba(255,253,249,.96) 55%, rgba(255,253,249,0)); min-height: 260px; display: flex; flex-direction: column; justify-content: center; }
.hero-text h1 { font-size: clamp(2rem, 3vw + 1rem, 2.8rem); }
.hero-text p { color: var(--muted); font-size: 1.05rem; }
.plan-grid .form { grid-area: form; }
.preview-card { grid-area: preview; align-self: start; position: sticky; top: 76px; }
.preview h2 { font-size: 1.5rem; margin: 4px 0 2px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.stats div { background: var(--beige-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.stats dt { font-size: .78rem; color: var(--muted); } .stats dd { margin: 0; font-weight: 700; font-size: 1.1rem; } .stats dd small { font-weight: 400; color: var(--muted); font-size: .8rem; }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.thumb { aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); width: 100%; }
.fallback { aspect-ratio: 1; border-radius: var(--radius-sm); background: var(--beige-2); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px; padding: 6px; position: relative; }
.fallback .illus { width: 40%; height: auto; }
.fallback-note { position: absolute; bottom: 4px; right: 8px; font-size: .65rem; color: var(--muted); }
.assumptions summary { cursor: pointer; color: var(--muted); font-size: .9rem; min-height: 32px; }
.assumptions ul { padding-left: 18px; font-size: .85rem; color: var(--muted); }
#preview.htmx-request { opacity: .6; transition: opacity .2s; }

/* shop */
.shop-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.chip-static { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: .9rem; margin-top: 10px; }
.shop-grid { display: grid; gap: 16px; }
.shop-main { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) 320px; grid-template-areas: "chips chips" "fm budget" "lines budget" "actions budget" "hint budget" "meals budget"; align-items: start; }
.shop-main .chips { grid-area: chips; } .shop-main .flash-mobile { grid-area: fm; } .shop-main .budget { grid-area: budget; position: sticky; top: 76px; } .shop-main .lines { grid-area: lines; } .shop-main .actions { grid-area: actions; } .shop-main > .hint { grid-area: hint; } .shop-main .meals-list { grid-area: meals; } .shop-main .empty { grid-area: lines; }
.chips { display: flex; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 16px; border-radius: var(--radius-sm); border: 1px solid var(--beige); background: var(--card); font: inherit; font-weight: 600; cursor: pointer; color: var(--espresso); }
.chip small { font-weight: 400; color: var(--muted); }
.chip.on { background: var(--orange-tint); border-color: var(--orange); color: var(--orange); }
.chip .logo { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.logo.walmart { background: #0071CE; } .logo.amazon { background: #FF9900; } .logo.wholefoods { background: #00674B; } .logo.kroger { background: #0F4C9B; }
.budget-row { display: flex; justify-content: space-between; align-items: baseline; }
.budget-row .spent b { font-size: 1.5rem; } .budget-row .left { color: var(--muted); } .budget-row .over { color: var(--red); font-weight: 700; }
.bar { height: 10px; background: var(--beige-2); border-radius: 999px; overflow: hidden; margin: 8px 0; }
.bar span { display: block; height: 100%; background: var(--orange); border-radius: 999px; transition: width .3s; }
.bar span.over { background: var(--red); }
.budget .meta { color: var(--muted); font-size: .85rem; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 8px; }
.budget .cover { flex-basis: 100%; color: var(--espresso); font-weight: 600; }
.lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.line { display: grid; grid-template-columns: 28px 56px minmax(0, 1fr) 76px 92px auto; grid-template-areas: "tick img name qty price swap" "tick img name qty price search"; gap: 4px 12px; align-items: center; background: var(--card); border: 1px solid var(--beige); border-radius: var(--radius); padding: 10px 14px; }
.line.off { opacity: .55; }
.line .tick { grid-area: tick; } .line .line-img { grid-area: img; } .line .line-name { grid-area: name; min-width: 0; } .line .qty { grid-area: qty; } .line-price { grid-area: price; text-align: right; } .line .btn { grid-area: swap; justify-self: end; } .line .link.tiny { grid-area: search; justify-self: end; }
.line-name b, .line-name small { display: block; } .line-name small { color: var(--muted); }
.line-name .swapped { color: var(--orange); }
.tick { position: relative; display: inline-flex; width: 28px; height: 44px; align-items: center; cursor: pointer; }
.tick input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.tick .box { width: 24px; height: 24px; border-radius: 6px; border: 2px solid var(--beige); background: var(--cream); display: grid; place-items: center; color: transparent; }
.tick input:checked + .box { background: var(--orange); border-color: var(--orange); color: #fff; }
.tick input:focus-visible + .box { outline: 3px solid var(--orange); outline-offset: 2px; }
.line-price b { display: block; font-size: 1.05rem; }
.price-edit { display: flex; align-items: center; justify-content: flex-end; gap: 4px; font-size: .8rem; color: var(--muted); }
.price-edit label { display: inline-flex; align-items: center; gap: 2px; }
.price-edit input { width: 64px; min-height: 30px; padding: 2px 4px; font-size: .8rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.meals-list summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.meals-list ol { margin: 8px 0 0; padding-left: 20px; }
.sheet { border: 0; border-radius: var(--radius); padding: 20px; max-width: 640px; width: calc(100% - 32px); box-shadow: 0 20px 60px rgba(43,33,26,.25); background: var(--card); color: var(--espresso); }
.sheet::backdrop { background: rgba(43,33,26,.45); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.sheet-head h2 { margin: 0; }
.swap-options { display: grid; gap: 10px; }
.swap-opt { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; background: var(--cream); border: 1px solid var(--beige); border-radius: var(--radius-sm); padding: 10px; }
.swap-text { display: flex; flex-direction: column; } .swap-text small { color: var(--muted); } .swap-text .save { color: var(--green); font-weight: 600; } .swap-text .cost { color: var(--muted); font-weight: 600; } .swap-text .note { color: var(--espresso); margin-top: 2px; }
.swap-cta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.confirm { max-width: 760px; margin: 0 auto; }
.confirm-lines { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 8px; }
.confirm-line { display: grid; grid-template-columns: 28px 44px minmax(0, 1fr) 80px 130px; grid-template-areas: "tick img name qty loc"; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--beige-2); }
.confirm-line .tick { grid-area: tick; } .confirm-line .illus { grid-area: img; } .confirm-line .line-name { grid-area: name; min-width: 0; } .confirm-line .qty-in { grid-area: qty; } .confirm-line .select-wrap { grid-area: loc; }
.confirm-line .line-name b, .confirm-line .line-name small { display: block; } .confirm-line .line-name small { color: var(--muted); }
.qty-in input { text-align: center; }

/* pantry */
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin: 20px 0 10px; }
.pantry-grid, .recipe-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pantry-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.pantry-card { background: var(--card); border: 1px solid var(--beige); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.pantry-img { position: relative; width: 100%; display: grid; place-items: center; padding: 6px 0 10px; }
.custom-img { width: 84px; height: 84px; border-radius: 50%; background: var(--beige-2); display: grid; place-items: center; font-size: 2rem; font-weight: 700; color: var(--muted); }
.pantry-name { font-size: .95rem; }
.pantry-actions { display: flex; gap: 12px; margin-top: 2px; }
.recipe-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.recipe-card { position: relative; background: var(--card); border: 1px solid var(--beige); border-radius: var(--radius); overflow: hidden; }
.recipe-link { display: flex; flex-direction: column; gap: 4px; padding: 0 12px 12px; color: inherit; text-decoration: none; }
.recipe-img { width: calc(100% + 24px); margin: 0 -12px 8px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 0; }
.fallback.recipe-img { aspect-ratio: 4 / 3; border-radius: 0; }
.recipe-card .save { position: absolute; top: 10px; right: 10px; }
.save { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,253,249,.92); border: 1px solid var(--beige); color: var(--espresso); display: grid; place-items: center; cursor: pointer; }
.save.on { color: var(--orange); } .save.on svg { fill: var(--orange); }
.plan-list { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.plan-list a { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--beige); border-radius: var(--radius-sm); padding: 12px 14px; color: inherit; text-decoration: none; }

/* recipe */
.recipe-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; background: var(--card); border: 1px solid var(--beige); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.recipe-hero-img { width: 100%; height: 100%; min-height: 280px; object-fit: cover; }
.fallback.recipe-hero-img { aspect-ratio: auto; border-radius: 0; }
.recipe-hero-text { padding: 24px 24px 24px 0; display: flex; flex-direction: column; gap: 8px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: .95rem; margin: 0; }
.meta-row span { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.servings { display: flex; gap: 8px; align-items: flex-end; } .servings label { display: flex; flex-direction: column; font-size: .85rem; } .servings input { width: 80px; }
.recipe-cta { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.recipe-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.ing-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.ing-list li { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--beige-2); }
.ing-list li.missing { color: var(--red); }
.missing-box { background: var(--orange-tint); border-radius: var(--radius-sm); padding: 12px; margin-top: 12px; }
.missing-box h3 { font-size: .95rem; } .subs { padding-left: 18px; font-size: .9rem; margin: 6px 0 10px; }
.steps { padding-left: 22px; display: grid; gap: 10px; } .steps li { padding-left: 4px; }
.steps li::marker { color: var(--orange); font-weight: 700; }

/* cooking mode */
.cook { display: flex; flex-direction: column; min-height: calc(100dvh - 140px); }
.cook-head { display: flex; align-items: center; gap: 12px; }
.cook-title { display: flex; flex-direction: column; flex: 1; min-width: 0; } .cook-title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cook-progress { font-size: .9rem; color: var(--muted); white-space: nowrap; }
.cook-bar { margin: 12px 0 20px; }
.cook-steps { list-style: none; padding: 0; margin: 0; flex: 1; }
.cook-step { background: var(--card); border: 1px solid var(--beige); border-radius: var(--radius); padding: 28px 24px; }
.cook-step p { font-size: clamp(1.25rem, 2vw + .8rem, 1.75rem); line-height: 1.4; margin: 8px 0 16px; }
.cook-step:focus { outline: none; }
.timer { display: flex; align-items: center; gap: 14px; } .timer output { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.cook-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }

/* settings */
.settings { display: grid; gap: 16px; max-width: 760px; }
.auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.plain { padding-left: 18px; }
.danger-zone { margin-top: 12px; } .danger-zone summary { cursor: pointer; color: var(--red); min-height: 32px; }
.prose { max-width: 720px; margin: 0 auto; } .prose ul { padding-left: 20px; }

/* sticky action + bottom nav (mobile) */
.sticky-action { display: none; }

@media (max-width: 900px) {
  .plan-grid { grid-template-columns: 1fr; grid-template-areas: "hero" "form" "preview"; }
  .preview-card { position: static; }
  .shop-main { grid-template-columns: 1fr; grid-template-areas: "chips" "budget" "fm" "lines" "actions" "hint" "meals"; }
  .shop-main .budget { position: sticky; top: 60px; z-index: 5; padding: 12px 14px; }
  .shop-main .budget .flash { display: none; }
  .shop-main .flash-mobile { display: block; }
  .recipe-hero, .recipe-cols { grid-template-columns: 1fr; }
  .recipe-hero-text { padding: 16px; }
  .recipe-hero-img { min-height: 220px; max-height: 320px; }
}
@media (max-width: 700px) {
  :root { --nav-h: 64px; }
  .shell { padding: 0 14px; }
  .topnav { display: none; }
  .bottomnav { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; background: var(--cream); border-top: 1px solid var(--beige); padding-bottom: var(--safe-b); z-index: 20; }
  .bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; font-size: .72rem; color: var(--muted); text-decoration: none; }
  .bottomnav a.active { color: var(--orange); font-weight: 600; }
  .sticky-action { display: block; position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b)); padding: 10px 14px; background: linear-gradient(180deg, rgba(251,247,240,0), var(--ivory) 40%); z-index: 15; }
  main.shell { padding-bottom: calc(100px + var(--nav-h) + var(--safe-b)); }
  .hero-text { max-width: none; background: linear-gradient(180deg, rgba(255,253,249,.97) 0 40%, rgba(255,253,249,0) 70%); padding: 20px 18px; min-height: 320px; justify-content: flex-start; }
  .hero { min-height: 320px; }
  .hero-img { object-position: 70% 50%; }
  .modes { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .line { grid-template-columns: 28px 48px minmax(0, 1fr) auto; grid-template-areas: "tick img name price" "tick img qty swap" "tick img search search"; padding: 10px; gap: 6px 10px; }
  .line-img { width: 48px; height: 48px; }
  .line .btn { justify-self: start; } .line .link.tiny { justify-self: start; }
  .price-edit { justify-content: flex-end; }
  .pantry-grid { grid-template-columns: 1fr 1fr; }
  .recipe-grid { grid-template-columns: 1fr 1fr; }
  .recipe-img { aspect-ratio: 1; }
  .sheet { position: fixed; margin: 0; left: 0; right: 0; bottom: 0; top: auto; width: 100%; max-width: none; max-height: 85dvh; overflow: auto; border-radius: 18px 18px 0 0; padding-bottom: calc(20px + var(--safe-b)); }
  .confirm-line { grid-template-columns: 28px 36px 80px minmax(0, 1fr); grid-template-areas: "tick img name name" "tick img qty loc"; }
  .auth-grid { grid-template-columns: 1fr; }
  .cook-step { padding: 22px 16px; }
  .cook { min-height: calc(100dvh - 200px); }
  .actions .btn { flex: 1 1 45%; }
  .row2 { grid-template-columns: 1fr 1fr; }
  .swap-opt { grid-template-columns: 56px 1fr; } .swap-cta { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
}
@media (max-width: 400px) { .pantry-grid { gap: 8px; } .stepper.small button { width: 36px; } .row2 { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

