:root {
  --leaf: #3f5a2e;          /* bay leaf, deep */
  --leaf-2: #57773f;
  --leaf-soft: #e6ecdc;
  --leaf-vein: #cfdcb9;
  --sage: #8fa67a;
  --cream: #f7f2e7;
  --paper: #fffdf8;
  --ink: #26261f;
  --muted: #6c6a5e;
  --line: #e4ddcc;
  --berry: #b5532f;         /* warm accent for warnings */
  --gold: #b8912f;
  --shadow: 0 1px 2px rgba(40,40,20,.06), 0 4px 14px rgba(40,40,20,.07);
  --radius: 16px;
  --tabs-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --leaf: #9fbe83; --leaf-2: #b6d39a; --leaf-soft: #2a3324; --leaf-vein: #3c4a32;
    --cream: #171812; --paper: #20211a; --ink: #eceadf; --muted: #a8a594; --line: #34352a;
    --berry: #e08a66; --gold: #d6b25a; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --leaf: #9fbe83; --leaf-2: #b6d39a; --leaf-soft: #2a3324; --leaf-vein: #3c4a32;
  --cream: #171812; --paper: #20211a; --ink: #eceadf; --muted: #a8a594; --line: #34352a;
  --berry: #e08a66; --gold: #d6b25a; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: var(--cream); color: var(--ink);
  font: 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  padding-bottom: calc(var(--tabs-h) + var(--safe-b));
  min-height: 100vh; overflow-x: hidden;
}
h1, h2, h3, .serif { font-family: Fraunces, Georgia, serif; font-weight: 650; letter-spacing: -.01em; line-height: 1.15; }
h1 { font-size: 1.75rem; margin: .2rem 0 .4rem; }
h2 { font-size: 1.3rem; margin: 1.4rem 0 .6rem; }
h3 { font-size: 1.05rem; margin: 0; }
a { color: var(--leaf); }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
svg { stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; background: color-mix(in srgb, var(--cream) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--leaf); }
.brand span { font-family: Fraunces, Georgia, serif; font-size: 1.45rem; font-weight: 650; color: var(--ink); }
.leaf { width: 28px; height: 28px; stroke: none; color: var(--leaf); }
.topbar-right { display: flex; gap: 8px; align-items: center; }

main { max-width: 1100px; margin: 0 auto; padding: 12px 16px 24px; }

/* ---------- bottom tabs ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabs-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--paper); border-top: 1px solid var(--line);
}
.tabs a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600;
}
.tabs a svg { width: 24px; height: 24px; }
.tabs a.on { color: var(--leaf); }
.tabs a.on::before { content: ""; position: absolute; top: 0; width: 36px; height: 3px; border-radius: 0 0 3px 3px; background: var(--leaf); }
.badge {
  position: absolute; top: 7px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--leaf); color: var(--paper); font-size: .7rem; line-height: 18px; text-align: center;
}

/* ---------- common ---------- */
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border-radius: 999px; border: 0; background: var(--leaf); color: var(--paper); font-weight: 600; cursor: pointer;
  text-decoration: none; white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; }
.btn.ghost { background: var(--leaf-soft); color: var(--leaf); }
.btn.line { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn.small { min-height: 38px; padding: 0 14px; font-size: .9rem; }
.btn.block { width: 100%; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--paper); display: grid; place-items: center;
  box-shadow: var(--shadow); cursor: pointer; color: var(--ink);
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.on { color: var(--berry); }
.icon-btn.on svg { fill: currentColor; }
.card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); }
.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .75rem;
  font-weight: 600; background: var(--leaf-soft); color: var(--leaf); white-space: nowrap;
}
.pill.gold { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }
.pill.warn { background: color-mix(in srgb, var(--berry) 15%, transparent); color: var(--berry); }
.pill.plain { background: var(--cream); color: var(--muted); }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty svg.leaf { width: 56px; height: 56px; margin: 0 auto 10px; opacity: .5; }
.loading { display: grid; place-items: center; padding: 60px 0; color: var(--muted); }
.spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--leaf-soft); border-top-color: var(--leaf); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- chips ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 10px; margin: 0 -16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 38px; padding: 0 15px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper);
  font-size: .9rem; font-weight: 600; color: var(--ink); cursor: pointer;
}
.chip.on { background: var(--leaf); border-color: var(--leaf); color: var(--paper); }

