/* ============================================================
   The Pantry — "Sunday Kitchen"
   cream/linen · pine ink · terracotta · Fraunces + Inter
   ============================================================ */
:root {
  --cream: #FAF6EF;
  --linen: #F3ECDF;
  --linen-deep: #EAE0CC;
  --card: #FFFDF8;
  --pine: #1F3A2E;
  --pine-deep: #16291F;
  --pine-soft: #3D5C4D;
  --terra: #C4673B;
  --terra-deep: #A6532E;
  --gold: #B8935A;
  --ink: #26312B;
  --ink-soft: #5C665F;
  --danger: #A63A2E;
  --ok: #4A7C59;
  --shadow-s: 0 1px 2px rgba(31, 58, 46, .06), 0 2px 8px rgba(31, 58, 46, .05);
  --shadow-m: 0 2px 6px rgba(31, 58, 46, .07), 0 10px 28px rgba(31, 58, 46, .09);
  --shadow-l: 0 6px 16px rgba(31, 58, 46, .10), 0 24px 56px rgba(31, 58, 46, .14);
  --r: 14px;
  --r-lg: 22px;
  --ease: cubic-bezier(.33, 1, .48, 1);
  --ease-pop: cubic-bezier(.34, 1.45, .5, 1);
  --nav-h: 64px;
  --font-d: "Fraunces", Georgia, serif;
  --font-u: "Inter", -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-u);
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(184, 147, 90, .10), transparent 60%),
    radial-gradient(900px 420px at -10% 0%, rgba(196, 103, 59, .07), transparent 55%),
    var(--cream);
  color: var(--ink);
  min-height: 100dvh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-d); font-weight: 600; line-height: 1.12; text-wrap: balance; color: var(--pine); letter-spacing: -.015em; }
