/* ============================================================
   styles.css — Meal Planner (Deep Navy + Lime)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=DM+Sans:wght@300;400;500&display=swap');

:root {
  --bg:           #130a1e;
  --surface:      #1f1030;
  --surface2:     #2a1540;
  --border:       #2a1540;
  --border2:      #3d2060;
  --accent:       #c084fc;
  --accent2:      #a855f7;
  --accent-dim:   rgba(192,132,252,0.08);
  --accent-text:  #130a1e;
  --text:         #ffffff;
  --text-nav:     #f0f0f0;
  --text-mid:     #d4c4e8;
  --text-muted:   #8b6aad;
  --text-faint:   #5a3a7a;
  --checked-bg:   #1a0d2e;
  --checked-text: #4a2a6a;
  --error:        #ff6b6b;
  --tag-you:      #7dd3fc;
  --tag-her:      #f9a8d4;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  -webkit-tap-highlight-color: transparent;
}

/* ── Loading / Error ── */
#loading-bar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; height: 3px;
  background: var(--accent);
  z-index: 999;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

#error-banner {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  background: rgba(255,107,107,0.12);
  border-bottom: 1px solid var(--error);
  color: var(--error);
  padding: 8px 16px;
  font-size: 0.78rem;
  text-align: center;
  z-index: 90;
}

