:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;
  --border: #e2e8f0;
  --primary: #0f766e;
  --primary-hover: #115e59;
  --primary-light: #ccfbf1;
  --emerald: #059669;
  --emerald-bg: #d1fae5;
  --amber: #d97706;
  --amber-bg: #fef3c7;
  --rose: #e11d48;
  --rose-bg: #ffe4e6;
  --sky: #0284c7;
  --sky-bg: #e0f2fe;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.14);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-14 { margin-bottom: 14px; }

/* GOOGLE SIGN-IN BUTTON & MODAL */
.google-gsi-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #ffffff;
  color: #1f2937;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: all 0.15s ease;
}

.btn-google:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  box-shadow: var(--shadow-sm);
}

.google-chooser-sheet {
  max-width: 410px;
}

.google-chooser-header {
  text-align: center;
  margin-bottom: 18px;
}

.google-chooser-header h3 {
  font-size: 1.2rem;
  margin-top: 8px;
}

.google-chooser-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.google-account-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.google-account-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}

.google-account-row:hover {
  background: #f0fdfa;
  border-color: var(--primary);
}

.g-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
}

.g-avatar-teal { background: #0f766e; }
.g-avatar-blue { background: #2563eb; }

.g-acct-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
}

.g-acct-email {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.google-custom-form {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.google-custom-form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.google-custom-row {
  display: flex;
  gap: 8px;
}

.google-custom-row input {
  flex: 1;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.cuisine-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.filter-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-light);
  margin-bottom: 6px;
}

.badge-cuisine {
  background: #f3e8ff;
  color: #6b21a8;
  border: 1px solid #e9d5ff;
}

/* TOAST NOTIFICATIONS */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  left: 16px;
  max-width: 420px;
  margin-left: auto;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #0f172a;
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideDown 0.22s ease-out;
}

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

/* AUTH SCREEN */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #f0fdfa 0%, #e0f2fe 50%, #fef3c7 100%);
}

.auth-card {
  background: var(--surface);
  width: 100%;
  max-width: 440px;
  padding: 28px 24px;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.brand-logo {
  font-size: 2.3rem;
  background: var(--primary-light);
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-brand h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
}

.auth-brand p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface-alt);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 18px;
}

.auth-tab {
  border: none;
  background: transparent;
  padding: 9px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
}

.auth-tab.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  background: #fff;
  color: var(--text-main);
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.auth-divider {
  text-align: center;
  margin: 14px 0;
  position: relative;
}

.auth-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  position: relative;
  background: var(--surface);
  padding: 0 10px;
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 600;
}

.auth-features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 20px;
}

.auth-feature-pill {
  background: var(--surface-alt);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 0.84rem;
}

