/* ═══════════════════════════════════════════════════
   NutriTrack — style.css  v3.0
   New UI: Fresh · Vibrant · Fruit-forward · Modern
   Fonts: Plus Jakarta Sans + Fraunces
   Palette: White/cream base, vivid fruit accents
═══════════════════════════════════════════════════ */
:root {
  --kiwi: #3ECF8E;
  --kiwi-deep: #2D9E6B;
  --kiwi-light: rgba(62, 207, 142, 0.15);
  --citrus: #F5A623;
  --citrus-deep: #D48806;
  --citrus-light: rgba(245, 166, 35, 0.15);
  --berry: #E05698;
  --berry-deep: #B83B76;
  --berry-light: rgba(224, 86, 152, 0.15);
  --coral: #F4613A;
  --coral-light: rgba(244, 97, 58, 0.15);
  --grape: #9B72CF;
  --grape-light: rgba(155, 114, 207, 0.15);
  --mango: #FF8C42;
  --ink: #FFFFFF;
  --ink-80: rgba(255, 255, 255, 0.92);
  --ink-50: rgba(255, 255, 255, 0.78);
  --ink-30: rgba(255, 255, 255, 0.58);
  --ink-10: rgba(255, 255, 255, 0.15);
  --mist: #d4d4d8;
  --smoke: #0F1712;
  --parchment: #0A0F0D;
  --white: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.12);
  --border-soft: rgba(255, 255, 255, 0.07);
  --fiber-color: #3ECF8E;
  --sugar-color: #F4613A;
  --sodium-color: #9B72CF;
  --chol-color: #F5A623;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.6);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 32px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #0a0f0d 0%, #0f1712 50%, #080c0a 100%);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── LOADER ── */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--parchment);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s, visibility 0.15s;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.loader-logo-wrap {
  animation: loaderPulse 1.8s ease-in-out infinite;
}

@keyframes loaderPulse {

  0%,
  100% {
    transform: scale(1) rotate(-1deg);
  }

  50% {
    transform: scale(1.08) rotate(1deg);
  }
}

.loader-brand {
  font-family: 'Fraunces', serif;
  font-size: 2rem;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.04em;
}

.loader-dots {
  display: flex;
  gap: 0.4rem;
}

.loader-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  animation: loaderDot 1.2s ease-in-out infinite;
}

.loader-dots span:nth-child(1) {
  background: var(--kiwi);
  animation-delay: 0s;
}

.loader-dots span:nth-child(2) {
  background: var(--citrus);
  animation-delay: 0.18s;
}

.loader-dots span:nth-child(3) {
  background: var(--berry);
  animation-delay: 0.36s;
}

@keyframes loaderDot {

  0%,
  80%,
  100% {
    transform: scale(0.55);
    opacity: 0.35;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.loader-msg {
  font-size: 0.82rem;
  color: var(--ink-30);
  letter-spacing: 0.05em;
}

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: rgba(18, 17, 15, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.open {
  display: flex;
  animation: modalFadeIn 0.15s ease both;
}

@keyframes modalFadeIn {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

.modal-box {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-xl);
  animation: modalSlideUp 0.15s ease both;
  border: 1px solid var(--border-soft);
}

.modal-wide {
  max-width: 520px;
  text-align: left;
}

@keyframes modalSlideUp {
  from {
    transform: translateY(24px) scale(0.96);
    opacity: 0;
  }

  to {
    transform: none;
    opacity: 1;
  }
}

.modal-icon-big {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.modal-title {
  font-family: 'Fraunces', serif;
  font-size: 1.6rem;
  color: var(--ink);
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.modal-body {
  font-size: 0.9rem;
  color: var(--ink-50);
  line-height: 1.6;
  margin-bottom: 1.2rem;
}

.modal-tips {
  background: var(--kiwi-light);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.4rem;
  text-align: left;
}

.modal-tip {
  font-size: 0.82rem;
  color: var(--kiwi-deep);
  padding: 0.3rem 0;
}

.modal-btn {
  background: linear-gradient(135deg, var(--kiwi), var(--kiwi-deep));
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  padding: 13px 2.5rem;
  cursor: pointer;
  transition: all 0.25s;
  margin-top: 0.5rem;
  box-shadow: 0 4px 20px rgba(45, 158, 107, 0.35);
}

.modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(45, 158, 107, 0.45);
}

/* ── AUTH ── */
.auth-wrapper {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

/* ── 3D SPLIT-SCREEN AUTH ── */
.auth-split-wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
  background: #0a0f0d;
}

.auth-split-left {
  flex: 1.1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  background: radial-gradient(circle at center, rgba(62, 207, 142, 0.12) 0%, rgba(10, 15, 13, 0.95) 75%);
  overflow: hidden;
  border-right: 1px solid rgba(62, 207, 142, 0.15);
}

.auth-3d-canvas-wrap {
  width: 100%;
  max-width: 440px;
  height: 440px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

#auth3dCanvas {
  width: 100%;
  height: 100%;
}

.auth-split-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 4rem;
  background: #0f1712;
}

.auth-card {
  background: #0F1712;
  border: 1px solid rgba(62, 207, 142, 0.25);
  border-radius: 28px;
  padding: 2.8rem 3.2rem;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
  animation: cardReveal 0.2s ease both;
}

/* Auth Login/Signup Tab Switcher */
.auth-tabs {
  position: relative;
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 1.4rem;
}

.auth-tab {
  position: relative;
  z-index: 2;
  flex: 1;
  border: none;
  background: transparent;
  color: var(--mist);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 10px 0;
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.25s ease;
}

.auth-tab.active {
  color: #0a0f0d;
}

.auth-tab-indicator {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: linear-gradient(135deg, #3ecf8e, #2fb87d);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(62, 207, 142, 0.35);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.auth-tab-indicator.to-register {
  transform: translateX(100%);
}

/* Dark Obsidian Logo Container */
.logo-mark-dark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  background: #0a0f0d;
  border-radius: 18px;
  border: 1px solid rgba(62, 207, 142, 0.25);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 0 15px rgba(62, 207, 142, 0.1);
  margin-bottom: 1rem;
}

@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(32px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: none;
  }
}



.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  background: #0a0f0d;
  border-radius: 20px;
  margin-bottom: 0.9rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(62, 207, 142, 0.2);
}

.auth-logo h1 {
  font-family: 'Fraunces', serif;
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.04em;
}

.auth-logo p {
  color: var(--ink-50);
  font-size: 0.9rem;
  margin-top: 0.2rem;
}

.auth-tab-row {
  display: flex;
  background: var(--smoke);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 2rem;
  border: 1px solid var(--border-soft);
}

.auth-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-50);
  transition: all 0.3s;
  border: none;
  background: transparent;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.auth-tab.active {
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.step-indicator {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--smoke);
  border: 2px solid var(--border);
  color: var(--ink-30);
  flex-shrink: 0;
  transition: all 0.3s;
}

.step-dot.active {
  background: var(--kiwi);
  border-color: var(--kiwi);
  color: white;
}

.step-dot.done {
  background: var(--kiwi-light);
  border-color: var(--kiwi);
  color: var(--kiwi-deep);
}

.step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  transition: background 0.3s;
}

.step-line.filled {
  background: var(--kiwi);
}

.step-label {
  font-size: 0.72rem;
  color: var(--ink-30);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 1.3rem;
}

.req-star {
  color: var(--coral);
}

.field-group {
  margin-bottom: 1.1rem;
}

.field-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-50);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.field-group input {
  width: 100%;
  background: var(--smoke);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1rem;
  transition: all 0.25s;
  outline: none;
}

.field-group input:focus {
  border-color: var(--kiwi);
  background: var(--kiwi-light);
  box-shadow: 0 0 0 3px rgba(45, 158, 107, 0.12);
}

.field-group input::placeholder {
  color: var(--ink-30);
}

.input-unit-row {
  display: flex;
  gap: 0.5rem;
}

.input-unit-row input {
  flex: 1;
}

.unit-select {
  background: var(--smoke);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
}

.unit-select:focus {
  border-color: var(--kiwi);
}

.radio-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.radio-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 8px 14px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--ink-50);
  font-weight: 500;
  border: 1.5px solid var(--border);
  background: var(--smoke);
  transition: all 0.2s;
}

.radio-chip input[type="radio"] {
  display: none;
}

.radio-chip:has(input:checked) {
  background: var(--kiwi-light);
  border-color: var(--kiwi);
  color: var(--kiwi-deep);
  font-weight: 700;
}

.radio-chip:hover {
  border-color: var(--kiwi);
  color: var(--kiwi);
}

.goals-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.auto-goals-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
  margin-bottom: 0.5rem;
}

.agp-card {
  background: var(--kiwi-light);
  border-radius: var(--radius-md);
  padding: 0.8rem;
  text-align: center;
  border: 1px solid rgba(45, 158, 107, 0.15);
}

.agp-val {
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  color: var(--kiwi-deep);
  font-weight: 700;
}

.agp-label {
  font-size: 0.65rem;
  color: var(--kiwi);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
}

.step-btns {
  display: flex;
  gap: 0.7rem;
}

.back-btn {
  background: var(--smoke) !important;
  border: 1.5px solid var(--border) !important;
  color: var(--ink-50) !important;
  box-shadow: none !important;
}

.submit-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--kiwi), var(--kiwi-deep));
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  margin-top: 0.4rem;
  box-shadow: 0 6px 24px rgba(45, 158, 107, 0.38);
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(45, 158, 107, 0.48);
}

.submit-btn:active {
  transform: none;
}

.auth-error {
  background: var(--coral-light);
  border: 1.5px solid rgba(244, 97, 58, 0.3);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--coral);
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 1rem;
  display: none;
}

/* ── APPLICATION LAYOUT (sidebar + main-content-wrap) ── */
#mainApp {
  display: none;
  min-height: 100vh;
  background: #0a0f0d;
  position: relative;
  z-index: 10;
}

.sidebar-nav {
  width: 260px;
  min-width: 260px;
  height: 100vh;
  position: sticky;
  top: 0;
  background: #0f1712;
  border-right: 1px solid rgba(62, 207, 142, 0.15);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.2rem;
  z-index: 100;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
}

.sidebar-brand {
  margin-bottom: 1.8rem;
}

.sidebar-title {
  font-family: 'Fraunces', serif;
  font-size: 1.22rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.sidebar-section-label {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--mist);
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
  opacity: 0.6;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 1.2rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--mist);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  width: 100%;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-icon {
  font-size: 1.1rem;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  transform: translateX(3px);
}

.sidebar-link.active {
  background: linear-gradient(135deg, rgba(62, 207, 142, 0.22), rgba(45, 158, 107, 0.12));
  border-color: rgba(62, 207, 142, 0.35);
  color: #3ecf8e;
  box-shadow: 0 4px 16px rgba(62, 207, 142, 0.15);
  font-weight: 700;
}