/* ── Login ── */
#screen-login {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  height: 100dvh;
  padding: 40px 24px;
  text-align: center;
  gap: 16px;
}
.login-logo {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.login-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  max-width: 360px;
  width: 100%;
}
.login-card p {
  font-size: 0.85rem;
  color: var(--text-mid);
  line-height: 1.6;
  margin-bottom: 20px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  transition: all 0.15s;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
  padding: 12px 20px;
  font-size: 0.85rem;
  width: 100%;
  font-weight: 600;
}
.btn-primary:hover { background: #bbff66; }
.btn-ghost {
  background: transparent;
  border: 1px solid #f0f0f0;
  color: #f0f0f0;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 5px 10px; font-size: 0.68rem; letter-spacing: 0.05em; text-transform: uppercase; }

/* ── App shell ── */
#screen-app { display: none; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }

/* ── Section switcher ── */
.section-switcher {
  display: flex;
  flex-wrap: nowrap;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.section-tab {
  flex: 1;
  padding: 10px 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  color: #f0f0f0;
  letter-spacing: 0.03em;
  transition: all 0.15s;
  position: relative;
}
.section-tab.active { color: var(--accent); background: var(--accent-dim); }
.section-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 10%; right: 10%;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}

/* ── Shopping / Recipes sections ── */
#shopping-section, #recipes-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ── Top nav ── */
.top-nav {
  display: flex;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.nav-tab, .rec-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  padding: 9px 4px;
  transition: background 0.12s;
}
.nav-tab:active, .rec-tab:active { background: var(--accent-dim); }
.nav-tab.active, .rec-tab.active { background: var(--accent-dim); }
.nav-tab.active::after, .rec-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 15%; right: 15%;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}
.nav-icon { font-size: 1.1rem; opacity: 1; transition: opacity 0.15s; }
.nav-tab.active .nav-icon, .rec-tab.active .nav-icon { opacity: 1; }
.nav-label { font-size: 0.62rem; color: #f0f0f0; letter-spacing: 0.04em; transition: color 0.15s; }
.nav-tab.active .nav-label, .rec-tab.active .nav-label { color: var(--accent); }
.rec-tab .nav-icon { font-size: 1.1rem; opacity: 1; }
.rec-tab .nav-label { font-size: 0.62rem; color: #f0f0f0; letter-spacing: 0.04em; }
.rec-tab.active .nav-label { color: var(--accent); }

.nav-badge {
  position: absolute;
  top: 5px; right: calc(50% - 20px);
  background: var(--accent);
  color: var(--accent-text);
  font-size: 0.52rem;
  font-weight: 700;
  min-width: 15px; height: 15px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

/* ── Actions bar ── */
.actions-bar {
  display: flex;
  justify-content: flex-end;
  padding: 5px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

/* ── Main scrollable ── */
.app-main { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; padding-bottom: 80px; }

/* ── Person filter ── */
.person-filter {
  display: flex;
  gap: 7px;
  padding: 10px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
  flex-shrink: 0;
}
.filter-btn {
  background: var(--bg);
  border: 1px solid #f0f0f0;
  color: #f0f0f0;
  padding: 5px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  transition: all 0.15s;
}
.filter-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Meal cards ── */
.meal-list { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }

.meal-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  overflow: hidden;
  transition: border-color 0.15s;
}
.meal-card.selected { border-color: var(--accent); }
.meal-card.clickable { cursor: pointer; }
.meal-card.clickable:active { background: var(--accent-dim); }

.meal-card-main {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  flex: 1;
  cursor: pointer;
}

.meal-card-check {
  width: 22px; height: 22px;
  border: 1.5px solid var(--border2);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--accent-text);
  flex-shrink: 0;
  transition: all 0.12s;
}
.meal-card-check.checked { background: var(--accent); border-color: var(--accent); }

.meal-card-info { flex: 1; }
.meal-card-name { font-size: 0.9rem; color: var(--text); margin-bottom: 3px; }
.meal-card-sub { font-size: 0.7rem; color: var(--text-muted); }
.meal-card-icon { font-size: 1.3rem; flex-shrink: 0; }
.meal-card-arrow { font-size: 1.4rem; color: var(--text-muted); padding: 0 4px; }

.meal-card-servings {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 14px 12px;
  border-left: 1px solid var(--border);
}

/* ── Serving buttons ── */
.srv-btn {
  background: var(--surface2);
  border: none;
  color: var(--accent);
  width: 26px; height: 26px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
}
.srv-btn:hover { background: var(--accent); color: var(--accent-text); }
.srv-count {
  font-size: 0.9rem;
  color: var(--accent);
  min-width: 24px;
  text-align: center;
  font-weight: 500;
}

/* ── Person tags ── */
.person-tag {
  display: inline-block;
  font-size: 0.6rem;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 500;
  letter-spacing: 0.03em;
  vertical-align: middle;
  margin-left: 4px;
}
.tag-you { background: rgba(106,175,212,0.15); color: var(--tag-you); }
.tag-her { background: rgba(185,144,204,0.15); color: var(--tag-her); }

/* ── Progress ── */
.progress-wrap {
  padding: 10px 14px 6px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}
.progress-bar { height: 2px; background: var(--border2); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.35s ease; }
.progress-label { font-size: 0.68rem; color: var(--text-muted); text-align: right; margin-top: 5px; }

/* ── Shopping list ── */
#shopping-list { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }

.list-empty {
  margin: 40px 16px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 28px 20px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.category { border: 1px solid var(--border2); border-radius: 12px; overflow: hidden; }

.category-header {
  background: var(--surface);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}
.category-title { display: flex; align-items: center; gap: 8px; }
.category-icon { font-size: 1rem; }
.category-name {
  font-family: 'Playfair Display', serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
}
.category-count {
  font-size: 0.65rem;
  color: var(--text-muted);
  background: var(--surface2);
  padding: 2px 7px;
  border-radius: 20px;
}
.category-chevron { color: var(--text-muted); font-size: 0.65rem; transition: transform 0.2s; }
.category.collapsed .category-chevron { transform: rotate(-90deg); }
.category.collapsed .category-items { display: none; }

.category-items { background: var(--surface2); }

.item {
  display: flex;
  align-items: center;
  padding: 11px 14px;
  border-top: 1px solid var(--border);
  gap: 12px;
  cursor: pointer;
  transition: background 0.12s;
  min-height: 48px;
}
.item:hover { background: rgba(170,255,77,0.04); }
.item.checked { background: var(--checked-bg); }
.item.qty-active { border-left: 2px solid var(--accent); }

.checkbox {
  width: 22px; height: 22px;
  border: 1.5px solid var(--border2);
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
}
.item.checked .checkbox { background: var(--accent); border-color: var(--accent); }
.checkmark { display: none; color: var(--accent-text); font-size: 0.7rem; font-weight: 800; }
.item.checked .checkmark { display: block; }

.item-text { flex: 1; }
.item-name { font-size: 0.85rem; color: var(--text); transition: color 0.12s; }
.item.checked .item-name { color: var(--checked-text); text-decoration: line-through; }
.meal-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.meal-tag { font-size: 0.58rem; color: var(--text-muted); background: var(--border); padding: 1px 5px; border-radius: 3px; }
.item-note { font-size: 0.63rem; color: var(--text-muted); margin-top: 2px; font-style: italic; }
.item-qty { font-size: 0.78rem; color: var(--accent); font-weight: 500; text-align: right; min-width: 60px; transition: color 0.12s; }
.item.checked .item-qty { color: var(--checked-text); }

/* ── Cook mode ── */
.cook-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.back-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px 4px 0;
  font-family: 'DM Sans', sans-serif;
  flex-shrink: 0;
}
.cook-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  line-height: 1.2;
}
.cook-servings { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.cook-section-title {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 14px 14px 6px;
}

/* ── Ingredients (cook mode) ── */
.cook-ingredients {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.ing-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.ing-qty { font-size: 0.8rem; color: var(--accent); font-weight: 500; min-width: 55px; flex-shrink: 0; }
.ing-name { font-size: 0.85rem; color: var(--text); flex: 1; }
.ing-note { font-size: 0.65rem; color: var(--text-muted); font-style: italic; width: 100%; padding-left: 63px; margin-top: -2px; }

/* ── Steps (cook mode) ── */
.cook-steps { padding: 0 12px 20px; }
.cook-step {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 14px;
  position: relative;
  transition: opacity 0.2s;
}
.cook-step.step-done { opacity: 0.45; }
.cook-step.step-done .step-num { background: var(--surface2); color: var(--text-muted); }
.step-num {
  width: 26px; height: 26px;
  background: var(--accent);
  color: var(--accent-text);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}
.step-body { flex: 1; }
.step-title { font-size: 0.88rem; font-weight: 500; color: var(--text); margin-bottom: 5px; }
.step-instruction { font-size: 0.82rem; color: var(--text-mid); line-height: 1.55; }

/* ── Step complete & pause ── */
.step-check {
  position: absolute;
  top: 12px; right: 12px;
  width: 24px; height: 24px;
  border: 1.5px solid var(--border2);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-text);
  transition: all 0.15s;
  background: var(--bg);
}
.step-check.checked { background: var(--accent); border-color: var(--accent); }

/* ── Step timer ── */
.step-timer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.timer-label { font-size: 0.72rem; color: var(--text-muted); flex: 1; }
.timer-display {
  font-size: 1rem;
  color: var(--accent);
  font-weight: 500;
  min-width: 42px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.timer-btn {
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.15s;
  letter-spacing: 0.03em;
}
.timer-btn:hover { background: #bbff66; }
.timer-btn.timer-done { background: var(--surface2); color: var(--text-mid); border: 1px solid var(--border); }
.timer-pause-btn {
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
  letter-spacing: 0.03em;
}
.timer-pause-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Macros tab ── */
.macros-wrap { padding: 10px 12px 80px; }
.macros-section-title {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.macros-people-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 6px;
}
.macro-person-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 12px;
}
.macro-person-name {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}
.macro-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  gap: 0 6px;
  margin-bottom: 8px;
  align-items: center;
}
.macro-row-label { font-size: 0.68rem; color: var(--text-muted); grid-column: 1; grid-row: 1; white-space: nowrap; }
.macro-row-value { font-size: 0.82rem; font-weight: 500; grid-column: 2; grid-row: 1; text-align: right; }
.macro-target { font-size: 0.6rem; color: var(--text-muted); grid-column: 3; grid-row: 1; white-space: nowrap; }
.macro-bar-wrap { grid-column: 1 / -1; grid-row: 2; height: 3px; background: var(--border2); border-radius: 2px; overflow: hidden; margin-top: 3px; }
.macro-bar-fill { height: 100%; border-radius: 2px; transition: width 0.4s ease; }

.meal-macro-card { background: var(--surface); border: 1px solid var(--border2); border-radius: 12px; overflow: hidden; margin-bottom: 8px; }
.meal-macro-header { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface2); }
.meal-macro-name { font-size: 0.85rem; color: var(--text); flex: 1; }
.meal-macro-servings { font-size: 0.72rem; color: var(--accent); background: var(--accent-dim); border: 1px solid var(--accent); padding: 1px 7px; border-radius: 10px; }
.meal-macro-people { padding: 8px 12px; display: flex; flex-direction: column; gap: 8px; }
.meal-macro-person { display: flex; align-items: center; gap: 10px; }
.meal-macro-person-name { font-size: 0.7rem; color: var(--text-muted); min-width: 55px; }
.meal-macro-stats { display: flex; gap: 10px; flex: 1; justify-content: flex-end; }
.meal-stat { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.meal-stat span:first-child { font-size: 0.82rem; font-weight: 500; }
.meal-stat-label { font-size: 0.58rem; color: var(--text-muted); }

/* ── Stub empty tabs ── */
.stub-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 30px; text-align: center; gap: 10px; }
.stub-icon { font-size: 2.5rem; }
.stub-title { font-size: 1rem; color: var(--text); font-weight: 500; }
.stub-text { font-size: 0.82rem; color: var(--text-muted); line-height: 1.6; }

/* ── Planner ── */
.planner-wrap { padding: 10px 12px 80px; }

#planner-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
#planner-section .app-main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 80px;
}
#planner-content { min-height: 0; }

/* Week strip */
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-bottom: 14px; }
.day-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 2px;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.day-chip.enabled { border-color: var(--accent); background: var(--accent-dim); }
.day-chip.today:not(.enabled) .day-chip-name { color: var(--accent); font-weight: 600; }
.day-chip.today { border-color: var(--accent); }
.day-chip-name { font-size: 0.72rem; color: var(--text-mid); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 500; }
.day-chip-check { font-size: 0.65rem; color: var(--accent); font-weight: 700; height: 12px; }

