/* ==========================================
   MEAL PLANNER — CLASSIC FITNESS GYM
   Premium Redesign — Elegant & Modern
   ========================================== */

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

/* ===== HERO ===== */
.meal-hero {
  position: relative;
  background: #060d1a;
  padding: 72px 0 64px;
  overflow: hidden;
  text-align: center;
}

/* Animated mesh background */
.meal-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 10% 60%, rgba(16,185,129,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 20%, rgba(245,158,11,0.14) 0%, transparent 55%),
    radial-gradient(ellipse 50% 60% at 50% 110%, rgba(99,102,241,0.10) 0%, transparent 50%);
  pointer-events: none;
}

/* Grid lines overlay */
.meal-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
}

.meal-hero-content {
  position: relative;
  z-index: 2;
}

.meal-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.35);
  color: #6ee7b7;
  font-size: 12px;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  padding: 7px 20px;
  border-radius: 999px;
  margin-bottom: 24px;
  letter-spacing: 0.3px;
  backdrop-filter: blur(4px);
}

.meal-hero h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: #fff;
  font-size: clamp(26px, 3.5vw, 42px);
  font-weight: 800;
  margin: 0 0 18px;
  line-height: 1.15;
  letter-spacing: -0.5px;
}

/* Green accent on "Meal" word */
.meal-hero h1 span { color: #10b981; }

.meal-hero p {
  color: rgba(255,255,255,0.65);
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  line-height: 1.75;
  max-width: 560px;
  margin: 0 auto 40px;
}

/* Stats row — pill style */
.meal-hero-stats {
  display: inline-flex;
  align-items: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 16px 8px;
  gap: 0;
  backdrop-filter: blur(12px);
  flex-wrap: wrap;
  justify-content: center;
  row-gap: 12px;
}

.meal-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 28px;
}

.meal-stat-num {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}

.meal-stat-lbl {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin-top: 4px;
  font-weight: 500;
}

.meal-stat-div {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,0.12);
  flex-shrink: 0;
}

/* ===== TRUST BANNER ===== */
.meal-trust-banner {
  background: linear-gradient(90deg, #f0fdf4 0%, #fafffe 50%, #f0fdf4 100%);
  border-top: 1px solid #d1fae5;
  border-bottom: 2px solid #d1fae5;
  padding: 0;
  overflow: hidden;
}

.meal-trust-inner {
  display: flex;
  align-items: stretch;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  max-width: 1100px;
  margin: 0 auto;
}

.meal-trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #065f46;
  transition: background 0.2s;
}

.meal-trust-item:hover { background: rgba(16,185,129,0.06); }
.meal-trust-item span:first-child { font-size: 18px; }

.meal-trust-div {
  width: 1px;
  background: #bbf7d0;
  margin: 10px 0;
}

/* ===== MODE TABS ===== */
.meal-mode-tabs {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 60px;
  z-index: 200;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.meal-mode-inner {
  display: flex;
  align-items: stretch;
  max-width: 540px;
  margin: 0 auto;
  padding: 8px 16px;
  gap: 8px;
}

.meal-mode-tab {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.25s;
  text-align: left;
}

.meal-mode-tab:hover {
  border-color: #10b981;
  background: #f0fdf4;
}

.meal-mode-tab.active {
  border-color: #10b981;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  box-shadow: 0 4px 16px rgba(16,185,129,0.15);
}

.meal-mode-icon { font-size: 22px; flex-shrink: 0; }
.meal-mode-title {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  font-family: 'DM Sans', sans-serif;
}
.meal-mode-sub {
  font-size: 11px;
  color: #64748b;
  margin-top: 1px;
  font-family: 'DM Sans', sans-serif;
}
.meal-mode-divider { display: none; }

/* ===== MAIN SECTION ===== */
.meal-section {
  background: #f8fafc;
  padding: 36px 0 64px;
  min-height: 60vh;
}

/* ===== LIBRARY FILTER BAR ===== */
.lib-filter-bar {
  background: #fff;
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 4px 32px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
  border: 1px solid #f1f5f9;
  margin-bottom: 28px;
}

.lib-filter-group { margin-bottom: 20px; }
.lib-filter-group:last-child { margin-bottom: 0; }

.lib-filter-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lib-filter-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #f1f5f9;
  max-width: 40px;
}

.lib-filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

/* ── New 2-col row for food type + cuisine ── */
.lib-filter-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

/* ── Goal group takes full width ── */
.lib-goal-group {
  width: 100%;
  margin-bottom: 20px;
}