.sidebar-widgets {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-widget-btn {
  width: 100%;
  text-align: left;
}

.share-btn-side {
  padding: 10px 14px;
  background: linear-gradient(135deg, #F5A623, #F4613A);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  text-align: center;
  margin-top: 4px;
  box-shadow: 0 4px 14px rgba(245, 166, 35, 0.25);
  transition: transform 0.2s, filter 0.2s;
}

.share-btn-side:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-username {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  color: var(--mist);
  font-size: 0.72rem;
  opacity: 0.7;
}

.sidebar-lang-select {
  background: #000000 !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.sidebar-lang-select option {
  background: #000000 !important;
  color: #FFFFFF !important;
  padding: 6px 10px;
}

.sidebar-logout-btn {
  background: transparent;
  border: none;
  color: #ff6b6b;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  padding: 4px 0;
  transition: opacity 0.2s;
}

.sidebar-logout-btn:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.main-content-wrap {
  flex: 1;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.mobile-topbar {
  display: none;
}

.diet-widget {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 6px 14px 6px 10px;
  background: var(--kiwi-light);
  border: 1.5px solid rgba(45, 158, 107, 0.25);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  white-space: nowrap;
}

.diet-widget:hover {
  background: rgba(45, 158, 107, 0.15);
  border-color: var(--kiwi);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(45, 158, 107, 0.18);
}

.diet-widget-icon {
  font-size: 1rem;
}

.diet-widget-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.diet-widget-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--kiwi-deep);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  line-height: 1;
}

.diet-widget-tag {
  font-size: 0.72rem;
  color: var(--kiwi);
  margin-top: 1px;
  font-weight: 500;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 4px 14px 4px 4px;
  box-shadow: var(--shadow-sm);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--citrus), var(--coral));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: white;
}

.user-chip span {
  font-size: 0.85rem;
  color: var(--ink);
  font-weight: 600;
}

.logout-link {
  background: none;
  border: none;
  color: var(--ink-50);
  cursor: pointer;
  font-size: 0.83rem;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 500;
  transition: color 0.2s;
}

.logout-link:hover {
  color: var(--coral);
}

/* ── PAGES ── */
.page {
  display: none;
  padding: 2.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.page.active {
  display: block;
  animation: pageIn 0.2s ease both;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.greeting {
  margin-bottom: 2.5rem;
}

.greeting h2 {
  font-family: 'Fraunces', serif;
  font-size: 2.8rem;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.greeting h2 span {
  color: var(--kiwi);
  font-style: italic;
}

.greeting p {
  color: var(--ink-50);
  margin-top: 0.5rem;
  font-size: 1rem;
}

/* ── STAT CARDS ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.stats-row-secondary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.4rem;
}

.stat-ring-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.goal-ring-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-card {
  background: #0F1712;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent, var(--kiwi));
  box-shadow: 0 0 12px var(--accent, var(--kiwi));
  border-radius: 3px 3px 0 0;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, var(--accent, var(--kiwi)) 0%, transparent 70%);
  opacity: 0.08;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.18);
}

.stat-card:hover::after {
  opacity: 0.18;
}

.stat-card .icon {
  font-size: 1.5rem;
  margin-bottom: 0.7rem;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.stat-card .val {
  font-family: 'Fraunces', serif;
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat-card .unit {
  font-size: 0.85rem;
  color: var(--ink-50);
  font-weight: 500;
}

.stat-card .label {
  font-size: 0.72rem;
  color: var(--ink-50);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.4rem;
  font-weight: 700;
}

.goal-bar-wrap {
  margin-top: 0.9rem;
}

.goal-bar-bg {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.goal-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent, var(--kiwi)), rgba(255, 255, 255, 0.9));
  box-shadow: 0 0 10px var(--accent, var(--kiwi));
  border-radius: 99px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-card.warning-high::before {
  background: var(--coral);
  box-shadow: 0 0 12px var(--coral);
}

.stat-card.warning-high .val {
  color: var(--coral);
}

.main-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
}

.glass-card {
  background: #0F1712;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.card-title {
  font-family: 'Fraunces', serif;
  font-size: 1.2rem;
  color: var(--ink);
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  letter-spacing: -0.02em;
}

.card-title .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--kiwi);
  flex-shrink: 0;
}

/* ── FOOD LOG ── */
.food-log-list {
  max-height: 360px;
  overflow-y: auto;
}

.food-log-list::-webkit-scrollbar {
  width: 3px;
}

.food-log-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.log-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.4rem;
  background: var(--smoke);
  border: 1px solid transparent;
  transition: all 0.2s;
}

.log-item:hover {
  background: var(--kiwi-light);
  border-color: rgba(45, 158, 107, 0.2);
}

.log-item-left {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.food-emoji {
  font-size: 1.6rem;
}

.log-item-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.log-item-meta {
  font-size: 0.73rem;
  color: var(--ink-50);
  margin-top: 2px;
}

.log-item-cal {
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  color: var(--citrus-deep);
  font-weight: 700;
}

.remove-item-btn {
  background: none;
  border: none;
  color: var(--ink-30);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all 0.2s;
}

.remove-item-btn:hover {
  color: var(--coral);
  background: var(--coral-light);
}

.empty-log {
  text-align: center;
  padding: 2.5rem;
  color: var(--ink-30);
}

.empty-log .empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.8rem;
}

.empty-log p {
  font-size: 0.88rem;
  line-height: 1.6;
}

.nutrient-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 4px;
}

.npill {
  font-size: 0.66rem;
  padding: 2px 8px;
  border-radius: 50px;
  font-weight: 600;
}

.npill.fiber {
  background: var(--kiwi-light);
  color: var(--kiwi-deep);
}

.npill.sugar {
  background: var(--coral-light);
  color: var(--coral);
}

.npill.sodium {
  background: var(--grape-light);
  color: var(--grape);
}

.npill.chol {
  background: var(--citrus-light);
  color: var(--citrus-deep);
}

/* ── SCAN ── */
.scan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin-bottom: 1.2rem;
  align-items: start;
}

@media(max-width:860px) {
  .scan-grid {
    grid-template-columns: 1fr;
  }
}

.cam-area {
  background: var(--smoke);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 0.9rem;
  position: relative;
  transition: border-color 0.2s;
}

.cam-area.has-media {
  display: block;
  min-height: 0;
  border-style: solid;
  border-color: var(--border-soft);
}

.cam-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink-30);
  padding: 2rem;
  text-align: center;
}

.cam-placeholder .cam-icon {
  font-size: 2.5rem;
}

.cam-placeholder p {
  font-size: 0.82rem;
  line-height: 1.5;
}

.page {
  padding-bottom: 90px;
}

#camVideo {
  display: none;
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: cover;
}

#scanPreview {
  display: none;
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.scan-btn-row {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}

.scan-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius-md);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.scan-btn.green {
  background: var(--kiwi-light);
  color: var(--kiwi-deep);
  border: 1.5px solid rgba(45, 158, 107, 0.25);
}

.scan-btn.green:hover {
  background: rgba(45, 158, 107, 0.18);
  transform: translateY(-1px);
}

.scan-btn.orange {
  background: var(--citrus-light);
  color: var(--citrus-deep);
  border: 1.5px solid rgba(245, 166, 35, 0.3);
}

.scan-btn.orange:hover {
  background: rgba(245, 166, 35, 0.18);
  transform: translateY(-1px);
}

.scan-btn.gold {
  background: linear-gradient(135deg, var(--citrus), var(--mango));
  color: white;
  border: none;
  box-shadow: 0 4px 16px rgba(245, 166, 35, 0.4);
}

.scan-btn.gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(245, 166, 35, 0.5);
}

.scan-btn.muted {
  background: var(--smoke);
  border: 1px solid var(--border);
  color: var(--ink-50);
}

.scan-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

/* ── API KEY ── */
.api-key-section {
  margin-bottom: 1rem;
}

.api-key-saved-state {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  justify-content: space-between;
  background: var(--kiwi-light);
  border: 1.5px solid rgba(45, 158, 107, 0.25);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
}

.api-key-saved-left {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.api-key-saved-icon {
  font-size: 1.1rem;
}

.api-key-saved-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--kiwi-deep);
  font-weight: 700;
}

.api-key-saved-masked {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--kiwi);
  margin-top: 2px;
}

.api-key-change-btn {
  font-size: 0.72rem;
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--ink-50);
  border-radius: 8px;
  padding: 4px 12px;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 600;
  transition: all 0.2s;
}

.api-key-change-btn:hover {
  border-color: var(--kiwi);
  color: var(--kiwi);
}

.api-key-get-link-banner {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  text-decoration: none;
  background: linear-gradient(135deg, var(--kiwi-light), rgba(45, 158, 107, 0.06));
  border: 1.5px solid rgba(45, 158, 107, 0.3);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  margin-bottom: 0.6rem;
  transition: all 0.2s;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--kiwi-deep);
}

.api-key-get-link-banner:hover {
  background: rgba(45, 158, 107, 0.12);
  border-color: var(--kiwi);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(45, 158, 107, 0.18);
}

.api-key-get-icon {
  font-size: 1rem;
}

.api-key-get-badge {
  margin-left: auto;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--kiwi);
  border-radius: 50px;
  padding: 2px 10px;
  color: white;
}

.api-key-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  background: var(--smoke);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.5rem;
  transition: all 0.2s;
}

.api-key-row:focus-within {
  border-color: var(--kiwi);
  background: var(--kiwi-light);
}

.api-key-row input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--ink);
}

.api-key-row input::placeholder {
  color: var(--ink-30);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.82rem;
}

.api-key-save-btn {
  background: linear-gradient(135deg, var(--kiwi), var(--kiwi-deep));
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 14px;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  white-space: nowrap;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(45, 158, 107, 0.3);
}

.api-key-save-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(45, 158, 107, 0.45);
}

.api-key-hints {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.api-key-hint {
  font-size: 0.65rem;
  color: var(--kiwi);
  background: var(--kiwi-light);
  border-radius: 50px;
  padding: 2px 9px;
  font-weight: 600;
}










.cnn-start-cmd code {
  font-family: monospace;
  font-size: 0.78rem;
  color: var(--kiwi-deep);
  background: rgba(45, 158, 107, 0.1);
  padding: 2px 8px;
  border-radius: 6px;
}

/* Scan result */
.scan-result-placeholder {
  min-height: 200px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.6rem;
  color: var(--ink-30);
  padding: 2rem;
  text-align: center;
}

.scan-result-card {
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  animation: pageIn 0.15s ease both;
  box-shadow: var(--shadow-sm);
}

.scan-food-name {
  font-family: 'Fraunces', serif;
  font-size: 1.2rem;
  color: var(--ink);
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.scan-portion {
  font-size: 0.72rem;
  color: var(--ink-30);
  margin-bottom: 1rem;
}

.scan-cal-row {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}

.scan-cal-big {
  font-family: 'Fraunces', serif;
  font-size: 2.2rem;
  color: var(--citrus-deep);
  line-height: 1;
  font-weight: 900;
}

.scan-cal-unit {
  font-size: 0.8rem;
  color: var(--ink-50);
}

.scan-macro-bar {
  height: 7px;
  border-radius: 4px;
  display: flex;
  overflow: hidden;
  margin-bottom: 1rem;
  gap: 2px;
}

.scan-macro-seg {
  border-radius: 4px;
  transition: width 0.5s ease;
}

.scan-nutrient-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.scan-nutrient-cell {
  background: var(--smoke);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.scan-nutrient-cell.warn {
  border-color: rgba(244, 97, 58, 0.3);
  background: var(--coral-light);
}

.scan-n-label {
  font-size: 0.68rem;
  color: var(--ink-50);
  font-weight: 500;
}

.scan-n-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

.scan-n-unit {
  font-size: 0.65rem;
  color: var(--ink-30);
}

.scan-add-btn {
  width: 100%;
  padding: 0.8rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--kiwi), var(--kiwi-deep));
  border: none;
  color: white;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(45, 158, 107, 0.35);
}

.scan-add-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(45, 158, 107, 0.45);
}

