:root {
  --bg: #f6efe2;
  --card: #fffaf3;
  --ink: #2c241c;
  --muted: #8d7968;
  --line: rgba(140, 96, 48, 0.12);
  --fill: #f3e6d2;
  --sun: #f2b423;
  --blue: #2c241c;
  --green: #2f7d4a;
  --red: #c43820;
  --coral: #e4532d;
  --accent: #e4532d;
  --shadow: 7px 7px 16px rgba(140, 96, 48, 0.14), -5px -5px 14px rgba(255, 252, 246, 0.9);
  --inset: inset 3px 3px 7px rgba(140, 96, 48, 0.16), inset -3px -3px 7px rgba(255, 252, 246, 0.85);
  --sans: "Nunito", "Segoe UI", sans-serif;
  --display: "Lilita One", "Nunito", sans-serif;
  --nav: 64px;
  --radius: 22px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; overflow-x: clip; }

body {
  margin: 0;
  max-width: 100%;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 var(--sans);
  padding-bottom: calc(var(--nav) + env(safe-area-inset-bottom));
}

body.sheet-open { overflow: hidden; }

button, input, select, textarea { font: inherit; color: inherit; }

button { cursor: pointer; }

a { color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

#app { max-width: 1120px; margin: 0 auto; }

.top { padding: calc(20px + env(safe-area-inset-top)) 20px 4px; text-align: center; }

.brand {
  margin: 0 0 8px;
  color: var(--coral);
  font-family: var(--display);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

h1 {
  display: inline-block;
  margin: 2px 0 8px;
  padding: 8px 14px 6px;
  background: var(--sun);
  color: var(--coral);
  font-family: var(--display);
  font-size: 34px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.recipes-top h1 {
  font-size: 51px;
  padding: 12px 21px 9px;
}

.lede, .quiet, .why, .note, .tip, .feed, .store-note { color: var(--muted); }

.lede { margin: 0; font-size: 16px; max-width: 36em; }

.plan-link {
  display: flex;
  width: fit-content;
  margin: 12px auto 0;
  border: 0;
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow);
}

.screen { padding: 8px 16px 20px; }

.search {
  display: block;
  margin: 12px 0 10px;
}

.search input,
.import-box textarea,
select,
input[type="text"],
input[type="number"],
input[type="search"] {
  width: 100%;
  background: var(--fill);
  color: var(--ink);
  border: 0;
  border-radius: 999px;
  padding: 12px 14px;
  min-height: 48px;
  box-shadow: var(--inset);
}

.search input { padding-left: 18px; }

textarea,
.import-box textarea,
.editor textarea,
.boot-code { border-radius: 18px; }

.filters, .presets, .meal-tools, .extra-row, .shop-actions, .sheet-actions, .qty, .people, .cupboard {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.meal-tools, .shop-actions { flex-direction: column; align-items: stretch; }

.tool-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; width: 100%; }

.trolley-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
}

.trolley-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--coral);
  flex: none;
}

.trolley-mark svg { width: 30px; height: 30px; }

