/* Smart Pantry by Noxe. Study 2 design (list rows with round ticks, spaced uppercase section titles,
   rounded group cards, pill buttons, one big add button). Palette: Tomato and basil on warm cream. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 800; font-display: swap; src: url('../fonts/inter-latin.woff2') format('woff2'); }
:root {
  --bg: #FBF7F1;
  --card: #FFFEFB;
  --well: #F4EEE5;
  --fill: #EEE6DA;
  --fill-2: #D9CFC0;
  --ring: #8C8174;
  --ink: #1E1915;
  --ink-2: #5C534A;
  --ink-3: #6B6158;
  --line: #E9E1D6;
  --edge: #E6DED2;
  --accent: #C8381E;
  --accent-2: #C8381E;
  --accent-soft: #FBE4DC;
  --on-accent: #FFFFFF;
  --basil: #2D7A46;
  --basil-soft: #DDEFE2;
  --on-basil: #FFFFFF;
  --chip: #FBE5A0;
  --on-chip: #1E1915;
  --orange: #9A4A06;
  --orange-soft: #FBE9D2;
  --red: #A4172B;
  --red-soft: #F9DEE0;
  --bar: #FFFEFB;
  --bar-ink: #5C534A;
  --toast: #2A2420;
  --on-toast: #FBF7F1;
  --scrim: rgba(30, 25, 21, .42);
  --lift: 0 1px 2px rgba(30, 25, 21, .04), 0 8px 24px -14px rgba(30, 25, 21, .22);
  --pop: 0 0 0 1px var(--edge), 0 10px 30px -12px rgba(30, 25, 21, .28);
  --ease: cubic-bezier(.32, .72, 0, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171310; --card: #211B17; --well: #2A231E; --fill: #342C26; --fill-2: #4A4038; --ring: #8E8378; --ink: #F6EFE8; --ink-2: #C2B8AD;
    --ink-3: #A0958A; --line: #342C26; --edge: #3A322B; --accent: #FF8061; --accent-2: #FF8061; --accent-soft: #3E211A; --on-accent: #200D07;
    --basil: #5CC27E; --basil-soft: #1F3326; --on-basil: #07200F; --chip: #3D3318; --on-chip: #FFE9A8;
    --orange: #F0A860; --orange-soft: #3A2616; --red: #FF8A94; --red-soft: #3F1D22; --bar: #211B17; --bar-ink: #C2B8AD;
    --toast: #3A322B; --on-toast: #F6EFE8; --lift: none; --pop: 0 0 0 1px var(--edge), 0 10px 30px -12px rgba(0, 0, 0, .7); --scrim: rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #171310; --card: #211B17; --well: #2A231E; --fill: #342C26; --fill-2: #4A4038; --ring: #8E8378; --ink: #F6EFE8; --ink-2: #C2B8AD;
  --ink-3: #A0958A; --line: #342C26; --edge: #3A322B; --accent: #FF8061; --accent-2: #FF8061; --accent-soft: #3E211A; --on-accent: #200D07;
  --basil: #5CC27E; --basil-soft: #1F3326; --on-basil: #07200F; --chip: #3D3318; --on-chip: #FFE9A8;
  --orange: #F0A860; --orange-soft: #3A2616; --red: #FF8A94; --red-soft: #3F1D22; --bar: #211B17; --bar-ink: #C2B8AD;
  --toast: #3A322B; --on-toast: #F6EFE8; --lift: none; --pop: 0 0 0 1px var(--edge), 0 10px 30px -12px rgba(0, 0, 0, .7); --scrim: rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17px/1.45 var(--font); -webkit-font-smoothing: antialiased; min-height: 100dvh;
  padding-bottom: calc(110px + env(safe-area-inset-bottom));
}
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
h1 { font-size: 32px; line-height: 1.1; font-weight: 700; }
h2 { font-size: 21px; line-height: 1.2; font-weight: 700; }
h3 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
svg { flex: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 65%, transparent); outline-offset: 2px; border-radius: 12px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 10px 14px; z-index: 50; border-radius: 12px; }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top line ---------- */
.top { max-width: 720px; margin: 0 auto; padding: calc(12px + env(safe-area-inset-top)) 20px 0; display: flex; justify-content: flex-end; min-height: 34px; }
.brand { display: none; }
.save-state { font-size: 13px; color: var(--ink-3); }
.save-state.bad { color: var(--red); font-weight: 600; }