.scan-confidence {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  padding: 3px 10px;
  border-radius: 50px;
  background: var(--citrus-light);
  color: var(--citrus-deep);
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.scan-status {
  font-size: 0.78rem;
  text-align: center;
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.6rem;
  display: none;
  font-weight: 500;
}

.scan-status.info {
  display: block;
  background: var(--kiwi-light);
  color: var(--kiwi-deep);
}

.scan-status.error {
  display: block;
  background: var(--coral-light);
  color: var(--coral);
}

.scan-status.success {
  display: block;
  background: var(--kiwi-light);
  color: var(--kiwi-deep);
}

.scanning-pulse {
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: 0.4
  }
}

/* ── SEARCH ── */
.food-results-wide {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
  max-height: 380px;
}

.search-wrap {
  position: relative;
  margin-bottom: 0.8rem;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
}

.search-wrap input {
  width: 100%;
  background: var(--smoke);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px 12px 44px;
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.25s;
}

.search-wrap input:focus {
  border-color: var(--kiwi);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(45, 158, 107, 0.1);
}

.search-wrap input::placeholder {
  color: var(--ink-30);
}

.cat-filter-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.cat-chip {
  padding: 5px 14px;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--ink-50);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.cat-chip.active {
  background: var(--kiwi);
  border-color: var(--kiwi);
  color: white;
  box-shadow: 0 2px 10px rgba(45, 158, 107, 0.3);
}

.cat-chip:hover:not(.active) {
  border-color: var(--kiwi);
  color: var(--kiwi);
}

.meal-type-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.meal-chip {
  padding: 7px 16px;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--ink-50);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.meal-chip:hover {
  border-color: var(--kiwi);
  color: var(--kiwi);
}

.meal-chip.active {
  background: var(--kiwi);
  border-color: var(--kiwi);
  color: white;
  box-shadow: 0 2px 10px rgba(45, 158, 107, 0.3);
}

.food-results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 4px;
}

.food-results::-webkit-scrollbar {
  width: 3px;
}

.food-results::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.food-result-card {
  background: var(--white);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.food-result-card:hover {
  border-color: var(--kiwi);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: var(--kiwi-light);
}

.food-result-card .emoji {
  font-size: 1.6rem;
  margin-bottom: 0.4rem;
}

.food-result-card .name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.15rem;
}

.food-result-card .desc {
  font-size: 0.7rem;
  color: var(--ink-30);
  margin-bottom: 0.3rem;
  line-height: 1.3;
}

.food-result-card .cals {
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  color: var(--citrus-deep);
  font-weight: 700;
}

.food-result-card .macros {
  font-size: 0.7rem;
  color: var(--ink-50);
  margin-top: 0.2rem;
  font-weight: 500;
}

.search-count {
  font-size: 0.78rem;
  color: var(--ink-30);
  font-weight: 500;
}

/* ── HISTORY ── */
.history-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

.chart-wrap {
  height: 280px;
  position: relative;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.history-table th {
  text-align: left;
  padding: 0.7rem 1rem;
  color: var(--ink-30);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border-soft);
}

.history-table td {
  padding: 0.9rem 1rem;
  color: var(--ink);
  border-bottom: 1px solid var(--border-soft);
  font-weight: 500;
}

.history-table tr:hover td {
  background: var(--smoke);
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
}

.badge.breakfast {
  background: var(--citrus-light);
  color: var(--citrus-deep);
}

.badge.lunch {
  background: var(--kiwi-light);
  color: var(--kiwi-deep);
}

.badge.dinner {
  background: var(--grape-light);
  color: var(--grape);
}

.badge.snack {
  background: var(--coral-light);
  color: var(--coral);
}

/* ── PROFILE ── */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.profile-avatar-section {
  text-align: center;
  padding: 2rem;
}

.big-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--citrus), var(--coral));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 900;
  color: white;
  margin: 0 auto 1.2rem;
  box-shadow: 0 12px 40px rgba(244, 97, 58, 0.28);
}

.profile-name {
  font-family: 'Fraunces', serif;
  font-size: 1.8rem;
  color: var(--ink);
  font-weight: 900;
  letter-spacing: -0.03em;
}

.profile-email {
  color: var(--ink-30);
  font-size: 0.9rem;
  margin-top: 0.3rem;
  font-weight: 500;
}

.body-stats-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin: 0.9rem 0;
}

.bsc {
  background: var(--kiwi-light);
  border: 1px solid rgba(45, 158, 107, 0.2);
  border-radius: 50px;
  padding: 4px 12px;
  font-size: 0.78rem;
  color: var(--kiwi-deep);
  font-weight: 600;
}

.profile-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.2rem;
}

.profile-stat {
  background: var(--smoke);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
}

.profile-stat .n {
  font-family: 'Fraunces', serif;
  font-size: 1.8rem;
  color: var(--kiwi);
  font-weight: 900;
}

.profile-stat .l {
  font-size: 0.72rem;
  color: var(--ink-30);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.goal-editor {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.goal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.1rem;
  background: var(--smoke);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  transition: background 0.2s;
}

.goal-row:hover {
  background: var(--white);
}

.goal-label {
  font-size: 0.9rem;
  color: var(--ink);
  font-weight: 600;
}

.goal-sub {
  font-size: 0.72rem;
  color: var(--ink-30);
}

.goal-input {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  width: 90px;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
}

.goal-input:focus {
  border-color: var(--kiwi);
}

.save-goals-btn {
  padding: 13px;
  background: linear-gradient(135deg, var(--kiwi), var(--kiwi-deep));
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 4px 18px rgba(45, 158, 107, 0.35);
}

.save-goals-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(45, 158, 107, 0.45);
}

.water-quick-btn {
  padding: 10px 16px;
  background: #E3F5FD;
  border: 1.5px solid rgba(79, 195, 247, 0.35);
  border-radius: var(--radius-md);
  color: #0288D1;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.water-quick-btn:hover {
  background: #4FC3F7;
  color: #fff;
  transform: translateY(-2px);
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.achievement-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.1rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #0F1712;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.achievement-badge.earned {
  background: #14241B;
  border-color: rgba(62, 207, 142, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.achievement-badge:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.achievement-badge.earned:hover {
  box-shadow: 0 14px 36px rgba(62, 207, 142, 0.28);
}

.achievement-badge .ab-icon {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  filter: grayscale(1) opacity(0.35);
  transition: filter 0.3s ease, transform 0.3s ease;
}

.achievement-badge.earned .ab-icon {
  filter: drop-shadow(0 2px 8px rgba(62, 207, 142, 0.4));
  transform: scale(1.08);
}

.achievement-badge .ab-name {
  font-weight: 800;
  font-size: 0.84rem;
  color: var(--ink);
  margin-bottom: 3px;
  letter-spacing: -0.01em;
}

.achievement-badge .ab-desc {
  font-size: 0.7rem;
  color: var(--ink-50);
  line-height: 1.35;
}

.achievement-badge .ab-progress {
  margin-top: 8px;
  font-size: 0.66rem;
  font-weight: 800;
  color: var(--kiwi);
  background: rgba(62, 207, 142, 0.12);
  border: 1px solid rgba(62, 207, 142, 0.3);
  padding: 2px 8px;
  border-radius: 50px;
}

.profile-logout-btn {
  margin-top: 1.5rem;
  padding: 13px;
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  width: 100%;
  transition: all 0.25s;
  box-shadow: 0 4px 18px rgba(231, 76, 60, 0.35);
  text-align: center;
}

.profile-logout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(231, 76, 60, 0.45);
}

/* ── TOAST NOTIFICATIONS ── */
.toast {
  position: fixed !important;
  top: 84px !important;
  bottom: auto !important;
  right: 24px !important;
  background: #0F1712;
  border: 1px solid rgba(62, 207, 142, 0.4);
  border-radius: 14px;
  padding: 12px 20px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #ffffff;
  z-index: 10000;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(62, 207, 142, 0.12);
  transform: translateY(-20px);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 380px;
  pointer-events: none;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  border-color: rgba(62, 207, 142, 0.5);
  background: linear-gradient(135deg, rgba(15, 30, 22, 0.96), rgba(10, 20, 15, 0.96));
  color: #ffffff;
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.5);
  background: linear-gradient(135deg, rgba(35, 15, 15, 0.96), rgba(20, 10, 10, 0.96));
  color: #ffffff;
}

.toast.info {
  border-color: rgba(59, 130, 246, 0.5);
  background: linear-gradient(135deg, rgba(15, 22, 35, 0.96), rgba(10, 15, 25, 0.96));
  color: #ffffff;
}

/* ── MISC ── */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(45, 158, 107, 0.2);
  border-top-color: var(--kiwi);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── RESPONSIVE ── */
@media(max-width:1100px) {

  .stats-row,
  .stats-row-secondary {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media(max-width:900px) {

  #mainApp {
    flex-direction: column;
  }

  .sidebar-nav {
    display: none;
  }

  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: #0f1712;
    border-bottom: 1px solid rgba(62, 207, 142, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .main-grid,
  .history-grid,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .page {
    padding: 1.5rem 1rem;
  }

  .food-results-wide {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media(max-width:600px) {

  .stats-row,
  .stats-row-secondary {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .stat-card {
    padding: 1.3rem;
  }

  .auth-card {
    padding: 2rem 1.5rem;
  }

  .food-results {
    grid-template-columns: 1fr;
  }

  .auto-goals-preview {
    grid-template-columns: 1fr 1fr;
  }
}

/* ══════════════════════════════════════════════════
   PLAN MY DIET PANEL
══════════════════════════════════════════════════ */
.dp-overlay {
  position: fixed;
  inset: 0;
  z-index: 8500;
  background: rgba(18, 17, 15, 0.45);
  display: none;
  align-items: stretch;
  justify-content: flex-end;
}

.dp-overlay.open {
  display: flex;
  animation: dpFadeIn 0.25s ease both;
}

@keyframes dpFadeIn {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

.dp-panel {
  width: min(580px, 100vw);
  height: 100vh;
  background: var(--white);
  border-left: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: dpSlideIn 0.15s ease both;
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.1);
}

@keyframes dpSlideIn {
  from {
    transform: translateX(100%);
    opacity: 0.6
  }

  to {
    transform: none;
    opacity: 1
  }
}

.dp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 1.8rem 1.2rem;
  border-bottom: 1px solid var(--border-soft);
  background: var(--white);
  flex-shrink: 0;
}

.dp-header-left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.dp-logo {
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, var(--kiwi), var(--kiwi-deep));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 16px rgba(45, 158, 107, 0.3);
}

.dp-title {
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  color: var(--ink);
  font-weight: 900;
  letter-spacing: -0.03em;
}

.dp-subtitle {
  font-size: 0.78rem;
  color: var(--ink-30);
  margin-top: 1px;
  font-weight: 500;
}

.dp-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--smoke);
  color: var(--ink-50);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dp-close:hover {
  background: var(--coral-light);
  border-color: rgba(244, 97, 58, 0.3);
  color: var(--coral);
}

.dp-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.6rem 1.8rem;
}

.dp-body::-webkit-scrollbar {
  width: 3px;
}

.dp-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.dp-hero {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.dp-stat {
  background: var(--smoke);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 1rem 0.8rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s;
}

.dp-stat:hover {
  transform: translateY(-2px);
}

.dp-stat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--dp-accent, var(--kiwi));
}

