/* ================================================================
   What's For Dinner — Mobile-First CSS (AllRecipes.com style)
   Breakpoints: 360 (base), 390, 412, 768
   ================================================================ */

:root {
  --brand: #e07a5f;
  --brand-dark: #c96a4f;
  --brand-light: #fdf0ec;
  --green: #2e7d32;
  --green-light: #e8f5e9;
  --blue: #3b82f6;
  --blue-light: #eff6ff;
  --gray-bg: #f8f9fa;
  --gray-card: #ffffff;
  --gray-border: #e9ecef;
  --gray-text: #868e96;
  --text: #212529;
  --text-light: #adb5bd;
  --shadow: 0 1px 8px rgba(0,0,0,0.06);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --nav-height: 64px;
  --tab-height: 56px;
}

/* ─── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--gray-bg);
  color: var(--text);
  line-height: 1.5;
  padding-bottom: calc(var(--tab-height) + 20px);
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, select { font-family: inherit; font-size: inherit; }

/* ─── Top Nav (slim on mobile, full on tablet) ─────────────────── */
.top-nav {
  background: var(--red);
  color: #fff;
  padding: 0 1rem;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.top-nav .logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.top-nav .logo .logo-icon { font-size: 1.5rem; }
.top-nav .nav-links { display: flex; gap: 0.5rem; }
.top-nav .nav-links a {
  color: rgba(255,255,255,0.85);
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  white-space: nowrap;
}
.top-nav .nav-links a:hover,
.top-nav .nav-links a.active {
  background: rgba(255,255,255,0.2);
  color: #fff;
  text-decoration: none;
}

/* ─── Bottom Tab Bar ────────────────────────────────────────────── */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--tab-height);
  background: #fff;
  border-top: 1px solid var(--gray-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
}
.tab-bar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--gray-text);
  font-size: 0.7rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.35rem 0.5rem;
  min-width: 60px;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}
.tab-bar a .tab-icon { font-size: 1.35rem; line-height: 1; }
.tab-bar a:hover { color: var(--red); text-decoration: none; }
.tab-bar a.active { color: var(--red); background: var(--red-light); }

/* ─── Container ──────────────────────────────────────────────────── */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem;
}

/* Hide desktop nav links on small screens, show tab bar */
@media (min-width: 768px) {
  body { padding-bottom: 0; }
  .tab-bar { display: none; }
  .top-nav .nav-links a { font-size: 0.95rem; padding: 0.5rem 1rem; }
  .container { padding: 2rem; }
}

@media (max-width: 767px) {
  .top-nav .nav-links { display: none; }
}

/* ─── Page Header ────────────────────────────────────────────────── */
.page-header {
  text-align: center;
  padding: 1rem 0 0.75rem;
}
.page-header h1 {
  font-size: 1.5rem;
  color: var(--text);
  font-weight: 700;
}
.page-header .subtitle {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* ─── Day Card (Planner) ────────────────────────────────────────── */
.days-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.day-card {
  background: var(--gray-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
  transition: box-shadow 0.2s;
}
.day-card:hover { box-shadow: var(--shadow-hover); }
.day-card.eating-out-card {
  background: linear-gradient(135deg, #fff8e1 0%, #fff3cd 100%);
}

.day-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-border);
  background: #fafafa;
}
.day-card .day-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}
.day-card .day-date {
  font-size: 0.85rem;
  color: var(--text-light);
}
.day-card .weather-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--blue-light);
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
}

.day-card .card-body {
  padding: 1rem;
}

.day-card.eating-out-card .card-body {
  text-align: center;
  padding: 2rem 1rem;
}

.eating-out-badge {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}
.eating-out-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--orange);
}

/* Hero image area — AllRecipes-style big photo cards */
.meal-hero {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: var(--gray-bg);
  border-radius: var(--radius) var(--radius) 0 0;
  transition: transform 0.3s ease;
}
.day-card:hover .meal-hero {
  transform: scale(1.03);
}
.meal-hero-placeholder {
  width: 100%;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0f0f0 0%, #e8e8e8 100%);
  font-size: 3.5rem;
  border-radius: var(--radius) var(--radius) 0 0;
}

/* Meal info row */
.meal-name-link {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  display: block;
  margin: 0.5rem 0 0.35rem;
  line-height: 1.25;
  transition: color 0.2s;
}
.meal-name-link:hover {
  color: var(--red);
  text-decoration: none;
}

