/* Sandplum Patch
   Airy and editorial — lots of white space, clean card grid — but the color
   and voice are ours: deep sand-plum skin, tart orange flesh, ripe gold,
   dry-thicket grass. Warm and personal, NOT the generic cream/terracotta look. */
:root {
  --plum:      #7C1F3A;  /* deep sand plum skin — primary */
  --plum-dk:   #571026;  /* pressed-in shadow */
  --plum-soft: #A24B63;  /* lighter plum for tints */
  --flesh:     #E4703A;  /* tart orange flesh — accent */
  --gold:      #E8B23A;  /* ripe highlight */
  --leaf:      #5B7A4B;  /* thicket green — fresh accent */
  --grass:     #9C8E72;  /* dry thicket grass — muted text */
  --paper:     #FCFBF8;  /* airy warm white — page */
  --card:      #FFFFFF;  /* clean card */
  --ink:       #2A1F22;  /* near-black with a plum cast */
  --ink-soft:  #6B5C60;  /* secondary text */
  --line:      #ECE6DD;  /* hairline */
  --line-2:    #F3EEE7;

  --r-sm: 10px;
  --r:    16px;
  --r-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(87,16,38,0.05);
  --shadow:    0 8px 24px -12px rgba(87,16,38,0.18);
  --shadow-lg: 0 22px 48px -20px rgba(87,16,38,0.30);
  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
/* The `hidden` attribute must win over element `display` rules (e.g. .sheet's
   `display: flex`), or the modal shows on load and its close button does nothing. */
[hidden] { display: none !important; }
html, body { margin: 0; }
html, body { overflow-x: hidden; }

/* ---------- accessibility ---------- */
.skip-link {
  position: absolute; left: 0.5rem; top: -3rem; z-index: 100;
  background: var(--plum); color: #fff; padding: 0.6rem 1rem; border-radius: 0 0 8px 8px;
  text-decoration: none; font-weight: 600; transition: top 0.15s ease;
}
.skip-link:focus { top: 0; }
#main-content:focus { outline: none; }
/* Visible keyboard focus on every interactive element. */
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible, .tab:focus-visible, label.avatar-wrap:focus-within {
  outline: 3px solid var(--plum-soft); outline-offset: 2px; border-radius: 6px;
}
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-bottom: 4rem;
}
button { font-family: inherit; }
input { font-family: inherit; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(252,251,248,0.82);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.brand-mark { flex: 0 0 auto; display: block; transition: transform 0.2s ease; }
.brand:hover .brand-mark { transform: rotate(-8deg); }
.brandname {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.34rem; letter-spacing: -0.018em; line-height: 1;
}
.bn-1 { color: var(--plum); }
.bn-2 { color: var(--flesh); font-style: italic; }
.tabs { display: flex; gap: 0.2rem; background: var(--line-2); padding: 0.25rem; border-radius: 999px; }
.tab {
  border: 0; background: transparent; cursor: pointer;
  font-size: 0.86rem; font-weight: 600; color: var(--ink-soft);
  padding: 0.42rem 0.95rem; border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.tab:hover { color: var(--plum); }
.tab.is-active {
  background: var(--card); color: var(--plum);
  box-shadow: var(--shadow-sm);
}

/* ---------- views ---------- */
.view { display: none; max-width: 1080px; margin: 0 auto; padding: 1.5rem 1.25rem 0; }
.view.is-active { display: block; animation: fade 0.25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- hero ---------- */
.hero { padding: 2.6rem 0 2rem; max-width: 720px; }
.eyebrow {
  margin: 0 0 0.7rem; text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 0.72rem; font-weight: 700; color: var(--flesh);
}
.hero-title {
  margin: 0 0 1.4rem;
  font-family: var(--font-display);
  font-weight: 600; font-size: clamp(1.9rem, 5vw, 3rem);
  line-height: 1.06; letter-spacing: -0.02em; color: var(--ink);
}
.hero-title { text-wrap: balance; }

/* ---------- capture ---------- */
.capture {
  display: flex; gap: 0.5rem;
  background: var(--card); padding: 0.5rem;
  border: 1px solid var(--line); border-radius: 999px;
  box-shadow: var(--shadow);
  max-width: 560px;
}
.capture-input {
  flex: 1; border: 0; background: transparent; outline: none;
  padding: 0.6rem 0.9rem; font-size: 0.98rem; color: var(--ink);
}
.capture-input::placeholder { color: var(--ink-soft); }

/* ---------- buttons ---------- */
.btn {
  border: 0; cursor: pointer; font-weight: 600; font-size: 0.94rem;
  padding: 0.7rem 1.3rem; border-radius: 999px;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-primary {
  background: var(--plum); color: #fff;
  box-shadow: 0 6px 16px -6px rgba(124,31,58,0.6);
}
.btn-primary:hover { background: var(--plum-dk); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.55; cursor: default; transform: none; }
.btn-ghost {
  border: 0; background: var(--line-2); color: var(--ink-soft);
  width: 34px; height: 34px; border-radius: 999px; cursor: pointer;
  font-size: 0.9rem; line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn-ghost:hover { background: var(--plum); color: #fff; }

/* ---------- homepage story band ---------- */
.story-band {
  display: block; text-decoration: none; color: #fff;
  margin: 0.5rem 0 2rem; padding: 1.8rem 1.9rem; border-radius: var(--r-lg);
  background: linear-gradient(120deg, var(--plum-dk), var(--plum) 55%, var(--flesh));
  box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.story-band:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.story-band::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 200px; height: 200px;
  border-radius: 50%; background: radial-gradient(circle at 40% 40%, rgba(255,255,255,0.18), transparent 70%);
}
.story-band-eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.72rem; font-weight: 700; color: var(--gold); }
.story-band-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.5rem, 3.5vw, 2rem); letter-spacing: -0.01em; margin: 0.4rem 0 0.5rem; color: #fff; }
.story-band-text { margin: 0; font-size: 0.98rem; line-height: 1.55; color: rgba(255,255,255,0.9); max-width: 620px; }
.story-band-link { font-weight: 700; color: #fff; white-space: nowrap; }

/* ---------- section head + filters ---------- */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  margin: 0.5rem 0 1.25rem;
  padding-top: 1.5rem; border-top: 1px solid var(--line);
}
.section-title {
  font-family: var(--font-display); font-weight: 600; font-size: 1.4rem;
  letter-spacing: -0.01em; margin: 0; color: var(--ink);
}
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.search-wrap { position: relative; display: flex; align-items: center; }
.search-icon {
  position: absolute; left: 0.8rem; color: var(--ink-soft); font-size: 1rem; pointer-events: none;
}
.search {
  border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 0.5rem 0.9rem 0.5rem 2rem;
  font-size: 0.88rem; color: var(--ink); width: 230px; max-width: 60vw;
  outline: none; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search:focus { border-color: var(--plum-soft); box-shadow: 0 0 0 3px rgba(162,75,99,0.14); }
.chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.84rem; font-weight: 500; color: var(--ink-soft);
  background: var(--card); border: 1px solid var(--line);
  padding: 0.42rem 0.85rem; border-radius: 999px; cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.chip:hover { border-color: var(--plum-soft); }
.chip input { accent-color: var(--plum); margin: 0; }
.chip:has(input:checked) { background: var(--plum); border-color: var(--plum); color: #fff; }

/* ---------- recipe grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.4rem 1.25rem;
  padding-bottom: 2.5rem;
}
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden; cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }
.card-thumb {
  position: relative; aspect-ratio: 4 / 3;
  display: grid; place-items: center; overflow: hidden;
}
.card:hover .card-mono { transform: scale(1.06) rotate(-3deg); }
.card-mono {
  font-family: var(--font-display); font-weight: 600;
  font-size: 3.4rem; color: rgba(255,255,255,0.92);
  transition: transform 0.3s ease; text-shadow: 0 4px 14px rgba(0,0,0,0.14);
}
/* per-card gradient variants drawn from the sand-plum palette */
.thumb-0 { background: linear-gradient(135deg, #7C1F3A, #A24B63); }
.thumb-1 { background: linear-gradient(135deg, #E4703A, #E8B23A); }
.thumb-2 { background: linear-gradient(135deg, #571026, #E4703A); }
.thumb-3 { background: linear-gradient(135deg, #5B7A4B, #9C8E72); }
.card-fav {
  position: absolute; top: 0.6rem; right: 0.6rem;
  width: 28px; height: 28px; border-radius: 999px;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.92); color: var(--gold);
  font-size: 0.85rem; box-shadow: var(--shadow-sm);
}
.card-src {
  position: absolute; bottom: 0.6rem; left: 0.6rem;
  font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: #fff; background: rgba(42,31,34,0.42);
  padding: 0.2rem 0.5rem; border-radius: 999px;
  backdrop-filter: blur(4px);
}
.card-body { padding: 0.9rem 0.95rem 1.05rem; display: flex; flex-direction: column; gap: 0.55rem; }
.card-title {
  font-family: var(--font-display); font-weight: 600; font-size: 1.06rem;
  line-height: 1.22; letter-spacing: -0.01em; margin: 0; color: var(--ink);
}
.card-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.meta-chip {
  font-size: 0.72rem; font-weight: 500; color: var(--ink-soft);
  background: var(--line-2); padding: 0.24rem 0.55rem; border-radius: 999px;
}
.meta-chip.chip-make { background: rgba(91,122,75,0.14); color: var(--leaf); font-weight: 600; }

/* ---------- empty state ---------- */
.empty {
  text-align: center; padding: 3.5rem 1rem 4rem;
  color: var(--ink-soft);
}
.empty-mark { display: block; font-size: 2rem; color: var(--flesh); margin-bottom: 0.6rem; }
.empty-title { font-family: var(--font-display); font-size: 1.3rem; color: var(--ink); margin: 0 0 0.3rem; }
.empty-sub { margin: 0; font-size: 0.92rem; }

/* ---------- hints ---------- */
.hint {
  color: var(--ink-soft); font-size: 0.96rem; max-width: 560px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 1rem 1.15rem;
}
.hint-todo { color: var(--ink-soft); font-style: italic; }

/* ---------- confirm sheet ---------- */
.sheet {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(42,31,34,0.42);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: overlay 0.2s ease;
}
@keyframes overlay { from { opacity: 0; } to { opacity: 1; } }
.sheet-inner {
  background: var(--card); width: 100%; max-width: 560px;
  max-height: 92vh; overflow-y: auto;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 1.4rem 1.4rem 1.6rem;
  box-shadow: var(--shadow-lg);
  animation: rise 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.sheet-head h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; margin: 0; color: var(--ink); }
.sheet h3 {
  font-family: var(--font-display); font-weight: 600; font-size: 1.02rem;
  margin: 1.4rem 0 0.5rem; color: var(--plum);
}
.fld { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.75rem; }
.fld > span { font-size: 0.74rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); }
.fld input,
.editlist input {
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 0.6rem 0.75rem; font-size: 0.95rem; color: var(--ink);
  background: var(--paper); outline: none; width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.fld input:focus,
.editlist input:focus {
  border-color: var(--plum-soft); background: var(--card);
  box-shadow: 0 0 0 3px rgba(162,75,99,0.13);
}
.source-link {
  display: inline-block; margin: -0.4rem 0 0.75rem; font-size: 0.82rem;
  font-weight: 600; color: var(--plum); text-decoration: none;
}
.source-link:hover { text-decoration: underline; }
.fld-row { display: flex; gap: 0.6rem; }
.fld-row .fld { flex: 1; }
.chk { display: flex; align-items: center; gap: 0.5rem; font-size: 0.92rem; font-weight: 500; color: var(--ink); margin: 0.3rem 0 0.2rem; cursor: pointer; }
.chk input { accent-color: var(--plum); width: 1.05rem; height: 1.05rem; }
.editlist { display: flex; flex-direction: column; gap: 0.45rem; }
.sheet-foot {
  position: sticky; bottom: -1.6rem; background: var(--card);
  padding: 1rem 0 0.2rem; margin-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.sheet-foot .btn { width: 100%; padding: 0.85rem; }
.btn-danger {
  border: 0; background: transparent; color: #B23A48; cursor: pointer;
  font-weight: 600; font-size: 0.85rem; width: 100%; padding: 0.6rem;
  border-radius: 999px; margin-top: 0.3rem; transition: background 0.15s ease;
}
.btn-danger:hover { background: rgba(178,58,72,0.09); }

/* ---------- responsive ---------- */
@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}
/* Tab bar: on narrow screens too many tabs to fit — make it swipe-scrollable
   so every tab (incl. About) stays reachable instead of clipping off-screen. */
@media (max-width: 780px) {
  .topbar-inner { gap: 0.5rem 0.75rem; }
  .tabs {
    order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap;
    justify-content: flex-start; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 0 0 auto; }
  .brand { order: 1; }
  .account-btn { order: 2; margin-left: auto; }
}

@media (max-width: 520px) {
  .topbar-inner { padding: 0.7rem 1rem; }
  .view { padding: 1rem 1rem 0; }
  .hero { padding: 1.8rem 0 1.4rem; }
  .grid { grid-template-columns: 1fr 1fr; gap: 1rem 0.85rem; }
  .card-mono { font-size: 2.6rem; }
  .section-head { margin-bottom: 1rem; }
}
/* ---------- pantry ---------- */
.pantry-hero { padding-bottom: 1.4rem; }
.loc-picker {
  display: inline-flex; gap: 0.2rem; background: var(--line-2);
  padding: 0.25rem; border-radius: 999px; margin-bottom: 0.85rem;
}
.loc-opt {
  border: 0; background: transparent; cursor: pointer;
  font-size: 0.84rem; font-weight: 600; color: var(--ink-soft);
  padding: 0.4rem 0.85rem; border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.loc-opt:hover { color: var(--plum); }
.loc-opt.is-active { background: var(--card); color: var(--plum); box-shadow: var(--shadow-sm); }
.pantry-add { max-width: 560px; margin-bottom: 0; }

.pantry-groups {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem; margin: 0.5rem 0 2rem;
}
.pantry-group {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 1rem 1.1rem;
}
.pantry-group.is-staples { border-color: #E6C368; box-shadow: inset 0 0 0 1px #F3E4B8; }
.staples-note { margin: -0.55rem 0 0.7rem; font-size: 0.78rem; color: var(--ink-soft); }
.pantry-group-title {
  display: flex; align-items: center; gap: 0.45rem;
  font-family: var(--font-display); font-weight: 600; font-size: 1.02rem;
  margin: 0 0 0.8rem; color: var(--ink);
}
.pantry-count {
  margin-left: auto; font-family: var(--font-body); font-weight: 600;
  font-size: 0.72rem; color: var(--ink-soft);
  background: var(--line-2); border-radius: 999px; padding: 0.1rem 0.5rem; min-width: 1.4rem; text-align: center;
}
.pantry-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.pantry-chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 999px; padding: 0.32rem 0.4rem 0.32rem 0.75rem;
  font-size: 0.85rem; color: var(--ink);
}
.chip-moves { display: inline-flex; gap: 0.1rem; }
.chip-move {
  border: 0; background: transparent; cursor: pointer;
  font-size: 0.85rem; line-height: 1; padding: 0.12rem 0.22rem; border-radius: 7px;
  opacity: 0.5; transition: opacity 0.15s ease, background 0.15s ease;
}
.chip-move:hover { opacity: 1; background: var(--line-2); }
.chip-x {
  border: 0; background: var(--line-2); color: var(--ink-soft);
  width: 24px; height: 24px; border-radius: 999px; cursor: pointer;
  font-size: 0.66rem; line-height: 1; display: grid; place-items: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.wild-saved { display: inline-block; font-size: 0.82rem; font-weight: 600; color: var(--leaf); padding: 0.5rem 0; }
.chip-x:hover { background: var(--plum); color: #fff; }
.pantry-empty-note { font-size: 0.82rem; color: var(--ink-soft); font-style: italic; }

/* pantry match meter on suggestion cards */
.match-badge {
  position: absolute; top: 0.6rem; right: 0.6rem;
  background: rgba(255,255,255,0.94); color: var(--plum);
  font-weight: 700; font-size: 0.72rem; padding: 0.2rem 0.5rem;
  border-radius: 999px; box-shadow: var(--shadow-sm);
}
.match-bar { height: 6px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.match-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--leaf), var(--gold)); }
.match-note { margin: 0.1rem 0 0; font-size: 0.76rem; color: var(--ink-soft); }
.miss-label { font-weight: 700; color: var(--plum); }
.have-all { color: var(--leaf); font-weight: 600; }
.miss-list { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.4rem; }
.miss-chip {
  font-size: 0.72rem; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.18rem 0.5rem;
}

/* ---------- your photo + story ---------- */
.card-thumb.has-photo { background-size: cover; background-position: center; }
.photo-block {
  display: flex; gap: 0.9rem; align-items: center;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r); padding: 0.8rem; margin-bottom: 1rem;
}
.photo-preview {
  width: 88px; height: 88px; flex: 0 0 auto; border-radius: 12px;
  background: var(--line-2) center / cover no-repeat;
}
.photo-preview.has { border: 1px solid var(--line); }
.photo-actions { display: flex; flex-direction: column; gap: 0.1rem; }
.photo-label { font-family: var(--font-display); font-weight: 600; margin: 0; color: var(--ink); }
.photo-hint { margin: 0 0 0.45rem; font-size: 0.8rem; color: var(--ink-soft); }
.btn-soft { background: var(--line-2); color: var(--plum); cursor: pointer; }
.btn-soft:hover { background: var(--plum); color: #fff; }
.photo-btn { align-self: flex-start; font-size: 0.85rem; padding: 0.5rem 1rem; }
#c-story {
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 0.6rem 0.75rem; font-size: 0.95rem; font-family: inherit;
  color: var(--ink); background: var(--paper); resize: vertical; outline: none; width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
#c-story:focus { border-color: var(--plum-soft); background: var(--card); box-shadow: 0 0 0 3px rgba(162,75,99,0.13); }

/* ---------- select recipes + build plans ---------- */
.card-select {
  position: absolute; top: 0.6rem; left: 0.6rem; z-index: 2;
  width: 28px; height: 28px; border-radius: 999px; cursor: pointer;
  border: 2px solid rgba(255,255,255,0.9); background: rgba(42,31,34,0.28);
  color: transparent; font-size: 0.8rem; font-weight: 700; line-height: 1;
  display: grid; place-items: center; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.card-select:hover { transform: scale(1.08); }
.card.is-selected { outline: 3px solid var(--plum); outline-offset: 2px; }
.card.is-selected .card-select { background: var(--plum); border-color: #fff; color: #fff; }

.select-bar {
  position: fixed; left: 50%; bottom: 1.1rem; transform: translateX(-50%);
  z-index: 45; display: flex; align-items: center; gap: 0.9rem;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 0.45rem 0.55rem 0.45rem 1.15rem;
  box-shadow: var(--shadow-lg); animation: rise 0.22s ease-out;
  max-width: calc(100vw - 1.5rem);
}
.select-count { font-size: 0.9rem; color: var(--ink); white-space: nowrap; }
.select-count b { color: var(--plum); }
.select-actions { display: flex; align-items: center; gap: 0.4rem; }
.select-actions .btn { padding: 0.55rem 0.9rem; font-size: 0.85rem; }

/* ---------- shopping list ---------- */
.list-aisle { margin-bottom: 1.4rem; }
.list-aisle-title {
  font-family: var(--font-display); font-weight: 600; font-size: 1.05rem;
  color: var(--plum); margin: 0 0 0.55rem; text-transform: capitalize;
}
.list-item {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.6rem 0.85rem; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  margin-bottom: 0.4rem; cursor: pointer; font-size: 0.95rem; max-width: 560px;
}
.list-item input { accent-color: var(--plum); width: 1.1rem; height: 1.1rem; flex: 0 0 auto; }
.list-item label { flex: 1; cursor: pointer; }
.list-item.checked label { text-decoration: line-through; color: var(--ink-soft); }
.buy-link {
  font-size: 0.76rem; font-weight: 700; color: var(--flesh); text-decoration: none;
  border: 1px solid var(--line); border-radius: 999px; padding: 0.24rem 0.7rem; white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.buy-link:hover { background: var(--flesh); color: #fff; border-color: var(--flesh); }
.affiliate-note { font-size: 0.78rem; color: var(--ink-soft); margin: 0.7rem 0 0; max-width: 560px; }

/* ---------- cook day ---------- */
.cookday-summary { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.3rem; }
.cookday-recipe {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 1.1rem 1.2rem; margin-bottom: 1rem; max-width: 640px;
}
.cookday-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; }
.cookday-head h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; margin: 0; color: var(--ink); }
.cookday-steps { margin: 0; padding-left: 1.2rem; color: var(--ink); }
.cookday-steps li { margin-bottom: 0.45rem; line-height: 1.5; }

/* ---------- account + auth ---------- */
.account-btn {
  border: 1px solid var(--line); background: var(--card); cursor: pointer;
  font-size: 0.84rem; font-weight: 600; color: var(--plum);
  padding: 0.42rem 0.95rem; border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.account-btn:hover { border-color: var(--plum-soft); }
.account-btn.is-in { background: var(--plum); color: #fff; border-color: var(--plum); }
.auth-inner { max-width: 440px; border-radius: var(--r-lg); }
.auth-sub { color: var(--ink-soft); font-size: 0.92rem; margin: 0 0 1.1rem; }
.auth-msg { margin: 0.9rem 0 0; font-size: 0.9rem; color: var(--plum); }
.auth-msg a { color: var(--plum); font-weight: 600; }

/* ---------- wild patch ---------- */
.wild-lede { color: var(--ink-soft); font-size: 1rem; margin: 0.4rem 0 0; max-width: 540px; }
.wild-filters { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0 0 1.3rem; }
.wfilter {
  border: 1px solid var(--line); background: var(--card); color: var(--ink-soft);
  font-size: 0.82rem; font-weight: 600; padding: 0.4rem 0.85rem; border-radius: 999px;
  cursor: pointer; text-transform: capitalize;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.wfilter:hover { border-color: var(--plum-soft); }
.wfilter.is-on { background: var(--plum); color: #fff; border-color: var(--plum); }
.wfilter-clear { text-transform: none; color: var(--plum); }
.wild-save { width: 100%; margin-top: 0.3rem; font-size: 0.85rem; padding: 0.55rem; text-align: center; }
.wild-save:disabled { opacity: 0.7; cursor: default; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 5.2rem; transform: translateX(-50%);
  z-index: 60; background: var(--ink); color: #fff;
  padding: 0.7rem 1.2rem; border-radius: 999px; font-size: 0.9rem;
  box-shadow: var(--shadow-lg); animation: rise 0.2s ease-out; max-width: calc(100vw - 2rem);
}

/* ---------- paste-to-structure + smart add ---------- */
.paste-block {
  background: var(--paper); border: 1px dashed var(--line);
  border-radius: var(--r); padding: 0.9rem 1rem; margin-bottom: 1rem;
}
.paste-note { margin: 0 0 0.55rem; font-size: 0.84rem; color: var(--ink-soft); }
#c-paste, #smart-text {
  width: 100%; border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 0.6rem 0.75rem; font-family: inherit; font-size: 0.92rem;
  color: var(--ink); background: var(--card); resize: vertical; outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
#c-paste:focus, #smart-text:focus { border-color: var(--plum-soft); box-shadow: 0 0 0 3px rgba(162,75,99,0.13); }
.paste-block .btn { margin-top: 0.55rem; }
.smart-toggle {
  border: 0; background: transparent; color: var(--plum); font-weight: 600;
  font-size: 0.86rem; cursor: pointer; padding: 0.5rem 0 0; align-self: flex-start;
}
.smart-toggle:hover { text-decoration: underline; }
.smart-box { margin-top: 0.7rem; display: flex; flex-direction: column; gap: 0.55rem; max-width: 560px; }
.smart-box .btn { align-self: flex-start; }

/* ---------- clipper bookmarklet ---------- */
.clip-line { margin: 0.95rem 0 0; font-size: 0.82rem; color: var(--ink-soft); max-width: 560px; line-height: 1.5; }
.clipper {
  display: inline-block; font-weight: 700; color: var(--plum);
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 0.12rem 0.6rem; text-decoration: none; cursor: grab;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.clipper:hover { border-color: var(--plum-soft); background: var(--paper); }

/* ---------- about / favorites ---------- */
.about-head { display: flex; gap: 1.3rem; align-items: flex-start; flex-wrap: wrap; }
.avatar-wrap { position: relative; flex: 0 0 auto; cursor: pointer; }
.avatar {
  width: 96px; height: 96px; border-radius: 999px;
  background: var(--line-2) center / cover no-repeat;
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 2.2rem; color: var(--plum);
  border: 1px solid var(--line);
}
.avatar-edit {
  position: absolute; right: -2px; bottom: -2px;
  width: 30px; height: 30px; border-radius: 999px; background: var(--card);
  border: 1px solid var(--line); display: grid; place-items: center; font-size: 0.85rem;
  box-shadow: var(--shadow-sm);
}
.about-head-fields { flex: 1; min-width: 260px; display: flex; flex-direction: column; gap: 0.6rem; }
.about-name {
  font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; color: var(--ink);
  border: 1px solid transparent; border-radius: var(--r-sm); padding: 0.3rem 0.5rem; margin-left: -0.5rem;
  background: transparent; outline: none;
}
.about-name:focus { border-color: var(--line); background: var(--card); }
.about-bio {
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0.7rem 0.85rem;
  font-family: inherit; font-size: 0.98rem; color: var(--ink); background: var(--card);
  resize: vertical; outline: none; line-height: 1.55;
}
.about-bio:focus { border-color: var(--plum-soft); box-shadow: 0 0 0 3px rgba(162,75,99,0.13); }
.about-head-fields .btn { align-self: flex-start; }

.fav-list { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1.2rem; max-width: 640px; }
.fav-item {
  display: flex; align-items: center; gap: 0.8rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 0.85rem 1rem;
}
.fav-body { flex: 1; min-width: 0; }
.fav-title { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; margin: 0; color: var(--ink); }
.fav-note { margin: 0.2rem 0 0; font-size: 0.86rem; color: var(--ink-soft); }
.fav-shop { flex: 0 0 auto; font-size: 0.82rem; padding: 0.45rem 0.9rem; text-decoration: none; }
.fav-del {
  flex: 0 0 auto; border: 0; background: var(--line-2); color: var(--ink-soft);
  width: 24px; height: 24px; border-radius: 999px; cursor: pointer; font-size: 0.66rem;
  display: grid; place-items: center; transition: background 0.15s ease, color 0.15s ease;
}
.fav-del:hover { background: var(--plum); color: #fff; }
.fav-add { display: flex; flex-wrap: wrap; gap: 0.5rem; max-width: 640px; margin-bottom: 0.7rem; }
.fav-add input {
  flex: 1 1 180px; border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 0.6rem 0.8rem; font-size: 0.92rem; color: var(--ink); background: var(--card); outline: none;
}
.fav-add input:focus { border-color: var(--plum-soft); box-shadow: 0 0 0 3px rgba(162,75,99,0.13); }
.fav-add .btn { flex: 0 0 auto; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 3.5rem; padding: 2.2rem 1.25rem 1.6rem; background: var(--card); }
.footer-inner { max-width: 1080px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 1.5rem 2rem; justify-content: space-between; }
.footer-brand p { color: var(--ink-soft); font-size: 0.88rem; max-width: 340px; margin: 0.45rem 0 0; line-height: 1.5; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.3rem; align-content: flex-start; }
.footer-links a { color: var(--plum); text-decoration: none; font-size: 0.9rem; font-weight: 600; }
.footer-links a:hover { text-decoration: underline; }
.footer-legal {
  max-width: 1080px; margin: 1.6rem auto 0; padding-top: 1.2rem; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.4rem 1rem;
}
.footer-legal p { margin: 0; font-size: 0.78rem; color: var(--ink-soft); }

/* ---------- journal / blog authoring ---------- */
.post-list { display: flex; flex-direction: column; gap: 0.8rem; max-width: 680px; }
.post-item {
  display: flex; align-items: flex-start; gap: 1rem; justify-content: space-between;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem 1.15rem;
}
.post-item-body { min-width: 0; }
.post-item .cat { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--flesh); }
.post-item-title { display: inline-block; font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; color: var(--ink); text-decoration: none; margin: 0.15rem 0; }
.post-item-title:hover { color: var(--plum); }
.post-item-body p { margin: 0.2rem 0 0; font-size: 0.9rem; color: var(--ink-soft); }
.badge-draft { display: inline-block; font-size: 0.66rem; font-weight: 700; color: #fff; background: var(--ink-soft); border-radius: 999px; padding: 0.1rem 0.5rem; margin-left: 0.4rem; vertical-align: middle; }
.post-item-actions { flex: 0 0 auto; }
.btn-soft2 { border: 1px solid var(--line); background: var(--card); color: var(--plum); font-weight: 600; font-size: 0.82rem; padding: 0.42rem 0.9rem; border-radius: 999px; cursor: pointer; transition: border-color 0.15s ease; }
.btn-soft2:hover { border-color: var(--plum-soft); }
.post-editor { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.4rem; margin-bottom: 1.5rem; max-width: 720px; }
.post-editor .fld { margin-bottom: 0.8rem; }
.post-editor input, .post-editor textarea {
  width: 100%; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0.6rem 0.75rem;
  font-family: inherit; font-size: 0.95rem; color: var(--ink); background: var(--paper); outline: none;
}
.post-editor textarea { resize: vertical; line-height: 1.6; }
.post-editor input:focus, .post-editor textarea:focus { border-color: var(--plum-soft); box-shadow: 0 0 0 3px rgba(162,75,99,0.13); background: var(--card); }
.pe-cover-row { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.pe-cover { width: 150px; height: 84px; border-radius: 10px; background: var(--line-2) center / cover no-repeat; flex: 0 0 auto; border: 1px solid var(--line); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