.dp-stat-icon {
  font-size: 1.2rem;
  margin-bottom: 0.35rem;
}

.dp-stat-val {
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  color: var(--ink);
  font-weight: 900;
  line-height: 1;
}

.dp-stat-unit {
  font-size: 0.62rem;
  color: var(--ink-30);
}

.dp-stat-label {
  font-size: 0.6rem;
  color: var(--ink-30);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.25rem;
  font-weight: 600;
}

.dp-tabs {
  display: flex;
  gap: 0.3rem;
  background: var(--smoke);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-soft);
}

.dp-tab {
  flex: 1;
  padding: 9px 6px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--ink-50);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.dp-tab.active {
  background: var(--white);
  color: var(--kiwi-deep);
  box-shadow: var(--shadow-sm);
}

.dp-tab-panel {
  display: none;
  animation: dpTabIn 0.25s ease both;
}

.dp-tab-panel.active {
  display: block;
}

@keyframes dpTabIn {
  from {
    opacity: 0;
    transform: translateY(6px)
  }

  to {
    opacity: 1;
    transform: none
  }
}

.dp-card {
  background: var(--smoke);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 1.3rem 1.4rem;
  margin-bottom: 1rem;
}

.dp-card-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--kiwi-deep);
  font-weight: 800;
  margin-bottom: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dp-card-title::before {
  content: '';
  width: 3px;
  height: 14px;
  background: var(--kiwi);
  border-radius: 2px;
}

.dp-bmi-row {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 0.5rem;
}

.dp-bmi-ring-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.dp-bmi-ring-wrap svg {
  width: 80px;
  height: 80px;
}

.dp-bmi-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dp-bmi-val {
  font-family: 'Fraunces', serif;
  font-size: 1.3rem;
  color: var(--ink);
  font-weight: 900;
  line-height: 1;
}

.dp-bmi-tiny {
  font-size: 0.58rem;
  color: var(--ink-30);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 1px;
  font-weight: 600;
}

.dp-bmi-info {
  flex: 1;
}

.dp-bmi-label {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.dp-bmi-desc {
  font-size: 0.78rem;
  color: var(--ink-50);
  line-height: 1.5;
}

.dp-bmi-scale {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.8rem;
  gap: 2px;
}

.dp-bmi-seg {
  flex: 1;
  border-radius: 3px;
}

.dp-bmi-marker-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.58rem;
  color: var(--ink-30);
  margin-top: 3px;
  font-weight: 600;
}

.dp-macro-rings {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  margin-top: 0.5rem;
}

.dp-macro-ring-item {
  text-align: center;
}

.dp-macro-ring-item svg {
  display: block;
  margin: 0 auto 0.4rem;
}

.dp-mring-label {
  font-size: 0.7rem;
  color: var(--ink-30);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
}

.dp-mring-val {
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  color: var(--ink);
  font-weight: 900;
}

.dp-cal-bar-wrap {
  margin: 0.4rem 0 1rem;
}

.dp-cal-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--ink-50);
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.dp-cal-bar-track {
  height: 10px;
  background: var(--border);
  border-radius: 5px;
  overflow: hidden;
}

.dp-cal-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--citrus), var(--mango));
  border-radius: 5px;
}

.dp-split-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.dp-split-item {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 0.6rem;
  text-align: center;
}

.dp-split-val {
  font-family: 'Fraunces', serif;
  font-size: 1.05rem;
  font-weight: 900;
}

.dp-split-label {
  font-size: 0.65rem;
  color: var(--ink-30);
  margin-top: 2px;
  font-weight: 600;
}

.dp-timeline {
  display: flex;
  flex-direction: column;
}

.dp-meal-item {
  display: flex;
  gap: 1rem;
  position: relative;
  padding-bottom: 1.1rem;
}

.dp-meal-item:last-child {
  padding-bottom: 0;
}

.dp-meal-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 44px;
  flex-shrink: 0;
}

.dp-meal-time-badge {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  border: 1px solid var(--border-soft);
}

.dp-meal-line {
  width: 2px;
  flex: 1;
  margin-top: 4px;
  min-height: 16px;
}

.dp-meal-item:last-child .dp-meal-line {
  display: none;
}

.dp-meal-right {
  flex: 1;
  padding-top: 0.1rem;
}

.dp-meal-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.3rem;
}

.dp-meal-time {
  font-size: 0.68rem;
  color: var(--ink-30);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.dp-meal-foods {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.dp-food-tag {
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 50px;
  background: var(--kiwi-light);
  border: 1px solid rgba(45, 158, 107, 0.2);
  color: var(--kiwi-deep);
  font-weight: 600;
}

.dp-food-tag.avoid {
  background: var(--coral-light);
  border-color: rgba(244, 97, 58, 0.25);
  color: var(--coral);
}

.dp-habit-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.dp-habit {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 0.9rem 1rem;
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  transition: all 0.2s;
}

.dp-habit:hover {
  border-color: rgba(45, 158, 107, 0.25);
  box-shadow: var(--shadow-sm);
}

.dp-habit-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.dp-habit-text h4 {
  font-size: 0.88rem;
  color: var(--ink);
  font-weight: 700;
  margin-bottom: 2px;
}

.dp-habit-text p {
  font-size: 0.75rem;
  color: var(--ink-50);
  line-height: 1.45;
}

.dp-habit-badge {
  margin-left: auto;
  font-size: 0.62rem;
  padding: 3px 9px;
  border-radius: 50px;
  flex-shrink: 0;
  border: 1px solid;
  white-space: nowrap;
  align-self: flex-start;
  margin-top: 2px;
  font-weight: 700;
}

.dp-habit-badge.green {
  color: var(--kiwi-deep);
  border-color: rgba(45, 158, 107, 0.3);
  background: var(--kiwi-light);
}

.dp-habit-badge.amber {
  color: var(--citrus-deep);
  border-color: rgba(245, 166, 35, 0.3);
  background: var(--citrus-light);
}

.dp-habit-badge.red {
  color: var(--coral);
  border-color: rgba(244, 97, 58, 0.3);
  background: var(--coral-light);
}

.dp-tip-banner {
  background: var(--kiwi-light);
  border: 1px solid rgba(45, 158, 107, 0.2);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  margin-top: 0.5rem;
}

.dp-tip-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.dp-tip-text {
  font-size: 0.8rem;
  color: var(--kiwi-deep);
  line-height: 1.55;
}

.dp-tip-text strong {
  color: var(--kiwi-deep);
  font-weight: 700;
}

.dp-footer {
  display: flex;
  gap: 0.8rem;
  padding: 1.1rem 1.8rem;
  border-top: 1px solid var(--border-soft);
  background: var(--white);
  flex-shrink: 0;
}

.dp-footer-btn {
  flex: 1;
  padding: 11px;
  border-radius: var(--radius-md);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--border);
  background: var(--smoke);
  color: var(--ink-50);
}

.dp-footer-btn:hover {
  background: var(--white);
  color: var(--ink);
}

.dp-footer-primary {
  background: linear-gradient(135deg, var(--kiwi), var(--kiwi-deep));
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 16px rgba(45, 158, 107, 0.35);
}

.dp-footer-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(45, 158, 107, 0.45);
}

@media(max-width:600px) {
  .dp-panel {
    width: 100vw;
  }

  .dp-hero {
    grid-template-columns: 1fr 1fr;
  }
}

@keyframes dpSlideOut {
  from {
    transform: none;
    opacity: 1
  }

  to {
    transform: translateX(100%);
    opacity: 0.4
  }
}

/* ── UTILITY CLASSES ── */
.hidden {
  display: none;
}

.no-margin-bottom {
  margin-bottom: 0 !important;
}

.margin-top-lg {
  margin-top: 1.2rem;
}

.margin-bottom-md {
  margin-bottom: 1rem;
}

.margin-bottom-sm {
  margin-bottom: 0.6rem;
}

.margin-top-md {
  margin-top: 1rem;
}

.margin-top-xs {
  margin-top: 0.35rem;
}

.margin-top-lg-xl {
  margin-top: 1.5rem;
}

.padding-override {
  padding: 0.9rem 1.3rem;
}

/* ── FLEX UTILITIES ── */
.flex-grow {
  flex: 1;
}

.min-width-220 {
  min-width: 220px;
}

/* ── MEAL TIME HINT ── */
#mealTimeHint {
  color: rgba(184, 201, 186, 0.4);
  margin-left: 0.3rem;
  align-self: center;
}

/* ── SEARCH COUNT ── */
#searchCount {
  white-space: nowrap;
  font-size: 0.78rem;
  color: var(--mist);
}

/* ── SEARCH WRAP FLEX ── */
.search-wrap.flex-search {
  flex: 1;
  min-width: 220px;
}

/* ── GREETING SPACING ── */
.greeting.margin-bottom-lg {
  margin-bottom: 1.4rem;
}

.font-size-sm {
  font-size: 0.7rem;
}

.font-size-xs {
  font-size: 0.65rem;
}

.opacity-50 {
  opacity: 0.5;
}

.opacity-35 {
  opacity: 0.35;
}

.opacity-30 {
  opacity: 0.3;
}

.opacity-28 {
  opacity: 0.28;
}

.opacity-25 {
  opacity: 0.25;
}

.flex-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.text-center {
  text-align: center;
}

.whitespace-nowrap {
  white-space: nowrap;
}

.line-height-1-5 {
  line-height: 1.5;
}

.letter-spacing-08 {
  letter-spacing: 0.08em;
}

.font-600 {
  font-weight: 600;
}

.font-700 {
  font-weight: 700;
}

.text-uppercase {
  text-transform: uppercase;
}

.text-muted {
  color: var(--ink-50);
}

/* ── SCAN MODE BUTTON ── */
.scan-btn-switch {
  font-size: 0.72rem;
  background: var(--smoke);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  padding: 3px 10px;
  cursor: pointer;
  color: var(--ink-50);
  font-weight: 600;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  transition: all 0.2s;
}

.scan-btn-switch:hover {
  background: var(--white);
  color: var(--ink);
  border-color: var(--kiwi);
}