.shop-actions .trolley-actions button {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.shop-actions .trolley-actions button[data-id="fill"] {
  width: auto;
  padding: 0 16px 0 12px;
  display: inline-flex;
  gap: 8px;
  background: var(--coral);
  color: #fffaf3;
  box-shadow: 5px 5px 12px rgba(180, 70, 36, 0.22);
  font-size: 15px;
  font-weight: 800;
}

.shop-actions .trolley-actions button[data-id="clear"] { color: var(--red); }

.sort-line label { display: flex; align-items: center; gap: 8px; width: 100%; }

.sort-line label.sr {
  display: block;
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sort-line select { flex: 1; width: auto; min-width: 0; }

.filters { margin: 0 0 12px; }

.recipe-bar {
  background: var(--card);
  border: 0;
  border-radius: 24px;
  padding: 12px;
  margin: 4px 0 14px;
  box-shadow: var(--shadow);
}

.recipe-bar .search { margin: 0; }

.recipe-bar .search input {
  min-height: 42px;
  background: var(--fill);
  border-color: transparent;
}

.recipe-bar .filters {
  margin: 10px 0 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 8px 16px 4px;
}

.recipe-bar .filters::-webkit-scrollbar { display: none; }

.recipe-bar .filter,
.recipe-bar .filter[aria-pressed="true"] {
  box-shadow: none;
  background: var(--fill);
  color: var(--ink);
  border-radius: 999px;
  min-height: 34px;
  padding: 4px 12px;
  font-size: 14px;
  font-weight: 800;
  flex: none;
}

.recipe-bar .filter[aria-pressed="true"] {
  background: var(--coral);
  color: #fffaf3;
  box-shadow: 5px 5px 12px rgba(180, 70, 36, 0.22);
}

.recipe-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  padding: 4px 4px 12px;
}

.cat-menu { position: relative; flex: none; min-width: 0; }

.cat-toggle {
  width: auto;
  text-align: center;
  background-color: var(--fill);
  color: var(--ink);
  border: 0;
  border-radius: 999px;
  min-height: 34px;
  padding: 4px 28px 4px 12px;
  font-size: 14px;
  font-weight: 800;
  box-shadow: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 14px) 14px, calc(100% - 9px) 14px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.cat-toggle.on {
  background-color: var(--coral);
  color: #fffaf3;
  box-shadow: 5px 5px 12px rgba(180, 70, 36, 0.22);
}

.cat-panel {
  position: absolute;
  z-index: 8;
  top: calc(100% + 6px);
  left: 0;
  width: min(300px, 78vw);
  background: var(--card);
  border: 0;
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 8px;
}

.cat-type {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--fill);
  border-radius: 12px;
  padding: 2px 4px 2px 12px;
}

.cat-type input {
  border: 0;
  background: transparent;
  min-height: 36px;
  padding: 0;
  width: auto;
  flex: 1;
}

.cat-add-btn {
  border: 0;
  border-radius: 999px;
  min-height: 30px;
  padding: 4px 12px;
  background: var(--coral);
  color: #fffaf3;
  font-weight: 800;
}

.cat-list { margin-top: 6px; max-height: 220px; overflow: auto; }

.cat-item { display: flex; align-items: center; gap: 4px; }

.cat-item button[data-action="filter"] {
  flex: 1;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 8px;
  min-height: 36px;
  padding: 6px 8px;
  font-weight: 650;
}

.cat-item button[aria-pressed="true"] { background: var(--fill); }

.recipe-bar .sort-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1.4 1 240px;
  width: auto;
  min-width: 0;
}

.recipe-bar .sort-line select {
  flex: 1;
  width: auto;
  min-width: 0;
  min-height: 40px;
  border-radius: 999px;
  background: var(--fill);
  border-color: transparent;
  box-shadow: var(--inset);
  padding: 8px 12px;
}

.dir {
  display: flex;
  background: var(--fill);
  border-radius: 999px;
  padding: 3px;
  flex: none;
  box-shadow: var(--inset);
}

.dir button {
  border: 0;
  background: transparent;
  color: var(--muted);
  width: 36px;
  min-height: 34px;
  padding: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
}

.dir button[aria-pressed="true"] {
  background: var(--coral);
  color: #fffaf3;
  box-shadow: 5px 5px 12px rgba(180, 70, 36, 0.22);
}

.recipe-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 16px;
  margin-top: 4px;
  padding: 0 4px;
}

.recipe-actions button {
  background: none;
  border: 0;
  padding: 6px 0;
  min-height: 32px;
  color: var(--muted);
  font-weight: 650;
  font-size: 14px;
}

.recipe-actions button:hover { color: var(--ink); }

.filter, .preset, .chip, .quiet-btn, .text, .add, .primary, .signin, .save-box button, .import-box button, .shop-actions button, .install {
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  min-height: 40px;
  background: var(--coral);
  color: #fffaf3;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 5px 5px 12px rgba(180, 70, 36, 0.22);
}