::selection { background: rgba(196, 103, 59, .25); }
:focus-visible { outline: 3px solid var(--terra); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- layout: sidebar (desktop) / tab bar (phone) ---------- */
.main { max-width: 1180px; margin: 0 auto; padding: clamp(16px, 3vw, 40px); padding-bottom: calc(var(--nav-h) + 28px); }

.nav {
  position: fixed; z-index: 40; inset: auto 0 0 0; height: var(--nav-h);
  display: flex; align-items: stretch; justify-content: space-around;
  background: rgba(255, 253, 248, .92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--linen-deep);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav__brand, .nav__out { display: none; }
.nav__links { display: flex; flex: 1; justify-content: space-around; }
.nav__link {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; text-decoration: none; color: var(--ink-soft);
  font-size: .68rem; font-weight: 600; letter-spacing: .02em;
  transition: color .2s var(--ease), transform .2s var(--ease);
}
.nav__icon { font-size: 1.35rem; line-height: 1; transition: transform .25s var(--ease-pop); }
.nav__link.is-active { color: var(--terra-deep); }
.nav__link.is-active .nav__icon { transform: translateY(-2px) scale(1.12); }
.nav__link:active .nav__icon { transform: scale(.92); }

@media (min-width: 980px) {
  body { padding-left: 232px; }
  .main { padding-bottom: 48px; }
  .nav {
    inset: 0 auto 0 0; width: 232px; height: auto; flex-direction: column;
    justify-content: flex-start; border-top: 0; border-right: 1px solid var(--linen-deep);
    padding: 28px 16px;
  }
  .nav__brand { display: flex; align-items: center; gap: 10px; padding: 4px 12px 26px; }
  .nav__logo { font-size: 1.7rem; }
  .nav__name { font-family: var(--font-d); font-size: 1.28rem; font-weight: 700; color: var(--pine); }
  .nav__links { flex-direction: column; flex: initial; gap: 4px; }
  .nav__link {
    flex-direction: row; justify-content: flex-start; gap: 12px;
    font-size: .95rem; font-weight: 500; padding: 11px 14px; border-radius: 11px;
  }
  .nav__icon { font-size: 1.2rem; }
  .nav__link:hover { background: var(--linen); color: var(--pine); }
  .nav__link.is-active { background: var(--pine); color: var(--cream); box-shadow: var(--shadow-s); }
  .nav__out {
    display: block; margin-top: auto; padding: 10px 14px; font-size: .84rem;
    color: var(--ink-soft); text-decoration: none; border-radius: 10px;
  }
  .nav__out:hover { background: var(--linen); color: var(--pine); }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 22px; border-radius: 999px;
  font-weight: 600; font-size: .95rem; text-decoration: none;
  transition: transform .18s var(--ease-pop), box-shadow .2s var(--ease), background .2s var(--ease), color .2s var(--ease);
  cursor: pointer;
}
.btn--primary { background: var(--terra); color: #FFF8F2; box-shadow: 0 2px 10px rgba(196, 103, 59, .34); }
.btn--primary:hover { background: var(--terra-deep); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(196, 103, 59, .4); }
.btn--primary:active { transform: translateY(0) scale(.98); }
.btn--pine { background: var(--pine); color: var(--cream); box-shadow: var(--shadow-s); }
.btn--pine:hover { background: var(--pine-deep); transform: translateY(-1px); box-shadow: var(--shadow-m); }
.btn--ghost { background: transparent; color: var(--pine); border: 1.5px solid var(--linen-deep); }
.btn--ghost:hover { border-color: var(--pine-soft); background: var(--card); }
.btn--sm { min-height: 36px; padding: 6px 14px; font-size: .84rem; }

/* ---------- login ---------- */
.login { min-height: calc(100dvh - var(--nav-h) - 60px); display: grid; place-items: center; }
@media (min-width: 980px) { .login { min-height: calc(100dvh - 120px); } }
.login__card {
  width: min(420px, 92vw); background: var(--card); border: 1px solid var(--linen-deep);
  border-radius: var(--r-lg); box-shadow: var(--shadow-l); padding: clamp(30px, 6vw, 48px);
  text-align: center; animation: rise .7s var(--ease) both;
}
.login__mark { font-size: 3rem; margin-bottom: 8px; animation: sway 5s ease-in-out infinite; }
.login__title { font-size: clamp(2rem, 6vw, 2.6rem); }
.login__sub { color: var(--ink-soft); margin: 6px 0 22px; font-size: .95rem; }
.login__error { background: #FBEBE8; color: var(--danger); border-radius: 10px; padding: 10px 14px; font-size: .88rem; margin-bottom: 14px; }
.login__form { display: grid; gap: 12px; }
.login__input {
  min-height: 48px; border: 1.5px solid var(--linen-deep); border-radius: 12px;
  padding: 10px 16px; background: var(--cream); text-align: center; font-size: 1rem;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.login__input:focus { outline: none; border-color: var(--terra); box-shadow: 0 0 0 4px rgba(196, 103, 59, .14); }
.login__btn { width: 100%; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes sway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }

/* ---------- shared bits ---------- */
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: clamp(16px, 3vw, 26px); flex-wrap: wrap; }
.page-head h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); }
.page-head .sub { color: var(--ink-soft); font-size: .93rem; margin-top: 4px; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 18px); transform: translateX(-50%) translateY(20px);
  background: var(--pine-deep); color: var(--cream); padding: 11px 20px; border-radius: 999px;
  font-size: .9rem; font-weight: 500; box-shadow: var(--shadow-l); opacity: 0; pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease); z-index: 90; max-width: 92vw; text-align: center;
}
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 980px) { .toast { bottom: 26px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- inventory board ---------- */
.zone-switch { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.zone-switch::-webkit-scrollbar { display: none; }
.zone-switch__btn {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; min-height: 44px;
  padding: 8px 16px; border-radius: 999px; background: var(--card); border: 1.5px solid var(--linen-deep);
  font-weight: 600; font-size: .9rem; color: var(--ink-soft); white-space: nowrap;
  transition: all .2s var(--ease);
}
.zone-switch__btn.is-on { background: var(--pine); border-color: var(--pine); color: var(--cream); box-shadow: var(--shadow-s); }
.zone-switch__n { background: rgba(255,255,255,.22); border-radius: 999px; padding: 1px 8px; font-size: .74rem; }
.zone-switch__btn:not(.is-on) .zone-switch__n { background: var(--linen); }

.board { display: block; }
.zone { display: none; }
.zone.is-on { display: block; }
.zone__title { display: flex; align-items: center; gap: 8px; font-size: 1.15rem; margin-bottom: 12px; }
.zone__count { font-family: var(--font-u); font-size: .74rem; font-weight: 600; color: var(--ink-soft); background: var(--linen); border-radius: 999px; padding: 2px 9px; }

@media (min-width: 980px) {
  .zone-switch { display: none; }
  .board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
  .zone { display: block; background: rgba(243, 236, 223, .55); border: 1px solid var(--linen-deep); border-radius: var(--r-lg); padding: 14px 10px; min-height: 300px; }
}

.zone__list { display: grid; gap: 10px; min-height: 40px; }
.card {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--linen-deep); border-radius: var(--r);
  padding: 9px 9px; box-shadow: var(--shadow-s);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), opacity .25s var(--ease);
  touch-action: pan-y;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-m); }
