/* ============================================================
   HomeMenu.plus — Main Stylesheet
   ============================================================ */

:root {
  --ink:        #1a1208;
  --cream:      #faf6ef;
  --warm:       #f5ede0;
  --gold:       #c4883a;
  --gold-light: #e8b96a;
  --gold-pale:  #fdf0d5;
  --rust:       #9b4b2a;
  --sage:       #6b7c5e;
  --sage-light: #a8b99a;
  --sage-pale:  #e6ede2;
  --border:     #ddd4c5;
  --shadow-sm:  rgba(26,18,8,0.08);
  --shadow-md:  rgba(26,18,8,0.14);
  --shadow-lg:  rgba(26,18,8,0.22);
  --sidebar-w:  240px;
  --radius:     12px;
  --radius-sm:  6px;
  --radius-lg:  16px;
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

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

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Auth Screen ───────────────────────────────────────────── */
#auth-screen {
  position: fixed; inset: 0;
  background: var(--ink);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  background: var(--cream);
  border-radius: 20px;
  padding: 48px 40px;
  width: 400px;
  max-width: 92vw;
  box-shadow: 0 30px 80px rgba(0,0,0,0.45);
}

.auth-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.9rem;
  color: var(--gold);
  text-align: center;
  margin-bottom: 4px;
}

.auth-tagline {
  text-align: center;
  font-size: 0.75rem;
  color: #999;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 32px;
}

.auth-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  color: #999;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.auth-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.auth-form { display: none; }
.auth-form.active { display: block; }

/* ── Layout ─────────────────────────────────────────────────── */
#app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--ink);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  z-index: 100;
  box-shadow: 3px 0 20px var(--shadow-md);
  overflow-y: auto;
}

.sidebar-logo {
  padding: 28px 22px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.sidebar-logo h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold-light);
  line-height: 1.2;
}

.sidebar-logo p {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 3px;
}

.sidebar-user {
  padding: 14px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.sidebar-user strong {
  display: block;
  font-size: 0.88rem;
  color: var(--cream);
}

.sidebar-user span {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.4);
}

nav { flex: 1; padding: 12px 0; }

.nav-section {
  padding: 10px 22px 4px;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.22);
  margin-top: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 22px;
  cursor: pointer;
  transition: all 0.18s;
  font-size: 0.86rem;
  color: rgba(255,255,255,0.6);
  border-left: 3px solid transparent;
  user-select: none;
}

.nav-item:hover { background: rgba(255,255,255,0.05); color: var(--cream); }
.nav-item.active { background: rgba(196,136,58,0.15); color: var(--gold-light); border-left-color: var(--gold); }
.nav-item .icon { font-size: 1rem; width: 18px; text-align: center; flex-shrink: 0; }

.sidebar-bottom {
  padding: 14px 22px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

/* ── Topbar ──────────────────────────────────────────────────── */
.topbar {
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  padding: 16px 36px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 0 var(--border);
}

.topbar h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* ── Content Area ────────────────────────────────────────────── */
.content-area { padding: 32px 36px; flex: 1; }

/* ── Panels ──────────────────────────────────────────────────── */
.panel { display: none; }
.panel.active { display: block; animation: fadeUp 0.25s ease; }

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

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.18s;
  white-space: nowrap;
  line-height: 1;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary  { background: var(--gold); color: #fff; }
.btn-primary:hover { background: #b07a30; }
.btn-sage     { background: var(--sage); color: #fff; }
.btn-sage:hover { background: #556248; }
.btn-ghost    { background: transparent; color: var(--ink); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--warm); }
.btn-danger   { background: #c0392b; color: #fff; }
.btn-danger:hover { background: #a93226; }
.btn-sm       { padding: 5px 12px; font-size: 0.78rem; }
.btn-icon     { padding: 6px 8px; font-size: 1rem; }

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--gold);
  background: none;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0;
  margin-bottom: 20px;
  font-weight: 500;
  transition: color 0.18s;
}
.back-btn:hover { color: var(--rust); }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  margin-bottom: 5px;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  background: var(--cream);
  color: var(--ink);
  transition: border-color 0.18s, background 0.18s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--gold);
  background: #fff;
}

.form-group textarea { min-height: 80px; resize: vertical; line-height: 1.55; }

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

.form-error {
  color: #c0392b;
  font-size: 0.82rem;
  margin-top: 4px;
  display: none;
}
.form-error.visible { display: block; }

/* ── Cards & Panels ──────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 2px 8px var(--shadow-sm);
}

.card-body { padding: 22px; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap;
}

.section-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
}

/* ── Recipe Grid ─────────────────────────────────────────────── */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}

.recipe-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.22s, box-shadow 0.22s;
  box-shadow: 0 2px 8px var(--shadow-sm);
}

