/* ==========================================
   CLASSIC FITNESS GYM — CALORIE CALCULATOR CSS
   Tab App Layout — Clean, Professional, Mobile-first
   ========================================== */

/* ===== HERO ===== */
.cal-hero {
  position: relative;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 40%, #0f172a 100%);
  padding: 100px 0 60px;
  overflow: hidden;
  text-align: center;
}
.cal-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(249,115,22,0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(234,179,8,0.10) 0%, transparent 50%);
  pointer-events: none;
}
.cal-hero-content { position: relative; z-index: 1; }
.cal-hero-badge {
  display: inline-block;
  background: rgba(249,115,22,0.15);
  color: #fb923c;
  border: 1px solid rgba(249,115,22,0.3);
  border-radius: 50px;
  padding: 6px 18px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.cal-hero-content h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900;
  color: #fff;
  margin-bottom: 14px;
  line-height: 1.15;
}
.cal-hero-content p {
  color: #94a3b8;
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto 28px;
  line-height: 1.65;
}
.cal-hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
.cal-hero-stat { text-align: center; padding: 0 28px; }
.cal-hero-stat-num {
  display: block;
  font-size: 1.7rem;
  font-weight: 900;
  color: #f97316;
  line-height: 1;
  margin-bottom: 4px;
}
.cal-hero-stat-lbl {
  font-size: 0.78rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.cal-hero-stat-divider {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,0.1);
  flex-shrink: 0;
}