.meal-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0;
}
.meal-stats .stat {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-light);
  background: var(--gray-bg);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}
.meal-stats .stat .stat-icon { font-size: 0.9rem; }

/* Equipment badges */
.equp-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--brand-light);
  color: var(--brand);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  margin: 0.15rem 0.2rem 0 0;
}

/* Tags */
.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.5rem 0;
}
.tag {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-light);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  text-transform: lowercase;
}

/* Vote section */
.vote-section {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-border);
}
.vote-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.vote-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green);
}
.vote-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ─── Pill-style buttons (vote, eating out) ─────────────────────── */
.btn-vote {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  background: var(--brand);
  color: #fff;
  line-height: 1.2;
  -webkit-user-select: none;
  user-select: none;
}
.btn-vote:hover { background: var(--brand-dark); }
.btn-vote:disabled {
  background: #ced4da;
  color: #fff;
  cursor: not-allowed;
}
.btn-vote.voted { background: #ced4da; }

.btn-eatout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0.5rem 1rem;
  border: 1px solid var(--gray-border);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s, transform 0.1s;
  background: #fff;
  color: var(--text);
  line-height: 1.2;
  -webkit-user-select: none;
  user-select: none;
}
.btn-eatout:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-light);
}
.btn-eatout:active { transform: scale(0.97); }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
  background: var(--brand);
  color: #fff;
  line-height: 1.2;
}
.btn-primary:hover { background: var(--brand-dark); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0.5rem 1rem;
  border: 1px solid var(--gray-border);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
  background: #fff;
  color: var(--text);
  line-height: 1.2;
}
.btn-secondary:hover { background: var(--gray-bg); }

.btn-small {
  min-height: 36px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

/* ─── Who Are You? Modal ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}
.modal-box {
  background: #fff;
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
}
.modal-box h2 {
  font-size: 1.5rem;
  color: var(--red);
  margin-bottom: 0.5rem;
}
.modal-box p {
  color: var(--text-light);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}
.name-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1rem;
}
.name-btn {
  min-height: 48px;
  min-width: 80px;
  padding: 0.6rem 1.25rem;
  border: 2px solid var(--gray-border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}
.name-btn:hover { border-color: var(--red); color: var(--red); }
.name-btn.selected {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.name-btn.view-only {
  font-size: 0.85rem;
  color: var(--text-light);
}
.name-btn.view-only:hover { border-color: var(--gray-text); color: var(--gray-text); }

/* ─── Meal Image Link (clickable hero) ────────────────────────── */
.meal-image-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* ─── Recipe Detail Page (AllRecipes style) ─────────────────────── */
.recipe-hero {
  width: 100%;
  max-height: 450px;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}
.recipe-hero-placeholder {
  width: 100%;
  height: 350px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
  font-size: 5rem;
  border-radius: var(--radius) var(--radius) 0 0;
}

.recipe-card-allrecipes {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  max-width: 800px;
  margin: 0 auto;
}

.recipe-body {
  padding: 1.5rem;
}
.recipe-body h1 {
  font-size: 1.75rem;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

/* Stats row (AllRecipes style) */
.recipe-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--gray-border);
  margin-bottom: 0.75rem;
}
.recipe-meta-row .meta-item {
  text-align: center;
}
.recipe-meta-row .meta-item .meta-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}
.recipe-meta-row .meta-item .meta-label {
  font-size: 0.7rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Star rating placeholder */
.star-rating {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin: 0.5rem 0;
}
.star-rating .star {
  font-size: 1.25rem;
  color: #f5a623;
}

/* Ingredient section */
.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  border-bottom: 2px solid var(--red);
  display: inline-block;
  padding-bottom: 0.25rem;
  margin: 1.25rem 0 0.75rem;
}

.ingredient-group {
  margin-bottom: 1rem;
}
.ingredient-group h4 {
  font-size: 0.95rem;
  color: var(--red);
  font-weight: 700;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ingredient-list {
  list-style: none;
  padding: 0;
}
.ingredient-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f5f5f5;
  font-size: 0.95rem;
  line-height: 1.35;
}
.ingredient-list li:last-child { border-bottom: none; }

