/* ----- REFINED, CLASSY MINIMAL THEME ----- */
:root {
  --bg:       #faf9f7;
  --surface:  #ffffff;
  --surface2: #f4f2ef;
  --border:   #e4dfd9;
  --ink:      #2c2824;
  --ink2:     #5f5852;
  --ink3:     #8f8881;
  --accent:   #9b7b5c;
  --accent-h: #7a5f47;
  --green:    #5f7a63;
  --red:      #b15e55;
  --gold:     #b38b4a;
  --radius:   6px;
  --font-head: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Inter', sans-serif;
  --mobile-nav-h: 64px;

  /* Animation easing variables */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-spring:   cubic-bezier(0.25, 1.2, 0.5, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  font-weight: 400;
}

.container { max-width: 900px; margin: 0 auto; padding: 0 24px; }

/* ---- HEADER ---- */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 32px 24px 24px;
}
header .inner { max-width: 900px; margin: 0 auto; display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 16px; }
header h1 {
  font-family: var(--font-head);
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--ink);
}
.header-tagline { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
header p { font-size: 15px; color: var(--ink2); font-weight: 400; }

/* ---- DESKTOP NAV ---- */
.desktop-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.desktop-nav .inner { max-width: 900px; margin: 0 auto; padding: 0 24px; display: flex; gap: 4px; flex-wrap: wrap; }
.tab {
  padding: 16px 22px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink2);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.2s var(--ease-out-expo), border-color 0.2s var(--ease-out-expo);
  display: flex;
  align-items: center;
  gap: 8px;
}
.tab meal-icon {
  font-size: 20px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---- APP SHELL ---- */
html, body { height: 100%; }
#app-shell { display: flex; flex-direction: column; min-height: 100%; }
#app-scroll { flex: 1 1 auto; overflow-y: auto; min-height: 0; }

/* ---- MOBILE NAV (sticky top) ---- */
.mobile-nav {
  display: none;
  width: 100%;
  height: var(--mobile-nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
  flex-shrink: 0;
}
.mobile-tab {
  flex: 1;
  height: 100%;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.15s var(--ease-spring), color 0.2s var(--ease-out-expo);
  color: var(--ink2);
}
.mobile-tab meal-icon { font-size: 28px; }
.mobile-tab:active { transform: scale(0.88); }
.mobile-tab.active { color: var(--accent); }
.mobile-tab.active::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  animation: dotFadeIn 0.2s var(--ease-out-expo);
}
@keyframes dotFadeIn {
  from { opacity: 0; transform: translateX(-50%) scale(0); }
  to   { opacity: 1; transform: translateX(-50%) scale(1); }
}

/* ---- SECTIONS ---- */
.section { padding: 40px 24px; display: none; }
.section.active { display: block; }
.section-title {
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 600;
  margin-bottom: 28px;
  color: var(--ink);
}

/* ---- BUTTONS (smoother transitions) ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 30px;
  border: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s var(--ease-out-expo);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
  transform: translateY(0);
}
.btn meal-icon { font-size: 20px; }
.btn:hover {
  background: var(--surface2);
  border-color: var(--accent);
  box-shadow: 0 4px 8px rgba(0,0,0,0.04);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(1px); box-shadow: 0 1px 2px rgba(0,0,0,0.02); }
.btn-primary { background: var(--accent); color: white; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-h); }
.btn-secondary { background: var(--surface2); }
.btn-ai { background: linear-gradient(135deg, #8b7a6b, #9b7b5c); color: white; border: none; }
.btn-sm { padding: 7px 16px; font-size: 13px; }
.btn-danger { color: var(--red); border-color: #e6cfca; background: #fdf6f5; }

/* ---- DIFFICULTY BADGE ---- */
.diff-badge {
  font-size: 10px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 30px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  transition: background 0.2s;
}
.diff-easy   { background: #eef3ef; color: #3d6643; border-color: #c3d9c7; }
.diff-medium { background: #fcf5e8; color: #7a5a1a; border-color: #e8d09b; }
.diff-hard   { background: #fdeae8; color: #8a3a32; border-color: #dcb9b4; }

/* ---- RECIPE CARDS (smooth hover) ---- */
.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: box-shadow 0.3s var(--ease-out-expo), transform 0.25s var(--ease-out-expo);
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
  position: relative;
  transform: translateY(0);
}
.card:hover {
  box-shadow: 0 12px 24px rgba(0,0,0,0.06);
  transform: translateY(-3px);
}
.card:active { transform: translateY(1px); box-shadow: 0 4px 12px rgba(0,0,0,0.04); }

.card-emoji { font-size: 32px; line-height: 1; margin-bottom: 2px; }
.card-name  { font-family: var(--font-head); font-size: 20px; line-height: 1.3; font-weight: 600; }
.card-flavor { font-size: 13px; color: var(--ink2); font-style: italic; }
.card-tags  { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 11px;
  background: var(--bg);
  padding: 3px 9px;
  border-radius: 30px;
  color: var(--ink2);
  border: 1px solid var(--border);
  font-weight: 500;
  transition: background 0.2s;
}

.card-view-hint {
  margin-top: auto;
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.25s var(--ease-out-expo);
}
.card:hover .card-view-hint { opacity: 1; }

/* ---- FAB (floating pan emoji - smoother float) ---- */
.fab {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 70px;
  height: 70px;
  background: transparent;
  border: none;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  cursor: pointer;
  transition: transform 0.25s var(--ease-spring);
  z-index: 150;
  animation: floatPan 4s infinite ease-in-out;
  text-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform-origin: center;
}
.fab:hover {
  transform: scale(1.15) rotate(2deg);
  animation-play-state: paused;
}
@keyframes floatPan {
  0%   { transform: translateY(0) rotate(0deg); }
  50%  { transform: translateY(-10px) rotate(2deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

/* ---- RECIPE DETAIL DRAWER (smooth slide) ---- */
.drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(44, 40, 36, 0.35);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.25s cubic-bezier(0.2, 0.9, 0.4, 1);
}
.drawer-backdrop.open {
  display: block;
  opacity: 1;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 100vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 40px rgba(0,0,0,0.10);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.4, 1);
  z-index: 301;
  overflow: hidden;
}
.drawer-backdrop.open .drawer {
  transform: translateX(0);
}

.drawer-handle {
  display: none;
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  margin: 12px auto 0;
  flex-shrink: 0;
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 28px 28px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer-title-area {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex: 1;
  min-width: 0;
}
.drawer-emoji {
  font-size: 42px;
  line-height: 1;
  flex-shrink: 0;
  transition: transform 0.2s var(--ease-spring);
}
.drawer-emoji:hover { transform: scale(1.05); }
.drawer-name {
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 4px;
}
.drawer-flavor {
  font-size: 14px;
  color: var(--ink2);
  font-style: italic;
}
.drawer-close {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink2);
  flex-shrink: 0;
  margin-left: 12px;
  transition: background 0.2s var(--ease-out-expo), transform 0.15s;
}
.drawer-close meal-icon { font-size: 20px; }
.drawer-close:hover { background: var(--border); transform: scale(1.05); }
.drawer-close:active { transform: scale(0.95); }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  opacity: 0;
  transition: opacity 0.2s ease 0.1s;
}
.drawer-backdrop.open .drawer-body {
  opacity: 1;
}

/* Drawer sections */
.drawer-section {}
.drawer-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  color: var(--ink3);
  margin-bottom: 10px;
}
.drawer-tags-row { display: flex; flex-wrap: wrap; gap: 8px; }
.drawer-plate {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.drawer-plate-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
  transition: transform 0.2s var(--ease-out-expo);
}
.drawer-plate-item:hover { transform: translateY(-2px); }
.drawer-plate-icon { font-size: 20px; margin-bottom: 4px; }
.drawer-plate-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--ink3); margin-bottom: 2px; }
.drawer-plate-val { font-size: 12px; color: var(--ink2); font-weight: 500; line-height: 1.3; }