/* ── PLACEHOLDER STYLES ── */
.placeholder-icon {
  font-size: 2.5rem;
  opacity: 0.2;
}

.placeholder-title {
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0.5;
}

.placeholder-text {
  font-size: 0.72rem;
  opacity: 0.35;
  line-height: 1.6;
  margin-top: 0.3rem;
}

/* ── FORM VALIDATION MESSAGES ── */
#emailValidationMsg,
#confirmPasswordMsg {
  font-size: 0.7rem;
  margin-top: 0.35rem;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
}

/* ── PASSWORD STRENGTH BAR ── */
#passwordStrengthBar {
  margin-top: 0.5rem;
}

#passwordStrengthBar>div {
  height: 3px;
  background: #e0e0e0;
  border-radius: 2px;
  overflow: hidden;
}

#passwordStrengthFill {
  height: 100%;
  width: 0%;
  transition: width 0.3s, background 0.3s;
  border-radius: 2px;
}

#passwordStrengthLabel {
  font-size: 0.68rem;
  margin-top: 0.3rem;
  color: rgba(184, 201, 186, 0.5);
}

/* ── Performance ── */
.auth-card,
.page.active,
.modal-box,
.scan-result-card {
  will-change: transform, opacity;
}

@media (prefers-reduced-motion:reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ══════════════════════════════════════════════════
   VEGETARIAN DIET MODE — Plan My Diet extras
══════════════════════════════════════════════════ */

/* Protein sources grid */
.veg-protein-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-top: 0.4rem;
}

.veg-protein-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--kiwi-light);
  border: 1px solid rgba(45, 158, 107, 0.15);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.7rem;
}

.veg-protein-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--kiwi-deep);
}

.veg-protein-val {
  font-size: 0.7rem;
  color: var(--kiwi);
  font-weight: 600;
}

/* Nutrient watch list */
.nutrient-watch-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.nutrient-watch-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
}

.nw-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.nw-info {
  flex: 1;
}

.nw-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}

.nw-tip {
  font-size: 0.73rem;
  color: var(--ink-50);
  line-height: 1.45;
}

.nw-badge {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 50px;
  padding: 3px 9px;
  border: 1px solid;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
  white-space: nowrap;
}

.nw-high {
  background: var(--coral-light);
  color: var(--coral);
  border-color: rgba(244, 97, 58, 0.3);
}

.nw-medium {
  background: var(--citrus-light);
  color: var(--citrus-deep);
  border-color: rgba(245, 166, 35, 0.3);
}

.nw-low {
  background: var(--kiwi-light);
  color: var(--kiwi-deep);
  border-color: rgba(45, 158, 107, 0.25);
}

/* ── GLOBAL FOOTER ── */
.app-footer {
  text-align: center;
  padding: 2.5rem 1.5rem;
  border-top: 1px solid var(--border-soft);
  margin-top: 2rem;
  width: 100%;
}

.app-footer p {
  font-size: 0.8rem;
  color: var(--ink-30);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ══════════════════════════════════════════════════
   MOBILE BOTTOM NAVIGATION BAR
   Visible only on screens ≤ 900px
══════════════════════════════════════════════════ */
.mobile-nav {
  display: none;
  /* hidden on desktop */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 500;
  background: #0A0F0D;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
  /* Safe area for iPhone home bar */
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mob-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 4px 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 0;
  transition: all 0.2s;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  position: relative;
  /* Tap highlight ripple */
  -webkit-tap-highlight-color: transparent;
}

.mob-nav-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--kiwi);
  box-shadow: 0 0 8px var(--kiwi);
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.mob-nav-btn.active::before {
  width: 32px;
}

.mob-nav-icon {
  font-size: 1.35rem;
  line-height: 1;
  transition: transform 0.2s;
}

.mob-nav-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--ink-50);
  letter-spacing: 0.03em;
  transition: color 0.2s;
  text-transform: uppercase;
}

.mob-nav-btn.active .mob-nav-label {
  color: var(--kiwi);
  text-shadow: 0 0 10px rgba(62, 207, 142, 0.4);
  font-weight: 700;
}

.mob-nav-btn.active .mob-nav-icon {
  transform: translateY(-2px) scale(1.08);
}

.mob-nav-btn:active .mob-nav-icon {
  transform: scale(0.9);
}

@media (max-width: 900px) {

  /* Show mobile bottom nav */
  .mobile-nav {
    display: flex;
  }

  /* Push page content up so it doesn't hide behind the 72px bottom bar */
  #mainApp .page {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px) + 1rem);
  }
}

@media (max-width: 480px) {
  .mob-nav-label {
    font-size: 0.58rem;
  }

  .mob-nav-icon {
    font-size: 1.25rem;
  }
}

/* ══════════════════════════════════════════════════
   MOBILE DIET BANNER CARD (Dashboard Specific)
   ══════════════════════════════════════════════════ */
.mobile-diet-banner {
  display: none;
  /* hidden on desktop */
}

@media (max-width: 900px) {
  .mobile-diet-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.4rem;
    background: var(--white);
    border: 1px solid var(--border-soft);
    border-left: 4px solid var(--kiwi);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    margin-bottom: 1.8rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-diet-banner:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(45, 158, 107, 0.25);
  }

  .mobile-diet-banner:active {
    transform: translateY(0);
  }

  .mdb-icon {
    font-size: 1.6rem;
    width: 44px;
    height: 44px;
    background: var(--kiwi-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .mdb-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .mdb-content h3 {
    font-family: 'Fraunces', serif;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.01em;
    margin: 0;
  }

  .mdb-content p {
    font-size: 0.8rem;
    color: var(--kiwi);
    margin-top: 3px;
    font-weight: 500;
  }

  .mdb-arrow {
    font-size: 1.2rem;
    color: var(--ink-30);
    transition: transform 0.2s;
  }

  .mobile-diet-banner:hover .mdb-arrow {
    transform: translateX(4px);
    color: var(--kiwi);
  }
}

/* ══════════════════════════════════════════════════
   PLAN MY DIET — WORKOUTS TAB STYLING & SCROLL FIX
   ══════════════════════════════════════════════════ */
.dp-tabs {
  overflow-x: auto;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE/Edge */
}

.dp-tabs::-webkit-scrollbar {
  display: none;
  /* Chrome/Safari */
}

.dp-workout-day-row {
  display: flex;
  gap: 1.2rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border-soft);
  align-items: flex-start;
}

.dp-workout-day-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.dp-workout-day-badge {
  flex-shrink: 0;
  width: 58px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dp-workout-day-info {
  flex: 1;
}

.dp-workout-day-type {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.35rem;
}

.dp-workout-ex-list {
  margin: 0;
  padding-left: 1.2rem;
}

.dp-workout-ex-list li {
  font-size: 0.8rem;
  color: var(--ink-50);
  margin-bottom: 0.25rem;
  line-height: 1.5;
}

/* ══════════════════════════════════════════════════════
   OTP VERIFICATION STYLES
═══════════════════════════════════════════════════════ */

.otp-sent-notice {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--kiwi-light);
  border: 1.5px solid rgba(45, 158, 107, 0.25);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  margin-bottom: 0.5rem;
}

.otp-sent-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.otp-sent-text {
  font-size: 0.82rem;
  color: var(--ink-80);
  line-height: 1.5;
}

.otp-sent-text strong {
  color: var(--kiwi-deep);
}

.otp-input-row {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
}

.otp-digit {
  width: 2.6rem;
  height: 3.2rem;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  caret-color: var(--kiwi);
  outline: none;
}

.otp-digit:focus {
  border-color: var(--kiwi);
  box-shadow: 0 0 0 3px rgba(45, 158, 107, 0.15);
  transform: scale(1.05);
}

.otp-digit.otp-filled {
  border-color: var(--kiwi);
  background: var(--kiwi-light);
  color: var(--kiwi-deep);
}

.otp-digit.otp-error {
  border-color: var(--coral);
  background: var(--coral-light);
  animation: otp-shake 0.35s ease;
}

@keyframes otp-shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-4px);
  }

  75% {
    transform: translateX(4px);
  }
}

.otp-timer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  font-size: 0.78rem;
  color: var(--ink-50);
}

.otp-resend-btn {
  background: none;
  border: none;
  color: var(--kiwi);
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  transition: background 0.15s;
}

.otp-resend-btn:hover {
  background: var(--kiwi-light);
}

/* ═══════════════════════════════════════════════════════
   MULTI-MODAL FLOATING ASSISTANT BAR
═══════════════════════════════════════════════════════ */
.floating-assistant-bar {
  position: fixed;
  bottom: 85px;
  right: 20px;
  z-index: 1200;
  background: #0A0F0D;
  border: 1px solid rgba(62, 207, 142, 0.3);
  border-radius: 50px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(62, 207, 142, 0.15);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.assistant-bar-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.assistant-bar-btn:hover {
  background: rgba(62, 207, 142, 0.25);
  border-color: #3ecf8e;
  transform: translateY(-2px) scale(1.08);
  box-shadow: 0 6px 16px rgba(62, 207, 142, 0.3);
}

.assistant-bar-btn.nutribot-accent {
  background: linear-gradient(135deg, #3ecf8e, #2d9e6b);
  border: none;
  box-shadow: 0 4px 14px rgba(45, 158, 107, 0.4);
}

.assistant-bar-btn.nutribot-accent:hover {
  transform: translateY(-2px) scale(1.1);
  box-shadow: 0 8px 22px rgba(45, 158, 107, 0.6);
}

@media (max-width: 480px) {
  .floating-assistant-bar {
    bottom: 74px;
    right: 12px;
    padding: 4px 8px;
    gap: 6px;
  }

  .assistant-bar-btn {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }
}

/* ══════════════════════════════════════════════════════
   NUTRIBOT FLOATING CHAT PANEL
═══════════════════════════════════════════════════════ */

.nutribot-fab {
  position: fixed;
  bottom: 90px;
  right: 20px;
  z-index: 1200;
  background: linear-gradient(135deg, var(--kiwi), var(--kiwi-deep));
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 0.7rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(45, 158, 107, 0.4);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  transition: transform 0.2s, box-shadow 0.2s;
  animation: fab-bounce 2.5s ease-in-out infinite;
}

@keyframes fab-bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

.nutribot-fab:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 10px 32px rgba(45, 158, 107, 0.5);
  animation: none;
}

.nutribot-fab-icon {
  font-size: 1.15rem;
}

.nutribot-fab-label {
  letter-spacing: 0.02em;
}

.nutribot-panel {
  position: fixed;
  bottom: 90px;
  right: 20px;
  z-index: 1300;
  width: min(380px, calc(100vw - 32px));
  max-height: min(580px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(45, 158, 107, 0.1);
  overflow: hidden;
  animation: chat-slide-up 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes chat-slide-up {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.nutribot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  background: linear-gradient(135deg, var(--kiwi), var(--kiwi-deep));
  color: #fff;
}

.nutribot-header-left {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.nutribot-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.nutribot-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.nutribot-subtitle {
  font-size: 0.72rem;
  opacity: 0.85;
  margin-top: 1px;
}

.nutribot-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: background 0.15s;
  flex-shrink: 0;
}

.nutribot-close:hover {
  background: rgba(255, 255, 255, 0.35);
}

.nutribot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scroll-behavior: smooth;
  background: var(--smoke);
}

.nutribot-messages::-webkit-scrollbar {
  width: 4px;
}

.nutribot-messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.nb-msg {
  display: flex;
  gap: 0.5rem;
  max-width: 90%;
  animation: msg-appear 0.25s ease;
}

@keyframes msg-appear {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nb-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.nb-msg.bot {
  align-self: flex-start;
}

.nb-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  margin-top: auto;
}

.nb-msg.bot .nb-msg-avatar {
  background: var(--kiwi-light);
}

.nb-msg.user .nb-msg-avatar {
  background: var(--citrus-light);
}

.nb-msg-bubble {
  padding: 0.65rem 0.9rem;
  border-radius: 18px;
  font-size: 0.84rem;
  line-height: 1.55;
  max-width: 280px;
  word-break: break-word;
}

.nb-msg.bot .nb-msg-bubble {
  background: var(--white);
  color: var(--ink);
  border-bottom-left-radius: 6px;
  box-shadow: var(--shadow-sm);
}

.nb-msg.user .nb-msg-bubble {
  background: linear-gradient(135deg, var(--kiwi), var(--kiwi-deep));
  color: #fff;
  border-bottom-right-radius: 6px;
}

.nb-typing .nb-msg-bubble {
  padding: 0.7rem 1rem;
}

.nb-typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}

.nb-typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-30);
  animation: typing-dot 1.2s ease-in-out infinite;
}