.ingredient-checkbox {
  width: 22px;
  height: 22px;
  min-width: 22px;
  accent-color: var(--green);
  margin-top: 2px;
  cursor: pointer;
}
.qty-highlight {
  font-weight: 700;
  color: var(--text);
}
.badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  margin-left: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-produce { background: var(--green-light); color: var(--green); }
.badge-bulk { background: #fff3e0; color: #e65100; }

/* Instructions */
.instructions-list {
  list-style: none;
  padding: 0;
  counter-reset: step;
}
.instructions-list li {
  counter-increment: step;
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f5f5f5;
  font-size: 0.95rem;
  line-height: 1.5;
}
.instructions-list li:last-child { border-bottom: none; }
.step-number {
  background: var(--red);
  color: #fff;
  width: 28px;
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 2px;
}
.step-number::after { content: counter(step); }

/* Action bar */
.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-border);
}

/* ─── Recipe Cards Grid ─────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 390px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
}

.recipe-thumb-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.recipe-thumb-card:hover { box-shadow: var(--shadow-hover); }

.recipe-thumb-card .thumb-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: var(--gray-bg);
}
.recipe-thumb-card .thumb-placeholder {
  width: 100%;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
  font-size: 3rem;
}

.recipe-thumb-card .thumb-body {
  padding: 0.75rem;
}
.recipe-thumb-card .thumb-body h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 0.35rem;
}
.recipe-thumb-card .thumb-body .thumb-meta {
  font-size: 0.75rem;
  color: var(--text-light);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.recipe-thumb-card .thumb-body .thumb-tags {
  margin-top: 0.35rem;
}

/* ─── Shopping Page ──────────────────────────────────────────────── */
.shopping-tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-border);
  margin-bottom: 1.5rem;
}
.shopping-tab {
  flex: 1;
  text-align: center;
  padding: 0.75rem 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-light);
  border-bottom: 3px solid transparent;
  cursor: pointer;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  transition: all 0.15s;
  margin-bottom: -2px;
}
.shopping-tab.active {
  color: var(--red);
  border-bottom-color: var(--red);
}
.shopping-tab:hover { color: var(--red); }

.shopping-panel { display: none; }
.shopping-panel.active { display: block; }

.shop-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.shop-card h3 {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.shop-card .shop-label {
  font-size: 0.8rem;
  color: var(--text-light);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
  padding: 0.35rem 0.75rem;
  background: var(--green-light);
  color: var(--green);
  border-radius: 4px;
  display: inline-block;
}
.shop-card .shop-label.bulk {
  background: #fff3e0;
  color: #e65100;
}

/* Week tab buttons */
.week-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.week-tab-btn {
  padding: 0.5rem 1rem;
  border: 2px solid var(--gray-border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 44px;
}
.week-tab-btn.active {
  border-color: var(--red);
  background: var(--red-light);
  color: var(--red);
}
.week-tab-btn:hover { border-color: var(--red); }

/* Shopping list ingredients */
.shop-ingredients {
  list-style: none;
  padding: 0;
}
.shop-ingredients li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f5f5f5;
  font-size: 0.95rem;
}
.shop-ingredients li:last-child { border-bottom: none; }
.shop-ingredients .qty { font-weight: 700; }

/* Category header in shopping list */
.category-header {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.75rem 0 0.25rem;
  border-bottom: 2px solid var(--gray-border);
  margin-top: 0.5rem;
}

/* ─── Setup Page ─────────────────────────────────────────────────── */
.setup-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-height) - var(--tab-height));
  padding: 1rem;
}
.setup-box {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 1.5rem;
  max-width: 440px;
  width: 100%;
  text-align: center;
}
.setup-box h1 {
  font-size: 2rem;
  color: var(--red);
  margin-bottom: 0.5rem;
}
.setup-box p {
  color: var(--text-light);
  margin-bottom: 1.5rem;
  font-size: 1rem;
  line-height: 1.5;
}
.setup-box input[type="text"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--gray-border);
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  text-align: center;
  margin-bottom: 1rem;
}
.setup-box input[type="text"]:focus {
  outline: none;
  border-color: var(--red);
}
.setup-box .btn { width: 100%; }

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 300;
}
.loading-spinner {
  width: 48px;
  height: 48px;
  border: 5px solid var(--gray-border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
  margin-top: 1rem;
  font-size: 1rem;
  color: var(--text-light);
}

/* ─── Toast / Confirmation ────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(var(--tab-height) + 16px);
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 300;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  opacity: 0;
  transition: opacity 0.3s;
}
.toast.show { opacity: 1; }

/* ─── Confirm dialog ───────────────────────────────────────────── */
.confirm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.confirm-box {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}
.confirm-box h3 {
  font-size: 1.15rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.confirm-box p {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 1.25rem;
}
.confirm-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

/* ─── Settings Page ──────────────────────────────────────────────── */
.settings-form {
  max-width: 400px;
  margin: 0 auto;
}
.settings-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text);
}
.settings-form input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--gray-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  margin-bottom: 1rem;
}
.settings-form input:focus {
  outline: none;
  border-color: var(--red);
}
.settings-current {
  background: var(--gray-bg);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.settings-current strong { color: var(--text); }

/* ─── Responsive helpers ─────────────────────────────────────────── */
@media (min-width: 768px) {
  .days-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
  }
  .day-card .card-body { padding: 1rem; }
  .recipe-body { padding: 2rem; }
}