.drawer-instructions {
  font-size: 14px;
  color: var(--ink2);
  line-height: 1.7;
  background: var(--surface2);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  transition: background 0.2s;
}

.drawer-grocery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.drawer-grocery-aisle {}
.drawer-grocery-aisle-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink2);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.drawer-grocery-item {
  font-size: 13px;
  color: var(--ink2);
  padding: 4px 0;
  border-bottom: 1px dotted var(--border);
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.drawer-grocery-qty {
  font-size: 11px;
  color: var(--ink3);
  flex-shrink: 0;
}

.drawer-source-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 0;
  transition: color 0.2s;
}
.drawer-source-link:hover { text-decoration: underline; }

.drawer-footer {
  display: flex;
  gap: 10px;
  padding: 16px 28px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.drawer-btn-add { flex: 1; justify-content: center; }

/* ---- PLANNER (smooth interactions) ---- */
.planner-actions { display: flex; gap: 12px; margin-bottom: 28px; flex-wrap: wrap; align-items: center; }
.week-grid { display: flex; flex-direction: column; gap: 10px; }
.day-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 80px 1fr 80px 1fr auto auto;
  gap: 12px;
  align-items: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.02);
  transition: box-shadow 0.2s var(--ease-out-expo), border-color 0.2s;
}
.day-row:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.04); border-color: var(--accent); }
.day-label { font-family: var(--font-head); font-size: 18px; font-weight: 600; }
.day-row select, .day-row input[type="text"], .day-row input[type="number"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 30px;
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 14px;
  transition: border-color 0.2s var(--ease-out-expo), box-shadow 0.2s;
}
.day-row select:focus, .day-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(155, 123, 92, 0.1);
  outline: none;
}
.day-clear { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--ink3); padding: 4px; transition: color 0.2s, transform 0.15s; }
.day-clear:hover { color: var(--red); transform: scale(1.1); }
.day-cal {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s var(--ease-out-expo), border-color 0.2s, transform 0.15s;
  flex-shrink: 0;
}
.day-cal:hover { background: var(--accent); border-color: var(--accent); transform: scale(1.05); }
.day-cal:disabled { opacity: 0.3; cursor: not-allowed; transform: none; }
.autosave { font-size: 13px; color: var(--green); font-weight: 500; min-width: 56px; display: inline-block; }