.recipe-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px var(--shadow-md);
}

.recipe-card-thumb {
  height: 160px;
  background: var(--warm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.2rem;
  position: relative;
}

.recipe-card-thumb::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 50px;
  background: linear-gradient(transparent, rgba(255,255,255,0.6));
}

.recipe-card-body { padding: 14px; }
.recipe-card-body h4 {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recipe-card-meta {
  font-size: 0.76rem;
  color: #888;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

/* ── Tags & Badges ───────────────────────────────────────────── */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 500;
  margin: 2px 2px 0 0;
}

.tag-gold  { background: var(--gold-pale); color: #8a5a10; }
.tag-sage  { background: var(--sage-pale); color: #3d5430; }
.tag-blue  { background: #e3f0fc; color: #1a5fa8; }
.tag-red   { background: #fde8e8; color: #8a1a1a; }
.tag-purple { background: #f0e8ff; color: #6b3fa0; }

.badge-private { background: #f0e8ff; color: #6b3fa0; }
.badge-public  { background: var(--sage-pale); color: #3d5430; }

/* ── Stat Cards ──────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 28px; }

.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: 0 2px 8px var(--shadow-sm);
}

.stat-card .num {
  font-family: 'Playfair Display', serif;
  font-size: 2.6rem;
  color: var(--gold);
  line-height: 1;
}

.stat-card .lbl {
  font-size: 0.76rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

/* ── Seasonal Banner ─────────────────────────────────────────── */
.seasonal-banner {
  background: linear-gradient(135deg, var(--sage) 0%, var(--sage-light) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.seasonal-banner .sbi { font-size: 2.2rem; flex-shrink: 0; }
.seasonal-banner h3 { font-family: 'Playfair Display', serif; font-size: 1.05rem; }
.seasonal-banner p  { font-size: 0.8rem; opacity: 0.85; margin-top: 2px; }

/* ── Pantry & List Items ─────────────────────────────────────── */
.pantry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }

.list-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 2px 8px var(--shadow-sm);
}

.list-panel h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--warm);
  font-size: 0.88rem;
}

.list-item:last-child { border-bottom: none; }

.list-item input[type=checkbox] {
  accent-color: var(--sage);
  width: 15px; height: 15px;
  flex-shrink: 0;
  cursor: pointer;
}

.list-item .item-name { flex: 1; transition: all 0.18s; }
.list-item .item-name.out { text-decoration: line-through; color: #bbb; }

.list-item .item-cat { font-size: 0.72rem; color: #aaa; }

.item-del {
  background: none; border: none;
  cursor: pointer; color: #ccc;
  font-size: 1rem; padding: 2px;
  transition: color 0.18s; line-height: 1;
  flex-shrink: 0;
}
.item-del:hover { color: var(--rust); }

.add-row {
  display: flex; gap: 8px; margin-top: 14px;
}

.add-row input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  background: var(--cream);
}

.add-row input:focus { outline: none; border-color: var(--gold); background: #fff; }

/* ── Recipe Detail ───────────────────────────────────────────── */
.recipe-detail-header {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 22px;
  box-shadow: 0 2px 8px var(--shadow-sm);
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 22px;
  align-items: start;
}

.recipe-emoji-big {
  width: 110px; height: 110px;
  background: var(--warm);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.2rem;
  flex-shrink: 0;
}

.recipe-detail-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.7rem;
  margin-bottom: 8px;
}

.recipe-meta-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 0.84rem;
  color: #666;
  margin-bottom: 10px;
  align-items: center;
}

.recipe-columns { display: grid; grid-template-columns: 270px 1fr; gap: 22px; }

.recipe-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 2px 8px var(--shadow-sm);
}

.recipe-panel h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.step-item {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--warm);
  cursor: pointer;
  transition: opacity 0.2s;
}

.step-item:last-child { border-bottom: none; }

.step-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--gold);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 1px;
}

.step-item.done { opacity: 0.45; }
.step-item.done .step-num { background: var(--sage-light); }
.step-item p { font-size: 0.9rem; line-height: 1.6; }

/* Servings control */
.servings-ctrl {
  display: flex; align-items: center; gap: 10px;
}

.servings-ctrl button {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s; line-height: 1;
}

.servings-ctrl button:hover { background: var(--gold); color: #fff; border-color: var(--gold); }
.servings-ctrl .count { font-weight: 600; min-width: 22px; text-align: center; font-size: 0.95rem; }

/* ── Timeline (Cooking Mode) ─────────────────────────────────── */
.timeline-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 22px;
  box-shadow: 0 2px 8px var(--shadow-sm);
}

.timeline { position: relative; padding-left: 30px; margin-top: 16px; }

.timeline::before {
  content: '';
  position: absolute;
  left: 9px; top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}

.tl-event {
  position: relative;
  margin-bottom: 14px;
  background: var(--warm);
  border-radius: 8px;
  padding: 10px 14px;
  border-left: 3px solid var(--gold);
}

.tl-event::before {
  content: '';
  position: absolute;
  left: -24px; top: 50%;
  transform: translateY(-50%);
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--gold);
}

.tl-event.prep { border-left-color: var(--sage); }
.tl-event.prep::before { background: var(--sage); box-shadow: 0 0 0 2px var(--sage); }
.tl-event.done { opacity: 0.45; }
.tl-event .time { font-size: 0.72rem; font-weight: 600; color: var(--gold); margin-bottom: 1px; }
.tl-event.prep .time { color: var(--sage); }
.tl-event h4 { font-size: 0.9rem; }
.tl-event p  { font-size: 0.78rem; color: #666; margin-top: 1px; }

/* ── Meal Plan Week Grid ──────────────────────────────────────── */
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}

.day-col {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 10px;
  box-shadow: 0 2px 6px var(--shadow-sm);
  min-height: 200px;
}

.day-col h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.day-col.today h4 { color: var(--gold); }

.meal-entry {
  background: var(--warm);
  border-radius: 6px;
  padding: 6px 8px;
  margin-bottom: 6px;
  font-size: 0.76rem;
  cursor: pointer;
  position: relative;
  transition: background 0.18s;
  line-height: 1.3;
}

.meal-entry:hover { background: var(--gold-pale); }

.meal-entry .meal-del {
  position: absolute; top: 4px; right: 4px;
  background: none; border: none;
  cursor: pointer; color: #ccc; font-size: 0.8rem; line-height: 1;
}
.meal-entry .meal-del:hover { color: var(--rust); }

/* ── View Toggle ─────────────────────────────────────────────── */
.view-toggle {
  display: flex; gap: 3px;
  background: var(--warm);
  border-radius: 8px;
  padding: 3px;
}

.view-toggle button {
  padding: 5px 11px;
  border: none;
  background: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.18s;
  color: #888;
}

.view-toggle button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 4px var(--shadow-sm);
}

