/* ============================================================
   VELUM — Meal planning, recipes & groceries
   Cloud-suite aesthetic: atmospheric themes + frosted glass
   ============================================================ */

/* ---------- Theme tokens ---------- */
:root {
  /* Night (default tokens) — moonlit lens cloud over the dark Flatirons */
  --bg-0: #050b18;
  --bg-1: #0b1426;
  --bg-2: #13203a;
  --ink: #f8fafc;
  --ink-soft: #d5dceb;
  --ink-faint: #9aa7bf;

  /* "beacon" = Velum accent (shared token name with sister apps): saffron, like the sunlit cloud rims */
  --beacon: #f59e0b;
  --beacon-bright: #fbbf24;
  --beacon-ink: #1c1002;

  --accent-cool: #7dd3fc;
  --good: #34d399;
  --warn: #fb923c;

  --glass: rgba(8, 16, 34, 0.36);
  --glass-strong: rgba(8, 16, 34, 0.86);
  --glass-hi: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-strong: rgba(255, 255, 255, 0.22);
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.8);

  --danger: #f87171;
  --amber-wash: rgba(245, 158, 11, 0.14);
  --amber-border: rgba(251, 191, 36, 0.45);
  --warn-wash: rgba(251, 146, 60, 0.12);
  --warn-border: rgba(251, 146, 60, 0.42);
  --good-wash: rgba(52, 211, 153, 0.1);
  --good-border: rgba(52, 211, 153, 0.4);
  --track: rgba(255, 255, 255, 0.1);
  --placeholder-a: #1e3a5f;
  --placeholder-b: #3b2f5c;

  /* Scene colors */
  --sky-top: #01040c;
  --sky-mid: #07142b;
  --sky-horizon: #1a2f52;
  --sun: #c7d2fe;
  --cirrus: #5b6a8a;
  --lens-light: #b4c0d6;
  --lens-mid: #6f7e99;
  --lens-shadow: #2f3a52;
  --lens-rim: #e2e8f5;
  --puff: #55627c;
  --ridge: #0a1220;
  --mtn-lit: #1b2638;
  --mtn-mid: #111a2a;
  --mtn-shadow: #070d18;
  --mtn-snow: #8a9ab5;
  --foothill: #1c2638;
  --snow: #a8b6cc;
  --snow-opacity: 0.55;
  --trees: #070d0b;
  --city: #0d1018;
  --city-2: #121826;
  --window: #ffd38a;
  --window-opacity: 0.85;
  --lights: #ff4d5e;
  --star-opacity: 0.8;
  --moon-opacity: 0.55;
  --sun-opacity: 0.12;

  --radius: 16px;
  --radius-sm: 10px;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, monospace;

  --rail-w: 270px;
  --tabbar-h: 0px;
}

/* Twilight — rose-gold lens cloud, violet sky, the city lights coming on */
html.twilight {
  --bg-0: #241a36;
  --bg-1: #34264a;
  --bg-2: #44325c;
  --ink: #fdf8f6;
  --ink-soft: #ece0ea;
  --ink-faint: #c4b0c6;

  --glass: rgba(40, 26, 58, 0.38);
  --glass-strong: rgba(40, 26, 58, 0.86);
  --glass-hi: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.16);
  --glass-border-strong: rgba(255, 255, 255, 0.28);
  --shadow: 0 18px 50px -22px rgba(30, 10, 40, 0.65);
  --placeholder-a: #7c4a74;
  --placeholder-b: #c9786a;

  --sky-top: #1b1840;
  --sky-mid: #5b3f86;
  --sky-horizon: #f29a7c;
  --sun: #ffb27a;
  --cirrus: #ffc6a6;
  --lens-light: #ffd8bd;
  --lens-mid: #c28aa2;
  --lens-shadow: #6b4f7c;
  --lens-rim: #ffb36b;
  --puff: #f4bcae;
  --ridge: #2b2140;
  --mtn-lit: #4d3b63;
  --mtn-mid: #35294a;
  --mtn-shadow: #1f1730;
  --mtn-snow: #f2c9cf;
  --foothill: #6e5770;
  --snow: #f1d6e2;
  --snow-opacity: 0.6;
  --trees: #1d1628;
  --city: #2a1f33;
  --city-2: #352841;
  --window: #ffd38a;
  --window-opacity: 0.6;
  --lights: #ff6b6b;
  --star-opacity: 0.18;
  --moon-opacity: 0;
  --sun-opacity: 0.8;
}

/* Day — the photo: cobalt winter sky, cream lens cloud with sunlit rims, dark Flatirons */
html.day {
  --bg-0: #e8eef7;
  --bg-1: #f2f6fb;
  --bg-2: #fafcff;
  --ink: #142033;
  --ink-soft: #334155;
  --ink-faint: #334155;

  --beacon: #b45309;
  --beacon-bright: #d97706;
  --beacon-ink: #ffffff;

  --accent-cool: #0369a1;
  --good: #047857;
  --warn: #c2410c;

  --glass: rgba(248, 251, 255, 0.42);
  --glass-strong: rgba(248, 251, 255, 0.92);
  --glass-hi: rgba(255, 255, 255, 0.18);
  --glass-border: rgba(255, 255, 255, 0.78);
  --glass-border-strong: rgba(148, 163, 184, 0.55);
  --shadow: 0 18px 50px -24px rgba(15, 30, 60, 0.5);

  --danger: #dc2626;
  --amber-wash: rgba(217, 119, 6, 0.1);
  --amber-border: rgba(180, 83, 9, 0.38);
  --warn-wash: rgba(234, 88, 12, 0.1);
  --warn-border: rgba(194, 65, 12, 0.38);
  --good-wash: rgba(16, 185, 129, 0.1);
  --good-border: rgba(4, 120, 87, 0.35);
  --track: rgba(20, 32, 51, 0.1);
  --placeholder-a: #93b4e0;
  --placeholder-b: #f2d3a2;

  --sky-top: #123672;
  --sky-mid: #2a5ea6;
  --sky-horizon: #7aa3d6;
  --sun: #fff6dc;
  --cirrus: #f4f1ea;
  --lens-light: #f7f3e8;
  --lens-mid: #c6cad3;
  --lens-shadow: #8590a3;
  --lens-rim: #ffe7b0;
  --puff: #f8fafc;
  --ridge: #273042;
  --mtn-lit: #3c4a60;
  --mtn-mid: #26324a;
  --mtn-shadow: #151d2e;
  --mtn-snow: #eef2f7;
  --foothill: #7c7b6c;
  --snow: #f4f7fb;
  --snow-opacity: 0.9;
  --trees: #232b22;
  --city: #4a3530;
  --city-2: #34404f;
  --window: #a9c1dc;
  --window-opacity: 0.4;
  --lights: #ff4d5e;
  --star-opacity: 0;
  --moon-opacity: 0;
  --sun-opacity: 1;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--bg-0);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