.filter, .preset, .preset.ghost, .chip, .quiet-btn, .text, .shop-actions .quiet-btn {
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.filter[aria-pressed="true"], .preset[aria-pressed="true"] {
  background: var(--sun);
  color: var(--coral);
  box-shadow: var(--inset);
}

.controls .preset,
.controls .preset.ghost {
  background: var(--fill);
  color: var(--ink);
  box-shadow: none;
  border-radius: 999px;
  min-height: 34px;
  padding: 4px 12px;
  font-size: 14px;
  font-weight: 800;
}

.controls .preset[aria-pressed="true"] {
  background: var(--coral);
  color: #fffaf3;
  box-shadow: 5px 5px 12px rgba(180, 70, 36, 0.22);
}

.pantry-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 4px 28px;
}

.pantry-shot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 72px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.shop-actions .primary {
  background: var(--coral);
  color: #fffaf3;
}

.shop-actions .quiet-btn[data-id="clear"] { color: var(--red); }

.group { margin: 22px 0 8px; }

.group h2, .panel h2, .summary h2, .controls h2, .aisle summary, .fold.cook summary, details h3, .saved-head {
  margin: 0 0 12px;
  color: var(--coral);
  font-family: var(--display);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.meals {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.meal {
  position: relative;
  background: var(--card);
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.meal.on { box-shadow: var(--shadow), inset 0 0 0 3px var(--sun); }

.shot {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #ece8e2;
  aspect-ratio: 5 / 4;
}

.shot img, .sheet img, .plan-row img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.meal.on .shot::after {
  content: "In this plan";
  position: absolute;
  left: 10px;
  bottom: 10px;
  background: var(--card);
  color: var(--coral);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}

.meal-copy { padding: 12px 14px 14px; }

.meal-copy h2, .sheet h2 { margin: 0 0 8px; letter-spacing: -0.03em; }

.meal-copy h2 { font-size: 18px; }

.title {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 720;
  text-align: left;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}

.chip-row span, .tag {
  display: inline-flex;
  align-items: center;
  background: var(--fill);
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 600;
}

.tag.warn { background: #fdeceb; color: var(--red); }

.facts { margin: 0 0 4px; }

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.qty button, .people button {
  width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--fill);
  color: var(--ink);
  font-size: 20px;
}

.qty input { width: 64px; min-height: 36px; text-align: center; }

.feed { margin: 6px 0 0; font-size: 13px; }

.controls, .panel, .summary, .import-box {
  margin: 12px 16px;
  padding: 16px;
  background: var(--card);
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.import-wrap {
  margin: 0 0 16px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.import-wrap summary {
  padding: 4px 6px 8px;
  font-weight: 650;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}

.import-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 8px 10px 12px;
  background: var(--card);
  border: 0;
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.import-box label, .control-row label, .meal-tools label { font-weight: 700; }

.import-box textarea { min-height: 72px; resize: vertical; }

.import-box button, .save-box button, .add, .primary, .signin { align-self: flex-start; }

.control-row { display: flex; flex-direction: column; gap: 12px; }

.controls h2 { margin-bottom: 14px; }

.shop-setup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.store-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 800;
  text-align: left;
}

.store-field select { margin: 0; }

.week-field { margin-top: 12px; }

.people-mark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--ink);
  flex: none;
}

.people-mark svg { display: block; }

.people {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 6px 8px 6px 14px;
  background: var(--fill);
  border-radius: 999px;
  box-shadow: var(--inset);
  font-weight: 800;
}

.people strong { min-width: 1.4em; text-align: center; }

.people button {
  width: 34px;
  min-height: 34px;
  border: 0;
  box-shadow: none;
  background: var(--card);
}

.checks { display: grid; gap: 8px; margin-top: 14px; }

.check {
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  text-align: left;
  background: var(--fill);
  border-radius: 16px;
  padding: 12px 14px;
}

.presets { margin-top: 14px; }

.store-note { margin: 12px 0 0; text-align: left; }

@media (max-width: 640px) {
  .shop-setup { grid-template-columns: 1fr; }
}

.store-note, .trolley-help, .foot { font-size: 14px; }

.till {
  margin: 4px 0;
  color: var(--coral);
  font-family: var(--display);
  font-size: 52px;
  font-weight: 400;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.protein-line { margin: 8px 0; }

.slot { margin: 10px 0; font-size: 15px; }

.slot div:first-child { display: flex; justify-content: space-between; }

.bar {
  height: 6px;
  margin-top: 6px;
  background: var(--fill);
  border-radius: 99px;
  overflow: hidden;
}

.bar span { display: block; height: 100%; background: var(--coral); }

.picked, .saved { list-style: none; margin: 14px 0 0; padding: 0; }

.picked li, .saved li { border-top: 1px solid var(--line); }

.plan-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border: 0;
  background: transparent;
  text-align: left;
  font-weight: 650;
}

.plan-row img {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  background: #ece8e2;
  flex: none;
}

.plan-row span:last-child { margin-left: auto; color: var(--muted); font-weight: 600; }

.plan-item {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
}

.plan-open {
  flex: 1 1 200px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  font-weight: 650;
}

.plan-open img {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  background: #ece8e2;
  flex: none;
}

.plan-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.plan-copy span { color: var(--muted); font-size: 13px; font-weight: 600; }

.plan-controls { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.summary .picked { margin-bottom: 22px; }

.summary > .add { margin-bottom: 10px; }

.saved-block .fold.cook summary,
.saved-block .fold.cook > p,
.saved-block .fold.cook > .save-box,
.saved-block .fold.cook > .saved { margin: 16px 0 0; }

.saved-block .fold.cook summary { margin: 0; }

.saved-head { margin: 22px 0 8px; font-size: 22px; }

.saved li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
}

.saved li button:first-child {
  border: 0;
  background: transparent;
  padding: 0;
  font-weight: 700;
  text-align: left;
}

.basket-meta {
  flex: 1 1 100%;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.notice { margin: 8px 0 0; color: var(--ink); font-weight: 650; }

.trolley-miss-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.trolley-miss-head p { margin: 0; }
.trolley-miss-head .quiet-btn { min-height: 32px; padding: 4px 12px; }

.menu-panel .week-field { display: block; margin: 0 0 12px; font-weight: 800; }
.menu-panel .week-field select,
.menu-panel .week-field input {
  display: block;
  width: 100%;
  margin-top: 6px;
}
.menu-tools { display: flex; gap: 8px; margin: 0 0 14px; }
.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.menu-tile {
  position: relative;
  background: var(--card);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.menu-tile .shot {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.menu-tile img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}
.menu-tile span {
  display: block;
  padding: 8px 10px 12px;
  font-weight: 800;
  line-height: 1.25;
}
.menu-tile .tile-x {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
  z-index: 1;
}

.trolley-miss { margin: 12px 0 0; }
.trolley-miss p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.trolley-miss .ingredients { margin: 0; }
.trolley-miss .ing { margin: 8px 0; }

.macros, .ticks { display: grid; gap: 8px; }

.macros { grid-template-columns: 1fr 1fr; margin: 12px 0; }

.macros div, .ticks li {
  background: var(--fill);
  border-radius: 14px;
  padding: 12px;
}

.macros strong { display: block; font-size: 22px; letter-spacing: -0.03em; }

.macros span, .ticks span { color: var(--muted); font-size: 13px; }

.ticks { list-style: none; margin: 0; padding: 0; }

.ticks li.ok strong { color: var(--green); }

.aisle {
  margin-top: 18px;
  background: var(--card);
  border-radius: 22px;
  padding: 6px 16px 8px;
  box-shadow: var(--shadow);
  border-top: 0;
}

.aisle summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}

.aisle summary::-webkit-details-marker { display: none; }

.aisle summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--coral);
  border-bottom: 2px solid var(--coral);
  transform: rotate(-135deg);
  flex: none;
}

.aisle:not([open]) summary::after { transform: rotate(45deg); }

.fold { margin-top: 16px; border-top: 0; padding: 0; }

.fold summary {
  cursor: pointer;
  list-style: none;
  font-weight: 800;
  color: var(--coral);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fold summary::-webkit-details-marker { display: none; }

.fold summary::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-right: 2px solid var(--coral);
  border-bottom: 2px solid var(--coral);
  transform: rotate(-135deg);
  flex: none;
}

.fold:not([open]) summary::after { transform: rotate(45deg); }

.fold.cook summary { display: flex; }

.item-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  font-weight: 720;
}