.btn-block {
  width: 100%;
  padding: 12px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

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

.btn-demo {
  background: var(--amber-bg);
  color: #92400e;
  border: 1px solid #fcd34d;
}

.btn-demo:hover {
  background: #fde68a;
}

.btn-outline {
  background: var(--surface);
  color: var(--text-main);
  border: 1.5px solid var(--border);
}

.btn-outline:hover {
  background: var(--surface-alt);
}

.btn-danger-soft {
  background: var(--rose-bg);
  color: var(--rose);
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

/* APP SHELL & HEADER */
.app-shell {
  min-height: 100vh;
  padding-bottom: 85px; /* Space for mobile bottom nav */
}

.top-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo-sm {
  font-size: 1.65rem;
  background: var(--primary-light);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-title {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.1;
}

.app-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

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

/* DESKTOP NAV */
.desktop-nav {
  max-width: 1180px;
  margin: 14px auto 0;
  padding: 0 20px;
  display: flex;
  gap: 8px;
}

.nav-pill {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.badge-pill {
  background: rgba(15, 23, 42, 0.12);
  padding: 2px 7px;
  border-radius: 99px;
  font-size: 0.74rem;
  font-weight: 700;
}

.nav-pill.active .badge-pill {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.badge-emerald { background: var(--emerald-bg); color: var(--emerald); }
.badge-danger { background: var(--rose-bg); color: var(--rose); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-sky { background: var(--sky-bg); color: var(--sky); }

/* MAIN CONTENT */
.main-content {
  max-width: 1180px;
  margin: 16px auto;
  padding: 0 20px;
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
}

/* ZERO WASTE BANNER */
.hero-waste-banner {
  background: linear-gradient(125deg, #0f766e 0%, #047857 100%);
  color: #fff;
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-md);
}

.eyebrow-tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.18);
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.hero-waste-text h3 {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.hero-waste-text p {
  font-size: 0.86rem;
  opacity: 0.9;
}

.hero-waste-metrics {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.impact-stat {
  background: rgba(255, 255, 255, 0.14);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  text-align: center;
  min-width: 115px;
}

.impact-num {
  display: block;
  font-size: 1.55rem;
  font-weight: 800;
}

.impact-label {
  font-size: 0.74rem;
  opacity: 0.92;
}

/* KPI GRID */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.14s, box-shadow 0.14s;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.kpi-teal { background: var(--primary-light); }
.kpi-amber { background: var(--amber-bg); }
.kpi-sky { background: var(--sky-bg); }
.kpi-rose { background: var(--rose-bg); }

.kpi-value {
  display: block;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.1;
}

.kpi-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* DASHBOARD COLUMNS */
.dashboard-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.panel-header h4 {
  font-size: 1.02rem;
  font-weight: 700;
}

.panel-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.compact-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.compact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
}

.compact-item-left {
  display: flex;
  flex-direction: column;
}

.compact-item-title {
  font-weight: 700;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.compact-item-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* INVENTORY CONTROLS & GRID */
.inventory-controls-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.location-tabs,
.meal-type-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.loc-tab {
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.loc-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.search-filter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
}

.search-box input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
}

.filter-select {
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  background: #fff;
  font-weight: 600;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}

.item-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.item-card.card-expiring {
  border-color: #f59e0b;
}

.item-card.card-low {
  border-color: #f43f5e;
}

.item-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.item-name {
  font-size: 1.04rem;
  font-weight: 700;
}

.item-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.tag-chip {
  font-size: 0.73rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--surface-alt);
  color: var(--text-muted);
}

.tag-fridge { background: var(--sky-bg); color: var(--sky); }
.tag-pantry { background: var(--amber-bg); color: #b45309; }
.tag-freezer { background: #ede9fe; color: #6d28d9; }
.tag-store { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }
.tag-appliance { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }

.appliances-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

.appliance-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.15s ease;
}

.appliance-card.active {
  border-color: var(--primary);
  background: #f0fdfa;
}

.appliance-card.inactive {
  opacity: 0.55;
  background: var(--surface-alt);
}

.add-appliance-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.add-appliance-form input {
  flex: 1;
  min-width: 220px;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.appliance-tip-banner {
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  background: #f0fdfa;
  border: 1px dashed #0f766e;
  color: #115e59;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-toddler {
  background: #fce7f3;
  color: #9d174d;
  border: 1px solid #f9a8d4;
}

.store-shopping-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.store-group-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.store-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.store-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.12rem;
  font-weight: 800;
}

.shopping-aisle-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.shopping-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-alt);
}

.shopping-item-row.checked-in-cart {
  background: #f0fdf4;
  border-color: #86efac;
}

.dashboard-store-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.dash-store-card {
  border: 1.5px solid var(--border);
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.dash-store-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

.dash-store-items-ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.82rem;
}

.dash-store-items-ul li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: #fff;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  font-weight: 600;
}

.route-timeline-flow {
  display: flex;
  align-items: stretch;
  gap: 10px;
  overflow-x: auto;
  padding: 8px 2px 6px;
}

.route-stop-node {
  min-width: 215px;
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  position: relative;
}

.route-stop-node.route-home-node {
  background: #f0fdfa;
  border-color: #0f766e;
}

.route-arrow-sep {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  padding: 0 2px;
}

.item-qty-box {
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.qty-number {
  font-size: 1.15rem;
  font-weight: 800;
}

.qty-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.step-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.item-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  font-size: 0.8rem;
}

.item-actions {
  display: flex;
  gap: 6px;
}

/* MEALS & SNACKS SUGGESTIONS */
.meals-header-card,
.restock-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.meals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.meal-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.meal-card.meal-rescues-waste {
  border-color: #10b981;
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 38%);
}

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

.meal-title {
  font-size: 1.08rem;
  font-weight: 800;
  margin-top: 6px;
}

.meal-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.meal-ing-section {
  background: var(--surface-alt);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
}

.ing-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.ing-pill {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 600;
}

.ing-have {
  background: var(--emerald-bg);
  color: #065f46;
}

.ing-expiring {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
}

.ing-missing {
  background: #f1f5f9;
  color: #64748b;
  text-decoration: line-through;
}

/* MOBILE BOTTOM NAVIGATION & FAB */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  z-index: 200;
  grid-template-columns: repeat(5, 1fr);
}

.mob-nav-item {
  border: none;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  color: var(--text-light);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.mob-nav-item.active {
  color: var(--primary);
}

.mob-icon {
  font-size: 1.25rem;
}

.mob-icon-wrap {
  position: relative;
  display: inline-flex;
}

.mob-badge {
  position: absolute;
  top: -4px;
  right: -10px;
  background: var(--rose);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 99px;
}

.mobile-fab {
  display: none;
  position: fixed;
  right: 18px;
  bottom: 76px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 1.65rem;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  z-index: 190;
  cursor: pointer;
}

/* MODALS */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-sheet {
  background: var(--surface);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.btn-icon-close {
  border: none;
  background: var(--surface-alt);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 0.95rem;
  cursor: pointer;
}

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

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

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.cook-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.cook-section {
  margin-bottom: 16px;
}

.cook-section h4 {
  font-size: 0.92rem;
  margin-bottom: 4px;
}

.cook-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.cook-ingredients-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cook-ing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-alt);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  gap: 10px;
}

.cook-ing-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
}

.cook-ing-input {
  width: 72px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: right;
  font-weight: 700;
}

.cook-steps-list {
  padding-left: 20px;
  font-size: 0.86rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* VOICE ASSISTANT PULSE & VALIDATION STYLES */
.voice-pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e11d48;
  display: inline-block;
  animation: voicePulse 1.1s infinite ease-in-out;
}

@keyframes voicePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.45); opacity: 0.45; }
}

.voice-field-missing input,
.voice-field-missing select {
  border-color: #e11d48 !important;
  background-color: #fff1f2 !important;
}

/* RESPONSIVE MOBILE BROWSER ADAPTATIONS */
@media (max-width: 768px) {
  .desktop-nav {
    display: none;
  }

  .mobile-bottom-nav {
    display: grid;
  }

  .mobile-fab {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .hide-xs {
    display: none;
  }

  .hero-waste-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }

  .hero-waste-metrics {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-columns {
    grid-template-columns: 1fr;
  }

  .main-content {
    padding: 0 14px;
  }

  /* Bottom sheet style modals on mobile */
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal-sheet {
    border-radius: 22px 22px 0 0;
    max-height: 92vh;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  }
}