:focus-visible { outline: 2px solid var(--beacon-bright); outline-offset: 2px; }

/* ---------- Scenic backdrop: lenticular cloud over the Flatirons ---------- */
.scenic-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.scenic-sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    var(--sky-top) 0%,
    var(--sky-mid) 42%,
    var(--sky-horizon) 78%,
    var(--sky-horizon) 100%);
  transition: background 0.6s ease;
}
.scenic-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.scenic-scene path,
.scenic-scene ellipse,
.scenic-scene rect,
.scenic-scene circle { transition: fill 0.6s ease, stroke 0.6s ease; }
.scenic-scene .sun { opacity: var(--sun-opacity); transition: opacity 0.6s ease; }
.city-blocks .city { fill: var(--city); }
.city-blocks .city-2 { fill: var(--city-2); }
.lens { animation: lens-hover 14s ease-in-out infinite alternate; transform-origin: 800px 470px; }
@keyframes lens-hover {
  from { transform: translateX(-6px); }
  to { transform: translateX(8px); }
}
.cirrus { animation: cirrus-drift 22s ease-in-out infinite alternate; }
@keyframes cirrus-drift {
  from { transform: translateX(0); opacity: 0.85; }
  to { transform: translateX(-24px); opacity: 1; }
}
.city-lights { animation: lights-blink 4s ease-in-out infinite alternate; }
@keyframes lights-blink { from { opacity: 0.75; } to { opacity: 1; } }

.scenic-stars {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 34%;
  opacity: var(--star-opacity);
  transition: opacity 0.6s ease;
  background-image:
    radial-gradient(1.4px 1.4px at 8% 40%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 22% 62%, #fff, transparent),
    radial-gradient(1.6px 1.6px at 36% 22%, #fff, transparent),
    radial-gradient(1px 1px at 51% 48%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 63% 30%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 78% 66%, #fff, transparent),
    radial-gradient(1px 1px at 92% 18%, #fff, transparent),
    radial-gradient(1px 1px at 15% 12%, #fff, transparent);
  animation: twinkle 5s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: calc(var(--star-opacity) * 0.55); } to { opacity: var(--star-opacity); } }

.celestial {
  position: absolute;
  top: 5%; right: 10%;
  width: 120px; height: 120px;
  display: grid;
  place-items: center;
  transition: opacity 0.6s ease;
}
.celestial--moon { opacity: var(--moon-opacity); }
.celestial__glow {
  position: absolute;
  width: 200px; height: 200px;
  border-radius: 50%;
  filter: blur(26px);
  background: radial-gradient(circle, rgba(226,232,240,0.45), transparent 70%);
}
.celestial__disc {
  position: relative;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 32%, #ffffff, #dbe4f0 55%, #aab6c9);
  box-shadow: 0 0 36px rgba(203,213,236,0.5);
}

/* ---------- App shell ---------- */
.shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}
.app {
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  gap: 16px;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 16px 16px;
}

/* ---------- Topbar + breadcrumb ---------- */
.topbar {
  flex: none;
  padding: 14px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-btn {
  width: 38px; height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
}
.icon-btn:hover {
  border-color: var(--glass-border-strong);
  transform: translateY(-1px) rotate(30deg);
}
.crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
}
.crumb__item {
  font-family: var(--font-ui);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: none;
  border: none;
  padding: 2px 4px;
  cursor: pointer;
  border-radius: 6px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}
.crumb__item:hover { color: var(--ink); }
.crumb__item.is-current { color: var(--ink); cursor: default; }
.crumb__home {
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--ink);
}
.crumb__sep { color: var(--ink-faint); font-size: 0.85rem; }

/* Shared glass surface */
.rail, .canvas {
  background: var(--glass);
  backdrop-filter: blur(4px) saturate(1.1);
  -webkit-backdrop-filter: blur(4px) saturate(1.1);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ============ LEFT RAIL ============ */
.rail {
  padding: 18px 16px;
  gap: 14px;
}
.rail__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand__emblem {
  width: 50px; height: 34px;
  flex: none;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35));
}
.brand__name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.brand__tag {
  margin: 2px 0 0;
  font-size: 0.72rem;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}
.rail__summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.stat-mini {
  padding: 8px 6px;
  border-radius: var(--radius-sm);
  background: var(--glass-hi);
  border: 1px solid var(--glass-border);
  text-align: center;
}
.stat-mini__val { display: block; font-weight: 800; font-size: 1.05rem; }
.stat-mini__lbl { display: block; font-size: 0.62rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 2px; }
.stat-mini.is-alert .stat-mini__val { color: var(--beacon-bright); }
html.day .stat-mini.is-alert .stat-mini__val { color: var(--beacon); }

.seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: var(--glass-hi);
  border: 1px solid var(--glass-border);
}
.seg__btn {
  flex: 1 1 0;
  padding: 7px 10px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: none;
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.seg__btn:hover { color: var(--ink); }
.seg__btn.is-active {
  background: var(--amber-wash);
  border-color: var(--amber-border);
  color: var(--beacon-bright);
}
html.day .seg__btn.is-active { color: var(--beacon); }
.seg--inline { display: inline-flex; }
.seg--inline .seg__btn { flex: none; padding: 6px 12px; }
.seg--scroll { max-width: 100%; overflow-x: auto; }

.rail__new { width: 100%; }
.rail__version {
  margin: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-faint);
}

/* Rail navigation */
.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: none;
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.nav-item:hover { color: var(--ink); background: var(--glass-hi); }
.nav-item.is-active {
  color: var(--ink);
  background: var(--amber-wash);
  border-color: var(--amber-border);
}
.nav-item__icon { width: 22px; text-align: center; }
.nav-item__label { flex: 1 1 auto; }
.nav-item__badge {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  text-align: center;
  background: var(--glass-hi);
  border: 1px solid var(--glass-border);
  color: var(--ink-soft);
}
.nav-item__badge--alert { background: var(--beacon); border-color: transparent; color: var(--beacon-ink); }

/* Mobile tab bar */
.tabbar { display: none; }

/* ---------- Progress bars ---------- */
.bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
}
.bar__fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--beacon), var(--beacon-bright));
  transition: width 0.5s ease;
}
.bar--sm { height: 6px; }