/* ---- MODAL (smooth fade & scale) ---- */
.modal-tabs { display: flex; gap: 8px; margin-bottom: 24px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.modal-tab-btn {
  background: none;
  border: none;
  padding: 8px 16px;
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--ink2);
  cursor: pointer;
  border-radius: 30px;
  transition: background 0.2s var(--ease-out-expo), color 0.2s;
}
.modal-tab-btn.active { background: var(--surface2); color: var(--accent); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

.ai-panel-modal { background: transparent; padding: 0; margin: 0; border: none; }
.ai-prompt-area { display: flex; gap: 12px; margin-top: 18px; }
.ai-prompt-area input {
  flex:1;
  padding: 14px 18px;
  border-radius: 40px;
  border: 1px solid var(--border);
  background: white;
  font-family: var(--font-body);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.ai-prompt-area input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(155, 123, 92, 0.1);
  outline: none;
}
.ai-status { margin-top: 12px; font-size: 13px; }

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.2);
  z-index: 400;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.2s var(--ease-out-expo);
}
.modal-backdrop.open { display: flex; opacity: 1; }

.modal {
  background: var(--surface);
  border-radius: 24px;
  padding: 32px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.25s var(--ease-out-back), opacity 0.2s var(--ease-out-expo);
}
.modal-backdrop.open .modal {
  transform: scale(1);
  opacity: 1;
}

.modal h3 { font-family: var(--font-head); font-size: 24px; margin-bottom: 8px; font-weight: 600; }
.field { margin-bottom: 20px; }
.field label {
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink2);
  display: block;
  margin-bottom: 6px;
  letter-spacing: 0.4px;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 14px;
  transition: border-color 0.2s var(--ease-out-expo), box-shadow 0.2s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(155, 123, 92, 0.1);
  outline: none;
}
.field-error { color: var(--red); font-size: 12px; margin-top: 4px; display: none; }
.field-error.show { display: block; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 28px; }

