@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --red:       #E8481C;
  --red-d:     #C23B12;
  --red-glow:  rgba(232,72,28,0.10);
  --green:     #3D7A2E;
  --green-d:   #2D5C21;
  --green-glow:rgba(61,122,46,0.10);
  --dark:      #1A1A1A;
  --dark-2:    #4A4A4A;
  --mid:       #8A8A8A;
  --light:     #F2EFEB;
  --white:     #ffffff;
  --card:      #ffffff;
  --bg:        #F2EFEB;
  --border:    #E4E0DB;
  --border-d:  #CCC8C2;
  --surface:   #ffffff;
  --surface2:  #F2EFEB;
  --radius:    20px;
  --radius-sm: 12px;
  --shadow:    0 1px 2px rgba(0,0,0,0.04), 0 4px 20px rgba(0,0,0,0.09);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.06), 0 16px 40px rgba(0,0,0,0.14);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--light);
  color: var(--dark);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
}

#app {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--light);
}

.page { display: none; flex: 1; flex-direction: column; }
.page.active { display: flex; animation: pageFadeIn 0.18s ease-out; }
@keyframes pageFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ── LOGIN PAGE ── */
.login-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 28px;
  gap: 36px;
  min-height: 100vh;
  background: var(--white);
}

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

.logo-wordmark {
  display: flex;
  align-items: baseline;
  gap: 0px;
  line-height: 1;
}

.logo-fit {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -2px;
  color: var(--red);
}

.logo-live {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -2px;
  color: var(--green);
}

.logo-sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--mid);
  letter-spacing: 0.3px;
  text-align: center;
}

.logo-divider {
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, var(--red), var(--green));
  border-radius: 2px;
  margin-top: 4px;
}

.lang-picker, .lang-picker-login {
  display: flex;
  gap: 8px;
}
.lang-picker-login { justify-content: center; margin-bottom: 4px; }

.lang-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--light);
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  color: var(--mid);
  cursor: pointer;
  transition: all 0.15s;
}
.lang-btn.active {
  background: var(--red-glow);
  border-color: var(--red);
  color: var(--red);
  font-weight: 700;
}

.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-form h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--dark);
  text-align: center;
  margin-bottom: 4px;
}

/* ── FIELDS ── */
.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-group label {
  font-size: 12px;
  color: var(--mid);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

input, select, textarea {
  background: var(--light);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--dark);
  font-size: 15px;
  font-family: inherit;
  padding: 13px 14px;
  width: 100%;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
}

textarea { resize: vertical; min-height: 80px; }

/* ── BUTTONS ── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: all 0.18s;
}

.btn-primary {
  background: var(--red);
  color: #fff;
}
.btn-primary:hover { background: var(--red-d); }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  background: var(--green);
  color: #fff;
}
.btn-secondary:hover { background: var(--green-d); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border-d);
  color: var(--dark-2);
}
.btn-outline:hover { border-color: var(--red); color: var(--red); }

.btn-danger {
  background: rgba(232,72,28,0.1);
  border: 1.5px solid var(--red);
  color: var(--red);
}
.btn-danger:hover { background: rgba(232,72,28,0.18); }

.btn-ghost {
  background: var(--surface2);
  color: var(--dark-2);
  border: none;
}
.btn-ghost:hover { background: var(--border); color: var(--dark); }

.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 10px; font-size: 17px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.error-msg {
  background: rgba(232,72,28,0.08);
  border: 1.5px solid var(--red);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--red);
}

/* ── HEADER ── */
.header {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

.header-logo {
  display: flex;
  align-items: baseline;
  gap: 1px;
  line-height: 1;
}

.header-logo .fit { font-size: 19px; font-weight: 900; letter-spacing: -0.5px; color: var(--red); }
.header-logo .live { font-size: 19px; font-weight: 900; letter-spacing: -0.5px; color: var(--green); }

.header-title { flex: 1; font-size: 16px; font-weight: 700; color: var(--dark); }
.header-subtitle { font-size: 11px; color: var(--mid); font-weight: 400; margin-top: 1px; }

/* ── BOTTOM NAV ── */
.bottom-nav {
  display: flex;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  position: sticky;
  bottom: 0;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--mid);
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  transition: color 0.2s;
}

.nav-btn .nav-icon { font-size: 22px; }
.nav-btn.active { color: var(--red); }

/* ── SETTINGS PAGE ── */
.settings-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 100px;
}