/* Day card */
.planner-day { background: var(--surface); border: 1px solid var(--border2); border-radius: 12px; overflow: hidden; margin-bottom: 10px; }
.planner-day-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface2); }
.planner-day-name { font-size: 0.85rem; color: var(--text); font-weight: 500; }
.planner-day-kcal { font-size: 0.75rem; color: var(--accent); }
.today-badge { font-size: 0.6rem; background: var(--accent); color: var(--accent-text); padding: 1px 6px; border-radius: 8px; margin-left: 6px; font-weight: 700; vertical-align: middle; }

/* Person rows */
.planner-person-row { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.planner-person-label { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; font-weight: 600; }
.planner-slots { display: flex; flex-direction: column; gap: 5px; }
.planner-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s;
  min-height: 40px;
}
.planner-slot.filled { border-color: var(--accent); background: var(--accent-dim); }
.planner-slot.stub { opacity: 0.35; cursor: default; pointer-events: none; }
.planner-slot:active { background: var(--accent-dim); }
.slot-icon { font-size: 1rem; flex-shrink: 0; opacity: 0.8; }
.slot-content { flex: 1; }
.slot-meal { font-size: 0.8rem; color: var(--text); }
.slot-empty { font-size: 0.78rem; color: var(--text-muted); }
.slot-clear { background: none; border: none; color: var(--text-muted); font-size: 1rem; cursor: pointer; padding: 2px 4px; flex-shrink: 0; line-height: 1; }
.slot-clear:hover { color: var(--error); }

