/*
 * MealGrid — Unified App Stylesheet
 * Version: 3.7.385
 * Single stylesheet for all app pages (replaces mealgrid.css + members.css)
 * Cache-busted via ?v= query param
 * Digitalis Creative — digitaliscreative.com
 *
 * Brand: Deep Terracotta + Forest Green + Cobalt Blue
 * Typography: Plus Jakarta Sans (display) + DM Sans (body)
 * Layout: Mobile-first, bottom nav on mobile, top nav on desktop
 */

/* ── Google Fonts ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,700&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Shadows+Into+Light+Two&display=swap');

/* ── Design Tokens ────────────────────────────────────────────────────────── */
:root {
  /* Primary — Deep Terracotta */
  --terra:              #A1280B;
  --terra-hover:        #B8300D;
  --terra-dark:         #751E0B;
  --terra-tint:         #F0C4B5;
  --terra-rgb:          161,40,11;

  /* Accent 1 — Forest Green (premium / My Kitchen) */
  --green:              #2D7A3D;
  --green-hover:        #3A8C4A;
  --green-dark:         #256634;
  --green-tint:         #B8E4C0;

  /* Accent 2 — Cobalt Blue */
  --cobalt:             #2563A8;
  --cobalt-hover:       #3478C5;
  --cobalt-dark:        #164278;
  --cobalt-tint:        #B0CAEA;

  /* Amber — accents on dark surfaces only */
  --amber:              #f9b54b;
  --amber-deep:         #f5a623;

  /* Neutrals */
  --cream:              #FDF6EE;
  --surface:            #F0E6D8;
  --surface-2:          #E8D8C8;
  --dark:               #3D2314;
  --body-color:         #6B4C3B;
  --muted:              #725648;
  --rule:               #E8D8C8;

  /* Semantic */
  --danger:             #dc2626;
  --success:            #16a34a;
  --warning:            #d97706;
  --info:               #2563eb;

  /* Typography */
  --font-display:       'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body:          'DM Sans', system-ui, sans-serif;
  --font-hand:          'Shadows Into Light Two', cursive;

  /* Nav */
  --nav-h:              60px;          /* top nav height (desktop) */
  --bottom-nav-h:       68px;          /* bottom nav height (mobile) */
  --nav-bg:             var(--terra);
  --nav-text:           #ffffff;
  --nav-active:         #fdd79c;
  --nav-hover:          rgba(255,255,255,0.15);

  /* Shadows */
  --shadow-sm:          0 2px 8px rgba(61,35,20,0.06);
  --shadow-md:          0 6px 32px rgba(61,35,20,0.08);
  --shadow-lg:          0 12px 48px rgba(61,35,20,0.12);
  --shadow-accent:      0 4px 14px rgba(161,40,11,0.20);

  /* Radii */
  --radius-sm:          8px;
  --radius-md:          12px;
  --radius-lg:          20px;
  --radius-xl:          28px;

  /* Transitions */
  --ease:               all 0.2s ease;
  --ease-bounce:        all 0.2s cubic-bezier(0.34,1.56,0.64,1);
  --ease-smooth:        all 0.3s cubic-bezier(0.4,0,0.2,1);

  /* Layout */
  --content-max:        1200px;
  --sidebar-w:          300px;

  /* Chip colours (overridable per-install from settings) */
  --chip-meal:          var(--terra);
  --chip-takeout:       var(--cobalt);
  --chip-new:           var(--green);
  --chip-leftovers:     var(--green);
  --chip-out:           var(--cobalt);
  --chip-unplanned:     var(--muted);
  --chip-baking:        #b45309;

  /* Backward compat aliases — keeps existing PHP working */
  --mg-accent:          var(--terra);
  --mg-accent-hover:    var(--terra-hover);
  --mg-accent-rgb:      var(--terra-rgb);
  --mg-font-display:    var(--font-display);
  --mg-font-body:       var(--font-body);
  --mg-text-primary:    var(--dark);
  --mg-text-secondary:  var(--body-color);
  --mg-text-muted:      var(--muted);
  --mg-border:          var(--rule);
  --mg-surface:         var(--surface);
  --mg-surface-2:       var(--surface-2);
  --mg-bg-start:        var(--cream);
  --mg-chip-meal:       var(--chip-meal);
  --mg-chip-takeout:    var(--chip-takeout);
  --mg-chip-new:        var(--chip-new);
  --mg-chip-leftovers:  var(--chip-leftovers);
  --mg-chip-out:        var(--chip-out);
  --mg-chip-unplanned:  var(--chip-unplanned);
  --mg-chip-baking:     var(--chip-baking);
  --mg-radius-sm:       var(--radius-sm);
  --mg-radius-md:       var(--radius-md);
  --mg-radius-lg:       var(--radius-lg);
  --mg-shadow-sm:       var(--shadow-sm);
  --mg-shadow-md:       var(--shadow-md);
}