/* ── Pinterest Masonry ───────────────────────────────────────── */
.masonry { columns: 3; column-gap: 14px; }
.masonry-item {
  break-inside: avoid;
  margin-bottom: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s;
  box-shadow: 0 2px 6px var(--shadow-sm);
}
.masonry-item:hover { transform: scale(1.02); }
.masonry-thumb {
  background: var(--warm);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
}
.masonry-item:nth-child(3n) .masonry-thumb { height: 160px; font-size: 3.5rem; }
.masonry-item:nth-child(5n) .masonry-thumb { height: 90px; font-size: 2rem; }
.masonry-item:not(:nth-child(3n)):not(:nth-child(5n)) .masonry-thumb { height: 120px; }
.masonry-body { padding: 10px 12px; }
.masonry-body h4 { font-family: 'Playfair Display', serif; font-size: 0.92rem; margin-bottom: 3px; }

/* ── Slideshow ───────────────────────────────────────────────── */
#slideshow-view {
  position: fixed; inset: 0;
  background: var(--ink);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

#slideshow-view.open { display: flex; }

.slide-card { text-align: center; color: #fff; max-width: 480px; padding: 36px 24px; }
.slide-emoji { font-size: 7rem; margin-bottom: 20px; }
.slide-card h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2.3rem;
  color: var(--gold-light);
  margin-bottom: 10px;
}
.slide-card p { color: rgba(255,255,255,0.55); font-size: 0.95rem; line-height: 1.7; }