/* ============ MAIN CANVAS ============ */
.canvas {
  overflow-y: auto;
  padding: 26px 30px;
}
.canvas:focus { outline: none; }
.canvas__inner { max-width: 1180px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.canvas__inner--narrow { max-width: 860px; }

.empty {
  margin: auto;
  max-width: 560px;
  text-align: center;
  padding: 40px 20px;
}
.empty__icon { font-size: 2.6rem; }
.empty__title { margin: 12px 0 8px; font-size: 1.5rem; font-weight: 800; }
.empty__text { margin: 0 0 20px; color: var(--ink-soft); line-height: 1.55; }
.empty__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.empty-note { margin: 0; font-size: 0.86rem; color: var(--ink-faint); line-height: 1.5; }

.section-title {
  margin: 0 0 10px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.section-title a, .section-title .link-btn { text-transform: none; letter-spacing: 0; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid var(--glass-border);
  background: var(--glass-hi);
  color: var(--ink-soft);
  white-space: nowrap;
}
.pill--active { border-color: var(--amber-border); color: var(--beacon-bright); background: var(--amber-wash); }
html.day .pill--active { color: var(--beacon); }
.pill--info { border-color: rgba(125, 211, 252, 0.45); color: var(--accent-cool); background: rgba(56, 189, 248, 0.1); }
.pill--good { border-color: var(--good-border); color: var(--good); background: var(--good-wash); }
.pill--warn { border-color: var(--warn-border); color: var(--warn); background: var(--warn-wash); }
.pill--muted { color: var(--ink-faint); }
.pill--sm { font-size: 0.66rem; padding: 2px 7px; }

.panel {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--glass-hi);
  border: 1px solid var(--glass-border);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}
.stat { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--glass-hi); border: 1px solid var(--glass-border); }
.stat__lbl { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); }
.stat__val { display: block; margin-top: 3px; font-weight: 700; font-size: 1rem; }

.insight {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  line-height: 1.45;
  background: var(--glass-hi);
  border: 1px solid var(--glass-border);
  color: var(--ink-soft);
}
.insight strong { color: var(--ink); }
.insight--warn { border-color: var(--warn-border); background: var(--warn-wash); }
.insight--good { border-color: var(--amber-border); background: var(--amber-wash); }
.insight__body { flex: 1 1 auto; }
.insight .btn { flex: none; }

/* Page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head__title { margin: 0; font-size: 1.6rem; font-weight: 800; }
.page-head__sub { margin: 4px 0 0; font-size: 0.86rem; color: var(--ink-faint); }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Forms ---------- */
.form { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.form__row--3 { grid-template-columns: repeat(3, 1fr); }
.form__row--4 { grid-template-columns: repeat(4, 1fr); }
.form__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.form__actions-left { margin-right: auto; }
.form__error {
  margin: 0;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.1);
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 600;
}
.form--flush { padding: 0; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field__label { font-size: 0.76rem; font-weight: 600; color: var(--ink-soft); }
.field__label em { font-weight: 400; color: var(--ink-faint); }
.field__input {
  width: 100%;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--glass-hi);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.88rem;
}
html.day .field__input { border-color: var(--glass-border-strong); }
.field__input:focus { outline: none; border-color: var(--beacon); }
.field__input--lg { font-size: 1.05rem; font-weight: 700; }
.field__input--area { resize: vertical; min-height: 64px; line-height: 1.45; }
.field__input--sm { padding: 7px 8px; font-size: 0.84rem; }
select.field__input { appearance: auto; }
html:not(.day) select.field__input option { background: #0f1a2e; color: #f8fafc; }
.field__hint { font-size: 0.74rem; color: var(--ink-faint); line-height: 1.4; margin: 0; }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: 0.84rem; color: var(--ink-soft); cursor: pointer; line-height: 1.4; }
.check-row input { width: 18px; height: 18px; margin-top: 0; accent-color: var(--beacon); flex: none; }
.check-row--center { align-items: center; align-self: center; }
.link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--beacon-bright);
  cursor: pointer;
  text-decoration: underline;
}
html.day .link-btn { color: var(--beacon); }
.preview {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--glass-hi);
  border: 1px solid var(--glass-border);
  font-size: 0.8rem;
  color: var(--ink-soft);
  line-height: 1.5;
}
.preview:empty { display: none; }
.preview ul { margin: 4px 0 0; padding-left: 18px; }
.search {
  min-width: 200px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--glass-hi);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.88rem;
}
html.day .search { border-color: var(--glass-border-strong); }
.search:focus { outline: none; border-color: var(--beacon); }
.search--block { width: 100%; }

/* ---------- Shared suite components (from Anvil/Virga) ---------- */
.btn {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--glass-hi);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}
html.day .btn { border-color: var(--glass-border-strong); }
.btn:hover { border-color: var(--glass-border-strong); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: progress; transform: none; }
.btn--ghost { background: var(--glass-hi); }
.btn--beacon {
  background: linear-gradient(120deg, var(--beacon), var(--beacon-bright));
  border-color: transparent !important;
  color: var(--beacon-ink);
  box-shadow: 0 8px 20px -8px var(--beacon);
}
.btn--beacon:hover { filter: brightness(1.06); }
.btn--danger { border-color: rgba(248, 113, 113, 0.4) !important; color: var(--danger); }
.btn--danger:hover { background: rgba(248, 113, 113, 0.12); }
.btn--tiny { font-size: 0.74rem; padding: 6px 10px; }
.btn--icon { padding: 6px 9px; min-width: 34px; }
.btn kbd { font-family: var(--font-mono); font-size: 0.7rem; opacity: 0.8; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.mini-btn {
  width: 30px; height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: var(--glass-hi);
  color: var(--ink-soft);
  font-size: 0.8rem;
  cursor: pointer;
  flex: none;
  transition: all 0.15s ease;
}
.mini-btn:hover { color: var(--ink); border-color: var(--glass-border-strong); }
.mini-btn--danger:hover { color: var(--danger); }
.mini-btn:disabled { opacity: 0.35; cursor: default; }

/* ---------- Modals ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 9, 18, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal__card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--glass-strong);
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
}
.modal__card--wide { max-width: 620px; }
.modal__card--xl { max-width: 860px; }
.modal__card--tall { height: min(720px, calc(100dvh - 40px)); display: flex; flex-direction: column; }
.modal__header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--glass-border);
  background: var(--glass-strong);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}
.modal__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.modal__close {
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  line-height: 1;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: var(--glass-hi);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
}
.modal__close:hover { border-color: var(--glass-border-strong); }

.settings-content { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.settings-group { display: flex; flex-direction: column; gap: 8px; }
.settings-divider { height: 1px; background: var(--glass-border); }
html.day .settings-divider { background: var(--glass-border-strong); }
.settings-row__label { font-weight: 700; font-size: 0.9rem; }
.settings-row__desc { font-size: 0.78rem; color: var(--ink-faint); line-height: 1.4; }
.settings-privacy {
  margin: 0;
  font-size: 0.75rem;
  color: var(--ink-faint);
  line-height: 1.4;
}
.settings-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.settings-actions .btn { flex: 1 1 auto; }
.settings-actions--compact .btn { flex: 1 1 140px; }

/* Encrypted cloud sync */
.cloud-data-field { display: flex; flex-direction: column; gap: 5px; margin-top: 4px; }
.cloud-data-field__label { font-size: 0.78rem; font-weight: 600; color: var(--ink-soft); }
.cloud-phrase-entry { display: flex; gap: 6px; }
.cloud-data-field__input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--glass-hi);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}
html.day .cloud-data-field__input { border-color: var(--glass-border-strong); }
.cloud-data-field__input:focus { outline: none; border-color: var(--beacon); }
.cloud-phrase-entry__toggle {
  flex: none;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--glass-hi);
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}
.cloud-phrase-entry__toggle:hover { border-color: var(--glass-border-strong); color: var(--ink); }
.cloud-phrase-output {
  margin: 0;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--amber-border);
  background: var(--amber-wash);
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--ink-soft);
}
.cloud-remember-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--ink-soft);
  cursor: pointer;
}
.cloud-remember-option input { accent-color: var(--beacon); }
.cloud-data-status {
  margin: 2px 0 0;
  min-height: 1em;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--ink-faint);
}
.cloud-data-status--info { color: var(--accent-cool); }
.cloud-data-status--success { color: var(--good); }
.cloud-data-status--error { color: var(--danger); }
.backup-status {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  margin: 4px 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--glass-hi);
  border: 1px solid var(--glass-border);
  font-size: 0.78rem;
}
.backup-status dt { color: var(--ink-faint); }
.backup-status dd { margin: 0; color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }

.theme-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 4px;
}
.theme-chip {
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--glass-hi);
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
html.day .theme-chip { border-color: var(--glass-border-strong); }
.theme-chip:hover { border-color: var(--glass-border-strong); transform: translateY(-1px); }
.theme-chip.is-active {
  border-color: var(--beacon);
  background: var(--amber-wash);
  color: var(--beacon-bright);
  box-shadow: 0 0 0 1px var(--beacon) inset;
}
html.day .theme-chip.is-active { color: var(--beacon); }

.aisle-order { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.aisle-order li {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 6px 5px 10px;
  border-radius: var(--radius-sm);
  background: var(--glass-hi);
  border: 1px solid var(--glass-border);
  font-size: 0.8rem;
}
.aisle-order li span { flex: 1 1 auto; }
.aisle-order .mini-btn { width: 26px; height: 26px; }

.about-content { padding: 18px; text-align: center; }
.about-content__name {
  margin: 4px 0 2px;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}
.about-content__version {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--beacon-bright);
}
html.day .about-content__version { color: var(--beacon); }
.about-content__description {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.5;
}
.about-build { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 16px 0 0; text-align: left; font-size: 0.76rem; }
.about-build dt { color: var(--ink-faint); }
.about-build dd { margin: 0; font-family: var(--font-mono); color: var(--ink-soft); overflow-wrap: anywhere; }

.toast {
  position: fixed;
  bottom: calc(24px + var(--tabbar-h));
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 32px);
  padding: 12px 16px 12px 20px;
  border-radius: var(--radius-sm);
  background: var(--glass-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border-strong);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  animation: toast-in 0.25s ease;
}
.toast__action {
  border: none;
  background: none;
  color: var(--beacon-bright);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  padding: 2px 4px;
}
html.day .toast__action { color: var(--beacon); }
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ============ VELUM COMPONENTS ============ */

/* Recipe image / placeholder */
.thumb {
  position: relative;
  flex: none;
  width: 44px; height: 44px;
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  background: linear-gradient(135deg, var(--placeholder-a), var(--placeholder-b));
  border: 1px solid var(--glass-border);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb--sm { width: 30px; height: 30px; border-radius: 8px; font-size: 0.95rem; }
.thumb--lg { width: 64px; height: 64px; border-radius: 12px; font-size: 1.7rem; }

/* Home */
.hero {
  padding: 22px;
  border-radius: var(--radius);
  background: var(--glass-hi);
  border: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.hero__top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hero__eyebrow { margin: 0; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }
.hero__title { margin: 4px 0 0; font-size: 1.7rem; font-weight: 800; letter-spacing: -0.01em; }
.hero__meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.86rem; color: var(--ink-soft); }
.hero__meta strong { color: var(--ink); }
.home-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.home-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.today-meals { display: flex; flex-direction: column; gap: 8px; }
.today-meal {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--glass-hi);
  border: 1px solid var(--glass-border);
}
.today-meal__label { width: 82px; flex: none; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
.today-meal__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.today-meal__empty { color: var(--ink-faint); font-size: 0.86rem; }
.quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.quick-action {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--glass-hi);
  border: 1px solid var(--glass-border);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: 0.86rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}