.settings-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow);
}

.settings-section h3 {
  font-size: 11px;
  font-weight: 700;
  color: var(--mid);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.person-card {
  background: var(--light);
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.person-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 15px;
}

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

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

.restriction-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--light);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
}

.restriction-chip input[type="checkbox"] { display: none; }
.restriction-chip.checked {
  background: var(--red-glow);
  border-color: var(--red);
  color: var(--red);
  font-weight: 600;
}

/* ── CALENDAR STRIP ── */
.calendar-strip {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: 10px 12px 0;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.calendar-strip::-webkit-scrollbar { display: none; }

.cal-month-label {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mid);
  padding: 0 4px 10px;
  align-self: flex-end;
  white-space: nowrap;
}

.cal-day {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 7px 8px;
  border-radius: 10px 10px 0 0;
  border: 1.5px solid transparent;
  border-bottom: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-family: inherit;
  min-width: 38px;
}
.cal-day:hover:not(.active) { background: var(--light); }

.cal-day-name {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mid);
}
.cal-day-num {
  font-size: 17px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1;
}

.cal-day.past { opacity: 0.45; }
.cal-day.past .cal-day-num { color: var(--mid); }

.cal-day.today .cal-day-num { color: var(--red); }

.cal-day.active {
  background: var(--red-glow);
  border-color: var(--red);
}
.cal-day.active .cal-day-name { color: var(--red); }
.cal-day.active .cal-day-num  { color: var(--red); }

/* ── MENU PAGE ── */
.menu-content {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 90px;
  background: var(--light);
}

.day-view {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.person-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.person-tab {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  background: var(--light);
  border: 1.5px solid var(--border);
  color: var(--mid);
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
}

.person-tab.active {
  background: var(--green-glow);
  border-color: var(--green);
  color: var(--green);
}

/* ── PERSON TOGGLES ── */
.person-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 8px;
}

.person-toggle {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  background: var(--light);
  border: 1.5px solid var(--border);
  color: var(--mid);
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
}

.person-toggle.active {
  background: var(--green-glow);
  border-color: var(--green);
  color: var(--green);
}

/* ── PERSON SECTION HEADER ── */
.person-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 4px;
}

.person-section-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: 0.01em;
}

.person-section + .person-section {
  margin-top: 12px;
  border-top: 1.5px solid var(--border);
  padding-top: 4px;
}

/* ── DAILY SUMMARY ── */
.daily-summary {
  background: var(--white);
  border-radius: var(--radius);
  padding: 4px 8px;
  display: flex;
  gap: 0;
  box-shadow: var(--shadow);
}

.summary-stat {
  flex: 1;
  text-align: center;
  padding: 12px 4px;
  border-radius: 12px;
}

