/* ============================================================
   Recipe App — visual foundation (from Recipe_App_UI_Design.md)
   Editorial / modern-cookbook: warm-neutral base, sparing gold,
   Fraunces (serif titles) + Inter (sans body), 3-state theme.
   ============================================================ */

:root {
  --bg: #F4EFE6;
  --surface: #FBF8F2;
  --text: #2A2622;
  --muted: #7A7268;
  --gold: #C2922E;
  --hairline: #E4DCCC;
  --shadow: 0 2px 14px rgba(42, 38, 34, 0.08);
  --radius: 14px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
}

/* Dark = warm charcoal, not pure black */
:root[data-theme="dark"] {
  --bg: #1C1815;
  --surface: #262019;
  --text: #F2ECE1;
  --muted: #A89C8B;
  --gold: #E2B65C;
  --hairline: #3A322A;
  --shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --bg: #1C1815; --surface: #262019; --text: #F2ECE1; --muted: #A89C8B;
    --gold: #E2B65C; --hairline: #3A322A; --shadow: 0 2px 18px rgba(0,0,0,0.35);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--hairline);
  position: sticky; top: 0; background: var(--bg); z-index: 10;
}
.brand {
  font-family: var(--serif); font-weight: 700; font-size: 1.3rem;
  background: none; border: none; color: var(--text); cursor: pointer; padding: 0;
}
.brand-accent { color: var(--gold); }
.topnav { display: flex; gap: 6px; margin-left: auto; }
.navlink {
  font-family: var(--sans); font-size: 0.95rem; color: var(--text);
  background: none; border: none; padding: 8px 14px; border-radius: 999px; cursor: pointer;
}
.navlink:hover { background: var(--surface); }
.navlink.primary { color: var(--gold); font-weight: 600; }
.theme-toggle {
  background: none; border: 1px solid var(--hairline); color: var(--text);
  width: 38px; height: 38px; border-radius: 999px; cursor: pointer; font-size: 1rem;
}

/* ---------- Layout ---------- */
.app { max-width: 920px; margin: 0 auto; padding: 28px 22px 80px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; }
h1 { font-size: 2rem; margin: 0 0 4px; }
.section-title {
  font-family: var(--serif); font-size: 1.3rem; margin: 32px 0 14px;
  padding-bottom: 8px; border-bottom: 2px solid var(--gold); display: inline-block;
}
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--sans); font-size: 0.95rem; font-weight: 500;
  padding: 11px 18px; border-radius: 999px; border: 1px solid var(--hairline);
  background: var(--surface); color: var(--text); cursor: pointer;
}
.btn:hover { border-color: var(--gold); }
.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-primary:hover { background: var(--gold); border-color: var(--gold); color: #1C1815; }
.btn-ghost { background: none; }
.btn-danger { color: #B23B2E; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* ---------- Forms ---------- */
input[type="text"], input[type="url"], input[type="number"], textarea, select {
  font-family: var(--sans); font-size: 1rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 10px; padding: 10px 12px; width: 100%;
}
input:focus, textarea:focus { outline: none; border-color: var(--gold); }
label { font-size: 0.85rem; color: var(--muted); display: block; margin-bottom: 4px; }
textarea { resize: vertical; }

/* ---------- Cards / grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.card {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  cursor: pointer; transition: transform .12s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-2px); }
.card-photo { aspect-ratio: 4/3; background: var(--bg); object-fit: cover; width: 100%; display: block; }
.card-photo.placeholder {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); color: var(--muted); font-size: .95rem;
}
.card-body { padding: 12px 14px; }
.card-title { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; margin: 0; }
.card-meta { color: var(--muted); font-size: .82rem; margin-top: 4px; }

.badge {
  display: inline-block; font-size: .68rem; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--gold); color: var(--gold); background: transparent;
}

/* ---------- Recipe detail ---------- */
/* Hero hugs the photo: natural size, capped, centered — no letterbox backing. */
.hero { display: block; width: auto; height: auto; max-width: 100%; max-height: 420px;
  margin: 0 auto; border-radius: var(--radius); box-shadow: var(--shadow); }
.hero.placeholder { aspect-ratio: 16/7; display: flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--muted); font-family: var(--serif); }
.detail-meta { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); margin: 14px 0; font-size: .92rem; }
.two-col { display: grid; grid-template-columns: 1fr 1.4fr; gap: 36px; }
@media (max-width: 680px) { .two-col { grid-template-columns: 1fr; } }
ul.ingredients { list-style: none; padding: 0; margin: 0; }
ul.ingredients li { padding: 8px 0; border-bottom: 1px solid var(--hairline); }
ol.steps { padding-left: 0; counter-reset: step; list-style: none; }
ol.steps li { position: relative; padding: 0 0 18px 44px; }
ol.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: -2px; width: 30px; height: 30px;
  background: var(--surface); border: 1px solid var(--gold); color: var(--gold);
  border-radius: 999px; display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: .95rem;
}
.notes-list { padding-left: 20px; }
.notes-list li { margin-bottom: 8px; }