.nb-typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.nb-typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing-dot {

  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }

  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

.nutribot-chips {
  padding: 0.6rem 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  background: var(--white);
  border-top: 1px solid var(--border-soft);
}

.nutribot-chip {
  font-family: inherit;
  font-size: 0.73rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 50px;
  background: var(--kiwi-light);
  color: var(--kiwi-deep);
  border: 1.5px solid rgba(45, 158, 107, 0.2);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  white-space: nowrap;
}

.nutribot-chip:hover {
  background: var(--kiwi);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(45, 158, 107, 0.3);
}

.nutribot-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem;
  background: var(--white);
  border-top: 1px solid var(--border-soft);
}

.nutribot-input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 0.55rem 1rem;
  font-family: inherit;
  font-size: 0.84rem;
  color: var(--ink);
  background: var(--smoke);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.nutribot-input:focus {
  border-color: var(--kiwi);
  background: var(--white);
}

.nutribot-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--kiwi), var(--kiwi-deep));
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 3px 10px rgba(45, 158, 107, 0.3);
}

.nutribot-send:hover {
  transform: scale(1.1);
  box-shadow: 0 5px 15px rgba(45, 158, 107, 0.4);
}

.nutribot-send:disabled {
  opacity: 0.5;
  transform: none;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .nutribot-fab {
    bottom: 76px;
    right: 12px;
  }

  .nutribot-panel {
    bottom: 76px;
    right: 12px;
    left: 12px;
    width: auto;
  }

  .otp-digit {
    width: 2.3rem;
    height: 2.8rem;
    font-size: 1.2rem;
  }
}

/* ═══════════════════════════════════════════════════
   AUTH — REDESIGNED LOGIN/REGISTER PAGE
   Signature element: animated "scan showcase" cards that
   demonstrate the core product loop (photo → AI match → macros)
   right on the login screen, instead of generic auth decoration.
═══════════════════════════════════════════════════ */

.auth-shell {
  display: none;
  /* toggled to flex by App.js */
  position: relative;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow: hidden;
}

.auth-blobs {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.auth-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.35;
  animation: authBlobDrift 22s ease-in-out infinite;
}

.auth-blob-1 {
  width: 420px;
  height: 420px;
  background: var(--kiwi-light);
  top: -10%;
  left: -8%;
  animation-delay: 0s;
}

.auth-blob-2 {
  width: 380px;
  height: 380px;
  background: var(--citrus-light);
  bottom: -12%;
  right: -6%;
  animation-delay: -7s;
}

.auth-blob-3 {
  width: 300px;
  height: 300px;
  background: var(--berry-light);
  top: 40%;
  left: 55%;
  animation-delay: -14s;
}

@keyframes authBlobDrift {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(30px, -20px) scale(1.08);
  }

  66% {
    transform: translate(-20px, 25px) scale(0.95);
  }
}

.auth-container {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 960px;
  background: var(--white);
  border-radius: 28px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: cardReveal 0.35s ease both;
}

.auth-panel {
  flex: 1 1 50%;
  min-width: 320px;
  padding: 3.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-panel-showcase {
  background: linear-gradient(160deg, var(--smoke) 0%, var(--kiwi-light) 130%);
  align-items: center;
  text-align: center;
  position: relative;
  border-left: 1px solid var(--border-soft);
}









.auth-success {
  background: var(--kiwi-light) !important;
  color: var(--kiwi-deep) !important;
  border-color: rgba(45, 158, 107, 0.3) !important;
}

.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.field-label-row label {
  margin-bottom: 0;
}

.auth-link-small {
  font-size: 0.8rem;
  color: var(--kiwi);
  text-decoration: none;
  font-weight: 600;
}

.auth-link-small:hover {
  text-decoration: underline;
}

.input-icon-wrap {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-30);
  pointer-events: none;
  transition: color 0.25s;
}

.input-icon-wrap input {
  padding-left: 44px !important;
}

.input-icon-wrap input:focus+.input-icon,
.input-icon-wrap:focus-within .input-icon {
  color: var(--kiwi);
}

.auth-submit {
  margin-top: 0.4rem;
  margin-bottom: 1.4rem;
}

.auth-switch-text {
  font-size: 0.9rem;
  color: var(--ink-50);
  text-align: center;
}

.auth-switch-text a {
  color: var(--kiwi);
  font-weight: 600;
  text-decoration: none;
}

.auth-switch-text a:hover {
  text-decoration: underline;
}

/* ── Signature element: the scan showcase ── */
.scan-showcase {
  width: 100%;
  max-width: 300px;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.scan-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #0F1712;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.95rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  text-align: left;
  opacity: 0;
  animation: scanCardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both, scanCardFloat 5s ease-in-out infinite;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.scan-card:hover {
  border-color: rgba(62, 207, 142, 0.4);
  box-shadow: 0 12px 32px rgba(62, 207, 142, 0.15);
}

.scan-card-1 {
  animation-delay: 0.1s, 0.6s;
  transform: rotate(-1.5deg);
}

.scan-card-2 {
  animation-delay: 0.28s, 0.9s;
  transform: rotate(1deg);
}

.scan-card-3 {
  animation-delay: 0.46s, 1.2s;
  transform: rotate(-0.8deg);
}

@keyframes scanCardIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }

  to {
    opacity: 1;
  }
}

@keyframes scanCardFloat {

  0%,
  100% {
    translate: 0 0;
  }

  50% {
    translate: 0 -5px;
  }
}

.scan-emoji {
  font-size: 1.7rem;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.scan-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1;
}

.scan-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scan-kcal {
  font-size: 0.74rem;
  color: var(--ink-50);
  font-weight: 500;
}

.scan-badge {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--kiwi);
  background: linear-gradient(135deg, rgba(62, 207, 142, 0.25) 0%, rgba(62, 207, 142, 0.1) 100%);
  border: 1px solid rgba(62, 207, 142, 0.4);
  box-shadow: 0 0 10px rgba(62, 207, 142, 0.2);
  padding: 0.28rem 0.6rem;
  border-radius: 50px;
  white-space: nowrap;
}

.showcase-title {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.showcase-sub {
  color: var(--ink-50);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1.75rem;
  max-width: 260px;
}

.google-btn {
  width: 100%;
  max-width: 280px;
  background: var(--white);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 600;
  font-size: 0.98rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1.5px solid var(--border);
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.google-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--ink-10);
}

.google-btn:active {
  transform: none;
}

/* ── Responsive — single consolidated block (replaces three
   previously-duplicated, conflicting @media(max-width:768px)
   blocks that fought each other with !important overrides) ── */
@media (max-width: 860px) {
  .auth-container {
    flex-direction: column;
    max-width: 480px;
    border-radius: 22px;
  }

  .auth-panel {
    padding: 2.25rem 1.75rem;
  }

  .auth-panel-showcase {
    border-left: none;
    border-top: 1px solid var(--border-soft);
    order: 2;
    /* form comes first on mobile — the task at hand */
  }

  .auth-panel-form {
    order: 1;
  }



  .scan-showcase {
    max-width: 100%;
    margin-bottom: 1.5rem;
  }
}