/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--body-color);
  background: var(--cream);
  min-height: 100vh;
  line-height: 1.6;
  /* Bottom padding for mobile nav */
  padding-bottom: var(--bottom-nav-h);
}

/* Warm radial texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 0% 0%, rgba(161,40,11,0.04) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 100% 100%, rgba(58,140,74,0.03) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
body > * { position: relative; z-index: 1; }

/* ── Typography ───────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--dark);
  line-height: 1.25;
}
h1 { font-size: clamp(1.5rem, 4vw, 2rem); }
h2 { font-size: clamp(1.2rem, 3vw, 1.5rem); }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; }

p { margin-bottom: .75rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--terra); text-decoration: none; transition: var(--ease); }
a:hover { color: var(--terra-hover); }

small, .text-sm  { font-size: .875rem; }
.text-xs         { font-size: .75rem; }
.text-muted      { color: var(--muted); }
.text-dark       { color: var(--dark); }
.text-accent     { color: var(--terra); }
.text-green      { color: var(--green); }
.text-cobalt     { color: var(--cobalt); }
.text-center     { text-align: center; }
.text-right      { text-align: right; }
.font-display    { font-family: var(--font-display); }
.font-hand       { font-family: var(--font-hand); }
.fw-600          { font-weight: 600; }
.fw-700          { font-weight: 700; }

/* ── Layout Utilities ─────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 16px;
}
.page-content {
  padding: 50px 16px 35px;
  max-width: var(--content-max);
  margin: 0 auto;
}
.d-flex       { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm       { gap: 8px; }
.gap-md       { gap: 16px; }
.gap-lg       { gap: 24px; }
.flex-1       { flex: 1; }
.w-100        { width: 100%; }
.mt-1         { margin-top: .5rem; }
.mt-2         { margin-top: 1rem; }
.mt-3         { margin-top: 1.5rem; }
.mb-1         { margin-bottom: .5rem; }
.mb-2         { margin-bottom: 1rem; }
.mb-3         { margin-bottom: 1.5rem; }
.p-1          { padding: .5rem; }
.p-2          { padding: 1rem; }
.p-3          { padding: 1.5rem; }
.hidden       { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   TOP NAV — desktop only (hidden on mobile)
   ═══════════════════════════════════════════════════════════════════════════ */
.app-topnav {
  display: none; /* hidden on mobile — shown at md breakpoint */
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--nav-h);
  background: var(--nav-bg);
  box-shadow: 0 2px 12px rgba(161,40,11,0.18);
}
.app-topnav-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 100%;
  padding: 0 52px;
  width: 100%;
  box-sizing: border-box;
}
.app-topnav-inner > :last-child {
  justify-self: end;
}

/* Logo */
.app-topnav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  justify-self: start;
}
.app-topnav-logo img {
  height: 34px;
  width: auto;
}
.app-topnav-logo-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: #fff;
  letter-spacing: -.02em;
}

/* Tab links */
.app-topnav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  justify-self: center;
}
.app-topnav-link {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.82);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .9rem;
  text-decoration: none;
  transition: var(--ease);
  white-space: nowrap;
}
.app-topnav-link:hover {
  color: #fff;
  background: var(--nav-hover);
}
.app-topnav-link.active {
  color: var(--nav-active);
  background: rgba(255,255,255,0.12);
}
.app-topnav-link i {
  font-size: 1.1rem;
  opacity: .85;
}
/* My Kitchen premium tab */
.app-topnav-link.premium {
  color: var(--green-tint);
}
.app-topnav-link.premium:hover,
.app-topnav-link.premium.active {
  color: #fff;
  background: rgba(45,122,61,0.35);
}
.app-topnav-link.premium .premium-badge {
  font-size: .65rem;
  background: var(--green);
  color: #fff;
  padding: 1px 5px;
  border-radius: 10px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}