/* Day macro summary row */
.day-macro-row { display: flex; gap: 8px; padding: 8px 12px; flex-wrap: wrap; }
.day-macro-person { flex: 1; min-width: 140px; }
.day-macro-name { font-size: 0.65rem; color: var(--text-muted); margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.04em; }
.day-macro-target { font-size: 0.65rem; color: var(--text-faint); margin: 0 1px; }
.day-macro-stats { display: flex; gap: 6px; flex-wrap: wrap; font-size: 0.75rem; font-weight: 500; }

/* Weekly macro summary */
.weekly-macros { margin-top: 16px; }

/* Meal picker overlay */
.meal-picker {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.meal-picker.open { opacity: 1; pointer-events: all; }
.meal-picker-sheet {
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-height: 70vh;
  overflow-y: auto;
  border-top: 1px solid var(--border2);
  transform: translateY(100%);
  transition: transform 0.25s ease;
}
.meal-picker.open .meal-picker-sheet { transform: translateY(0); }
.picker-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.picker-title { font-size: 0.88rem; color: var(--text); font-weight: 500; }
.picker-close { background: none; border: none; color: var(--text-muted); font-size: 1.3rem; cursor: pointer; padding: 0 4px; }
.picker-meals { padding: 8px 12px 24px; display: flex; flex-direction: column; gap: 6px; }
.picker-meal { display: flex; align-items: center; gap: 10px; padding: 11px 12px; background: var(--surface2); border: 1px solid var(--border2); border-radius: 10px; cursor: pointer; transition: border-color 0.12s; font-size: 0.85rem; color: var(--text); }
.picker-meal.selected { border-color: var(--accent); background: var(--accent-dim); }
.picker-check { width: 20px; height: 20px; border: 1.5px solid var(--border2); border-radius: 5px; display: flex; align-items: center; justify-content: center; font-size: 0.65rem; font-weight: 800; color: var(--accent-text); flex-shrink: 0; transition: all 0.12s; }
.picker-check.checked { background: var(--accent); border-color: var(--accent); }

/* ── Cook for selector ── */
.cook-for-bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; background: var(--surface2); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.cook-for-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; flex-shrink: 0; }
.cook-for-btn { background: var(--bg); border: 1px solid var(--border2); color: var(--text-mid); padding: 5px 14px; border-radius: 20px; cursor: pointer; font-family: 'DM Sans', sans-serif; font-size: 0.78rem; transition: all 0.15s; }
.cook-for-btn.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); font-weight: 500; }
.cook-for-tag { font-size: 0.65rem; color: var(--accent); background: var(--accent-dim); border: 1px solid var(--accent); padding: 1px 7px; border-radius: 8px; margin-left: 6px; vertical-align: middle; font-weight: 500; }

