/* ─── Reset & Variables ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:             #fdfaf6;
  --surface:        #fdfaf6;
  --card:           #fffdf9;
  --text-primary:   #1a1208;
  --text-secondary: #6b5a4e;
  --text-muted:     #9e8e84;
  --accent:         #c4622d;
  --accent-light:   #f5ede5;
  --green:          #5a6e3a;
  --green-light:    #eef2e6;
  --gold:           #a07820;
  --gold-light:     #f5f0e0;
  --border:         #e8dfd4;
  --shadow-sm:      0 1px 3px rgba(44,24,16,0.07);
  --shadow-md:      0 4px 16px rgba(44,24,16,0.10);
  --shadow-lg:      0 8px 32px rgba(44,24,16,0.14);
  --radius:         12px;
  --radius-sm:      8px;
  --font-head:      'Playfair Display', Georgia, serif;
  --font-body:      'Inter', system-ui, sans-serif;
  --max-width:      1200px;
  --gutter:         24px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ─── Header ──────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px var(--gutter) 8px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
}


.header-utils {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.util-btn {
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--card);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.util-btn.nav-btn-planner { color: var(--green); border-color: rgba(90,110,58,0.25); }
.util-btn.nav-btn-planner:hover,
.util-btn.nav-btn-planner.active { background: var(--green); color: white; border-color: var(--green); }
.util-btn.nav-btn-guide { color: #1a4a6b; border-color: rgba(26,74,107,0.25); }
.util-btn.nav-btn-guide:hover,
.util-btn.nav-btn-guide.active { background: #1a4a6b; color: white; border-color: #1a4a6b; }

.logo-name { font-family: var(--font-head); font-weight: 700; font-size: 28px; line-height: 1; }
.logo-tagline { font-size: 11px; color: var(--text-muted); letter-spacing: 0.03em; }

.nav-wrap { position: relative; width: 100%; }
.category-nav { display: flex; justify-content: space-between; gap: 2px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; width: 100%; }
.category-nav::-webkit-scrollbar { display: none; }

.nav-btn {
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 20px;
  background: none;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-align: center;
}

.nav-btn:hover { background: var(--accent-light); color: var(--accent); }
.nav-btn.active { background: var(--accent); color: white; border-color: var(--accent); }

.nav-btn-special { background: #f5f0e0; color: #a07820; border-color: rgba(160,120,32,0.2); }
.nav-btn-special:hover { background: #a07820; color: white; }
.nav-btn-special.active { background: #a07820; color: white; border-color: #a07820; }

.nav-btn-dessert { background: #fce8f0; color: #b03070; border-color: rgba(176,48,112,0.2); }
.nav-btn-dessert:hover { background: #b03070; color: white; }
.nav-btn-dessert.active { background: #b03070; color: white; border-color: #b03070; }
.nav-btn-baking { background: #f5ede0; color: #8a5020; border-color: rgba(138,80,32,0.2); }
.nav-btn-baking:hover { background: #8a5020; color: white; }
.nav-btn-baking.active { background: #8a5020; color: white; border-color: #8a5020; }
.nav-btn-drink { background: #e8f5e8; color: #2a7a3a; border-color: rgba(42,122,58,0.2); }
.nav-btn-drink:hover { background: #2a7a3a; color: white; }
.nav-btn-drink.active { background: #2a7a3a; color: white; border-color: #2a7a3a; }
.nav-btn-planner { background: var(--green-light); color: var(--green); border-color: rgba(90,110,58,0.2); }
.nav-btn-planner:hover { background: var(--green); color: white; }
.nav-btn-planner.active { background: var(--green); color: white; border-color: var(--green); }

/* ─── Hero ────────────────────────────────────────────────────────────────── */
.hero-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px var(--gutter) 0;
  margin-bottom: 32px;
}

.hero-featured {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  min-height: 280px;
  display: flex;
  align-items: flex-end;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hero-featured:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(0,0,0,0.18); }

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 28px 32px;
  width: 100%;
}

.hero-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  margin-bottom: 6px;
}

.hero-title {
  font-family: var(--font-head);
  font-size: 32px;
  font-weight: 700;
  color: white;
  line-height: 1.15;
  margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.hero-desc {
  font-size: 14px;
  color: rgba(255,255,255,0.82);
  max-width: 520px;
  line-height: 1.5;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hero-meta-item {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  gap: 5px;
}

.hero-cta {
  margin-left: auto;
  background: white;
  color: #1a1208;
  border: none;
  border-radius: 20px;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.hero-cta:hover { background: #f0ebe0; }

/* ─── Ingredient search bar ───────────────────────────────────────────────── */
.ingredient-search-bar {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter) 28px;
}

.ingredient-search-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 40px;
  padding: 10px 18px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ingredient-search-inner:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(196,98,45,0.10);
}

.isb-icon { font-size: 16px; flex-shrink: 0; opacity: 0.5; }

.isb-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
}

.isb-input::placeholder { color: var(--text-muted); }

.isb-clear {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: color 0.15s;
}

.isb-clear:hover { color: var(--accent); }

/* ─── Dietary filter bar ──────────────────────────────────────────────────── */
.diet-filter-bar {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter) 16px;
}

