/* Meals4Us — deep red-to-black gradient identity (matches the app icon),
   calm warm-neutral body so it stays easy to read. Refined, not candy-coated. */

:root {
  --bg: #EFECE7;
  --card: #FFFFFF;
  --ink: #1B1512;
  --ink-soft: #6B645C;
  --line: #E2DCD3;
  --red: #8C1D24;
  --red-bright: #B0222E;
  --red-tint: rgba(140, 29, 36, 0.08);
  --red-tint-strong: rgba(140, 29, 36, 0.14);
  --header-gradient: linear-gradient(135deg, #A81D26 0%, #5C0F14 55%, #171111 100%);
  --shadow: 0 1px 2px rgba(27, 21, 18, 0.06), 0 6px 16px rgba(27, 21, 18, 0.06);
  --shadow-lift: 0 10px 28px rgba(27, 21, 18, 0.16);
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; }
button { font-family: inherit; }

/* Generic hide utility — some components have their own scoped .hidden rules,
   this covers everything else (e.g. the collapsed sauce library). */
.hidden { display: none !important; }

.app-shell {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* Header — the one place the icon's red/black gradient drama lives */
.app-header {
  padding: 16px 20px 12px;
  position: sticky;
  top: 0;
  background: var(--header-gradient);
  z-index: 5;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.brand-mark {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  display: block;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.brand-name {
  font-size: 32px;
  font-weight: 600;
  color: #F5F1EC;
  letter-spacing: -0.005em;
}

.brand-name span { color: inherit; }

.progress {
  list-style: none;
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.progress li {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: rgba(245, 241, 236, 0.4);
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(245, 241, 236, 0.18);
  transition: color .2s, border-color .2s;
  cursor: pointer;
}

.progress li.locked {
  cursor: default;
  opacity: .45;
  pointer-events: none;
}

.progress li.active {
  color: #F5F1EC;
  border-color: #FF6B6F;
}

.progress li.done {
  color: rgba(245, 241, 236, 0.7);
  border-color: rgba(245, 241, 236, 0.45);
}

/* Main / screens */
#app { flex: 1; display: flex; flex-direction: column; }

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  animation: fadeIn .25s ease;
}

.screen.hidden { display: none; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.screen-inner { flex: 1; padding: 10px 20px 16px; }

.back-link {
  display: inline-flex;
  align-items: center;
  background: none;
  border: none;
  padding: 0 0 8px;
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}

.back-link:hover { color: var(--red); }

h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--ink);
}

.subtitle {
  font-size: 14.5px;
  color: var(--ink-soft);
  margin: 0 0 8px;
  line-height: 1.35;
}

.screen-footer {
  position: sticky;
  bottom: 0;
  padding: 10px 20px 14px;
  background: linear-gradient(180deg, rgba(239,236,231,0) 0%, var(--bg) 40%);
}

.screen-footer-split { display: flex; gap: 10px; }
.screen-footer-split .btn { flex: 1; }

/* Buttons */
.btn {
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .08s ease, opacity .15s ease, filter .15s ease;
}

.btn:active { transform: scale(0.98); }
.btn-full { width: 100%; }

.btn-primary {
  background: linear-gradient(135deg, var(--red-bright), #3A0D10);
  color: #FFFFFF;
  box-shadow: 0 8px 20px rgba(140, 29, 36, 0.3);
}

.btn-primary:hover { filter: brightness(1.08); }

.btn-secondary {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-secondary:hover { border-color: var(--red); color: var(--red); }

.household-box {
  background: #F7F4EF;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 10px;
}

.household-row { display: flex; gap: 8px; margin-top: 2px; }
.household-field { flex: 1; }

.household-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 3px;
}

.household-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  color: var(--ink);
  background: var(--card);
}

.household-field input:focus {
  outline: none;
  border-color: var(--red);
}

.household-field-select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 14.5px;
  font-weight: 700;
  font-family: inherit;
  color: var(--ink);
  background: var(--card);
}

.household-field-select:focus {
  outline: none;
  border-color: var(--red);
}

/* Screen 1 — family text */
.family-textarea {
  width: 100%;
  min-height: 120px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  padding: 16px;
  font-size: 16.5px;
  font-family: inherit;
  color: var(--ink);
  resize: vertical;
  box-shadow: var(--shadow);
}

.family-textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-tint);
}