/* ---------- floating tab bar ---------- */
.tabs {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 20;
  max-width: 520px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  background: var(--bar); border-radius: 24px; padding: 6px; box-shadow: var(--pop);
}
.tabs a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 58px; border-radius: 18px; text-decoration: none; color: var(--bar-ink); font-size: 12px; font-weight: 600;
  transition: background-color .3s var(--ease), color .2s;
}
.tabs svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tabs a[aria-current="page"] { background: var(--accent); color: var(--on-accent); }
.badge {
  position: absolute; top: 5px; left: calc(50% + 7px); min-width: 20px; height: 20px; padding: 0 5px; border-radius: 7px;
  background: var(--red); color: var(--bg); font-size: 12px; font-weight: 700; line-height: 20px; text-align: center;
}
@media (min-width: 760px) {
  body { padding-bottom: 120px; }
  .tabs a { flex-direction: row; gap: 8px; min-height: 52px; font-size: 15px; }
  .badge { position: static; }
}

main { max-width: 720px; margin: 0 auto; padding: 4px 16px 24px; outline: none; }
.view > * + * { margin-top: 26px; }
.lede { color: var(--ink-2); margin-top: 8px; font-size: 16px; max-width: 60ch; }
.row-title, .view section > h2, #cookList > section > h2 { font-size: 20px; margin: 0 4px 12px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 20px; border-radius: 16px; border: 0;
  background: var(--card); color: var(--ink); font-weight: 600; font-size: 16px; cursor: pointer; text-decoration: none;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform .18s var(--ease), background-color .2s, box-shadow .2s;
}
.btn:active, .tile:active, .hero:active, .row-btn:active, .icon-btn:active, .tape-strip:active { transform: scale(.975); }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-main { background: var(--ink); color: var(--bg); box-shadow: none; }
.btn-go { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.btn-main:disabled { background: var(--fill); color: var(--ink-3); cursor: not-allowed; transform: none; }
.btn-quiet { background: var(--well); box-shadow: none; }
.btn-danger { background: var(--red-soft); color: var(--red); box-shadow: none; }
.btn-wide { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row > .btn { flex: 1 1 140px; }
.link { background: none; border: 0; padding: 10px 0; min-height: 44px; color: var(--red); cursor: pointer; width: 100%; font-weight: 500; }
.text-btn { flex: none; min-height: 44px; padding: 0 2px; border: 0; background: none; color: var(--accent); font-size: 15px; font-weight: 700; cursor: pointer; }

/* ---------- composer ---------- */
.tell { background: var(--card); border-radius: 24px; padding: 18px; box-shadow: var(--lift); }
.tell label { display: block; font-weight: 700; font-size: 17px; margin-bottom: 12px; }
.tell-row { display: flex; gap: 10px; align-items: flex-end; }
.tell-input {
  flex: 1; min-width: 0; min-height: 54px; padding: 15px 16px; font-size: 17px; line-height: 1.35;
  border: 0; border-radius: 18px; background: var(--well); resize: none; outline: none; transition: box-shadow .2s;
}
.tell-input::placeholder { color: var(--ink-3); }
.tell-input:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.icon-btn {
  position: relative; flex: none; width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center; cursor: pointer; padding: 0; transition: transform .18s var(--ease), background-color .2s;
}
.icon-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn small { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.icon-btn.on { background: var(--red); color: var(--bg); animation: listen 1.4s ease-in-out infinite; }
@keyframes listen { 50% { box-shadow: 0 0 0 9px var(--red-soft); } }
.tell-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.tell-tools .btn { min-height: 48px; padding: 0 12px; font-size: 15px; white-space: nowrap; background: var(--well); box-shadow: none; }
.examples { margin-top: 16px; }
.examples p { font-size: 13px; color: var(--ink-3); margin-bottom: 2px; font-weight: 500; }
.try { list-style: none; margin: 0; padding: 0; }
.try li + li { border-top: 1px solid var(--line); }
.row-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 46px;
  padding: 10px 0; border: 0; background: none; text-align: left; font-size: 16px; color: var(--accent); font-weight: 600; cursor: pointer;
}
.preview { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); animation: fade .25s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(-4px); } }
.preview h3 { font-size: 13px; font-weight: 600; color: var(--ink-3); margin-bottom: 4px; }
.preview ol { list-style: none; margin: 0 0 14px; padding: 0; }
.preview li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.preview li:last-child { border-bottom: 0; }
.preview li .what { flex: 1; font-size: 16px; }
.preview li .sub { display: block; color: var(--ink-2); font-size: 13px; margin-top: 1px; }
.preview li.note .what { color: var(--ink-2); }
.step-mark { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 18px; background: var(--accent-soft); color: var(--accent); }
.step-mark.minus { background: var(--orange-soft); color: var(--orange); }
.step-mark.out { background: var(--red-soft); color: var(--red); }
.step-mark.note { background: var(--fill); color: var(--ink-2); }
.x-btn { flex: none; width: 34px; height: 34px; border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 24px; font-weight: 300; line-height: 1; display: grid; place-items: center; position: relative; }
.x-btn::after { content: ''; position: absolute; inset: -6px; }
.unclear { color: var(--red); font-size: 15px; margin-bottom: 12px; }