.summary-stat .val { font-size: 19px; font-weight: 800; letter-spacing: -0.5px; }
.summary-stat .val.kcal { color: var(--red); }
.summary-stat .val.protein { color: #2563EB; }
.summary-stat .val.fat { color: #D97706; }
.summary-stat .val.carbs { color: var(--green); }
.summary-stat .lbl { font-size: 10px; color: var(--mid); margin-top: 3px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }

/* ── MEAL CARD ── */
.meal-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
  box-shadow: var(--shadow);
  position: relative;
}

.meal-card:active { transform: scale(0.985); box-shadow: 0 1px 4px rgba(0,0,0,0.06); }

.meal-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.meal-emoji {
  width: 52px;
  height: 52px;
  background: var(--light);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

.meal-info { flex: 1; min-width: 0; }
.meal-type { font-size: 11px; color: var(--mid); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.meal-name { font-size: 16px; font-weight: 700; margin-top: 4px; line-height: 1.35; color: var(--dark); }
.meal-time { font-size: 12px; color: var(--mid); margin-top: 3px; }

.meal-macros { display: flex; gap: 6px; flex-wrap: wrap; }

.macro-pill {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.macro-pill.kcal    { color: var(--red);    background: rgba(232,72,28,0.10); }
.macro-pill.protein { color: #2563EB;       background: rgba(37,99,235,0.09); }
.macro-pill.fat     { color: #B45309;       background: rgba(180,83,9,0.09); }
.macro-pill.carbs   { color: var(--green);  background: rgba(61,122,46,0.10); }

.meal-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.meal-prep-hint {
  font-size: 12px;
  color: var(--mid);
  flex: 1;
  margin-right: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.regenerate-btn {
  background: var(--light);
  border: none;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--mid);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  transition: all 0.18s;
  font-family: inherit;
  min-height: 34px;
}

.regenerate-btn:hover { color: var(--red); background: var(--red-glow); }
.regenerate-btn:active { transform: scale(0.95); }

.day-actions { display: flex; gap: 8px; padding: 0 16px 4px; }
.btn-secondary.active-workout { background: var(--green); }

.meal-card-special { box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 20px rgba(217,119,6,0.12); }
.meal-card-empty { border: 1.5px dashed var(--border); background: var(--surface); opacity: 0.75; }

.special-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  color: #D97706;
  background: rgba(217,119,6,0.1);
  border-radius: 4px;
  padding: 1px 5px;
  letter-spacing: 0.2px;
  vertical-align: middle;
}

.favorites-content {
  flex: 1;
  overflow-y: auto;
  background: var(--light);
}

/* ── SKELETON ── */
.skeleton {
  background: var(--border);
  border-radius: 8px;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { opacity: 0.5; }
  50% { opacity: 1; }
  100% { opacity: 0.5; }
}

.skeleton-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow);
}

/* ── RECIPE MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,26,26,0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  backdrop-filter: blur(4px);
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal-sheet {
  background: var(--white);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.15);
}

.modal-overlay.open .modal-sheet { transform: translateY(0); }

.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--border-d);
  border-radius: 2px;
  margin: 12px auto 0;
}

.modal-header {
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.modal-header-info { flex: 1; min-width: 0; }
.modal-header h2 { font-size: 20px; font-weight: 800; line-height: 1.3; color: var(--dark); }
.modal-header .modal-sub {
  font-size: 13px;
  color: var(--mid);
  margin-top: 4px;
  display: flex;
  gap: 12px;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-bottom: 32px;
}

.recipe-hero {
  margin: -20px -20px 0;
  height: 200px;
  overflow: hidden;
  flex-shrink: 0;
}
.recipe-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.recipe-section h3 {
  font-size: 11px;
  font-weight: 700;
  color: var(--mid);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}

/* ── NUTRITION BARS ── */
.nutrition-bars { display: flex; flex-direction: column; gap: 10px; }

.nutrition-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.nutrition-bar-label { width: 80px; color: var(--mid); font-size: 13px; font-weight: 500; }
.nutrition-bar-track {
  flex: 1;
  height: 8px;
  background: var(--light);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.nutrition-bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s; }
.nutrition-bar-fill.kcal { background: var(--red); }
.nutrition-bar-fill.protein { background: #2563EB; }
.nutrition-bar-fill.fat { background: #D97706; }
.nutrition-bar-fill.carbs { background: var(--green); }
.nutrition-bar-fill.over { background: var(--red-d); }
.nutrition-bar-val { width: 60px; text-align: right; font-size: 13px; font-weight: 700; }

/* ── INGREDIENTS ── */
.ingredient-list { display: flex; flex-direction: column; gap: 8px; }

.ingredient-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--light);
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 14px;
}

.ingredient-name { font-weight: 600; }
.ingredient-meta { text-align: right; }
.ingredient-amount { color: var(--mid); font-size: 13px; }
.ingredient-kcal { font-size: 12px; color: var(--red); font-weight: 700; }

/* ── STEPS ── */
.steps-list { display: flex; flex-direction: column; gap: 12px; }

.step-item { display: flex; gap: 12px; align-items: flex-start; }

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--red-glow);
  border: 1.5px solid var(--red);
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-text { font-size: 14px; line-height: 1.6; padding-top: 4px; color: var(--dark-2); }

.tips-box {
  background: rgba(61,122,46,0.08);
  border: 1.5px solid rgba(61,122,46,0.25);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 13px;
  color: var(--green-d);
  line-height: 1.6;
  font-weight: 500;
}

/* ── SHOPPING PAGE ── */
.shopping-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 100px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--light);
}

.days-picker {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow);
}

.days-picker h3 { font-size: 16px; font-weight: 700; }

.days-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.day-option {
  padding: 10px;
  background: var(--light);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  transition: all 0.18s;
  font-size: 14px;
  font-weight: 600;
  color: var(--mid);
  font-family: inherit;
}

.day-option.selected {
  background: var(--red-glow);
  border-color: var(--red);
  color: var(--red);
}