.quick-action:hover { border-color: var(--amber-border); transform: translateY(-2px); }
.quick-action__icon { font-size: 1.4rem; }
.quick-action__sub { font-size: 0.74rem; font-weight: 500; color: var(--ink-faint); }
.upcoming { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.up-card {
  display: flex; flex-direction: column;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--glass-hi);
  border: 1px solid var(--glass-border);
  text-decoration: none;
  color: var(--ink);
  transition: all 0.15s ease;
}
.up-card:hover { border-color: var(--glass-border-strong); transform: translateY(-2px); }
.up-card__img { height: 96px; display: grid; place-items: center; font-size: 2rem; background: linear-gradient(135deg, var(--placeholder-a), var(--placeholder-b)); }
.up-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.up-card__body { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.up-card__when { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); }
.up-card__name { font-weight: 700; font-size: 0.9rem; line-height: 1.3; }
.week-strip { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.week-strip__day {
  padding: 8px 6px;
  border-radius: var(--radius-sm);
  background: var(--glass-hi);
  border: 1px solid var(--glass-border);
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  display: flex; flex-direction: column; gap: 6px; align-items: center;
}
.week-strip__day.is-today { border-color: var(--amber-border); background: var(--amber-wash); }
.week-strip__name { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
.week-strip__num { font-weight: 800; font-size: 1.05rem; }
.dots { display: flex; gap: 4px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--track); }
.dot.is-on { background: var(--beacon-bright); }
.dot.is-done { background: var(--good); }
.shop-status { display: flex; flex-direction: column; gap: 10px; }
.shop-status__nums { display: flex; justify-content: space-between; font-size: 0.84rem; color: var(--ink-soft); }
.shop-status__nums strong { color: var(--ink); font-size: 1.1rem; }

/* Week toolbar */
.week-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.week-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.week-nav__range { font-weight: 800; font-size: 1.05rem; padding: 0 6px; }
.week-nav__date { width: 150px; padding: 6px 8px; }
.menu-name {
  border: 1px dashed transparent;
  background: none;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1.6rem;
  font-weight: 800;
  padding: 2px 6px;
  margin-left: -6px;
  border-radius: 8px;
  width: min(100%, 520px);
}
.menu-name:hover { border-color: var(--glass-border-strong); }
.menu-name:focus { outline: none; border-color: var(--beacon); background: var(--glass-hi); }
.menu-name::placeholder { color: var(--ink); opacity: 1; }
.menu-name:focus::placeholder { color: var(--ink-faint); }

/* Days down the side, meal types across the top */
.week-grid {
  display: grid;
  grid-template-columns: 120px repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.wg-corner { }
.wg-day {
  padding: 8px 8px;
  border-radius: var(--radius-sm);
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 6px;
  background: var(--glass-hi);
  border: 1px solid var(--glass-border);
  min-width: 0;
}
.wg-day.is-today { border-color: var(--amber-border); background: var(--amber-wash); }
.wg-day.is-past { opacity: 0.78; }
.wg-day__link { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); min-width: 0; }
.wg-day__name { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.04em; color: var(--ink-soft); }
.wg-day__num { font-weight: 800; font-size: 1rem; }
.wg-day .mini-btn { width: 26px; height: 26px; align-self: flex-end; }
.wg-meal {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 0 2px;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
}
.wg-meal span:first-child { font-size: 1.1rem; }
.wg-cell {
  min-height: 130px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--glass-hi);
  border: 1px solid var(--glass-border);
  display: flex; flex-direction: column; gap: 8px;
  min-width: 0;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.wg-cell.is-today { border-color: var(--amber-border); }
.wg-cell.is-drop { border-color: var(--beacon); background: var(--amber-wash); border-style: dashed; }
.slot-add {
  margin-top: auto;
  width: 100%;
  min-height: 30px;
  border-radius: 8px;
  border: 1px dashed var(--glass-border-strong);
  background: none;
  color: var(--ink-faint);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.slot-add:hover { color: var(--beacon-bright); border-color: var(--beacon); background: var(--amber-wash); }
html.day .slot-add:hover { color: var(--beacon); }
.wg-cell.is-empty .slot-add { flex: 1 1 auto; }

/* Meal chip */
.meal-chip {
  display: flex; align-items: center; gap: 6px;
  width: 100%;
  padding: 5px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--ink);
  font-family: var(--font-ui);
  text-align: left;
  cursor: pointer;
  min-width: 0;
  transition: all 0.12s ease;
}
html.day .meal-chip { background: var(--glass-hi); border-color: var(--glass-border-strong); }
.meal-chip:hover { border-color: var(--amber-border); }
.meal-chip[draggable="true"] { cursor: grab; }
.meal-chip.is-dragging { opacity: 0.4; }
.meal-chip__text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; padding: 0; border: none; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.meal-chip__name { font-size: 0.78rem; font-weight: 700; line-height: 1.25; overflow: hidden; overflow-wrap: anywhere; hyphens: auto; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.meal-chip__meta { font-size: 0.66rem; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:is(.week-grid, .week-list) .meal-chip { padding: 10px; gap: 8px; }
:is(.week-grid, .week-list) .meal-chip__name {
  display: block;
  font-size: 0.9rem;
  line-height: 1.4;
  overflow: visible;
  -webkit-line-clamp: unset;
}
:is(.week-grid, .week-list) .meal-chip__meta {
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
}
.meal-chip.is-done { opacity: 0.7; }
.meal-chip.is-done .meal-chip__name { text-decoration: line-through; text-decoration-color: var(--good); }
.meal-chip.is-note .meal-chip__name { font-style: italic; font-weight: 600; }
.meal-chip.is-archived .meal-chip__meta { color: var(--warn); }
.done-toggle {
  width: 22px; height: 22px; flex: none;
  border-radius: 50%;
  border: 1.5px solid var(--glass-border-strong);
  background: none;
  color: transparent;
  font-size: 0.7rem; font-weight: 900;
  display: grid; place-items: center;
  cursor: pointer;
}
.done-toggle.is-on { background: var(--good); border-color: var(--good); color: #fff; }
.today-meal .meal-chip { padding: 8px; }
.today-meal .meal-chip__name { font-size: 0.9rem; }

.week-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.week-foot__stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.84rem; color: var(--ink-soft); }
.week-foot__stats strong { color: var(--ink); }

/* Day view */
.day-cards { display: flex; flex-direction: column; gap: 12px; }
.day-card {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--glass-hi);
  border: 1px solid var(--glass-border);
  display: flex; flex-direction: column; gap: 10px;
}
.day-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.day-card__title { margin: 0; font-size: 1rem; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.day-meal {
  display: grid; grid-template-columns: 84px 1fr auto; gap: 14px; align-items: center;
  padding: 10px; border-radius: var(--radius-sm); background: var(--glass); border: 1px solid var(--glass-border);
}
html.day .day-meal { background: var(--glass-hi); }
.day-meal__img { width: 84px; height: 64px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; font-size: 1.8rem; background: linear-gradient(135deg, var(--placeholder-a), var(--placeholder-b)); }
.day-meal__img img { width: 100%; height: 100%; object-fit: cover; }
.day-meal__name { font-weight: 800; font-size: 1rem; text-decoration: none; color: var(--ink); }
.day-meal__meta { font-size: 0.78rem; color: var(--ink-faint); margin-top: 3px; }
.day-meal__actions { display: flex; gap: 6px; align-items: center; }

/* Mobile week list (stacked days) */
.week-list { display: none; flex-direction: column; gap: 10px; }
.wl-day { padding: 12px; border-radius: var(--radius); background: var(--glass-hi); border: 1px solid var(--glass-border); display: flex; flex-direction: column; gap: 8px; }
.wl-day.is-today { border-color: var(--amber-border); }
.wl-day__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wl-day__title { font-weight: 800; text-decoration: none; color: var(--ink); }
.wl-row { display: grid; grid-template-columns: 74px 1fr; gap: 8px; align-items: start; }
.wl-row__label { padding-top: 8px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
.wl-row__body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.wl-row .slot-add { min-height: 38px; opacity: 1 !important; }
.wl-row .meal-chip { padding: 7px; }

/* Recipes library */
.lib-tools { display: flex; flex-direction: column; gap: 10px; }
.lib-tools__row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lib-tools__row .search { flex: 1 1 240px; }
.lib-tools select { width: auto; min-width: 140px; }
.chip-toggle { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-hi);
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
  white-space: nowrap;
}
html.day .chip { border-color: var(--glass-border-strong); }
.chip:hover { color: var(--ink); }
.chip.is-on { background: var(--amber-wash); border-color: var(--amber-border); color: var(--beacon-bright); }
html.day .chip.is-on { color: var(--beacon); }
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.recipe-card {
  position: relative;
  display: flex; flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--glass-hi);
  border: 1px solid var(--glass-border);
  color: var(--ink);
  text-decoration: none;
  transition: all 0.15s ease;
}
.recipe-card:hover { border-color: var(--glass-border-strong); transform: translateY(-3px); box-shadow: var(--shadow); }
.recipe-card__link { display: flex; flex-direction: column; flex: 1 1 auto; color: inherit; text-decoration: none; }
.welcome-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; text-align: left; margin-top: 22px; }
.recipe-card__img { aspect-ratio: 4 / 3; display: grid; place-items: center; font-size: 2.8rem; background: linear-gradient(135deg, var(--placeholder-a), var(--placeholder-b)); overflow: hidden; }
.recipe-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.recipe-card__initials { font-size: 0.9rem; font-weight: 800; letter-spacing: 0.16em; color: rgba(255,255,255,0.85); margin-top: -8px; }
.ph { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.recipe-card__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1 1 auto; }
.recipe-card__name { font-weight: 800; font-size: 0.98rem; line-height: 1.3; }
.recipe-card__meta { font-size: 0.76rem; color: var(--ink-faint); display: flex; gap: 10px; flex-wrap: wrap; }
.recipe-card__pills { display: flex; gap: 5px; flex-wrap: wrap; margin-top: auto; }
.fav-btn {
  position: absolute; top: 10px; right: 10px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.5);
  background: rgba(10, 16, 30, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: grid; place-items: center;
}
.fav-btn.is-on { color: #fb7185; background: rgba(255,255,255,0.9); }

/* Recipe detail */
.recipe-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 22px; align-items: stretch; }
.recipe-hero__img { border-radius: var(--radius); overflow: hidden; min-height: 240px; max-height: 380px; display: grid; place-items: center; font-size: 4.5rem; background: linear-gradient(135deg, var(--placeholder-a), var(--placeholder-b)); border: 1px solid var(--glass-border); }
.recipe-hero__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.recipe-hero__body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.recipe-hero__title { margin: 0; font-size: 2rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.15; }
.recipe-hero__desc { margin: 0; color: var(--ink-soft); line-height: 1.55; }
.recipe-hero__pills { display: flex; gap: 6px; flex-wrap: wrap; }
.recipe-body { display: grid; grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr); gap: 20px; align-items: start; }
.ing-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ing-list__group { margin: 12px 0 4px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.ing-list__group:first-child { margin-top: 0; }
.ing-line {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 2px;
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.92rem; line-height: 1.4;
  cursor: pointer;
}
.ing-line:last-child { border-bottom: none; }
.ing-line input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--beacon); flex: none; }
.ing-line__qty { font-weight: 800; white-space: nowrap; }
.ing-line__prep { color: var(--ink-faint); }
.ing-line.is-checked { opacity: 0.5; }
.ing-line.is-checked .ing-line__text { text-decoration: line-through; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 14px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 34px 1fr; gap: 12px; font-size: 0.98rem; line-height: 1.6; cursor: pointer; }
.steps li::before {
  content: counter(step);
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800; font-size: 0.85rem;
  background: var(--amber-wash); border: 1px solid var(--amber-border); color: var(--beacon-bright);
}
html.day .steps li::before { color: var(--beacon); }
.steps li.is-done { opacity: 0.45; }
.steps li.is-current::before { background: var(--beacon); color: var(--beacon-ink); }
.scaler { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.scaler__note { font-size: 0.76rem; color: var(--ink-faint); }
.recipe-notes { white-space: pre-wrap; line-height: 1.55; color: var(--ink-soft); margin: 0; }
.recipe-foot { font-size: 0.76rem; color: var(--ink-faint); display: flex; gap: 14px; flex-wrap: wrap; }
.archived-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
html.cooking .canvas { padding: 22px; }
html.cooking .steps li { font-size: 1.25rem; line-height: 1.65; }
html.cooking .ing-line { font-size: 1.1rem; }
html.cooking .recipe-hero { display: none; }

/* Stepper */
.stepper { display: inline-flex; align-items: stretch; border-radius: var(--radius-sm); border: 1px solid var(--glass-border-strong); overflow: hidden; background: var(--glass-hi); }
.stepper__btn { width: 38px; border: none; background: none; color: var(--ink); font-size: 1.1rem; font-weight: 700; cursor: pointer; }
.stepper__btn:hover { background: var(--amber-wash); }
.stepper__input { width: 64px; border: none; border-left: 1px solid var(--glass-border); border-right: 1px solid var(--glass-border); background: none; color: var(--ink); text-align: center; font-family: var(--font-ui); font-size: 0.95rem; font-weight: 700; padding: 7px 4px; -moz-appearance: textfield; }
.stepper__input::-webkit-outer-spin-button, .stepper__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper__input:focus { outline: none; }

/* Recipe editor */
.recipe-form__top { display: grid; grid-template-columns: 200px 1fr; gap: 16px; }
.recipe-form__main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.photo-drop { display: flex; flex-direction: column; gap: 8px; }
.photo-drop__preview { aspect-ratio: 4 / 3; border-radius: var(--radius-sm); overflow: hidden; display: grid; place-items: center; font-size: 2.6rem; background: linear-gradient(135deg, var(--placeholder-a), var(--placeholder-b)); border: 1px dashed var(--glass-border-strong); }
.photo-drop__preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-drop.is-over .photo-drop__preview { border-color: var(--beacon); }
.photo-drop__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.editor-block { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--glass-border); background: var(--glass-hi); }
.editor-block__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.editor-block > .btn { align-self: flex-start; }
.subhead { margin: 0; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.ing-rows { display: flex; flex-direction: column; gap: 6px; }
.ing-row { display: grid; grid-template-columns: 70px 92px minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 0.8fr) auto auto; gap: 6px; align-items: center; }
.ing-row__opt { display: flex; align-items: center; gap: 4px; font-size: 0.72rem; color: var(--ink-faint); white-space: nowrap; }
.ing-row__opt input { accent-color: var(--beacon); }
.ing-row__btns { display: flex; gap: 4px; }
.ing-head { display: grid; grid-template-columns: 70px 92px minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 0.8fr) auto auto; gap: 6px; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
.paste-box { display: flex; flex-direction: column; gap: 8px; }
.step-rows { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; counter-reset: s; }
.step-row { counter-increment: s; display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: start; }
.step-row::before { content: counter(s); padding-top: 9px; font-weight: 800; font-size: 0.8rem; color: var(--ink-faint); text-align: center; }
.step-row textarea { min-height: 44px; }
.step-row__btns { display: flex; flex-direction: column; gap: 4px; }
.step-row__btns .mini-btn { width: 26px; height: 22px; font-size: 0.7rem; }