/* ---------- photo hero ---------- */
.hero {
  position: relative; display: block; width: 100%; aspect-ratio: 4 / 3.3; padding: 0; border: 0; cursor: pointer; text-align: left;
  border-radius: 28px; overflow: hidden; background: var(--fill); box-shadow: var(--lift); transition: transform .18s var(--ease);
}
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .66)); }
.hero-text { position: absolute; left: 20px; right: 20px; bottom: 18px; z-index: 1; color: #fff; }
.hero-name { display: block; font-size: 24px; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; text-shadow: 0 1px 12px rgba(0, 0, 0, .3); }
.hero-sub { display: block; margin-top: 4px; font-size: 15px; font-weight: 500; opacity: .92; }
.time-box {
  position: absolute; top: 12px; left: 12px; z-index: 1; display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 10px 6px 8px; border-radius: 11px; background: rgba(255, 255, 255, .92); color: #1B1E19;
  font-size: 13px; font-weight: 700; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.time-box svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.no-photo {
  display: grid; place-items: center; background: var(--accent-soft);
  color: var(--accent); font-size: 44px; font-weight: 800;
}

/* ---------- use first ---------- */
.use-first h2 { display: flex; align-items: baseline; gap: 8px; }
.use-first h2 small { font-size: 15px; font-weight: 500; color: var(--ink-2); }
.items, .tapes, .checks, .history, .ing {
  list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: 20px; overflow: hidden; box-shadow: var(--lift);
}
.items > li, .tapes > li, .checks > li, .history > li, .ing > li { position: relative; }
.items > li + li::before, .tapes > li + li::before, .checks > li + li::before, .history > li + li::before, .ing > li + li::before {
  content: ''; position: absolute; top: 0; right: 16px; left: 16px; border-top: 1px solid var(--line);
}
.tape-strip {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  border: 0; background: none; padding: 12px 16px; min-height: 62px; color: var(--ink); transition: transform .18s var(--ease);
}
.tape-strip .t-name { flex: 1; font-size: 17px; font-weight: 600; }
.tape-strip .t-where { display: block; font-size: 13px; color: var(--ink-2); font-weight: 400; margin-top: 1px; }
.tape-strip .t-when { font-size: 14px; font-weight: 700; color: var(--orange); text-align: right; }
.tape-strip.red .t-when { color: var(--red); }
.tape-cook { margin-top: 12px; width: 100%; }

/* ---------- shelves ---------- */
.shelf-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 4px; background: var(--fill); border-radius: 16px; scrollbar-width: none; margin-bottom: 12px; }
.shelf-tabs::-webkit-scrollbar { display: none; }
.chip {
  min-height: 40px; padding: 8px 14px; border-radius: 12px; border: 0; background: transparent;
  cursor: pointer; font-size: 15px; font-weight: 600; color: var(--ink-2); flex: 1 0 auto; text-align: center;
  transition: background-color .25s var(--ease), color .2s;
}
.chip[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 2px 8px rgba(27, 30, 25, .1); }
.find {
  width: 100%; min-height: 50px; padding: 12px 16px 12px 44px; border: 0; border-radius: 16px; background-color: var(--card); font-size: 16px; outline: none;
  box-shadow: inset 0 0 0 1px var(--line);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238D9287' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m20 20-4.8-4.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 15px center; background-size: 18px;
}
.find:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.find::placeholder { color: var(--ink-3); }
.shelf { margin-top: 22px; }
.shelf > h3 { font-size: 14px; font-weight: 700; color: var(--ink-2); margin: 0 6px 8px; display: flex; gap: 6px; }
.shelf > h3 span { color: var(--ink-3); font-weight: 500; }
.item { display: flex; align-items: center; gap: 8px; padding: 0 12px 0 0; min-height: 64px; transition: opacity .2s; }
.item.zero { opacity: .55; }
.item-open { flex: 1; min-width: 0; min-height: 64px; background: none; border: 0; text-align: left; padding: 10px 6px 10px 16px; cursor: pointer; }
.item-name { display: block; font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.item-when { display: block; color: var(--ink-2); font-size: 13px; margin-top: 1px; }
.item.soon .item-when { color: var(--orange); font-weight: 700; }
.item.today .item-when, .item.past .item-when { color: var(--red); font-weight: 700; }
.stepper { display: flex; align-items: center; gap: 4px; flex: none; background: var(--well); border-radius: 14px; padding: 3px; }
.stepper output { min-width: 34px; text-align: center; font-weight: 700; font-size: 16px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stepper output small { display: block; font-weight: 500; font-size: 11px; color: var(--ink-2); }
.stepper button {
  width: 38px; height: 38px; border: 0; border-radius: 11px; background: var(--card); font-size: 22px; line-height: 1; cursor: pointer;
  display: grid; place-items: center; color: var(--ink); position: relative; box-shadow: 0 1px 2px rgba(27, 30, 25, .08);
}
.stepper button::after { content: ''; position: absolute; inset: -4px -2px; }
.empty { background: var(--card); border-radius: 24px; padding: 22px 18px; box-shadow: var(--lift); }
.empty h2 { font-size: 22px; }
.empty p { color: var(--ink-2); margin: 6px 0 16px; }
.pick { list-style: none; margin: 0 0 18px; padding: 0; }
.pick li + li { border-top: 1px solid var(--line); }
.pick-row { color: var(--ink); font-size: 17px; font-weight: 500; min-height: 50px; padding: 12px 2px; }
.pick-row .mark { flex: none; width: 24px; height: 24px; border-radius: 8px; box-shadow: inset 0 0 0 2px var(--fill-2); display: grid; place-items: center; transition: background-color .2s; }
.pick-row[aria-pressed="true"] .mark { background: var(--basil); box-shadow: none; }
.pick-row[aria-pressed="true"] .mark::after { content: ''; width: 6px; height: 11px; border: solid var(--on-basil); border-width: 0 2.5px 2.5px 0; transform: translateY(-1px) rotate(45deg); }
.putaway { position: sticky; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 5; animation: fade .25s var(--ease); }
.putaway .btn { box-shadow: var(--pop); }

/* ---------- cook ---------- */
.row-select {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px;
  padding: 0 0 0 18px; background: var(--card); border-radius: 16px; font-size: 16px; font-weight: 600; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line);
}
.row-select select {
  appearance: none; -webkit-appearance: none; border: 0; background-color: transparent; color: var(--ink-2); font-size: 16px; text-align: right;
  min-height: 52px; padding: 0 40px 0 8px; cursor: pointer; outline: none; max-width: 70%; font-weight: 500;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238D9287' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m8 9 4-4 4 4M8 15l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 16px;
}
.row-select ~ .find { margin-top: 12px; }
#cookList > section { margin-top: 28px; }
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 620px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.tile {
  display: flex; flex-direction: column; width: 100%; height: 100%; padding: 6px; border: 0; cursor: pointer; text-align: left;
  background: var(--card); border-radius: 22px; box-shadow: var(--lift); color: var(--ink); transition: transform .18s var(--ease);
}
.tile-photo { position: relative; display: block; aspect-ratio: 1 / 1; border-radius: 17px; overflow: hidden; background: var(--fill); }
.tile-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-photo .no-photo { width: 100%; height: 100%; }
.tile-photo .time-box { top: 8px; left: 8px; font-size: 12px; padding: 5px 8px 5px 6px; }
.tile-body { display: flex; flex-direction: column; gap: 4px; padding: 10px 8px 8px; }
.tile-name { font-size: 15px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
.st { font-size: 13px; font-weight: 600; line-height: 1.3; }
.st.ready { color: var(--basil); }
.st.miss { color: var(--ink-2); font-weight: 500; }
.st.soon { color: var(--orange); }

/* recipe sheet */
.sheet-photo { position: relative; border-radius: 24px; overflow: hidden; aspect-ratio: 16 / 11; background: var(--fill); }
.sheet-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sheet-photo .no-photo { width: 100%; height: 100%; }
.close.on-photo { position: absolute; top: 12px; right: 12px; background: rgba(255, 255, 255, .92); color: #1B1E19; border-radius: 12px; padding: 0 14px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.sheet-inner > .credit { font-size: 12px; color: var(--ink-3); margin-top: 6px; padding: 0 4px; }
.recipe-title { font-size: 28px; line-height: 1.12; letter-spacing: -.025em; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; color: var(--ink-2); font-size: 15px; font-weight: 500; }
.facts span { display: inline-flex; align-items: center; gap: 6px; }
.facts svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.facts .ready { color: var(--basil); font-weight: 700; }
.facts .miss { color: var(--orange); font-weight: 700; }
.ing li { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 16px; }
.ing .tick { flex: none; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.ing .yes .tick { background: var(--basil-soft); color: var(--basil); }
.ing .no .tick { background: var(--red-soft); color: var(--red); }
.ing .maybe .tick { background: var(--fill); }
.ing .lbl { flex: 1; font-weight: 600; }
.ing .lbl small { display: block; color: var(--ink-2); font-size: 13px; font-weight: 400; }
.ing .no .lbl small { color: var(--red); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; background: var(--card); border-radius: 18px; padding: 14px 16px; box-shadow: var(--lift); }
.steps .n { flex: none; width: 30px; height: 30px; border-radius: 10px; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.sheet-cta { position: sticky; bottom: 0; padding-top: 14px; background: var(--bg); }
.cook-list { background: var(--card); border-radius: 20px; overflow: hidden; box-shadow: var(--lift); }
.cook-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 16px; min-height: 64px; position: relative; }
.cook-row + .cook-row::before { content: ''; position: absolute; top: 0; right: 16px; left: 16px; border-top: 1px solid var(--line); }
.cook-row .lbl { flex: 1; font-size: 17px; font-weight: 600; }
.cook-row .lbl small { display: block; font-size: 13px; color: var(--ink-2); font-weight: 400; }
.seg { display: flex; padding: 3px; gap: 3px; background: var(--fill); border-radius: 13px; flex: none; }
.seg button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink-2); transition: background-color .2s; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 2px 6px rgba(27, 30, 25, .1); }

/* ---------- shop ---------- */
.aisle { margin-top: 22px; }
.aisle h3 { font-size: 14px; font-weight: 700; color: var(--ink-2); margin: 0 6px 8px; }
.check { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 8px 12px 8px 16px; cursor: pointer; }
.check input {
  appearance: none; -webkit-appearance: none; flex: none; margin: 0; width: 28px; height: 28px; border-radius: 9px;
  box-shadow: inset 0 0 0 2px var(--fill-2); cursor: pointer; display: grid; place-items: center; transition: background-color .2s;
}
.check input:checked { background: var(--basil); box-shadow: none; }
.check input:checked::after { content: ''; width: 7px; height: 12px; border: solid var(--on-basil); border-width: 0 2.5px 2.5px 0; transform: translateY(-1px) rotate(45deg); }
.check .lbl { flex: 1; font-size: 17px; font-weight: 600; }
.check .lbl small { display: block; font-size: 13px; color: var(--ink-2); font-weight: 400; }
.check.done .lbl { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1.5px; }

/* ---------- more ---------- */
.card { background: var(--card); border-radius: 24px; padding: 20px 18px; box-shadow: var(--lift); }
.card > * + * { margin-top: 12px; }
.card h2 { font-size: 20px; }
.card p { color: var(--ink-2); font-size: 15px; max-width: 62ch; }
.value-rows { list-style: none; margin: 0; padding: 0; }
.value-rows li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 0; font-size: 17px; }
.value-rows li + li { border-top: 1px solid var(--line); }
.value-rows b { font-weight: 700; font-size: 22px; font-variant-numeric: tabular-nums; color: var(--orange); }
.value-rows b.good { color: var(--basil); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 52px; cursor: pointer; font-size: 17px; }
.toggle input {
  appearance: none; -webkit-appearance: none; order: 2; flex: none; margin: 0; width: 52px; height: 32px; border-radius: 16px;
  background: var(--fill-2); position: relative; cursor: pointer; transition: background-color .25s;
}
.toggle input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .18); transition: transform .3s var(--ease); }
.toggle input:checked { background: var(--basil); }
.toggle input:checked::after { transform: translateX(20px); }
.card .seg { width: fit-content; }
.card .history { box-shadow: none; background: transparent; border-radius: 0; }
.history li { padding: 10px 0; display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.card .history li + li::before { left: 0; right: 0; }
.history time { color: var(--ink-3); flex: none; }
.help dl { margin: 0; }
.help dt { font-weight: 700; margin-top: 12px; font-size: 15px; }
.help dd { margin: 2px 0 0; color: var(--ink-2); font-size: 15px; }

/* ---------- sheet ---------- */
.sheet {
  width: min(620px, 100%); max-width: 100%; max-height: 94dvh; margin: auto auto 0; padding: 0; border: 0;
  border-radius: 30px 30px 0 0; background: var(--bg); color: var(--ink); box-shadow: var(--pop);
}
@media (min-width: 760px) { .sheet { margin: auto; border-radius: 30px; } }
.sheet::backdrop { background: var(--scrim); }
.sheet[open] { animation: sheet-up .5s var(--ease); }
.sheet[open]::backdrop { animation: scrim .3s ease-out; }
@keyframes sheet-up { from { transform: translateY(100%); } }
@media (min-width: 760px) { .sheet[open] { animation-name: sheet-pop; } }
@keyframes sheet-pop { from { transform: translateY(24px) scale(.97); opacity: 0; } }
@keyframes scrim { from { opacity: 0; } }
.sheet-inner { padding: 14px 14px calc(22px + env(safe-area-inset-bottom)); overflow-y: auto; max-height: 94dvh; }
.sheet-inner > * + * { margin-top: 18px; }
.sheet-inner > section > h3 { font-size: 14px; font-weight: 700; color: var(--ink-2); margin: 0 6px 8px; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 6px 4px 0; }
.sheet-head h2 { flex: 1; font-size: 24px; }
.close { flex: none; min-height: 44px; padding: 0 4px 0 12px; border: 0; background: none; color: var(--accent); font-weight: 700; font-size: 16px; cursor: pointer; }
.sheet form { display: grid; gap: 18px; }
.fresh-line { font-size: 15px; font-weight: 700; color: var(--basil); padding: 0 4px; }
.fresh-line.soon { color: var(--orange); }
.fresh-line.today, .fresh-line.past { color: var(--red); }
.field { display: flex; flex-direction: column; }
.field label, .field .label { display: block; font-size: 14px; font-weight: 700; color: var(--ink-2); margin: 0 6px 8px; }
.field .hint { display: block; color: var(--ink-3); font-size: 13px; margin: 8px 6px 0; order: 3; }
.field input[type="text"], .field input[type="date"], .field input[type="search"], .field input[type="number"], .field select, .field textarea, .field input[inputmode] {
  width: 100%; min-height: 52px; padding: 13px 16px; border: 0; border-radius: 16px; background: var(--card); font-size: 17px; outline: none;
  box-shadow: inset 0 0 0 1px var(--line);
}
.field textarea { min-height: 110px; resize: vertical; line-height: 1.4; }
.field input:focus, .field textarea:focus, .field select:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.locs { display: flex; padding: 4px; gap: 4px; background: var(--fill); border-radius: 16px; }
.locs .chip { flex: 1; padding: 8px 4px; min-height: 42px; }
.date-row { display: flex; gap: 8px; }
.date-row input { flex: 1; }
.date-row .btn { min-height: 52px; font-size: 15px; padding: 0 16px; }
.big-stepper { display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 16px; padding: 6px; box-shadow: inset 0 0 0 1px var(--line); }
.big-stepper button { width: 52px; height: 44px; border-radius: 12px; border: 0; background: var(--well); font-size: 24px; cursor: pointer; color: var(--ink); }
.field .big-stepper input { width: 72px; min-height: 44px; padding: 0; text-align: center; font-weight: 700; background: none; box-shadow: none; font-variant-numeric: tabular-nums; }
.field .big-stepper select { flex: 1; min-height: 44px; background: var(--well); padding: 0 12px; border-radius: 12px; box-shadow: none; }
.scan-video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 22px; background: #000; }
.found { border-radius: 15px; padding: 14px 16px; background: var(--basil-soft); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(100px + env(safe-area-inset-bottom)); z-index: 40;
  max-width: 500px; margin: 0 auto; display: flex; align-items: center; gap: 12px;
  background: var(--toast); color: var(--on-toast); border-radius: 28px; padding: 8px 8px 8px 22px; box-shadow: var(--pop);
  animation: toast-in .4s var(--ease);
}
@keyframes toast-in { from { transform: translateY(16px) scale(.98); opacity: 0; } }
.has-putaway .toast { bottom: calc(172px + env(safe-area-inset-bottom)); }
.toast p { flex: 1; font-size: 15px; font-weight: 500; }
.btn-undo { min-height: 44px; padding: 0 20px; border-radius: 999px; border: 0; background: #FBE5A0; color: #1E1915; font-weight: 700; cursor: pointer; }
.noscript { padding: 20px; text-align: center; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print {
  body { background: #fff; padding: 0; }
  .tabs, .top, .toast, .no-print, .putaway { display: none !important; }
  .checks { box-shadow: none; }
}
.credit-line { font-size: 14px; color: var(--ink-3); }
.credit-line a { color: var(--ink-2); font-weight: 600; }

/* =====================================================================
   Study 2 design language. Pills for buttons and controls, 15px group cards,
   round ticks on the right, spaced uppercase section titles, one big add button.
   ===================================================================== */
body { font-family: var(--font); }
:focus-visible { border-radius: 14px; }

/* page header: eyebrow, centred title, progress chip */
.page-head { text-align: center; }
.page-head > * + * { margin-top: 2px; }
.eyebrow { font-size: 15px; line-height: 18px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.page-head h1, .view > h1 { font-size: 24px; line-height: 30px; font-weight: 800; letter-spacing: -.025em; max-width: none; text-align: center; }
.page-head .lede { margin: 8px auto 0; }
.done-chip { display: flex; align-items: center; gap: 7px; width: fit-content; margin: 12px auto 0; padding: 7px 8px; border-radius: 999px; background: var(--card); box-shadow: 0 0 0 1px var(--edge); }
.done-chip .cart { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; box-shadow: 0 0 0 1px var(--edge); color: var(--ink); }
.done-chip .cart svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.done-chip b { display: grid; place-items: center; min-height: 34px; padding: 0 16px; border-radius: 999px; background: var(--chip); color: var(--on-chip); font-size: 16px; font-weight: 700; }

/* section titles */
.view section > h2, .row-title, #cookList > section > h2, .aisle h3, .shelf > h3, .sheet-inner > section > h3 {
  font-size: 15px; line-height: 18px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin: 0 2px 8px;
}
.view > * + * { margin-top: 18px; }
.aisle, .shelf { margin-top: 18px; }
.use-first h2 small { text-transform: none; letter-spacing: 0; }
.empty h2, .card h2 { text-transform: none; letter-spacing: -.02em; }

/* buttons: pills with a hairline, one big accent button */
.btn { min-height: 52px; border-radius: 999px; font-weight: 700; box-shadow: 0 0 0 1px var(--edge); background: var(--card); }
.btn-main, .btn-go, .btn-add { background: var(--accent); color: var(--on-accent); box-shadow: none; font-size: 17px; letter-spacing: -.01em; }
.btn-main:disabled { background: var(--fill); color: var(--ink-3); }
.btn-quiet { background: var(--card); box-shadow: 0 0 0 1px var(--edge); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.btn-row.two .btn { min-height: 48px; font-size: 16px; }
.add-form { display: grid; gap: 12px; }
.tell-tools .btn { background: var(--card); box-shadow: 0 0 0 1px var(--edge); min-height: 48px; }
.text-btn, .close { font-weight: 700; }
.badge { border-radius: 999px; }

/* cards and groups */
.tell, .card, .empty { border-radius: 15px; box-shadow: 0 0 0 1px var(--edge); background: var(--card); }
.items, .tapes, .checks, .history, .ing, .cook-list { border-radius: 15px; box-shadow: 0 0 0 1px var(--edge); }
.items > li + li::before, .tapes > li + li::before, .checks > li + li::before, .history > li + li::before, .ing > li + li::before, .cook-row + .cook-row::before { right: 0; left: 0; }
.steps li { border-radius: 15px; box-shadow: 0 0 0 1px var(--edge); }
.steps .n { border-radius: 50%; }
.hero { border-radius: 20px; box-shadow: 0 0 0 1px var(--edge); }
.tile { border-radius: 15px; box-shadow: 0 0 0 1px var(--edge); }
.tile-photo { border-radius: 11px; }
.sheet-photo { border-radius: 20px; }
.time-box { border-radius: 999px; }
.close.on-photo { border-radius: 999px; }
.sheet { border-radius: 28px 28px 0 0; }
@media (min-width: 760px) { .sheet { border-radius: 28px; } }

/* inputs */
.tell-input { border-radius: 20px; background: var(--card); box-shadow: inset 0 0 0 1px var(--ring); }
.tell-input:focus, .find:focus, .field input:focus, .field textarea:focus, .field select:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.find { border-radius: 999px; box-shadow: inset 0 0 0 1px var(--ring); }
.find.plain { background-image: none; padding-left: 20px; }
.row-select { border-radius: 999px; box-shadow: inset 0 0 0 1px var(--ring); padding-left: 22px; }
.field input[type="text"], .field input[type="date"], .field input[type="search"], .field input[type="number"], .field select, .field textarea, .field input[inputmode] { border-radius: 15px; box-shadow: inset 0 0 0 1px var(--ring); }
.big-stepper { border-radius: 999px; box-shadow: inset 0 0 0 1px var(--ring); }
.big-stepper button { border-radius: 50%; width: 46px; background: var(--well); }
.field .big-stepper select { border-radius: 999px; }
.scan-video { border-radius: 20px; }
.found { border-radius: 15px; }

/* segmented choices become pill buttons; the chosen one wears the chip colour */
.shelf-tabs, .locs, .seg, .card .seg { background: none; padding: 0; gap: 8px; border-radius: 0; }
.shelf-tabs { padding: 2px 0; }
.chip, .seg button { min-height: 44px; border-radius: 999px; background: var(--card); box-shadow: 0 0 0 1px var(--edge); color: var(--ink); font-weight: 600; font-size: 15px; padding: 0 16px; }
.locs .chip { padding: 0 4px; }
.chip[aria-pressed="true"], .seg button[aria-pressed="true"] { background: var(--chip); color: var(--on-chip); font-weight: 700; box-shadow: none; }
.theme-seg { flex-wrap: wrap; margin-top: 8px; }

/* list rows: name over small note, amount, round tick on the right */
.check { gap: 10px; min-height: 60px; padding: 8px 12px 8px 16px; }
.check .lbl { font-size: 16px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
.check .lbl small { font-size: 15px; font-weight: 500; color: var(--ink-2); line-height: 1.25; margin-top: 1px; }
.check .q { flex: none; font-size: 15px; font-weight: 600; color: var(--ink-2); text-align: right; }
.check input { order: 3; width: 29px; height: 29px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--ring); margin-left: 4px; }
.check input:checked::after { width: 6px; height: 12px; }
.check .x-btn { order: 2; width: 28px; height: 28px; font-size: 22px; }
.check.done .q { color: var(--ink-3); }
.item-name, .tape-strip .t-name, .cook-row .lbl, .ing .lbl { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.item-when, .tape-strip .t-where, .cook-row .lbl small, .ing .lbl small { font-size: 15px; font-weight: 500; }
.tape-strip .t-when { font-size: 15px; }
.stepper { border-radius: 999px; background: var(--well); }
.stepper button { border-radius: 50%; box-shadow: 0 0 0 1px var(--edge); width: 40px; height: 40px; }
.pick-row { font-weight: 600; }
.pick-row .mark { width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--ring); }
.pick-row[aria-pressed="true"] .mark { box-shadow: none; }
.step-mark, .ing .tick { border-radius: 50%; }
.toggle input { background: var(--ring); }
.toggle input:checked { background: var(--basil); }
.toggle input::after { background: #fff; }

/* floating tab bar */
.tabs { background: var(--bar); border-radius: 30px; box-shadow: var(--pop); }
.tabs a { border-radius: 24px; font-weight: 600; }
.done-chip + *, .page-head + * { margin-top: 16px; }
.putaway .btn { box-shadow: var(--pop); }
.toast p { font-weight: 600; }
.tell-tools > .btn { min-width: 0; }
@media (max-width: 359px) { .tell-tools .btn { white-space: normal; padding: 0 8px; font-size: 14px; gap: 5px; line-height: 1.15; } .tell-tools .btn svg { width: 17px; height: 17px; } }