.diet-filter-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.diet-filter-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex-shrink: 0;
}

.diet-filter-btn {
  padding: 8px 18px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.diet-filter-btn:hover {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-light);
}

.diet-filter-btn.active {
  background: #3d5226;
  color: white;
  border-color: #3d5226;
}

.activity-filter-btn {
  padding: 8px 18px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.activity-filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}
.activity-filter-btn.active {
  background: #8b3515;
  color: white;
  border-color: #8b3515;
}

.diet-filter-clear {
  padding: 6px 12px;
  border-radius: 20px;
  border: none;
  background: none;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.15s;
}
.diet-filter-clear:hover { color: var(--accent); }

/* ─── Section header ──────────────────────────────────────────────────────── */
.section-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter) 20px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.section-header h2 { font-family: var(--font-head); font-size: 28px; font-weight: 700; }
#recipe-count { font-size: 13px; color: var(--text-muted); }

/* ─── Recipe Grid ─────────────────────────────────────────────────────────── */
.recipe-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter) 80px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.empty-state {
  grid-column: 1/-1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state p { font-size: 16px; margin-bottom: 6px; }
.empty-hint { font-size: 13px; color: var(--text-muted) !important; }

/* ─── Recipe Card ─────────────────────────────────────────────────────────── */
.recipe-card {
  background: var(--card, #fffdf9);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid var(--border);
  min-height: 220px;
}

.recipe-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.card-image {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  position: relative;
}

.card-image:not(.card-image-photo)::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.1) 60%, transparent 100%);
  pointer-events: none;
}

.card-badges { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; flex-wrap: wrap; }

.badge {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 12px;
  backdrop-filter: blur(4px);
}

.badge-dinner    { background: rgba(196,98,45,0.88);  color: white; }
.badge-lunch     { background: rgba(90,110,58,0.88);  color: white; }
.badge-breakfast { background: rgba(160,120,32,0.88); color: white; }
.badge-time      { background: rgba(0,0,0,0.42);      color: white; }
.badge-match     { background: rgba(90,140,60,0.92);  color: white; }
.badge-special   { background: rgba(160,120,32,0.92); color: white; letter-spacing: 0.03em; }
.badge-dessert { background: rgba(176,48,112,0.88); color: white; }
.badge-baking  { background: rgba(138,80,32,0.88);  color: white; }
.badge-drink   { background: rgba(42,122,58,0.88);   color: white; }

.card-image-special { height: 200px; }

.recipe-card:has(.badge-special) {
  border-color: rgba(160,120,32,0.3);
  box-shadow: 0 2px 8px rgba(160,120,32,0.10);
}

.recipe-card:has(.badge-special):hover {
  box-shadow: 0 8px 24px rgba(160,120,32,0.18);
}

.card-body { padding: 16px 20px 20px; }

.card-title {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.3;
}

.card-subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }

.card-description {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta { margin-top: 14px; display: flex; gap: 16px; }
.meta-item { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.meta-icon { font-size: 13px; }

/* ─── Detail View ─────────────────────────────────────────────────────────── */
.detail-back {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px var(--gutter) 0;
}

.back-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.back-btn:hover { background: var(--surface); color: var(--text-primary); border-color: var(--text-secondary); }

.detail-header {
  height: 300px;
  display: flex;
  align-items: flex-end;
  position: relative;
  margin-top: 24px;
}

.detail-header-bg { position: absolute; inset: 0; }

.detail-emoji {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -62%);
  font-size: 96px;
  line-height: 1;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.35));
}

.detail-header-text {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  padding: 28px var(--gutter);
}

.detail-category-badge {
  display: inline-block;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.10em; text-transform: uppercase;
  color: rgba(255,255,255,0.92);
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 12px;
  padding: 3px 12px;
  margin-bottom: 10px;
  backdrop-filter: blur(4px);
}

.detail-title {
  font-family: var(--font-head);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  color: white;
  line-height: 1.15;
  text-shadow: 0 2px 10px rgba(0,0,0,0.35);
  margin-bottom: 4px;
}

.detail-subtitle { font-size: 16px; color: rgba(255,255,255,0.82); text-shadow: 0 1px 4px rgba(0,0,0,0.3); }

.detail-meta-bar { background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.detail-meta-bar-inner { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--gutter); display: flex; }

.detail-meta-item { padding: 16px 32px 16px 0; margin-right: 32px; border-right: 1px solid var(--border); }
.detail-meta-item:last-child { border-right: none; }
.detail-meta-label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 2px; }
.detail-meta-value { font-size: 16px; font-weight: 600; }