/* ── Goal row — flex wrap ── */
.lib-goal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

/* ── Goal buttons slightly larger than toggle for clarity ── */
.lib-goal-btn {
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 12px;
}

/* ── Women's section — clear visual separation ── */
.lib-womens-section {
  margin-top: 4px;
}

.lib-womens-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.lib-womens-divider::before,
.lib-womens-divider::after {
  content: '';
  flex: 1;
  height: 1.5px;
  background: linear-gradient(90deg, #fce7f3, #fbcfe8, transparent);
}

.lib-womens-divider::after {
  background: linear-gradient(90deg, transparent, #fce7f3);
}

.lib-womens-heading {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 800;
  color: #be185d;
  background: linear-gradient(135deg, #fdf2f8, #fce7f3);
  border: 1.5px solid #f9a8d4;
  padding: 4px 14px;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: 0.4px;
  pointer-events: none;
  user-select: none;
}

/* ── Women's goal buttons — pink theme ── */
.lib-womens-row {
  flex-wrap: wrap;
  gap: 8px;
}

/* ===== SLOT TABS ===== */
.lib-slot-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.lib-slot-btn {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.lib-slot-btn:hover {
  border-color: #10b981;
  color: #059669;
  background: #f0fdf4;
}

.lib-slot-btn.active {
  background: #059669;
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(5,150,105,0.3);
}

/* ===== TOGGLE BUTTONS ===== */
.lib-toggle-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lib-toggle-btn {
  padding: 6px 14px;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.lib-toggle-btn:hover {
  border-color: #10b981;
  color: #059669;
  background: #f0fdf4;
}

.lib-toggle-btn.active {
  background: #10b981;
  color: #fff;
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(16,185,129,0.25);
}

/* ===== SEARCH ROW ===== */
.lib-search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #f1f5f9;
  padding-top: 20px;
}

.lib-search-input {
  flex: 1;
  padding: 12px 18px;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: #0f172a;
  background: #f8fafc;
  outline: none;
  transition: all 0.2s;
}

.lib-search-input:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 4px rgba(16,185,129,0.08);
  background: #fff;
}

.lib-count {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 999px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===== LOADING / EMPTY ===== */
.lib-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 80px 20px;
  gap: 16px;
}

.lib-loading-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid #e2e8f0;
  border-top-color: #10b981;
  border-radius: 50%;
  animation: libSpin 0.75s linear infinite;
}

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

.lib-loading-text {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: #64748b;
  font-weight: 600;
}

.lib-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 80px 20px;
  gap: 8px;
  text-align: center;
}

.lib-empty-icon  { font-size: 52px; }
.lib-empty-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  margin-top: 4px;
}
.lib-empty-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: #94a3b8;
}

/* ===== MEAL GRID ===== */
.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

/* ===== MEAL CARD ===== */
.lib-meal-card {
  background: #fff;
  border-radius: 20px;
  border: 1.5px solid #f1f5f9;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  animation: cardIn 0.4s ease both;
}

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

/* Top accent line */
.lib-meal-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #10b981, #059669);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.lib-meal-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 48px rgba(0,0,0,0.1);
  border-color: #d1fae5;
}

.lib-meal-card:hover::before { transform: scaleX(1); }

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

.lib-slot-badge, .lib-type-badge {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid;
  letter-spacing: 0.3px;
}

.lib-meal-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
}

.lib-meal-prep {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Macros — horizontal bar style */
.lib-meal-macros {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px 8px;
}

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

.lib-macro-val {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 800;
}

.lib-macro-lbl {
  font-family: 'DM Sans', sans-serif;
  font-size: 9px;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.lib-meal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.lib-tag {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: #059669;
  background: #f0fdf4;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  padding: 3px 9px;
}

.lib-meal-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lib-view-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #10b981;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.2s;
}

.lib-meal-card:hover .lib-view-btn { gap: 8px; }

/* ===== STEP INDICATOR ===== */
.meal-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
  gap: 0;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

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

.meal-step-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #94a3b8;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.meal-step.active .meal-step-circle {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 6px 18px rgba(16,185,129,0.4);
  transform: scale(1.1);
}

.meal-step.done .meal-step-circle {
  background: #d1fae5;
  color: #059669;
}

.meal-step-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  white-space: nowrap;
}