/* ===== APP WRAPPER ===== */
.cal-section {
  background: #f1f5f9;
  min-height: 80vh;
  padding: 0 0 60px;
}
.cal-app-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== STICKY TOP MACRO BAR ===== */
.cal-topbar {
  background: #fff;
  border-radius: 0 0 16px 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  border: 1px solid #e2e8f0;
  border-top: none;
  position: sticky;
  top: 68px;
  z-index: 200;
  margin-bottom: 16px;
}
.cal-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  flex-wrap: wrap;
  gap: 6px;
}
.cal-topbar-macro {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 14px;
  min-width: 60px;
}
.cal-topbar-num {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
  margin-bottom: 2px;
}
.cal-topbar-lbl {
  font-size: 0.68rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cal-topbar-divider {
  width: 1px;
  height: 28px;
  background: #e2e8f0;
  flex-shrink: 0;
}
.cal-topbar-reset {
  margin-left: auto;
  background: #fef2f2;
  color: #ef4444;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.cal-topbar-reset:hover { background: #ef4444; color: #fff; border-color: #ef4444; }

/* ===== TAB NAVIGATION ===== */
.cal-tab-nav {
  display: flex;
  background: #fff;
  border-radius: 14px;
  padding: 6px;
  gap: 4px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border: 1px solid #e2e8f0;
  margin-bottom: 16px;
  position: sticky;
  top: 124px;
  z-index: 190;
}
.cal-tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 8px;
  border: none;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.cal-tab-btn:hover { background: #f8fafc; }
.cal-tab-btn.active {
  background: #f97316;
  box-shadow: 0 2px 8px rgba(249,115,22,0.3);
}
.cal-tab-icon {
  font-size: 1.1rem;
  line-height: 1;
}
.cal-tab-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cal-tab-btn.active .cal-tab-label { color: #fff; }
.cal-tab-badge {
  position: absolute;
  top: 6px;
  right: 12px;
  background: #ef4444;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  border-radius: 10px;
  padding: 1px 5px;
  min-width: 16px;
  text-align: center;
}

/* ===== TAB PANELS ===== */
.cal-tab-panel { display: none; }
.cal-tab-panel.active { display: block; }
.cal-panel-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ===== CARD BASE ===== */
.cal-card, .cal-add-card, .cal-goal-card, .cal-tip-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border: 1px solid #e2e8f0;
  padding: 20px;
}
.cal-add-card-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}

/* ===== SEARCH BOX ===== */
.cal-search-box-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border: 1.5px solid #e2e8f0;
  transition: border-color 0.2s;
  overflow: hidden;
}
.cal-search-box-wrap:focus-within {
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249,115,22,0.1);
}
.cal-search-icon {
  position: absolute;
  left: 14px;
  font-size: 1rem;
  pointer-events: none;
  z-index: 1;
}
.cal-search-input {
  width: 100%;
  padding: 14px 40px 14px 42px;
  border: none;
  font-size: 0.95rem;
  font-family: inherit;
  color: #0f172a;
  background: transparent;
  outline: none;
}
.cal-search-input::placeholder { color: #94a3b8; }
.cal-search-clear {
  position: absolute;
  right: 12px;
  background: #f1f5f9;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 4px 7px;
  border-radius: 6px;
  transition: all 0.2s;
}
.cal-search-clear:hover { background: #ef4444; color: #fff; }

/* ===== CATEGORY PILLS ===== */
.cal-category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cal-pill {
  background: #fff;
  color: #475569;
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  padding: 5px 13px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.cal-pill:hover { border-color: #f97316; color: #f97316; }
.cal-pill.active { background: #f97316; color: #fff; border-color: #f97316; box-shadow: 0 2px 8px rgba(249,115,22,0.25); }

/* ===== SECTION TITLES ===== */
.cal-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 10px;
}

/* ===== RECENT SECTION ===== */
.cal-recent-section { background: #fff; border-radius: 14px; padding: 14px 16px; border: 1px solid #e2e8f0; }
.cal-recent-list { display: flex; flex-wrap: wrap; gap: 6px; }
.cal-recent-item {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  transition: all 0.15s;
}
.cal-recent-item:hover { background: #fff7ed; border-color: #f97316; color: #f97316; }

/* ===== POPULAR CHIPS ===== */
.cal-popular-section { background: #fff; border-radius: 14px; padding: 14px 16px; border: 1px solid #e2e8f0; }
.cal-popular-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cal-pop-chip {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  padding: 7px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
}
.cal-pop-chip:hover { background: #0f172a; color: #fff; border-color: #0f172a; }

/* ===== SEARCH RESULTS ===== */
.cal-results {
  background: #fff;
  border-radius: 14px;
  border: 1.5px solid #e2e8f0;
  max-height: 360px;
  overflow-y: auto;
}
.cal-results::-webkit-scrollbar { width: 4px; }
.cal-results::-webkit-scrollbar-track { background: #f8fafc; }
.cal-results::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
.cal-results-placeholder {
  text-align: center;
  padding: 36px 16px;
  color: #94a3b8;
  font-size: 0.88rem;
}
.cal-results-placeholder-icon { font-size: 2.5rem; margin-bottom: 10px; }
.cal-results-placeholder-sub { font-size: 0.74rem; color: #cbd5e1; margin-top: 6px; }

/* Result Item */
.cal-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.15s;
}
.cal-result-item:last-child { border-bottom: none; }
.cal-result-item:hover { background: #fff7ed; }
.cal-result-item.selected { background: #fff7ed; border-left: 3px solid #f97316; }
.cal-result-left { flex: 1; }
.cal-result-name { font-size: 0.88rem; font-weight: 700; color: #0f172a; margin-bottom: 2px; }
.cal-result-meta { font-size: 0.72rem; color: #94a3b8; }
.cal-result-cal { font-size: 0.92rem; font-weight: 800; color: #f97316; white-space: nowrap; margin-left: 10px; }
.cal-result-unit { font-size: 0.68rem; color: #94a3b8; font-weight: 400; }
.cal-no-results { text-align: center; padding: 24px; color: #94a3b8; font-size: 0.88rem; }

/* ===== ADD CARD ===== */
.cal-add-card { border-color: #fed7aa; }
.cal-selected-food {
  background: #fff7ed;
  border: 1.5px solid #fed7aa;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}
.cal-selected-name { font-size: 1rem; font-weight: 800; color: #0f172a; margin-bottom: 4px; }
.cal-selected-unit { font-size: 0.78rem; color: #94a3b8; margin-bottom: 10px; }
.cal-selected-macros {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.cal-sel-macro {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border-radius: 8px;
  padding: 8px 4px;
  border: 1.5px solid #e2e8f0;
}
.cal-sel-val { font-size: 1rem; font-weight: 800; color: #0f172a; line-height: 1; margin-bottom: 3px; }
.cal-sel-lbl { font-size: 0.62rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; }
.cal-sel-sugar .cal-sel-val { color: #ca8a04; }
.cal-sel-sugar { border-color: #fef08a; background: #fefce8; }

/* Add Row */
.cal-add-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.cal-add-field {}
.cal-label { font-size: 0.78rem; font-weight: 700; color: #475569; margin-bottom: 6px; display: block; }
.cal-qty-row { display: flex; align-items: center; gap: 8px; }
.cal-qty-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
  font-size: 1.1rem; font-weight: 700;
  color: #475569; cursor: pointer;
  transition: all 0.15s;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cal-qty-btn:hover { border-color: #f97316; color: #f97316; }
.cal-qty-input {
  width: 70px; text-align: center;
  padding: 8px; border: 2px solid #e2e8f0; border-radius: 8px;
  font-size: 1rem; font-weight: 700; color: #0f172a; outline: none; font-family: inherit;
}
.cal-qty-input:focus { border-color: #f97316; }
.cal-meal-select-wrap { position: relative; }
.cal-meal-select {
  width: 100%; padding: 9px 12px;
  border: 2px solid #e2e8f0; border-radius: 8px;
  font-size: 0.86rem; font-family: inherit; color: #0f172a;
  background: #f8fafc; outline: none; cursor: pointer; transition: border-color 0.2s;
}
.cal-meal-select:focus { border-color: #f97316; }

/* Gram Toggle */
.cal-gram-toggle { margin-bottom: 12px; font-size: 0.8rem; color: #64748b; }
.cal-gram-toggle label { display: flex; align-items: center; gap: 8px; cursor: pointer; }

/* Preview */
.cal-preview {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.cal-preview-item { display: flex; flex-direction: column; align-items: center; }
.cal-preview-val { font-size: 1.05rem; font-weight: 800; color: #16a34a; line-height: 1; margin-bottom: 2px; }
.cal-preview-lbl { font-size: 0.66rem; color: #4ade80; text-transform: uppercase; letter-spacing: 0.04em; }
.cal-preview-sugar .cal-preview-val { color: #ca8a04; }

/* Add Button */
.cal-add-btn {
  width: 100%;
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff; border: none; border-radius: 10px;
  padding: 13px; font-size: 0.95rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.cal-add-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(249,115,22,0.35); }
.cal-add-btn:active { transform: translateY(0); }

/* ===== ENTRY ANIMATION ===== */
.cal-animate-in { animation: fadeSlideIn 0.25s ease; }
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== MEAL SECTIONS ===== */
.cal-meals { display: flex; flex-direction: column; gap: 10px; }
.cal-meal-section {
  background: #fff;
  border-radius: 14px;
  border: 1.5px solid #e2e8f0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.cal-meal-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; cursor: pointer; user-select: none;
  background: #fff;
}
.cal-meal-header:hover { background: #f8fafc; }
.cal-meal-icon { font-size: 1.3rem; flex-shrink: 0; }
.cal-meal-info { flex: 1; }
.cal-meal-name { font-size: 0.9rem; font-weight: 800; color: #0f172a; line-height: 1; margin-bottom: 2px; }
.cal-meal-total { font-size: 0.78rem; color: #f97316; font-weight: 700; }
.cal-meal-toggle {
  background: none; border: none; cursor: pointer;
  font-size: 1rem; color: #94a3b8; padding: 4px;
  border-radius: 4px; transition: transform 0.2s;
}
.cal-meal-section.collapsed .cal-meal-toggle { transform: rotate(-90deg); }
.cal-meal-items {
  border-top: 1px solid #f1f5f9;
  padding: 6px 0;
}
.cal-meal-section.collapsed .cal-meal-items { display: none; }
.cal-meal-empty {
  text-align: center; padding: 16px;
  color: #94a3b8; font-size: 0.82rem; font-style: italic;
}

/* Log Item */
.cal-log-item {
  display: flex; align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid #f8fafc;
  gap: 10px;
  background: #fff;
  animation: fadeInItem 0.25s ease;
}
@keyframes fadeInItem {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}
.cal-log-item:last-child { border-bottom: none; }
.cal-log-info { flex: 1; }
.cal-log-name { font-size: 0.84rem; font-weight: 700; color: #0f172a; margin-bottom: 2px; }
.cal-log-qty { font-size: 0.72rem; color: #94a3b8; font-weight: 400; }
.cal-log-sub { font-size: 0.71rem; color: #94a3b8; }
.cal-log-sugar { color: #ca8a04; font-weight: 600; }
.cal-log-cal { font-size: 0.88rem; font-weight: 800; color: #f97316; white-space: nowrap; }
.cal-log-delete {
  background: none; border: none; cursor: pointer;
  color: #cbd5e1; font-size: 0.85rem; padding: 4px 6px;
  border-radius: 4px; transition: color 0.15s; line-height: 1;
}
.cal-log-delete:hover { color: #ef4444; }

/* Go to Search Button */
.cal-goto-search-btn {
  width: 100%;
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  color: #64748b;
  border-radius: 12px;
  padding: 14px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.cal-goto-search-btn:hover { border-color: #f97316; color: #f97316; background: #fff7ed; }

/* ===== SUMMARY TAB ===== */

/* Goal Card */
.cal-goal-card { margin-bottom: 0; }
.cal-goal-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;
}
.cal-goal-label { font-size: 0.82rem; font-weight: 700; color: #475569; }
.cal-goal-input {
  width: 90px; text-align: right;
  border: 1.5px solid #e2e8f0; border-radius: 8px;
  padding: 5px 10px; font-size: 0.9rem; font-weight: 700;
  color: #0f172a; font-family: inherit; outline: none;
}
.cal-goal-input:focus { border-color: #f97316; }
.cal-goal-bar {
  width: 100%; height: 10px;
  background: #f1f5f9; border-radius: 20px; overflow: hidden; margin-bottom: 8px;
}
.cal-goal-progress {
  height: 100%; width: 0%;
  background: linear-gradient(90deg,#4CAF50,#8BC34A);
  transition: width 0.4s ease;
  border-radius: 20px;
}
.cal-goal-text { font-size: 0.8rem; color: #64748b; font-weight: 600; }

/* Summary Hero */
.cal-summary-hero {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.cal-summary-total-big { }
.cal-summary-total-big span:first-child {
  display: block;
  font-size: 3.2rem;
  font-weight: 900;
  color: #0f172a;
  line-height: 1;
}
.cal-summary-unit {
  display: block;
  font-size: 0.78rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 4px;
}
.cal-chart-wrap {
  width: 150px;
  height: 150px;
  flex-shrink: 0;
}
.cal-chart-wrap canvas { max-width: 150px !important; max-height: 150px !important; }

/* Macro Bars */
.cal-macro-bars {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cal-macro-row {}
.cal-macro-label {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px; font-size: 0.82rem; color: #475569;
}
.cal-macro-dot {
  width: 10px; height: 10px;
  border-radius: 50%; flex-shrink: 0;
}
.cal-macro-dot.protein { background: #3b82f6; }
.cal-macro-dot.carbs   { background: #f59e0b; }
.cal-macro-dot.fat     { background: #ef4444; }
.cal-macro-dot.fiber   { background: #22c55e; }
.cal-macro-dot.sugar   { background: #eab308; }
.cal-macro-val { margin-left: auto; font-weight: 700; color: #0f172a; }
.cal-macro-bar-track {
  height: 7px; background: #f1f5f9;
  border-radius: 10px; overflow: hidden;
}
.cal-macro-bar-fill {
  height: 100%; border-radius: 10px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 0%; max-width: 100%;
}
.cal-macro-bar-fill.protein { background: #3b82f6; }
.cal-macro-bar-fill.carbs   { background: #f59e0b; }
.cal-macro-bar-fill.fat     { background: #ef4444; }
.cal-macro-bar-fill.fiber   { background: #22c55e; }
.cal-macro-bar-fill.sugar   { background: linear-gradient(90deg, #eab308, #ca8a04); }

/* Save Row */
.cal-save-row { display: flex; gap: 10px; }
.cal-save-btn {
  flex: 1; background: #0f172a; color: #fff; border: none;
  border-radius: 10px; padding: 12px; font-size: 0.88rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.cal-save-btn:hover { background: #1e293b; transform: translateY(-1px); }
.cal-reset-btn-full {
  background: #fef2f2; color: #ef4444; border: 1.5px solid #fecaca;
  border-radius: 10px; padding: 12px 16px; font-size: 0.88rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.cal-reset-btn-full:hover { background: #ef4444; color: #fff; border-color: #ef4444; }
.cal-saved-notice {
  background: #f0fdf4; border: 1px solid #bbf7d0; color: #16a34a;
  border-radius: 8px; padding: 10px 14px; font-size: 0.82rem;
  font-weight: 600; text-align: center;
}

/* Tip Card */
.cal-tip-card {
  text-align: center;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  border-color: transparent;
}
.cal-tip-icon { font-size: 2rem; margin-bottom: 10px; }
.cal-tip-card h3 { color: #fff; font-size: 1rem; font-weight: 800; margin-bottom: 8px; }
.cal-tip-card p { color: #94a3b8; font-size: 0.84rem; line-height: 1.6; margin-bottom: 16px; }
.cal-tip-btn {
  display: inline-block;
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff; border-radius: 8px;
  padding: 10px 22px; font-size: 0.88rem; font-weight: 700;
  text-decoration: none; transition: all 0.2s;
}
.cal-tip-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(249,115,22,0.35); color: #fff; }

/* ===== LOADING ===== */
.cal-loading {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 36px 16px; gap: 14px;
  color: #94a3b8; font-size: 0.85rem;
}
.cal-spinner {
  width: 32px; height: 32px;
  border: 3px solid #f1f5f9;
  border-top-color: #f97316;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 30px; left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: #e2e5ec;
  color: #fff; border-radius: 14px;
  padding: 14px 18px; display: none; align-items: center;
  gap: 10px; font-size: 0.88rem; font-weight: 600;
  opacity: 0; transition: all 0.35s ease; z-index: 9999;
  pointer-events: none; white-space: nowrap;
  border-left: 4px solid #22c55e;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}
.toast.show { display: flex; opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== NAV CALORIE LINK ===== */
.nav-link-calorie {
  background: linear-gradient(135deg, #16a34a, #15803d) !important;
  color: #fff !important;
  border-radius: 6px;
  padding: 5px 12px !important;
  font-weight: 700 !important;
  transition: all 0.2s;
}
.nav-link-calorie:hover { opacity: 0.9; transform: translateY(-1px); }

/* ===== MOBILE ===== */
@media (max-width: 600px) {
  .cal-hero { padding: 80px 0 40px; }
  .cal-hero-stat { padding: 0 16px; }
  .cal-topbar { top: 58px; }
  .cal-topbar-inner { padding: 10px 12px; gap: 4px; }
  .cal-topbar-macro { padding: 0 8px; min-width: 50px; }
  .cal-topbar-num { font-size: 1.05rem; }
  .cal-topbar-lbl { font-size: 0.62rem; }
  .cal-tab-nav { top: 112px; }
  .cal-add-row { grid-template-columns: 1fr; }
  .cal-summary-hero { flex-direction: column; align-items: flex-start; }
  .cal-chart-wrap { width: 100%; height: 200px; }
  .cal-chart-wrap canvas { max-width: 200px !important; max-height: 200px !important; margin: 0 auto; display: block; }
}

@media (max-width: 400px) {
  .cal-tab-label { display: none; }
  .cal-tab-btn { padding: 12px; }
  .cal-tab-icon { font-size: 1.3rem; }
}
/* ==========================================
   NEW NUTRIENTS — LOG ITEM TWO-LINE DISPLAY
   ========================================== */
.cal-log-sub-row1 {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 6px;
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 3px;
}

.cal-log-sub-row2 {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 6px;
  font-size: 0.73rem;
  color: #64748b;
  margin-top: 2px;
}

.nl-sep { color: #cbd5e1; margin: 0 1px; }
.nl-p   { color: #f97316; font-weight: 600; }
.nl-c   { color: #3b82f6; font-weight: 600; }
.nl-f   { color: #a855f7; font-weight: 600; }
.nl-fi  { color: #22c55e; }
.nl-su  { color: #eab308; }
.nl-sf  { color: #ef4444; }
.nl-pf  { color: #06b6d4; }
.nl-mf  { color: #8b5cf6; }
.nl-tf  { color: #f43f5e; }
.nl-ch  { color: #f97316; }

/* ==========================================
   FAT SUBGROUP SECTION IN SUMMARY
   ========================================== */
.cal-fat-subgroup {
  margin-top: 16px;
  border-top: 1px solid rgba(0,0,0,0.07);
  padding-top: 14px;
}

.cal-subgroup-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: 12px;
  letter-spacing: 0.01em;
}

/* Macro dot colors for new nutrients */
.cal-macro-dot.satfat     { background: #ef4444; }
.cal-macro-dot.polyfat    { background: #06b6d4; }
.cal-macro-dot.monofat    { background: #8b5cf6; }
.cal-macro-dot.transfat   { background: #f43f5e; }
.cal-macro-dot.cholesterol{ background: #f97316; }

/* Macro bar fill colors for new nutrients */
.cal-macro-bar-fill.satfat     { background: linear-gradient(90deg, #ef4444, #fca5a5); }
.cal-macro-bar-fill.polyfat    { background: linear-gradient(90deg, #06b6d4, #67e8f9); }
.cal-macro-bar-fill.monofat    { background: linear-gradient(90deg, #8b5cf6, #c4b5fd); }
.cal-macro-bar-fill.transfat   { background: linear-gradient(90deg, #f43f5e, #fda4af); }
.cal-macro-bar-fill.cholesterol{ background: linear-gradient(90deg, #f97316, #fdba74); }

/* ==========================================
   EXTENDED PREVIEW GRID (11 nutrients)
   ========================================== */
#addPreview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cal-preview-item {
  min-width: 70px;
  flex: 1 1 70px;
}

.cal-preview-satfat .cal-preview-val { color: #ef4444; }
.cal-preview-trans  .cal-preview-val { color: #f43f5e; }
.cal-preview-chol   .cal-preview-val { color: #f97316; }

/* ==========================================
   BREAKDOWN TABLE CSS (from previous update)
   ========================================== */
.cal-breakdown-section {
  margin: 24px 0 16px;
}
.cal-breakdown-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text, #1a1a2e);
  margin: 0 0 12px;
}
.cal-breakdown-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.cal-breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  min-width: 600px;
}
.cal-breakdown-table thead tr {
  background: linear-gradient(90deg, #f97316, #fb923c);
  color: #fff;
}
.cal-breakdown-table th {
  padding: 9px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 0.78rem;
}
.cal-breakdown-table tbody tr {
  border-bottom: 1px solid rgba(0,0,0,0.05);
  transition: background 0.15s;
}
.cal-breakdown-table tbody tr:last-child { border-bottom: none; }
.cal-breakdown-table tbody tr:hover { background: #fff7ed; }
.cal-breakdown-table td { padding: 9px 10px; color: #374151; }
.cal-bd-meal  { font-weight: 600; color: #111827; white-space: nowrap; }
.cal-bd-cal   { font-weight: 700; color: #f97316; }
.cal-bd-total-row { background: #f9fafb; border-top: 2px solid #f97316 !important; }
.cal-bd-total-row td { padding: 10px; color: #111827; font-size: 0.85rem; }
/* ==========================================
   ACTION ROW — Save / WhatsApp / PDF / Reset
   ========================================== */
.cal-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 12px;
}

.cal-action-btn {
  flex: 1 1 130px;
  padding: 13px 14px;
  border: none;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s;
  white-space: nowrap;
  text-align: center;
}

.cal-action-btn:hover  { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.15); }
.cal-action-btn:active { transform: translateY(0);    opacity: 0.88; }

.cal-btn-save     { background: linear-gradient(135deg,#3b82f6,#2563eb); color:#fff; }
.cal-btn-whatsapp { background: linear-gradient(135deg,#25d366,#128c47); color:#fff; box-shadow: 0 4px 14px rgba(37,211,102,0.25); }
.cal-btn-pdf      { background: linear-gradient(135deg,#f97316,#ea580c); color:#fff; box-shadow: 0 4px 14px rgba(249,115,22,0.25); }
.cal-btn-reset    { background: linear-gradient(135deg,#ef4444,#dc2626); color:#fff; }

@media (max-width: 500px) {
  .cal-action-row     { flex-direction: column; }
  .cal-action-btn     { width: 100%; flex: none; }
}
/* ==========================================
   NEW FEATURES — SOCIAL PROOF BANNER (shared with bmi)
   ========================================== */
.bmi-trust-banner {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 14px 0;
}
.bmi-trust-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
.bmi-trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #475569;
  font-weight: 600;
}
.bmi-trust-item strong { color: #0f172a; }
.bmi-trust-icon { font-size: 16px; }
.bmi-trust-divider {
  width: 1px;
  height: 20px;
  background: #e2e8f0;
  flex-shrink: 0;
}
@media (max-width: 600px) {
  .bmi-trust-inner { gap: 6px; }
  .bmi-trust-divider { display: none; }
  .bmi-trust-item { font-size: 12px; }
}

/* ==========================================
   NEW FEATURES — CALORIE GOAL RING
   ========================================== */
.cal-ring-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 16px auto 12px;
}
.cal-ring-svg {
  width: 100%;
  height: 100%;
}
.cal-ring-progress {
  stroke: #22c55e;
  stroke-dasharray: 314;
  stroke-dashoffset: 314;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.4,0,0.2,1), stroke 0.3s ease;
}
.cal-ring-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 2px;
}
.cal-ring-consumed {
  font-size: 28px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1;
}
.cal-ring-lbl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  font-weight: 700;
}
.cal-ring-remain {
  font-size: 12px;
  font-weight: 800;
  color: #22c55e;
  margin-top: 2px;
}

/* ==========================================
   NEW FEATURES — TAMIL MEAL COMBOS
   ========================================== */
.cal-combos-section {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  padding: 16px 16px 18px;
}
.cal-combos-badge {
  display: inline-block;
  background: #f97316;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}
.cal-combos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.cal-combo-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 12px 12px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  text-align: left;
}
.cal-combo-btn:hover {
  border-color: #f97316;
  background: #fff7ed;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(249,115,22,0.15);
}
.cal-combo-btn.cal-combo-added {
  border-color: #22c55e;
  background: #f0fdf4;
  transform: scale(0.97);
}
.cal-combo-icon { font-size: 18px; line-height: 1; }
.cal-combo-name {
  font-size: 0.78rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}
.cal-combo-cal {
  font-size: 0.72rem;
  font-weight: 700;
  color: #f97316;
}
.cal-combo-items {
  font-size: 0.65rem;
  color: #94a3b8;
  line-height: 1.3;
}
@media (max-width: 600px) {
  .cal-combos-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 360px) {
  .cal-combos-grid { grid-template-columns: 1fr; }
}


  /* ── Live Date & Time Bar ─────────────────────────────────── */
  .datetime-bar {
    background: #12122a;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    padding: 7px 0;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: rgba(255,255,255,0.65);
    position: relative;
    z-index: 1001;
  }
  .datetime-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
  }
  .datetime-left {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,0.5);
  }
  .datetime-right {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
  }
  .datetime-icon { font-size: 13px; }
  .datetime-sep { color: rgba(255,255,255,0.2); font-size: 11px; }
  #liveDate { color: rgba(255,255,255,0.8); font-weight: 600; }
  #liveTime {
    color: #f0c040;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
    min-width: 92px;
    display: inline-block;
  }
  .datetime-phone { color: #6bdfb8; text-decoration: none; font-weight: 600; }
  .datetime-phone:hover { color: #fff; }
  @media (max-width: 640px) {
    .datetime-left { display: none; }
    .datetime-bar-inner { justify-content: center; }
  }