/* Avatar / account button */
.app-topnav-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.35);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  transition: var(--ease);
  text-decoration: none;
  margin-left: auto;
}
.app-topnav-avatar:hover {
  background: rgba(255,255,255,0.32);
  border-color: rgba(255,255,255,0.6);
  color: #fff;
}
.app-topnav-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BOTTOM NAV — mobile only
   ═══════════════════════════════════════════════════════════════════════════ */
.app-bottomnav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--bottom-nav-h);
  background: var(--nav-bg);
  box-shadow: 0 -2px 16px rgba(161,40,11,0.16);
  /* Safe area for devices with home bars */
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.app-bottomnav-inner {
  display: flex;
  align-items: stretch;
  height: 100%;
}
.app-bottomnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .65rem;
  letter-spacing: .02em;
  transition: var(--ease);
  position: relative;
  padding: 6px 4px 0;
}
.app-bottomnav-item i {
  font-size: 1.35rem;
  line-height: 1;
  transition: var(--ease-bounce);
}
.app-bottomnav-item:hover,
.app-bottomnav-item.active {
  color: var(--nav-active);
}
.app-bottomnav-item.active i {
  transform: translateY(-2px);
}
/* Active indicator dot */
.app-bottomnav-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background: var(--nav-active);
  border-radius: 3px 3px 0 0;
}
/* Premium Kitchen tab in bottom nav */
.app-bottomnav-item.premium {
  color: rgba(184,228,192,0.6);
}
.app-bottomnav-item.premium.active,
.app-bottomnav-item.premium:hover {
  color: var(--green-tint);
}
.app-bottomnav-item.premium.active::after {
  background: var(--green-tint);
}
/* Locked premium tab */
.app-bottomnav-item.premium-locked {
  color: rgba(255,255,255,0.3);
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ACCOUNT DROPDOWN MENU
   ═══════════════════════════════════════════════════════════════════════════ */
.account-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 240px;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px) scale(.97);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 300;
}
.account-dropdown.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.account-dropdown-header {
  padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
}
.account-dropdown-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .9rem;
  color: var(--dark);
  line-height: 1.2;
}
.account-dropdown-email {
  font-size: .75rem;
  color: var(--muted);
  margin-top: 2px;
}
.account-dropdown-list {
  list-style: none;
  padding: 6px 0;
}
.account-dropdown-list a,
.account-dropdown-list button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-size: .875rem;
  color: var(--body-color);
  text-decoration: none;
  transition: var(--ease);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-body);
}
.account-dropdown-list a:hover,
.account-dropdown-list button:hover {
  background: var(--surface);
  color: var(--dark);
}
.account-dropdown-list a i,
.account-dropdown-list button i {
  width: 18px;
  color: var(--muted);
  font-size: 1rem;
  flex-shrink: 0;
}
.account-dropdown-divider {
  height: 1px;
  background: var(--rule);
  margin: 4px 0;
}
.account-dropdown-list .danger-item a,
.account-dropdown-list .danger-item button {
  color: var(--danger);
}
.account-dropdown-list .danger-item a i,
.account-dropdown-list .danger-item button i {
  color: var(--danger);
}

/* Mobile full-screen account menu */
.account-mobile-sheet {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(61,35,20,0.5);
  backdrop-filter: blur(4px);
}
.account-mobile-sheet.open { display: block; }
.account-mobile-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--cream);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  max-height: 88vh;
  overflow-y: auto;
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(0.4,0,0.2,1);
}
.account-mobile-sheet.open .account-mobile-panel {
  transform: translateY(0);
}
.account-mobile-panel-handle {
  width: 36px;
  height: 4px;
  background: var(--rule);
  border-radius: 2px;
  margin: 12px auto 16px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PAGE TOOLBAR (page-level: title + actions)
   ═══════════════════════════════════════════════════════════════════════════ */
.page-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 0;
  max-width: var(--content-max);
  margin: 0 auto;
}
.page-toolbar-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--dark);
  flex: 1;
}
.page-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FLASH MESSAGES
   ═══════════════════════════════════════════════════════════════════════════ */
.flash {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: .875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 16px;
}
.flash-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.flash-error   { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.flash-info    { background: #dbeafe; color: #1d4ed8; border: 1px solid #93c5fd; }
.flash-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }

/* ═══════════════════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════════════════ */
.card {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-body { padding: 16px; }
.card-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
}

/* Hero card — Tonight's dinner */
.hero-card {
  background: var(--terra);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-decoration: none;
  box-shadow: var(--shadow-accent);
  transition: var(--ease);
}
.hero-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.hero-card-img {
  position: absolute;
  inset: 0;
  object-fit: cover;
  width: 100%;
  height: 100%;
}
.hero-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(61,35,20,0.85) 0%, rgba(61,35,20,0.1) 55%, transparent 100%);
}
.hero-card-body {
  position: relative;
  z-index: 1;
  padding: 20px;
  color: #fff;
}
.hero-card-eyebrow {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 4px;
}
.hero-card-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  line-height: 1.2;
  color: #fff;
  margin-bottom: 4px;
}
.hero-card-sub {
  font-size: .8rem;
  color: rgba(255,255,255,0.75);
}