.line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.line-end { display: flex; flex-direction: column; align-items: flex-end; min-width: 140px; gap: 6px; }

.line-tools { display: flex; align-items: center; gap: 8px; }

.line-end .line-remove {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 999px;
  background: var(--fill);
  color: var(--ink);
  box-shadow: none;
  font-size: 22px;
  line-height: 1;
}

.line-end strong { font-variant-numeric: tabular-nums; }

.line-end a { font-size: 14px; font-weight: 650; text-underline-offset: 3px; }

.have { display: block; margin-top: 2px; color: var(--muted); font-size: 14px; font-weight: 650; text-align: right; }

.have input { width: 88px; min-height: 36px; }

.cupboard { margin-top: 8px; }

.cupboard p { flex-basis: 100%; margin: 0; font-weight: 700; }

.save-box { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }

.save-box input { flex: 1; min-width: 180px; }

.save-box button { align-self: center; }

.boot-code {
  width: 100%;
  min-height: 96px;
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--fill);
  color: var(--ink);
  font: 13px/1.4 ui-monospace, Consolas, monospace;
}

.step-count { margin: 0 0 4px; color: var(--muted); }

.qty-hero {
  margin: 4px 0 8px;
  color: var(--coral);
  font-family: var(--display);
  font-size: 56px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.signin { display: inline-flex; margin-top: 8px; }

.foot { padding: 0 4px 8px; }

.sheet-back {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(44, 36, 28, 0.35);
}

.sheet {
  position: fixed;
  z-index: 31;
  inset: 0;
  overflow: auto;
  background: var(--bg);
  padding: 0 0 calc(20px + env(safe-area-inset-bottom));
}

.sheet-card {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  background: var(--card);
  min-height: 100%;
}

.sheet img { aspect-ratio: 4 / 3; background: #ece8e2; }

.close {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top));
  left: 12px;
  z-index: 2;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 8px 14px;
  font-weight: 700;
  box-shadow: var(--shadow);
}