.custom-days-row { display: flex; align-items: center; gap: 12px; }
.custom-days-row label { font-size: 13px; color: var(--mid); }
.custom-days-row input { flex: 1; max-width: 80px; }

.shopping-category {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.shopping-category-header {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  background: var(--light);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--dark-2);
}

.shopping-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  gap: 8px;
  transition: background 0.15s;
}

.shopping-item:hover { background: var(--light); }

.shopping-item-check {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border-d);
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.shopping-item-check.checked { background: var(--green); border-color: var(--green); }
.shopping-item-name { flex: 1; font-weight: 500; }
.shopping-item.checked-item .shopping-item-name { text-decoration: line-through; color: var(--mid); }

.shopping-item-meta { display: flex; align-items: center; gap: 6px; }
.shopping-item-amount { color: var(--mid); font-size: 12px; }
.shopping-item-price { color: var(--green); font-size: 12px; font-weight: 700; }
.shopping-item-store { color: var(--mid); font-size: 11px; }

.pantry-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  padding: 2px 6px;
  cursor: pointer;
  color: var(--mid);
  line-height: 1;
  transition: all 0.15s;
  flex-shrink: 0;
}
.pantry-btn:hover { border-color: var(--green); }
.pantry-btn.active {
  background: rgba(34,197,94,0.12);
  border-color: var(--green);
  color: var(--green);
}

.shopping-item.pantry-item {
  background: rgba(34,197,94,0.06);
}
.shopping-item.pantry-item .shopping-item-name {
  color: var(--green);
}
.shopping-item.pantry-item::after {
  content: 'olemas';
  font-size: 10px;
  font-weight: 700;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: 4px;
}

/* ── LOADING ── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(250,248,245,0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
  gap: 16px;
  backdrop-filter: blur(4px);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text { color: var(--mid); font-size: 14px; font-weight: 500; }

/* ── MISC ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--mid);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-state .icon { font-size: 48px; }
.empty-state h3 { font-size: 16px; font-weight: 700; color: var(--dark); }
.empty-state p { font-size: 14px; line-height: 1.5; }

.divider { height: 1px; background: var(--border); }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.chip-red { background: var(--red-glow); color: var(--red); }
.chip-green { background: var(--green-glow); color: var(--green); }
.chip-orange { background: rgba(217,119,6,0.1); color: #D97706; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-d); border-radius: 2px; }

/* Ingredient exclusion catalog */
.excl-ing-section { margin-top: 16px; border-radius: var(--radius-sm); overflow: hidden; background: var(--light); }
.excl-ing-toggle { width: 100%; display: flex; align-items: center; gap: 8px; padding: 14px 16px; background: var(--white); border: none; font-size: 14px; font-weight: 600; color: var(--dark); cursor: pointer; text-align: left; min-height: 44px; }
.excl-ing-toggle:active { background: var(--light); }
#excl-ing-body { padding: 12px 16px 16px; background: var(--white); border-top: 1px solid var(--border); }
#excl-ing-body input[type="search"] { border: 1.5px solid var(--border); border-radius: 10px; padding: 10px 14px; font-size: 14px; background: var(--light); color: var(--dark); }
.ing-filter-item { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border); font-size: 14px; cursor: pointer; min-height: 44px; }
.ing-filter-item:last-child { border-bottom: none; }
.ing-filter-item input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--green); flex-shrink: 0; }


/* ── Toast notifications ── */
#toast-wrap {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: #333;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  transition: opacity 0.22s, transform 0.22s;
  pointer-events: none;
  white-space: nowrap;
}
.toast.toast-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.toast.toast-success { background: #22c55e; }
.toast.toast-error   { background: #ef4444; }
.toast.toast-info    { background: #3b82f6; }

/* ── Card stagger animation ── */
@keyframes cardEnter {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card-enter {
  animation: cardEnter 0.22s ease-out both;
}

/* ── Macro progress bars in daily summary ── */
.macro-bar {
  height: 3px;
  background: var(--border, #e5e7eb);
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
  width: 100%;
}
.macro-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}
.macro-bar-fill.protein { background: #3b82f6; }
.macro-bar-fill.fat     { background: #f59e0b; }
.macro-bar-fill.carbs   { background: #10b981; }

@media (prefers-reduced-motion: reduce) {
  .card-enter, .toast, .macro-bar-fill { animation: none; transition: none; }
}