.slide-nav { display: flex; gap: 20px; margin-top: 36px; align-items: center; }
.slide-nav button {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.slide-nav button:hover { background: rgba(255,255,255,0.18); }
.slide-counter { color: rgba(255,255,255,0.35); font-size: 0.82rem; }

.slide-close {
  position: absolute; top: 22px; right: 22px;
  background: none; border: none;
  color: rgba(255,255,255,0.35);
  font-size: 1.4rem; cursor: pointer;
  transition: color 0.18s;
}
.slide-close:hover { color: #fff; }

/* ── Search Bar ──────────────────────────────────────────────── */
.search-bar {
  display: flex; gap: 10px; margin-bottom: 20px;
}

.search-bar input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  background: #fff;
  transition: border-color 0.18s;
}

.search-bar input:focus { outline: none; border-color: var(--gold); }

/* Chips */
.chip-row { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 16px; }

.chip {
  background: var(--warm);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px 12px;
  font-size: 0.76rem;
  cursor: pointer;
  transition: all 0.18s;
}

.chip:hover { background: var(--gold); color: #fff; border-color: var(--gold); }
.chip.active { background: var(--gold); color: #fff; border-color: var(--gold); }

/* ── Grocery Section ─────────────────────────────────────────── */
.grocery-cat {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #888;
  margin: 14px 0 6px;
}

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(26,18,8,0.55);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
  padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--cream);
  border-radius: var(--radius-lg);
  padding: 30px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(-16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.modal-footer {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ── AI Bar ──────────────────────────────────────────────────── */
.ai-bar {
  background: linear-gradient(135deg, var(--ink) 0%, #2d1f0a 100%);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 22px;
}

.ai-bar-label {
  font-size: 0.72rem;
  color: var(--gold-light);
  font-weight: 500;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.ai-bar input {
  flex: 1;
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 7px;
  padding: 9px 14px;
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
}

.ai-bar input::placeholder { color: rgba(255,255,255,0.3); }
.ai-bar input:focus { outline: none; border-color: var(--gold); }

/* ── Alerts ──────────────────────────────────────────────────── */
.alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.86rem;
  margin-bottom: 14px;
}

.alert-info { background: #e8f0fe; color: #1a4a9b; border-left: 3px solid #1a4a9b; }
.alert-warn { background: #fef9e7; color: #8a6200; border-left: 3px solid #f0a500; }
.alert-success { background: var(--sage-pale); color: #2d4a22; border-left: 3px solid var(--sage); }

/* ── Divider ─────────────────────────────────────────────────── */
hr.divider { border: none; border-top: 1px solid var(--border); margin: 22px 0; }

/* ── Empty State ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 52px 20px;
  color: #aaa;
}

.empty-state .big-icon { font-size: 3.8rem; margin-bottom: 14px; }
.empty-state h3 { font-family: 'Playfair Display', serif; font-size: 1.2rem; color: #888; margin-bottom: 6px; }
.empty-state p { font-size: 0.88rem; }

/* ── Loading Spinner ─────────────────────────────────────────── */
.spinner {
  width: 30px; height: 30px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 30px auto;
}

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

/* ── Toast ───────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 28px; right: 28px;
  background: var(--ink);
  color: #fff;
  padding: 11px 18px;
  border-radius: 8px;
  font-size: 0.86rem;
  z-index: 8000;
  transform: translateY(70px);
  opacity: 0;
  transition: all 0.28s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 4px 18px rgba(0,0,0,0.3);
  pointer-events: none;
  max-width: 320px;
}

#toast.show { transform: translateY(0); opacity: 1; }

/* ── Notification Dot ────────────────────────────────────────── */
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold);
  display: inline-block;
  margin-left: 5px;
  animation: pulse 2s infinite;
}

@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.4; } }

/* ── LLM Prompt Export ───────────────────────────────────────── */
.code-block {
  background: #1a1208;
  color: #a8d8a8;
  border-radius: 8px;
  padding: 14px;
  font-family: 'Courier New', monospace;
  font-size: 0.79rem;
  line-height: 1.6;
  margin-top: 12px;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 300px;
  overflow-y: auto;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --sidebar-w: 60px; }
  .sidebar-logo p, .sidebar-user, .nav-section, .nav-item span:not(.icon) { display: none; }
  .nav-item { justify-content: center; padding: 12px; }
  .sidebar-logo { padding: 16px 10px; text-align: center; }
  .sidebar-logo h1 { font-size: 1.4rem; }
  .content-area { padding: 20px; }
  .topbar { padding: 12px 20px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .recipe-columns, .pantry-grid { grid-template-columns: 1fr; }
  .week-grid { grid-template-columns: repeat(4, 1fr); }
  .masonry { columns: 2; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .week-grid { grid-template-columns: repeat(2, 1fr); }
  .masonry { columns: 1; }
  .stat-grid { grid-template-columns: 1fr; }
}