/* Picker */
.picker { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1 1 auto; min-height: 0; }
.picker__slot { font-size: 0.84rem; color: var(--ink-soft); }
.picker__slot strong { color: var(--ink); }
.picker__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; flex: 1 1 auto; min-height: 160px; }
.pick-row {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: none;
  color: var(--ink);
  font-family: var(--font-ui);
  text-align: left;
  cursor: pointer;
}
.pick-row:hover, .pick-row:focus-visible { background: var(--amber-wash); border-color: var(--amber-border); }
.pick-row__text { flex: 1 1 auto; min-width: 0; }
.pick-row__name { font-weight: 700; font-size: 0.9rem; }
.pick-row__meta { font-size: 0.74rem; color: var(--ink-faint); margin-top: 2px; }
.pick-row__fav { color: #fb7185; }
.picker__foot { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--glass-border); }
.picker__note { display: flex; gap: 6px; flex: 1 1 260px; }
.picker__note .field__input { padding: 7px 10px; }

.meal-head { display: flex; gap: 12px; align-items: center; }
.meal-head__name { font-weight: 800; font-size: 1.05rem; }
.meal-head__meta { font-size: 0.78rem; color: var(--ink-faint); margin-top: 2px; }

/* Shopping */
.list-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.list-bar select { width: auto; min-width: 220px; font-weight: 700; }
.shop-progress { display: flex; flex-direction: column; gap: 8px; }
.shop-progress__text { display: flex; justify-content: space-between; font-size: 0.86rem; color: var(--ink-soft); }
.quick-add { display: flex; gap: 8px; }
.quick-add .field__input { flex: 1 1 auto; font-size: 0.95rem; padding: 11px 12px; }
.aisle { display: flex; flex-direction: column; gap: 6px; }
.aisle__title { margin: 6px 0 2px; display: flex; align-items: center; gap: 8px; font-size: 0.76rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.aisle__count { font-weight: 600; letter-spacing: 0; text-transform: none; }
.shop-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.shop-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--glass-hi);
  border: 1px solid var(--glass-border);
  min-height: 76px;
}
html.day .shop-item { background: var(--glass-hi); }
.shop-check {
  width: 52px; height: 52px; flex: none;
  border-radius: 12px;
  border: 2px solid var(--glass-border-strong);
  background: none;
  color: transparent;
  font-size: 1.25rem; font-weight: 900;
  display: grid; place-items: center;
  cursor: pointer;
  transition: all 0.12s ease;
}
.shop-check:hover { border-color: var(--beacon); }
.shop-item.is-bought .shop-check { background: var(--good); border-color: var(--good); color: #fff; }
.shop-item__main { flex: 1 1 auto; min-width: 0; min-height: 52px; padding: 8px 0; background: none; border: none; text-align: left; color: var(--ink); font-family: var(--font-ui); cursor: pointer; }
.shop-item__name { font-weight: 700; font-size: 1.15rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; overflow-wrap: anywhere; }
.shop-item__edit { min-width: 44px; min-height: 44px; }
.shop-item__sub { font-size: 0.74rem; color: var(--ink-faint); margin-top: 2px; line-height: 1.35; overflow-wrap: anywhere; }
.shop-item__change { font-size: 0.74rem; color: var(--warn); margin-top: 2px; }
.shop-item__qty { flex: none; font-family: var(--font-mono); font-weight: 600; font-size: 1rem; color: var(--ink-soft); text-align: right; white-space: nowrap; }
.shop-item.is-bought .shop-item__name { text-decoration: line-through; color: var(--ink-faint); }
.shop-item.is-bought { opacity: 0.75; }
.shop-item.is-stale { border-style: dashed; }
.shop-item__arrange { display: flex; flex-direction: column; gap: 3px; }
.shop-item__arrange .mini-btn { width: 28px; height: 22px; font-size: 0.7rem; }
.shop-item.is-draggable { position: relative; cursor: grab; }
.shop-item__grip {
  flex: none; align-self: stretch;
  display: grid; place-items: center;
  width: 22px; margin-right: -4px;
  color: var(--ink-faint); font-size: 1.1rem; line-height: 1;
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
}
.shop-item.is-draggable:hover .shop-item__grip { color: var(--ink-soft); }
.shop-item.is-dragging, html.day .shop-item.is-dragging { position: relative; z-index: 5; background: var(--glass-strong); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); opacity: 0.92; box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28); pointer-events: none; transition: none; }
.shop-item.is-drop-before::before,
.shop-item.is-drop-after::after {
  content: ""; position: absolute; left: 8px; right: 8px; height: 3px; border-radius: 3px;
  background: var(--beacon); pointer-events: none;
}
.shop-item.is-drop-before::before { top: -6px; }
.shop-item.is-drop-after::after { bottom: -6px; }
html.is-shop-dragging, html.is-shop-dragging * { cursor: grabbing !important; user-select: none !important; -webkit-user-select: none !important; }
.pantry-set { opacity: 0.85; }
.pantry-set .shop-item { border-style: dashed; }
.list-foot { display: flex; gap: 8px; flex-wrap: wrap; justify-content: space-between; align-items: center; }