.sheet-body { padding: 18px 18px 8px; }

.sheet h2 {
  color: var(--coral);
  font-family: var(--display);
  font-size: 32px;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.05;
}

.sheet h3 {
  margin: 22px 0 8px;
  color: var(--coral);
  font-family: var(--display);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ingredients, .method, .sheet ul, .sheet ol { margin: 0; padding-left: 18px; }

.ingredients { list-style: none; padding-left: 0; }

.ingredients li, .method li, .sheet li { margin: 8px 0; }

.ing { display: flex; align-items: center; gap: 12px; }

.ing-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }

.ing-copy strong { font-size: 14px; }

.ing-copy span { color: var(--ink); }

.ing-ico {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #f6f3ee;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  position: relative;
  overflow: hidden;
}

.sheet .ing-ico { width: 64px; height: 64px; border-radius: 14px; }

.ing-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.heart, .sheet-heart {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #b7b1aa;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
}

.meal .heart { position: absolute; top: 10px; right: 10px; z-index: 2; }

.heart.on, .sheet-heart.on { color: var(--accent); }

.sheet-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }

.sheet-title h2 { margin: 0; }

.source { font-weight: 700; text-underline-offset: 3px; }

.qty.portion span { min-width: 84px; text-align: center; font-weight: 700; }

.units { display: flex; gap: 8px; margin: 8px 0; }