.meal-step.active .meal-step-label,
.meal-step.done .meal-step-label { color: #059669; }

.meal-step-line {
  flex: 1;
  height: 2px;
  background: #e2e8f0;
  min-width: 48px;
  max-width: 80px;
  margin-bottom: 22px;
  transition: background 0.3s;
}

.meal-step-line.done { background: #10b981; }

/* ===== AI PLANNER CARD ===== */
.meal-card {
  background: #fff;
  border-radius: 28px;
  padding: 36px;
  box-shadow: 0 8px 48px rgba(0,0,0,0.07);
  border: 1px solid #f1f5f9;
  max-width: 760px;
  margin: 0 auto;
  animation: mealFadeIn 0.4s ease;
}

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

.meal-card-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
}

.meal-card-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: #94a3b8;
  margin-bottom: 28px;
}

/* ===== GOAL GRID ===== */
.meal-goal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.meal-goal-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 24px 16px;
  border-radius: 20px;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: 'DM Sans', sans-serif;
  position: relative;
  overflow: hidden;
}

.meal-goal-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(16,185,129,0.05), rgba(16,185,129,0.02));
  opacity: 0;
  transition: opacity 0.2s;
}

.meal-goal-btn:hover {
  border-color: #10b981;
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(16,185,129,0.15);
}

.meal-goal-btn:hover::before { opacity: 1; }

.meal-goal-btn.selected {
  border-color: #10b981;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  box-shadow: 0 8px 24px rgba(16,185,129,0.2);
}

.meal-goal-icon { font-size: 38px; line-height: 1; }

.meal-goal-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.meal-goal-desc {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
}

/* ===== PREFERENCES ===== */
.meal-pref-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

.meal-pref-full { grid-column: 1 / -1; }

.meal-pref-label {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.meal-req  { color: #ef4444; }
.meal-unit { color: #94a3b8; font-weight: 500; text-transform: none; }

.meal-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: #0f172a;
  background: #f8fafc;
  outline: none;
  transition: all 0.2s;
  box-sizing: border-box;
}

.meal-input:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 4px rgba(16,185,129,0.08);
  background: #fff;
}

.meal-pref-hint {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 5px;
}

.meal-toggle-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.meal-toggle-btn {
  padding: 8px 16px;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.meal-toggle-btn:hover {
  border-color: #10b981;
  color: #059669;
}

.meal-toggle-btn.active {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(16,185,129,0.3);
}

/* ===== NEXT / BACK BUTTONS ===== */
.meal-next-row {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: center;
}

.meal-next-btn {
  padding: 14px 28px;
  border-radius: 14px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 6px 20px rgba(16,185,129,0.35);
  letter-spacing: 0.2px;
}

.meal-next-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(16,185,129,0.45);
}

.meal-next-btn:disabled {
  background: #e2e8f0;
  color: #94a3b8;
  box-shadow: none;
  cursor: not-allowed;
}

.meal-back-btn {
  padding: 12px 20px;
  border-radius: 14px;
  background: transparent;
  border: 1.5px solid #e2e8f0;
  color: #64748b;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.meal-back-btn:hover {
  border-color: #94a3b8;
  color: #374151;
  background: #f8fafc;
}

/* ===== LOADING ===== */
.meal-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px;
  gap: 16px;
  text-align: center;
}

.meal-loading-spinner {
  width: 52px;
  height: 52px;
  border: 4px solid #e2e8f0;
  border-top-color: #10b981;
  border-radius: 50%;
  animation: libSpin 0.8s linear infinite;
}

.meal-loading-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}

.meal-loading-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  background: #f8fafc;
  border-radius: 14px;
  padding: 16px 20px;
  width: 100%;
  max-width: 340px;
  border: 1px solid #e2e8f0;
}

.meal-loading-step {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #94a3b8;
  font-weight: 500;
  transition: color 0.3s;
}

.meal-loading-step.done { color: #059669; font-weight: 700; }

/* ===== RESULT HEADER ===== */
.meal-result-header {
  margin-bottom: 24px;
}

.meal-result-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.meal-result-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
}

.meal-result-subtitle {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #64748b;
  margin-top: 4px;
}

.meal-result-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.meal-result-badge {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid;
}

/* Macro summary */
.meal-macro-summary {
  background: linear-gradient(135deg, #060d1a, #0d2137);
  border-radius: 18px;
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  position: relative;
  overflow: hidden;
}

.meal-macro-summary::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(16,185,129,0.15), transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(245,158,11,0.1), transparent 50%);
}

.meal-macro-item {
  text-align: center;
  position: relative;
  z-index: 1;
}