/* Reconcile preview */
.changes { display: flex; flex-direction: column; gap: 12px; }
.changes__group h4 { margin: 0 0 6px; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.changes__group ul { margin: 0; padding-left: 18px; font-size: 0.85rem; line-height: 1.55; color: var(--ink-soft); }
.changes__group--add h4 { color: var(--good); }
.changes__group--up h4 { color: var(--beacon-bright); }
html.day .changes__group--up h4 { color: var(--beacon); }
.changes__group--rm h4 { color: var(--danger); }
.changes__group--keep h4 { color: var(--accent-cool); }

/* Pantry & catalog */
.pantry-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pantry-row {
  display: grid; grid-template-columns: auto 1fr 90px 100px auto; gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: var(--radius-sm); background: var(--glass-hi); border: 1px solid var(--glass-border);
}
.pantry-row__name { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.pantry-row.is-out .pantry-row__name { color: var(--ink-faint); text-decoration: line-through; }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--track); border: 1px solid var(--glass-border-strong); transition: all 0.15s ease; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink-faint); transition: all 0.15s ease; }
.switch input:checked + span { background: var(--good-wash); border-color: var(--good-border); }
.switch input:checked + span::after { left: 21px; background: var(--good); }
.switch input:focus-visible + span { outline: 2px solid var(--beacon-bright); outline-offset: 2px; }
.staples { display: flex; flex-wrap: wrap; gap: 6px; }
/* Occasional items */
.occ-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.occ-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto auto; gap: 10px; align-items: center;
  padding: 10px 12px; border-radius: var(--radius-sm); background: var(--glass-hi); border: 1px solid var(--glass-border);
}
.occ-row.is-on { border-color: var(--good-border); background: var(--good-wash); }
.occ-row__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.occ-row__name { font-weight: 700; font-size: 1rem; overflow-wrap: anywhere; }
.occ-row__sub { font-size: 0.8rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.occ-row__state { min-width: 96px; justify-content: center; }
.occ-row__state.is-on { color: var(--good); border-color: var(--good-border); }
.occ-row__move { display: flex; gap: 4px; }
.occ-row__move .mini-btn { width: 28px; height: 28px; font-size: 0.7rem; }
.occ-row__move .mini-btn:disabled { opacity: 0.35; cursor: default; }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.tbl th { text-align: left; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); padding: 8px 10px; border-bottom: 1px solid var(--glass-border); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--glass-border); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr[data-edit-ingredient] { cursor: pointer; }
.tbl tbody tr[data-edit-ingredient]:hover { background: var(--glass-hi); }
.muted { color: var(--ink-faint); }