/* Meal list item */
.meal-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
  transition: var(--ease);
}
.meal-list-item:last-child { border-bottom: none; }
.meal-list-item:hover { background: var(--surface); margin: 0 -12px; padding: 12px; border-radius: var(--radius-sm); }
.meal-list-day {
  flex-shrink: 0;
  width: 44px;
  text-align: center;
}
.meal-list-day-name {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1;
}
.meal-list-day-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--dark);
  line-height: 1;
  margin-top: 2px;
}
.meal-list-day-num.today {
  color: var(--terra);
}
.meal-list-thumb {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface);
}
.meal-list-thumb-empty {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--surface);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 1.1rem;
}
.meal-list-info { flex: 1; min-width: 0; }
.meal-list-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .95rem;
  color: var(--dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.meal-list-recipes {
  font-size: .75rem;
  color: var(--muted);
  margin-top: 2px;
}
.meal-list-chip {
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.meal-list-item.empty .meal-list-name {
  color: var(--muted);
  font-weight: 400;
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .875rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: var(--ease);
  white-space: nowrap;
  line-height: 1.2;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary   { background: var(--terra); color: #fff; }
.btn-primary:hover { background: var(--terra-hover); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--dark); border: 1px solid var(--rule); }
.btn-secondary:hover { background: var(--surface-2); color: var(--dark); }
.btn-ghost     { background: transparent; color: var(--terra); border: 1px solid var(--terra-tint); }
.btn-ghost:hover { background: var(--terra-tint); color: var(--terra-dark); }
.btn-green     { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-hover); color: #fff; }
.btn-danger    { background: #fee2e2; color: var(--danger); border: 1px solid #fca5a5; }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-icon { padding: 8px; border-radius: 50%; }
.btn-icon.btn-sm { padding: 6px; }
.btn-block { width: 100%; }

/* FAB — floating action button */
.fab {
  position: fixed;
  bottom: calc(68px + 16px); /* 68px bottom nav + 16px gap */
  right: 16px;
  z-index: 1050;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--terra);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: var(--shadow-accent);
  transition: var(--ease-bounce);
  text-decoration: none;
}
.fab:hover { background: var(--terra-hover); transform: scale(1.08); color: #fff; }
.fab-green { background: var(--green); }
.fab-green:hover { background: var(--green-hover); }

/* ═══════════════════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-weight: 600;
  font-size: .8rem;
  color: var(--dark);
  margin-bottom: 5px;
  letter-spacing: .02em;
}
.form-control {
  width: 100%;
  padding: 10px 12px;
  background: #fff;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .9rem;
  color: var(--dark);
  transition: var(--ease);
  appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--terra);
  box-shadow: 0 0 0 3px rgba(161,40,11,0.1);
}
.form-control::placeholder { color: var(--muted); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }
.form-hint { font-size: .75rem; color: var(--muted); margin-top: 4px; }
.form-error { font-size: .75rem; color: var(--danger); margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════════════════════
   BOTTOM SHEET (mobile slide-up panel)
   ═══════════════════════════════════════════════════════════════════════════ */
.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(61,35,20,0.5);
  backdrop-filter: blur(3px);
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.bottom-sheet-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 410;
  background: var(--cream);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(0.4,0,0.2,1);
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
}
.bottom-sheet.open { transform: translateY(0); }
.bottom-sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--rule);
  border-radius: 2px;
  margin: 10px auto 14px;
  flex-shrink: 0;
}
.bottom-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 12px;
  flex-shrink: 0;
}
.bottom-sheet-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
}
.bottom-sheet-body {
  overflow-y: auto;
  padding: 0 16px 16px;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR (desktop edit mode panels)
   ═══════════════════════════════════════════════════════════════════════════ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(61,35,20,0.3);
  z-index: 190;
}
.app-sidebar {
  position: fixed;
  top: var(--nav-h);
  right: 0;
  width: var(--sidebar-w);
  height: calc(100vh - var(--nav-h));
  background: var(--cream);
  border-left: 1px solid var(--rule);
  box-shadow: -4px 0 24px rgba(61,35,20,0.08);
  display: flex;
  flex-direction: column;
  z-index: 195;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(0.4,0,0.2,1);
}
.app-sidebar.open { transform: translateX(0); }
.app-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}
.app-sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TABS (cookbook, etc.)
   ═══════════════════════════════════════════════════════════════════════════ */
