/* ============================================================
   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;
}
/* Safe-area top cover: blocks scrolled content bleeding through the device status bar.
   Uses a fixed strip with the page background colour, z-index above sticky headers (20)
   and the tab bar (30) but below overlays/modals (60). */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: env(safe-area-inset-top, 0px);
  background: var(--bg);
  z-index: 50;
  pointer-events: none;
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 22px;
  /* Push below phone status bar when launched from home screen */
  padding-top: max(14px, calc(10px + env(safe-area-inset-top, 0px)));
  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; box-sizing: border-box; min-height: 100dvh; padding: 28px 22px 80px;
  /* Extra top room when no topbar (lock screen / standalone with no topbar visible) */
  padding-top: max(28px, calc(16px + env(safe-area-inset-top, 0px)));
  /* Extra bottom room so the fixed tab bar never covers page content */
  padding-bottom: max(80px, calc(64px + env(safe-area-inset-bottom, 0px))); }
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 {
  position: relative; 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;
}
/* Image-overlay badges for .card (browseGrid) */
.card-img-badge {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  font-size: .6rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; pointer-events: none;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.card-img-badge-draft { background: rgba(194,146,46,.88); color: #1c1815; }
.card-img-badge-new  { background: rgba(255,255,255,.88); color: #1c1815; }

/* ---------- 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; } }
.review-row .merge-edit { grid-column: 1 / -1; font-size: .8rem; padding: 5px 8px; color: var(--muted); border: 1px dashed var(--hairline); border-radius: 8px; background: transparent; }
.review-row .merge-edit:focus { color: var(--text); border-style: solid; border-color: var(--gold); }

/* ---------- 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: grab; display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.plan-chip.blackout { color: var(--muted); font-style: italic; cursor: default; }
.plan-chip .rm { background: none; border: none; color: #B23B2E; cursor: pointer; }
.plan-chip.dragging { opacity: .4; cursor: grabbing; }
.cal-day.drag-over { background: rgba(194,146,46,.1); border-radius: 12px; outline: 2px dashed var(--gold); }
.cal-actions { display: flex; gap: 4px; margin-top: 6px; }
.cal-actions .mini { font-size: .7rem; padding: 3px 7px; }
.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 { display: flex; align-items: center; gap: 10px; 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-day { flex: 0 0 auto; min-width: 34px; text-align: center; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--gold); background: rgba(194,146,46,.12); border-radius: 6px; padding: 3px 6px; }
.pick-name { flex: 1 1 auto; }
.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 ---------- */
/* Tutorial card: flex column with a definite height so the screenshot fills the
   space left by the text and never gets cut off; nav is overlaid on the image. */
.sheet.tour { text-align: center; overflow: hidden; display: flex; flex-direction: column;
  height: min(760px, 86vh); }
.tour-card { display: flex; flex-direction: column; height: 100%; min-height: 0; width: 100%; }
.tour-dots { display: flex; gap: 8px; justify-content: center; margin-bottom: 10px; flex: 0 0 auto; }
.tour-dots span { width: 8px; height: 8px; border-radius: 999px; background: var(--hairline); }
.tour-dots span.on { background: var(--gold); }
.sheet.tour .section-title { flex: 0 0 auto; }
.sheet.tour p { flex: 0 0 auto; margin: .35em 0 .55em; }
.img-area { flex: 1 1 0; min-height: 0; display: flex; justify-content: center; align-items: center; }
.img-area.noimg { display: none; }
.tour-img-wrap { position: relative; display: inline-flex; max-height: 100%; max-width: 100%; line-height: 0; }
.tour-img { display: block; max-height: 100%; max-width: 100%; width: auto; height: auto;
  object-fit: contain; border-radius: 12px; box-shadow: var(--shadow); }
.tour-marks { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.tour-pill { position: absolute; transform: translate(-50%, -50%); background: var(--gold); color: #1C1815;
  font-size: .76rem; font-weight: 700; line-height: 1.14; text-align: center; padding: 4px 9px;
  border-radius: 11px; max-width: 52%; box-shadow: 0 0 0 3px #fff, var(--shadow); }
.tour-nav { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; justify-content: center;
  padding: 12px 10px; border-radius: 0 0 12px 12px;
  background: linear-gradient(to top, rgba(0,0,0,.62), rgba(0,0,0,0)); }
.tour-nav .btn-ghost { background: rgba(255,255,255,.92); }
.tour-homescreen-note {
  margin: 12px 0 4px; padding: 9px 13px; border-radius: 10px;
  background: rgba(194,146,46,.1); border: 1px solid rgba(194,146,46,.28);
  font-size: .8rem; color: var(--gold); text-align: center; line-height: 1.4; flex: 0 0 auto;
}
.sheet.tour .btn-row { justify-content: center; flex: 0 0 auto; }

/* ---------- 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; }
.profile-gate { max-width: 640px; margin: 4vh auto 0; text-align: center; }
.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: 16px; }
.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; }
/* Wide profile card variant (full name, no initial) */
.profile-card-wide {
  width: auto; min-width: 120px; padding: 16px 24px;
  background: var(--surface); border: 2px solid var(--hairline) !important;
  border-radius: var(--radius); transition: border-color .15s, transform .12s;
}
.profile-card-wide:hover { border-color: var(--gold) !important; transform: translateY(-2px); }

/* Fixed-size profile cards so all are the same width on the picker */
.profile-card-fixed { width: 148px; }
/* Gold profile name text on picker screen */
.pname-gold { color: var(--gold); }
.profile-deco { font-size: 2.2rem; line-height: 1; margin-bottom: 4px; }
.pname-full { font-size: 1.05rem; font-weight: 600; }
.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: 100dvh; }
.cook-bar {
  display: flex; align-items: center; gap: 14px; padding: 12px 18px;
  padding-top: max(12px, calc(10px + env(safe-area-inset-top, 0px)));
  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: 22vh; 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-recipe-title { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; margin: 0 0 18px; line-height: 1.2; }
.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; }
/* Title gradient overlay inside .rcard-img */
.rcard-title-overlay {
  position: absolute; left: 0; right: 0; bottom: 0; pointer-events: none;
  padding: 32px 8px 8px;
  background: linear-gradient(to top, rgba(0,0,0,.78) 0%, transparent 100%);
  font-family: var(--serif); font-size: .82rem; font-weight: 600; color: #fff;
  line-height: 1.25;
}
/* "Requested" tag, top-left of a requested recipe card image */
.rcard-req-tag {
  position: absolute; top: 6px; left: 6px; z-index: 2; pointer-events: none;
  font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: #F0C75E; padding: 3px 7px; border-radius: 999px;
  background: rgba(0,0,0,.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
/* Image-overlay badges for .rcard (carousel) */
.rcard-badge {
  position: absolute; top: 6px; left: 6px; z-index: 2; pointer-events: none;
  font-size: .58rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.rcard-badge-draft { background: rgba(194,146,46,.88); color: #1c1815; }
.rcard-badge-new   { background: rgba(255,255,255,.88); 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);
  object-fit: cover; display: block; }
.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); }
.lrow .lreq { height: 34px; padding: 0 12px; border-radius: 17px; background: var(--surface);
  border: 1px solid var(--hairline); color: var(--text); cursor: pointer; flex-shrink: 0; font-size: .82rem; white-space: nowrap; }
.lrow .lreq: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; }
.home-grid .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); }
.home-grid .mini:hover { transform: translateY(-2px); }
.home-grid .mini.photo { border: none; background-size: cover; background-position: center; }
.home-grid .mini.photo .grad { position: absolute; inset: 0; background: linear-gradient(to top, rgba(20,16,12,.8), rgba(20,16,12,.1)); }
.home-grid .mini .mbody { position: absolute; inset: 0; padding: 15px; display: flex; flex-direction: column; justify-content: space-between; }
.home-grid .mini .mlabel { font-family: var(--serif); font-size: 1.05rem; font-weight: 600; }
.home-grid .mini .msub { font-size: .74rem; color: var(--muted); margin-top: 2px; }
.home-grid .mini.photo .mlabel { color: #fff; }
.home-grid .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)
   ============================================================ */
/* profile name sits inline with the greeting, in gold */
.home-name { background: none; border: none; padding: 0; font: inherit; color: var(--gold); cursor: pointer; }
.home-name:hover { text-decoration: underline; }

/* premium calendar panel */
.cal-card.cal-dark { background: var(--surface); border-color: var(--hairline); color: var(--text); padding: 12px 12px 14px; }
.cal-dark .cal-head { justify-content: center; margin-bottom: 8px; }
.cal-dark .cal-label { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; color: var(--gold); min-width: 132px; text-align: center; }
.cal-dark .wk-arrow { background: var(--bg); border-color: var(--hairline); color: var(--text); }
.cal-dark .wk-arrow:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.cal-dark .wk-arrow:disabled { opacity: .35; cursor: default; }

/* cover-flow of combined day/recipe cards */
/* padding-inline lets end cards scroll to centre */
.cal-cf { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px calc(50% - 43px) 2px; scroll-padding-inline: calc(50% - 43px);
  scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.cal-cf::-webkit-scrollbar { display: none; }
.cf-card { position: relative; flex: 0 0 86px; height: 132px; border-radius: 16px; overflow: hidden;
  cursor: pointer; scroll-snap-align: center; background-size: cover; background-position: center;
  background-color: #1e1812; border: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 4px 16px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.06);
  transition: flex-basis .28s var(--ease, ease), height .28s var(--ease, ease); }
.cf-card.noimg { background-image: linear-gradient(155deg, #2a1f12 0%, #17130d 55%, #221a0f 100%); }
.cf-card.on { flex-basis: 212px; height: 174px; border-color: rgba(194,146,46,.35); box-shadow: 0 6px 24px rgba(0,0,0,.6), 0 0 0 1px rgba(194,146,46,.2); }
.cf-grad { position: absolute; inset: 0; background: linear-gradient(to top, rgba(12,9,6,.92) 0%, rgba(12,9,6,.3) 55%, rgba(12,9,6,.05) 100%); }
.cf-top { position: relative; display: flex; justify-content: space-between; align-items: flex-start; padding: 9px 10px 0; }
.cf-dow { font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #fff; background: rgba(0,0,0,.42); padding: 3px 8px; border-radius: 7px; }
.cf-dow.cf-today { text-transform: none; letter-spacing: .02em; font-size: .68rem; font-weight: 800; white-space: nowrap; color: #E2B65C; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.cf-num { font-family: var(--serif); font-size: 1.15rem; color: #fff; background: rgba(0,0,0,.42); padding: 1px 9px; border-radius: 7px; }
.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.05rem; 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; justify-content: space-between; gap: 8px; margin-top: 10px; }
.cf-right { display: flex; align-items: center; gap: 8px; }
.cf-heart { color: #ff6b6b; font-size: .9rem; }
.cf-cook { background: var(--gold); color: #1C1815; border: none; border-radius: 999px; padding: 6px 15px; font-weight: 600; font-size: .8rem; cursor: pointer; }
.cf-cook:hover { filter: brightness(1.07); }
.cf-avg { font-size: .8rem; font-weight: 600; color: var(--gold); white-space: nowrap; }

/* Waiter's Recommendation — one large card holding the recipe carousel */
.rec-card { background: var(--surface); border: 1px solid var(--hairline); border-radius: 20px; box-shadow: var(--shadow); padding: 14px 4px 8px 16px; margin-bottom: 4px; }
.rec-title { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; color: var(--gold); margin: 0 0 10px; }
.rec-card .carousel { margin: 0; padding: 2px 12px 8px 0; }
.rec-empty { color: var(--muted); font-size: .92rem; padding: 4px 12px 8px 0; }
.link-btn { background: none; border: none; color: var(--gold); font-weight: 600; cursor: pointer; padding: 0; font-size: .92rem; }

/* History & Ratings tile — gold background */
.wide { background: linear-gradient(135deg, var(--gold), #d8b968); border: none; color: #2A2622; }
.wide-head h3 { color: #2A2622; }
.wide .muted { color: rgba(42,38,34,.6); }
.wide .hrow + .hrow { border-top-color: rgba(42,38,34,.18); }
.wide .hrow .name { color: #2A2622; }
.wide .hrow .when { color: rgba(42,38,34,.7); }
.wide .hrow .rating-stars { color: #6b4f17; }

/* ============================================================
   Home tab changes (2025 UI refresh)
   ============================================================ */

/* Profile button — upscale rounded pill, white background */
.home-profile-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 2px solid var(--gold);
  color: var(--gold); border-radius: 999px; padding: 6px 22px;
  font-family: var(--serif); font-size: 1.25rem; font-weight: 600;
  cursor: pointer; transition: background .18s, box-shadow .18s;
  box-shadow: 0 2px 10px rgba(194,146,46,.18);
}
.home-profile-btn:hover { background: rgba(255,255,255,.88); box-shadow: 0 4px 16px rgba(194,146,46,.28); }
[data-theme=dark] .home-profile-btn { background: #2e2720; }

/* Quick-rating button on day cards */
.cf-rate-btn {
  background: none; border: none; font-size: .8rem; font-weight: 600;
  color: var(--gold); white-space: nowrap; cursor: pointer; padding: 2px 4px;
  border-radius: 6px; transition: background .15s;
}
.cf-rate-btn:hover { background: rgba(194,146,46,.18); }
.cf-rate-btn.cf-dim { color: rgba(255,255,255,.6); }

/* Gap between calendar and recommendation */
.cal-card { margin-bottom: 12px; }

/* Chef Request section */
.chef-req-row { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.chef-req-btn {
  flex: 1; min-width: 0; background: var(--surface); border: 1.5px solid var(--gold);
  color: var(--gold); border-radius: 14px; padding: 11px 14px;
  font-family: var(--serif); font-size: .92rem; font-weight: 600;
  cursor: pointer; transition: background .18s, box-shadow .18s;
  box-shadow: 0 2px 10px rgba(194,146,46,.12); white-space: nowrap;
}
.chef-req-btn:hover { background: rgba(194,146,46,.1); box-shadow: 0 4px 16px rgba(194,146,46,.22); }
.chef-req-cards { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.chef-req-cards::-webkit-scrollbar { display: none; }
.chef-req-card {
  flex: 0 0 150px; scroll-snap-align: start; background: var(--surface);
  border: 1px solid var(--hairline); border-radius: 12px; padding: 10px 12px;
  cursor: pointer; transition: box-shadow .15s;
}
.chef-req-card:hover { box-shadow: var(--shadow); }
.req-card-who { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--gold); margin-bottom: 4px; }
.req-card-text { font-size: .85rem; line-height: 1.3; color: var(--text); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.req-card-actions { display: flex; gap: 4px; margin-top: 6px; }

/* Rating modal — larger heart/make-again */
.heart-large { font-size: 1.25rem; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 10px 0; }
.heart-large input[type=checkbox] { width: 22px; height: 22px; accent-color: #e85454; cursor: pointer; }

/* Recipe page top actions — sticky so Cook Mode stays visible while scrolling */
.recipe-top-actions {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--bg);
  display: flex; align-items: center; gap: 6px; flex-wrap: nowrap;
  padding: 10px 0 8px; margin: 8px 0 4px;
  border-bottom: 1px solid var(--hairline);
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.recipe-top-actions::-webkit-scrollbar { display: none; }
.recipe-top-actions .btn {
  padding: 9px 13px; font-size: .85rem; white-space: nowrap; flex: 0 0 auto;
}
/* Gold/upscale primary buttons on recipe page */
.recipe-top-actions .btn-primary {
  background: var(--gold); color: #1C1815; border: none;
  font-weight: 700; letter-spacing: .02em;
  box-shadow: 0 2px 10px rgba(194,146,46,.3);
}
.recipe-top-actions .btn-primary:hover { filter: brightness(1.07); box-shadow: 0 4px 16px rgba(194,146,46,.45); }

/* Pin page: prevent double-tap zoom */
.keypad { touch-action: manipulation; }
.key { touch-action: manipulation; }

/* Library sticky header — keep below status bar on iPhone/Android homescreen */
.lib-sticky-header { top: env(safe-area-inset-top, 0px) !important; }

/* Library hamburger — always visible */
.ham-btn { font-size: 1.1rem; padding: 6px 13px; border-radius: 10px; }

/* Filter panel divider + mode items */
.fp-divider { border-top: 1px solid var(--hairline); margin: 6px 0; }
.fp-cat-mode { font-style: italic; }

/* Shopping tab layout */
.shop-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.shop-clear-btn { display: block; width: 100%; margin-top: 24px; }

/* Upscale undo button */
.shop-undo-btn {
  font-family: var(--serif); font-size: .88rem; font-weight: 600;
  padding: 8px 18px; border-radius: 999px;
  border: 1.5px solid var(--gold); background: transparent; color: var(--gold);
  cursor: pointer; letter-spacing: .02em;
  transition: background .15s, color .15s, box-shadow .15s;
  box-shadow: 0 1px 6px rgba(194,146,46,.12);
}
.shop-undo-btn:hover:not(:disabled) { background: var(--gold); color: #1C1815; box-shadow: 0 3px 12px rgba(194,146,46,.3); }
.shop-undo-btn:disabled { opacity: .35; cursor: default; border-color: var(--hairline); color: var(--muted); box-shadow: none; }

/* Shopping collapsible categories */
.shop-section { margin-bottom: 4px; }
.shop-section-head {
  width: 100%; text-align: left; background: none; border: none;
  border-bottom: 1px solid var(--hairline); padding: 10px 0 8px;
  font-weight: 600; font-size: .9rem; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); cursor: pointer; display: flex; justify-content: space-between; align-items: center;
}
/* More visible category drop-down caret */
.shop-caret {
  font-size: 1.05rem; line-height: 1; color: var(--gold);
  width: 1.4em; height: 1.4em; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--surface2);
}

/* Per-ingredient recipe marker + inline note on the shopping list */
.shop-recipe {
  display: inline-block; font-size: .68rem; line-height: 1.4; vertical-align: middle;
  background: var(--surface2); color: var(--muted);
  border-radius: 999px; padding: 1px 8px; margin-left: 6px;
}
.shop-note {
  display: block; font-size: .76rem; color: var(--muted); font-style: italic; margin-top: 2px;
}

/* Home calendar card Fam / Pers view buttons */
.cal-foot { display: flex; justify-content: space-between; margin-top: 8px; }
.cal-view-btns { display: flex; gap: 6px; }
.cal-view-btn {
  font-size: .72rem; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--hairline); background: var(--surface2); color: var(--text); cursor: pointer;
}
.cal-view-btn.off { opacity: .45; }
.cal-view-btn.on { background: var(--gold); color: #1C1815; font-weight: 600; border-color: var(--gold); }

/* Numbered steps in the edit form */
#steps { counter-reset: stepnum; }
#steps .review-row.step { counter-increment: stepnum; position: relative; }
#steps .review-row.step::before {
  content: counter(stepnum); position: absolute; left: -22px; top: 8px;
  font-weight: 700; color: var(--gold); font-size: .85rem;
}

/* Note -> step assignment box (edit form) */
.note-row { display: flex; align-items: flex-start; gap: 8px; }
.note-step-box {
  flex: 0 0 auto; min-width: 54px; height: 30px; padding: 0 8px;
  border: 1px solid var(--hairline); border-radius: 6px; background: var(--surface2);
  color: var(--text); cursor: pointer; font-size: .78rem;
}

/* Request states */
.req-granted-tag { font-size: .72rem; color: var(--gold); font-weight: 600; }
.req-card-pending { font-style: italic; color: var(--muted); }
.req-card-recipe { display: flex; align-items: center; gap: 8px; }
.req-card-thumb { width: 38px; height: 38px; border-radius: 6px; background-size: cover; background-position: center; flex: 0 0 auto; }
.req-card-thumb-ph { background: var(--surface2); }
.pick-taken { color: var(--gold); font-size: .8rem; }

/* Cook-mode multi-recipe tabs */
.cook-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.cook-tab {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--hairline);
  background: var(--surface2); color: var(--text); cursor: pointer; font-size: .85rem; white-space: nowrap;
}
.cook-tab.on { background: var(--gold); color: #1C1815; font-weight: 600; border-color: var(--gold); }
.cook-tab .cook-tab-x { font-size: .72rem; font-weight: 700; color: #1C1815; border: 1px solid #1C1815; border-radius: 6px; padding: 0 5px; opacity: 1; }
.cook-tab .cook-tab-x:hover { background: #1C1815; color: #fff; }
.cook-tab-add { font-size: 1.1rem; font-weight: 700; padding: 6px 12px; flex: 0 0 auto; }
.cook-scaler { margin: 8px 0; }
.cook-note-btn {
  display: inline-block; margin-top: 6px; font-size: .78rem; padding: 3px 10px;
  border: 1px solid var(--hairline); border-radius: 999px; background: var(--surface2);
  color: var(--text); cursor: pointer;
}
.cook-note-text {
  margin-top: 6px; font-size: .85rem; color: var(--muted); font-style: italic;
  border-left: 2px solid var(--gold); padding-left: 8px;
}
.shop-section-body { margin: 0; padding: 0; list-style: none; }
.shop-section-body.collapsed { display: none; }

/* Shopping row — swipe to delete (wrapper approach) */
.shop-row { position: relative; overflow: hidden; border-bottom: 1px solid var(--hairline); }
.shop-swipe-wrap {
  display: flex;
  /* 100% container + 72px delete zone — overflow hidden on .shop-row clips the button */
  width: calc(100% + 72px);
  transition: transform .22s ease;
}
.shop-row.swiped .shop-swipe-wrap { transform: translateX(-72px); }
.shop-row-inner {
  flex: 1; min-width: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; transition: transform .2s ease; gap: 8px;
}
.shop-label { display: flex; align-items: center; gap: 8px; flex: 1; cursor: pointer; min-width: 0; }
.shop-name { line-height: 1.3; min-width: 0; flex: 1 1 auto; white-space: nowrap; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.shop-name::-webkit-scrollbar { display: none; }
.shop-del-btn {
  width: 72px; flex-shrink: 0;
  background: #e53935; color: #fff; border: none;
  font-weight: 700; font-size: .82rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  /* Hidden until swiped — belt + suspenders for iOS Safari */
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
.shop-row.swiped .shop-del-btn { opacity: 1; pointer-events: auto; }

/* Shopping manual-item avatar */
.shop-avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--gold);
  color: #1C1815; font-size: .7rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Cook Mode ingredient group labels */
.ing-group-label {
  list-style: none; font-weight: 700; font-size: .78rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--gold); padding: 12px 0 4px; margin-top: 4px;
  border-top: 1px solid var(--hairline);
}
.ing-group-label:first-child { border-top: none; padding-top: 4px; }

/* Plan tab — text-only minimal action buttons */
.cal-text-btn {
  background: none; border: none; cursor: pointer;
  color: var(--gold); font-size: .78rem; font-weight: 600;
  padding: 2px 0; line-height: 1.4; text-align: left;
}
.cal-text-btn.muted { color: var(--muted); }
.cal-text-btn:hover { text-decoration: underline; }

/* Calendar — No Menu placeholder */
.cf-no-menu { font-size: .78rem; opacity: .55; font-style: italic; }

/* +Recipe shortcut button in chef request row — same size as Make request button */
.chef-req-btn-secondary {
  flex: 0 0 auto; background: var(--bg); border: 1.5px solid var(--gold);
  color: var(--gold); border-radius: 14px; padding: 11px 14px;
  font-family: var(--serif); font-size: .78rem; font-weight: 600;
  cursor: pointer; transition: background .18s, box-shadow .18s;
  box-shadow: 0 2px 10px rgba(194,146,46,.12); white-space: nowrap;
}
.chef-req-btn-secondary:hover { background: rgba(194,146,46,.1); }

/* Combined outer card wrapping the whole request section */
.chef-req-card-outer {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 22px; box-shadow: var(--shadow);
  padding: 14px 14px 10px; margin: 12px 0;
}

/* Button row inside the combined card */
.chef-req-btn-row { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; margin-bottom: 12px; }

/* 4-cards-visible carousel */
.chef-req-cards-4 {
  display: grid;
  /* 4 equal columns that fit the container */
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
@media (max-width: 500px) { .chef-req-cards-4 { grid-template-columns: repeat(2, 1fr); } }

/* Small inline edit button on request cards */
.req-edit-btn {
  font-size: .68rem; padding: 1px 7px; border-radius: 999px;
  border: 1px solid var(--hairline); background: var(--bg);
  color: var(--muted); cursor: pointer; white-space: nowrap;
}
.req-edit-btn:hover { border-color: var(--gold); color: var(--gold); }

/* Izzy invitation scroll */
.izzy-invite-overlay { background: rgba(20,16,12,.72) !important; }
.izzy-scroll-wrap { display: flex; align-items: center; justify-content: center; padding: 24px; }
.izzy-scroll {
  background: linear-gradient(160deg, #fdf6e3 0%, #f5e9c9 100%);
  border: 2px solid #c9a84c; border-radius: 6px 6px 8px 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,.5), inset 0 0 30px rgba(201,168,76,.12);
  padding: 40px 36px 32px; text-align: center; max-width: 340px; width: 100%;
  position: relative;
}
.izzy-scroll::before, .izzy-scroll::after {
  content: ""; position: absolute; left: -6px; right: -6px;
  height: 26px;
  background: linear-gradient(to bottom,
    #e8c86a 0%, #c9a84c 18%, #8a5e20 45%, #c9a84c 72%, #ddb85a 88%, #b08030 100%);
  box-shadow: 0 4px 14px rgba(0,0,0,.5), inset 0 2px 4px rgba(255,220,120,.4), inset 0 -2px 4px rgba(0,0,0,.25);
}
/* top roller: wavy bottom edge faces the parchment */
.izzy-scroll::before {
  top: -13px;
  clip-path: polygon(
    0% 0%, 100% 0%,
    100% 60%, 93% 100%, 87% 60%, 80% 100%, 73% 60%, 67% 100%,
    60% 60%, 53% 100%, 47% 60%, 40% 100%, 33% 60%, 27% 100%,
    20% 60%, 13% 100%, 7% 60%, 0% 100%
  );
}
/* bottom roller: wavy top edge faces the parchment */
.izzy-scroll::after {
  bottom: -13px;
  clip-path: polygon(
    0% 100%, 100% 100%,
    100% 40%, 93% 0%, 87% 40%, 80% 0%, 73% 40%, 67% 0%,
    60% 40%, 53% 0%, 47% 40%, 40% 0%, 33% 40%, 27% 0%,
    20% 40%, 13% 0%, 7% 40%, 0% 0%
  );
}
.izzy-scroll-dear {
  font-family: Georgia, serif; font-size: 1.45rem; font-weight: bold;
  color: #7a5218; margin: 0 0 14px; letter-spacing: .06em;
  font-style: italic;
}
.izzy-scroll-text {
  font-family: Georgia, serif; font-size: 1rem; font-weight: bold;
  font-style: italic; color: #7a5218; letter-spacing: .04em;
  line-height: 1.6; margin: 0 0 6px;
}
.izzy-scroll-title {
  font-family: Georgia, serif; font-size: 1.45rem; font-weight: bold;
  color: #7a5218; margin: 16px 0 24px; letter-spacing: .06em;
  font-style: italic;
}
.izzy-scroll-btn {
  background: #7a5218; border: none; color: #fdf6e3;
  font-family: Georgia, serif; font-size: .95rem; letter-spacing: .04em;
  padding: 12px 32px; border-radius: 999px; cursor: pointer;
  box-shadow: 0 2px 10px rgba(122,82,24,.4);
}
.izzy-scroll-btn:hover { background: #9a6a28; }

/* ============================================================
   changes2.md — visual additions
   ============================================================ */

/* Home: "Chef Mary on break" in gold on no-menu days */
.cf-break { color: var(--gold); font-weight: 600; font-style: normal; opacity: 1; font-size: .8rem; }
/* Home calendar event label: gold, no icon */
.cf-event { color: var(--gold); font-weight: 600; }

/* Upscale file-picker button (hides the native input) */
.file-input-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.file-btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--gold);
  color: var(--gold); background: var(--surface); font-family: var(--serif);
  font-weight: 600; font-size: .85rem; transition: background .18s, box-shadow .18s;
  box-shadow: 0 2px 10px rgba(194,146,46,.12);
}
.file-btn:hover { background: rgba(194,146,46,.1); box-shadow: 0 4px 16px rgba(194,146,46,.22); }

/* Recipes filter panel: Cuisine collapsible group */
.fp-cuisine-head { display: flex; align-items: center; justify-content: space-between; font-weight: 600; }
.fp-caret { color: var(--gold); font-size: .85rem; }
.fp-cat-sub { padding-left: 26px; font-size: .92rem; opacity: .9; }

/* Manual-add reference link */
.ref-link { color: var(--gold); text-decoration: underline; word-break: break-all; }

/* Cook mode: ingredients header row with inline serving control */
.cook-ings-headrow {
  position: sticky; top: 0; z-index: 3; background: var(--surface);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.cook-ings-headrow .cook-ings-head { position: static; flex: 0 0 auto; padding: 10px 0; }
.cook-scaler { margin: 0; flex: 0 0 auto; }

/* Cook mode: two-column steps (number + note on the left, text on the right) */
.cook-step-list { list-style: none; margin: 0; padding: 0; }
.cook-step-list li.cook-step { display: flex; gap: 14px; padding: 0 0 26px; font-size: 1.4rem; line-height: 1.5; }
.cook-step-list li.cook-step::before { display: none; content: none; }
.cook-step-left { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cook-step-no {
  width: 34px; height: 34px; border-radius: 999px; background: var(--gold); color: #1C1815;
  display: flex; align-items: center; justify-content: center; font-size: 1.05rem; font-weight: 700;
}
.cook-step-body { flex: 1 1 auto; }
/* Inline duration buttons inside a cook step ("steam 20 min" -> the duration is a button) */
.cook-dur { font: inherit; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer;
  display: inline; vertical-align: baseline; line-height: 1.4;
  color: var(--gold); background: rgba(194,146,46,.12);
  border: 1px solid var(--gold); border-radius: 8px; padding: 0 7px; }
.cook-dur:hover { background: rgba(194,146,46,.24); }
.cook-dur.running { background: var(--gold); color: #1C1815; }
.cook-dur.paused { opacity: .75; }
.cook-dur.done { background: #2e7d32; border-color: #2e7d32; color: #fff; }

/* Cook mode tabs: info (number on top, name beneath) on the left, Close on the right */
.cook-tab { align-items: center; gap: 10px; line-height: 1.1; }
.cook-tab-info { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.cook-tab-num { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .95rem; }
.cook-tab-name { font-size: .7rem; opacity: .8; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Shopping: sticky action bar (Add + Undo) — pinned to the top below the safe
   area, above the status-bar cover (z-20), so it stays visible while scrolling. */
.shop-nextweek-toggle { display: flex; align-items: center; gap: 7px; margin: 2px 0 10px;
  font-size: .85rem; color: var(--muted); cursor: pointer; }
.shop-nextweek-toggle input { width: 15px; height: 15px; accent-color: var(--gold); }
.shop-actionbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 22; background: var(--bg);
  display: flex; align-items: center; gap: 10px; padding: 8px 0; margin-top: 0;
  box-shadow: 0 4px 8px -6px rgba(0,0,0,.3);
}
.shop-actionbar #addBtn { flex: 1 1 auto; }
.shop-actionbar .shop-undo-btn { flex: 0 0 auto; }

/* Shopping: category Show more / Hide control replaces the caret */
.shop-section-head .shop-caret { font-size: .8rem; color: var(--gold); background: none; width: auto; height: auto; border-radius: 0; }

/* Shopping: recipe numbers (legend chip + per-item, right-aligned) */
.shop-recipe-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 4px; margin-right: 4px;
  background: var(--gold); color: #1C1815; border-radius: 999px; font-size: .72rem; font-weight: 700;
}
.shop-recipe-nums { flex: 0 0 auto; color: var(--muted); font-size: .8rem; font-weight: 600; white-space: nowrap; text-align: right; }
.shop-label { flex: 1 1 auto; min-width: 0; }
/* Tighter row spacing; leave room on the right for the (absolutely-placed) number */
.shop-row-inner { display: flex; align-items: center; padding: 2px 0; padding-right: 40px; }
.shop-name { line-height: 1.25; }
/* Hide the recipe-number overlay while the row is swiped so it doesn't sit on the delete button */
.shop-row.swiped .shop-right { display: none; }
/* The recipe number / adder initial is positioned against .shop-row so it ignores
   the swipe-to-delete layout and lands flush at the real right edge, under "Hide". */
.shop-right {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
}
.shop-avatar { flex: 0 0 auto; }
/* Match the section header's right edge to the rows' right edge (no insets) */
.shop-section-head, .shop-section-body { padding-right: 0; }

/* Izzy: Hogwarts / Slytherin acceptance letter */
.izzy-letter-wrap { display: flex; align-items: center; justify-content: center; padding: 24px; }
.izzy-letter {
  background: linear-gradient(160deg, #f3ecd8 0%, #e7dabb 100%);
  border: 2px solid #2a5d3a; border-radius: 6px;
  box-shadow: 0 10px 44px rgba(0,0,0,.55), inset 0 0 28px rgba(42,93,58,.12);
  padding: 30px 30px 26px; text-align: center; max-width: 360px; width: 100%;
  color: #23351f; font-family: Georgia, serif;
}
.izzy-crest { font-size: 2.4rem; margin-bottom: 6px; }
.izzy-letter-house { font-size: .82rem; letter-spacing: .12em; font-weight: 700; color: #1f3a28; margin: 0; }
.izzy-letter-sub { font-size: 1.05rem; letter-spacing: .08em; color: #2a5d3a; font-weight: 700; margin: 2px 0 0; }
.izzy-letter-rule { border: none; border-top: 1px solid #2a5d3a55; margin: 14px 0; }
.izzy-letter-dear { text-align: left; font-style: italic; margin: 0 0 10px; }
.izzy-letter-text { text-align: left; font-size: .95rem; line-height: 1.5; margin: 0 0 12px; }
.izzy-letter-sign { text-align: left; margin: 14px 0 0; font-style: italic; }
.izzy-letter-name { text-align: left; margin: 2px 0 18px; font-weight: 700; color: #2a5d3a; }
.izzy-letter .izzy-scroll-btn { background: #2a5d3a; box-shadow: 0 2px 10px rgba(42,93,58,.4); }
.izzy-letter .izzy-scroll-btn:hover { background: #357049; }

/* ============================================================
   changes3.md — visual additions
   ============================================================ */

/* Slytherin crest image: fixed, responsive size so it never renders too big/small */
.izzy-crest { display: flex; justify-content: center; margin-bottom: 8px; }
.izzy-crest img { height: 72px; width: auto; max-width: 45%; object-fit: contain; }
@media (max-width: 420px) { .izzy-crest img { height: 60px; } }

/* History & Ratings: true half-filled stars */
.stars-vis { position: relative; display: inline-block; white-space: nowrap; line-height: 1; }
.stars-vis-bg { color: var(--hairline); }
.stars-vis-fg { position: absolute; left: 0; top: 0; overflow: hidden; color: var(--gold); white-space: nowrap; }

/* Home: chef-request buttons without a surrounding card, tight spacing */
.chef-req-bare { margin: 8px 0 12px; }
.chef-req-bare .chef-req-btn-row { margin-bottom: 10px; }

/* Parsed-URL request cards: big image with the title overlaid (like Waiter's Rec) */
.chef-req-card .req-rcard { width: 100%; }
.chef-req-card .req-rcard .rcard-img { aspect-ratio: 4 / 3; min-height: 0; }
.chef-req-card:has(.req-rcard) { padding: 0; border: none; background: none; box-shadow: none; }
.chef-req-card.req-textonly { padding: 0; border: none; background: none; box-shadow: none; }
.chef-req-card.req-textonly .req-card-textbox { background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; padding: 10px 12px; aspect-ratio: 4 / 3; overflow: hidden; display: flex; }
.chef-req-cards-scroll { display: flex; grid-template-columns: none; overflow-x: auto; gap: 8px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.chef-req-cards-scroll::-webkit-scrollbar { height: 0; }
.chef-req-cards-scroll > * { flex: 0 0 46%; max-width: 180px; scroll-snap-align: start; }
.req-swipe-hint { text-align: center; font-size: .72rem; color: var(--muted, #8a7a64); margin-top: 2px; letter-spacing: .04em; }

/* Filter panel: Cuisine More/Less control */
.fp-cuisine-head .fp-caret { color: var(--gold); font-size: .8rem; font-weight: 600; }

/* Cook mode: keep the serving control on-screen next to Ingredients */
.cook-ings-headrow { flex-wrap: nowrap; max-width: 100%; box-sizing: border-box; }
.cook-ings-headrow .cook-ings-head { flex: 1 1 auto; }
.cook-ings-headrow .cook-scaler { flex: 0 0 auto; }
.cook-scaler { flex: 0 1 auto; }
/* Remove the gap above the sticky Ingredients header (text was peeking through) */
.cook-ings { padding-top: 0; }
.cook-ings-headrow { padding-top: 8px; }

/* Cook mode: "Note" label beneath the note icon */
.cook-note-btn { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; line-height: 1; }
.cook-note-lbl { font-size: .6rem; letter-spacing: .02em; }

/* Shopping: keep recipe legend names on one line */
.recipe-toggles .cat-chip { white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }

/* ============================================================
   Request cards (one per profile) + cook resize + smaller scaler
   ============================================================ */
.req-profile-card { display: flex; flex-direction: column; gap: 4px; }
.req-line-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.req-line { font-size: .85rem; line-height: 1.35; color: var(--text); padding: 4px 0; border-top: 1px solid var(--hairline); }
.req-line:first-child { border-top: none; }
.req-line.editable { cursor: pointer; }
.req-line.editable:hover { color: var(--gold); }

/* Cook mode: visible drag bar (sibling below the ingredients pane) to resize it */
.cook-ings-resize {
  flex: 0 0 auto; height: 16px; cursor: ns-resize; touch-action: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border-bottom: 1px solid var(--hairline);
}
.cook-ings-resize::before {
  content: ""; width: 44px; height: 4px; border-radius: 999px; background: var(--muted); opacity: .55;
}
.cook-ings.collapsed + .cook-ings-resize { display: none; }

/* Cook mode: narrow serving control, number sized like the "servings" text */
.cook-scaler { font-size: .95rem; gap: 4px; padding: 2px 5px; }
.cook-scaler .val { min-width: 0; padding: 0 2px; font-size: .95rem; }
.cook-scaler button { width: 26px; height: 26px; font-size: .95rem; }

/* Cook mode: trim empty space under the Exit bar / recipe tabs */
.cook-bar { padding-top: max(8px, calc(6px + env(safe-area-inset-top, 0px))); padding-bottom: 6px; gap: 10px; }
.cook-tabs { padding-bottom: 0; }

/* Settings: compact "More" chip beside Profiles (hug the text) */
#profToggle { align-self: center; height: auto; min-height: 0; padding: 2px 10px; line-height: 1; font-size: .75rem; }

/* Dark-mode-safe stars for History & Ratings: outline each glyph so they're
   legible on any background; empty layer a touch more visible, filled stays gold. */
.stars-vis-bg { color: rgba(150, 150, 150, .55); }
.stars-vis-fg { color: #ffd95a; } /* lighter yellow for History & Ratings */
.stars-vis-bg, .stars-vis-fg { -webkit-text-stroke: 0.7px #000; }

/* Print: show only the recipe content cleanly on paper/PDF */
@media print {
  .tabbar, .net-status, .toast, .recipe-top-actions, .ladd, .card-plan, .rcard-add,
  #requests, .lib-sticky-header, .scaler, #ratingsBlock { display: none !important; }
  body, .app { background: #fff !important; color: #000 !important; }
  .hero { max-height: 240px; }
  .two-col { display: block !important; }
  a[href]::after { content: ""; }
}

/* Event (blackout) plan chip with a photo */
.plan-chip.has-photo {
  background-size: cover; background-position: center; color: #fff; min-height: 38px;
  display: flex; align-items: flex-end; text-shadow: 0 1px 3px rgba(0,0,0,.7);
}
.plan-chip.has-photo .plan-chip-label { font-weight: 600; }

/* Network/save status pill */
.net-status {
  position: fixed; bottom: 78px; left: 50%; transform: translateX(-50%);
  z-index: 60; font-size: .78rem; font-weight: 600; padding: 5px 12px;
  border-radius: 999px; box-shadow: var(--shadow); pointer-events: none;
  background: var(--surface); color: var(--muted); border: 1px solid var(--hairline);
}
.net-status.net-saving { color: #8a6d1f; }
.net-status.net-saved { color: #2a7d46; }
.net-status.net-offline { color: #fff; background: #b3261e; border-color: #b3261e; }

/* ============================================================
   Scale: load-more list + category "More" tile
   ============================================================ */
.load-more { display: block; width: 100%; margin: 14px 0 4px; }
.cat-card-more { display: flex; align-items: center; justify-content: center;
  background: var(--surface2); border: 1px dashed var(--hairline); }
.cat-card-more .cat-cc { position: static; text-align: center; }
.cat-card-more .cat-cn { color: var(--gold); }

/* Shopping: gold-outlined "Add an item" button */
.shop-add-gold { border: 1px solid var(--gold); color: #1C1815; }
.shop-row.row-hidden, .shop-section.row-hidden { display: none; }
.shop-add-gold:hover { background: var(--gold); color: #1C1815; }

/* Recipe: servings row holds the scaler + Print together (normal flow, scrolls away) */
.serv-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }

/* ---- Cook Mode timers ---- */
/* ---- Right-edge half-circle timer rail + per-timer popover ---- */
.cook-rail { position: fixed; right: 0; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 12px; z-index: 40; }
.cook-half { position: relative; width: 46px; height: 64px; border: none; padding: 0;
  background: transparent; cursor: pointer; display: block; }
.cook-half .ch-cap { position: absolute; inset: 0; background: var(--gold); color: #1C1815;
  border-top-left-radius: 64px; border-bottom-left-radius: 64px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding-left: 6px; }
.cook-half.paused .ch-cap { background: var(--surface); color: var(--gold); border: 1px solid var(--gold); border-right: none; }
.cook-half.done .ch-cap { background: #2e7d32; color: #fff; animation: chPulse 1s infinite; }
@keyframes chPulse { 50% { filter: brightness(1.3); } }
.cook-half .ch-step { font-weight: 800; font-size: 1.05rem; line-height: 1; }
.cook-half .ch-clock { font-size: .62rem; font-variant-numeric: tabular-nums; margin-top: 2px; opacity: .9; }

.cook-tpop { position: fixed; right: 58px; z-index: 41; width: 240px; padding: 14px;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px; box-shadow: var(--shadow); }
.cook-tpop[hidden] { display: none; }
.tpop-head { font-family: var(--serif); font-size: 1.02rem; margin-bottom: 8px; }
.tpop-clock { font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; margin-bottom: 10px; }
.tpop-adj { display: flex; gap: 6px; margin-bottom: 12px; }
.tpop-adj button { flex: 1; border-radius: 8px; border: 1px solid var(--hairline); background: var(--bg);
  color: var(--text); padding: 6px 0; font-size: .74rem; cursor: pointer; font-variant-numeric: tabular-nums; }
.tpop-adj button:hover { border-color: var(--gold); }
.tpop-row { display: flex; gap: 8px; }
.tpop-row + .tpop-row { margin-top: 8px; }
.tpop-btn { flex: 1; border-radius: 999px; border: 1px solid var(--hairline); background: var(--bg);
  color: var(--text); padding: 7px 0; font-size: .85rem; cursor: pointer; }
.tpop-btn:hover { border-color: var(--gold); }
.tpop-btn.primary { background: var(--gold); color: #1C1815; border-color: var(--gold); }
.tpop-btn.danger { color: #e57373; border-color: #e57373; }
.tpop-edit { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.tpop-num { width: 46px; flex: 0 0 auto; padding: 6px 4px; text-align: center; }
.tpop-edit .tpop-btn { flex: 0 0 auto; width: 46px; padding: 6px 0; } /* Set matches the min/sec boxes */
.tpop-hint { font-size: .68rem; color: var(--muted); margin-top: 10px; text-align: center; }


/* Home calendar — "Also on <day>" extra-recipe strip (multi-recipe days) */
.cal-extra { margin-top: 12px; }
.cal-extra:empty { display: none; }
.cal-extra-label { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 2px 9px; }
.cal-extra-row { display: flex; gap: 10px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
.cal-extra-row::-webkit-scrollbar { display: none; }
.cal-mini-card { position: relative; flex: 0 0 150px; background: var(--bg); border: 1px solid var(--hairline); border-radius: 12px; padding: 10px 12px; cursor: pointer; overflow: hidden; background-size: cover; background-position: center; transition: box-shadow .15s; }
.cal-mini-card.photo { min-height: 104px; display: flex; flex-direction: column; justify-content: flex-end; border-color: rgba(255,255,255,.1); }
.cmc-grad { display: none; }
.cal-mini-card.photo .cmc-grad { display: block; position: absolute; inset: 0; background: linear-gradient(to top, rgba(12,9,6,.92) 0%, rgba(12,9,6,.3) 60%, rgba(12,9,6,.05) 100%); }
.cmc-body { position: relative; }
.cal-mini-card.photo .cmc-title { color: #fff; }
.cal-mini-card.photo .cmc-eyebrow { color: #E2B65C; }
.cal-mini-card.photo .cmc-rate { border-color: rgba(255,255,255,.35); color: #E2B65C; }
.cal-mini-card:hover { box-shadow: var(--shadow); }
.cmc-eyebrow { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--gold); margin-bottom: 4px; }
.cmc-title { font-family: var(--serif); font-size: .95rem; line-height: 1.2; color: var(--text); }
.cmc-actions { display: flex; gap: 6px; margin-top: 8px; }
.cmc-cook { background: var(--gold); color: #1C1815; border: none; border-radius: 999px; padding: 4px 12px; font-weight: 600; font-size: .72rem; cursor: pointer; }
.cmc-rate { background: transparent; color: var(--gold); border: 1px solid var(--hairline); border-radius: 999px; padding: 4px 12px; font-weight: 600; font-size: .72rem; cursor: pointer; }

/* Category filter panel — per-category recipe count badge */
.fp-cat-count { display: inline-block; margin-left: 8px; font-size: .72rem; font-weight: 600; color: var(--muted); }


/* "Make a request to Chef Mary" — larger text, same button height (+Recipe unchanged) */
.chef-req-btn:not(.chef-req-btn-secondary) { font-size: 1.04rem; padding: 10px 14px; }

/* Update-available reload bar (top, only shown when a newer build is deployed) */
.update-bar { position: sticky; top: 0; z-index: 60; width: 100%; text-align: center; background: var(--gold); color: #1C1815; font-weight: 600; font-size: .9rem; padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px; border: none; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.update-bar[hidden] { display: none; }
.update-bar:not([hidden]) { display: block; }
.update-bar:hover { filter: brightness(1.05); }

/* Units toggle — single "Grams" button (gold = grams, plain = volume) */
.unit-toggle { flex: 0 0 auto; background: none; border: 1px solid var(--gold); color: var(--gold); border-radius: 999px; padding: 5px 12px; font-size: .8rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.unit-toggle.on { background: var(--gold); color: #1C1815; }
.ing-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 32px 0 14px; }


/* ---- Restaurant visits (Group F) ---- */
.plan-chip.restaurant { border-left: 3px solid var(--gold); cursor: pointer; }
.visit-screen { max-width: 720px; margin: 0 auto; }
.visit-head { margin-top: 6px; }
.visit-head h1 { margin: 0; }
.visit-head-actions { display: flex; gap: 8px; margin: 6px 0 14px; }
.dish-card { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--hairline); border-radius: 14px; margin-bottom: 12px; }
.dish-photo { flex: 0 0 96px; width: 96px; height: 96px; border-radius: 10px; background-size: cover; background-position: center; background-color: rgba(0,0,0,0.06); }
.dish-body { flex: 1; min-width: 0; }
.dish-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dish-ratings { margin: 6px 0; display: flex; flex-direction: column; gap: 3px; }
.dish-rating-row { font-size: .85rem; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.dish-rating-row .who { font-weight: 600; }
.dish-cmt { font-style: italic; opacity: .8; }
.dish-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

/* ---------- Restaurants ---------- */
/* Mini-card count badge, centred in the calendar foot between Family/Personal */
/* Mini-card count shown as a row of dots, centred between Family/Personal */
.mini-count { align-self: center; display: inline-flex; align-items: center; gap: 5px; }
.mc-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); display: inline-block; }

/* Section label with a trailing action button (e.g. Restaurants -> View all) */
.section-label-row { justify-content: space-between; }
.section-label-row::after { display: none; }
.mini-link-btn {
  background: none; border: none; color: var(--gold); font-weight: 600;
  font-size: .72rem; letter-spacing: .06em; cursor: pointer; padding: 0;
  text-transform: none;
}
.mini-link-btn:hover { text-decoration: underline; }

/* Home card: horizontal row of restaurant cards + a "show all" tile */
.restaurant-row { display: flex; gap: 10px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.restaurant-row::-webkit-scrollbar { display: none; }
.restaurant-row .restaurant-card { flex: 0 0 64%; max-width: 240px; scroll-snap-align: start; }

.restaurant-card {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px;
  padding: 14px; cursor: pointer; transition: border-color .15s, transform .15s;
}
.restaurant-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.rc-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.rc-name { font-family: var(--serif); font-size: 1.05rem; font-weight: 600; }
.rc-sub { font-size: .8rem; margin-top: 4px; }
.restaurant-card-all { display: flex; align-items: center; justify-content: center; }
.rc-all-label { color: var(--gold); font-weight: 600; font-size: .9rem; }

/* List screen */
.restaurants-screen .fchips { display: flex; gap: 8px; margin: 10px 0 14px; flex-wrap: wrap; }
.restaurant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }

/* Detail screen */
.restaurant-head h1 { margin-bottom: 2px; }
.rv-visit-card {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 10px; cursor: pointer; transition: border-color .15s;
}
.rv-visit-card:hover { border-color: var(--gold); }
.rv-visit-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.rv-visit-ratings { display: flex; flex-direction: column; gap: 3px; }
.rv-visit-dishes { font-size: .82rem; margin-top: 6px; }

/* Visit-level rating block on the visit screen */
.visit-rating-card {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px;
  padding: 12px 14px; margin: 12px 0;
}
.vr-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.vr-rows { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }

/* Restaurant autocomplete suggestions in the add-visit modal */
.rv-suggest { display: flex; flex-direction: column; margin-top: 4px; }
.rv-suggest-item {
  text-align: left; background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 8px; padding: 8px 10px; margin-top: 4px; cursor: pointer; color: var(--text);
}
.rv-suggest-item:hover { border-color: var(--gold); }

/* Labelled rating metric (e.g. "Overall ★★★★☆") on visit + restaurant detail */
.vr-metric { display: inline-flex; align-items: center; gap: 4px; }
.vr-lbl { font-size: .7rem; font-weight: 600; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; }
.dish-rating-row .vr-metric + .vr-metric { margin-left: 8px; }

/* Profile rating block (both screens): name + Overall on row 1, Ambiance +
   Service on row 2. Grid so the Overall and Ambiance stars share a column. */
.vr-row {
  display: grid; grid-template-columns: auto auto 1fr;
  column-gap: 10px; row-gap: 4px; align-items: center; margin-bottom: 10px;
}
.vr-who { font-weight: 600; font-size: .9rem; }
.vr-lbl { font-size: .7rem; font-weight: 600; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; }
.vr-as { display: inline-flex; align-items: center; gap: 8px; }
.vr-spacer { width: 0; }
.vr-full { grid-column: 1 / -1; }

/* Dishes + their ratings shown inline on the restaurant detail visit card */
.rv-visit-dishes-list { margin-top: 10px; }
.rd-dishes-label { font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.rd-dish { padding: 6px 0; border-top: 1px solid var(--hairline); }
.rd-dish-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.rd-dish-name { font-weight: 600; font-size: .9rem; }
.btn-sm { font-size: .82rem; padding: 5px 12px; }
/* ============================================================
   KITCHEN HOME (opt-in alternate Home). All rules scoped under
   .kitchen-root so generic names don't collide with the app.
   Ported from kitchen-ui/kitchen-scene.html; image paths point
   at ./img/kitchen/ with the ?v= cache-buster.
   ============================================================ */
.kitchen-root{--kh-ink:#3a2c20;--kh-paper:#fffdf6;--kh-accent:#c0492f;--kh-accent-d:#9c3a25;
  color:var(--kh-ink);-webkit-tap-highlight-color:transparent}
.kitchen-root *{box-sizing:border-box}
.kitchen-root .stage{position:relative;width:100%;max-width:480px;margin:0 auto;aspect-ratio:768/1341;
  background:#1c130c url('../img/kitchen/kitchen-bg.webp?v=112') center/cover no-repeat;overflow:hidden}
.kitchen-root .hint{position:absolute;top:8px;left:50%;transform:translateX(-50%);z-index:30;
  font-size:11px;letter-spacing:.4px;color:#3a2c20;background:rgba(255,253,246,.82);
  padding:5px 11px;border-radius:20px;white-space:nowrap;box-shadow:0 2px 6px rgba(0,0,0,.3)}
.kitchen-root .hot{position:absolute;cursor:pointer;z-index:10;border-radius:14px;
  background:transparent;border:none;-webkit-appearance:none;appearance:none;-webkit-tap-highlight-color:transparent;
  transition:box-shadow .2s, background .2s;outline:0}
.kitchen-root .hot:hover,.kitchen-root .hot:focus-visible{background:rgba(255,236,180,.16);
  box-shadow:0 0 0 2px rgba(255,221,120,.8), 0 0 24px rgba(255,200,90,.45) inset}
.kitchen-root .hot.rack{left:3.1%;top:12%;width:94.6%;height:15.4%}
.kitchen-root .hot.chef{left:7.9%;top:52.9%;width:30.4%;height:36.3%}
.kitchen-root .hot.book{left:75.3%;top:76.2%;width:23.8%;height:19.2%}
.kitchen-root .hot.restaurant{left:56.8%;top:90.4%;width:16.7%;height:9.5%}
.kitchen-root .hot.shopping{left:74.6%;top:39.9%;width:23.8%;height:4.5%}
.kitchen-root .hot.settings{right:2.4%;top:1.2%;width:11.4%;height:4.3%}
.kitchen-root .hot.planner{left:19%;top:7%;width:26.5%;height:3.8%}
.kitchen-root .hot.shopping,.kitchen-root .hot.planner{background:rgba(28,19,12,.5);border:1.5px solid rgba(255,236,180,.85);border-radius:9px;display:flex;align-items:center;justify-content:center;color:#fff;font-size:12px;font-weight:700;text-shadow:0 1px 3px rgba(0,0,0,.7)}
.kitchen-root .hot.settings{background:rgba(28,19,12,.5);border:1.5px solid rgba(255,236,180,.85);border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff;padding:0}
.kitchen-root .hot.shopping:active,.kitchen-root .hot.planner:active,.kitchen-root .hot.settings:active{background:rgba(192,73,47,.6)}
.kitchen-root .tipdot{position:absolute;width:26px;height:26px;border-radius:50%;background:var(--kh-accent);
  color:#fff;font-size:15px;font-weight:700;display:flex;align-items:center;justify-content:center;
  box-shadow:0 3px 8px rgba(0,0,0,.45);animation:kh-pulse 2.2s ease-in-out infinite;pointer-events:none}
.kitchen-root .hot.rack .tipdot{top:-9px;left:calc(50% - 13px)}
.kitchen-root .hot.chef .tipdot{top:8px;left:8px}
.kitchen-root .hot.book .tipdot{top:-9px;right:-9px;left:auto}
.kitchen-root .hot.restaurant .tipdot{top:-9px;left:calc(50% - 13px)}
@keyframes kh-pulse{0%,100%{transform:scale(1);box-shadow:0 3px 8px rgba(0,0,0,.45)}50%{transform:scale(1.12);box-shadow:0 3px 14px rgba(192,73,47,.7)}}
.kitchen-root .overlay{position:absolute;inset:0;background:rgba(30,20,12,.6);backdrop-filter:blur(3px);
  display:flex;align-items:center;justify-content:center;opacity:0;pointer-events:none;visibility:hidden;
  transition:opacity .3s,visibility .3s;z-index:40;padding:14px}
.kitchen-root .overlay.show{opacity:1;pointer-events:auto;visibility:visible}
.kitchen-root .close{position:absolute;top:10px;right:12px;width:34px;height:34px;border-radius:50%;border:none;
  background:#fff;font-size:18px;cursor:pointer;box-shadow:0 4px 10px rgba(0,0,0,.3);z-index:2}
.kitchen-root .overlay.full{padding:0;align-items:stretch;justify-content:stretch;backdrop-filter:none}
.kitchen-root .chefScene{position:relative;width:100%;height:100%;background:#1c130c url('../img/kitchen/kitchen-bg-chef.webp?v=112') center/cover no-repeat}
.kitchen-root .cfx{position:absolute}
.kitchen-root .cfx.greeting{left:36%;top:70%;width:57.5%}
.kitchen-root .cfx.inputbox{left:2.4%;top:80.2%;width:48.7%}
.kitchen-root .cfx.rackbox{left:9.2%;top:11.8%;width:83.4%;height:13%}
.kitchen-root .cfx.bookbox{left:78.7%;top:59%;width:12.7%;height:12%}
.kitchen-root .cfx.backbox{left:79.9%;top:87.8%;width:20%;height:9%}
.kitchen-root .cfx.restaurantbox{left:56.4%;top:87.8%;width:19.8%;height:9%}
.kitchen-root .navhot{display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:700;color:transparent;
  background:transparent;border:none;border-radius:10px;cursor:pointer;-webkit-appearance:none;appearance:none;
  -webkit-tap-highlight-color:transparent;transition:background .2s,color .2s}
.kitchen-root .navhot:hover,.kitchen-root .navhot:focus-visible{background:rgba(255,236,180,.12);color:#fff;text-shadow:0 1px 3px rgba(0,0,0,.6)}
.kitchen-root .navhot:active{background:rgba(192,73,47,.45);color:#fff}
.kitchen-root .cfx .bubble,.kitchen-root .cfx .chips{margin-bottom:0}
.kitchen-root .bubble{background:#efe7d6;border-radius:14px 14px 14px 4px;padding:9px 12px;font-size:13px;margin-bottom:10px;line-height:1.45}
.kitchen-root .reqinput{display:flex;gap:7px;margin-top:6px}
.kitchen-root .reqinput input{flex:1;border:1.5px solid #d8c9aa;border-radius:12px;padding:10px 12px;font-size:16px;font-family:inherit}
.kitchen-root .reqinput button{border:none;background:var(--kh-accent);color:#fff;border-radius:12px;padding:0 15px;font-weight:700;cursor:pointer}
.kitchen-root .reqinput button:active{background:var(--kh-accent-d)}
.kitchen-root #reqDone{background:#6b5a47}
.kitchen-root .cfx.inputbox.pinned{position:fixed;left:10px;right:10px;width:auto;top:auto;z-index:70}
.kitchen-root .cfx.inputbox.pinned .reqinput{margin:0;background:#fffdf6;padding:8px;border-radius:14px;box-shadow:0 -2px 18px rgba(0,0,0,.45)}
.kitchen-root .rackwrap{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center}
.kitchen-root .rackhead{color:#fff;font-family:Georgia,serif;font-size:18px;letter-spacing:1px;margin-bottom:6px;text-shadow:0 2px 6px rgba(0,0,0,.6)}
.kitchen-root .rackrail{position:relative;width:86%;max-width:460px;height:12px;border-radius:8px;background:linear-gradient(180deg,#c2c7cc,#8e979e);box-shadow:0 3px 7px rgba(0,0,0,.45),inset 0 1px 0 rgba(255,255,255,.6);z-index:3}
.kitchen-root .carstage{position:relative;width:100%;height:300px;display:flex;align-items:flex-start;justify-content:center;margin-top:-6px}
.kitchen-root .carousel{position:relative;width:170px;height:100%;touch-action:pan-y}
.kitchen-root .rticket{position:absolute;top:0;left:0;width:170px;background:#fffdf6;border-radius:4px;padding:30px 16px 20px;box-shadow:0 12px 26px rgba(0,0,0,.4);transition:transform .35s ease,opacity .35s ease;transform-origin:top center;background-image:repeating-linear-gradient(180deg,transparent 0 23px,rgba(0,0,0,.045) 23px 24px)}
.kitchen-root .rclip{position:absolute;top:-13px;left:50%;transform:translateX(-50%);width:18px;height:24px;border-radius:50% 50% 4px 4px;background:linear-gradient(180deg,#e2c14e,#b8902c);box-shadow:0 2px 3px rgba(0,0,0,.35)}
.kitchen-root .rday{font-size:12px;letter-spacing:2px;color:var(--kh-accent);font-weight:700;text-transform:uppercase}
.kitchen-root .rmeal{font-size:21px;font-family:Georgia,serif;margin-top:8px;line-height:1.15}
.kitchen-root .rtag{font-size:12px;color:#8a7a64;margin-top:12px;border-top:1px dashed #d9c8aa;padding-top:8px}
.kitchen-root .carnav{position:absolute;top:38%;z-index:30;width:40px;height:40px;border-radius:50%;border:none;background:rgba(255,253,246,.92);color:var(--kh-ink);font-size:22px;cursor:pointer;box-shadow:0 3px 10px rgba(0,0,0,.4)}
.kitchen-root .carnav.prev{left:6%}
.kitchen-root .carnav.next{right:6%}
.kitchen-root .bookopen{position:relative;width:100%;max-width:420px;height:78%;display:flex;background:#fff;
  border-radius:8px 12px 12px 8px;box-shadow:0 24px 50px rgba(0,0,0,.5);
  transform:rotateX(16deg) scale(.93);transform-origin:bottom;transition:.35s;perspective:1600px}
.kitchen-root .overlay.show .bookopen{transform:rotateX(0) scale(1)}
.kitchen-root .bookcover{position:absolute;inset:0;border-radius:8px 12px 12px 8px;z-index:8;background:linear-gradient(135deg,#8a3420,#c0492f 60%,#9c3a25);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;transform-origin:left center;transform:rotateY(0deg);transition:transform .8s cubic-bezier(.6,.05,.25,1) .15s;backface-visibility:hidden;box-shadow:inset 0 0 0 2px rgba(255,220,150,.25)}
.kitchen-root .bookcover .bctitle{font-family:Georgia,serif;font-style:italic;font-size:30px;color:#f3e0c0}
.kitchen-root .bookcover .bcsub{font-family:Georgia,serif;font-size:11px;letter-spacing:3px;color:#e3b98f}
.kitchen-root .overlay.show .bookcover{transform:rotateY(-168deg)}

/* tab bar is redundant on the kitchen Home (hotspots replace it) */
body.kitchen-home .tabbar { display: none; }
body.kitchen-home #app { padding: 0; }
/* kitchen Home — live request list + rack Cook button */
.kitchen-root .kh-reqlist{margin-top:8px;max-height:120px;overflow:auto;display:flex;flex-direction:column;gap:5px}
.kitchen-root .kh-reqitem{background:rgba(255,253,246,.94);border-radius:10px;padding:6px 10px;font-size:12px;line-height:1.35;color:#3a2c20;box-shadow:0 1px 3px rgba(0,0,0,.2)}
.kitchen-root .kh-reqitem.kh-reqempty{opacity:.75;font-style:italic;box-shadow:none;background:rgba(255,253,246,.7)}
.kitchen-root .rcook{margin-top:12px;border:none;background:var(--kh-accent);color:#fff;border-radius:9px;padding:7px 14px;font-size:12px;font-weight:700;cursor:pointer}
.kitchen-root .rcook:active{background:var(--kh-accent-d)}
/* ===== Kitchen mode: Recipes-as-book ===== */
body.kitchen-mode .book-screen{position:fixed;inset:0;z-index:5;
  background:#e8dcc0 url("../img/kitchen/kitchen-bg-book.webp?v=112") center/100% 100% no-repeat;
  animation:bookIn .5s ease both}
@keyframes bookIn{from{opacity:0;transform:perspective(1200px) rotateY(-14deg) scale(.97)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){body.kitchen-mode .book-screen{animation:none}}
/* index strip across the top of the book (recipe-tab zone) — cookbook page tabs */
body.kitchen-mode .book-index{position:absolute;left:4.7%;top:2.3%;width:91.3%;height:6.2%;
  display:flex;align-items:stretch;gap:3px;z-index:8;overflow-x:auto;overflow-y:hidden;padding-bottom:1px}
body.kitchen-mode .book-index::-webkit-scrollbar{height:0}
body.kitchen-mode .book-index button{flex:0 0 auto;border:none;cursor:pointer;
  font-family:Georgia,"Times New Roman",serif;font-weight:700;font-size:clamp(11px,3vw,14px);
  white-space:nowrap;display:flex;align-items:center;justify-content:center;padding:0 10px;
  border-radius:9px 9px 0 0;color:#4a2c10;
  background:linear-gradient(#f3e4c2,#e1c692);box-shadow:inset 0 -2px 3px rgba(120,80,30,.28),0 1px 2px rgba(0,0,0,.25);
  text-shadow:0 1px 0 rgba(255,255,255,.45)}
body.kitchen-mode .book-index .bx-ham,
body.kitchen-mode .book-index .bx-home{padding:0 9px;font-size:15px}
body.kitchen-mode .book-index .bx-home svg{display:block}
body.kitchen-mode .book-index button.on{color:#5a2a0a;
  background:linear-gradient(#fff7e6,#f0cf7a);box-shadow:0 -1px 6px rgba(0,0,0,.18)}
body.kitchen-mode .book-index button:active{transform:translateY(1px)}
/* action buttons: parchment tab look, aligned on one row */
body.kitchen-mode .book-btn{position:absolute;border:none;cursor:pointer;padding:0 10px;
  font-family:Georgia,"Times New Roman",serif;font-weight:700;font-size:clamp(12px,3.4vw,15px);
  color:#4a2c10;white-space:nowrap;display:flex;align-items:center;justify-content:center;
  border-radius:10px;background:linear-gradient(#f3e4c2,#e1c692);
  box-shadow:inset 0 -2px 3px rgba(120,80,30,.28),0 1px 3px rgba(0,0,0,.3);
  text-shadow:0 1px 0 rgba(255,255,255,.45)}
body.kitchen-mode .book-btn:active{transform:translateY(1px)}
body.kitchen-mode .book-req{left:18%;top:90.8%;width:40%;height:6.2%}
body.kitchen-mode .book-add{left:60%;top:90.8%;width:22%;height:6.2%}
/* scrolling recipe content sits in the blank page (recipe-window zone) */
body.kitchen-mode .book-page{position:absolute;left:6.4%;top:10.5%;width:80.5%;height:74%;
  overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;padding:2px 4px 8px}
body.kitchen-mode .book-page::-webkit-scrollbar{width:0;height:0}
/* hamburger filter panel opens inside the book (over the page region) */
body.kitchen-mode .filter-panel{position:absolute;left:6.4%;top:10.5%;width:80.5%;height:74%;right:auto;
  max-width:none;border-radius:10px;z-index:30;overflow-y:auto;
  transform:translateY(10px) scale(.98);opacity:0;visibility:hidden;pointer-events:none;
  transition:opacity .2s,transform .2s,visibility .2s}
body.kitchen-mode .filter-panel.open{transform:none;opacity:1;visibility:visible;pointer-events:auto}
body.kitchen-mode .filter-scrim{position:absolute;z-index:29}
/* kitchen mode: hide bottom tab bar; corner back-to-Home button */
body.kitchen-mode .tabbar{display:flex!important;height:var(--khTab);box-sizing:border-box;align-items:center;
  padding:4px 10px env(safe-area-inset-bottom,0px);background:#241812;border-top:1px solid rgba(255,236,180,.28);
  -webkit-backdrop-filter:none;backdrop-filter:none}
.kh-backhome{position:fixed;left:12px;bottom:calc(12px + env(safe-area-inset-bottom,0px));z-index:60;
  width:40px;height:40px;border-radius:50%;border:none;cursor:pointer;background:rgba(28,19,12,.58);
  color:#fff;font-size:21px;line-height:1;display:flex;align-items:center;justify-content:center;
  backdrop-filter:blur(3px);box-shadow:0 2px 9px rgba(0,0,0,.45)}
.kh-backhome:active{background:rgba(192,73,47,.65);transform:translateY(1px)}
/* recipe result-row actions: side-by-side by default */
.lacts{display:flex;gap:6px;align-items:center;flex:0 0 auto}
.lacts .lreq{order:0}.lacts .ladd{order:1}
/* book mode: stack +Planner over Request, roomy ellipsised title, even row height */
body.kitchen-mode .book-page .lrow{align-items:center;min-height:64px}
body.kitchen-mode .book-page .li{min-width:0;flex:1 1 auto}
body.kitchen-mode .book-page .ln{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.kitchen-mode .book-page .lacts{flex-direction:column;align-items:stretch;gap:4px;width:92px}
body.kitchen-mode .book-page .lacts .ladd{order:0;width:100%;height:30px;border-radius:15px;padding:0 8px;
  font-size:.76rem;font-weight:600;white-space:nowrap;display:flex;align-items:center;justify-content:center}
body.kitchen-mode .book-page .lacts .lreq{order:1;width:100%;height:30px;padding:0 8px;
  font-size:.76rem;white-space:nowrap;display:flex;align-items:center;justify-content:center}
/* ===== Kitchen mode: Shopping-in-fridge ===== */
body.kitchen-mode .fridge-screen{position:fixed;inset:0;z-index:5;
  background:#b8c4c0 url("../img/kitchen/kitchen-bg-fridge.webp?v=112") center/100% 100% no-repeat}
body.kitchen-mode .fridge-screen>.shop-header,
body.kitchen-mode .fridge-screen>.shop-actionbar{display:none}
body.kitchen-mode .fr-zone{position:absolute;display:flex;align-items:center}
body.kitchen-mode .fr-seg{left:1.1%;top:1.3%;width:45.9%;height:6.5%}
body.kitchen-mode .fr-add{left:48%;top:1.3%;width:40%;height:7%}
body.kitchen-mode .fr-undo{left:84.6%;top:1.2%;width:14.7%;height:7.1%;justify-content:flex-end}
body.kitchen-mode .fr-recipes{left:7.2%;top:15.7%;width:86%;height:10.3%;
  overflow-y:auto;overflow-x:hidden;display:flex;flex-wrap:wrap;align-content:flex-start;
  align-items:flex-start;gap:6px;padding:2px}
body.kitchen-mode .fr-recipes-label{left:7.2%;top:11.4%;width:86%;height:4%;display:flex;align-items:flex-end}
body.kitchen-mode .fr-list{left:10.5%;top:27.8%;width:77.5%;height:70.8%;display:block;
  overflow-y:auto;overflow-x:hidden;padding:6px 2px 14px}
body.kitchen-mode .fr-list::-webkit-scrollbar,
body.kitchen-mode .fr-recipes::-webkit-scrollbar{width:0;height:0}
/* controls keep the app original gold styling — only resized to fit their zones */
body.kitchen-mode .fr-seg .seg{display:inline-flex;width:auto;height:auto;margin:0}
body.kitchen-mode .fr-seg .seg button{padding:4px 9px;font-size:clamp(9px,2.5vw,12px)}
body.kitchen-mode .fr-add .shop-add-gold{width:auto;max-width:100%;height:auto;margin:0;padding:5px 11px;
  font-size:clamp(10px,2.7vw,13px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.kitchen-mode .fr-undo .shop-undo-btn{width:34px;height:34px;margin:0;padding:0;border-radius:50%;
  display:flex;align-items:center;justify-content:center}
body.kitchen-mode .fr-undo .shop-undo-btn svg{display:block}
body.kitchen-mode .fr-seg .seg,
body.kitchen-mode .fr-add .shop-add-gold,
body.kitchen-mode .fr-undo .shop-undo-btn{background:var(--surface)}
body.kitchen-mode .fr-recipes-label .muted{color:#222;background:#fff;padding:3px 8px;border-radius:8px;font-weight:600;white-space:nowrap}
body.kitchen-mode .fr-recipes .cat-chip{flex:0 0 auto}
/* ---- shopping LIST only: frosted glass + white text so it reads on the fridge ---- */
body.kitchen-mode .fr-list .shop-section-head,
body.kitchen-mode .fr-list .shop-row,
body.kitchen-mode .fr-list .forgotten,
body.kitchen-mode .fr-list .section-title,
body.kitchen-mode .fr-list .muted,
body.kitchen-mode .fr-list .empty{color:#fff;text-shadow:0 1px 2px rgba(0,0,0,.5);
  background:rgba(245,250,255,.13);border:1px solid rgba(255,255,255,.22);border-radius:10px;
  -webkit-backdrop-filter:blur(7px);backdrop-filter:blur(7px)}
body.kitchen-mode .fr-list .shop-row-inner,
body.kitchen-mode .fr-list .shop-list,
body.kitchen-mode .fr-list .shop-section-body,
body.kitchen-mode .fr-list .shop-swipe-wrap{background:transparent;border:none;box-shadow:none}
body.kitchen-mode .fr-list .shop-section{margin-bottom:8px}
body.kitchen-mode .fr-list .shop-section-head{margin-bottom:4px;padding:7px 10px}
body.kitchen-mode .fr-list .shop-row{margin-bottom:5px;padding:2px 6px}
/* keep the recipe number visible on the right; truncate long names instead */
body.kitchen-mode .fr-list .shop-row-inner{display:flex;align-items:center;gap:6px;width:100%}
body.kitchen-mode .fr-list .shop-label{flex:1 1 auto;min-width:0;overflow:hidden}
body.kitchen-mode .fr-list .shop-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#fff}
body.kitchen-mode .fr-list .shop-name .amt,
body.kitchen-mode .fr-list .src-tag{color:#fff}
body.kitchen-mode .fr-list .shop-right{flex:0 0 auto}
body.kitchen-mode .fr-list .shop-recipe-nums{color:#fff;background:rgba(0,0,0,.35);padding:1px 6px;border-radius:8px}
/* next-week toggle: always reachable, pinned at the bottom of the list */
body.kitchen-mode .fr-list .shop-nextweek-toggle{margin:10px 0 0;
  padding:8px 10px;display:flex;gap:6px;align-items:center;color:#fff;border-radius:8px;
  background:rgba(20,16,12,.82);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}
body.kitchen-mode .fr-list .shop-clear-btn{display:block;width:fit-content;max-width:100%;margin:10px auto 0;
  padding:6px 16px;color:#fff;border:1px solid rgba(255,255,255,.3);border-radius:10px;
  background:rgba(245,250,255,.13);-webkit-backdrop-filter:blur(7px);backdrop-filter:blur(7px);
  text-shadow:0 1px 2px rgba(0,0,0,.6)}
body.kitchen-mode .fr-list .shop-caret{color:inherit;font-size:inherit;font-weight:inherit;
  text-shadow:inherit;-webkit-text-stroke:0}

/* ===== Kitchen home: order tickets coverflow on the scene ===== */
.kitchen-root .kh-rackstage{position:absolute;left:4.6%;top:13.1%;width:92.1%;height:15.3%;
  z-index:11;perspective:760px;touch-action:pan-y}
.kitchen-root .kh-rackstage .rticket{position:absolute;left:50%;top:50%;width:44%;max-width:215px;
  padding:7px 12px 9px;border-radius:5px;background:#fffdf6;transform-origin:center;
  box-shadow:0 8px 18px rgba(0,0,0,.42);transition:transform .35s ease,opacity .35s ease;cursor:pointer;
  background-image:repeating-linear-gradient(180deg,transparent 0 15px,rgba(0,0,0,.045) 15px 16px)}
.kitchen-root .kh-rackstage .rclip{top:-7px;width:30px;height:14px;border-radius:2px 2px 3px 3px;background:linear-gradient(180deg,#454545,#191919);box-shadow:0 2px 4px rgba(0,0,0,.4)}
.kitchen-root .kh-rackstage .rclip::before,.kitchen-root .kh-rackstage .rclip::after{content:"";position:absolute;top:-6px;width:8px;height:8px;border:1.5px solid #8a8a8a;border-bottom:none;border-radius:3px 3px 0 0}
.kitchen-root .kh-rackstage .rclip::before{left:3px}
.kitchen-root .kh-rackstage .rclip::after{right:3px}
.kitchen-root .kh-rackstage .rday{font-size:9px;letter-spacing:1.5px}
.kitchen-root .kh-rackstage .rmeal{font-size:13px;margin-top:2px;line-height:1.18;max-height:5.4em;overflow:hidden;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical}
.kitchen-root .kh-rackstage .rtag{font-size:9px;margin-top:4px;padding-top:4px}
.kitchen-root .kh-rackstage .rcook{margin-top:6px;padding:4px 11px;font-size:10px}
/* ===== Kitchen home: ticket photo bg, rate, speech bubble, sparkles ===== */
.kitchen-root .kh-rackstage .rticket{min-height:92px}
.kitchen-root .kh-rackstage .rticket.has-photo{background-size:cover;background-position:center;color:#fff}
.kitchen-root .kh-rackstage .rticket.has-photo .rscrim{position:absolute;inset:0;border-radius:5px;
  background:linear-gradient(180deg,rgba(0,0,0,.12),rgba(0,0,0,.66));pointer-events:none}
.kitchen-root .kh-rackstage .rticket.has-photo .rday{color:#ffe;text-shadow:0 1px 3px rgba(0,0,0,.85)}
.kitchen-root .kh-rackstage .rticket.has-photo .rmeal{color:#fff;text-shadow:0 1px 3px rgba(0,0,0,.9)}
.kitchen-root .kh-rackstage .rticket .rday,
.kitchen-root .kh-rackstage .rticket .rmeal{position:relative;z-index:1}
.kitchen-root .kh-rackstage .rmeal{margin-bottom:26px}
.kitchen-root .kh-rackstage .rticket .rcook{position:absolute;left:7px;bottom:7px;margin-top:0;z-index:3}
.kitchen-root .kh-rackstage .rrate{position:absolute;right:7px;bottom:7px;z-index:3;border:none;cursor:pointer;
  width:25px;height:25px;border-radius:50%;background:rgba(0,0,0,.5);color:#ffd75e;font-size:14px;
  display:flex;align-items:center;justify-content:center;padding:0}
.kitchen-root .kh-rackstage .rclip{z-index:2}
.kitchen-root .hot.chef .kh-speech{position:absolute;top:-8px;left:50%;transform:translateX(-50%);
  background:#fff;color:#1c130c;font-size:15px;font-weight:700;white-space:nowrap;padding:5px 11px;border-radius:13px;
  box-shadow:0 3px 8px rgba(0,0,0,.4);animation:kh-pulse 2.4s ease-in-out infinite;pointer-events:none;user-select:none;-webkit-tap-highlight-color:transparent}
.kitchen-root .hot.chef .kh-speech::after{content:"";position:absolute;left:16px;bottom:-5px;width:10px;height:10px;
  background:#fff;transform:rotate(45deg)}
.kitchen-root .kh-sparkle{position:absolute;top:22%;right:26%;font-size:18px;color:#ffe27a;
  filter:drop-shadow(0 0 4px rgba(255,225,130,.9));animation:kh-sparkle 2.2s ease-in-out infinite;pointer-events:none}
@keyframes kh-sparkle{0%,100%{transform:scale(1) rotate(0);opacity:.85}50%{transform:scale(1.25) rotate(12deg);opacity:1}}
.kitchen-root .kh-sparkle-b{top:auto;bottom:22%;right:auto;left:26%;font-size:13px;animation-delay:1.1s}
.kitchen-root .kh-sparkle-c{top:26%;right:auto;left:22%;font-size:12px;animation-delay:.6s}
.kitchen-root .kh-sparkle-d{top:auto;bottom:26%;right:24%;left:auto;font-size:16px;animation-delay:1.6s}
.kitchen-root .hot.restaurant .kh-sparkle{text-shadow:0 0 2px #000,0 0 4px #000,0 0 1px #000}
/* ===== Kitchen home rack rework (v103): paper tickets, fixed row, enlarge-in-place ===== */
.kitchen-root .kh-rackstage{position:absolute;left:5.1%;top:12.6%;width:90.8%;height:30%;z-index:11;
  overflow:hidden;touch-action:none;pointer-events:none}
.kitchen-root .kh-racktrack{display:flex;gap:4px;align-items:flex-start;height:100%;padding:12px 0 0;
  transition:transform .32s cubic-bezier(.22,.61,.36,1);will-change:transform}
.kitchen-root .kh-rackstage::-webkit-scrollbar{height:0}
.kitchen-root .kh-rackstage .rticket{position:relative;left:auto;top:auto;width:100%;
  min-height:0;padding:9px 12px 11px;transition:box-shadow .26s ease}
.kitchen-root .kh-rackstage .rday-col{flex:0 0 auto;width:24%;max-width:108px;display:flex;flex-direction:column;gap:4px;
  opacity:.5;pointer-events:auto;
  transition:width .26s ease,opacity .26s ease}
.kitchen-root .kh-rackstage .rday-col.sel{width:38%;max-width:172px;opacity:1;z-index:5;max-height:100%;overflow-y:auto;touch-action:pan-y}
.kitchen-root .kh-rackstage .rday-col.sel::-webkit-scrollbar{width:0;height:0}
.kitchen-root .kh-rackstage .rday-col.sel .rticket.rt-sub{min-height:78px}
.kitchen-root .kh-rackstage .rday-col:not(.sel) .rcook,
.kitchen-root .kh-rackstage .rday-col:not(.sel) .rrate{display:none}
.kitchen-root .kh-rackstage .rday-col:not(.sel) .rmeal{margin-bottom:0;max-height:none;-webkit-line-clamp:3}
.kitchen-root .kh-rackstage .rday-col:not(.sel) .rticket.rt-sub .rmeal{margin-bottom:0}
.kitchen-root .kh-rackstage .rday-col.sel .rticket{min-height:148px;box-shadow:0 14px 30px rgba(0,0,0,.5)}
.kitchen-root .kh-rackstage .rticket.rt-sub{min-height:0;padding:6px 10px 8px}
.kitchen-root .kh-rackstage .rticket.rt-sub .rmeal{font-size:11px;margin-bottom:18px}
.kitchen-root .kh-rackstage .rticket.rt-sub .rcook{padding:3px 8px;font-size:9px}
.kitchen-root .kh-rackstage .rticket.rt-sub .rrate{width:20px;height:20px;font-size:12px}
.kitchen-root .kh-rackstage .rticket.sel{transform:scale(1.12);opacity:1;z-index:5;box-shadow:0 14px 30px rgba(0,0,0,.5)}
.kitchen-root .kh-rackstage .rticket.rt-empty{opacity:1}
/* speech bubbles (no animation) — chef + shopping */
.kitchen-root .hot.chef .kh-speech{animation:none}
.kitchen-root .hot.shopping{background:transparent;border:0}
.kitchen-root .hot.shopping .kh-speech{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);
  background:#fff;color:#000;font-size:15px;font-weight:700;white-space:nowrap;padding:5px 11px;border-radius:13px;
  box-shadow:0 3px 8px rgba(0,0,0,.4);text-shadow:none;pointer-events:none;user-select:none;-webkit-tap-highlight-color:transparent}
.kitchen-root .hot.shopping .kh-speech::after{content:"";position:absolute;left:50%;margin-left:-5px;bottom:-5px;
  width:10px;height:10px;background:#fff;transform:rotate(45deg)}
/* moved Planner button + week switcher + calendar toggles */
.kitchen-root .hot.planner{left:11.9%;top:1.8%;width:28%;height:3.9%}
.kitchen-root .kh-weekbar{position:absolute;left:3.9%;top:6.6%;width:44%;height:5%;z-index:11;
  display:flex;align-items:center;justify-content:center;gap:8px}
.kitchen-root .kh-weekbar #khWeekTitle{font-family:Georgia,serif;font-weight:700;font-size:13px;color:#fff;
  text-shadow:0 1px 3px rgba(0,0,0,.75)}
.kitchen-root .kh-wk{border:none;background:rgba(0,0,0,.42);color:#fff;width:22px;height:22px;border-radius:50%;
  cursor:pointer;font-size:15px;line-height:1;display:flex;align-items:center;justify-content:center}
.kitchen-root .kh-toggle{position:absolute;top:29.6%;height:5%;z-index:11;cursor:pointer;border-radius:9px;
  border:1px solid rgba(255,236,180,.85);background:rgba(28,19,12,.5);color:#fff;font-size:12px;font-weight:700;
  padding:0 10px;text-shadow:0 1px 3px rgba(0,0,0,.7)}
.kitchen-root #khTogP{left:3.7%;width:auto}
.kitchen-root #khTogF{right:3.7%;left:auto;width:auto}
.kitchen-root .kh-toggle.on{background:rgba(255,236,180,.92);color:#1c130c;text-shadow:none}
/* request rack (chef scene) */
.kitchen-root .kh-reqrack{display:flex;gap:8px;overflow-x:auto;overflow-y:visible;padding:4px 0 8px;
  scroll-snap-type:x mandatory}
.kitchen-root .kh-reqrack::-webkit-scrollbar{height:0}
.kitchen-root .req-ticket{flex:0 0 auto;width:152px;position:relative;background:#fffdf6;border-radius:5px;
  padding:14px 11px 11px;box-shadow:0 6px 14px rgba(0,0,0,.35);cursor:pointer;scroll-snap-align:start;
  background-image:repeating-linear-gradient(180deg,transparent 0 15px,rgba(0,0,0,.045) 15px 16px)}
.kitchen-root .req-ticket .rclip{top:-8px}
.kitchen-root .req-ticket .rq-who{font-size:10px;font-weight:700;color:var(--kh-accent);text-transform:uppercase;letter-spacing:1px}
.kitchen-root .req-ticket .rq-text{font-size:12px;margin-top:4px;line-height:1.25;color:#1c130c;max-height:11em;overflow:hidden}
.kitchen-root .req-ticket .rq-status{font-size:9px;color:#8a7a64;margin-top:4px}
.kitchen-root .req-ticket.req-empty{color:#fff;background:rgba(255,255,255,.12);box-shadow:none;background-image:none;cursor:default}
/* chef request tickets sit on the rack; planner popup host */
.kitchen-root .cfx.reqrackpos{left:9.1%;top:11.9%;width:83.6%;z-index:12;max-height:none}
.kitchen-root #khPlanOv .kh-planwrap,.kitchen-root #khRestOv .kh-planwrap{position:relative;width:92%;height:90%;max-width:760px;overflow:auto;-webkit-overflow-scrolling:touch;padding:16px;background:#faf6ee;border-radius:16px;box-shadow:0 24px 70px rgba(0,0,0,.55)}
.kitchen-root #khPlanOv .close,.kitchen-root #khRestOv .close{position:absolute;top:14px;right:16px;z-index:30}
/* PC hover labels (Restaurant / Home) always visible + larger for touch */
.kitchen-root .cfx.restaurantbox,.kitchen-root .cfx.backbox{color:#fff;font-size:16px;text-shadow:0 1px 4px rgba(0,0,0,.85)}
/* home rack: extra same-day recipes as mini tickets under the main one */
.kitchen-root .kh-rackstage .rmini-wrap{position:relative;z-index:1;display:flex;flex-direction:column;gap:3px;margin-top:6px;margin-bottom:30px}
.kitchen-root .kh-rackstage .rmini{font-size:10px;font-family:Georgia,serif;color:#5a4632;background:rgba(0,0,0,.05);border-top:1px dashed #d9c8aa;padding:3px 5px 2px;line-height:1.15;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.kitchen-root .kh-rackstage .rticket.has-photo .rmini{color:#fff;background:rgba(0,0,0,.35);border-top-color:rgba(255,255,255,.4)}
.kitchen-root .kh-rackstage .rticket.has-mini .rmeal{margin-bottom:6px}
.kitchen-root .kh-rackstage .rticket.rt-blank{background:#fbf7ee}
.kitchen-root .kh-rackstage .rmeal-empty{color:#8a7a64;font-style:italic}
.kitchen-root .req-ticket .rcook{margin-top:7px;padding:4px 12px;font-size:11px;border:none;background:var(--kh-accent);color:#fff;border-radius:9px;font-weight:700;cursor:pointer}

/* ===== Kitchen chrome: fixed Mary's Kitchen title (top) + themed tab bar (bottom); art sits flush above the bar ===== */
body.kitchen-mode{--khTab:calc(56px + env(safe-area-inset-bottom,0px))}
/* Kitchen art handles its own top area — drop the white safe-area cover that hid the book tabs */
body.kitchen-home::before,body.kitchen-mode::before{display:none}
body.kitchen-home{background:#1c130c;overflow:hidden}
body.kitchen-home .kitchen-root{position:fixed;inset:0;background:#1c130c}
body.kitchen-home .kitchen-root .stage{position:absolute;left:0;right:0;bottom:var(--khTab);top:auto;margin:0 auto;width:100%;max-width:480px;height:auto;aspect-ratio:768/1341}
/* book & fridge: lock to art aspect (no stretch), flush above the tab bar, dark letterbox around */
body.kitchen-mode .book-screen,body.kitchen-mode .fridge-screen{
  inset:auto;top:auto;bottom:var(--khTab);left:0;right:0;margin:0 auto;width:100%;max-width:480px;height:auto;aspect-ratio:768/1376;
  box-shadow:0 0 0 100vmax #1c130c}
/* "Mary's Kitchen" — fixed at the top of kitchen scenes (added by JS only when installed to the home screen) */
.kh-title{position:fixed;top:0;left:0;right:0;z-index:40;display:flex;align-items:center;justify-content:center;pointer-events:none;
  padding:calc(env(safe-area-inset-top,0px) + 4px) 14px 4px;
  font-family:'Mochiy Pop One','Fraunces',system-ui,sans-serif;font-weight:400;text-align:center;
  font-size:clamp(22px,7.5vw,42px);line-height:1.04;color:#ffd75e;letter-spacing:1px;
  -webkit-text-stroke:2px #5a2a0a;paint-order:stroke fill;text-shadow:0 3px 0 #5a2a0a,0 6px 12px rgba(0,0,0,.5)}
/* themed tab text + hide the redundant corner back button */
body.kitchen-mode .tab{color:#d8c2a0}
body.kitchen-mode .tab.active{color:#ffd75e}
body.kitchen-mode .tab.active .tl{-webkit-text-stroke:0}
body.kitchen-mode .kh-backhome{display:none!important}