.field-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 12px 0 6px;
}

.week-lock-status {
  background: var(--red-tint);
  border: 1px solid var(--red);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--red);
  text-align: center;
}
.week-lock-status.hidden { display: none; }

.week-updated-banner {
  background: rgba(242, 196, 51, 0.16);
  border: 1px solid #F2C433;
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.week-updated-banner.hidden { display: none; }
.week-updated-actions { display: flex; gap: 8px; margin-top: 8px; }
.week-updated-actions .btn { flex: 1; padding: 8px 10px; font-size: 13px; }

.past-week-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
}
.past-week-range {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--red);
  margin-bottom: 6px;
}
.past-week-meals {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.7;
  margin-bottom: 10px;
}

.show-password-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin: -6px 0 12px;
  cursor: pointer;
}
.show-password-toggle input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--red);
}

.field-label span {
  font-weight: 400;
  font-style: italic;
}

.family-notes {
  min-height: 68px;
}

.reset-everything-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  background: none;
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}

.reset-everything-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

.clear-text-btn {
  display: block;
  margin: 4px 0 0 auto;
  background: none;
  border: none;
  padding: 2px 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}

.clear-text-btn:hover { color: var(--red); }

/* Screen 1 — the categories are full-width banners that open up in place;
   two across on wider screens so the whole list fits on one page */
.chip-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 6px;
}

@media (min-width: 480px) {
  .chip-row { grid-template-columns: 1fr 1fr; }
}

#chip-row .suggestion-box { grid-column: 1 / -1; }

#chip-row .chip {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

#chip-row .chip .chip-emoji { margin-right: 10px; font-size: 17px; }

#chip-row .chip::after {
  content: "▸";
  margin-left: auto;
  color: var(--ink-soft);
  font-size: 15px;
  transition: transform .15s;
}

#chip-row .chip.open { border-color: var(--red); color: var(--red); }
#chip-row .chip.open::after { transform: rotate(90deg); color: var(--red); }

.suggestion-box {
  margin: -2px 0 2px;
  background: #F7F4EF;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
}

.suggestion-box.hidden { display: none; }

.suggestion-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 0 10px;
}

.suggestion-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 6px;
}

.suggestion-pill {
  width: 100%;
  text-align: center;
  background: var(--card);
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: 8px;
  padding: 8px 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-pill.used {
  background: var(--red);
  color: #FFFFFF;
  border-color: var(--red);
}

.suggestion-pill-wrap {
  display: flex;
  width: 100%;
  align-items: stretch;
  border-radius: 8px;
  overflow: hidden;
}

.suggestion-pill-wrap .suggestion-pill { flex: 1; }

.suggestion-pill-wrap .suggestion-pill {
  border-radius: 8px 0 0 8px;
  border-right: none;
}

.suggestion-pill-remove {
  background: var(--card);
  border: 1px solid var(--red);
  border-left: none;
  border-radius: 0 8px 8px 0;
  color: var(--red);
  font-size: 12px;
  padding: 0 9px;
  cursor: pointer;
}

.suggestion-pill-wrap .suggestion-pill.used + .suggestion-pill-remove {
  background: var(--red);
  border-color: var(--red);
  color: #FFFFFF;
}

.add-word-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.add-word-input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--ink);
  background: var(--card);
}

.add-word-input:focus {
  outline: none;
  border-color: var(--red);
}