/* ---------- week header ---------- */
.weekbar { display: flex; align-items: center; gap: 6px; margin: 4px 0 8px; }
.weekbar h1 { margin: 0; flex: 1; }
.weekbar .icon-btn { box-shadow: none; background: transparent; }

/* ---------- recipe grid / cards ---------- */
.grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.rcard { overflow: hidden; display: flex; flex-direction: column; position: relative; }
.rcard .img { position: relative; aspect-ratio: 3/2; background: var(--leaf-soft); }
.rcard .img img { width: 100%; height: 100%; object-fit: cover; }
.rcard .fav { position: absolute; top: 10px; right: 10px; }
.rcard .tags { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 6px; }
.rcard .tags .pill { background: rgba(255,253,248,.94); }
.rcard .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.rcard h3 a { color: var(--ink); text-decoration: none; }
.rcard .sub { color: var(--muted); font-size: .9rem; line-height: 1.35; }
.rcard .meta { display: flex; gap: 12px; color: var(--muted); font-size: .82rem; margin-top: auto; padding-top: 8px; align-items: center; }
.rcard .add { margin-left: auto; }
.rcard.picked { outline: 3px solid var(--leaf); outline-offset: -3px; }
.add-btn {
  min-height: 40px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--leaf-soft); color: var(--leaf);
  font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.add-btn.on { background: var(--leaf); color: var(--paper); }
.add-btn svg { width: 18px; height: 18px; stroke-width: 2.4; }

/* sticky progress over the tabs */
.pickbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabs-h) + var(--safe-b) + 10px); z-index: 25;
  max-width: 700px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 18px;
  background: var(--ink); color: var(--cream); border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.pickbar .dots { display: flex; gap: 5px; }
.pickbar .dots i { width: 9px; height: 9px; border-radius: 50%; background: color-mix(in srgb, var(--cream) 30%, transparent); }
.pickbar .dots i.on { background: var(--sage); }
.pickbar .btn { min-height: 42px; background: var(--sage); color: #1c2416; }
.has-pickbar { padding-bottom: 90px; }

/* ---------- search ---------- */
.searchbox { position: relative; margin: 4px 0 10px; }
.searchbox input {
  width: 100%; height: 52px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper);
  padding: 0 18px 0 48px; font: inherit; font-size: 1rem; color: var(--ink); outline: none;
}
.searchbox input:focus { border-color: var(--leaf); }
.searchbox svg { position: absolute; left: 16px; top: 15px; width: 22px; height: 22px; color: var(--muted); }