/* serving scaler */
.scaler { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--hairline);
  border-radius: 999px; padding: 4px 6px; }
.scaler button { width: 30px; height: 30px; border-radius: 999px; border: none;
  background: var(--surface); color: var(--text); cursor: pointer; font-size: 1.1rem; }
.scaler .val { min-width: 54px; text-align: center; font-weight: 600; }

/* ---------- Review screen rows ---------- */
.review-row { display: grid; grid-template-columns: 70px 80px 1fr 1fr 30px; gap: 8px; margin-bottom: 8px; align-items: center; }
.review-row.step { grid-template-columns: 1fr 30px; }
.review-head { font-size: .78rem; color: var(--muted); }
.rm { background: none; border: none; color: #B23B2E; cursor: pointer; font-size: 1.1rem; }
@media (max-width: 680px) { .review-row { grid-template-columns: 1fr 1fr; } }

/* ---------- Plan + Shopping ---------- */
.seg { display: inline-flex; border: 1px solid var(--hairline); border-radius: 999px; overflow: hidden; }
.seg button { background: none; border: none; color: var(--text); padding: 7px 16px; cursor: pointer; font-size: .9rem; }
.seg button.on { background: var(--gold); color: #1C1815; font-weight: 600; }
.week-nav { display: flex; align-items: center; gap: 14px; margin: 16px 0; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
@media (max-width: 760px) { .cal { grid-template-columns: 1fr 1fr; } }
.cal-day { background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; padding: 10px; min-height: 130px; display: flex; flex-direction: column; }
.cal-date { font-family: var(--serif); font-size: .95rem; color: var(--gold); margin-bottom: 8px; }
.cal-items { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.plan-chip { background: var(--bg); border: 1px solid var(--hairline); border-radius: 8px; padding: 6px 8px; font-size: .82rem; cursor: pointer; display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.plan-chip.blackout { color: var(--muted); font-style: italic; }
.plan-chip .rm { background: none; border: none; color: #B23B2E; cursor: pointer; }
.cal-actions { display: flex; gap: 6px; margin-top: 8px; }
.mini { font-size: .78rem; padding: 5px 9px; border-radius: 999px; border: 1px solid var(--hairline); background: var(--bg); color: var(--text); cursor: pointer; }
.mini.ghost { color: var(--muted); }
.mini:hover { border-color: var(--gold); }

.shop-list { list-style: none; padding: 0; }
.shop-list li { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.shop-list li.done span { text-decoration: line-through; color: var(--muted); }
.shop-list li.forgotten { color: var(--muted); }
.shop-list label { display: flex; align-items: center; gap: 10px; cursor: pointer; margin: 0; color: var(--text); font-size: 1rem; }
.src-tag { font-size: .68rem; color: var(--muted); border: 1px solid var(--hairline); border-radius: 999px; padding: 1px 7px; }
.amt { color: var(--muted); font-size: .92em; }
.recipe-toggles { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 14px; }

.link-density { font-size: .72rem; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--gold); background: transparent; color: var(--gold); cursor: pointer; vertical-align: middle; }
.link-density:hover { background: var(--gold); color: #1C1815; }

.gram-db { border: 1px solid var(--hairline); border-radius: 12px; padding: 4px 14px; background: var(--surface); }
.gram-db summary { cursor: pointer; padding: 10px 0; font-weight: 500; }
.gram-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; padding: 8px 0 14px; border-bottom: 1px solid var(--hairline); margin-bottom: 8px; }
.gram-add > div { display: flex; flex-direction: column; }
.gram-add input { width: 110px; }
.gram-add input#d-g { width: 80px; }

.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; z-index: 60; }
.overlay.center-overlay { align-items: center; }
.center-overlay .sheet { border-radius: 16px; margin: 16px; max-height: 86vh; }
.sheet { background: var(--bg); width: 100%; max-width: 520px; max-height: 80vh; overflow: auto; border-radius: 16px 16px 0 0; padding: 20px; }
@media (min-width: 560px) { .overlay { align-items: center; } .sheet { border-radius: 16px; } }
.pick-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.pick-row { text-align: left; background: var(--surface); border: 1px solid var(--hairline); border-radius: 10px; padding: 12px; cursor: pointer; color: var(--text); font-size: 1rem; }
.pick-row:hover { border-color: var(--gold); }

/* ---------- Category chips (browse) ---------- */
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.cat-chip { background: var(--surface); border: 1px solid var(--hairline); color: var(--text); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: .88rem; }
.cat-chip:hover { border-color: var(--gold); }
.cat-chip.on { background: var(--gold); color: #1C1815; font-weight: 600; border-color: var(--gold); }

/* ---------- What Can I Make ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 999px; padding: 5px 12px; font-size: .88rem; }
.chip button { background: none; border: none; color: #B23B2E; cursor: pointer; font-size: 1rem; line-height: 1; }
.make-list { list-style: none; padding: 0; }
.make-list li { border-bottom: 1px solid var(--hairline); }
.make-row { width: 100%; text-align: left; background: none; border: none; color: var(--text); cursor: pointer; padding: 12px 0; font-size: 1rem; }
.make-row:hover { color: var(--gold); }

/* ---------- Browse (Recipes screen) ---------- */
.browse-controls { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; }
.browse-controls select { width: auto; }
#search { margin-top: 12px; }
.carousel { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x mandatory; }
.ccard { flex: 0 0 150px; scroll-snap-align: start; cursor: pointer; }
.ccard img, .ccard-photo { width: 150px; height: 110px; object-fit: cover; border-radius: 12px; box-shadow: var(--shadow); display: block; }
.ccard-photo.placeholder { display: flex; align-items: center; justify-content: center; background: var(--surface); color: var(--muted); font-family: var(--serif); }
.ccard-title { font-family: var(--serif); font-size: .95rem; margin: 6px 0 2px; line-height: 1.2; }
.card { position: relative; }
.card-plan { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 999px; border: none; background: rgba(0,0,0,.55); color: #fff; font-size: 1.2rem; cursor: pointer; line-height: 1; }
.card-plan:hover { background: var(--gold); color: #1C1815; }
.card-when { float: right; font-size: .8rem; }
.badge-new { display: inline-block; font-size: .68rem; font-weight: 600; text-transform: uppercase; color: var(--gold); }

/* ---------- Welcome tour ---------- */
.sheet.tour { text-align: center; }
.tour-img { max-width: 100%; max-height: 220px; border-radius: 12px; margin-bottom: 12px; box-shadow: var(--shadow); }
.tour-dots { display: flex; gap: 8px; justify-content: center; margin-bottom: 14px; }
.tour-dots span { width: 8px; height: 8px; border-radius: 999px; background: var(--hairline); }
.tour-dots span.on { background: var(--gold); }
.sheet.tour .btn-row { justify-content: center; }

/* ---------- Ratings ---------- */
.rating-avg, .rating-stars { color: var(--gold); letter-spacing: 1px; }
.rate-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; }
.star { background: none; border: none; font-size: 1.6rem; color: var(--hairline); cursor: pointer; padding: 0 2px; line-height: 1; }
.star.on { color: var(--gold); }
.star.half { background: linear-gradient(90deg, var(--gold) 50%, var(--hairline) 50%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.heart { display: flex; align-items: center; gap: 8px; margin: 12px 0; cursor: pointer; }
.rating-list { list-style: none; padding: 0; }
.rating-list li { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.rating-list .rating-stars { font-size: .95rem; margin-right: 6px; }
.rating-avg { text-decoration: none; cursor: pointer; background: none; border: none; color: var(--text); font: inherit; padding: 0; }
.rb-collapsed { display: none; }
.rating-person { margin-bottom: 14px; }
.rating-person-head { font-family: var(--serif); font-size: 1.05rem; padding: 8px 0 2px; border-bottom: 2px solid var(--hairline); }
.rating-person .rating-list li { padding: 8px 0; }

/* ---------- Gate + profiles ---------- */
body.locked .topbar { display: none; }
.gate { max-width: 360px; margin: 12vh auto 0; text-align: center; }
.gate.wide { max-width: 640px; }
.gate h1 { font-family: var(--serif); font-size: 2rem; }
.gate input[type="password"], .gate input[type="text"] { margin: 14px 0; }
.pin-dots { font-size: 2rem; letter-spacing: .35em; height: 40px; color: var(--gold); margin: 8px 0 16px; min-height: 40px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 280px; margin: 0 auto; }
.key { font-size: 1.5rem; font-family: var(--serif); padding: 16px 0; border-radius: 14px; border: 1px solid var(--hairline); background: var(--surface); color: var(--text); cursor: pointer; }
.key:hover { border-color: var(--gold); }
.key:active { background: var(--gold); color: #1C1815; }
.key.ghost { color: var(--muted); }
.key.go { color: var(--gold); }
.profile-chip {
  background: var(--surface); border: 1px solid var(--hairline); color: var(--text);
  padding: 7px 14px; border-radius: 999px; cursor: pointer; font-size: .9rem; font-weight: 500;
}
.profile-chip:hover { border-color: var(--gold); }
.profile-grid { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; margin-top: 22px; }
.profile-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: none; border: none; cursor: pointer; color: var(--text); width: 120px;
}
.avatar {
  width: 84px; height: 84px; border-radius: 18px; background: var(--surface);
  border: 1px solid var(--hairline); display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 2rem; color: var(--gold);
}
.profile-card:hover .avatar { border-color: var(--gold); }
.pname { font-size: .95rem; }
.dev-list { list-style: none; padding: 0; }
.dev-list li { display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--hairline); }

/* ---------- Cook Mode (read-only two-pane) ---------- */
body.cooking .topbar { display: none; }
body.cooking .app { max-width: 100%; padding: 0; }
.cook { display: flex; flex-direction: column; height: 100vh; }
.cook-bar {
  display: flex; align-items: center; gap: 14px; padding: 12px 18px;
  border-bottom: 1px solid var(--hairline); background: var(--bg); flex: 0 0 auto;
}
.cook-title { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cook-ings {
  flex: 0 0 auto; max-height: 33vh; overflow: auto; padding: 8px 22px 14px;
  border-bottom: 1px solid var(--hairline); background: var(--surface);
}
.cook-ings.collapsed { max-height: 48px; overflow: hidden; }
.cook-ings-head {
  position: sticky; top: 0; background: var(--surface); width: 100%; text-align: left;
  font-family: var(--serif); font-size: 1.05rem; color: var(--gold);
  border: none; padding: 10px 0; cursor: pointer;
}
.cook-ings .ingredients li { font-size: 1.05rem; }
.cook-steps { flex: 1 1 auto; overflow: auto; padding: 22px 22px 80px; }
.cook-step-list li { font-size: 1.4rem; line-height: 1.5; padding-bottom: 26px; padding-left: 50px; }
.cook-step-list li::before { width: 34px; height: 34px; font-size: 1.05rem; top: 0; }
.cook-steps strong { color: var(--gold); font-weight: 600; }

/* ---------- States ---------- */
.empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.spinner { text-align: center; padding: 50px; color: var(--muted); }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: 999px;
  box-shadow: var(--shadow); z-index: 50; font-size: .92rem;
}
.banner { background: var(--surface); border: 1px solid var(--gold); border-radius: 10px;
  padding: 12px 16px; margin-bottom: 18px; font-size: .9rem; }

/* ---------- Requests (text "please add this" recipe asks) ---------- */
.request-list { list-style: none; padding: 0; margin: 8px 0 14px; }
.request-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.req-badge { display: inline-flex; align-items: center; gap: 8px; background: var(--surface);
  border: 1px solid var(--gold); color: var(--text); border-radius: 12px; padding: 12px 16px;
  margin: 16px 0 4px; cursor: pointer; font-size: .95rem; box-shadow: var(--shadow);
  transition: transform var(--t-fast, .14s) var(--ease, ease), box-shadow var(--t-fast, .14s) var(--ease, ease); }
.req-badge:hover { transform: translateY(-2px); }
.req-badge:active { transform: translateY(0) scale(.99); }

/* ============================================================
   Recipes browse — prototype-style carousels + category cards
   ============================================================ */
.section-label { font-size: .7rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin: 24px 0 10px; display: flex; align-items: center; gap: 10px; }
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }

/* square photo cards in the carousels */
.rcard { width: 150px; flex: 0 0 150px; scroll-snap-align: start; cursor: pointer; }
.rcard-img { width: 150px; height: 150px; border-radius: 16px; position: relative; overflow: hidden;
  box-shadow: var(--shadow); background: var(--surface); }
.rcard-img img { width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform var(--t-med, .26s) var(--ease, ease); }
.rcard:hover .rcard-img img { transform: scale(1.05); }
.rcard-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); color: var(--muted); }
.rcard-add { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.28); background: rgba(0,0,0,.45); color: #fff; cursor: pointer;
  font-size: 1.05rem; line-height: 1; display: flex; align-items: center; justify-content: center; }
.rcard-add:hover { background: var(--gold); color: #1C1815; }
.rname { font-family: var(--serif); font-size: .95rem; font-weight: 600; margin-top: 8px; line-height: 1.2; }
.rmeta { font-size: .74rem; color: var(--muted); margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.rmeta .rating-stars { color: var(--gold); }

.show-more-card { width: 150px; height: 150px; flex: 0 0 150px; border-radius: 16px;
  border: 1px dashed var(--hairline); display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; gap: 4px; font-family: var(--serif); color: var(--muted);
  cursor: pointer; padding: 0 10px; transition: border-color var(--t-fast, .14s) ease, color var(--t-fast, .14s) ease; }
.show-more-card span { font-family: var(--sans); font-size: .76rem; }
.show-more-card:hover { border-color: var(--gold); color: var(--gold); }

/* image-backed category cards */
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cat-card { height: 92px; border-radius: 16px; position: relative; overflow: hidden; cursor: pointer;
  box-shadow: var(--shadow); background-size: cover; background-position: center;
  background-image: linear-gradient(135deg, var(--gold), var(--surface)); /* fallback when no photo */
  transition: transform var(--t-med, .26s) var(--ease, ease); }
.cat-card:hover { transform: translateY(-2px); }
.cat-grad { position: absolute; inset: 0; background: linear-gradient(to top, rgba(20,16,12,.78), rgba(20,16,12,.12)); }
.cat-cc { position: absolute; left: 14px; bottom: 11px; }
.cat-cn { font-family: var(--serif); font-size: 1rem; font-weight: 600; color: #fff; }
.cat-ck { font-size: .72rem; color: rgba(255,255,255,.85); }

/* in-library filter bar (search / category active) */
.lib-filterbar { display: flex; align-items: center; gap: 12px; margin: 16px 0 12px; flex-wrap: wrap; }
.back-pill { border: 1px solid var(--hairline); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 7px 14px; cursor: pointer; font-size: .85rem;
  transition: border-color var(--t-fast, .14s) ease; }
.back-pill:hover { border-color: var(--gold); }

@media (max-width: 600px) { .cat-grid { gap: 10px; } }

/* ============================================================
   Results window (search / category) — prototype-style
   ============================================================ */
.results-topbar { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; }
.results-topbar .back, .results-topbar .ham {
  width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--hairline);
  background: var(--surface); color: var(--text); cursor: pointer; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center; }
.results-topbar .back:hover, .results-topbar .ham:hover { border-color: var(--gold); }
.results-topbar .rt-label { font-size: .85rem; }

.current-filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: .8rem; color: var(--muted); margin: 4px 0 8px; }
.fchip { font-size: .8rem; font-weight: 600; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--hairline); background: var(--surface); color: var(--text); cursor: pointer; }
.fchip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.current-filter .clr { color: var(--gold); font-weight: 600; cursor: pointer; }

.results-list { margin-top: 4px; }
.sort-line { font-size: .78rem; color: var(--muted); padding: 2px 0 10px; }
.lrow { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--hairline);
  align-items: center; cursor: pointer; }
.lrow .lt { width: 60px; height: 60px; border-radius: 13px; background-size: cover;
  background-position: center; flex-shrink: 0; background-color: var(--surface); }
.lrow .lt-ph { background: linear-gradient(135deg, var(--gold), var(--surface)); }
.lrow .li { flex: 1; min-width: 0; }
.lrow .ln { font-family: var(--serif); font-size: 1rem; font-weight: 600; }
.lrow .lm { font-size: .76rem; color: var(--muted); margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.lrow .lm .rating-stars { color: var(--gold); }
.lrow .ladd { width: 34px; height: 34px; border-radius: 50%; background: var(--surface);
  border: 1px solid var(--hairline); color: var(--text); cursor: pointer; flex-shrink: 0; font-size: 1rem; }
.lrow .ladd:hover { border-color: var(--gold); color: var(--gold); }

/* slide-in category filter overlay */
.filter-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40;
  opacity: 0; pointer-events: none; transition: opacity .25s var(--ease, ease); }
.filter-scrim.on { opacity: 1; pointer-events: auto; }
.filter-panel { position: fixed; top: 0; bottom: 0; left: 0; width: 240px; background: var(--surface);
  border-right: 1px solid var(--hairline); z-index: 41; transform: translateX(-100%);
  transition: transform .25s var(--ease, ease); box-shadow: 8px 0 30px rgba(0,0,0,.25);
  padding: 16px 0; overflow-y: auto; }
.filter-panel.open { transform: translateX(0); }
.filter-panel .fp-head { display: flex; align-items: center; justify-content: space-between; padding: 0 16px 10px; }
.filter-panel .fp-head .h { font-family: var(--serif); font-size: 1.1rem; }
.filter-panel .fp-head .back { width: 32px; height: 32px; border: 1px solid var(--hairline);
  background: var(--bg); border-radius: 8px; cursor: pointer; color: var(--text); }
.filter-panel .fp-cat { padding: 11px 16px; font-size: .85rem; font-weight: 600; color: var(--muted);
  cursor: pointer; border-left: 2px solid transparent; }
.filter-panel .fp-cat.active { color: var(--text); border-left-color: var(--gold); background: var(--bg); }
.filter-panel .fp-cat:hover { color: var(--text); }

/* ============================================================
   Home dashboard — prototype-style
   ============================================================ */
.home-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.home-eyebrow { font-size: .7rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: 3px; }
.home-greet { font-family: var(--serif); font-size: 1.9rem; font-weight: 600; margin: 0; line-height: 1.05; }
.home-add { flex-shrink: 0; }

/* calendar card */
.cal-card { background: var(--surface); border: 1px solid var(--hairline); border-radius: 22px;
  box-shadow: var(--shadow); padding: 16px 14px 14px; margin-top: 16px; }
.cal-head { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 14px; }
.cal-head .cal-month { font-family: var(--serif); font-size: 1.1rem; min-width: 120px; text-align: center; }
.wk-arrow { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--hairline);
  background: var(--bg); color: var(--text); cursor: pointer; font-size: 1rem; }
.wk-arrow:hover { border-color: var(--gold); }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.day { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 7px 0 6px;
  border-radius: 12px; cursor: pointer; background: none; border: none; }
.day:hover { background: var(--bg); }
.day .dow { font-size: .62rem; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.day .num { font-size: .82rem; font-weight: 600; color: var(--text); }
.day.today { background: var(--text); }
.day.today .dow { color: var(--gold); }
.day.today .num { color: var(--bg); }
.chip { width: 28px; height: 28px; border-radius: 8px; background-size: cover; background-position: center;
  border: 1px solid var(--hairline); background-color: var(--gold); }
.chip.empty { background: var(--bg); border: 1px dashed var(--hairline); }
.chip.blackout { background: repeating-linear-gradient(45deg, var(--hairline), var(--hairline) 4px, transparent 4px, transparent 8px);
  display: flex; align-items: center; justify-content: center; font-size: .7rem; }

/* cook-now hero */
.cook-now { position: relative; border-radius: 24px; overflow: hidden; min-height: 210px; cursor: pointer;
  box-shadow: var(--shadow); background-size: cover; background-position: center; background-color: var(--surface);
  display: flex; transition: transform var(--t-med, .26s) var(--ease, ease); }
.cook-now:hover { transform: translateY(-2px); }
.cook-now.placeholder { background-image: linear-gradient(135deg, var(--gold), #8a6a4a); }
.cook-now .grad { position: absolute; inset: 0; background: linear-gradient(to top, rgba(20,16,12,.82), rgba(20,16,12,.1)); }
.cook-now-content { position: relative; align-self: flex-end; padding: 20px; width: 100%; }
.cook-now-tag { font-size: .64rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #E2B65C; margin-bottom: 6px; }
.cook-now-content h2 { font-family: var(--serif); font-weight: 600; font-size: 1.6rem; color: #fff;
  line-height: 1.06; margin: 0 0 14px; text-shadow: 0 1px 12px rgba(0,0,0,.35); }
.cook-now-row { display: flex; align-items: center; gap: 14px; }
.launch { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.16);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.3);
  color: #fff; font-size: .85rem; font-weight: 600; padding: 10px 18px; border-radius: 999px; cursor: pointer; }
.launch:hover { background: rgba(255,255,255,.26); }
.launch .play { width: 20px; height: 20px; border-radius: 50%; background: var(--gold); color: #1C1815;
  display: flex; align-items: center; justify-content: center; font-size: .6rem; }
.cook-now-avg { color: #fff; font-weight: 600; font-size: .92rem; text-shadow: 0 1px 8px rgba(0,0,0,.4); }

/* your-kitchen tiles */
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 4px; }
.mini { position: relative; border-radius: 20px; overflow: hidden; min-height: 150px; cursor: pointer;
  box-shadow: var(--shadow); background: var(--surface); border: 1px solid var(--hairline);
  transition: transform var(--t-fast, .14s) var(--ease, ease); }
.mini:hover { transform: translateY(-2px); }
.mini.photo { border: none; background-size: cover; background-position: center; }
.mini.photo .grad { position: absolute; inset: 0; background: linear-gradient(to top, rgba(20,16,12,.8), rgba(20,16,12,.1)); }
.mini .mbody { position: absolute; inset: 0; padding: 15px; display: flex; flex-direction: column; justify-content: space-between; }
.mini .mlabel { font-family: var(--serif); font-size: 1.05rem; font-weight: 600; }
.mini .msub { font-size: .74rem; color: var(--muted); margin-top: 2px; }
.mini.photo .mlabel { color: #fff; }
.mini.photo .msub { color: rgba(255,255,255,.85); }
.wide { grid-column: 1 / -1; background: var(--surface); border: 1px solid var(--hairline); border-radius: 20px;
  box-shadow: var(--shadow); padding: 16px; cursor: pointer; }
.wide-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.wide-head h3 { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; margin: 0; }
.hrow { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.hrow + .hrow { border-top: 1px solid var(--hairline); }
.hrow .thumb { width: 46px; height: 46px; border-radius: 11px; background-size: cover; background-position: center; flex-shrink: 0; background-color: var(--bg); }
.hrow .thumb-ph { background: linear-gradient(135deg, var(--gold), var(--surface)); }
.hrow .meta { flex: 1; min-width: 0; }
.hrow .name { font-size: .9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hrow .when { font-size: .74rem; color: var(--muted); margin-top: 1px; }
.hrow .rating-stars { color: var(--gold); }

@media (max-width: 600px) { .home-greet { font-size: 1.6rem; } }

/* ============================================================
   Bottom tab bar — primary switcher (Recipe_App_Navigation.md)
   Home / Recipes / Shopping / Plan · frosted · gold active.
   ============================================================ */
.topbar-spacer { flex: 1; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--hairline);
  background: var(--bg); /* fallback */
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; cursor: pointer; color: var(--muted); padding: 4px 0;
  transition: color var(--t-fast, .14s) var(--ease, ease); }
.tab .ti { display: flex; align-items: center; justify-content: center; }
.tab .tl { font-size: .66rem; font-weight: 600; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--gold); }
.tab.active .tl { -webkit-text-stroke: .4px var(--text); }
:root[data-theme="dark"] .tab.active .tl { -webkit-text-stroke: .4px rgba(0,0,0,.55); }

/* hide the bar on the lock screen and in Cook Mode */
body.locked .tabbar, body.cooking .tabbar { display: none; }

/* ============================================================
   Home calendar card — one enlarged day + small day strip
   (Recipe_App_Screen_Designs.md §1)
   ============================================================ */
.cal-head { position: relative; }
.cal-search { position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--hairline);
  background: var(--bg); color: var(--muted); cursor: pointer; font-size: .85rem; }
.cal-search:hover { border-color: var(--gold); color: var(--gold); }

.cal-enlarged { margin-bottom: 12px; }
.cal-big { position: relative; border-radius: 18px; overflow: hidden; min-height: 150px;
  background-size: cover; background-position: center; background-color: var(--bg);
  cursor: pointer; display: flex; box-shadow: var(--shadow);
  transition: transform var(--t-med, .26s) var(--ease, ease); }
.cal-big:hover { transform: translateY(-2px); }
.cal-big.placeholder { background-image: linear-gradient(135deg, var(--gold), #8a6a4a); }
.cal-big-grad { position: absolute; inset: 0; background: linear-gradient(to top, rgba(20,16,12,.82), rgba(20,16,12,.08)); }
.cal-big-body { position: relative; align-self: flex-end; padding: 16px; width: 100%; }
.cal-big-label { font-size: .64rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #E2B65C; margin-bottom: 5px; }
.cal-big-name { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; color: #fff; line-height: 1.1; text-shadow: 0 1px 10px rgba(0,0,0,.4); }
.cal-big-empty { font-size: .92rem; color: rgba(255,255,255,.92); }
.cal-big-star { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.3); background: rgba(0,0,0,.4); color: var(--gold); font-size: 1.05rem; cursor: pointer; }
.cal-big-star:hover { background: var(--gold); color: #1C1815; }

.cal-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-mini { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 0 6px;
  border-radius: 12px; background: none; border: none; cursor: pointer; }
.cal-mini:hover { background: var(--bg); }
.cal-mini.sel { background: var(--text); }
.cal-mini .cmd { font-size: .6rem; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.cal-mini .cmn { font-size: .85rem; font-weight: 600; color: var(--text); }
.cal-mini.today .cmn { color: var(--gold); }
.cal-mini.sel .cmd { color: var(--gold); }
.cal-mini.sel .cmn { color: var(--bg); }
.cmdot { width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.cmdot.has { background: var(--gold); }
.cmdot.bo { background: var(--muted); }
.cal-mini.sel .cmdot.has { background: var(--gold); }

/* ============================================================
   Home v2 — profile avatar, dark cover-flow calendar,
   Waiter's Recommendation (Home tab changes.md)
   ============================================================ */
.home-avatar { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--gold), #8a6a4a); border: 1.5px solid var(--gold);
  color: #fff; font-family: var(--serif); font-size: 1.1rem; font-weight: 600; }
.home-avatar:hover { filter: brightness(1.06); }

/* dark premium calendar panel */
.cal-card.cal-dark { background: #211c16; border-color: #3a322a; color: #F2ECE1; }
.cal-dark .cal-head { justify-content: center; }
.cal-dark .cal-label { font-family: var(--serif); font-size: 1.05rem; color: #fff; min-width: 132px; text-align: center; }
.cal-dark .wk-arrow { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); color: #F2ECE1; }
.cal-dark .wk-arrow:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.cal-dark .wk-arrow:disabled { opacity: .3; cursor: default; }

/* cover-flow of combined day/recipe cards */
.cal-cf { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 2px 2px; scrollbar-width: none; }
.cal-cf::-webkit-scrollbar { display: none; }
.cf-card { position: relative; flex: 0 0 84px; height: 116px; border-radius: 14px; overflow: hidden;
  cursor: pointer; scroll-snap-align: center; background-size: cover; background-position: center;
  background-color: #2c251d; box-shadow: 0 2px 10px rgba(0,0,0,.4);
  transition: flex-basis .28s var(--ease, ease), height .28s var(--ease, ease); }
.cf-card.noimg { background-image: linear-gradient(150deg, #3a2f20, #241e17); }
.cf-card.on { flex-basis: 190px; height: 150px; }
.cf-grad { position: absolute; inset: 0; background: linear-gradient(to top, rgba(15,12,9,.85), rgba(15,12,9,.12)); }
.cf-top { position: relative; display: flex; justify-content: space-between; align-items: baseline; padding: 8px 10px 0; color: #fff; }
.cf-dow { font-size: .58rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.72); }
.cf-num { font-family: var(--serif); font-size: 1.05rem; }
.cf-card.td .cf-num { color: var(--gold); }
.cf-bot { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px; color: #fff; }
.cf-name { font-family: var(--serif); font-size: 1.02rem; line-height: 1.12; }
.cf-card:not(.on) .cf-name, .cf-card:not(.on) .cf-free { display: none; }
.cf-free { font-size: .72rem; color: rgba(255,255,255,.62); }
.cf-dim { color: rgba(255,255,255,.6); }
.cf-actions { display: flex; align-items: center; gap: 10px; margin-top: 9px; }
.cf-cook { background: var(--gold); color: #1C1815; border: none; border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: .78rem; cursor: pointer; }
.cf-cook:hover { filter: brightness(1.07); }
.cf-avg { font-size: .78rem; font-weight: 600; color: var(--gold); }

/* Waiter's Recommendation empty state */
.rec-empty { background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px;
  padding: 16px; color: var(--muted); font-size: .9rem; margin-bottom: 4px; }
.link-btn { background: none; border: none; color: var(--gold); font-weight: 600; cursor: pointer; padding: 0; font-size: .9rem; }