.detail-body { max-width: var(--max-width); margin: 0 auto; padding: 40px var(--gutter) 80px; }

.detail-description {
  font-family: var(--font-head);
  font-size: 18px;
  font-style: italic;
  color: var(--text-secondary);
  max-width: 680px;
  line-height: 1.7;
  margin-bottom: 48px;
}

.detail-columns { display: grid; grid-template-columns: 280px 1fr; gap: 64px; align-items: start; }

.ingredients-section h3,
.instructions-section h3 {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

.ingredients-list { list-style: none; }
.ingredient-amount { font-weight: 600; color: var(--accent); min-width: 72px; flex-shrink: 0; font-size: 14px; }
.ingredient-item { color: var(--text-secondary); font-size: 14px; line-height: 1.4; }

.instructions-list { list-style: none; }
.instruction-item { display: flex; gap: 20px; margin-bottom: 28px; }
.instruction-item:last-child { margin-bottom: 0; }
.step-number { width: 32px; height: 32px; background: var(--accent); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; margin-top: 2px; }
.step-content { flex: 1; }
.step-title { font-family: var(--font-head); font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.step-detail { font-size: 14px; color: var(--text-secondary); line-height: 1.65; }

.detail-notes { margin-top: 48px; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.note-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 20px 24px; }
.note-label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.note-text { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }
.note-card.tip { background: var(--accent-light); border-color: rgba(196,98,45,0.2); }
.note-card.make-ahead { background: var(--green-light); border-color: rgba(90,110,58,0.2); }
.note-card.make-ahead .note-label { color: var(--green); }
.note-card.serving { background: var(--gold-light); border-color: rgba(160,120,32,0.2); }
.note-card.serving .note-label { color: var(--gold); }
.note-card.substitutions { background: #eef2f8; border-color: rgba(60,90,160,0.2); }
.note-card.substitutions .note-label { color: #3a5a9a; }
.note-card.lighter { background: #f0eef8; border-color: rgba(100,80,160,0.2); }
.note-card.lighter .note-label { color: #6050a0; }

/* ─── Planner View ────────────────────────────────────────────────────────── */
.planner-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.planner-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px var(--gutter);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.planner-title { font-family: var(--font-head); font-size: 28px; font-weight: 700; margin-bottom: 4px; }
.planner-sub { font-size: 14px; color: var(--text-secondary); }

.planner-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.planner-btn {
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.planner-btn-primary { background: var(--accent); color: white; }
.planner-btn-primary:hover { background: #b0551f; }
.planner-btn-secondary { background: var(--green); color: white; }
.planner-btn-secondary:hover { background: #4a5c30; }
.planner-btn-ghost { background: none; color: var(--text-secondary); border-color: var(--border); }
.planner-btn-ghost:hover { border-color: var(--text-secondary); color: var(--text-primary); }

/* Planner grid */
.planner-grid-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px var(--gutter);
  overflow-x: auto;
}

.planner-grid { min-width: 700px; }

.pg-header-row,
.pg-meal-row {
  display: grid;
  grid-template-columns: 100px repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.pg-corner { /* empty top-left cell */ }

.pg-day-header {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 4px;
}

.pg-day-short { display: none; }

.pg-meal-label {
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
  padding-right: 8px;
}

.pg-cell {
  min-height: 72px;
  display: flex;
  align-items: stretch;
}

.pg-add-btn {
  flex: 1;
  background: var(--surface);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
}

.pg-add-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.pg-recipe-chip {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  position: relative;
  transition: box-shadow 0.15s ease;
  overflow: hidden;
}

.pg-recipe-chip:hover { box-shadow: var(--shadow-md); }

.pg-chip-emoji { font-size: 20px; line-height: 1; }
.pg-chip-name { font-size: 11px; font-weight: 500; color: var(--text-primary); line-height: 1.3; }

.pg-chip-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  background: rgba(44,24,16,0.08);
  border: none;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  color: var(--text-primary);
}

.pg-recipe-chip:hover .pg-chip-remove { opacity: 1; }

/* Picker modal */
.pg-picker {
  position: fixed;
  inset: 0;
  background: rgba(44,24,16,0.4);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.pg-picker-inner {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pg-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 8px;
}

.pg-picker-header h3 { font-family: var(--font-head); font-size: 20px; font-weight: 600; }

.pg-picker-close {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  transition: color 0.15s;
}

.pg-picker-close:hover { color: var(--text-primary); }

.pg-picker-sub { padding: 0 20px 16px; font-size: 13px; color: var(--text-muted); }

.pg-picker-list { overflow-y: auto; padding: 0 12px 12px; }

.pg-picker-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}

.pg-picker-item:hover { background: var(--accent-light); }
.pg-picker-emoji { font-size: 28px; flex-shrink: 0; }
.pg-picker-info { display: flex; flex-direction: column; gap: 2px; }
.pg-picker-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.pg-picker-meta { font-size: 12px; color: var(--text-muted); }

/* ─── Shopping List ───────────────────────────────────────────────────────── */
.shopping-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter) 80px;
}

.shopping-header { margin-bottom: 28px; padding-top: 8px; border-top: 2px solid var(--border); }
.shopping-title { font-family: var(--font-head); font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.shopping-sub { font-size: 14px; color: var(--text-secondary); }

.shopping-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.shop-category {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.shop-cat-heading {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.shop-list { list-style: none; padding: 4px 0; }

.shop-item { border-bottom: 1px solid var(--border); }
.shop-item:last-child { border-bottom: none; }

.shop-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  cursor: pointer;
  transition: background 0.12s;
}

.shop-label:hover { background: var(--bg); }

.shop-check {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

.shop-item-text { flex: 1; font-size: 13px; color: var(--text-primary); line-height: 1.4; }
.shop-item-text strong { color: var(--accent); font-weight: 600; }

.shop-recipe-tag {
  font-size: 10.5px;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.shop-label:has(.shop-check:checked) .shop-item-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.shopping-empty { font-size: 15px; color: var(--text-muted); padding: 32px 0; }

/* ─── Home sections (All view) ────────────────────────────────────────────── */
.recipe-sections {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter) 80px;
}

.recipe-section {
  margin-bottom: 52px;
}

.recipe-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border);
}

.recipe-section-title-group {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.recipe-section-title {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  position: relative;
}

.recipe-section-title::after {
  content: '';
  display: block;
  position: absolute;
  bottom: -16px;
  left: 0;
  width: 32px;
  height: 3px;
  background: var(--sec-accent, var(--accent));
  border-radius: 2px;
}

.recipe-section-count {
  font-size: 13px;
  color: var(--text-muted);
}

.recipe-section-more {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  opacity: 0.85;
  transition: opacity 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.recipe-section-more:hover { opacity: 1; text-decoration: underline; }

.recipe-section-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 1100px) {
  .recipe-section-row { grid-template-columns: repeat(3, 1fr); }
  .recipe-section-row .recipe-card:nth-child(4) { display: none; }
}

@media (max-width: 720px) {
  .recipe-section-row { grid-template-columns: repeat(2, 1fr); }
  .recipe-section-row .recipe-card:nth-child(3),
  .recipe-section-row .recipe-card:nth-child(4) { display: none; }
}

/* ─── Photo support ───────────────────────────────────────────────────────── */

/* Card with photo — darken bottom for badge legibility */
.card-image-photo {
  position: relative;
}
.card-image-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    rgba(0,0,0,0.25) 0%,
    rgba(0,0,0,0) 40%,
    rgba(0,0,0,0.1) 100%);
  pointer-events: none;
}

/* Detail header with photo */
.detail-header-photo {
  height: 420px;
}
.detail-header-photo .detail-header-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    rgba(0,0,0,0.1) 0%,
    rgba(0,0,0,0.55) 100%);
}
.detail-header-photo .detail-header-text {
  text-shadow: 0 1px 6px rgba(0,0,0,0.4);
}

/* Related card with photo */
.related-img-photo {
  font-size: 0;
}

/* ─── Saved nav button ────────────────────────────────────────────────────── */
.nav-btn-saved { background: #fce8f0; color: #b03070; border-color: rgba(176,48,112,0.2); }
.nav-btn-saved:hover { background: #b03070; color: white; }
.nav-btn-saved.active { background: #b03070; color: white; border-color: #b03070; }

/* ─── Difficulty badges ───────────────────────────────────────────────────── */
.badge-diff { text-transform: none; letter-spacing: 0; }
.badge-diff-easy   { background: rgba(42,122,58,0.85);  color: white; }
.badge-diff-medium { background: rgba(160,120,32,0.85); color: white; }
.badge-diff-hard   { background: rgba(180,50,30,0.85);  color: white; }

.detail-difficulty {
  display: inline-block;
  font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 10px;
  margin-left: 6px;
}

.detail-header-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }

/* ─── Bookmark button on card ─────────────────────────────────────────────── */
.card-bookmark {
  position: absolute;
  bottom: 10px; right: 10px;
  width: 30px; height: 30px;
  background: rgba(255,255,255,0.88);
  border: none; border-radius: 50%;
  font-size: 16px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  color: #b03070;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.recipe-card:hover .card-bookmark,
.card-bookmark.is-saved { opacity: 1; }
.card-bookmark.is-saved { background: #b03070; color: white; }

/* ─── Cooked tracking ─────────────────────────────────────────────────────── */
.badge-cooked { background: rgba(40,130,65,0.92); color: white; }

.card-cooked { border-color: rgba(40,140,60,0.35) !important; }
.card-cooked .card-image { position: relative; }
.card-cooked .card-image::after {
  content: '✓';
  position: absolute;
  bottom: 10px; right: 10px;
  width: 26px; height: 26px;
  background: rgba(40,140,60,0.88);
  color: white;
  border-radius: 50%;
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.detail-actions {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px var(--gutter);
  display: flex;
  align-items: center;
  gap: 12px;
}

.cooked-btn {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  border: 1.5px solid rgba(40,140,60,0.4);
  background: none; color: #2a7a3a;
  transition: all 0.15s ease;
}
.cooked-btn:hover { background: #2a7a3a; color: white; border-color: #2a7a3a; }
.cooked-btn.is-cooked { background: #2a7a3a; color: white; border-color: #2a7a3a; }

/* ─── Serving scaler ──────────────────────────────────────────────────────── */
.detail-meta-serves .detail-meta-label { margin-bottom: 6px; }

.serves-scaler {
  display: flex;
  align-items: center;
  gap: 8px;
}

.scale-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 16px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: all 0.15s;
  flex-shrink: 0;
}
.scale-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

.scale-value { font-size: 16px; font-weight: 600; min-width: 20px; text-align: center; }

/* ─── Detail action bar ───────────────────────────────────────────────────── */
.detail-actions {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px var(--gutter);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}

.save-btn, .cooked-btn, .print-btn {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.save-btn {
  border: 1.5px solid rgba(176,48,112,0.35);
  background: none; color: #b03070;
}
.save-btn:hover { background: #b03070; color: white; border-color: #b03070; }
.save-btn.is-saved { background: #b03070; color: white; border-color: #b03070; }

.cooked-btn {
  border: 1.5px solid rgba(40,140,60,0.4);
  background: none; color: #2a7a3a;
}
.cooked-btn:hover { background: #2a7a3a; color: white; border-color: #2a7a3a; }
.cooked-btn.is-cooked { background: #2a7a3a; color: white; border-color: #2a7a3a; }

.print-btn {
  border: 1px solid var(--border);
  background: none; color: var(--text-secondary);
}
.print-btn:hover { border-color: var(--text-secondary); color: var(--text-primary); }

/* ─── Dietary tags ────────────────────────────────────────────────────────── */
.diet-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }

.diet-tag {
  font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 10px;
  letter-spacing: 0.02em;
}
.diet-veg    { background: #e8f5e8; color: #2a6a2a; border: 1px solid rgba(42,106,42,0.2); }
.diet-dairy  { background: #f0f4ff; color: #2a3a8a; border: 1px solid rgba(42,58,138,0.2); }
.diet-gluten { background: #fff8e8; color: #8a6010; border: 1px solid rgba(138,96,16,0.2); }

/* ─── Macros bar ──────────────────────────────────────────────────────────── */
.detail-macros {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.detail-macros-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px var(--gutter);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.macros-label {
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--text-muted);
  flex-shrink: 0;
}

.macro-bar-wrap { flex: 1; min-width: 120px; max-width: 240px; }
.macro-bar {
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  background: var(--border);
}
.macro-seg { height: 100%; transition: width 0.3s ease; }
.macro-seg-protein { background: #3a72c0; }
.macro-seg-carbs   { background: #c09030; }
.macro-seg-fat     { background: #c04040; }

.macro-legend { display: flex; gap: 8px; flex-wrap: wrap; }
.macro-pill {
  font-size: 12px; font-weight: 600;
  padding: 4px 12px; border-radius: 12px;
}
.macro-protein { background: #e4edf8; color: #1e4a80; }
.macro-carbs   { background: #f5f0df; color: #7a5510; }
.macro-fat     { background: #fce8e8; color: #902020; }

/* ─── Related recipes ─────────────────────────────────────────────────────── */
.related-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px var(--gutter) 64px;
  border-top: 2px solid var(--border);
}

.related-title {
  font-family: var(--font-head);
  font-size: 22px; font-weight: 700;
  margin-bottom: 20px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.related-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: box-shadow 0.15s, transform 0.15s;
  font-family: var(--font-body);
}
.related-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.related-img {
  width: 56px; height: 56px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.related-name { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 3px; line-height: 1.3; }
.related-meta { font-size: 12px; color: var(--text-muted); }

/* ─── Print button ────────────────────────────────────────────────────────── */
.shopping-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-print {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-print:hover { border-color: var(--text-secondary); color: var(--text-primary); }

/* ─── Print styles ────────────────────────────────────────────────────────── */
@media print {
  /* Hide everything that's not content */
  .site-header,
  .detail-back,
  .detail-actions,
  .detail-macros,
  .related-section,
  .planner-header,
  .planner-grid-wrap,
  .btn-print,
  .site-footer { display: none !important; }

  body { background: white; font-size: 11pt; }

  /* Recipe detail print */
  #detail-view { display: block !important; }
  .detail-header { height: auto !important; min-height: 80pt; page-break-after: avoid; }
  .detail-header-bg { opacity: 0.15; }
  .detail-emoji { font-size: 48pt; top: 10pt; }
  .detail-title { font-size: 22pt; }
  .detail-subtitle { font-size: 12pt; }
  .detail-meta-bar-inner { flex-wrap: wrap; }
  .detail-columns { grid-template-columns: 1fr 2fr; gap: 24pt; }
  .detail-body { padding: 16pt 20pt; }
  .detail-description { font-size: 10pt; margin-bottom: 16pt; }
  .ingredients-list li { padding: 5pt 0; }
  .instruction-item { margin-bottom: 12pt; }
  .step-detail { font-size: 10pt; }
  .detail-notes { margin-top: 16pt; }
  .note-card { break-inside: avoid; }

  /* Shopping list print */
  .shopping-section { padding: 16pt 0 !important; }
  .shopping-header { border-top: none; margin-bottom: 16pt; }
  .shopping-title { font-size: 20pt; }
  .shopping-sub { font-size: 10pt; }
  .shopping-content { grid-template-columns: repeat(3, 1fr); gap: 10pt; }
  .shop-category { break-inside: avoid; }
  .shop-cat-heading { font-size: 8pt; padding: 6pt 10pt; }
  .shop-label { padding: 5pt 10pt; }
  .shop-item-text { font-size: 10pt; }
  .shop-recipe-tag { font-size: 8pt; }
  .shop-check { display: none; }
  .shop-label::before { content: '☐'; font-size: 12pt; margin-right: 6pt; }
}

/* ─── Breadcrumb ──────────────────────────────────────────────────────────── */
.detail-breadcrumb {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px var(--gutter) 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.bc-link {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  transition: color 0.12s;
}
.bc-link:hover { color: var(--accent); text-decoration: underline; }

.bc-sep { color: var(--text-muted); user-select: none; }

.bc-current {
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

/* ─── Ingredient checkboxes ───────────────────────────────────────────────── */
.ingredients-list li {
  display: block;
  padding: 0;
  border-bottom: 1px solid var(--border);
}
.ingredients-list li:last-child { border-bottom: none; }

.ingredient-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 4px;
  cursor: pointer;
  width: 100%;
  transition: background 0.1s;
  border-radius: 4px;
}
.ingredient-row:hover { background: var(--accent-light); }

.ing-check {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  cursor: pointer;
  margin-top: 1px;
}

.ingredient-row:has(.ing-check:checked) .ingredient-amount,
.ingredient-row:has(.ing-check:checked) .ingredient-item {
  text-decoration: line-through;
  color: var(--text-muted);
  opacity: 0.65;
}

/* ─── Add-to-plan picker modal ────────────────────────────────────────────── */
.plan-picker-modal {
  position: fixed;
  inset: 0;
  background: rgba(44,24,16,0.45);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.plan-picker-inner {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 540px;
  overflow: hidden;
}

.plan-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--border);
}

.plan-picker-header h3 {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
}

.plan-picker-close {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  transition: color 0.15s;
}
.plan-picker-close:hover { color: var(--text-primary); }

.plan-picker-recipe {
  padding: 14px 20px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.plan-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  padding: 16px 20px;
}

.ppg-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.ppg-day-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
}

.ppg-slot {
  width: 100%;
  padding: 8px 0;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.ppg-slot:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: scale(1.08);
}

.plan-picker-hint {
  padding: 0 20px 16px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

/* ─── Plan button ─────────────────────────────────────────────────────────── */
.plan-btn {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  border: 1.5px solid rgba(90,110,58,0.35);
  background: none;
  color: var(--green);
}
.plan-btn:hover { background: var(--green); color: white; border-color: var(--green); }

/* ─── Toast notification ──────────────────────────────────────────────────── */
.app-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: var(--text-primary);
  color: white;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  white-space: nowrap;
  pointer-events: none;
}

.app-toast-show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ─── Nutrition summary ───────────────────────────────────────────────────── */
.nutrition-summary-wrap { padding: 0 var(--gutter); margin-bottom: 24px; max-width: var(--max-width); margin-left: auto; margin-right: auto; }
.nutr-summary { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; background: var(--card, #fffdf9); border: 1px solid var(--border); border-radius: 14px; padding: 14px 20px; font-size: 13px; }
.nutr-label { font-weight: 600; color: var(--text-secondary); margin-right: 4px; }
.nutr-item { color: var(--text-primary); font-weight: 500; }
.nutr-count { margin-left: auto; font-size: 12px; color: var(--text-muted); }

/* ─── Empty planner slot hint ─────────────────────────────────────────────── */
.pg-empty-hint { font-size: 11px; color: var(--text-muted); text-align: center; padding: 2px 0 0; display: block; line-height: 1.2; }

/* ─── Start Here ──────────────────────────────────────────────────────────── */
#start-view {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px var(--gutter) 64px;
}

.start-inner { max-width: 1100px; margin: 0 auto; }

.start-about {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: start;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  margin-bottom: 48px;
}

.start-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.start-title {
  font-family: var(--font-head);
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 16px;
}

.start-body {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 12px;
}
.start-body:last-child { margin-bottom: 0; }
.start-body em { color: var(--text-primary); font-style: italic; }

.start-stats {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
  background: var(--accent-light);
  border-radius: 14px;
  min-width: 120px;
  text-align: center;
  flex-shrink: 0;
}

.start-stat { display: flex; flex-direction: column; gap: 2px; }
.start-stat-num { font-family: var(--font-head); font-size: 32px; font-weight: 700; color: var(--accent); line-height: 1; }
.start-stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }

.start-picks-title {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

.start-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.util-btn.nav-btn-start {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  font-weight: 600;
}
.util-btn.nav-btn-start:hover { background: #a8511f; border-color: #a8511f; }
.util-btn.nav-btn-start.active { background: #a8511f; border-color: #a8511f; }

@media (max-width: 700px) {
  .start-about { grid-template-columns: 1fr; }
  .start-stats { flex-direction: row; justify-content: space-around; }
}

/* ─── Cook Mode ───────────────────────────────────────────────────────────── */
.cook-mode-btn {
  padding: 9px 18px;
  border-radius: 20px;
  border: 1.5px solid var(--accent);
  background: var(--accent);
  color: white;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cook-mode-btn:hover { background: #a8511f; border-color: #a8511f; }

.cm-overlay {
  position: fixed;
  inset: 0;
  background: #111;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  color: white;
}

.cm-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.cm-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: #1a1a1a;
  border-bottom: 1px solid #333;
  flex-shrink: 0;
}

.cm-recipe-name {
  font-size: 15px;
  font-weight: 600;
  color: #ccc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cm-exit {
  background: none;
  border: 1px solid #444;
  color: #aaa;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}
.cm-exit:hover { background: #333; color: white; }

.cm-progress-wrap {
  height: 3px;
  background: #2a2a2a;
  flex-shrink: 0;
}
.cm-progress-bar {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

.cm-body {
  flex: 1;
  overflow-y: auto;
  padding: 40px 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

.cm-step-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.cm-step-title {
  font-family: var(--font-head);
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 700;
  color: white;
  line-height: 1.2;
}

.cm-step-detail {
  font-size: clamp(16px, 2.5vw, 20px);
  color: #ccc;
  line-height: 1.75;
}

.cm-ingredients {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cm-ing-row label {
  display: flex;
  align-items: baseline;
  gap: 12px;
  cursor: pointer;
  font-size: clamp(16px, 2.2vw, 19px);
  color: #ccc;
  line-height: 1.5;
}

.cm-ing-check {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
  margin-top: 2px;
}

.cm-ing-row input:checked ~ .cm-ing-amount,
.cm-ing-row input:checked ~ .cm-ing-item {
  opacity: 0.4;
  text-decoration: line-through;
}

.cm-ing-amount {
  font-weight: 700;
  color: white;
  white-space: nowrap;
  flex-shrink: 0;
}

.cm-ing-item { color: #bbb; }

.cm-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: #1a1a1a;
  border-top: 1px solid #333;
  gap: 16px;
  flex-shrink: 0;
}

.cm-btn {
  padding: 14px 28px;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  min-width: 120px;
}

.cm-btn-prev {
  background: #2a2a2a;
  color: #aaa;
  border: 1px solid #444;
}
.cm-btn-prev:hover:not(:disabled) { background: #3a3a3a; color: white; }
.cm-btn-prev:disabled { opacity: 0.3; cursor: not-allowed; }

.cm-btn-next {
  background: var(--accent);
  color: white;
}
.cm-btn-next:hover { background: #a8511f; }

.cm-dots {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.cm-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #444;
  transition: background 0.2s, transform 0.2s;
}
.cm-dot-active {
  background: var(--accent);
  transform: scale(1.4);
}

@media (max-width: 600px) {
  .cm-body { padding: 28px 20px 16px; }
  .cm-btn { padding: 12px 20px; font-size: 15px; min-width: 100px; }
}

/* ─── Kitchen Guide nav button ────────────────────────────────────────────── */
.nav-btn-quick { background: #eaf5ec; color: #1a7a3a; border-color: rgba(26,122,58,0.2); }
.nav-btn-quick:hover { background: #1a7a3a; color: white; }
.nav-btn-quick.active { background: #1a7a3a; color: white; border-color: #1a7a3a; }
.nav-btn-guide { background: #e8f0fa; color: #1a4a6b; border-color: rgba(26,74,107,0.2); }
.nav-btn-guide:hover { background: #1a4a6b; color: white; }
.nav-btn-guide.active { background: #1a4a6b; color: white; border-color: #1a4a6b; }

/* ─── Kitchen Guide view ──────────────────────────────────────────────────── */
#tips-view {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px var(--gutter) 48px;
}

.tips-inner { max-width: 860px; margin: 0 auto; }

.tips-page-header { margin-bottom: 40px; }
.tips-page-title { font-family: var(--font-head); font-size: 36px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.tips-page-sub { font-size: 15px; color: var(--text-secondary); line-height: 1.6; }

.tips-section { margin-bottom: 52px; }
.tips-section-title {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}
.tips-section-intro {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.6;
}

/* Hob temperature table */
.temp-table { display: flex; flex-direction: column; gap: 2px; }

.temp-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: box-shadow 0.15s;
}
.temp-row:hover { box-shadow: var(--shadow-sm); }

.temp-label {
  background: var(--accent-light);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--border);
}
.temp-name { font-weight: 600; font-size: 14px; color: var(--text-primary); }
.temp-hob {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: white;
  border: 1px solid rgba(196,98,45,0.25);
  border-radius: 4px;
  padding: 1px 6px;
  display: inline-block;
  width: fit-content;
}

.temp-body { padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; }
.temp-deg { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.temp-look, .temp-use { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.temp-deg-f { font-weight: 400; color: var(--text-muted); font-size: 12px; }
.temp-look strong, .temp-use strong { color: var(--text-primary); font-weight: 600; }

/* Oven temperature table */
.oven-table { display: flex; flex-direction: column; gap: 2px; }

.oven-row {
  display: grid;
  grid-template-columns: 130px 260px 1fr;
  gap: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  align-items: center;
}
.oven-row:hover { box-shadow: var(--shadow-sm); }

.oven-label {
  background: #e8f0fa;
  color: #1a4a6b;
  font-weight: 600;
  font-size: 13px;
  padding: 12px 14px;
  border-right: 1px solid var(--border);
  height: 100%;
  display: flex;
  align-items: center;
}
.oven-temps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  padding: 10px 14px;
  border-right: 1px solid var(--border);
  height: 100%;
}
.oven-c { font-weight: 700; font-size: 13px; color: var(--text-primary); }
.oven-sep { color: var(--text-muted); font-size: 12px; }
.oven-f { font-size: 12px; color: var(--text-secondary); }
.oven-gas {
  font-size: 11px;
  font-weight: 600;
  color: #1a4a6b;
  background: #e8f0fa;
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
}
.oven-use { font-size: 13px; color: var(--text-secondary); padding: 10px 14px; line-height: 1.5; }

/* Cooking terms */
.terms-section { margin-bottom: 32px; }
.terms-cat-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.terms-grid { display: flex; flex-direction: column; gap: 2px; }

.term-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  transition: box-shadow 0.15s;
}
.term-card:hover { box-shadow: var(--shadow-sm); }

.term-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.term-name { font-family: var(--font-head); font-size: 16px; font-weight: 600; color: var(--text-primary); }
.term-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 2px 7px;
}
.term-def { font-size: 14px; color: var(--text-secondary); line-height: 1.65; }

/* Responsive — collapse grid columns on small screens */
@media (max-width: 600px) {
  .temp-row { grid-template-columns: 1fr; }
  .temp-label { border-right: none; border-bottom: 1px solid var(--border); }
  .oven-row { grid-template-columns: 1fr; }
  .oven-label, .oven-temps { border-right: none; border-bottom: 1px solid var(--border); }
}

/* ─── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--text-primary);
  color: rgba(255,255,255,0.45);
  text-align: center;
  padding: 24px;
  font-size: 13px;
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero-section { padding: 20px var(--gutter) 0; margin-bottom: 24px; }
  .hero-featured { min-height: 220px; }
  .hero-title { font-size: 24px; }
  .hero-content { padding: 20px 20px; }
}

@media (max-width: 768px) {
  .detail-columns { grid-template-columns: 1fr; gap: 32px; }
  .detail-meta-bar-inner { flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
  .detail-meta-item { padding: 4px 16px 4px 0; margin-right: 16px; border-right: none; }
  .recipe-grid { grid-template-columns: 1fr; }
  .nav-btn { padding: 6px 10px; font-size: 12.5px; }
  .logo-tagline { display: none; }
  .pg-day-full { display: none; }
  .pg-day-short { display: inline; }
  .planner-header-inner { flex-direction: column; align-items: flex-start; }
  .related-grid { grid-template-columns: 1fr; }
  .diet-tags { margin-left: 0; }
  .macro-bar-wrap { min-width: 80px; }
}

/* ─── Animations ──────────────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.recipe-card  { animation: fadeUp 0.3s ease both; }
#detail-view  { animation: fadeUp 0.25s ease both; }
#planner-view { animation: fadeUp 0.25s ease both; }