.tab-bar {
  display: flex;
  border-bottom: 2px solid var(--rule);
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-btn {
  flex-shrink: 0;
  padding: 10px 18px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .875rem;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  text-decoration: none;
  transition: var(--ease);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tab-btn:hover { color: var(--dark); }
.tab-btn.active {
  color: var(--terra);
  border-bottom-color: var(--terra);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ═══════════════════════════════════════════════════════════════════════════
   BADGES & CHIPS
   ═══════════════════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.badge-terra   { background: var(--terra-tint); color: var(--terra-dark); }
.badge-green   { background: var(--green-tint); color: var(--green-dark); }
.badge-cobalt  { background: var(--cobalt-tint); color: var(--cobalt-dark); }
.badge-muted   { background: var(--surface-2); color: var(--muted); }
.badge-premium { background: var(--green); color: #fff; }

/* Calendar meal chips */
.chip {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 6px;
  font-size: .7rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PREMIUM GATE
   ═══════════════════════════════════════════════════════════════════════════ */
.premium-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 12px;
}
.premium-gate-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--green-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: var(--green);
  margin-bottom: 4px;
}
.premium-gate h2 {
  font-size: 1.2rem;
  color: var(--dark);
}
.premium-gate p {
  color: var(--muted);
  font-size: .9rem;
  max-width: 280px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   EMPTY STATES
   ═══════════════════════════════════════════════════════════════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 10px;
}
.empty-state-icon {
  font-size: 2.5rem;
  color: var(--muted);
  opacity: .5;
}
.empty-state h3 { font-size: 1rem; color: var(--dark); }
.empty-state p  { font-size: .875rem; color: var(--muted); max-width: 260px; }

/* ═══════════════════════════════════════════════════════════════════════════
   LOADER
   ═══════════════════════════════════════════════════════════════════════════ */
.loader {
  width: 24px;
  height: 24px;
  border: 3px solid var(--rule);
  border-top-color: var(--terra);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ═══════════════════════════════════════════════════════════════════════════ */

/* md — tablet and up (768px) */
@media (min-width: 768px) {
  body {
    padding-bottom: 0;
    --bottom-nav-h: 0px;
  }
  .app-topnav    { display: flex; }
  @media (max-width: 1024px) { .app-topnav-inner { padding: 0 24px; } }
  .app-bottomnav { display: none; }
  .page-content  { padding: 50px 24px 35px; }
  .page-toolbar  { padding: 24px 24px 0; }
  .bottom-sheet { display: none; }
  .bottom-sheet-overlay { display: none; }
  .fab { bottom: 80px; right: 24px; z-index: 1050; } /* above 56px footer bar with headroom */
}

/* tablet (640-767px): pub-footer-bar visible, no bottom nav */
@media (min-width: 640px) and (max-width: 767px) {
  .fab { bottom: 80px; z-index: 1050; }
}

/* lg — desktop (1024px+) */
@media (min-width: 1024px) {
  .page-content { padding: 50px 32px 35px; }

  .hero-card { min-height: 240px; }
  .hero-card-title { font-size: 1.8rem; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   UTILITY / LEGACY COMPAT
   ═══════════════════════════════════════════════════════════════════════════ */
.text-accent-green { color: var(--green); }
.text-accent-cobalt { color: var(--cobalt); }
img { max-width: 100%; height: auto; }
hr { border: none; border-top: 1px solid var(--rule); margin: 16px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   MODAL (shared — used by cookbook import, grid, etc.)
   ═══════════════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(61,35,20,0.5);
  backdrop-filter: blur(3px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.modal {
  background: var(--cream);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: scale(.95) translateY(8px);
  transition: transform .2s ease;
}
.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  margin: 0;
  flex: 1;
}
.modal-body  { padding: 20px; }
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--rule);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}


/* Modal — backdrop + box variant (used by recipe, mykitchen, help) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(61,35,20,0.45);
  backdrop-filter: blur(3px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-box {
  background: var(--surface, #fff);
  border-radius: 16px;
  box-shadow: 0 12px 60px rgba(0,0,0,0.2);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideUp .2s ease;
}
@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--surface, #f5f5f5);
  color: var(--muted);
  cursor: pointer;
  font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
  flex-shrink: 0;
}
.modal-close:hover { background: var(--rule); }
.modal-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--dark);
  margin: 0;
}

/* ---- APP FOOTER ---- */

/* Mobile: regular footer sits above bottom nav */
.app-footer-bar {
  background: var(--surface);
  border-top: 1px solid var(--rule);
  margin-bottom: var(--bottom-nav-h);
}
.app-footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 10px 16px;
  flex-wrap: wrap;
  font-size: .72rem;
  color: var(--muted);
}
.app-footer-copy { color: var(--muted); }
.app-footer-version {
  font-size: .68rem;
  color: var(--rule);
  font-family: var(--font-display);
}
.app-footer-links {
  display: flex;
  gap: 10px;
  align-items: center;
}
.app-footer-links a {
  font-size: .72rem;
  color: var(--muted);
  text-decoration: none;
  transition: var(--ease);
}
.app-footer-links a:hover { color: var(--terra); }

/* Desktop/tablet: footer sits naturally at bottom of content */
@media (min-width: 768px) {
  .app-footer-bar {
    margin-bottom: 0;
    margin-top: 32px;
  }
}
}


/* ============================================================
   ACCESSIBILITY FONT SIZE WIDGET
   ============================================================ */
/* a11y widget — tab is fixed exactly like pub-tour-btn, panel pops out from it */
#a11y-widget {
  position: static; /* wrapper is not the positioned element */
}
#a11y-tab {
  /* Positioned exactly like pub-tour-btn but stacked above it */
  position: fixed;
  bottom: calc(24px + 32px + 8px); /* tour btn bottom + height + gap = 64px */
  left: 0;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 28px;
  height: 40px;
  background: var(--terra);
  color: #fff;
  border: none;
  border-left: none;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  padding: 4px;
  box-shadow: 2px 2px 8px rgba(0,0,0,0.18);
  transition: background 0.2s;
}
#a11y-tab:hover { background: var(--terra-hover); }
#a11y-tab-label {
  font-size: .55rem;
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: .04em;
  line-height: 1;
}
#a11y-panel {
  position: fixed;
  left: 28px;
  bottom: calc(24px + 32px + 8px); /* same as tab */
  z-index: 8999;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 0 10px 10px 0;
  padding: 14px 16px;
  box-shadow: 4px 4px 16px rgba(0,0,0,0.12);
  min-width: 140px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  transform: translateX(-8px);
}
#a11y-widget.open #a11y-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}
#a11y-panel-label {
  font-size: .7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 10px;
  font-family: var(--font-display);
}
.a11y-btn-row {
  display: flex;
  gap: 6px;
}
.a11y-size-btn {
  flex: 1;
  padding: 6px 4px;
  border: 2px solid var(--rule);
  background: var(--bg);
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--body-color);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  font-size: .8rem;
}
.a11y-size-btn:hover { border-color: var(--terra); color: var(--terra); }
.a11y-size-btn.active {
  border-color: var(--terra);
  background: var(--terra);
  color: #fff;
}
/* Mobile: shift both fixed elements up above bottom nav */
@media (max-width: 767px) {
  #a11y-tab   { bottom: calc(68px + 8px + 32px + 8px); } /* nav + gap + tour + gap */
  #a11y-panel { bottom: calc(68px + 8px + 32px + 8px); }
}