.meal-macro-val {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 19px;
  font-weight: 700;
  display: block;
  line-height: 1.1;
}

.meal-macro-lbl {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== TIMELINE ===== */
.meal-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  margin-bottom: 24px;
  padding-left: 44px;
}

.meal-timeline::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 24px;
  bottom: 24px;
  width: 2px;
  background: linear-gradient(to bottom, #10b981, #059669, #6366f1);
  border-radius: 2px;
}

.meal-tl-card {
  position: relative;
  margin-bottom: 16px;
}

.meal-tl-dot {
  position: absolute;
  left: -36px;
  top: 20px;
  width: 24px;
  display: flex;
  justify-content: center;
}

.meal-tl-dot-circle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px rgba(16,185,129,0.2);
}

.meal-tl-body {
  background: #fff;
  border-radius: 18px;
  border: 1.5px solid #f1f5f9;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.meal-tl-card.open .meal-tl-body {
  box-shadow: 0 8px 28px rgba(0,0,0,0.07);
}

/* Colored card accents */
.meal-breakfast .meal-tl-dot-circle { background: #f59e0b; }
.meal-breakfast .meal-tl-body { border-left: 3px solid #f59e0b; }

.meal-snack1 .meal-tl-dot-circle { background: #f97316; }
.meal-snack1 .meal-tl-body { border-left: 3px solid #f97316; }

.meal-lunch .meal-tl-dot-circle { background: #10b981; }
.meal-lunch .meal-tl-body { border-left: 3px solid #10b981; }

.meal-snack2 .meal-tl-dot-circle { background: #8b5cf6; }
.meal-snack2 .meal-tl-body { border-left: 3px solid #8b5cf6; }

.meal-dinner .meal-tl-dot-circle { background: #3b82f6; }
.meal-dinner .meal-tl-body { border-left: 3px solid #3b82f6; }

.meal-tl-header {
  display: flex;
  flex-direction: column;
  padding: 16px 16px 12px;
  cursor: pointer;
  user-select: none;
  gap: 8px;
}

.meal-tl-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.meal-tl-time-badge {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,0.06);
  color: #374151;
  white-space: nowrap;
  flex-shrink: 0;
}

.meal-tl-top-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.meal-tl-cal-pill {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: rgba(0,0,0,0.2);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.meal-tl-prep-badge {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
}

.meal-tl-toggle {
  font-size: 14px;
  color: #94a3b8;
  transition: transform 0.3s;
  flex-shrink: 0;
}

.meal-tl-card.open .meal-tl-toggle { transform: rotate(180deg); }

.meal-tl-name-row { padding: 0 2px; }

.meal-tl-meal-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
}

.meal-tl-meal-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: #94a3b8;
  margin-top: 3px;
}

.meal-tl-content {
  display: none;
  padding: 0 18px 18px;
  border-top: 1px solid #f1f5f9;
}

.meal-tl-card.open .meal-tl-content {
  display: block;
  animation: mealFadeIn 0.25s ease;
}

/* Section labels */
.meal-section-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 16px 0 8px;
}

/* Ingredients */
.meal-ingredients {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meal-ingredient-tag {
  font-family: 'DM Sans', sans-serif;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: #374151;
}

/* Macros row */
.meal-macros-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.meal-macro-chip {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 6px 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #374151;
}

.meal-macro-chip span {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
}

/* Prep steps */
.meal-prep-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.meal-prep-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.meal-prep-text {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #374151;
  line-height: 1.6;
}

/* ===== ACTION BUTTONS ===== */
.meal-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.meal-regen-btn {
  flex: 1;
  padding: 14px 20px;
  border-radius: 14px;
  border: 2px solid #e2e8f0;
  background: #fff;
  font-family: 'DM Sans', sans-serif;
  color: #374151;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 180px;
}

.meal-regen-btn:hover {
  border-color: #10b981;
  color: #059669;
  background: #f0fdf4;
}

.meal-wa-btn {
  flex: 1;
  padding: 14px 20px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 6px 18px rgba(22,163,74,0.3);
  min-width: 180px;
}

.meal-wa-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(22,163,74,0.4);
}

/* ===== CTA BOX ===== */
.meal-cta-box {
  background: linear-gradient(135deg, #060d1a 0%, #0d2137 100%);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(16,185,129,0.15);
}

.meal-cta-box::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0% 50%, rgba(16,185,129,0.12), transparent 60%);
}

.meal-cta-icon { font-size: 38px; flex-shrink: 0; position: relative; }

.meal-cta-text {
  flex: 1;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: rgba(255,255,255,0.8);
  line-height: 1.65;
  min-width: 180px;
  position: relative;
}

.meal-cta-text strong { color: #fff; font-weight: 700; }

.meal-cta-btn {
  padding: 12px 22px;
  border-radius: 12px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.25s;
  box-shadow: 0 4px 16px rgba(16,185,129,0.35);
  position: relative;
}

.meal-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(16,185,129,0.5);
}

/* ===== MEAL DETAIL MODAL ===== */
.meal-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.meal-modal.show { display: flex; }

.meal-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6,13,26,0.7);
  backdrop-filter: blur(6px);
}

.meal-modal-content {
  position: relative;
  background: #fff;
  border-radius: 28px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px 28px 28px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.2);
  animation: modalIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.meal-modal-close {
  position: absolute;
  top: 18px; right: 18px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-weight: 700;
}

.meal-modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
  transform: rotate(90deg);
}

.modal-meal-header { margin-bottom: 18px; }
.modal-meal-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.modal-meal-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 22px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.2;
  margin: 0 0 6px;
}

.modal-meal-meta {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #94a3b8;
  font-weight: 500;
}

.modal-macro-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: linear-gradient(135deg, #060d1a, #0d2137);
  border-radius: 18px;
  padding: 18px 12px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}

.modal-macro-row::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 50%, rgba(16,185,129,0.15), transparent 60%);
}

