:root {
  --forest-950: #102f27;
  --forest-900: #173f34;
  --forest-800: #215445;
  --forest-700: #2d6956;
  --forest-100: #dfeae3;
  --cream: #f7f3ea;
  --paper: #fffdf8;
  --sand: #eadfc9;
  --acorn: #9a5b32;
  --orange: #d87932;
  --orange-dark: #b45c27;
  --ink: #1f2a25;
  --muted: #68726c;
  --line: rgba(23, 63, 52, .13);
  --green: #39865d;
  --yellow: #d49a24;
  --red: #c95545;
  --shadow: 0 22px 60px rgba(21, 50, 41, .12);
  --radius-xl: 28px;
  --radius-lg: 21px;
  --radius-md: 15px;
}

* { box-sizing: border-box; }

html { color-scheme: light; scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 3%, rgba(216,121,50,.12), transparent 27rem),
    radial-gradient(circle at 93% 32%, rgba(45,105,86,.11), transparent 24rem),
    var(--cream);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button { color: inherit; }
button, label { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 3px solid rgba(216,121,50,.42);
  outline-offset: 3px;
}

[hidden] { display: none !important; }

.app-shell { width: min(100%, 1040px); min-height: 100vh; margin: 0 auto; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 10px;
}

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand img { width: 50px; height: 50px; filter: drop-shadow(0 7px 10px rgba(22,48,39,.17)); }
.brand div { display: grid; line-height: 1.1; }
.brand strong { color: var(--forest-900); font-family: Georgia, "Times New Roman", serif; font-size: 1.26rem; letter-spacing: -.03em; }
.brand span { color: var(--muted); font-size: .72rem; margin-top: 4px; }

.text-button { border: 0; background: transparent; color: var(--forest-700); font-weight: 750; padding: 10px 4px; font-size: .84rem; cursor: pointer; }

main { padding: 6px 14px 34px; }
.screen { animation: appear .35s ease both; }

.welcome { display: flex; align-items: center; gap: 10px; width: min(100%, 680px); margin: 4px auto 12px; }
.guide-squirrel { width: 76px; height: 76px; flex: 0 0 auto; animation: guide-bob 3.8s ease-in-out infinite; transform-origin: 50% 100%; }
.guide-bubble {
  position: relative;
  color: var(--forest-900);
  background: rgba(255,253,248,.88);
  border: 1px solid var(--line);
  border-radius: 8px 18px 18px 18px;
  padding: 12px 14px;
  font-size: .85rem;
  line-height: 1.45;
  box-shadow: 0 9px 24px rgba(23,63,52,.07);
}
.guide-bubble span { display: block; color: var(--orange-dark); font-size: .68rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 2px; }

.setup-card {
  width: min(100%, 680px);
  margin: 0 auto;
  padding: 25px 19px 20px;
  border: 1px solid rgba(23,63,52,.1);
  border-radius: var(--radius-xl);
  background: rgba(255,253,248,.96);
  box-shadow: var(--shadow);
}