.add-word-btn {
  border: 1px solid var(--red);
  background: var(--card);
  color: var(--red);
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.add-word-btn:hover { background: var(--red); color: #FFFFFF; }

.chip {
  background: var(--card);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}

.chip:hover, .chip:active { border-color: var(--red); color: var(--red); }

/* Screen 2 — learned profile */
.learned-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
}

.learned-card h2 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink);
  margin: 0 0 8px;
}

.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  background: #F7F4EF;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-transform: capitalize;
}

.tag-list:empty::after {
  content: "Nothing here yet";
  font-size: 15.5px;
  color: var(--ink-soft);
  font-style: italic;
}

.empty-note {
  background: #F7F4EF;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 15.5px;
  color: var(--ink-soft);
}

.empty-note.hidden { display: none; }

/* Screen 3 — week plan */
.week-list { display: flex; flex-direction: column; gap: 6px; }

.next-week-box {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.next-week-box.hidden { display: none; }

.next-week-list { display: flex; flex-direction: column; gap: 8px; }

.next-week-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.next-week-item-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
}

.next-week-item-day {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--red);
  flex-shrink: 0;
}

/* Week 2 — planning-ahead section, shown below Week 1 on Screen 3 */
.week2-header {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}
.week2-header h2 { font-size: 17px; margin: 0 0 4px; color: var(--ink); }
.week2-header .subtitle { margin: 0 0 14px; }

.week2-grocery-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin: 16px 0 4px;
  cursor: pointer;
}
.week2-grocery-toggle input[type="checkbox"] {
  width: 19px;
  height: 19px;
  accent-color: var(--red);
  flex-shrink: 0;
}

.add-recipe-btn { margin-top: 20px; }

/* Add Your Own Recipe form (rendered inside the shared modal) */
.recipe-form-field { margin-bottom: 14px; }

.recipe-form-field label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.recipe-form-field input[type="text"],
.recipe-form-field input[type="number"],
.recipe-form-field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: var(--card);
}

.recipe-form-field input:focus,
.recipe-form-field select:focus {
  outline: none;
  border-color: var(--red);
}

.recipe-form-row { display: flex; gap: 10px; }
.recipe-form-row .recipe-form-field { flex: 1; }

.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.ingredient-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}

.ingredient-row input[type="text"] {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: var(--card);
}

.ingredient-row .ing-name { flex: 2; min-width: 0; }
.ingredient-row .ing-qty { flex: 0.6; min-width: 0; }
.ingredient-row select { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 9px 4px; font-size: 12.5px; font-family: inherit; color: var(--ink); background: var(--card); }

.ingredient-row .ingredient-remove {
  border: none;
  background: none;
  color: var(--ink-soft);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 6px;
  flex-shrink: 0;
}

.recipe-form-actions { display: flex; gap: 10px; margin-top: 18px; }
.recipe-form-actions .btn { flex: 1; }

.day-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 12px 9px;
  box-shadow: var(--shadow);
}

.day-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
}

.day-name {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--red);
}

.free-day-toggle {
  background: none;
  border: none;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 2px 0;
}

.free-day-toggle:hover { color: var(--red); }

/* Leftovers night: a Free day that says what's being eaten */
.day-toggles { display: flex; align-items: center; gap: 12px; }
.lo-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.lo-chip {
  font: inherit; font-size: 12.5px; line-height: 1.25; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 5px 11px; text-align: left;
}
.lo-chip:hover { border-color: var(--red); }
.lo-chip.on { background: var(--red); border-color: var(--red); color: #fff; }
.fd-switch {
  display: block; margin-top: 8px; padding: 0; background: none; border: none; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 700; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px;
}
.fd-switch:hover { color: var(--red); }
.lo-note { font-size: 12.5px; font-weight: 600; color: var(--red); margin-top: 3px; }

.free-day-card {
  border-style: dashed;
  background: #F7F4EF;
  box-shadow: none;
}

.free-day-body {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0 2px;
}

.free-day-emoji {
  font-size: 22px;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
}

.free-day-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.free-day-subtitle { font-size: 12.5px; color: var(--ink-soft); margin-top: 1px; }

.meal-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.meal-emoji {
  font-size: 14px;
  line-height: 1;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--red-tint);
  display: flex;
  align-items: center;
  justify-content: center;
}