@media (max-width: 480px) {
  .auth-shell {
    padding: 0.75rem;
  }

  .auth-panel {
    padding: 1.75rem 1.25rem;
  }





  /* Two showcase cards is plenty on small phones — keep the sign-in
     task front and center rather than pushing it below the fold. */
  .scan-card-3 {
    display: none;
  }

  .scan-showcase {
    margin-bottom: 1.25rem;
  }

  .showcase-title {
    font-size: 1.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {

  .auth-blob,
  .scan-card {
    animation: none !important;
    opacity: 1;
  }
}

/* ═══════════════════════════════════════════════════
   AUTH — Login page redesign
   Signature element: animated "scan showcase" cards that
   demonstrate the actual product loop (photo → AI match →
   macros logged) instead of a generic auth illustration.
═══════════════════════════════════════════════════ */

.auth-shell {
  display: none;
  position: relative;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow: hidden;
}

/* Ambient background blobs — soft, slow, on-brand with the
   fruity palette. Purely atmospheric, sits behind everything. */
.auth-blobs {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.auth-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  animation: authBlobDrift 22s ease-in-out infinite;
}

.auth-blob-1 {
  width: 420px;
  height: 420px;
  top: -10%;
  left: -8%;
  background: radial-gradient(circle, var(--kiwi-light), transparent 70%);
  animation-delay: 0s;
}

.auth-blob-2 {
  width: 380px;
  height: 380px;
  bottom: -12%;
  right: -6%;
  background: radial-gradient(circle, var(--citrus-light), transparent 70%);
  animation-delay: -7s;
}

.auth-blob-3 {
  width: 300px;
  height: 300px;
  bottom: 10%;
  left: 30%;
  background: radial-gradient(circle, var(--berry-light), transparent 70%);
  animation-delay: -14s;
}

@keyframes authBlobDrift {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(20px, -24px) scale(1.06);
  }

  66% {
    transform: translate(-16px, 18px) scale(0.96);
  }
}

.auth-container {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 960px;
  background: var(--white);
  border-radius: 28px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: cardReveal 0.35s ease both;
}

.auth-panel {
  flex: 1;
  min-width: 320px;
  padding: 3.25rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-panel-showcase {
  background: linear-gradient(160deg, var(--kiwi-light) 0%, var(--smoke) 60%);
  align-items: center;
  text-align: center;
  position: relative;
  border-left: 1px solid var(--border-soft);
}

.auth-logo {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-logo-img {
  width: 190px;
  height: auto;
  display: block;
}

.auth-headline {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 2.15rem;
  line-height: 1.14;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 0.65rem;
}

.auth-subhead {
  color: var(--ink-50);
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 1.75rem;
  max-width: 38ch;
}

/* Icon-accented inputs */
.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.field-label-row label {
  margin-bottom: 0;
}

.auth-link-small {
  font-size: 0.8rem;
  color: var(--kiwi);
  text-decoration: none;
  font-weight: 600;
}

.auth-link-small:hover {
  text-decoration: underline;
}

.input-icon-wrap {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-30);
  pointer-events: none;
  transition: color 0.2s;
}

.field-icon-group input {
  padding-left: 42px;
}

.field-icon-group input:focus+.input-icon,
.input-icon-wrap:focus-within .input-icon {
  color: var(--kiwi);
}

.auth-submit {
  margin-top: 0.4rem;
  margin-bottom: 1.4rem;
  font-size: 1rem;
  padding: 0.95rem;
}

.auth-switch-text {
  font-size: 0.9rem;
  color: var(--ink-50);
  text-align: center;
}

.auth-switch-text a {
  color: var(--kiwi);
  font-weight: 600;
  text-decoration: none;
}

.auth-switch-text a:hover {
  text-decoration: underline;
}

.auth-success {
  background: var(--kiwi-light) !important;
  color: var(--kiwi-deep) !important;
  border-color: rgba(45, 158, 107, 0.3) !important;
}

/* Signature element: floating scan cards */
.scan-showcase {
  position: relative;
  width: 100%;
  max-width: 300px;
  height: 190px;
  margin-bottom: 1.75rem;
}

.scan-card {
  position: absolute;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 0.7rem 0.85rem;
  text-align: left;
  opacity: 0;
  animation: scanCardIn 0.6s ease both, scanCardFloat 5s ease-in-out infinite;
}

.scan-card-1 {
  top: 0;
  transform: rotate(-3deg);
  animation-delay: 0.1s, 0.7s;
  z-index: 3;
}

.scan-card-2 {
  top: 68px;
  transform: rotate(2deg);
  animation-delay: 0.35s, 0.95s;
  z-index: 2;
  left: 14px;
}

.scan-card-3 {
  top: 136px;
  transform: rotate(-1.5deg);
  animation-delay: 0.6s, 1.2s;
  z-index: 1;
  left: 4px;
}

@keyframes scanCardIn {
  from {
    opacity: 0;
    transform: translateY(16px) rotate(0deg) scale(0.94);
  }

  to {
    opacity: 1;
  }
}

@keyframes scanCardFloat {

  0%,
  100% {
    margin-top: 0;
  }

  50% {
    margin-top: -6px;
  }
}

.scan-emoji {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.scan-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.scan-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scan-kcal {
  font-size: 0.72rem;
  color: var(--ink-50);
  font-weight: 500;
}

.scan-badge {
  position: absolute;
  top: -8px;
  right: -6px;
  background: var(--kiwi);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 7px;
  border-radius: 20px;
  box-shadow: 0 2px 6px rgba(45, 158, 107, 0.4);
}

.showcase-title {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--ink);
  margin-bottom: 0.4rem;
}

.showcase-sub {
  color: var(--ink-50);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1.6rem;
  max-width: 260px;
}

.google-btn {
  width: 100%;
  max-width: 280px;
  background: var(--white);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 600;
  font-size: 0.96rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid var(--border);
  padding: 0.9rem 1.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.google-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

@media (prefers-reduced-motion: reduce) {

  .auth-blob,
  .scan-card {
    animation: none !important;
  }

  .scan-card {
    opacity: 1;
  }

  .auth-container {
    animation: none;
  }
}

/* ── Consolidated responsive auth (replaces prior conflicting blocks) ── */
@media (max-width: 860px) {
  .auth-container {
    flex-direction: column;
    max-width: 460px;
    border-radius: 22px;
  }

  .auth-panel-showcase {
    border-left: none;
    border-top: 1px solid var(--border-soft);
    order: 2;
    padding: 2.25rem 2rem;
  }

  .auth-panel-form {
    order: 1;
    padding: 2.5rem 2rem 2rem;
  }

  .auth-headline {
    font-size: 1.75rem;
  }

  .scan-showcase {
    max-width: 260px;
    height: 170px;
    margin-bottom: 1.4rem;
  }
}

@media (max-width: 480px) {
  .auth-shell {
    padding: 1rem;
  }

  .auth-container {
    border-radius: 18px;
  }

  .auth-panel-form {
    padding: 2rem 1.35rem 1.75rem;
  }

  .auth-panel-showcase {
    padding: 1.75rem 1.35rem;
  }

  .auth-headline {
    font-size: 1.55rem;
  }

  .auth-subhead {
    max-width: none;
    font-size: 0.92rem;
    margin-bottom: 1.4rem;
  }

  .auth-logo-img {
    width: 160px;
  }

  /* Prioritize the actual sign-in task on small screens — condense the
     showcase to a single static card instead of the full 3-card stack. */
  .scan-showcase {
    height: 76px;
    max-width: 100%;
    margin-bottom: 1.1rem;
  }

  .scan-card-2,
  .scan-card-3 {
    display: none;
  }

  .scan-card-1 {
    position: relative;
    top: 0;
    transform: none;
    animation: none;
    opacity: 1;
    width: 100%;
  }

  .showcase-title {
    font-size: 1.15rem;
  }

  .showcase-sub {
    font-size: 0.85rem;
    margin-bottom: 1.2rem;
  }
}

/* Tier 1 New Feature Styles */
.scan-btn {
  padding: 8px 14px;
  border-radius: var(--radius-md, 8px);
  border: none;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.scan-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.scan-btn:active {
  transform: translateY(0) scale(0.98);
}

.scan-btn.green {
  background: linear-gradient(135deg, #3ecf8e, #2d9e6b);
  color: #0a0f0d;
  box-shadow: 0 4px 14px rgba(62, 207, 142, 0.25);
}

.scan-btn.orange {
  background: linear-gradient(135deg, #f5a623, #d48806);
  color: #0a0f0d;
  box-shadow: 0 4px 14px rgba(245, 166, 35, 0.25);
}

.scan-btn.blue {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.25);
}

.scan-btn.purple {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.25);
}

.scan-btn.gold {
  background: linear-gradient(135deg, #eab308, #ca8a04);
  color: #0a0f0d;
  box-shadow: 0 4px 14px rgba(234, 179, 8, 0.25);
}

.scan-btn.muted {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

@keyframes voicePulse {
  0% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.4;
    transform: scale(1.15);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.voice-pulse {
  display: inline-block;
  animation: voicePulse 1.2s infinite;
}

.tpl-card {
  min-width: 150px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.tpl-card:hover {
  background: rgba(62, 207, 142, 0.12);
  border-color: rgba(62, 207, 142, 0.3);
}

.tpl-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  margin-bottom: 3px;
}

.tpl-sub {
  font-size: 0.72rem;
  color: var(--mist, #a0aec0);
}

/* ── Auth Split-Screen Mobile & Tablet (≤860px) ── */
@media (max-width: 860px) {
  .auth-split-wrapper {
    flex-direction: column;
    min-height: 100vh;
    background: #0A0F0D;
  }

  .auth-split-left {
    flex: none;
    min-height: 260px;
    padding: 1.5rem 1rem;
    border-right: none;
    border-bottom: 1px solid rgba(62, 207, 142, 0.18);
    background: radial-gradient(circle at center, rgba(62, 207, 142, 0.15) 0%, rgba(10, 15, 13, 0.98) 75%);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .auth-3d-canvas-wrap {
    max-width: 260px;
    height: 260px;
    margin: 0 auto;
  }

  .auth-split-right {
    flex: 1;
    padding: 2rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0A0F0D;
  }

  .auth-card {
    max-width: 440px;
    width: 100%;
    padding: 2.2rem 1.8rem;
    border-radius: 20px;
    background: rgba(15, 23, 18, 0.95);
    border: 1px solid rgba(62, 207, 142, 0.2);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.65);
  }
}

/* ── Small Mobile Screens (≤600px) ── */
@media (max-width: 600px) {
  .auth-split-left {
    min-height: 200px;
    padding: 1rem 0.5rem;
  }

  .auth-3d-canvas-wrap {
    max-width: 200px;
    height: 200px;
  }

  .auth-split-right {
    padding: 1.5rem 1rem;
    min-height: auto;
    background: radial-gradient(circle at 50% 15%, rgba(62, 207, 142, 0.08), transparent 70%), #0A0F0D;
  }

  .auth-card {
    padding: 1.8rem 1.35rem;
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  }

  .auth-headline {
    font-size: 1.35rem !important;
    line-height: 1.25;
  }

  .auth-subhead {
    font-size: 0.82rem !important;
    margin-bottom: 1.2rem !important;
  }

  .auth-tabs {
    border-radius: 10px;
    margin-bottom: 1.2rem;
  }

  .auth-tab {
    font-size: 0.82rem;
    padding: 9px 0;
  }

  .field-group label {
    font-size: 0.76rem;
    margin-bottom: 4px;
  }

  .field-group input {
    font-size: 16px !important; /* Prevents iOS auto-zoom */
    padding: 12px 14px 12px 38px;
    height: 48px;
  }

  .auth-submit,
  .google-btn {
    height: 48px;
    font-size: 0.92rem;
    border-radius: 12px;
  }

  /* Mobile Dashboard Polish */
  .greeting h2 {
    font-size: 1.35rem;
  }

  .stats-row {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .stat-card-ring {
    padding: 1rem 1.1rem;
  }

  /* Micro grid 2-col on mobile */
  #microGridContainer {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  /* Assistant Floating Pill above Bottom Nav */
  #quickAssistantBar {
    bottom: 74px !important;
    right: 12px !important;
  }

  #nutribotBtn {
    bottom: 74px !important;
    right: 12px !important;
  }

  #nutribotPanel {
    bottom: 74px !important;
    right: 8px !important;
    left: 8px !important;
    width: auto !important;
    max-width: none !important;
    height: 72vh !important;
  }

  /* Mobile Topbar */
  .mobile-topbar {
    padding: 10px 14px;
  }
}

/* ── Small Mobile Screens (≤480px) ── */
@media (max-width: 480px) {
  .page {
    padding: 1rem 0.85rem !important;
  }

  .stat-ring-row {
    gap: 6px;
  }

  .goal-ring-wrap svg {
    width: 44px;
    height: 44px;
  }

  .water-btn-row {
    flex-wrap: wrap;
    gap: 6px;
  }

  .water-quick-btn {
    flex: 1;
    min-width: 80px;
    padding: 8px 10px;
    font-size: 0.8rem;
  }
}

@keyframes bboxFadeIn {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ══════════════════════════════════════════════════
   3D INTERACTIVE MACRO SPLIT VISUALIZER
══════════════════════════════════════════════════ */
.macro-3d-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(22, 34, 27, 0.85), rgba(15, 23, 18, 0.95)) !important;
  border: 1px solid rgba(62, 207, 142, 0.18) !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

.macro-badge-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(62, 207, 142, 0.12);
  border: 1px solid rgba(62, 207, 142, 0.25);
  color: #3ecf8e;
  letter-spacing: 0.04em;
}

.macro-pills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
  margin-bottom: 12px;
}

.macro-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: default;
}

.macro-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.macro-pill.pill-pro {
  border-color: rgba(127, 184, 212, 0.25);
  background: linear-gradient(135deg, rgba(127, 184, 212, 0.08), transparent);
}

.macro-pill.pill-pro:hover {
  border-color: rgba(127, 184, 212, 0.6);
  box-shadow: 0 6px 18px rgba(127, 184, 212, 0.2);
}

.macro-pill.pill-carb {
  border-color: rgba(245, 166, 35, 0.25);
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.08), transparent);
}

.macro-pill.pill-carb:hover {
  border-color: rgba(245, 166, 35, 0.6);
  box-shadow: 0 6px 18px rgba(245, 166, 35, 0.2);
}

.macro-pill.pill-fat {
  border-color: rgba(244, 97, 58, 0.25);
  background: linear-gradient(135deg, rgba(244, 97, 58, 0.08), transparent);
}

.macro-pill.pill-fat:hover {
  border-color: rgba(244, 97, 58, 0.6);
  box-shadow: 0 6px 18px rgba(244, 97, 58, 0.2);
}

.macro-pill-icon {
  font-size: 1.15rem;
}

.macro-pill-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.macro-pill-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--mist);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.macro-pill-val {
  font-size: 0.82rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.macro-chart-3d-wrap {
  position: relative;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.macro-chart-center-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle, #142018 0%, #0a0f0d 90%);
  border: 2px solid rgba(62, 207, 142, 0.35);
  box-shadow: 0 0 24px rgba(62, 207, 142, 0.2), inset 0 0 16px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
  transition: all 0.3s ease;
}

.hub-label {
  font-size: 0.58rem;
  font-weight: 800;
  color: var(--mist);
  letter-spacing: 0.1em;
  opacity: 0.7;
}

.hub-cals {
  font-family: 'Fraunces', serif;
  font-size: 1.25rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
  text-shadow: 0 0 12px rgba(62, 207, 142, 0.4);
}

.hub-unit {
  font-size: 0.62rem;
  font-weight: 700;
  color: #3ecf8e;
}

.macro-secondary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sec-micro-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.72rem;
}