.eyebrow { margin: 0 0 8px; color: var(--orange-dark); font-size: .69rem; line-height: 1; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2 { margin: 0; color: var(--forest-950); font-family: Georgia, "Times New Roman", serif; letter-spacing: -.035em; }
h1 { max-width: 18ch; font-size: clamp(2rem, 9vw, 3.5rem); line-height: .98; }
h2 { font-size: clamp(1.65rem, 7vw, 2.45rem); line-height: 1.02; }
h3 { color: var(--forest-900); }
.lead { margin: 10px 0 18px; color: var(--muted); font-size: .94rem; }

.choice-cloud { display: flex; flex-wrap: wrap; gap: 9px; }
.choice {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 43px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #3b4942;
  font-size: .86rem;
  font-weight: 720;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, color .16s ease, background .16s ease;
}
.choice:hover { transform: translateY(-1px); border-color: rgba(45,105,86,.4); }
.choice[aria-pressed="true"] { color: #fff; border-color: var(--forest-800); background: var(--forest-800); box-shadow: 0 7px 15px rgba(33,84,69,.19); }
.choice[aria-pressed="true"] span { filter: saturate(.7) brightness(1.2); }
.choice-cloud.compact { gap: 7px; }
.choice-cloud.compact .choice { min-height: 37px; padding: 7px 10px; font-size: .78rem; }

.setup-divider { height: 1px; margin: 22px 0; background: linear-gradient(90deg, var(--line), transparent); }
.field-group { margin-bottom: 14px; }
.field-label, .compact-field > span, .avoid-field > span { display: block; color: var(--forest-900); font-size: .78rem; font-weight: 800; margin-bottom: 8px; }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); padding: 4px; border-radius: 13px; background: #ecebe3; }
.segmented button { min-height: 39px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: .79rem; font-weight: 760; cursor: pointer; }
.segmented button[aria-pressed="true"] { color: var(--forest-900); background: #fff; box-shadow: 0 4px 12px rgba(23,63,52,.1); }

.setting-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.compact-field { display: block; min-width: 0; }
.compact-field select, .avoid-field input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  padding: 0 12px;
}
.compact-field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--forest-700) 50%), linear-gradient(135deg, var(--forest-700) 50%, transparent 50%); background-position: calc(100% - 17px) 20px, calc(100% - 12px) 20px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; font-size: .84rem; }
.stepper { display: grid; grid-template-columns: 42px 1fr 42px; height: 46px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.stepper button { border: 0; background: transparent; color: var(--forest-800); font-size: 1.45rem; cursor: pointer; }
.stepper output { display: grid; place-items: center; font-weight: 850; }

.toggle-list { margin: 16px 0 8px; border-block: 1px solid var(--line); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 61px; border-bottom: 1px solid var(--line); cursor: pointer; }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row > span { display: grid; }
.toggle-row strong { color: var(--forest-900); font-size: .86rem; }
.toggle-row small { color: var(--muted); font-size: .72rem; margin-top: 2px; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-row i { position: relative; width: 44px; height: 25px; flex: 0 0 auto; border-radius: 999px; background: #d8dcd8; transition: .2s ease; }
.toggle-row i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.18); transition: .2s ease; }
.toggle-row input:checked + i { background: var(--forest-700); }
.toggle-row input:checked + i::after { transform: translateX(19px); }
.toggle-row input:focus-visible + i { outline: 3px solid rgba(216,121,50,.42); outline-offset: 3px; }

.preferences-button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 16px; padding: 13px 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff; text-align: left; cursor: pointer; }
.preferences-button > span:first-child { display: grid; }
.preferences-button strong { color: var(--forest-900); font-size: .83rem; }
.preferences-button small { color: var(--muted); font-size: .71rem; margin-top: 3px; }
.preferences-button > span:last-child { color: var(--orange-dark); font-size: 1.8rem; line-height: 1; }