.meal-name-row { display: flex; align-items: center; gap: 5px; }
.meal-name { font-size: 14.5px; font-weight: 600; }

.rename-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  line-height: 1;
  opacity: .55;
  cursor: pointer;
}
.rename-btn:hover { opacity: 1; }

.meal-meta {
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-top: 0;
}

.meal-actions { display: flex; gap: 5px; margin-top: 5px; }
.meal-actions:first-of-type { margin-top: 0; }

.meal-btn {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 7px;
  padding: 6px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
  white-space: nowrap;
}

.meal-btn:hover { border-color: var(--red); color: var(--red); }
.meal-btn:active { transform: scale(0.96); }

.meal-btn.loved {
  background: var(--red-tint-strong);
  border-color: var(--red);
  color: var(--red);
}

.meal-btn.marked-ok {
  background: var(--red-tint);
  border-color: var(--ink-soft);
  color: var(--ink);
}


.recipe-picker-search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: var(--card);
  margin-bottom: 12px;
}

.recipe-picker-search:focus { outline: none; border-color: var(--red); }

.recipe-picker-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 48vh;
  overflow-y: auto;
}

.recipe-picker-empty {
  font-size: 14px;
  color: var(--ink-soft);
  text-align: center;
  padding: 20px 0;
}

.meal-btn.remove-btn:hover {
  border-color: var(--red);
  background: var(--red);
  color: #FFFFFF;
}

/* Screen 4 — grocery list */
.grocery-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 8px; }

.grocery-store-title {
  font-size: 14.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--red);
  margin: 0 0 6px;
}

.grocery-store-categories { display: flex; flex-direction: column; gap: 8px; }

.grocery-category {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 12px;
  box-shadow: var(--shadow);
}

.grocery-category-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink);
  margin: 0 0 4px;
  padding-left: 8px;
  border-left: 3px solid var(--red);
}

.grocery-items { display: flex; flex-direction: column; }

.grocery-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.grocery-item:last-child { border-bottom: none; }

.grocery-check {
  width: 17px;
  height: 17px;
  accent-color: var(--red);
  flex-shrink: 0;
}

.grocery-item-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  text-transform: capitalize;
}