/* ---- AI OVERLAY (smoother step transitions) ---- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes floatUp {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-6px); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes successPop {
  0%   { transform: scale(0.7); opacity: 0; }
  60%  { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.ai-generating-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.96);
  border-radius: 24px;
  z-index: 10;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  padding: 32px;
  animation: fadeInUp 0.3s var(--ease-out-expo);
}
.ai-generating-overlay.visible { display: flex; }
.ai-spinner-ring {
  width: 56px;
  height: 56px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.ai-generating-emoji {
  font-size: 36px;
  animation: floatUp 2s ease-in-out infinite;
  position: absolute;
  margin-top: -4px;
}
.ai-generating-title { font-family: var(--font-head); font-size: 22px; font-weight: 600; color: var(--ink); }
.ai-generating-sub { font-size: 13px; color: var(--ink2); max-width: 260px; line-height: 1.5; }
.ai-generating-steps { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.ai-step {
  font-size: 12px;
  color: var(--ink3);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.3s var(--ease-out-expo), color 0.2s;
}
.ai-step.active { opacity: 1; color: var(--accent); }
.ai-step.done   { opacity: 0.6; color: var(--green); }
.ai-step-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  transition: background 0.2s;
}

.ai-success-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.97);
  border-radius: 24px;
  z-index: 11;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 32px;
}
.ai-success-overlay.visible { display: flex; }
.ai-success-icon  { font-size: 52px; animation: successPop 0.4s var(--ease-out-back) forwards; }
.ai-success-title { font-family: var(--font-head); font-size: 24px; font-weight: 600; color: var(--green); }
.ai-success-name  { font-size: 15px; color: var(--ink2); font-style: italic; }

.ai-status-error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fdf4f3;
  border: 1px solid #f0c8c4;
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 12px;
  font-size: 13px;
  color: #8a3a32;
  line-height: 1.5;
  animation: fadeInUp 0.25s var(--ease-out-expo);
}
.ai-status-error .err-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.ai-status-error .err-body { flex: 1; }
.ai-status-error .err-retry {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  margin-top: 4px;
  display: block;
  transition: color 0.2s;
}
.btn-ai:disabled { opacity: 0.7; cursor: not-allowed; }
.add-recipe-modal { position: relative; overflow: hidden; }

/* ---- GUIDE ---- */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-bottom: 32px; }
.guide-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  transition: box-shadow 0.3s var(--ease-out-expo), transform 0.25s var(--ease-out-expo);
}
.guide-item:hover { box-shadow: 0 8px 20px rgba(0,0,0,0.04); transform: translateY(-2px); }
.guide-icon {
  font-size: 32px;
  margin-bottom: 16px;
  background: var(--surface2);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: transform 0.2s var(--ease-spring);
}
.guide-item:hover .guide-icon { transform: scale(1.05); }
.guide-item h4 { font-family: var(--font-head); font-size: 20px; margin-bottom: 12px; font-weight: 600; }
.guide-item p  { font-size: 14px; color: var(--ink2); line-height: 1.6; margin-bottom: 8px; }
.guide-item ul { list-style-type: disc; padding-left: 20px; color: var(--ink2); font-size: 14px; line-height: 1.6; }
.guide-item li { margin-bottom: 4px; }

/* ---- TOAST (smooth slide) ---- */
#toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: white;
  padding: 12px 28px;
  border-radius: 40px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.25s var(--ease-out-expo), transform 0.25s var(--ease-out-expo);
  z-index: 999;
  pointer-events: none;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- FOOTER ---- */
footer {
  padding: 48px 24px;
  text-align: center;
  font-size: 14px;
  color: var(--ink3);
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
footer a { color: var(--accent); text-decoration: none; font-weight: 500; }

/* ---- EMPTY STATE ---- */
.empty-state { text-align: center; padding: 64px 24px; color: var(--ink2); }

/* =============================================
   PRINT STYLES (unchanged)
   ============================================= */
.print-page {
  background: white;
  padding: 56px 52px;
  max-width: 820px;
  margin: 0 auto 48px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 24px rgba(0,0,0,0.04);
  border-radius: 4px;
}
.cafe-header {
  text-align: center;
  margin-bottom: 44px;
  padding-bottom: 28px;
  border-bottom: 2px solid var(--ink);
  position: relative;
}
.cafe-header h2 {
  font-family: var(--font-head);
  font-size: 52px;
  font-weight: 400;
  font-style: italic;
  letter-spacing: -1px;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 10px;
}
.cafe-header .week-date {
  text-transform: uppercase;
  letter-spacing: 5px;
  font-size: 10px;
  color: var(--ink3);
  font-weight: 500;
}
.menu-item {
  display: grid;
  grid-template-columns: 80px 1fr 80px;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
  page-break-inside: avoid;
}
.menu-item:last-child { border-bottom: none; }
.menu-day {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--accent);
  padding-top: 6px;
  line-height: 1.4;
}
.menu-content h3 {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1;
  margin-bottom: 5px;
  color: var(--ink);
}
.menu-desc {
  font-size: 13px;
  color: var(--ink2);
  font-style: italic;
  margin-bottom: 8px;
  line-height: 1.4;
}
.menu-instructions {
  font-size: 12px;
  color: var(--ink3);
  line-height: 1.55;
  margin-bottom: 8px;
  max-width: 480px;
}
.menu-details {
  display: flex;
  gap: 14px;
  font-size: 11px;
  color: var(--ink3);
  flex-wrap: wrap;
  align-items: center;
  margin-top: 4px;
}
.menu-qr {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.menu-qr img {
  border-radius: 4px;
  border: 1px solid var(--border);
  width: 60px;
  height: 60px;
}
.menu-servings {
  text-align: right;
  font-family: var(--font-head);
  font-style: italic;
  color: var(--ink3);
  font-size: 16px;
}
.menu-note {
  font-size: 11px;
  color: var(--ink3);
  font-style: italic;
  margin-top: 3px;
}
.cafe-grocery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px 48px;
}
.cafe-category h4 {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 600;
  border-bottom: 1.5px solid var(--ink);
  padding-bottom: 8px;
  margin-bottom: 14px;
}
.cafe-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  padding: 7px 0;
  border-bottom: 1px dotted #ddd;
  color: var(--ink2);
}
.cafe-item:last-child { border-bottom: none; }
.cafe-item .checkbox {
  width: 15px;
  height: 15px;
  border: 1.5px solid #bbb;
  border-radius: 3px;
  flex-shrink: 0;
}
.cafe-item-name { flex: 1; }
.cafe-item-qty  { font-size: 12px; color: var(--ink3); white-space: nowrap; }