/* ── Household ── */
.household-actions { display: flex; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--surface); }
.household-add-bar { display: flex; gap: 6px; padding: 10px 12px; background: var(--surface); border-bottom: 1px solid var(--border); align-items: center; }
.household-input { flex: 1; background: var(--bg); border: 1px solid var(--border2); border-radius: 8px; padding: 8px 12px; color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 0.82rem; outline: none; transition: border-color 0.15s; min-width: 0; }
.household-input:focus { border-color: var(--accent); }
.household-input::placeholder { color: var(--text-muted); }
.household-select { background: var(--bg); border: 1px solid var(--border2); border-radius: 8px; padding: 8px 6px; color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 0.75rem; outline: none; cursor: pointer; flex-shrink: 0; }
.household-add-btn { background: var(--accent); color: var(--accent-text); border: none; border-radius: 8px; padding: 8px 14px; font-size: 0.78rem; font-weight: 600; cursor: pointer; font-family: 'DM Sans', sans-serif; white-space: nowrap; transition: background 0.15s; flex-shrink: 0; }
.household-add-btn:hover { background: #bbff66; }
.manual-tag { font-size: 0.58rem; background: rgba(200,169,110,0.15); color: #c8a96e; padding: 1px 5px; border-radius: 3px; margin-left: 4px; vertical-align: middle; }
.recurring-tag { font-size: 0.58rem; background: rgba(143,190,143,0.12); color: #8fbe8f; padding: 1px 5px; border-radius: 3px; margin-left: 4px; vertical-align: middle; }
.item-remove { background: none; border: none; color: var(--text-muted); font-size: 1.1rem; cursor: pointer; padding: 0 4px; flex-shrink: 0; line-height: 1; }
.item-remove:hover { color: var(--error); }

/* ── Item quantity counter ── */
.item-qty-ctrl { display: flex; align-items: center; gap: 5px; flex-shrink: 0; margin-left: 4px; }
.qty-btn { background: var(--surface2); border: none; color: #f0f0f0; width: 24px; height: 24px; border-radius: 5px; cursor: pointer; font-size: 0.9rem; display: flex; align-items: center; justify-content: center; transition: all 0.12s; flex-shrink: 0; }
.qty-btn:hover { background: var(--accent); color: var(--accent-text); }
.qty-count { font-size: 0.82rem; color: var(--text-muted); min-width: 16px; text-align: center; font-weight: 500; transition: color 0.12s; }
.qty-count.qty-has { color: var(--accent); }

/* ── Planner slot batch counter ── */
.slot-batch { display: flex; align-items: center; gap: 4px; flex-shrink: 0; margin-left: 2px; }
.slot-batch-btn { background: var(--surface2); border: none; color: #f0f0f0; width: 20px; height: 20px; border-radius: 4px; cursor: pointer; font-size: 0.8rem; display: flex; align-items: center; justify-content: center; transition: background 0.12s; flex-shrink: 0; line-height: 1; }
.slot-batch-btn:hover { background: var(--accent); color: var(--accent-text); }
.slot-batch-count { font-size: 0.75rem; color: var(--accent); font-weight: 500; min-width: 20px; text-align: center; }

/* ── Inline edit ── */
.inline-edit-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 5px 8px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  outline: none;
}
.edit-save-btn, .edit-cancel-btn {
  background: none; border: none; cursor: pointer;
  font-size: 0.9rem; padding: 0 5px; flex-shrink: 0;
}
.edit-save-btn   { color: var(--accent); }
.edit-cancel-btn { color: var(--text-muted); }
.item-edit-btn {
  background: none; border: none; cursor: pointer;
  font-size: 0.8rem; padding: 0 3px; flex-shrink: 0;
  opacity: 0.6; transition: opacity 0.15s;
}
.item-edit-btn:hover { opacity: 1; }
.item.editing { background: var(--accent-dim); border-left: 2px solid var(--accent); }
