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

:root {
  --cream: #faf6f1;
  --warm-white: #fefcf9;
  --sage: #7a8c6e;
  --sage-light: #c5d1b8;
  --sage-muted: #e8ede3;
  --terracotta: #c4704b;
  --terracotta-light: #e8a98a;
  --clay: #d4a574;
  --bark: #3d3229;
  --bark-light: #6b5d52;
  --mist: #d6cfc7;
  --blush: #f0ddd4;
  --font-display: 'Fraunces', serif;
  --font-body: 'DM Sans', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--bark);
  line-height: 1.6;
  overflow-x: hidden;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ===== TOP BAR (slim status bar) ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bark);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 1rem;
  color: var(--cream);
}

.nav-brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--cream);
  letter-spacing: -0.02em;
}

.nav-brand em { color: var(--terracotta-light); font-style: normal; }

.header-diets {
  display: flex;
  gap: 0.3rem;
  margin-left: auto;
}

.header-diet-tag {
  font-size: 0.55rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 100px;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ===== BOTTOM BAR (now-strip + tabs) ===== */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--warm-white);
  border-top: 1px solid rgba(61,50,41,0.08);
  display: flex;
  flex-direction: column;
  box-shadow: 0 -2px 20px rgba(61,50,41,0.06);
}

.bottom-now {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 1rem;
  background: var(--bark);
  color: var(--cream);
  cursor: pointer;
  transition: background 0.2s;
  overflow: hidden;
  white-space: nowrap;
}

.bottom-now:active { background: #4a4039; }

.bottom-now .bn-label {
  font-size: 0.58rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--terracotta-light);
  flex-shrink: 0;
}

.bottom-now .bn-meal {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bottom-now .bn-meta {
  font-size: 0.7rem;
  opacity: 0.5;
  flex-shrink: 0;
}

.bottom-now .bn-go {
  margin-left: auto;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--terracotta);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
}

.bottom-now .bn-go svg {
  width: 14px;
  height: 14px;
  stroke: white;
  stroke-width: 2.5;
  fill: none;
}

.bottom-now:active .bn-go {
  transform: scale(0.9);
  background: var(--terracotta-light);
}

.bottom-tabs {
  display: flex;
  justify-content: space-around;
  padding: 0.35rem 0.5rem;
  padding-bottom: max(0.35rem, env(safe-area-inset-bottom));
}

.tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.35rem 0.75rem;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s;
  position: relative;
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
}

.tab-btn svg {
  width: 22px;
  height: 22px;
  stroke: var(--bark-light);
  stroke-width: 1.8;
  fill: none;
  transition: all 0.2s;
}

.tab-btn .tab-label {
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--bark-light);
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.tab-btn.active svg { stroke: var(--terracotta); }
.tab-btn.active .tab-label { color: var(--terracotta); font-weight: 600; }

.tab-btn.active::before {
  content: '';
  position: absolute;
  top: -0.35rem;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2.5px;
  border-radius: 100px;
  background: var(--terracotta);
}

.tab-btn:active { transform: scale(0.92); }

/* Tab content sections */
.tab-view { display: none; }
.tab-view.active { display: block; }

/* Spacing for fixed bars */
.app-content {
  padding-top: 28px;
  padding-bottom: 160px;
}

/* Desktop: centered bottom bar */
@media (min-width: 769px) {
  .bottom-bar {
    max-width: 520px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 16px 16px 0 0;
    border: 1px solid rgba(61,50,41,0.08);
    border-bottom: none;
    overflow: hidden;
  }
  .bottom-now { border-radius: 16px 16px 0 0; }
  .header-inner { padding: 0.5rem 2rem; }
}

/* ===== DAY NAVIGATION (in bottom bar) ===== */
.day-nav-section {
  background: var(--cream);
  border-bottom: 1px solid rgba(61,50,41,0.06);
  padding: 0.4rem 0.75rem;
  display: flex;
  justify-content: center;
}

.day-tabs {
  display: flex;
  gap: 0.25rem;
  background: transparent;
  padding: 0;
}

.day-tab {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--bark-light);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.day-tab:hover { color: var(--bark); background: rgba(61,50,41,0.04); }

.day-tab.active {
  background: var(--bark);
  color: var(--cream);
}

.day-tab.today { color: var(--terracotta); font-weight: 800; }
.day-tab.active.today { color: var(--cream); }

/* ===== MEAL PLAN CONTENT ===== */
.meal-plan { max-width: 900px; margin: 0 auto; padding: 0.5rem 1rem 1rem; }

.day-content { display: none; }
.day-content.active { display: block; animation: fadeIn 0.35s ease; }