.card--held { transform: scale(1.03) rotate(1.2deg); box-shadow: var(--shadow-l); }
.card--ghost { opacity: .35; background: var(--linen); border-style: dashed; }
.card--drag { opacity: .95; }
.card--new { animation: rise .5s var(--ease-pop) both; }
.card.is-out { opacity: .62; }
.card.is-out .card__name { text-decoration: line-through; text-decoration-color: rgba(38,49,43,.4); }
.card__emoji {
  font-size: 1.5rem; width: 46px; height: 46px; display: grid; place-items: center;
  background: var(--linen); border-radius: 12px; transition: transform .2s var(--ease-pop), background .2s var(--ease);
}
.card__emoji:hover { transform: scale(1.1); background: var(--linen-deep); }
.card__body { display: flex; flex-direction: column; min-width: 0; }
.card__name { font-weight: 600; font-size: .95rem; color: var(--pine); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card__unit { font-size: .72rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .08em; }
.card__qty { display: flex; align-items: center; gap: 2px; }
.qbtn {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  font-size: 1.35rem; font-weight: 600; color: var(--pine); background: var(--linen);
  transition: background .15s var(--ease), transform .12s var(--ease-pop);
  user-select: none; -webkit-user-select: none;
}
.qbtn:hover { background: var(--linen-deep); }
.qbtn:active { transform: scale(.88); }
.qbtn--plus { background: rgba(196, 103, 59, .14); color: var(--terra-deep); }
.qbtn--plus:hover { background: rgba(196, 103, 59, .24); }
.card__num {
  font-family: var(--font-d); font-size: 1.5rem; font-weight: 600; color: var(--pine);
  min-width: 30px; text-align: center; font-variant-numeric: tabular-nums;
}
.card__num.pulse { animation: pulse .3s var(--ease-pop); }
@keyframes pulse { 0% { transform: scale(1); } 45% { transform: scale(1.28); color: var(--terra); } 100% { transform: scale(1); } }
.card__zero {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: #FBF1E9; border-radius: 10px; padding: 8px 12px; font-size: .82rem; color: var(--terra-deep);
}
.card__zero-btn { font-weight: 700; color: var(--terra-deep); text-decoration: underline; text-underline-offset: 3px; min-height: 32px; }
.card__zero-btn:disabled { opacity: .6; text-decoration: none; }

.add { margin-top: 12px; position: relative; }
.add__wrap { display: flex; gap: 8px; }
.add__input {
  flex: 1; min-width: 0; min-height: 44px; border: 1.5px dashed var(--linen-deep); border-radius: 12px;
  padding: 8px 14px; background: transparent; font-size: .92rem;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.add__input:focus { outline: none; border-style: solid; border-color: var(--terra); background: var(--card); }
.add__suggest {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--card); border: 1px solid var(--linen-deep); border-radius: 12px;
  box-shadow: var(--shadow-l); overflow: hidden; display: grid;
}
.add__opt { display: flex; align-items: center; gap: 10px; padding: 11px 14px; font-size: .92rem; text-align: left; transition: background .12s; }
.add__opt:hover { background: var(--linen); }

/* ---------- bottom sheet / modal ---------- */
.sheet {
  position: fixed; inset: 0; z-index: 80; background: rgba(22, 41, 31, .4);
  display: grid; place-items: end center; opacity: 0; transition: opacity .2s var(--ease);
  padding: 0 0 0 0;
}
@media (min-width: 700px) { .sheet { place-items: center; } }
.sheet.is-on { opacity: 1; }
.sheet__card {
  width: min(560px, 100vw); background: var(--card); border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 24px 22px calc(24px + env(safe-area-inset-bottom));
  transform: translateY(24px); transition: transform .25s var(--ease); box-shadow: var(--shadow-l);
}
@media (min-width: 700px) { .sheet__card { border-radius: var(--r-lg); } }
.sheet.is-on .sheet__card { transform: none; }
.sheet__title { font-size: 1.3rem; margin-bottom: 14px; }
.field { display: grid; gap: 5px; margin-bottom: 12px; }
.field span { font-size: .8rem; font-weight: 600; color: var(--ink-soft); }
.field input, .field textarea, .field select {
  min-height: 44px; border: 1.5px solid var(--linen-deep); border-radius: 10px; padding: 8px 12px;
  background: var(--cream); width: 100%;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--terra); box-shadow: 0 0 0 4px rgba(196,103,59,.12); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sheet__actions { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.sheet__spacer { flex: 1; }

/* desktop zone columns are narrow: cards go two-row so names breathe */
@media (min-width: 980px) {
  .card { grid-template-columns: auto minmax(0, 1fr); row-gap: 8px; padding: 11px 11px; }
  .card__qty { grid-column: 1 / -1; justify-content: space-between; background: rgba(243, 236, 223, .6); border-radius: 999px; padding: 3px; }
  .card__zero { grid-column: 1 / -1; }
  .card__name { white-space: normal; line-height: 1.25; }
}

/* ---------- kitchen shelves / recipe cards ---------- */
.btn__count { background: var(--terra); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: .74rem; margin-left: 4px; }
.shelf { margin-bottom: clamp(26px, 4vw, 40px); }
.shelf__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.shelf__head h2 { font-size: clamp(1.25rem, 3.4vw, 1.6rem); }
.shelf__note { font-family: var(--font-u); font-size: .8rem; font-weight: 500; color: var(--ink-soft); margin-left: 6px; }
.shelf__more { font-size: .85rem; font-weight: 600; color: var(--terra-deep); text-decoration: none; white-space: nowrap; }
.shelf__more:hover { text-decoration: underline; text-underline-offset: 3px; }
.shelf__row {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(240px, 68vw);
  gap: 14px; overflow-x: auto; padding: 4px 4px 14px; margin: 0 -4px;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
}
.shelf__row::-webkit-scrollbar { height: 8px; }
.shelf__row::-webkit-scrollbar-thumb { background: var(--linen-deep); border-radius: 999px; }
.rcard { scroll-snap-align: start; position: relative; }
.rcard__link { text-decoration: none; display: block; }
.rcard__imgwrap {
  position: relative; aspect-ratio: 8 / 5; border-radius: var(--r); overflow: hidden;
  background: var(--linen); box-shadow: var(--shadow-s);
  transition: box-shadow .25s var(--ease), transform .25s var(--ease);
}
.rcard:hover .rcard__imgwrap { box-shadow: var(--shadow-m); transform: translateY(-3px); }
.rcard__img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.rcard:hover .rcard__img { transform: scale(1.05); }
.rcard__imgwrap--empty { display: grid; place-items: center; background: linear-gradient(135deg, var(--linen), var(--linen-deep)); }
.rcard__ph { font-family: var(--font-d); font-size: 3rem; color: var(--pine-soft); opacity: .5; }
.rcard__badge {
  position: absolute; left: 10px; bottom: 10px; border-radius: 999px; padding: 4px 12px;
  font-size: .72rem; font-weight: 700; letter-spacing: .02em; backdrop-filter: blur(6px);
}
.rcard__badge--go { background: rgba(74, 124, 89, .92); color: #F2F8F4; }
.rcard__badge--almost { background: rgba(196, 103, 59, .92); color: #FFF4EC; }
.rcard__title { font-size: 1rem; margin-top: 10px; line-height: 1.25; color: var(--pine);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rcard__ribbon { display: inline-block; margin-top: 4px; font-size: .68rem; font-weight: 700;
  color: var(--gold); text-transform: uppercase; letter-spacing: .1em; }
.rcard__missing { display: grid; gap: 5px; margin-top: 8px; }
.rcard__miss {
  display: flex; align-items: center; gap: 7px; font-size: .8rem; color: var(--ink-soft);
  background: var(--card); border: 1px dashed var(--linen-deep); border-radius: 999px;
  padding: 6px 12px; min-height: 34px; transition: all .2s var(--ease); text-align: left;
}
.rcard__miss b { margin-left: auto; color: var(--terra-deep); font-weight: 700; white-space: nowrap; }
.rcard__miss:hover { border-color: var(--terra); background: #FDF3EC; }
.rcard__miss.is-done { opacity: .55; border-style: solid; }
.rcard__miss.is-done b::after { content: " ✓"; }

[data-reveal] { opacity: 0; transform: translateY(14px) scale(.98); transition: opacity .55s var(--ease), transform .55s var(--ease); }
[data-reveal].is-in { opacity: 1; transform: none; }

.empty {
  display: flex; align-items: center; gap: 14px; background: var(--card);
  border: 1px dashed var(--linen-deep); border-radius: var(--r-lg); padding: 22px;
  color: var(--ink-soft); font-size: .93rem;
}
.empty__icon { font-size: 2rem; }

.lowstock { background: var(--card); border: 1px solid var(--linen-deep); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow-s); }
.lowstock__title { font-size: 1.1rem; margin-bottom: 10px; }
.lowstock__row { display: flex; flex-wrap: wrap; gap: 8px; }
.lowstock__chip {
  display: inline-flex; align-items: center; gap: 7px; background: var(--linen);
  border-radius: 999px; padding: 6px 6px 6px 14px; font-size: .85rem; font-weight: 500;
}
.lowstock__chip.is-out { background: #FBEBE8; color: var(--danger); }
.lowstock__add {
  width: 30px; height: 30px; border-radius: 50%; background: var(--card); color: var(--terra-deep);
  font-weight: 700; display: grid; place-items: center; box-shadow: var(--shadow-s);
  transition: transform .15s var(--ease-pop);
}
.lowstock__add:hover { transform: scale(1.12); }
.lowstock__add.is-done { opacity: .5; }

/* ---------- recipe browse ---------- */
.rsearch { margin-bottom: 12px; }
.rsearch__input {
  width: 100%; min-height: 50px; border: 1.5px solid var(--linen-deep); border-radius: 999px;
  padding: 10px 22px; background: var(--card); font-size: 1rem; box-shadow: var(--shadow-s);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.rsearch__input:focus { outline: none; border-color: var(--terra); box-shadow: 0 0 0 4px rgba(196,103,59,.12); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; min-height: 40px; display: inline-flex; align-items: center; padding: 7px 16px;
  border-radius: 999px; background: var(--card); border: 1.5px solid var(--linen-deep);
  font-size: .87rem; font-weight: 600; color: var(--ink-soft); text-decoration: none;
  transition: all .2s var(--ease); white-space: nowrap;
}
.chip:hover { border-color: var(--pine-soft); color: var(--pine); }
.chip.is-on { background: var(--pine); border-color: var(--pine); color: var(--cream); }
.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 16px 14px; }
@media (min-width: 700px) { .rgrid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px 18px; } }
.rgrid .rcard { text-decoration: none; }
.rgrid__empty { grid-column: 1 / -1; }
.rcard__heart { position: absolute; top: 8px; right: 8px; font-size: 1rem; filter: drop-shadow(0 1px 3px rgba(0,0,0,.3)); }
.loadmore { display: grid; place-items: center; padding: 26px 0 8px; }

/* ---------- recipe detail ---------- */
.rd { max-width: 880px; margin: 0 auto; }
.rd__hero {
  position: relative; border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 16 / 9;
  background: var(--linen); box-shadow: var(--shadow-m); margin-bottom: 18px;
}
.rd__hero--empty {
  aspect-ratio: auto; height: 130px; display: grid; place-items: center; font-size: 2.6rem;
  background:
    radial-gradient(340px 90px at 12% 110%, rgba(196, 103, 59, .16), transparent 70%),
    radial-gradient(300px 100px at 88% -10%, rgba(184, 147, 90, .2), transparent 70%),
    linear-gradient(135deg, var(--linen), var(--linen-deep));
}
.rd__blur { position: absolute; inset: -20px; width: calc(100% + 40px); height: calc(100% + 40px);
  object-fit: cover; filter: blur(36px) saturate(1.3); opacity: .8; }
.rd__img { position: relative; width: 100%; height: 100%; object-fit: contain; }
.rd__head { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.rd__title { font-size: clamp(1.6rem, 5vw, 2.3rem); }
.rd__heart { font-size: 1.7rem; min-width: 52px; min-height: 52px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--linen-deep); box-shadow: var(--shadow-s);
  transition: transform .18s var(--ease-pop); }
.rd__heart:hover { transform: scale(1.1); }
.rd__heart.is-on { animation: heartbeat .45s var(--ease-pop); }
@keyframes heartbeat { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }
.rd__meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 22px; }
.rd__chip { background: var(--linen); border-radius: 999px; padding: 5px 13px; font-size: .8rem; font-weight: 600; color: var(--pine-soft); }
.rd__chip--family { background: rgba(184, 147, 90, .18); color: #7A5F37; }
.rd__cols { display: grid; gap: 26px; }
@media (min-width: 820px) { .rd__cols { grid-template-columns: 340px 1fr; align-items: start; } }
.rd__ings { background: var(--card); border: 1px solid var(--linen-deep); border-radius: var(--r-lg);
  padding: 20px; box-shadow: var(--shadow-s); position: sticky; top: 14px; }
.rd__ings h2, .rd__steps h2 { font-size: 1.25rem; margin-bottom: 12px; }
.ilist { list-style: none; display: grid; gap: 2px; }
.ilist__row { display: flex; align-items: baseline; gap: 10px; padding: 7px 4px; border-radius: 8px; font-size: .92rem; }
.ilist__mark { font-weight: 800; width: 18px; flex: 0 0 18px; text-align: center; }
.ilist__row.is-have .ilist__mark { color: var(--ok); }
.ilist__row.is-missing { background: #FDF4EE; }
.ilist__row.is-missing .ilist__mark { color: var(--terra-deep); }
.ilist__text { flex: 1; }
.ilist__add { flex: 0 0 auto; font-size: .78rem; font-weight: 700; color: var(--terra-deep);
  border: 1px dashed var(--terra); border-radius: 999px; padding: 3px 10px; min-height: 30px;
  transition: background .15s var(--ease); white-space: nowrap; }
.ilist__add:hover { background: #FBE9DE; }
.ilist__note { font-size: .76rem; color: var(--ink-soft); margin-top: 12px; }
.slist { list-style: none; display: grid; gap: 16px; }
.slist__step { display: flex; gap: 14px; align-items: start; }
.slist__no { flex: 0 0 34px; width: 34px; height: 34px; display: grid; place-items: center;
  background: var(--pine); color: var(--cream); border-radius: 50%; font-family: var(--font-d);
  font-weight: 600; font-size: .95rem; }
.slist__step p { flex: 1; padding-top: 4px; }
.rd__notes { margin-top: 26px; position: relative; }
.rd__notebox { width: 100%; border: 1.5px solid var(--linen-deep); border-radius: var(--r);
  padding: 12px 14px; background: var(--card); resize: vertical; min-height: 80px; }
.rd__notebox:focus { outline: none; border-color: var(--terra); box-shadow: 0 0 0 4px rgba(196,103,59,.1); }
.rd__notesaved { position: absolute; right: 4px; bottom: -22px; font-size: .78rem; color: var(--ok); font-weight: 600; }

.cookbar { position: sticky; bottom: calc(var(--nav-h) + 12px); display: grid; place-items: center; padding: 40px 0 8px; margin-top: -28px; z-index: 30; pointer-events: none;
  background: linear-gradient(to top, var(--cream) 42%, transparent); }
@media (min-width: 980px) { .cookbar { bottom: 18px; justify-items: end; padding: 40px 8px 8px 0; background: none; } }
.cookbar__btn { pointer-events: auto; font-size: 1.05rem; padding: 14px 34px; box-shadow: 0 8px 26px rgba(196,103,59,.45); }

/* ---------- cook mode ---------- */
.cook { position: fixed; inset: 0; z-index: 100; background: var(--pine-deep); color: var(--cream); display: flex; flex-direction: column; }
.cook__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px clamp(16px, 4vw, 30px); }
.cook__title { font-family: var(--font-d); font-size: 1rem; opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cook__x { font-size: 1.2rem; min-width: 46px; min-height: 46px; border-radius: 50%; background: rgba(255,255,255,.1); transition: background .2s; }
.cook__x:hover { background: rgba(255,255,255,.2); }
.cook__stage { flex: 1; display: grid; place-items: center; padding: 0 clamp(20px, 6vw, 60px); cursor: pointer; user-select: none; -webkit-user-select: none; }
.cook__stepwrap { max-width: 720px; text-align: center; }
.cook__stepwrap--in { animation: stepin .4s var(--ease) both; }
@keyframes stepin { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.cook__no { display: block; font-size: .82rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: 16px; }
.cook__body { font-family: var(--font-d); font-size: clamp(1.35rem, 3.6vw, 2.1rem); line-height: 1.4; text-wrap: balance; }
.cook__foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px clamp(16px, 4vw, 30px) calc(20px + env(safe-area-inset-bottom)); }
.cook__navbtn { min-width: 62px; min-height: 62px; border-radius: 50%; background: rgba(255,255,255,.1); font-size: 1.4rem; font-weight: 600; transition: background .2s, transform .15s var(--ease-pop); }
.cook__navbtn:hover { background: rgba(255,255,255,.2); transform: scale(1.06); }
.cook__navbtn:disabled { opacity: .3; }
.cook__navbtn--next { background: var(--terra); }
.cook__navbtn--next:hover { background: var(--terra-deep); }
.cook__dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; max-width: 60vw; }
.cook__dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.22); cursor: pointer; transition: background .2s, transform .2s; }
.cook__dot.is-on { background: var(--gold); transform: scale(1.15); }
.cook__done { position: absolute; inset: 0; background: rgba(22,41,31,.88); backdrop-filter: blur(8px); display: grid; place-items: center; padding: 18px; }
.cook__donecard { width: min(560px, 94vw); max-height: 88dvh; overflow: auto; background: var(--card); color: var(--ink); border-radius: var(--r-lg); padding: 26px; box-shadow: var(--shadow-l); animation: rise .45s var(--ease-pop) both; }
.cook__donecard h2 { font-size: 1.6rem; }
.cook__donesub { color: var(--ink-soft); margin: 6px 0 14px; }
.deduct { list-style: none; display: grid; gap: 8px; margin-bottom: 16px; }
.deduct__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--linen); border-radius: 12px; padding: 9px 12px; }
.deduct__check { display: flex; align-items: center; gap: 9px; font-size: .92rem; font-weight: 500; cursor: pointer; }
.deduct__check input { width: 19px; height: 19px; accent-color: var(--terra); }
.deduct__check em { font-style: normal; color: var(--ink-soft); font-size: .8rem; }
.deduct__ctrl { display: flex; align-items: center; gap: 6px; }
.deduct__ctrl b { min-width: 26px; text-align: center; font-family: var(--font-d); font-size: 1.1rem; }
.deduct__b { width: 38px; height: 38px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow-s); font-size: 1.1rem; font-weight: 700; color: var(--pine); }
.cook__doneactions { display: flex; gap: 10px; flex-wrap: wrap; }
.cook__doneactions .btn { flex: 1; }
.cook__zeroed { margin-top: 16px; border-top: 1px dashed var(--linen-deep); padding-top: 14px; }
.cook__zeroed p { font-size: .88rem; font-weight: 600; margin-bottom: 8px; }
.cook__zeroed div { display: grid; gap: 6px; margin-bottom: 12px; }

/* ---------- grocery list ---------- */
.gl-add { position: relative; margin-bottom: 20px; max-width: 560px; }
.gl { margin-bottom: 20px; }
.gl__head { font-size: 1.05rem; margin-bottom: 8px; }
.gl__list { list-style: none; display: grid; gap: 8px; }
.gl__row {
  display: flex; align-items: center; gap: 10px; background: var(--card);
  border: 1px solid var(--linen-deep); border-radius: var(--r); padding: 8px 10px;
  box-shadow: var(--shadow-s); transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.gl__row--moving { opacity: 0; transform: translateY(8px); }
.gl__tick { min-width: 44px; min-height: 44px; display: grid; place-items: center; }
.gl__box {
  width: 26px; height: 26px; border-radius: 9px; border: 2px solid var(--linen-deep);
  display: grid; place-items: center; font-weight: 800; color: #fff; font-size: .9rem;
  transition: all .2s var(--ease-pop); background: var(--cream);
}
.gl__tick:hover .gl__box { border-color: var(--terra); }
.gl__row.is-checked .gl__box { background: var(--ok); border-color: var(--ok); transform: scale(1.05); }
.gl__emoji { font-size: 1.25rem; }
.gl__name { flex: 1; font-weight: 500; font-size: .95rem; min-width: 0; }
.gl__row.is-checked .gl__name { text-decoration: line-through; color: var(--ink-soft); }
.gl__src { font-style: normal; font-size: .72rem; color: var(--terra-deep); background: #FBEFE7; border-radius: 999px; padding: 2px 8px; margin-left: 6px; white-space: nowrap; }
.gl__qtyctrl { display: flex; align-items: center; gap: 4px; }
.gl__qtyctrl b { min-width: 24px; text-align: center; font-family: var(--font-d); font-size: 1.05rem; }
.gl__qbtn { width: 38px; height: 38px; border-radius: 50%; background: var(--linen); font-weight: 700; font-size: 1rem; color: var(--pine); transition: background .15s; }
.gl__qbtn:hover { background: var(--linen-deep); }
.gl__del { min-width: 40px; min-height: 40px; color: var(--ink-soft); font-size: .85rem; border-radius: 50%; transition: all .15s; }
.gl__del:hover { background: #FBEBE8; color: var(--danger); }
.gl--done { border-top: 2px dashed var(--linen-deep); padding-top: 18px; margin-top: 26px; }
.gl--done .gl__row { opacity: .72; }
.gl__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* ---------- family recipe form ---------- */
.fr { max-width: 980px; }
.fr__cols { display: grid; gap: 24px; }
@media (min-width: 900px) { .fr__cols { grid-template-columns: 1fr 1fr; align-items: start; } }
.fr__drop {
  display: grid; place-items: center; min-height: 170px; border: 2px dashed var(--linen-deep);
  border-radius: var(--r-lg); background: var(--card); cursor: pointer; overflow: hidden;
  position: relative; transition: border-color .2s var(--ease);
}
.fr__drop:hover { border-color: var(--terra); }
.fr__drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fr__dropinner { position: relative; z-index: 2; background: rgba(255,253,248,.9); border-radius: 999px; padding: 8px 18px; font-size: .9rem; font-weight: 600; color: var(--pine-soft); }
.fr__rows { display: grid; gap: 8px; margin-bottom: 8px; }
.fr__row { position: relative; display: flex; gap: 8px; align-items: start; }
.fr__row .fr__input {
  flex: 1; min-width: 0; min-height: 44px; border: 1.5px solid var(--linen-deep);
  border-radius: 10px; padding: 9px 12px; background: var(--card); resize: vertical;
}
.fr__row .fr__input:focus { outline: none; border-color: var(--terra); box-shadow: 0 0 0 4px rgba(196,103,59,.1); }
.fr__grip { align-self: center; cursor: grab; color: var(--ink-soft); font-size: 1.1rem; padding: 4px 2px; touch-action: none; }
.fr__x { min-width: 40px; min-height: 44px; color: var(--ink-soft); border-radius: 10px; transition: all .15s; }
.fr__x:hover { background: #FBEBE8; color: var(--danger); }
.fr__row .add__suggest { top: calc(100% + 4px); left: 0; right: 48px; z-index: 40; }
.fr__submit { margin-top: 22px; display: flex; justify-content: center; }
.fr__submit .btn { min-width: 260px; font-size: 1.02rem; }

/* ---------- recipe importer (add-recipe page) ---------- */
.importer { background: linear-gradient(135deg, rgba(184,147,90,.12), rgba(196,103,59,.08)), var(--card);
  border: 1px solid var(--linen-deep); border-radius: var(--r-lg); padding: 20px; margin-bottom: 22px; box-shadow: var(--shadow-s); }
.importer__head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.importer__icon { font-size: 1.6rem; }
.importer__title { font-size: 1.2rem; }
.importer__sub { color: var(--ink-soft); font-size: .88rem; margin-top: 3px; }
.importer__row { display: flex; gap: 10px; align-items: flex-end; }
.importer__input { flex: 1; min-width: 0; min-height: 48px; border: 1.5px solid var(--linen-deep); border-radius: 12px;
  padding: 12px 14px; background: var(--card); resize: none; font-size: .95rem; line-height: 1.5; }
.importer__input:focus { outline: none; border-color: var(--terra); box-shadow: 0 0 0 4px rgba(196,103,59,.1); }
.importer__btn { flex: 0 0 auto; white-space: nowrap; }
.importer__btn:disabled { opacity: .6; cursor: wait; }
.importer__status { margin-top: 12px; font-size: .88rem; border-radius: 10px; padding: 10px 14px; }
.importer__status.is-load { background: var(--linen); color: var(--pine-soft); }
.importer__status.is-load::before { content: "⏳ "; }
.importer__status.is-ok { background: #EDF5EE; color: var(--ok); }
.importer__status.is-warn { background: #FBEFE7; color: var(--terra-deep); }

/* ---------- inventory search ---------- */
.invsearch { position: relative; margin-bottom: 14px; }
.invsearch__input::-webkit-search-cancel-button, .rsearch__input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.invsearch__input { width: 100%; min-height: 46px; border: 1.5px solid var(--linen-deep); border-radius: 999px;
  padding: 10px 44px 10px 18px; background: var(--card); font-size: .95rem; box-shadow: var(--shadow-s); }
.invsearch__input:focus { outline: none; border-color: var(--terra); box-shadow: 0 0 0 4px rgba(196,103,59,.1); }
.invsearch__clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px;
  border-radius: 50%; color: var(--ink-soft); font-size: .85rem; }
.invsearch__clear:hover { background: var(--linen); color: var(--pine); }
.invsearch__none { color: var(--ink-soft); font-size: .9rem; padding: 4px 4px 12px; }
/* while searching, show every zone stacked (mobile) so all matches are visible at once */
.board.is-searching .zone { display: block !important; margin-bottom: 14px; }
@media (max-width: 979px) { .board.is-searching { display: block; } }

/* ---------- card delete X ---------- */
.card { position: relative; }
.card__del { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%;
  color: var(--ink-soft); font-size: .7rem; opacity: 0; transition: opacity .15s var(--ease), background .15s, color .15s;
  display: grid; place-items: center; }
.card:hover .card__del, .card:focus-within .card__del { opacity: .7; }
.card__del:hover { opacity: 1; background: #FBEBE8; color: var(--danger); }
@media (hover: none) { .card__del { opacity: .5; } }   /* touch: always show */

/* ---------- recipe remove ---------- */
.rd__actions { display: flex; gap: 8px; align-items: center; }
.rd__remove { width: 46px; height: 46px; border-radius: 50%; font-size: 1.1rem; background: var(--card);
  border: 1px solid var(--linen-deep); box-shadow: var(--shadow-s); transition: all .18s var(--ease); }
.rd__remove:hover { background: #FBEBE8; border-color: #E9C9C0; transform: scale(1.06); }
.rd__remove:disabled { opacity: .5; }