.units button {
  border: 0;
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  min-height: 40px;
  padding: 8px 16px;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.units button[aria-pressed="true"] {
  background: var(--coral);
  color: #fffaf3;
  box-shadow: 5px 5px 12px rgba(180, 70, 36, 0.22);
}

.filter-x {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  min-height: 36px;
  padding: 6px 12px;
}

.filter-wrap { display: inline-flex; align-items: center; gap: 4px; }

.filter-x { width: 36px; padding: 0; }

.cat-item .filter-x { width: 32px; min-height: 32px; padding: 0; }

.inline-field { display: block; margin: 12px 0; font-weight: 650; }

.inline-field select, .editor input, .editor select, .editor textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
}

.editor textarea { min-height: 88px; resize: vertical; }

.edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

@media (max-width: 700px) {
  .edit-grid { grid-template-columns: 1fr; }
}

.edit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px auto 36px;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
}

.edit-row select, .edit-row input { width: 100%; min-width: 0; margin: 0; }

.edit-row .unit { color: var(--muted); font-size: 13px; }

.edit-row button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
}

.danger { color: var(--red); }

.edit-row select.unit { width: 72px; }

@media (max-width: 700px) {
  .edit-row { grid-template-columns: minmax(0, 1fr) 64px 68px 36px; }
}

.sheet-cta {
  position: sticky;
  bottom: 0;
  margin: 18px -18px 0;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 250, 243, 0.94);
  border-top: 0;
  box-shadow: 0 -8px 18px rgba(140, 96, 48, 0.08);
}

.sheet-cta .add, .sheet-cta .text { width: 100%; }

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  background: rgba(246, 239, 226, 0.94);
  backdrop-filter: blur(16px);
  border-top: 0;
  box-shadow: 0 -8px 18px rgba(140, 96, 48, 0.1);
  padding-bottom: env(safe-area-inset-bottom);
}

.tabbar button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #8d877f;
  padding: 8px 0 10px;
  font-size: 11px;
  font-weight: 700;
  min-height: var(--nav);
}

.tabbar button[aria-pressed="true"] { color: var(--coral); }

.tabbar svg { display: block; }

.empty { margin: 12px 0; color: var(--muted); }

details {
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

details summary { font-weight: 700; cursor: pointer; }

@media (min-width: 720px) {
  .meals { grid-template-columns: 1fr 1fr; }
  .control-row { flex-direction: row; flex-wrap: wrap; }
  .sheet {
    top: 24px;
    left: 50%;
    right: auto;
    bottom: 24px;
    width: min(760px, calc(100% - 48px));
    transform: translateX(-50%);
    background: transparent;
    padding: 0;
    border-radius: 22px;
  }
  .sheet-card { border-radius: 22px; overflow: hidden; min-height: 0; }
}

@media (min-width: 980px) {
  body { padding: 0 0 0 220px; }
  .meals { grid-template-columns: 1fr 1fr 1fr; }
  .tabbar {
    top: 0;
    bottom: 0;
    left: 0;
    right: auto;
    width: 220px;
    flex-direction: column;
    justify-content: flex-start;
    gap: 4px;
    padding: 22px 12px;
    border-top: 0;
    border-right: 0;
    background: var(--bg);
    box-shadow: 8px 0 18px rgba(140, 96, 48, 0.08);
  }
  .tabbar button {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 15px;
  }
  .tabbar button[aria-pressed="true"] { background: var(--sun); color: var(--coral); box-shadow: var(--inset); }
}

@media (max-width: 700px) {
  .recipe-bar .filters {
    flex-wrap: wrap;
    justify-content: center;
    overflow-x: visible;
  }

  .presets, .recipe-actions, .tool-line, .trolley-actions { justify-content: center; }
  .trolley-actions { align-self: center; flex-wrap: wrap; }

  .line { flex-direction: column; }
  .line-end, .have { align-items: flex-start; text-align: left; }
}

@media print {
  body { background: white; padding: 0; }
  .tabbar, .sheet, .sheet-back, .controls, .shop-actions, .have, .line-end a, .extra-row, .shot, .qty, .add, .search, .filters, .meal-tools, .recipe-bar, .import-box, .import-wrap { display: none !important; }
  .meal, .panel, .summary { box-shadow: none; }
}