/* Restore preview */
.restore-meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 0.85rem; margin: 0; }
.restore-meta dt { color: var(--ink-faint); }
.restore-meta dd { margin: 0; font-weight: 600; }
.restore-counts { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 12px; }

/* ---------- Scrollbars ---------- */
.nav-list::-webkit-scrollbar,
.canvas::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
.picker__list::-webkit-scrollbar,
.modal__card::-webkit-scrollbar { width: 8px; height: 8px; }
.nav-list::-webkit-scrollbar-thumb,
.canvas::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb,
.picker__list::-webkit-scrollbar-thumb,
.modal__card::-webkit-scrollbar-thumb {
  background: var(--glass-border-strong);
  border-radius: 999px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1100px) {
  :root { --rail-w: 230px; }
  .canvas { padding: 20px; }
  .home-grid { grid-template-columns: 1fr; }
  .recipe-body { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .week-grid { display: none; }
  .week-list { display: flex; }
  .recipe-hero { grid-template-columns: 1fr; }
  .recipe-hero__img { min-height: 200px; max-height: 260px; }
}

@media (max-width: 820px) {
  :root { --tabbar-h: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .shell { height: auto; min-height: 100vh; min-height: 100dvh; padding-bottom: var(--tabbar-h); }
  .app { grid-template-columns: 1fr; padding: 0 10px 10px; }
  .rail { display: none; }
  .canvas { min-height: calc(100dvh - 80px - var(--tabbar-h)); padding: 16px 14px 24px; overflow: visible; }
  .topbar { padding: 10px 12px; }
  .crumb__item { max-width: 150px; }
  #topNewRecipeBtn { display: none; }
  .tabbar {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 100;
    height: var(--tabbar-h);
    padding: 6px 6px env(safe-area-inset-bottom, 0px);
    background: var(--glass-strong);
    backdrop-filter: blur(20px) saturate(1.3);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    border-top: 1px solid var(--glass-border-strong);
  }
  .tab {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    border-radius: 12px;
    color: var(--ink-faint);
    text-decoration: none;
    font-size: 0.66rem; font-weight: 700;
  }
  .tab__icon { font-size: 1.3rem; line-height: 1; }
  .tab.is-active { color: var(--ink); background: var(--amber-wash); }
  .tab__badge { position: absolute; top: 2px; right: calc(50% - 22px); min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--beacon); color: var(--beacon-ink); font-size: 0.62rem; font-weight: 800; line-height: 16px; text-align: center; }
  .form__row, .form__row--3, .form__row--4 { grid-template-columns: 1fr 1fr; }
  .recipe-form__top { grid-template-columns: 1fr; }
  .photo-drop { flex-direction: row; align-items: flex-end; }
  .photo-drop__preview { width: 140px; flex: none; }
  .ing-head { display: none; }
  .ing-row {
    grid-template-columns: 64px 84px minmax(0, 1fr) auto;
    padding: 8px; border-radius: var(--radius-sm); border: 1px solid var(--glass-border);
  }
  .ing-row [data-f="prep"] { grid-column: 1 / 3; }
  .ing-row [data-f="group"] { grid-column: 3 / 4; }
  .ing-row__opt { grid-column: 4; grid-row: 2; }
  .ing-row__btns { grid-column: 4; grid-row: 1; }
  .theme-picker { grid-template-columns: repeat(2, 1fr); }
  .aisle-order { grid-template-columns: 1fr; }
  .modal { padding: 0; align-items: flex-end; }
  .modal__card { max-height: 94dvh; border-radius: 18px 18px 0 0; }
  .modal__card--tall { height: 94dvh; }
  .pantry-row { grid-template-columns: auto 1fr auto; }
  .pantry-row__qty, .pantry-row__unit { display: none; }
  .occ-row { grid-template-columns: auto auto 1fr auto; }
  .occ-row__main { grid-column: 1 / -1; }
  .occ-row__move { justify-self: end; }
  .hide-sm { display: none !important; }
  .page-head__title, .menu-name { font-size: 1.35rem; }
  .recipe-hero__title { font-size: 1.6rem; }
  .day-meal { grid-template-columns: 64px 1fr; }
  .day-meal__img { width: 64px; height: 56px; }
  .day-meal__actions { grid-column: 1 / -1; justify-content: flex-end; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .week-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .shop-item__qty { font-size: 0.8rem; }
  .list-bar select { min-width: 0; flex: 1 1 auto; }
  html.cooking .steps li { font-size: 1.15rem; }
}

@media (max-width: 420px) {
  .form__row, .form__row--3, .form__row--4 { grid-template-columns: 1fr; }
  .week-strip { gap: 3px; }
  .week-strip__day { padding: 6px 2px; }
  .recipe-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .recipe-card__body { padding: 10px; }
  .recipe-card__name { font-size: 0.88rem; }
  .recipe-card__meta { font-size: 0.7rem; }
}

/* Phones are shopping-only, including in landscape. Backup/restore remains available. */
html.phone-checklist { --tabbar-h: 0px; }
.phone-checklist .rail,
.phone-checklist .tabbar,
.phone-checklist #topNewRecipeBtn,
.phone-checklist #planningForm,
.phone-checklist #shoppingForm,
.phone-checklist .settings-group:has(.theme-picker),
.phone-checklist #starterBtn,
.phone-checklist #aboutBtn { display: none; }
.phone-checklist .shell { height: auto; min-height: 100dvh; padding-bottom: 0; }
.phone-checklist .app { grid-template-columns: 1fr; padding: 0 10px 10px; }
.phone-checklist .canvas { min-height: calc(100dvh - 70px); padding: 16px 14px 24px; overflow: visible; }
.phone-checklist .topbar { padding: 10px 12px; }
.phone-checklist .list-bar select { min-width: 0; width: 100%; }
.phone-checklist .shop-item { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 6px 10px; }
.phone-checklist .shop-check { grid-column: 1; grid-row: 1 / 3; }
.phone-checklist .shop-item__main { grid-column: 2; grid-row: 1 / 3; }
.phone-checklist .shop-item__qty { grid-column: 3; grid-row: 1; white-space: normal; overflow-wrap: anywhere; max-width: 90px; }
.phone-checklist .shop-item__edit { grid-column: 3; grid-row: 2; }
.phone-checklist .shop-item__arrange { grid-column: 3; }
.phone-checklist .shop-item__arrange .mini-btn { width: 44px; height: 44px; }
.phone-checklist .shop-item > [data-act="pantry-override"] { grid-column: 2 / -1; min-height: 44px; }
.phone-checklist .shop-item__name { font-size: 1.1rem; }
.phone-checklist .shop-item__qty { font-size: 0.9rem; }

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