.grocery-item-qty-wrap {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.grocery-item-qty-input {
  width: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 2px;
  font-size: 12.5px;
  font-family: inherit;
  color: var(--ink);
  background: var(--card);
  text-align: right;
  /* Hide the spinner arrows — they'd eat the width this needs for "2.25" */
  -moz-appearance: textfield;
}
.grocery-item-qty-input::-webkit-outer-spin-button,
.grocery-item-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.grocery-item-qty-input:focus { outline: none; border-color: var(--red); }

.grocery-item-qty-unit {
  font-size: 12.5px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.grocery-item.checked .grocery-item-name,
.grocery-item.checked .grocery-item-qty-input,
.grocery-item.checked .grocery-item-qty-unit {
  text-decoration: line-through;
  color: var(--ink-soft);
  opacity: .6;
}

.grocery-remove {
  border: none;
  background: none;
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
  padding: 2px;
}

.grocery-item-store-select {
  flex-shrink: 0;
  background: var(--card);
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: 20px;
  padding: 2px 4px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  max-width: 92px;
}

.grocery-item-store-select.unset {
  color: var(--ink-soft);
  border-color: var(--line);
}

.grocery-item-store-select:focus { outline: none; border-color: var(--red); }

/* Screen 1 — grocery stores */
.store-tag-list { margin-top: 6px; }

.store-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #F7F4EF;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 6px 4px 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.store-tag-remove {
  border: none;
  background: none;
  color: var(--ink-soft);
  font-size: 12px;
  cursor: pointer;
  padding: 2px;
  line-height: 1;
}

.store-tag-remove:hover { color: var(--red); }

/* Modal (recipe view) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 15, 13, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 20;
}

.modal-backdrop.hidden { display: none; }

.modal-card {
  background: var(--card);
  width: 100%;
  max-width: 560px;
  border-radius: 18px 18px 0 0;
  padding: 22px 20px 28px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp .2s ease;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  border: 1px solid var(--line);
  background: var(--card);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 13px;
  cursor: pointer;
}

.modal-body-emoji {
  font-size: 26px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--red-tint);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body-title {
  font-size: 21px;
  font-weight: 600;
  margin: 12px 0 4px;
}

.modal-body-meta {
  font-size: 14.5px;
  color: var(--ink-soft);
  margin-bottom: 16px;
}

.day-pick-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.day-pick-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
}

.day-pick-option:hover { border-color: var(--red); }

.day-pick-day {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--red);
  flex-shrink: 0;
}

.day-pick-meal {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  text-align: right;
}

.modal-ingredients h3 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-soft);
  margin: 0 0 8px;
}

.modal-ingredients ul {
  margin: 0;
  padding-left: 18px;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--ink);
}

.modal-instructions { margin-top: 20px; }

.modal-instructions h3 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-soft);
  margin: 0 0 8px;
}

.modal-instructions ol {
  margin: 0;
  padding-left: 20px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
}

.modal-instructions li { margin-bottom: 8px; }
.modal-instructions li:last-child { margin-bottom: 0; }

@media (min-width: 600px) {
  .app-shell { box-shadow: var(--shadow-lift); }
}

/* Account strip — small "signed in as" row in the header */
.account-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -4px 0 10px;
  font-size: 12.5px;
  color: rgba(245, 241, 236, 0.75);
}

.account-strip.hidden { display: none; }
.account-strip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.account-strip .strip-link {
  flex-shrink: 0;
  border: 1px solid rgba(245, 241, 236, 0.3);
  border-radius: 8px;
  color: rgba(245, 241, 236, 0.9);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  text-decoration: none;
}

.account-strip button {
  flex-shrink: 0;
  background: none;
  border: 1px solid rgba(245, 241, 236, 0.3);
  border-radius: 8px;
  color: rgba(245, 241, 236, 0.9);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
}

.account-strip button:hover { border-color: rgba(245, 241, 236, 0.6); }

#trial-badge {
  flex-shrink: 0;
  background: rgba(242, 196, 51, 0.18);
  border: 1px solid rgba(242, 196, 51, 0.5);
  color: #F2C433;
  border-radius: 8px;
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 700;
}
#trial-badge.hidden { display: none; }
#btn-manage-billing.hidden { display: none; }

/* Lock It In / Start Next Week — sit just below the week's day cards */
.week-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 4px;
}
/* five buttons: one row on wide screens, wrapping onto a second row on phones
   instead of pushing the page sideways */
.week-actions .btn { flex: 1 1 auto; padding: 10px 10px; font-size: 13.5px; white-space: nowrap; }

/* Auth gate — full-screen sign in / create account overlay */
.auth-gate {
  position: fixed;
  inset: 0;
  background: var(--header-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 30;
}

.auth-gate.hidden { display: none; }

.auth-card {
  background: var(--card);
  border-radius: 18px;
  padding: 32px 24px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: var(--shadow-lift);
}

.auth-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  margin-bottom: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.auth-card h1 { font-size: 22px; margin: 0 0 6px; }
.auth-card .subtitle { margin: 0 0 20px; }

.auth-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  background: var(--card);
  margin-bottom: 10px;
}

.auth-input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-tint);
}

.auth-error {
  font-size: 13px;
  font-weight: 600;
  color: var(--red);
  margin: -2px 0 12px;
  text-align: left;
}