@media print {
  header, nav, .desktop-nav, .mobile-nav,
  #tab-recipes, #tab-planner, #tab-settings, #tab-guide,
  footer, .print-actions, .no-print,
  .modal-backdrop, .drawer-backdrop,
  #toast, .fab { display: none !important; }
  body { background: white; font-size: 13px; }
  #tab-output { display: block !important; padding: 0; }
  .print-page {
    box-shadow: none;
    border: none;
    padding: 0;
    max-width: 100%;
    margin: 0;
  }
  .cafe-header { border-bottom: 1.5px solid #000; }
  .menu-item   { page-break-inside: avoid; }
  body.print-menu-only  .print-page.grocery-page  { display: none !important; }
  body.print-list-only  .print-page.menu-page     { display: none !important; }
  .print-page.grocery-page {
    page-break-before: always;
    break-before: page;
    margin-top: 0;
  }
}

/* =============================================
   RESPONSIVE — MOBILE (with smoother transitions)
   ============================================= */
@media (max-width: 680px) {
  header { padding: 20px 16px 16px; }
  header h1 { font-size: 26px; }
  header p  { font-size: 13px; }

  .desktop-nav { display: none; }
  .mobile-nav  { display: flex; }

  .section { padding: 24px 16px 24px; }

  .fab {
    bottom: 36px;
    right: 20px;
    width: auto;
    height: auto;
    font-size: 64px;
  }

  #toast { bottom: 30px; }
  #toast.show { bottom: 40px; }

  .recipes-grid { grid-template-columns: 1fr; gap: 12px; }
  .card { padding: 16px; flex-direction: row; align-items: center; gap: 14px; cursor: pointer; }
  .card-emoji { font-size: 36px; flex-shrink: 0; }
  .card-body  { flex: 1; min-width: 0; }
  .card-name  { font-size: 17px; }
  .card-flavor { font-size: 12px; }
  .card-view-hint { display: none; }
  .card-arrow {
    font-size: 18px;
    color: var(--ink3);
    flex-shrink: 0;
  }

  .drawer {
  top: auto;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  max-width: 100%;
  height: 88vh;
  border-left: none;
  border-top: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.12);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.4, 1);
}
.drawer-backdrop.open .drawer {
  transform: translateY(0);
}
  .drawer-handle { display: block; }
  .drawer-header { padding: 16px 20px 16px; }
  .drawer-body   { padding: 20px 20px; }
  .drawer-footer { padding: 12px 20px calc(env(safe-area-inset-bottom, 0px) + 12px); }

  .day-row {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 10px;
    padding: 14px 16px;
  }
  .day-label { grid-column: 1; font-size: 16px; }
  .day-row select { grid-column: 1 / -1; }
  .day-row input[type="number"] { grid-column: 1; }
  .day-row input[type="text"]   { grid-column: 1 / -1; }
  .day-cal   { justify-self: end; }
  .day-clear { justify-self: end; }

  .planner-actions {
    flex-direction: column;
    gap: 10px;
  }
  .planner-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 14px 16px;
    font-size: 15px;
  }
  #autosaveBadge { align-self: flex-end; }

  .print-actions {
    flex-direction: column;
    gap: 10px;
  }
  .print-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 14px 16px;
    font-size: 15px;
  }

  .cafe-grocery-grid { grid-template-columns: 1fr; }
  .menu-item { grid-template-columns: 1fr; gap: 6px; }
  .menu-qr   { align-items: flex-start; margin-top: 6px; }

  .drawer-grocery-grid { grid-template-columns: 1fr; }
  .drawer-plate { grid-template-columns: 1fr 1fr 1fr; }

  .btn { white-space: normal; text-align: center; }
}