.modal-macro-item { text-align: center; position: relative; }
.modal-macro-val {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 20px;
  font-weight: 900;
  display: block;
  line-height: 1.1;
}
.modal-macro-lbl {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  color: rgba(255,255,255,0.45);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-meal-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.modal-wa-btn {
  flex: 1;
  padding: 13px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(22,163,74,0.3);
}

.modal-wa-btn:hover { transform: translateY(-2px); }

.modal-diet-btn {
  flex: 1;
  padding: 13px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(16,185,129,0.3);
}

.modal-diet-btn:hover { transform: translateY(-2px); }

/* ===== NAV LINKS ===== */
.nav-link-meal  { color: #10b981 !important; }
.active-page    { background: rgba(16,185,129,0.1) !important; color: #10b981 !important; }

/* ===== RESPONSIVE ===== */
@media (max-width: 820px) {
  .lib-filter-row { grid-template-columns: 1fr; gap: 16px; }
  .lib-filter-row-2col { grid-template-columns: 1fr; gap: 14px; }
  .lib-goal-btn { font-size: 12px; padding: 7px 13px; }
  .meal-mode-inner { max-width: 100%; padding: 8px 12px; }
  .meal-mode-tab { padding: 10px 14px; gap: 10px; }
  .meal-mode-icon { font-size: 20px; }
  .meal-mode-title { font-size: 13px; }
  .meal-mode-sub { display: none; }
  .meal-hero-stats { padding: 12px 4px; }
  .meal-stat { padding: 0 16px; }
}

@media (max-width: 700px) {
  .meal-card { padding: 22px 18px; border-radius: 20px; }
  .meal-goal-grid { grid-template-columns: 1fr; gap: 10px; }
  .meal-goal-btn { flex-direction: row; text-align: left; padding: 16px; gap: 14px; }
  .meal-goal-icon { font-size: 28px; flex-shrink: 0; }
  .meal-pref-grid { grid-template-columns: 1fr; gap: 16px; }
  .meal-pref-full { grid-column: 1; }
  .meal-stat { padding: 4px 14px; }
  .meal-stat-div { display: none; }
  .meal-timeline { padding-left: 36px; }
  .meal-timeline::before { left: 12px; }
  .meal-tl-dot { left: -30px; }
  .meal-macro-summary { grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 16px; }
  .meal-actions { flex-direction: column; }
  .lib-grid { grid-template-columns: 1fr; }
  .lib-filter-bar { padding: 18px 16px; }
  .meal-next-row { flex-direction: column; align-items: stretch; }
  .meal-next-btn, .meal-back-btn { width: 100%; text-align: center; }
  .modal-macro-row { grid-template-columns: repeat(2,1fr); gap: 12px; padding: 14px; }
  .meal-modal-content { padding: 24px 18px 20px; border-radius: 22px; }
}

@media (max-width: 400px) {
  .meal-hero h1 { font-size: 26px; }
  .meal-card-title { font-size: 18px; }
  .meal-tl-prep-badge { display: none; }
  .meal-tl-cal-pill { font-size: 10px; padding: 3px 8px; }
}

/* ==========================================
   FEATURE 1 — WHY TAG
   ========================================== */
.lib-meal-why {
  font-size: 11px;
  color: #0369a1;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 7px 10px;
  margin: 8px 0 4px;
  line-height: 1.5;
  font-weight: 500;
}
.meal-why-box {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 16px 0;
  font-size: 13px;
  color: #0c4a6e;
  line-height: 1.6;
}
.meal-why-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }

/* ── Add to My Day button on card ── */
.lib-meal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.lib-add-day-btn {
  background: #ecfdf5;
  border: 1.5px solid #6ee7b7;
  color: #059669;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
}
.lib-add-day-btn:hover {
  background: #059669;
  color: #fff;
  border-color: #059669;
}

/* ==========================================
   MY DAY — LEFT SIDE FLOATING PANEL
   ========================================== */

/* ── Tab trigger (always visible on left) ── */
.myd-tab {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 801;
  background: linear-gradient(180deg, #10b981, #059669);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 10px;
  border-radius: 0 14px 14px 0;
  cursor: pointer;
  box-shadow: 4px 0 20px rgba(16,185,129,0.35);
  transition: padding 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  min-width: 44px;
}

.myd-tab:hover {
  padding-left: 14px;
  box-shadow: 6px 0 28px rgba(16,185,129,0.5);
}

.myd-tab:active {
  background: linear-gradient(180deg, #059669, #047857);
}

.myd-tab.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(-100%);
}

.myd-tab-icon  { font-size: 20px; line-height: 1; }

.myd-tab-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  white-space: nowrap;
}

.myd-tab .myd-count {
  background: #fff;
  color: #059669;
  font-size: 11px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
  line-height: 1.4;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

/* ── Backdrop ── */
.myd-backdrop {
  display: none;
  position: fixed;
  top: 0; /* JS will override */
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 802;
  background: rgba(6,13,26,0.45);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.3s;
}

.myd-backdrop.show {
  display: block;
  opacity: 1;
}

/* ── Slide-out Panel ── */
.my-day-panel {
  position: fixed;
  left: 0;
  top: 0; /* JS will override dynamically */
  bottom: 0;
  z-index: 803;
  width: 300px;
  max-width: 85vw;
  background: #fff;
  border-right: 3px solid #10b981;
  box-shadow: 6px 0 40px rgba(16,185,129,0.2), 2px 0 12px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform 0.3s cubic-bezier(0.34, 1.1, 0.64, 1);
  overflow: hidden;
}

.my-day-panel.collapsed {
  transform: translateX(-100%);
}

/* ── Header ── */
.myd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 14px;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border-bottom: 1px solid #a7f3d0;
  flex-shrink: 0;
  user-select: none;
}

.myd-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: #065f46;
  display: flex;
  align-items: center;
  gap: 8px;
}

.myd-title-icon { font-size: 18px; }

.myd-count-inner {
  background: #10b981;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  min-width: 22px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(16,185,129,0.4);
}

.myd-header-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.myd-share-btn {
  background: linear-gradient(135deg, #16a34a, #15803d);
  border: none;
  border-radius: 8px;
  padding: 7px 11px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  transition: all 0.2s;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(22,163,74,0.3);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.myd-share-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22,163,74,0.45);
}

.myd-clear-btn {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 14px;
  cursor: pointer;
  color: #94a3b8;
  transition: all 0.2s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.myd-clear-btn:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fca5a5;
}

.myd-close-btn {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: #64748b;
  transition: all 0.2s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  line-height: 1;
}

.myd-close-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

/* ── Body ── */
.myd-body {
  overflow-y: auto;
  flex: 1;
  padding: 14px 16px 20px;
  background: #fafffe;
}

/* ── Totals ── */
.myd-totals {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #060d1a, #0d2137);
  border-radius: 14px;
  padding: 14px 12px;
  position: relative;
  overflow: hidden;
}

.myd-totals::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 50%, rgba(16,185,129,0.2), transparent 60%);
}

