/* kitchen: the same night as the landing page and the corkboard.
   Fairy lights along the top, fireflies behind, and "lit bulbs" for
   things you have: a lit bulb means yes, an unlit one means you need it. */

:root {
  color-scheme: dark;

  --bg-1: #0d1026;
  --bg-2: #1c1834;
  --bg-3: #2c2340;
  --panel: rgba(28, 24, 52, 0.72);
  --panel-solid: #1a1631;
  --line: rgba(244, 238, 224, 0.09);
  --line-gold: rgba(244, 213, 141, 0.22);

  --gold: #f4d58d;
  --gold-bright: #fff4d6;
  --amber: #f2a950;
  --rose: #ec8a7c;
  --cream: rgba(244, 238, 224, 0.94);
  --cream-soft: rgba(244, 238, 224, 0.64);
  --cream-faint: rgba(244, 238, 224, 0.38);
  --ink: #2b2333;

  --serif: "Newsreader", Georgia, serif;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;

  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--bg-1); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 20% 0%, var(--bg-3), var(--bg-2) 45%, var(--bg-1) 100%) fixed;
  color: var(--cream);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--gold); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid rgba(244, 213, 141, 0.75); outline-offset: 2px; border-radius: 8px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

#fireflies { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

/* ---------- the top: fairy lights, header, tabs ---------- */

/* No backdrop-filter here on a phone: it would make the fixed tab bar
   inside position itself against this bar instead of the screen. */