/* css/styles.css — add the new section styles at the end (or integrate) */

/* Combined Guide & Data Section */
.guide-data-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 48px 0;
  margin-top: 24px;
}

.guide-data-section .container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

.guide-data-section .section-title {
  margin-bottom: 32px;
  font-size: 28px;
  letter-spacing: -0.3px;
}

.data-management {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px dashed var(--border);
}

/* Ensure the guide grid still looks good */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

/* Mobile adjustments */
@media (max-width: 680px) {
  .guide-data-section {
    padding: 32px 0;
  }
  .guide-data-section .section-title {
    font-size: 24px;
  }
  .data-management {
    margin-top: 32px;
    padding-top: 24px;
  }
  .data-management .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ----- COLLAPSIBLE GUIDE & DATA SECTION ----- */
.guide-data-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 24px 0;
  margin-top: 24px;
}

.guide-data-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 8px 0;
  user-select: none;
}

.toggle-btn {
  background: none;
  border: none;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink2);
  transition: background 0.2s, transform 0.2s;
}

.toggle-btn:hover {
  background: var(--surface2);
}

.toggle-btn meal-icon {
  font-size: 24px;
  transition: transform 0.3s var(--ease-out-expo);
}

.guide-data-content {
  overflow: hidden;
  transition: max-height 0.35s var(--ease-out-expo), opacity 0.25s ease, margin 0.25s ease;
  max-height: 2000px;
  opacity: 1;
  margin-top: 16px;
}

.guide-data-content.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  margin-bottom: 0;
}

.data-management {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px dashed var(--border);
}

/* Mobile adjustments */
@media (max-width: 680px) {
  .guide-data-section {
    padding: 16px 0;
  }
  .data-management {
    margin-top: 24px;
    padding-top: 20px;
  }
  .data-management .btn {
    width: 100%;
    justify-content: center;
  }
}
/* ============================================================
   ONBOARDING BANNER
   ============================================================ */
.onboarding-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0;
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: none;
}

.onboarding-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
}

.onboarding-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.onboarding-sparkle {
  font-size: 15px;
  opacity: 0.7;
}

.onboarding-title {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink2);
  margin: 0;
}

.onboarding-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  border-radius: 20px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink3);
  cursor: pointer;
  transition: color 0.2s;
}
.onboarding-toggle:hover { color: var(--accent); }
.onboarding-toggle meal-icon { font-size: 16px; transition: transform 0.3s ease; }

.onboarding-body {
  padding: 0 24px 24px;
  transition: opacity 0.3s ease, max-height 0.35s ease;
}

.onboarding-subtitle {
  color: var(--ink2);
  font-size: 14px;
  margin-bottom: 20px;
}

.onboarding-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.onboarding-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 16px;
  position: relative;
  transition: box-shadow 0.2s, transform 0.2s;
}
.onboarding-step:hover {
  box-shadow: 0 4px 16px rgba(155,123,92,0.1);
  transform: translateY(-1px);
}

.step-number {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-icon {
  font-size: 28px;
  margin-bottom: 10px;
}

.onboarding-step h4 {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--ink);
}

.onboarding-step p {
  font-size: 13px;
  color: var(--ink2);
  line-height: 1.5;
}

.onboarding-data {
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.onboarding-data-row {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}

.onboarding-data-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.onboarding-data-note {
  font-size: 13px;
  color: var(--ink3);
  align-self: center;
}

.btn-sm {
  padding: 8px 14px !important;
  font-size: 13px !important;
}

/* ============================================================
   CALENDAR PLANNER
   ============================================================ */
.planner-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 12px;
  flex-wrap: wrap;
}

.planner-toolbar-left {}

.planner-week-label {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
}