@media (min-width: 390px) and (max-width: 767px) {
  .container { padding: 0.75rem; }
}

/* ================================================================
   Recipe Detail Page — Clean & Minimal
   ================================================================ */

/* ─── Breadcrumb ────────────────────────────────────────────────── */
.page-breadcrumb {
  font-size: 0.85rem;
  color: var(--gray-text);
  padding: 0.75rem 0 0.25rem;
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}
.page-breadcrumb a { color: var(--brand); text-decoration: none; }
.page-breadcrumb a:hover { text-decoration: underline; }
.page-breadcrumb .sep { color: var(--gray-text); }
.page-breadcrumb .current { color: var(--text); font-weight: 500; }

/* ─── Hero Image ────────────────────────────────────────────────── */
.recipe-hero-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0.5rem 0 0;
  max-height: 500px;
}
.recipe-hero-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  aspect-ratio: 4/3;
}
.recipe-hero-ph {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--gray-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  border-radius: var(--radius);
}

/* ─── Header ────────────────────────────────────────────────────── */
.recipe-header {
  padding: 1rem 0 0.5rem;
}
.recipe-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 0.4rem;
}
.recipe-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.stars-row {
  display: inline-flex;
  align-items: center;
  gap: 0;
}
.star { color: #dee2e6; font-size: 1.2rem; letter-spacing: 1px; }
.star.filled { color: #f4a340; }
.rating-num {
  margin-left: 0.3rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
}
.rating-meta {
  font-size: 0.85rem;
  color: var(--gray-text);
}
.recipe-desc {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}
.recipe-byline {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--gray-text);
  margin-bottom: 0.75rem;
}
.recipe-byline strong { color: var(--text); }
.recipe-byline .sep { color: var(--gray-border); }

/* ─── Pill Buttons (Save, Rate) ─────────────────────────────────── */
.recipe-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.recipe-actions-bottom {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-border);
  margin-top: 1rem;
}
.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--gray-border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  line-height: 1;
}
.btn-pill:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-light);
}
.btn-pill-save { }
.btn-pill-rate {
  color: #f4a340;
  border-color: #f4a340;
  cursor: default;
}

/* ─── Details Grid ──────────────────────────────────────────────── */
.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 1px;
  background: var(--gray-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 0.75rem;
}
.detail-cell {
  background: var(--gray-bg);
  padding: 0.7rem 0.6rem;
  text-align: center;
}
.detail-label {
  display: block;
  font-size: 0.7rem;
  color: var(--gray-text);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.15rem;
}
.detail-value {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

/* ─── Tags ──────────────────────────────────────────────────────── */
.recipe-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}
.tag-pill {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: var(--brand-light);
  color: var(--brand);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: capitalize;
}

/* ─── Content Split ─────────────────────────────────────────────── */
.recipe-content-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 768px) {
  .recipe-content-split {
    grid-template-columns: 360px 1fr;
  }
}
.section-stroke {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--brand-light);
}
.yield-note {
  font-size: 0.85rem;
  color: var(--gray-text);
  margin-bottom: 0.75rem;
}