.sec-micro-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sec-micro-label {
  color: var(--mist);
  font-weight: 600;
}

.sec-micro-val {
  color: #fff;
  font-weight: 800;
}

/* ══════════════════════════════════════════════════
   HIGH-TECH AUDIO WAVEFORM HUD
══════════════════════════════════════════════════ */
.voice-waveform-hud {
  margin-top: 0.8rem;
  padding: 1rem 1.2rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(160, 120, 200, 0.14), rgba(15, 23, 18, 0.95));
  border: 1px solid rgba(160, 120, 200, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), inset 0 0 16px rgba(160, 120, 200, 0.1);
  animation: hudPulse 2s infinite alternate ease-in-out;
}

@keyframes hudPulse {
  0% {
    border-color: rgba(160, 120, 200, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), inset 0 0 12px rgba(160, 120, 200, 0.08);
  }
  100% {
    border-color: rgba(160, 120, 200, 0.6);
    box-shadow: 0 8px 30px rgba(160, 120, 200, 0.2), inset 0 0 20px rgba(160, 120, 200, 0.18);
  }
}

.voice-hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 0.8rem;
}

.voice-recording-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(244, 97, 58, 0.2);
  border: 1px solid rgba(244, 97, 58, 0.4);
  color: #ff6b6b;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 8px;
}

.voice-pulse-ring {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f4613a;
  animation: pulseDot 1s infinite alternate;
}

@keyframes pulseDot {
  0% { transform: scale(0.8); opacity: 0.6; }
  100% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 8px #f4613a; }
}

.voice-status-text {
  font-size: 0.82rem;
  color: #e0e6e2;
  font-weight: 500;
  flex: 1;
  text-align: left;
}

.voice-stop-btn {
  padding: 5px 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, #a078c8, #7f5af0);
  border: none;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(127, 90, 240, 0.35);
  transition: transform 0.2s, filter 0.2s;
}

.voice-stop-btn:hover {
  transform: scale(1.04);
  filter: brightness(1.15);
}

.voice-bars-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 38px;
  padding: 4px 0;
}

.voice-bar {
  width: 4px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to top, #3ecf8e, #a078c8, #f5a623);
  animation: voiceBarDance 1.2s infinite ease-in-out;
}

.voice-bar:nth-child(1)  { animation-delay: 0.05s; height: 10px; }
.voice-bar:nth-child(2)  { animation-delay: 0.15s; height: 16px; }
.voice-bar:nth-child(3)  { animation-delay: 0.25s; height: 24px; }
.voice-bar:nth-child(4)  { animation-delay: 0.35s; height: 32px; }
.voice-bar:nth-child(5)  { animation-delay: 0.45s; height: 28px; }
.voice-bar:nth-child(6)  { animation-delay: 0.10s; height: 18px; }
.voice-bar:nth-child(7)  { animation-delay: 0.30s; height: 34px; }
.voice-bar:nth-child(8)  { animation-delay: 0.50s; height: 26px; }
.voice-bar:nth-child(9)  { animation-delay: 0.20s; height: 36px; }
.voice-bar:nth-child(10) { animation-delay: 0.40s; height: 22px; }
.voice-bar:nth-child(11) { animation-delay: 0.15s; height: 30px; }
.voice-bar:nth-child(12) { animation-delay: 0.35s; height: 18px; }
.voice-bar:nth-child(13) { animation-delay: 0.05s; height: 26px; }
.voice-bar:nth-child(14) { animation-delay: 0.25s; height: 20px; }
.voice-bar:nth-child(15) { animation-delay: 0.45s; height: 14px; }
.voice-bar:nth-child(16) { animation-delay: 0.10s; height: 8px; }

@keyframes voiceBarDance {
  0%, 100% {
    transform: scaleY(0.4);
    opacity: 0.4;
  }
  50% {
    transform: scaleY(1.3);
    opacity: 1;
    filter: drop-shadow(0 0 6px #3ecf8e);
  }
}

/* ══════════════════════════════════════════════════
   NATIVE MOBILE UI/UX MASTER REDESIGN
   Elevating Mobile Experience to Tier-1 Consumer Standard
   ══════════════════════════════════════════════════ */

/* ── Mobile Quick Actions Bar ── */
.mobile-quick-actions {
  display: none; /* hidden on desktop */
}

@media (max-width: 900px) {
  .mobile-quick-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px 14px;
    margin-bottom: 1rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-quick-actions::-webkit-scrollbar {
    display: none;
  }

  .mob-quick-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50px;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
  }

  .mob-quick-btn:active {
    transform: scale(0.94);
  }

  .mob-quick-btn.mob-quick-scan {
    background: linear-gradient(135deg, rgba(62, 207, 142, 0.25), rgba(45, 158, 107, 0.15));
    border-color: rgba(62, 207, 142, 0.45);
    color: #3ecf8e;
    box-shadow: 0 4px 12px rgba(62, 207, 142, 0.15);
  }

  .mob-quick-btn.mob-quick-water {
    background: linear-gradient(135deg, rgba(91, 192, 235, 0.2), rgba(2, 136, 209, 0.12));
    border-color: rgba(91, 192, 235, 0.4);
    color: #5bc0eb;
  }

  .mq-icon {
    font-size: 1rem;
    line-height: 1;
  }

  /* ── Native Mobile Topbar ── */
  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(10, 15, 13, 0.88) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border-bottom: 1px solid rgba(62, 207, 142, 0.15) !important;
    position: sticky;
    top: 0;
    z-index: 900;
  }

  .mobile-topbar .nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  /* ── Native Floating Bottom Navigation Bar ── */
  .mobile-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 950;
    background: rgba(10, 15, 13, 0.92) !important;
    backdrop-filter: blur(28px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(200%) !important;
    border-top: 1px solid rgba(62, 207, 142, 0.2) !important;
    box-shadow: 0 -10px 36px rgba(0, 0, 0, 0.7) !important;
    padding: 6px 8px max(10px, env(safe-area-inset-bottom, 10px)) !important;
    justify-content: space-around;
  }

  .mob-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 2px;
    border-radius: 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
  }

  .mob-nav-btn.active {
    background: rgba(62, 207, 142, 0.12);
  }

  .mob-nav-btn.active .mob-nav-icon {
    transform: translateY(-2px) scale(1.12);
    filter: drop-shadow(0 2px 8px rgba(62, 207, 142, 0.5));
  }

  .mob-nav-btn.active .mob-nav-label {
    color: #3ecf8e !important;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(62, 207, 142, 0.4);
  }

  /* ── Mobile Layout & Card Aesthetics ── */
  .page {
    padding: 1rem 0.9rem calc(76px + env(safe-area-inset-bottom, 12px)) !important;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .glass-card,
  .stat-card,
  .macro-3d-card {
    border-radius: 18px !important;
    padding: 1.15rem 1rem !important;
    margin-bottom: 1rem !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: linear-gradient(145deg, rgba(18, 28, 22, 0.85), rgba(12, 18, 14, 0.95)) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
  }

  .greeting h2 {
    font-size: 1.35rem !important;
    line-height: 1.25;
  }

  /* ── Mobile Modal Bottom-Sheet Transformation ── */
  .modal-overlay,
  .dp-overlay {
    align-items: flex-end !important;
    justify-content: center !important;
    padding: 0 !important;
  }

  .modal-box,
  .dp-panel,
  .recipe-modal-box,
  .ach-modal-box {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 88dvh !important;
    border-radius: 24px 24px 0 0 !important;
    border-bottom: none !important;
    margin: 0 !important;
    animation: sheetSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) both !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 1.5rem 1.1rem max(1.5rem, env(safe-area-inset-bottom, 1.5rem)) !important;
    position: relative;
  }

  .modal-box::before,
  .dp-panel::before,
  .recipe-modal-box::before {
    content: '';
    position: sticky;
    top: -1.2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.25);
    display: block;
    margin: 0 auto 12px;
  }

  /* ── Mobile Food Cards & Search Ergonomics ── */
  .food-card {
    padding: 12px 14px !important;
    border-radius: 14px !important;
  }

  .food-card-action button,
  .food-add-btn {
    min-width: 44px !important;
    min-height: 44px !important;
    border-radius: 12px !important;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* ── Mobile Viewfinder & Camera ── */
  .cam-area {
    border-radius: 18px !important;
    min-height: 220px !important;
  }

  /* ── Assistant Floating Button Safe Area ── */
  #nutribotBtn {
    bottom: calc(76px + env(safe-area-inset-bottom, 10px)) !important;
    right: 12px !important;
    width: 52px !important;
    height: 52px !important;
    box-shadow: 0 8px 24px rgba(62, 207, 142, 0.4) !important;
  }
}

@keyframes sheetSlideUp {
  from {
    transform: translateY(100%);
    opacity: 0.5;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