.planner-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Calendar grid */
.cal-grid {
  display: grid;
  grid-template-columns: 90px repeat(7, 1fr);
  gap: 0;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

/* Header row */
.cal-header-row {
  display: contents;
}

.cal-corner {
  background: var(--surface);
  padding: 12px 8px;
  border-bottom: 1.5px solid var(--border);
  border-right: 1px solid var(--border);
}

.cal-day-header {
  background: var(--surface);
  padding: 12px 6px;
  text-align: center;
  border-bottom: 1.5px solid var(--border);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.cal-day-header:last-child { border-right: none; }

.cal-today-header {
  background: linear-gradient(135deg, #fdf3e8 0%, #f9ede0 100%);
}
.cal-today-header .cal-day-name { color: var(--accent); }
.cal-today-header .cal-day-date {
  background: var(--accent);
  color: white;
}

.cal-day-name {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink2);
}

.cal-day-date {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

/* Slot rows */
.cal-slot-row {
  display: contents;
}

.cal-slot-label {
  background: var(--surface2);
  padding: 10px 8px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.cal-slot-icon {
  font-size: 16px;
}

.cal-slot-name {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--ink3);
}

/* Calendar cells */
.cal-cell {
  background: var(--surface);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  min-height: 72px;
  padding: 8px;
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-cell:last-child { border-right: none; }

.cal-slot-row:last-child .cal-cell,
.cal-slot-row:last-child .cal-slot-label {
  border-bottom: none;
}

.cal-cell:hover {
  background: var(--surface2);
}

.cal-today-cell {
  background: #fffaf4;
}
.cal-today-cell:hover { background: #fff3e6; }

.cal-cell-add {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1.5px dashed var(--border);
  color: var(--ink3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 400;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.cal-cell:hover .cal-cell-add {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  border-style: solid;
}

/* Filled cells */
.cal-cell-filled {
  background: linear-gradient(135deg, #fdf8f3 0%, #f9f1e8 100%);
  align-items: flex-start;
  justify-content: flex-start;
}
.cal-cell-filled:hover { background: linear-gradient(135deg, #fdf3ea 0%, #f5e9d9 100%); }

.cal-cell-custom {
  background: linear-gradient(135deg, #f3f7fd 0%, #e8f1f9 100%);
  align-items: flex-start;
  justify-content: flex-start;
}

.cal-cell-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding-right: 18px;
}

.cal-cell-emoji {
  font-size: 18px;
  line-height: 1;
}

.cal-cell-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cal-cell-srv {
  font-size: 10px;
  color: var(--accent);
  font-weight: 600;
}

.cal-cell-clear {
  position: absolute;
  top: 4px;
  right: 4px;
  background: none;
  border: none;
  font-size: 11px;
  color: var(--ink3);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  line-height: 1;
}
.cal-cell:hover .cal-cell-clear { opacity: 1; }
.cal-cell-clear:hover { color: var(--red); }

/* ============================================================
   RECIPE PICKER MODAL
   ============================================================ */
.picker-modal {
  max-width: 480px !important;
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  overflow: hidden;
}

.picker-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

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

.picker-subtitle {
  font-size: 13px;
  color: var(--ink2);
  margin: 0;
}

.picker-search-row {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.picker-search {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 30px;
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.picker-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(155,123,92,0.1);
}

.picker-list {
  overflow-y: auto;
  flex: 1 1 auto;
  padding: 8px 0;
}

.picker-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}
.picker-item:hover { background: var(--surface2); }
.picker-item.selected { background: linear-gradient(90deg, #fdf3e8, #fdf8f2); }

.picker-item-emoji {
  font-size: 24px;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
}

.picker-item-info {
  flex: 1;
  min-width: 0;
}

.picker-item-name {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.picker-item-meta {
  display: block;
  font-size: 12px;
  color: var(--ink3);
}

.picker-item-check {
  color: var(--accent);
  font-size: 16px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.picker-item.selected .picker-item-check { opacity: 1; }

.picker-empty {
  text-align: center;
  padding: 32px;
  color: var(--ink3);
  font-size: 14px;
}

.picker-footer {
  border-top: 1.5px solid var(--border);
  padding: 16px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
}

.picker-servings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.picker-srv-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.picker-srv-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.srv-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  line-height: 1;
}
.srv-btn:hover { background: var(--accent); border-color: var(--accent); color: white; }

.srv-val {
  font-size: 18px;
  font-weight: 600;
  min-width: 24px;
  text-align: center;
}

.picker-note-row {}

.picker-note-input {
  width: 100%;
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  background: var(--bg);
  outline: none;
  transition: border-color 0.2s;
}
.picker-note-input:focus { border-color: var(--accent); }

.picker-footer-actions {
  display: flex;
  gap: 10px;
}
.picker-footer-actions .btn { flex: 1; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .onboarding-steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .onboarding-steps { grid-template-columns: 1fr 1fr; gap: 10px; }
  .onboarding-data-row { flex-direction: column; }
  .btn-label-long { display: none; }
  .picker-modal { max-height: 95vh; border-radius: 20px 20px 0 0; }
}

/* ---- WEEK NAVIGATION ---- */
.week-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.week-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink2);
  transition: all 0.2s var(--ease-out-expo);
  flex-shrink: 0;
}
.week-nav-btn:hover {
  background: var(--surface2);
  border-color: var(--accent);
  color: var(--accent);
}

.week-today-btn {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink2);
  cursor: pointer;
  transition: all 0.2s var(--ease-out-expo);
  letter-spacing: 0.3px;
}
.week-today-btn:hover {
  background: var(--surface2);
  border-color: var(--accent);
  color: var(--accent);
}

/* ---- MENU DAY GROUP ---- */
.menu-day-group {
  margin-bottom: 0;
  page-break-inside: avoid;
}
.menu-day-heading {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--accent);
  padding: 18px 0 6px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.menu-day-group:first-child .menu-day-heading {
  border-top: none;
  margin-top: 0;
  padding-top: 4px;
}
.menu-slot {
  font-size: 11px;
  color: var(--ink3);
  font-weight: 500;
  text-transform: capitalize;
  padding-top: 6px;
  min-width: 72px;
}

/* ============================================================
   MOBILE VERTICAL PLANNER
   ============================================================ */
@media (max-width: 700px) {
  /* Override horizontal grid with vertical day cards */
  .cal-grid {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
    border: none !important;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  /* Hide desktop header row entirely */
  .cal-header-row { display: none !important; }

  /* Each slot row becomes a card for its meal type */
  .cal-slot-row {
    display: block !important;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  }

  /* Slot heading bar at the top of each card */
  .cal-slot-label {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 8px;
    padding: 12px 16px !important;
    border-bottom: 1.5px solid var(--border) !important;
    border-right: none !important;
    background: var(--surface2);
  }
  .cal-slot-icon { font-size: 17px !important; }
  .cal-slot-name {
    font-size: 12px !important;
    letter-spacing: 0.5px !important;
    display: block !important;
    color: var(--ink2) !important;
    text-transform: uppercase;
    font-weight: 600;
  }

  /* Day cells stack vertically */
  .cal-cell {
    display: flex !important;
    align-items: center;
    border-right: none !important;
    border-bottom: 1px solid var(--border) !important;
    min-height: 60px !important;
    padding: 10px 14px !important;
    border-radius: 0 !important;
    position: relative;
  }
  .cal-slot-row .cal-cell:last-child {
    border-bottom: none !important;
  }

  /* Day label inside each cell */
  .cal-cell::before {
    content: attr(data-day);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ink3);
    min-width: 36px;
    flex-shrink: 0;
    margin-right: 10px;
  }
  .cal-today-cell::before {
    color: var(--accent);
  }

  .cal-cell-add {
    width: 26px !important;
    height: 26px !important;
    font-size: 15px !important;
  }

  .cal-cell-content {
    flex-direction: row !important;
    align-items: center;
    gap: 8px;
    flex: 1;
    padding-right: 22px;
  }

  .cal-cell-emoji { font-size: 18px !important; flex-shrink: 0; }
  .cal-cell-name { font-size: 13px !important; white-space: normal !important; }
  .cal-cell-clear {
    opacity: 1 !important;
    font-size: 13px !important;
    top: 50% !important;
    transform: translateY(-50%);
    right: 8px !important;
  }

  /* Planner toolbar on mobile */
  .planner-toolbar { flex-direction: column; align-items: flex-start; gap: 12px; }
  .planner-toolbar-right { width: 100%; }

  .week-nav { flex-wrap: wrap; gap: 8px; }
  .planner-week-label { font-size: 17px; }
}

@media (max-width: 480px) {
  .onboarding-steps { grid-template-columns: 1fr; }
}