.top {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(180deg, #0d1026, rgba(22, 19, 44, 0.98));
  border-bottom: 1px solid var(--line);
}
.lights {
  position: absolute; left: 0; top: var(--safe-t); width: 100%; height: 64px;
  overflow: visible; pointer-events: none;
}
.lights .wire { fill: none; stroke: #3a2c20; stroke-width: 1.4; }
.lights .bulb-glow { fill: var(--gold); opacity: 0.5; filter: url(#bulbBlur); }
.lights .bulb-glass { fill: var(--gold-bright); }
.lights .warm .bulb-glow { fill: #f7b56b; }
.lights .warm .bulb-glass { fill: #ffe2b8; }
.lights .cap { fill: #4a3726; }
.lights .bulb-group { animation: twinkle var(--dur, 3s) ease-in-out var(--delay, 0s) infinite; }
@keyframes twinkle { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

.app-head {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: calc(var(--safe-t) + 40px) 16px 10px;
}
.home-link { display: none; }
.app-title {
  margin: 0;
  font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.6rem; line-height: 1;
  color: var(--cream);
  text-shadow: 0 0 18px rgba(244, 213, 141, 0.25);
}
.head-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.units {
  display: inline-flex; padding: 2px; border-radius: 999px;
  border: 1px solid var(--line-gold); background: rgba(0, 0, 0, 0.2);
}
.units button {
  border: 0; background: none; padding: 4px 10px; border-radius: 999px;
  font-size: 0.75rem; color: var(--cream-faint); min-height: 30px;
}
.units button.on { background: rgba(244, 213, 141, 0.16); color: var(--gold-bright); }

.person-chip {
  border: 1px solid var(--line); background: none; border-radius: 999px;
  padding: 4px 12px; font-size: 0.8rem; color: var(--cream-soft); min-height: 34px;
  max-width: 7.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.person-chip:hover { color: var(--cream); border-color: var(--line-gold); }

.icon-btn {
  flex: none; display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid transparent; background: none; color: var(--cream-soft); font-size: 1rem; padding: 0;
}
.icon-btn:hover { color: var(--cream); background: rgba(244, 238, 224, 0.06); }
.icon-btn svg { width: 20px; height: 20px; fill: currentColor; }

/* phone: tabs along the bottom, in reach of a thumb */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(16, 14, 34, 0.94);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line-gold);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--cream-faint); font-size: 0.68rem; letter-spacing: 0.01em;
  text-align: center; line-height: 1.1; padding: 0 2px;
}
.tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.tab svg .glow { fill: none; }
.tab.on { color: var(--gold-bright); }
.tab.on svg .glow { fill: var(--gold); stroke: var(--gold); filter: drop-shadow(0 0 4px var(--gold)); }
.tab.on svg { filter: drop-shadow(0 0 6px rgba(244, 213, 141, 0.45)); }

main {
  position: relative; z-index: 1;
  max-width: 1040px; margin: 0 auto;
  padding: 8px 16px calc(var(--tabbar-h) + var(--safe-b) + 96px);
}
#pane-pantry, #pane-week, #pane-make { max-width: 720px; margin: 0 auto; }
body:not(.ready) main { opacity: 0.4; }

/* ---------- headings and bars ---------- */

.pane-head { display: flex; align-items: center; gap: 12px; margin: 14px 0 12px; }
.pane-head h1, .card-title {
  margin: 0; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.9rem; line-height: 1.1;
}
.pane-head > :last-child:not(h1) { margin-left: auto; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0 8px; }
.toolbar .chips { flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; }
.toolbar .chips::-webkit-scrollbar { display: none; }
.toolbar .chip { flex: none; }

input[type="text"], input[type="search"], input[type="url"], input[type="number"], input[type="date"], input[type="password"], select, textarea {
  width: 100%; min-height: 44px;
  background: rgba(8, 8, 22, 0.45); border: 1px solid var(--line); border-radius: 12px;
  padding: 9px 12px; font-size: 16px; /* 16px stops iOS zooming in */
  color: var(--cream);
}
input::placeholder, textarea::placeholder { color: var(--cream-faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(244, 213, 141, 0.55); box-shadow: 0 0 0 3px rgba(244, 213, 141, 0.12); }
textarea { resize: vertical; line-height: 1.5; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--cream-faint) 50%), linear-gradient(135deg, var(--cream-faint) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
.search { flex: 1 1 200px; }

/* quick add: at the top on a laptop, docked above the tabs on a phone */
.quick-wrap {
  position: fixed; left: 12px; right: 12px; z-index: 25;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px);
}
.quick-add {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 6px 6px 14px; border-radius: 999px;
  background: rgba(26, 22, 49, 0.96); border: 1px solid var(--line-gold);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 24px rgba(244, 213, 141, 0.06);
}
.quick-add .quick-input { border: 0; background: none; min-height: 40px; padding: 6px 4px; box-shadow: none; }
.quick-add .ghost-btn { flex: none; }
.add-btn {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: var(--gold); color: var(--ink); font-size: 1.4rem; line-height: 1;
  box-shadow: 0 0 16px rgba(244, 213, 141, 0.45);
}
.add-btn:disabled { opacity: 0.6; }
.quick-hint {
  margin: 0 0 6px 18px; min-height: 1.2em; font-size: 0.78rem; color: var(--gold);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8); order: -1;
}
.quick-wrap { display: flex; flex-direction: column; }

/* ---------- bulbs ---------- */

.bulb {
  flex: none; display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  border: 1.5px solid var(--cream-faint); background: transparent;
}
.bulb-on { background: var(--gold-bright); border-color: var(--gold); box-shadow: 0 0 8px 2px rgba(244, 213, 141, 0.55); }
.bulb-soon { background: #ffd9a3; border-color: var(--amber); box-shadow: 0 0 8px 2px rgba(242, 169, 80, 0.6); }
.bulb-expired { background: #ffc4ba; border-color: var(--rose); box-shadow: 0 0 8px 2px rgba(236, 138, 124, 0.6); }
.bulb-off { border-color: var(--cream-faint); }
.bulb-unknown { border-style: dashed; }

/* ---------- chips and buttons ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.chip {
  border: 1px solid var(--line); background: rgba(8, 8, 22, 0.3); border-radius: 999px;
  padding: 5px 12px; font-size: 0.8rem; color: var(--cream-soft); min-height: 34px;
}
.chip:hover { border-color: var(--line-gold); color: var(--cream); }
.chip.on { border-color: rgba(244, 213, 141, 0.6); background: rgba(244, 213, 141, 0.14); color: var(--gold-bright); }
.chip.static { min-height: 0; padding: 2px 10px; font-size: 0.75rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px 18px; border-radius: 999px;
  border: 1px solid rgba(244, 213, 141, 0.4); background: rgba(244, 213, 141, 0.08);
  color: var(--cream); text-decoration: none; font-size: 0.92rem;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}
.btn:hover { background: rgba(244, 213, 141, 0.16); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn-primary { background: var(--gold); border-color: var(--gold); color: var(--ink); font-weight: 500; box-shadow: 0 0 18px rgba(244, 213, 141, 0.3); }
.btn-primary:hover { background: var(--gold-bright); box-shadow: 0 0 24px rgba(244, 213, 141, 0.5); }
.btn-waste { border-color: rgba(236, 138, 124, 0.5); background: rgba(236, 138, 124, 0.08); }
.btn-waste:hover { background: rgba(236, 138, 124, 0.16); }
.btn-small { min-height: 36px; padding: 6px 14px; font-size: 0.85rem; }
.btn.wide { width: 100%; }

.ghost-btn {
  border: 0; background: none; padding: 8px 10px; min-height: 40px; border-radius: 10px;
  color: var(--cream-soft); font-size: 0.85rem;
}
.ghost-btn:hover { color: var(--cream); background: rgba(244, 238, 224, 0.05); }
.ghost-btn.danger:hover { color: var(--rose); }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0 0; }
.btn-row.subtle { gap: 4px; margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--line); }

.quiet { color: var(--cream-faint); font-size: 0.88rem; }

/* ---------- list rows ---------- */

.group { margin: 18px 0 6px; }
.group-title {
  display: flex; align-items: baseline; gap: 8px;
  margin: 0 0 4px; padding: 0 4px;
  font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.1rem; color: var(--cream-soft);
}
.group-title .count { font-family: var(--sans); font-style: normal; font-size: 0.72rem; color: var(--cream-faint); }
.group-title .ghost-btn { margin-left: auto; font-family: var(--sans); font-style: normal; }
.group.soon .group-title { color: var(--amber); text-shadow: 0 0 14px rgba(242, 169, 80, 0.35); }
.group.soon .rows { border-color: rgba(242, 169, 80, 0.25); }

.rows {
  list-style: none; margin: 0; padding: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
}
.rows > li + li { border-top: 1px solid var(--line); }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 56px; padding: 10px 14px;
  border: 0; background: none; text-align: left; text-decoration: none; color: inherit;
}
.row:hover { background: rgba(244, 238, 224, 0.035); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-name { font-size: 0.98rem; }
.row-meta { font-size: 0.78rem; color: var(--cream-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-qty { flex: none; font-size: 0.9rem; color: var(--cream-soft); font-variant-numeric: tabular-nums; }
.p-row.soon .row-meta { color: var(--amber); }
.p-row.expired .row-meta { color: var(--rose); }
.p-row.expired .row-name { color: #ffd9d2; }

/* ---------- shopping list ---------- */

.list-title { margin: 0 0 10px; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.25rem; }

.shop-row { display: flex; align-items: stretch; }
.tick {
  flex: none; width: 58px; border: 0; background: none; display: grid; place-items: center;
}
.tick .bulb { width: 22px; height: 22px; border-width: 2px; transition: box-shadow 0.25s, background 0.25s; }
.tick:hover .bulb-off { border-color: var(--gold); box-shadow: 0 0 8px rgba(244, 213, 141, 0.35); }
.shop-main { padding-left: 0; }
.shop-row.ticked .row-name { color: var(--cream-faint); text-decoration: line-through; text-decoration-color: rgba(244, 238, 224, 0.3); }
.shop-row.ticked .row-meta { color: var(--gold); opacity: 0.8; }
.group.basket .rows { background: rgba(28, 24, 52, 0.45); }
.all-done { display: flex; align-items: center; gap: 10px; padding: 8px 4px; }

/* ---------- recipes ---------- */

.recipe-grid {
  display: grid; gap: 14px; margin-top: 8px;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
}
.recipe-grid > .quiet, .recipe-grid > .empty { grid-column: 1 / -1; }
.recipe-tile {
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 16px; background: var(--panel); border: 1px solid var(--line);
  text-decoration: none; color: inherit;
  transition: transform 0.25s ease, border-color 0.25s, box-shadow 0.25s;
}
.recipe-tile:hover, .recipe-tile:focus-visible { transform: translateY(-3px); border-color: var(--line-gold); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 22px rgba(244, 213, 141, 0.08); }
.tile-photo { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #221d3b; }
.placeholder {
  display: grid; place-items: center;
  font-family: var(--serif); font-style: italic; font-size: 3rem; color: rgba(255, 244, 214, 0.85);
  background:
    radial-gradient(circle at 50% 58%, rgba(244, 213, 141, 0.35), transparent 42%),
    linear-gradient(160deg, #3a2d4a, #231d3d 60%, #171430);
  text-shadow: 0 0 22px rgba(244, 213, 141, 0.6);
}
.tile-body { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 12px; }
.tile-title { font-family: var(--serif); font-size: 1.08rem; line-height: 1.2; }
.tile-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 0.75rem; color: var(--cream-faint); }
.have-count { display: inline-flex; align-items: center; gap: 5px; }
.have-count .bulb { width: 8px; height: 8px; border-width: 1px; }
.have-count.all { color: var(--gold); }
.tile-stars { color: var(--gold); letter-spacing: 1px; }

.back-link { display: block; width: fit-content; margin: 14px 0 6px; color: var(--cream-soft); text-decoration: none; font-size: 0.88rem; padding: 6px 0; }
.back-link:hover { color: var(--cream); }
.recipe-card { max-width: 720px; margin: 0 auto; }
#pane-recipes .back-link { margin-left: max(0px, calc((100% - 720px) / 2)); }
.hero-photo { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 18px; border: 1px solid var(--line); }
.tile-photo.placeholder, .hero-photo.placeholder { display: grid; }
.hero-photo.placeholder { font-size: 4.5rem; aspect-ratio: 3 / 1; }
.card-head { margin: 16px 0 6px; }
.card-meta { margin: 8px 0; color: var(--cream-faint); font-size: 0.85rem; }
.card-head .chips { margin: 8px 0; }

.ratings { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 0; align-items: center; }
.rate { display: inline-flex; align-items: center; gap: 2px; }
.rate-who { font-size: 0.78rem; color: var(--cream-faint); margin-right: 6px; }
.star { border: 0; background: none; width: 30px; height: 34px; padding: 0; font-size: 1.15rem; color: rgba(244, 238, 224, 0.2); }
.star.on { color: var(--gold); text-shadow: 0 0 10px rgba(244, 213, 141, 0.6); }
.rate:hover .star { color: rgba(244, 213, 141, 0.55); }
.rate .star:hover ~ .star { color: rgba(244, 238, 224, 0.2); }
.stars-static { color: var(--gold); letter-spacing: 2px; }
.stars-static .dim { color: rgba(244, 238, 224, 0.2); }

.card-section { margin: 22px 0; padding: 16px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }
.card-section h2 { margin: 0 0 10px; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.3rem; }
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.section-head h2 { margin: 0; }
.servings { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 0.85rem; color: var(--cream-soft); }
.servings .icon-btn { border-color: var(--line); width: 34px; height: 34px; }

.ingredient-lines { list-style: none; margin: 0; padding: 0; }
.ingredient-line { display: flex; gap: 12px; align-items: flex-start; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.ingredient-line:last-child { border-bottom: 0; }
.ingredient-line .bulb { margin-top: 5px; }
.line-main { display: flex; flex-direction: column; min-width: 0; }
.line-text strong { font-weight: 500; color: var(--gold-bright); }
.ingredient-line.need .line-text, .ingredient-line.unknown .line-text { color: var(--cream-soft); }
.ingredient-line.optional { opacity: 0.75; }
.line-original { font-size: 0.75rem; color: var(--cream-faint); }
.line-short { font-size: 0.75rem; color: var(--amber); }
.all-here { display: inline-flex; align-items: center; gap: 8px; }

.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 4px 0 14px 42px; line-height: 1.6; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 3px;
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--serif); font-style: italic; font-size: 0.95rem; color: var(--ink);
  background: var(--gold); box-shadow: 0 0 12px rgba(244, 213, 141, 0.45);
}
.notes { min-height: 84px; }

/* ---------- week planner ---------- */

.planner { margin: 4px 0 26px; }
.planner-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.planner-head h2 { margin: 0; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.25rem; }
.week-nav { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; font-size: 0.85rem; color: var(--cream-soft); }
.week-nav .icon-btn { font-size: 1.3rem; }
.days { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.day { display: flex; align-items: center; }
.day + .day { border-top: 1px solid var(--line); }
.day-row { flex: 1; min-width: 0; }
.day-name { flex: none; width: 44px; display: flex; flex-direction: column; align-items: center; line-height: 1.1; font-family: var(--serif); font-style: italic; font-size: 1rem; color: var(--cream-soft); }
.day-date { font-family: var(--sans); font-style: normal; font-size: 0.72rem; color: var(--cream-faint); }
.day.today { background: rgba(244, 213, 141, 0.06); box-shadow: inset 3px 0 0 var(--gold); }
.day.today .day-name { color: var(--gold-bright); text-shadow: 0 0 10px rgba(244, 213, 141, 0.5); }
.day.past { opacity: 0.55; }
.day-empty { color: var(--cream-faint); font-size: 0.9rem; }
.day-note { font-family: var(--serif); font-style: italic; color: var(--cream-soft); }
.row-meta.all-in { color: var(--gold); }
.day-open { margin-right: 6px; text-decoration: none; }
.planner-foot { margin-top: 12px; }
.pick-list { margin-top: 12px; }
.pick-list .row.chosen { background: rgba(244, 213, 141, 0.1); }
.pick-empty { padding: 14px; }

/* ---------- what can we make? ---------- */

.make-ask { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line-gold); box-shadow: 0 0 30px rgba(244, 213, 141, 0.05); }
.make-prompt { min-height: 70px; }
.make-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.make-go { margin-left: auto; }
.make-hint { text-align: center; padding: 24px 12px; }
.make-searching { display: flex; flex-direction: column; align-items: center; padding: 34px 12px 10px; text-align: center; }
.make-searching p { margin: 4px 0; }
.search-glow {
  width: 18px; height: 18px; border-radius: 50%; margin-bottom: 18px;
  background: var(--gold-bright); box-shadow: 0 0 22px 10px rgba(244, 213, 141, 0.45);
  animation: search-drift 2.6s ease-in-out infinite;
}
@keyframes search-drift {
  0%, 100% { transform: translate(-26px, 4px); opacity: 0.55; }
  50% { transform: translate(26px, -6px); opacity: 1; }
}
.key-panel { margin: 12px 2px 0; }
.key-on { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 0.85rem; color: var(--cream-soft); }
.key-on .ghost-btn { margin-left: auto; }
.key-card { padding: 10px 14px; border-radius: 14px; border: 1px dashed var(--line-gold); background: rgba(244, 213, 141, 0.03); font-size: 0.88rem; color: var(--cream-soft); }
.key-card summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; min-height: 32px; }
.key-card summary::-webkit-details-marker { display: none; }
.key-card summary strong { color: var(--gold); font-weight: 500; }
.key-card p { margin: 10px 0 0; }
.key-card .field-row input { flex: 1 1 200px; width: auto; }
.make-options { display: flex; flex-direction: column; gap: 6px; }
.make-heading { display: flex; align-items: baseline; gap: 10px; margin: 26px 2px 10px; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.3rem; }
.make-heading .count, .pane-head .count { font-family: var(--sans); font-style: normal; font-size: 0.75rem; color: var(--cream-faint); }
.pane-head h1 .count { margin-left: 10px; vertical-align: middle; }
.pick-cards { display: flex; flex-direction: column; gap: 10px; }
.pick-card { display: flex; gap: 14px; padding: 12px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.pick-photo { flex: none; width: 76px; height: 76px; border-radius: 12px; overflow: hidden; display: block; }
.pick-photo img, .pick-photo .placeholder { width: 100%; height: 100%; object-fit: cover; display: grid; font-size: 1.8rem; }
.pick-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pick-body p { margin: 0; font-size: 0.8rem; }
.pick-title { font-family: var(--serif); font-size: 1.1rem; line-height: 1.2; color: var(--cream); text-decoration: none; }
.pick-title:hover { color: var(--gold-bright); }
.pick-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--cream-faint); }
.pick-soon { color: var(--amber); }
.pick-need { color: var(--cream-faint); }
.pick-add { align-self: flex-start; margin: 2px 0 -6px -10px; padding: 6px 10px; min-height: 34px; font-size: 0.8rem; color: var(--gold); }
.box-picks > .ghost-btn { margin-top: 6px; }
.filtered-note { margin: 0 0 10px; font-size: 0.82rem; color: var(--amber); }
.link-btn { border: 0; background: none; padding: 4px 2px; color: var(--gold); text-decoration: underline; font-size: inherit; }
.suggestion { margin-top: 4px; }
.suggestion-why { margin: 8px 0 0; font-family: var(--serif); font-style: italic; font-size: 1.08rem; color: var(--gold); }
.method summary { cursor: pointer; list-style: none; }
.method summary::-webkit-details-marker { display: none; }
.method summary h2 { display: inline; }
.method summary::after { content: " +"; color: var(--cream-faint); }
.method[open] summary::after { content: ""; }
.method[open] summary { margin-bottom: 10px; }

/* ---------- empty states ---------- */

.empty { text-align: center; padding: 36px 16px 20px; max-width: 420px; margin: 0 auto; }
.empty-jar { width: 92px; height: 92px; }
.empty-glow { filter: blur(5px); animation: jar-glow 3.2s ease-in-out infinite; }
@keyframes jar-glow { 0%, 100% { opacity: 0.3; } 50% { opacity: 0.75; } }
.empty-title { margin: 10px 0 4px; font-family: var(--serif); font-style: italic; font-size: 1.35rem; color: var(--cream); }
.empty-text { margin: 0; color: var(--cream-soft); font-size: 0.9rem; }

/* ---------- sheets ---------- */

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(5, 5, 16, 0.6);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: fade-in 0.18s ease;
}
.sheet-backdrop.leaving { animation: fade-out 0.18s ease forwards; }
.sheet {
  width: 100%; max-height: 90vh; overflow-y: auto; overscroll-behavior: contain;
  padding: 6px 18px calc(22px + var(--safe-b));
  background: #1e1939;
  border: 1px solid var(--line-gold); border-bottom: 0;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5), 0 -1px 30px rgba(244, 213, 141, 0.07);
  animation: slide-up 0.22s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.sheet::before {
  content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; margin: 4px auto 6px;
  background: rgba(244, 238, 224, 0.2);
}
.sheet-head { display: flex; align-items: center; gap: 8px; position: sticky; top: -6px; padding: 6px 0; background: #1e1939; z-index: 1; }
.sheet-head h2 { margin: 0; flex: 1; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.45rem; line-height: 1.2; }
.sheet-summary { margin: 4px 0 12px; color: var(--cream-soft); font-size: 0.9rem; }
.sheet-summary strong { color: var(--gold-bright); font-weight: 500; }
.sheet-note { margin: 0 0 12px; padding: 8px 12px; border-left: 2px solid var(--line-gold); color: var(--cream-soft); font-style: italic; }
@keyframes slide-up { from { transform: translateY(40px); opacity: 0.4; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

/* ---------- forms ---------- */

.form { display: flex; flex-direction: column; gap: 14px; padding-top: 4px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 0; }
.form .field { margin: 0; }
.field .chips { margin-top: 2px; }
.field-label { font-size: 0.78rem; color: var(--cream-faint); letter-spacing: 0.02em; }
.field-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 0; }
.field-row > .field-label { flex: 1 1 100%; }
.field-row > input[type="text"], .field-row > input[type="url"] { flex: 1 1 180px; width: auto; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.check-field { display: flex; gap: 10px; align-items: center; font-size: 0.88rem; color: var(--cream-soft); }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--gold); flex: none; }

.qty-input { display: inline-flex; gap: 6px; flex: 1 1 200px; }
.qty-input .qty-num, .qty-input input { flex: 1 1 90px; width: 90px; min-width: 0; }
.qty-input select { flex: 0 0 96px; width: 96px; }
.qty-unit-fixed { align-self: center; color: var(--cream-faint); padding: 0 8px; }

.or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--cream-faint); font-size: 0.8rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.match-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.match { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; padding: 8px 10px; border-radius: 12px; background: rgba(8, 8, 22, 0.3); border: 1px solid var(--line); }
.match-original { grid-column: 1 / -1; font-size: 0.82rem; color: var(--cream-soft); }
.match-arrow { display: none; }
.match input[type="text"] { min-height: 38px; padding: 6px 10px; }
.match-flag { font-size: 0.72rem; color: var(--gold); }
.match.new { border-color: rgba(244, 213, 141, 0.3); }
.match-opt { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--cream-faint); }
.match-opt input { width: 16px; height: 16px; }

.cook-list { margin-top: 6px; }
.cook-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; }
.cook-check { flex: 1 1 160px; display: flex; align-items: center; gap: 10px; }
.cook-row .qty-input { flex: 0 1 220px; }

.check-list { margin-top: 12px; }
.check-row.gone .row-name { text-decoration: line-through; color: var(--cream-faint); }
.check-state { font-size: 0.78rem; color: var(--gold); }
.check-row.gone .check-state { color: var(--cream-faint); }
.menu-row .row-name { font-family: var(--serif); font-style: italic; font-size: 1.1rem; }
.ing-list { margin-top: 12px; }

/* ---------- toasts ---------- */

.toasts {
  position: fixed; left: 0; right: 0; z-index: 60; pointer-events: none;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 76px);
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 12px;
}
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 14px;
  max-width: 460px; padding: 10px 10px 10px 16px; border-radius: 14px;
  background: rgba(24, 20, 46, 0.97); border: 1px solid var(--line-gold);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(244, 213, 141, 0.08);
  font-size: 0.9rem; animation: slide-up 0.2s ease;
}
.toast.leaving { animation: fade-out 0.25s ease forwards; }
.toast-error { border-color: rgba(236, 138, 124, 0.6); }
.toast-action { border: 0; background: rgba(244, 213, 141, 0.14); color: var(--gold-bright); border-radius: 10px; padding: 6px 12px; min-height: 36px; font-size: 0.82rem; white-space: nowrap; }

/* ---------- login ---------- */

.login-page .top { position: fixed; left: 0; right: 0; background: none; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; height: 70px; }
.login {
  position: relative; z-index: 1;
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 90px 24px 60px; text-align: center;
}
.login-jar { width: 108px; height: 108px; }
.login-glow { animation: jar-glow 3.2s ease-in-out infinite; }
.login h1 { margin: 6px 0 0; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 2.6rem; text-shadow: 0 0 22px rgba(244, 213, 141, 0.3); }
.login-sub { margin: 4px 0 28px; color: var(--cream-soft); font-family: var(--serif); font-style: italic; font-size: 1.05rem; }
.login-form { display: flex; flex-direction: column; gap: 12px; width: min(320px, 100%); }
.login-form input { text-align: center; border-radius: 999px; }
.login-error { min-height: 1.4em; margin: 14px 0 0; color: var(--rose); font-size: 0.9rem; }

/* ---------- laptop ---------- */

@media (min-width: 760px) {
  body { font-size: 15.5px; }
  .app-head { padding: 44px 28px 6px; }
  .home-link { display: inline; font-size: 0.78rem; color: var(--cream-faint); text-decoration: none; order: 2; margin-left: 4px; }
  .home-link:hover { color: var(--cream-soft); }
  .app-title { font-size: 1.9rem; }
  .head-tools { order: 3; }

  .tabbar {
    position: static; height: auto; padding: 0 20px; display: flex; gap: 4px;
    background: none; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .tab { flex-direction: row; gap: 8px; padding: 10px 14px 12px; font-size: 0.9rem; border-bottom: 2px solid transparent; }
  .tab svg { width: 20px; height: 20px; }
  .tab:hover { color: var(--cream-soft); }
  .tab.on { border-bottom-color: var(--gold); }

  main { padding: 12px 28px 80px; }

  .quick-wrap { position: static; margin: 4px 0 8px; }
  .quick-hint { order: 1; margin: 6px 0 0 18px; text-shadow: none; }
  .quick-add { box-shadow: 0 0 24px rgba(244, 213, 141, 0.05); }

  .top { background: linear-gradient(180deg, rgba(13, 16, 38, 0.97), rgba(20, 17, 40, 0.9)); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
  .toolbar .chips { flex: 1 1 auto; flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
  .toasts { bottom: 28px; }

  .sheet-backdrop { align-items: center; padding: 24px; }
  .sheet { max-width: 480px; max-height: 86vh; border-radius: 20px; border-bottom: 1px solid var(--line-gold); padding-bottom: 22px; }
  .sheet-wide { max-width: 720px; }
  .sheet::before { display: none; }

  .recipe-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
  .match { grid-template-columns: minmax(0, 1.3fr) auto minmax(0, 1fr) auto auto; }
  .match-original, .match-opt { grid-column: auto; }
  .match-arrow { display: inline; color: var(--cream-faint); }
}

@media (max-width: 380px) {
  .units button { padding: 4px 7px; }
  .person-chip { max-width: 5.5em; }
  .tab { font-size: 0.62rem; }
}

@media (prefers-reduced-motion: reduce) {
  .lights .bulb-group, .empty-glow, .login-glow, .search-glow { animation: none; opacity: 0.9; }
  .sheet, .toast, .sheet-backdrop { animation: none; }
  .recipe-tile, .btn { transition: none; }
}