.myd-total-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  gap: 3px;
  position: relative;
  z-index: 1;
}

.myd-total-item span:first-child {
  font-size: 16px;
  font-weight: 800;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

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

.myd-empty {
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  padding: 32px 12px 16px;
  line-height: 1.8;
}

.myd-item {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 11px 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.myd-item:hover {
  border-color: #a7f3d0;
  box-shadow: 0 2px 10px rgba(16,185,129,0.1);
}

.myd-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.myd-slot {
  font-size: 10px;
  font-weight: 700;
  color: #10b981;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #ecfdf5;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #a7f3d0;
}

.myd-remove {
  background: none;
  border: none;
  color: #cbd5e1;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 6px;
  transition: all 0.2s;
  line-height: 1;
  touch-action: manipulation;
}

.myd-remove:hover { color: #dc2626; background: #fef2f2; }

.myd-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 3px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  line-height: 1.35;
}

.myd-macros { font-size: 11px; color: #64748b; font-weight: 500; }

/* ── Toast ── */
.my-day-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #0f172a;
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: all 0.3s;
  z-index: 9000;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

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

/* ── Mobile ── */
@media (max-width: 480px) {
  .my-day-panel { width: 280px; }
  .myd-tab { padding: 12px 8px; min-width: 40px; }
  .myd-tab-icon { font-size: 18px; }
}

/* ==========================================
   WOMEN'S HEALTH GOALS — NEW STYLES
   Classic Fitness Gym
   ========================================== */

/* ── Section label between main goals and women's goals ── */
.meal-goal-section-label {
  margin: 8px 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.meal-goal-section-label::before,
.meal-goal-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #f9a8d4, transparent);
}

.goal-section-tag {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #db2777;
  background: linear-gradient(135deg, #fdf2f8, #fce7f3);
  border: 1px solid #f9a8d4;
  padding: 5px 16px;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

/* ── Women's goal grid — 4 columns ── */
.meal-goal-grid-womens {
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 0;
}

/* ── Women's goal button — pink accent theme ── */
.meal-goal-btn-womens {
  border-color: #f9a8d4;
  background: linear-gradient(135deg, #fff5f7, #fff);
}

.meal-goal-btn-womens::before {
  background: linear-gradient(135deg, rgba(219,39,119,0.06), rgba(219,39,119,0.02));
}

.meal-goal-btn-womens:hover {
  border-color: #db2777;
  box-shadow: 0 12px 28px rgba(219,39,119,0.15);
  transform: translateY(-4px);
}

.meal-goal-btn-womens.selected {
  border-color: #db2777;
  background: linear-gradient(135deg, #fdf2f8, #fce7f3);
  box-shadow: 0 8px 24px rgba(219,39,119,0.2);
}

/* ── Women's goals in Library filter bar ── */
.lib-womens-goals {
  padding-top: 4px;
}

.lib-toggle-btn.lib-womens-btn {
  border-color: #f9a8d4;
  color: #9d174d;
  background: #fff5f7;
}

.lib-toggle-btn.lib-womens-btn:hover {
  border-color: #db2777;
  color: #9d174d;
  background: #fdf2f8;
}

.lib-toggle-btn.lib-womens-btn.active {
  background: linear-gradient(135deg, #db2777, #be185d);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(219,39,119,0.3);
}

/* ── Result badges for women's goals ── */
.meal-result-badge[data-goal="Pre-Pregnancy"],
.meal-result-badge[data-goal="Post-Pregnancy"] {
  background: #fdf2f8;
  color: #db2777;
  border-color: #f9a8d4;
}

/* ── Mobile responsive for women's goal grid ── */
@media (max-width: 820px) {
  .meal-goal-grid-womens {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .meal-goal-grid-womens {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .meal-goal-btn-womens {
    padding: 14px 10px;
  }

  .meal-goal-section-label {
    margin: 6px 0 10px;
  }
}


/* ==========================================
   MOBILE-FIRST FILTER BAR IMPROVEMENTS
   All phones — 320px to 480px
   ========================================== */

/* Filter bar overall on mobile */
@media (max-width: 640px) {
  .lib-filter-bar {
    padding: 16px 14px;
    border-radius: 18px;
  }

  /* Slot tabs — scrollable row on small phones */
  .lib-slot-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
    gap: 6px;
  }
  .lib-slot-tabs::-webkit-scrollbar { display: none; }
  .lib-slot-btn {
    flex-shrink: 0;
    padding: 7px 14px;
    font-size: 12px;
  }

  /* 2-col becomes 1-col on small phones */
  .lib-filter-row-2col {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Goal buttons wrap nicely */
  .lib-goal-row {
    gap: 6px;
  }
  .lib-goal-btn {
    font-size: 12px;
    padding: 7px 12px;
    border-radius: 10px;
  }

  /* Women's heading smaller */
  .lib-womens-heading {
    font-size: 10px;
    padding: 3px 12px;
  }

  /* Toggle buttons smaller */
  .lib-toggle-btn {
    font-size: 11px;
    padding: 6px 11px;
  }

  /* Search row stacks on mobile */
  .lib-search-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-top: 14px;
  }
  .lib-count {
    text-align: center;
    font-size: 12px;
  }

  /* Meal grid — 1 column on phones */
  .lib-grid {
    grid-template-columns: 1fr !important;
  }

  /* Filter label styling on mobile */
  .lib-filter-label {
    font-size: 10px;
    margin-bottom: 8px;
  }

  /* Filter group spacing */
  .lib-filter-group {
    margin-bottom: 14px;
  }
  .lib-goal-group {
    margin-bottom: 10px;
  }
}

/* Very small phones — 320px */
@media (max-width: 360px) {
  .lib-slot-btn {
    padding: 6px 11px;
    font-size: 11px;
  }
  .lib-goal-btn {
    font-size: 11px;
    padding: 6px 10px;
  }
  .lib-filter-bar {
    padding: 14px 12px;
  }
}

/* ── Meal card mobile improvements ── */
@media (max-width: 640px) {
  .lib-meal-card {
    border-radius: 16px;
    padding: 16px;
  }
  .lib-meal-name {
    font-size: 14px;
  }
  .lib-macro-val {
    font-size: 15px;
  }
  .lib-macro-lbl {
    font-size: 10px;
  }
  .lib-meal-footer {
    flex-direction: column;
    gap: 8px;
  }
  .lib-view-btn {
    text-align: center;
    padding: 10px;
    border-radius: 10px;
    background: #f0fdf4;
    color: #059669;
    font-weight: 700;
  }
  .lib-add-day-btn {
    width: 100%;
    justify-content: center;
    border-radius: 10px;
    padding: 10px;
  }
}

/* ── Modal mobile improvements ── */
@media (max-width: 640px) {
  .meal-modal-content {
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
    padding: 20px 16px;
  }
  .modal-meal-name {
    font-size: 18px;
  }
  .meal-prep-step {
    gap: 10px;
  }
  .meal-prep-num {
    width: 26px;
    height: 26px;
    font-size: 11px;
    flex-shrink: 0;
  }
  .meal-prep-text {
    font-size: 13px;
  }
  .meal-ingredient-tag {
    font-size: 11px;
    padding: 4px 10px;
  }
}

/* ── AI Planner mobile improvements ── */
@media (max-width: 640px) {
  .meal-goal-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px;
  }
  .meal-goal-btn {
    padding: 16px 10px;
    border-radius: 16px;
  }
  .meal-goal-icon {
    font-size: 28px;
  }
  .meal-goal-name {
    font-size: 12px;
  }
  .meal-goal-desc {
    font-size: 10px;
    display: none;
  }
  .meal-goal-grid-womens {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px;
  }
  .meal-goal-section-label {
    margin: 10px 0 12px;
  }
  .goal-section-tag {
    font-size: 11px;
    padding: 4px 12px;
  }
  /* Step indicator compact on mobile */
  .meal-steps {
    gap: 6px;
  }
  .meal-step-label {
    font-size: 10px;
  }
  .meal-step-circle {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  /* Timeline cards */
  .meal-tl-body {
    padding: 14px;
  }
  .meal-tl-meal-name {
    font-size: 15px;
  }
  .meal-macro-chip {
    font-size: 12px;
    padding: 5px 10px;
  }
  /* Actions buttons */
  .meal-regen-btn,
  .meal-wa-btn {
    width: 100%;
    text-align: center;
    padding: 14px;
    font-size: 14px;
  }
}

/* ── My Day panel mobile ── */
@media (max-width: 640px) {
  .my-day-panel {
    width: 100% !important;
    max-width: 320px;
  }
  .myd-header {
    padding: 16px;
  }
  .myd-item {
    padding: 12px;
  }
}

/* ── Mode tabs mobile ── */
@media (max-width: 480px) {
  .meal-mode-tabs {
    padding: 8px 0;
  }
  .meal-mode-inner {
    gap: 6px;
  }
  .meal-mode-tab {
    flex: 1;
    padding: 10px 8px;
    gap: 6px;
    border-radius: 14px;
  }
  .meal-mode-icon {
    font-size: 18px;
  }
  .meal-mode-title {
    font-size: 12px;
  }
}