.primary-action, .secondary-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 52px;
  border-radius: 14px;
  padding: 0 18px;
  font-weight: 820;
  cursor: pointer;
}
.primary-action { width: 100%; justify-content: space-between; border: 1px solid var(--forest-900); color: #fff; background: var(--forest-900); box-shadow: 0 10px 22px rgba(23,63,52,.2); }
.primary-action:hover { background: var(--forest-800); }
.secondary-action { border: 1px solid var(--line); color: var(--forest-800); background: #fff; }
.privacy-note { margin: 11px 0 0; color: var(--muted); font-size: .7rem; text-align: center; }

.week-screen { width: min(100%, 820px); margin: 5px auto 0; padding-bottom: 88px; }
.week-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 18px 5px 14px; }
.week-heading h1 { font-size: clamp(2rem, 8vw, 3.2rem); }
.week-heading p:last-child { margin: 8px 0 0; color: var(--muted); font-size: .84rem; }
.week-total { display: grid; flex: 0 0 auto; text-align: right; }
.week-total span { color: var(--muted); font-size: .65rem; }
.week-total strong { color: var(--forest-900); font-family: Georgia, serif; font-size: 1.3rem; }

.day-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(60px, 1fr); gap: 7px; overflow-x: auto; padding: 4px 2px 12px; scrollbar-width: none; scroll-snap-type: x proximity; }
.day-strip::-webkit-scrollbar { display: none; }
.day-tab { position: relative; min-height: 61px; padding: 8px 5px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,253,248,.78); text-align: center; cursor: pointer; scroll-snap-align: center; }
.day-tab span { display: block; color: var(--muted); font-size: .65rem; font-weight: 800; text-transform: uppercase; }
.day-tab strong { display: block; margin-top: 4px; color: var(--forest-900); font-size: 1.1rem; }
.day-tab i { position: absolute; right: 6px; bottom: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--histamine-color, var(--green)); }
.day-tab[aria-selected="true"] { border-color: var(--forest-900); color: #fff; background: var(--forest-900); box-shadow: 0 8px 18px rgba(23,63,52,.18); }
.day-tab[aria-selected="true"] span, .day-tab[aria-selected="true"] strong { color: #fff; }

.meal-card { overflow: hidden; min-height: 450px; border: 1px solid rgba(23,63,52,.1); border-radius: var(--radius-xl); background: var(--paper); box-shadow: var(--shadow); }
.meal-art { position: relative; display: grid; place-items: center; min-height: 205px; overflow: hidden; color: #fff; background: linear-gradient(135deg, var(--meal-a), var(--meal-b)); isolation: isolate; }
.meal-art::before, .meal-art::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.09); z-index: -1; }
.meal-art::before { width: 210px; height: 210px; left: -70px; top: -95px; }
.meal-art::after { width: 160px; height: 160px; right: -45px; bottom: -85px; }
.meal-symbol { font-size: 5.5rem; filter: drop-shadow(0 12px 18px rgba(0,0,0,.17)); transform: rotate(-3deg); }
.day-badge { position: absolute; left: 15px; top: 15px; padding: 7px 10px; border-radius: 999px; color: #fff; background: rgba(16,47,39,.62); backdrop-filter: blur(8px); font-size: .72rem; font-weight: 790; }
.source-badge { position: absolute; right: 15px; top: 15px; max-width: 48%; padding: 7px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 999px; color: #fff; background: rgba(16,47,39,.62); backdrop-filter: blur(8px); font-size: .67rem; font-weight: 720; }
.meal-body { padding: 21px 18px 18px; }
.meal-kicker { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; color: var(--muted); font-size: .72rem; font-weight: 720; }
.meal-body h2 { max-width: 19ch; font-size: clamp(1.85rem, 8vw, 2.65rem); }
.meal-meta { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0; }
.meta-pill { display: inline-flex; align-items: center; min-height: 30px; padding: 5px 9px; border-radius: 999px; color: #53605a; background: #f0eee7; font-size: .71rem; font-weight: 720; }
.histamine-pill { color: var(--histamine-ink); background: var(--histamine-bg); }
.histamine-dot { width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--histamine-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--histamine-color), transparent 78%); }
.meal-price { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 15px 0; }
.price-box { padding: 11px 12px; border: 1px solid rgba(45,105,86,.12); border-radius: 13px; background: #f2f6f2; }
.price-box span { display: block; color: var(--muted); font-size: .64rem; }
.price-box strong { display: block; color: var(--forest-900); font-size: 1.04rem; margin-top: 2px; }
.coordination-note { display: flex; gap: 9px; align-items: flex-start; margin: 0 0 16px; padding: 11px 12px; border-radius: 13px; color: #48574f; background: #f6efe3; font-size: .76rem; line-height: 1.4; }
.coordination-note span { color: var(--orange-dark); font-weight: 900; }
.meal-actions { display: grid; grid-template-columns: 1fr 1.45fr; gap: 9px; }
.meal-actions button { min-height: 49px; border-radius: 13px; padding: 0 10px; font-weight: 820; cursor: pointer; }
.details-button { border: 1px solid var(--line); color: var(--forest-800); background: #fff; }
.swap-button { border: 1px solid var(--forest-900); color: #fff; background: var(--forest-900); }
.swap-button[disabled] { opacity: .65; cursor: wait; }
.swap-button span { display: inline-block; margin-left: 5px; transition: transform .2s ease; }
.swap-button:hover span { transform: translateX(3px); }

.today-controls { margin-top: 11px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255,253,248,.82); }
.today-controls summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 66px; padding: 13px 16px; list-style: none; cursor: pointer; }
.today-controls summary::-webkit-details-marker { display: none; }
.today-controls summary > span:first-child { display: grid; }
.today-controls summary strong { color: var(--forest-900); font-size: .87rem; }
.today-controls summary small { color: var(--muted); font-size: .7rem; margin-top: 3px; }
.summary-icon { color: var(--orange-dark); font-size: 1.6rem; transition: transform .2s ease; }
.today-controls[open] .summary-icon { transform: rotate(45deg); }
.today-body { padding: 0 15px 15px; border-top: 1px solid var(--line); }
.today-body .choice-cloud { padding-top: 14px; }
.avoid-field { display: block; margin-top: 15px; }
.avoid-field input::placeholder { color: #a2aaa5; }
.avoid-field small { display: block; color: var(--muted); font-size: .68rem; margin-top: 5px; }
.day-hint { margin: 8px 0 0; color: var(--muted); font-size: .68rem; }

.shopping-dock { position: fixed; z-index: 20; left: max(14px, calc((100vw - 820px) / 2)); right: max(14px, calc((100vw - 820px) / 2)); bottom: max(12px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px; min-height: 64px; padding: 9px 15px 9px 10px; border: 1px solid rgba(255,255,255,.16); border-radius: 18px; color: #fff; background: rgba(16,47,39,.96); box-shadow: 0 16px 40px rgba(16,47,39,.28); backdrop-filter: blur(14px); text-align: left; cursor: pointer; }
.dock-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: var(--forest-900); background: #f1d9ae; font-size: 1.05rem; font-weight: 900; }
.shopping-dock > span:nth-child(2) { display: grid; }
.shopping-dock strong { font-size: .87rem; }
.shopping-dock small { color: rgba(255,255,255,.64); font-size: .68rem; margin-top: 2px; }
.shopping-dock > span:last-child { font-family: Georgia, serif; font-size: 1.08rem; font-weight: 800; }

footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; padding: 8px 18px 28px; color: var(--muted); font-size: .68rem; text-align: center; }
footer button { border: 0; padding: 0; color: var(--forest-700); background: transparent; font-weight: 780; text-decoration: underline; cursor: pointer; }

.sheet-dialog { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; overflow: hidden; }
.sheet-dialog::backdrop { background: rgba(10,31,25,.66); backdrop-filter: blur(3px); }
.sheet-card { position: absolute; left: 0; right: 0; bottom: 0; max-height: min(91vh, 900px); overflow: auto; padding: 21px 18px calc(20px + env(safe-area-inset-bottom)); border-radius: 27px 27px 0 0; background: var(--paper); box-shadow: 0 -20px 70px rgba(0,0,0,.2); animation: sheet-up .28s ease both; }
.sheet-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 12px; }
.sheet-header h2 { max-width: 18ch; }
.icon-button { display: grid; place-items: center; width: 41px; height: 41px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 50%; color: var(--forest-800); background: #fff; font-size: 1.55rem; line-height: 1; cursor: pointer; }
.sheet-intro { margin: 0 0 16px; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.allergen-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.allergen-option { position: relative; }
.allergen-option input { position: absolute; opacity: 0; }
.allergen-option span { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: #4d5953; font-size: .76rem; font-weight: 700; }
.allergen-option span::before { content: ""; width: 17px; height: 17px; flex: 0 0 auto; border: 1.5px solid #a3aca7; border-radius: 5px; }
.allergen-option input:checked + span { color: var(--forest-900); border-color: rgba(45,105,86,.38); background: #e8f0e9; }
.allergen-option input:checked + span::before { border-color: var(--forest-700); background: var(--forest-700); box-shadow: inset 0 0 0 4px #e8f0e9; }
.allergen-option input:focus-visible + span { outline: 3px solid rgba(216,121,50,.42); outline-offset: 2px; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1.5fr; gap: 9px; margin-top: 20px; }

.recipe-hero { margin: -21px -18px 20px; padding: 18px 18px 23px; color: #fff; background: linear-gradient(135deg, var(--meal-a), var(--meal-b)); }
.recipe-hero .sheet-header h2, .recipe-hero .eyebrow { color: #fff; }
.recipe-hero .eyebrow { opacity: .78; }
.recipe-hero .icon-button { color: #fff; border-color: rgba(255,255,255,.28); background: rgba(16,47,39,.25); }
.recipe-hero-main { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 18px; }
.recipe-hero-main > span { font-size: 4rem; }
.recipe-hero-main div { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.recipe-hero-main i { padding: 6px 8px; border-radius: 999px; background: rgba(16,47,39,.36); font-size: .67rem; font-style: normal; }
.recipe-section { margin-top: 21px; }
.recipe-section h3 { margin: 0 0 10px; font-size: .95rem; }
.ingredient-list, .step-list { margin: 0; padding: 0; list-style: none; }
.ingredient-list li { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .8rem; }
.ingredient-list li span:last-child { color: var(--muted); white-space: nowrap; }
.step-list { counter-reset: steps; }
.step-list li { position: relative; padding: 0 0 16px 39px; color: #46534d; font-size: .8rem; line-height: 1.55; counter-increment: steps; }
.step-list li::before { content: counter(steps); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; background: var(--forest-800); font-weight: 850; }
.source-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 50px; margin-top: 19px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 13px; color: var(--forest-800); background: #fff; font-size: .78rem; font-weight: 780; text-decoration: none; }
.source-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.storage-note, .histamine-detail { margin-top: 14px; padding: 12px 13px; border-radius: 13px; color: #49564f; background: #f5efe4; font-size: .76rem; line-height: 1.5; }

.shopping-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 5px 0 13px; }
.shopping-summary > div { padding: 12px; border-radius: 13px; background: #edf3ed; }
.shopping-summary span { display: block; color: var(--muted); font-size: .65rem; }
.shopping-summary strong { display: block; color: var(--forest-900); font-family: Georgia, serif; font-size: 1.25rem; margin-top: 3px; }
.shopping-progress { margin-bottom: 18px; color: var(--muted); font-size: .7rem; }
.shopping-progress > div { height: 6px; overflow: hidden; margin-top: 6px; border-radius: 999px; background: #e2e5e1; }
.shopping-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--orange); transition: width .2s ease; }
.shopping-group { margin: 0 0 19px; }
.shopping-group h3 { margin: 0 0 6px; color: var(--orange-dark); font-size: .69rem; letter-spacing: .08em; text-transform: uppercase; }
.shopping-item { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 9px; min-height: 44px; border-bottom: 1px solid var(--line); cursor: pointer; }
.shopping-item input { appearance: none; width: 20px; height: 20px; margin: 0; border: 1.5px solid #9ca7a1; border-radius: 6px; background: #fff; }
.shopping-item input:checked { border-color: var(--forest-700); background: var(--forest-700) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m4 10 4 4 8-9' fill='none' stroke='white' stroke-width='2.3' stroke-linecap='round'/%3E%3C/svg%3E") center/16px no-repeat; }
.shopping-item span { font-size: .79rem; }
.shopping-item small { color: var(--muted); font-size: .7rem; white-space: nowrap; }
.shopping-item:has(input:checked) span { color: #8d9691; text-decoration: line-through; }
.export-panel { margin-top: 23px; padding: 14px; border-radius: 17px; color: #fff; background: var(--forest-900); }
.export-panel > p { display: grid; margin: 0 0 12px; }
.export-panel strong { font-size: .9rem; }
.export-panel span { color: rgba(255,255,255,.66); font-size: .69rem; margin-top: 3px; }
.export-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.export-actions button { min-height: 41px; border: 1px solid rgba(255,255,255,.16); border-radius: 11px; color: #fff; background: rgba(255,255,255,.1); font-size: .74rem; font-weight: 760; cursor: pointer; }
.estimate-note { margin: 12px 0 0; color: var(--muted); font-size: .65rem; line-height: 1.45; }
.info-copy h3 { margin: 20px 0 5px; font-size: .9rem; }
.info-copy p { margin: 0; color: #4f5b55; font-size: .8rem; line-height: 1.56; }

.loading-layer { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(16,47,39,.76); backdrop-filter: blur(6px); }
.loading-layer > div { display: grid; justify-items: center; width: min(100%, 280px); padding: 24px 18px; border-radius: 22px; color: var(--forest-900); background: var(--paper); text-align: center; box-shadow: var(--shadow); }
.loading-layer img { animation: search-wiggle 1.15s ease-in-out infinite; }
.loading-layer strong { margin-top: 10px; font-family: Georgia, serif; font-size: 1.2rem; }
.loading-layer span { margin-top: 4px; color: var(--muted); font-size: .73rem; }
.toast { position: fixed; z-index: 120; left: 50%; bottom: max(90px, calc(75px + env(safe-area-inset-bottom))); width: max-content; max-width: calc(100% - 28px); padding: 11px 14px; border-radius: 12px; color: #fff; background: rgba(16,47,39,.96); box-shadow: 0 10px 28px rgba(0,0,0,.2); font-size: .76rem; opacity: 0; pointer-events: none; transform: translate(-50%, 8px); transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes appear { from { opacity: 0; transform: translateY(7px); } }
@keyframes guide-bob { 0%, 100% { transform: rotate(-2deg) translateY(0); } 50% { transform: rotate(2deg) translateY(-4px); } }
@keyframes sheet-up { from { opacity: 0; transform: translateY(34px); } }
@keyframes search-wiggle { 0%,100% { transform: rotate(-4deg) scale(1); } 50% { transform: rotate(4deg) scale(1.04); } }

@media (min-width: 700px) {
  .topbar { padding: 22px 26px 12px; }
  main { padding-inline: 24px; }
  .setup-card { padding: 34px 37px 28px; }
  .welcome { margin-top: 12px; }
  .guide-squirrel { width: 88px; height: 88px; }
  .choice { font-size: .9rem; }
  .meal-card { display: grid; grid-template-columns: .92fr 1.08fr; min-height: 460px; }
  .meal-art { min-height: 100%; }
  .meal-body { display: flex; flex-direction: column; justify-content: center; padding: 30px 29px; }
  .sheet-dialog { padding: 28px; }
  .sheet-card { position: relative; top: 50%; bottom: auto; width: min(100%, 680px); max-height: calc(100vh - 56px); margin: auto; border-radius: 27px; transform: translateY(-50%); animation: modal-in .24s ease both; }
  .shopping-dialog .sheet-card { width: min(100%, 760px); }
  .allergen-grid { grid-template-columns: repeat(3, 1fr); }
  @keyframes modal-in { from { opacity: 0; transform: translateY(calc(-50% + 16px)) scale(.985); } }
}

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

@media print {
  body { background: #fff; }
  .topbar, #setup-screen, #week-screen, footer, dialog:not([open]) { display: none !important; }
  #shopping-dialog[open] { position: static; display: block; width: auto; height: auto; overflow: visible; }
  #shopping-dialog::backdrop { display: none; }
  #shopping-dialog .sheet-card { position: static; width: auto; max-height: none; overflow: visible; padding: 0; box-shadow: none; transform: none; }
  .icon-button, .shopping-progress, .export-panel { display: none !important; }
  .shopping-item { break-inside: avoid; }
}