/* Tour button */
.pub-tour-btn {
  position: fixed;
  bottom: 24px;
  left: 0;
  z-index: 8999;
  width: 32px; height: 32px;
  border-radius: 0 50% 50% 0;
  border: 1px solid var(--rule);
  border-left: none;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 2px 6px rgba(0,0,0,.1);
  transition: opacity .15s, color .15s;
}
.pub-tour-btn:hover { color: var(--terra); }
@media (max-width: 767px) {
  .pub-tour-btn { bottom: calc(68px + 8px); } /* above mobile bottom nav */
  #a11y-widget  { bottom: calc(68px + 8px + 32px + 8px); } /* above tour btn */
}

/* ============================================================
   ACCOUNT / PREFERENCES / SUBSCRIPTION PAGES
   ============================================================ */
.page-section {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 50px 16px 35px;
}
.page-hero {
  padding: 0 0 20px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 24px;
}
.page-hero h1 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--dark);
  margin: 0 0 4px;
  font-family: var(--font-display);
}
.page-hero p {
  font-size: .875rem;
  color: var(--muted);
  margin: 0;
}
.tab-strip {
  display: flex;
  gap: 6px;
  border-bottom: none;
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.tab-strip::-webkit-scrollbar { display: none; }
.tab-strip-btn {
  padding: 8px 20px;
  border: 2px solid var(--muted, #9A7868);
  background: #fff;
  border-radius: 24px;
  font-size: .85rem;
  font-weight: 700;
  color: var(--body, #6B4C3B);
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-display);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tab-strip-btn:hover { color: var(--dark, #3D2314); background: #e8e0d0; border-color: var(--dark, #3D2314); }
.tab-strip-btn.active { color: #fff; background: #3b492d; border-color: #3b492d; }
.tab-strip-btn.active:hover { background: #2f3b24; border-color: #2f3b24; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.form-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}
.form-card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
}
.form-card-header h3 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--dark);
  margin: 0;
  font-family: var(--font-display);
}
.form-card-body { padding: 20px; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.form-row.full { grid-template-columns: 1fr; }
.form-row.three { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 640px) {
  .form-row, .form-row.three { grid-template-columns: 1fr; }
}
.color-swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}
.color-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: .7rem;
  color: var(--muted);
  font-weight: 600;
  font-family: var(--font-display);
}
.color-swatch input[type="color"] {
  width: 48px; height: 48px;
  border: 2px solid var(--rule);
  border-radius: 8px;
  padding: 2px;
  cursor: pointer;
  background: none;
}
/* Avatar display in account */
.account-avatar {
  width: 68px; height: 68px;
  border-radius: 50%;
  background: var(--terra-tint);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--terra-dark);
  flex-shrink: 0;
  overflow: hidden;
}
.account-avatar img { width: 100%; height: 100%; object-fit: cover; }
.member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}
.member-row:last-child { border-bottom: none; }
.member-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--cobalt-tint, #B0CAEA);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .9rem;
  color: var(--cobalt-dark, #164278);
  flex-shrink: 0;
}
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: .7rem;
  font-weight: 700;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.role-badge.admin    { background: rgba(161,40,11,.1); color: var(--terra); border: 1px solid rgba(161,40,11,.25); }
.role-badge.editor   { background: rgba(58,140,74,.1); color: var(--forest); border: 1px solid rgba(58,140,74,.25); }
.role-badge.viewer   { background: rgba(37,99,168,.1); color: var(--cobalt); border: 1px solid rgba(37,99,168,.25); }
/* Tier cards for subscription */
.tier-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.tier-card {
  background: var(--surface);
  border: 2px solid var(--rule);
  border-radius: var(--radius);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
}
.tier-card:hover { border-color: var(--terra); box-shadow: 0 4px 20px rgba(161,40,11,.1); }
.tier-card.current { border-color: var(--terra); }
.tier-card-badge {
  position: absolute;
  top: -1px; right: 16px;
  background: var(--terra);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  font-family: var(--font-display);
  padding: 3px 10px;
  border-radius: 0 0 8px 8px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.tier-price {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--dark);
  font-family: var(--font-display);
  line-height: 1;
}
.tier-price sup { font-size: .9rem; vertical-align: super; }
.tier-price span { font-size: .85rem; font-weight: 500; color: var(--muted); }
.tier-features { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 7px; }
.tier-features li { font-size: .825rem; color: var(--body-color); display: flex; align-items: flex-start; gap: 7px; }
.tier-features li i { color: var(--forest); margin-top: 2px; flex-shrink: 0; }
.tier-features li.missing i { color: var(--muted); }
.tier-features li.missing { color: var(--muted); }

/* ============================================================
   MEAL VIEW / RECIPE VIEW pages
   ============================================================ */
.meal-hero {
  position: relative;
  height: 280px;
  background: var(--surface);
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
}
@media (min-width: 768px) { .meal-hero { height: 360px; } }
.meal-hero img { width: 100%; height: 100%; object-fit: cover; }
.meal-hero-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--terra-tint) 0%, var(--surface2) 100%);
  font-size: 4rem;
}
.meal-hero-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 24px 20px 20px;
  background: linear-gradient(to top, rgba(30,10,0,.75) 0%, transparent 100%);
}
.meal-hero-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-display);
  margin: 0 0 6px;
  text-shadow: 0 1px 4px rgba(0,0,0,.4);
}
@media (min-width: 768px) { .meal-hero-title { font-size: 2rem; } }
.meal-detail-body {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px 80px;
}
.ingredient-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 99px;
  padding: 5px 12px;
  font-size: .8rem;
  color: var(--body-color);
}
.ingredient-chip .qty { color: var(--terra); font-weight: 700; }
.recipe-step {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}
.recipe-step:last-child { border-bottom: none; }
.step-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--terra);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: .875rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.step-body { flex: 1; }
.step-img {
  margin-top: 10px;
  border-radius: 8px;
  overflow: hidden;
  max-height: 200px;
}
.step-img img { width: 100%; height: 100%; object-fit: cover; }