.auth-error.hidden { display: none; }
.auth-error.auth-success { color: #2E7D32; }

.auth-link {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  padding: 12px 0 0;
  cursor: pointer;
}

.auth-link:hover { color: var(--red); }

.lead-form { text-align: left; }
.lead-form.hidden { display: none; }

.lead-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 2px 0 12px;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
}
.lead-consent input { margin-top: 2px; }

/* ---------- Meal Ideas library ---------- */
.idea-filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.idea-filters::-webkit-scrollbar { display: none; }
.idea-filters .chip {
  flex: none;
  padding: 7px 13px;
  font-size: 13.5px;
  border-radius: 18px;
}
.idea-filters .chip.on {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.idea-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.idea-toolbar .recipe-picker-search { flex: 1; }
.idea-cuisine {
  flex: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 8px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink);
  background: var(--card);
}
.idea-cuisine:focus { outline: none; border-color: var(--red); }

.idea-list { max-height: 52vh; }

.idea-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
}
.idea-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 13px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}
.idea-main:hover { border-color: var(--red); }
.idea-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.idea-meta {
  font-size: 12px;
  color: var(--ink-soft);
}
.idea-act {
  flex: none;
  width: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  font-size: 16px;
  cursor: pointer;
}
.idea-act:hover { border-color: var(--red); }

/* The labeled "Add to Day" button — the row's main action, spelled out */
.idea-add-btn {
  width: auto;
  padding: 0 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--red);
  border-color: var(--red);
  white-space: nowrap;
}
.idea-add-btn:hover { background: var(--red); color: #fff; }

/* Welcome splash — the branded front door at every sign-in. Dense, one screen.
   The red lives in a centered panel; the page ground around it stays the
   app's off-white so it matches the rest of the app. */
.welcome-splash {
  position: fixed; inset: 0; z-index: 70;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 14px;
}
.ws-inner {
  max-width: 620px; width: 100%; text-align: center;
  background: var(--header-gradient);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 14px 40px rgba(23, 17, 17, .35);
}
.ws-brandrow { display: flex; align-items: center; justify-content: center; gap: 10px; text-align: left; }
.ws-icon { width: 40px; height: 40px; border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,.45); }
.ws-brand { font-size: 19px; font-weight: 800; color: #fff; letter-spacing: -0.01em; line-height: 1.15; }
.ws-brand span { color: #FFB3B8; }
.ws-tag { font-size: 12px; color: rgba(255,255,255,.75); }
.ws-tonight {
  display: inline-block; margin: 8px 0 0;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.28);
  border-radius: 8px; padding: 5px 12px;
  font-size: 12.5px; font-weight: 600; color: #fff;
}
.ws-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0; text-align: left; }
.ws-card {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  border-radius: 9px; padding: 7px 10px;
}
.ws-card b { display: block; font-size: 12.5px; color: #fff; font-weight: 700; }
.ws-card span { display: block; font-size: 11px; color: rgba(255,255,255,.72); line-height: 1.3; margin-top: 1px; }
.ws-go {
  display: block; width: 100%; max-width: 300px; margin: 0 auto;
  background: #fff; color: var(--red); font-family: inherit;
  font-size: 13.5px; font-weight: 800; border: none; border-radius: 9px;
  padding: 10px 16px; cursor: pointer;
}
.ws-go:hover { filter: brightness(.94); }
.ws-close {
  position: absolute; top: 12px; right: 14px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--line);
  color: var(--ink-soft); font-size: 13px; cursor: pointer;
}
.ws-close:hover { border-color: var(--red); color: var(--red); }
/* Only a truly tiny window is allowed to scroll the splash */
@media (max-height: 500px) { .welcome-splash { overflow-y: auto; align-items: flex-start; } }

.idea-hidden-link {
  display: block;
  margin: 12px auto 0;
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 13px;
  font-family: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.idea-hidden-link:hover { color: var(--red); }
.idea-hidden-link:empty { display: none; }

/* Aisle picker on the recipe editor's add-ingredient row */
.aisle-select {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: var(--card);
}
.aisle-select:focus { outline: none; border-color: var(--red); }