/* ---------- recipe detail ---------- */
.hero { margin: -12px -16px 0; position: relative; }
.hero img { width: 100%; aspect-ratio: 16/10; object-fit: cover; max-height: 52vh; }
.hero .back { position: absolute; top: 12px; left: 12px; }
.hero .fav { position: absolute; top: 12px; right: 12px; }
.detail { max-width: 760px; margin: 0 auto; }
.detail .headline { color: var(--muted); font-size: 1.05rem; margin-top: -2px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.fact { background: var(--paper); border-radius: 12px; padding: 8px 12px; font-size: .85rem; box-shadow: var(--shadow); }
.fact b { display: block; font-size: 1rem; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 6px; }
.actions .btn { flex: 1; min-width: 150px; }
.stepper { display: inline-flex; align-items: center; background: var(--paper); border-radius: 999px; box-shadow: var(--shadow); }
.stepper button { width: 44px; height: 44px; border: 0; background: transparent; font-size: 1.3rem; cursor: pointer; color: var(--leaf); }
.stepper span { min-width: 64px; text-align: center; font-weight: 600; font-size: .95rem; white-space: nowrap; }
.ing-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 2px; }
@media (min-width: 640px) { .ing-list { grid-template-columns: 1fr 1fr; column-gap: 20px; } }
.ing { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ing img { width: 44px; height: 44px; object-fit: contain; border-radius: 10px; background: var(--paper); flex: none; }
.ing .amt { font-weight: 700; min-width: 62px; }
.ing .nm { flex: 1; line-height: 1.3; }
.ing .alt { display: block; font-size: .8rem; color: var(--leaf); }
.ing .alt.gf { color: var(--gold); }
.ing.staple .nm::after { content: " · pantry"; color: var(--muted); font-size: .8rem; }
.steps-preview { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps-preview li { display: grid; grid-template-columns: 36px 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.steps-preview li::before { counter-increment: s; content: counter(s); width: 30px; height: 30px; border-radius: 50%; background: var(--leaf); color: var(--paper); display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.steps-preview .stxt p { margin: 0 0 .3em; }
.notice { padding: 12px 14px; border-radius: 12px; background: var(--leaf-soft); color: var(--ink); font-size: .9rem; margin: 10px 0; }
.notice.warn { background: color-mix(in srgb, var(--berry) 12%, var(--paper)); }

/* ---------- cook mode ---------- */
body.cooking { padding-bottom: 0; }
body.cooking .tabs, body.cooking .topbar { display: none; }
.cook { position: fixed; inset: 0; z-index: 40; background: var(--cream); display: flex; flex-direction: column; }
.cook-top { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 8px; }
.cook-top .title { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cook-progress { display: flex; gap: 4px; padding: 0 12px 8px; }
.cook-progress i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.cook-progress i.on { background: var(--leaf); }
.cook-body { flex: 1; overflow-y: auto; padding: 0 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.cook-step { display: grid; gap: 14px; max-width: 1000px; margin: 0 auto; width: 100%; }
@media (min-width: 820px) and (orientation: landscape) {
  .cook-step { grid-template-columns: 1fr 1fr; align-items: start; }
}
.cook-step > img { width: 100%; border-radius: var(--radius); aspect-ratio: 14/9; object-fit: cover; background: var(--leaf-soft); }
.cook-num { font-family: Fraunces, Georgia, serif; color: var(--leaf); font-size: 1rem; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.cook-caption { font-family: Fraunces, Georgia, serif; font-size: 1.5rem; margin: 2px 0 8px; }
.cook-text { font-size: 1.22rem; line-height: 1.55; }
.cook-text ul { padding-left: 1.1em; margin: 0; }
.cook-text li { margin-bottom: .55em; }
.timer-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 0 10px; margin: 0 2px; border-radius: 999px; border: 0;
  background: var(--leaf-soft); color: var(--leaf); font-weight: 700; font-size: 1.05rem; cursor: pointer; line-height: 1.7;
}
.cook-nav { display: flex; gap: 12px; padding: 12px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--paper); }
.cook-nav .btn { flex: 1; min-height: 58px; font-size: 1.1rem; }
.timers { position: fixed; right: 12px; top: calc(70px + env(safe-area-inset-top, 0px)); z-index: 45; display: flex; flex-direction: column; gap: 8px; }
.timer {
  display: flex; align-items: center; gap: 10px; background: var(--ink); color: var(--cream); border-radius: 999px;
  padding: 6px 6px 6px 16px; font-variant-numeric: tabular-nums; font-weight: 700; box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
.timer.done { background: var(--berry); animation: pulse 1s infinite; }
.timer button { border: 0; background: rgba(255,255,255,.15); color: inherit; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; }
@keyframes pulse { 50% { transform: scale(1.04); } }

/* ---------- my week ---------- */
.wrow { display: flex; gap: 12px; padding: 10px; align-items: center; margin-bottom: 12px; }
.wrow img { width: 96px; height: 76px; border-radius: 12px; object-fit: cover; flex: none; }
.wrow .info { flex: 1; min-width: 0; }
.wrow h3 { font-size: 1rem; }
.wrow h3 a { color: var(--ink); text-decoration: none; }
.wrow .ctrl { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.wrow .stepper { box-shadow: none; background: var(--cream); }
.wrow .stepper button { width: 36px; height: 36px; }
.wrow .stepper span { min-width: 0; padding: 0 4px; font-size: .9rem; }

/* ---------- shopping ---------- */
.shop-sum { padding: 16px; margin-bottom: 14px; display: grid; gap: 12px; }
.shop-sum .big { font-family: Fraunces, Georgia, serif; font-size: 1.6rem; }
.sitem { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.sitem .pimg { width: 56px; height: 56px; border-radius: 10px; background: #fff; object-fit: contain; flex: none; border: 1px solid var(--line); }
.sitem .main { flex: 1; min-width: 0; }
.sitem .nm { font-weight: 600; line-height: 1.3; }
.sitem .need { font-size: .8rem; color: var(--muted); }
.sitem .prod { font-size: .88rem; margin-top: 4px; line-height: 1.3; }
.sitem .prod .price { font-weight: 700; }
.sitem .prod button { border: 0; background: none; color: var(--leaf); font-weight: 600; padding: 4px 0; cursor: pointer; font-size: .85rem; }
.sitem .side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.sitem .stepper { box-shadow: none; background: var(--cream); }
.sitem .stepper button { width: 34px; height: 34px; font-size: 1.1rem; }
.sitem .stepper span { min-width: 28px; font-size: .95rem; }
.sitem.skipped { opacity: .45; }
.sitem.skipped .nm { text-decoration: line-through; }
.linkish { border: 0; background: none; color: var(--muted); font-size: .8rem; cursor: pointer; padding: 2px 0; text-decoration: underline; }
details.staples-box { margin-top: 18px; }
details.staples-box summary { cursor: pointer; font-weight: 600; padding: 12px 0; list-style: none; display: flex; align-items: center; gap: 8px; }
details.staples-box summary::-webkit-details-marker { display: none; }
.send-bar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tabs-h) + var(--safe-b)); z-index: 25; padding: 10px 16px;
  background: color-mix(in srgb, var(--cream) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}
.send-bar .btn { width: 100%; max-width: 700px; margin: 0 auto; display: flex; min-height: 54px; font-size: 1.05rem; }

/* ---------- sheets ---------- */
.sheet-bg { position: fixed; inset: 0; z-index: 60; background: rgba(20,20,10,.45); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet {
  width: 100%; max-width: 640px; max-height: 88vh; overflow-y: auto; background: var(--paper);
  border-radius: 22px 22px 0 0; padding: 10px 18px calc(22px + var(--safe-b)); animation: up .2s ease-out;
}
@media (min-width: 700px) { .sheet-bg { align-items: center; } .sheet { border-radius: 22px; } }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.sheet h2 { margin-top: 0; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.prod-opt { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; cursor: pointer; border: 1.5px solid transparent; width: 100%; background: none; text-align: left; }
.prod-opt:hover, .prod-opt.on { border-color: var(--leaf); background: var(--leaf-soft); }
.prod-opt img { width: 54px; height: 54px; object-fit: contain; background: #fff; border-radius: 8px; flex: none; }
.prod-opt .t { flex: 1; font-size: .92rem; line-height: 1.3; }
.prod-opt .p { font-weight: 700; text-align: right; font-size: .92rem; }
.log { list-style: none; padding: 0; margin: 10px 0; font-size: .9rem; max-height: 40vh; overflow-y: auto; }
.log li { padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; gap: 8px; }
.log li.bad { color: var(--berry); }
.bar { height: 8px; border-radius: 4px; background: var(--leaf-soft); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--leaf); transition: width .3s; }

/* ---------- settings ---------- */
.set-group { padding: 4px 16px; margin-bottom: 16px; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row .lbl { flex: 1; }
.set-row .lbl small { display: block; color: var(--muted); font-size: .82rem; line-height: 1.35; }
.switch { position: relative; width: 54px; height: 32px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 16px; background: var(--line); transition: .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--leaf); }
.switch input:checked + span::after { transform: translateX(22px); }
.seg { display: inline-flex; background: var(--cream); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; min-width: 44px; height: 38px; border-radius: 999px; font-weight: 600; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--paper); color: var(--leaf); box-shadow: var(--shadow); }
.staple-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0; }
.staple-chips .pill { font-size: .88rem; padding: 6px 6px 6px 12px; }
.staple-chips .pill button { border: 0; background: none; color: inherit; cursor: pointer; width: 22px; height: 22px; border-radius: 50%; font-size: 1rem; line-height: 1; }
.add-row { display: flex; gap: 8px; padding-bottom: 14px; }
.add-row input { flex: 1; height: 46px; border-radius: 999px; border: 1.5px solid var(--line); padding: 0 16px; font: inherit; background: var(--paper); color: var(--ink); }

/* ---------- login ---------- */
.login { max-width: 360px; margin: 12vh auto 0; text-align: center; }
.login .leaf { width: 64px; height: 64px; margin: 0 auto; }
.login input { width: 100%; height: 52px; border-radius: 999px; border: 1.5px solid var(--line); padding: 0 18px; font: inherit; margin: 18px 0 12px; background: var(--paper); color: var(--ink); }

#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + var(--safe-b) + 80px); transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--cream); padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: .9rem;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 80; max-width: calc(100vw - 32px); text-align: center;
}
#toast.on { opacity: 1; transform: translateX(-50%); }

/* ---------- rotisserie chicken mode ---------- */
.rot-toggle { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap;
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 10px 10px 16px; margin: 6px 0 4px; font-weight: 600; }
.rot-section { margin-top: 16px; }
.rot-meter { background: color-mix(in srgb, var(--gold) 12%, var(--paper)); border-radius: 12px; padding: 10px 14px; margin: 8px 0 10px; }
.rot-meter .bar { margin-top: 6px; background: color-mix(in srgb, var(--gold) 20%, transparent); }
.rot-meter .bar i { background: var(--gold); }
.rot-meter.over { background: color-mix(in srgb, var(--berry) 12%, var(--paper)); }
.rot-meter.over .bar i { background: var(--berry); }
.hscroll { display: grid; grid-auto-flow: column; grid-auto-columns: min(78vw, 300px); gap: 14px; overflow-x: auto;
  scroll-snap-type: x mandatory; padding: 4px 16px 12px; margin: 0 -16px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll .rcard { scroll-snap-align: start; }
.rot-note { background: color-mix(in srgb, var(--gold) 12%, var(--paper)); }
.cook-step .rot-note { font-size: 1rem; }
.rot-ico { width: 44px; height: 44px; display: grid; place-items: center; font-size: 1.6rem; flex: none; }
.rot-card { border-left: 4px solid var(--gold); }

/* ---------- sources / import ---------- */
.source-toggle { display: flex; width: 100%; max-width: 420px; margin: 4px auto 10px; }
.source-toggle button { flex: 1; height: 42px; }
.import-box { padding: 14px 16px 10px; margin-bottom: 8px; }
.import-box input[type=url] { min-width: 0; }
.ing-dot { width: 44px; height: 44px; flex: none; display: grid; place-items: center; }
.ing-dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sage); }

/* ---------- farmers market ---------- */
.market-toggle { padding: 12px 14px; margin-bottom: 8px; border-left: 4px solid var(--leaf-2); }
.market-list .sitem { align-items: center; }
.market-pre { white-space: pre-wrap; font: inherit; background: var(--cream); padding: 12px; border-radius: 12px; user-select: text; -webkit-user-select: text; }

.top-search { box-shadow: none; background: var(--leaf-soft); color: var(--leaf); width: 42px; height: 42px; }
body.cooking .top-search { display: none; }

/* ---------- feel like an app (iOS home screen / standalone) ---------- */
html { -webkit-text-size-adjust: 100%; overscroll-behavior-y: none; }
body { overscroll-behavior-y: none; touch-action: manipulation; }
button, .btn, .chip, .tabs a, .icon-btn, .add-btn, .seg button, .brand, .pill { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
a, button { -webkit-tap-highlight-color: transparent; }
input, textarea { font-size: 16px; }            /* iOS zooms into inputs smaller than 16px */
@media (display-mode: standalone) {
  .topbar { padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
  body { padding-bottom: calc(var(--tabs-h) + var(--safe-b)); }
}
.tabs a:active, .btn:active, .chip:active, .icon-btn:active { opacity: .7; }

.mine-remove { align-self: flex-start; order: 99; margin-top: 8px; color: var(--berry); }

/* ---------- no page scrollbar (endless lists — the bar is meaningless and just shrinks) ---------- */
html, body { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; width: 0; height: 0; }
.sheet, .cook-body, .log { scrollbar-width: none; }
.sheet::-webkit-scrollbar, .cook-body::-webkit-scrollbar, .log::-webkit-scrollbar { display: none; }

.source-toggle { max-width: 520px; }
.source-toggle button { font-size: .9rem; padding: 0 6px; }

/* ---------- keypad login ---------- */
body.locked .tabs, body.locked .topbar { display: none; }
body.locked { padding-bottom: 0; }
.pin { max-width: 340px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 24px 16px calc(24px + var(--safe-b)); text-align: center; }
.pin .leaf { width: 56px; height: 56px; }
.pin h1 { margin: 8px 0 2px; }
.pin-dots { display: flex; gap: 16px; margin: 22px 0 30px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--leaf); transition: background .1s; }
.pin-dots i.on { background: var(--leaf); }
.pin-dots.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.pin-pad { display: grid; grid-template-columns: repeat(3, 78px); gap: 18px 26px; }
.pin-pad button { width: 78px; height: 78px; border-radius: 50%; border: 0; background: var(--paper); box-shadow: var(--shadow);
  font: 500 1.9rem/1 Inter, system-ui, sans-serif; color: var(--ink); cursor: pointer; touch-action: manipulation; }
.pin-pad button:active { background: var(--leaf-soft); transform: scale(.96); }
.pin-pad .pin-del { background: transparent; box-shadow: none; font-size: 1.6rem; color: var(--muted); }

.ms-bar { display: flex; align-items: center; gap: 12px; background: var(--paper); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 10px 10px 10px 16px; margin: 0 0 10px; }