/* ─── Ingredients ───────────────────────────────────────────────── */
.ing-group {
  margin-bottom: 0.4rem;
}
.ing-cat {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}
.ing-list {
  list-style: none;
  padding: 0;
}
.ing-row {
  padding: 0.3rem 0;
  border-bottom: 1px solid #f0f0f0;
}
.ing-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.88rem;
}
.ing-cb {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.cb-box {
  display: inline-flex;
  width: 17px;
  height: 17px;
  border: 2px solid var(--gray-border);
  border-radius: 3px;
  flex-shrink: 0;
  position: relative;
  transition: all 0.15s;
}
.ing-cb:checked + .cb-box {
  background: var(--brand);
  border-color: var(--brand);
}
.ing-cb:checked + .cb-box::after {
  content: '✓';
  color: #fff;
  font-size: 11px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.ing-cb:checked ~ .ing-qty,
.ing-cb:checked ~ .ing-name {
  text-decoration: line-through;
  color: var(--gray-text);
}
.ing-qty {
  font-weight: 700;
  color: var(--brand);
  white-space: nowrap;
  min-width: 45px;
}
.ing-name {
  color: var(--text);
}

/* ─── Directions ────────────────────────────────────────────────── */
.steps-list {
  list-style: none;
  padding: 0;
}
.step-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid #f0f0f0;
}
.step-item:last-child { border-bottom: none; }
.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  border-radius: 50%;
  flex-shrink: 0;
}
.step-text {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text);
  flex: 1;
  padding-top: 0.15rem;
}

/* ─── Nav ───────────────────────────────────────────────────────── */
.recipe-nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
}
.nav-back {
  color: var(--brand);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}
.nav-back:hover { text-decoration: underline; }

/* ================================================================
   Shopping List — Synced Checkboxes
   ================================================================ */
.shop-card {
  background: var(--gray-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.shop-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.2rem; }
.shop-label { font-size: 0.8rem; color: var(--gray-text); display: block; margin-bottom: 0.75rem; }
.shop-label.bulk { color: var(--brand); font-weight: 600; }

.category-header {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid var(--brand-light);
}
.shop-ingredients { list-style: none; padding: 0; }
.shop-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px solid #f0f0f0;
}
.shop-label-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  flex: 1;
}
.shop-cb { position: absolute; opacity: 0; width: 0; height: 0; }
.shop-cb-box {
  display: inline-flex;
  width: 18px;
  height: 18px;
  border: 2px solid var(--gray-border);
  border-radius: 4px;
  flex-shrink: 0;
  position: relative;
  transition: all 0.15s;
}
.shop-cb:checked + .shop-cb-box { background: var(--brand); border-color: var(--brand); }
.shop-cb:checked + .shop-cb-box::after {
  content: '✓';
  color: #fff;
  font-size: 12px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.shop-cb:checked ~ .shop-qty,
.shop-cb:checked ~ .shop-name,
.shop-cb:checked ~ .shop-pantry {
  text-decoration: line-through;
  color: var(--gray-text);
}
.shop-qty {
  font-weight: 700;
  color: var(--brand);
  white-space: nowrap;
  min-width: 60px;
}
.shop-name { color: var(--text); }
.shop-pantry { font-style: italic; color: var(--gray-text); font-size: 0.85rem; }
.shop-checked-by {
  font-size: 0.72rem;
  color: var(--brand);
  font-weight: 600;
  white-space: nowrap;
  margin-left: 0.5rem;
}

/* Shopping tabs */
.shopping-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.shopping-tab {
  padding: 0.5rem 1rem;
  border: 1px solid var(--gray-border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}
.shopping-tab.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.shopping-panel { display: none; }
.shopping-panel.active { display: block; }

/* Week tabs for produce */
.week-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.week-tab-btn {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--gray-border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
}
.week-tab-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.week-panel { display: none; }
.week-panel.active { display: block; }

/* ================================================================
   Month Grid — 4 Weeks Side by Side
   ================================================================ */
.month-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.week-block {
  background: var(--gray-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}
.week-block-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--brand-light);
}
.week-empty {
  text-align: center;
  color: var(--gray-text);
  padding: 1rem;
  font-size: 0.9rem;
}
.week-days {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
@media (min-width: 768px) {
  .week-days {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
  }
}

/* Pool cards on recipes page */
.pool-card {
  opacity: 0.75;
  transition: opacity 0.2s;
}
.pool-card:hover { opacity: 1; }