/* ============================================================
   EDITOR SLIDE-OUT PANEL (shared across cookbook, meal-view, recipe)
   ============================================================ */
.editor-overlay {
  position: fixed; inset: 0;
  background: rgba(61,35,20,0.4);
  backdrop-filter: blur(3px);
  z-index: 1090;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.editor-overlay.open { opacity: 1; pointer-events: auto; }
.editor-panel {
  position: fixed; top: 0; right: 0;
  width: 100%; max-width: 560px;
  height: 100vh; height: 100dvh;
  background: var(--cream, var(--bg));
  box-shadow: -8px 0 40px rgba(61,35,20,0.12);
  display: flex; flex-direction: column;
  z-index: 1100;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
}
.editor-panel.open { transform: translateX(0); }
.editor-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0; background: var(--cream, var(--bg));
}
.editor-header h2 { flex:1; font-size:1rem; font-weight:800; color:var(--dark); margin:0; font-family:var(--font-display); }
.editor-body { flex:1; overflow-y:auto; padding:20px; -webkit-overflow-scrolling:touch; }
.editor-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--rule);
  display: flex; gap: 8px; justify-content: flex-end;
  flex-shrink: 0; background: var(--cream, var(--bg));
}
.ing-row { display:grid; grid-template-columns:3fr 1fr 1.5fr 2fr auto; gap:6px; margin-bottom:6px; align-items:center; }
.ing-row input, .ing-row select {
  padding:7px 10px; border:1.5px solid var(--rule); border-radius:var(--radius-sm, 6px);
  font-size:.85rem; font-family:var(--font-body); color:var(--dark); background:#fff; width:100%;
}
.ing-row input:focus, .ing-row select:focus { outline:none; border-color:var(--terra); }
.ing-row-del {
  width:28px; height:28px; border-radius:50%;
  border:none; background:var(--surface); color:var(--muted);
  cursor:pointer; display:flex; align-items:center; justify-content:center;
  font-size:.75rem; transition:var(--ease);
}
.ing-row-del:hover { background:#fee2e2; color:var(--danger, #ef4444); }
.step-row { display:flex; gap:10px; margin-bottom:8px; align-items:flex-start; }
.step-row-num {
  width:26px; height:26px; border-radius:50%;
  background:var(--terra); color:#fff;
  font-family:var(--font-display); font-weight:800; font-size:.75rem;
  display:flex; align-items:center; justify-content:center; flex-shrink:0; margin-top:8px;
}
.step-row textarea {
  flex:1; padding:8px 10px; border:1.5px solid var(--rule); border-radius:var(--radius-sm, 6px);
  font-size:.85rem; font-family:var(--font-body); color:var(--dark); background:#fff;
  resize:vertical; min-height:60px;
}
.step-row textarea:focus { outline:none; border-color:var(--terra); }

/* ============================================================
   AUTH PAGES (login / register / forgot / reset)
   ============================================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 40px 36px;
  box-shadow: 0 8px 40px rgba(61,35,20,.08);
}
@media (max-width: 480px) {
  .auth-card { padding: 28px 20px; border-radius: 12px; }
}
.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--dark);
  letter-spacing: -.03em;
}
.auth-logo-text em { font-style: normal; color: var(--terra); }
.auth-logo-sub {
  font-size: .78rem;
  color: var(--muted);
  margin-top: 4px;
}
.auth-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--dark);
  margin: 0 0 6px;
  text-align: center;
}
.auth-sub {
  font-size: .84rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 24px;
}
.auth-divider {
  text-align: center;
  font-size: .78rem;
  color: var(--muted);
  margin: 16px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--rule);
}
.auth-footer {
  text-align: center;
  font-size: .82rem;
  color: var(--muted);
  margin-top: 20px;
}
.auth-footer a { color: var(--terra); text-decoration: none; font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }
