/* ========================================
   NutriTracker — Redesign 2026
   Mobile-first · Warm dark · Plus Jakarta Sans
   ======================================== */

/* Auth loading - hide page until auth verified */
body.auth-loading {
  opacity: 0;
  pointer-events: none;
}

body.app-body {
  transition: opacity 0.15s ease;
}

/* ── Variables ── */
:root {
  /* Backgrounds */
  --bg: #131318;
  --bg-subtle: #1a1a20;
  --surface: #212129;
  --surface-hover: #2a2a33;
  --surface-active: #33333d;

  /* Borders */
  --border: rgba(255, 255, 255, 0.09);
  --border-hover: rgba(255, 255, 255, 0.16);

  /* Text */
  --text-primary: #f0f0f2;
  --text-secondary: #a1a1aa;
  /* Improved contrast */
  --text-muted: #8b8b96;
  /* Improved contrast (passes WCAG AA) */

  /* Primary — Emerald */
  --primary: #22c55e;
  --primary-dark: #16a34a;
  --primary-light: #4ade80;
  --primary-subtle: rgba(34, 197, 94, 0.10);
  --primary-glow: 0 0 24px rgba(34, 197, 94, 0.18);

  /* Semantic */
  --danger: #ef4444;
  --danger-subtle: rgba(239, 68, 68, 0.10);
  --warning: #f59e0b;

  /* Macro accent colours */
  --color-protein: #fb7185;
  --color-carbs: #60a5fa;
  --color-fat: #fbbf24;
  --color-water: #38bdf8;
  --color-sport: #a78bfa;

  /* Radii */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.30);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-xl: 0 16px 40px rgba(0, 0, 0, 0.40);
}

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

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSy stemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
}

/* ========================================
   LOGIN PAGE
   ======================================== */

.login-body {
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.login-container {
  width: 100%;
  max-width: 420px;
  animation: fadeInUp 0.5s ease-out;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 0 20px rgba(34, 197, 94, 0.2));
}

.login-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
  letter-spacing: -0.03em;
}

.login-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-xl);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}

/* ── Form Fields (login/signup) ── */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.field-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.field-input {
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.field-input::placeholder {
  color: var(--text-muted);
}

.field-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}

.field-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.field-input-number {
  padding-right: 3.5rem;
}

.field-unit {
  position: absolute;
  right: 1rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 700;
  pointer-events: none;
}

.field-error {
  font-size: 0.8125rem;
  color: var(--danger);
  margin-top: 0.125rem;
}

.field-error:empty {
  display: none;
}

/* ── Submit Button ── */
.submit-btn {
  width: 100%;
  padding: 0.9rem;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--r-md);
  color: #4ade80;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  margin-top: 0.25rem;
}

.submit-btn:hover {
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(34, 197, 94, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.1);
}

.submit-btn:active {
  transform: translateY(0);
}

.submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.spinner {
  width: 20px;
  height: 20px;
  animation: spin 0.8s linear infinite;
}

/* ── Auth Tabs ── */
.auth-tabs {
  display: flex;
  background: var(--bg);
  border-radius: var(--r-md);
  padding: 4px;
  margin-bottom: 1.75rem;
  gap: 4px;
}

.auth-tab {
  flex: 1;
  padding: 0.65rem 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: var(--r-sm);
  font-family: inherit;
}

.auth-tab.active {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.auth-tab:hover:not(.active) {
  color: var(--text-secondary);
}

/* ── Auth Error ── */
.auth-error {
  background: var(--danger-subtle);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--r-sm);
  padding: 0.75rem 1rem;
  color: var(--danger);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.auth-error.hidden {
  display: none;
}

/* ── Google OAuth ── */
.google-btn {
  width: 100%;
  padding: 0.8rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  transition: all 0.2s;
  font-family: inherit;
}

.google-btn:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
}

.google-btn svg {
  width: 18px;
  height: 18px;
}

/* ── Auth Separator ── */
.auth-separator {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin: 1.25rem 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
}

.auth-separator::before,
.auth-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Sexe Toggle ── */
.sexe-toggle {
  display: flex;
  gap: 0.625rem;
}

.sexe-option {
  flex: 1;
  cursor: pointer;
}

.sexe-option input[type="radio"] {
  display: none;
}

.sexe-pill {
  display: block;
  text-align: center;
  padding: 0.7rem 0.875rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 600;
  transition: all 0.2s;
}

.sexe-option input[type="radio"]:checked+.sexe-pill {
  border-color: var(--primary);
  background: var(--primary-subtle);
  color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.sexe-pill:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
}

/* ── Form Row Inline ── */
.form-row-inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem;
}

@media (max-width: 360px) {
  .form-row-inline {
    grid-template-columns: 1fr;
  }
}

/* ── Objectif Hint ── */
.objectif-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.375rem -1rem 0;
  padding: 0.5rem 1rem;
  background: rgba(34, 197, 94, 0.06);
  border-top: 1px solid rgba(34, 197, 94, 0.12);
  border-radius: 0 0 var(--r-md) var(--r-md);
}

.objectif-hint-text {
  font-size: 0.75rem;
  color: var(--primary-light);
  font-weight: 600;
  line-height: 1.3;
}

.objectif-hint-btn {
  padding: 0.3rem 0.75rem;
  background: var(--primary);
  border: none;
  border-radius: var(--r-xs);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: inherit;
}

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

.objectif-hint-btn:active {
  transform: scale(0.96);
}

/* ── Onboarding Modal ── */
.modal-onboarding {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(8px);
}

.modal-onboarding.hidden {
  display: none;
}

.onboarding-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 1.75rem;
  width: 100%;
  max-width: 480px;
  max-height: 90dvh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
}

.onboarding-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.onboarding-icon {
  font-size: 2.75rem;
  margin-bottom: 0.625rem;
}

.onboarding-card h2 {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
  letter-spacing: -0.02em;
}

.onboarding-card p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-bottom: 0;
}

.onboarding-card .login-form {
  gap: 1.125rem;
}

.onboarding-card .form-field {
  margin-bottom: 0;
}

/* ========================================
   APP PAGE
   ======================================== */

.app-body {
  min-height: 100dvh;
  background: var(--bg);
}

/* ── Header ── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(19, 19, 24, 0.82);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.header-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.header-logo {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-logo .brand-icon {
  font-size: 1.5rem;
}

.brand-icon {
  font-size: 1.5rem;
}

.brand-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1;
}

.brand-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.brand-by {
  font-size: 0.55rem;
  color: var(--text-muted);
  font-weight: 400;
  font-style: italic;
  opacity: 0.6;
}

.brand-author {
  font-size: 0.55rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.1;
  opacity: 0.6;
}

/* ── Container ── */
.app-container {
  max-width: 540px;
  margin: 0 auto;
  padding: 1rem 1rem 5rem;
}

/* ── Nutrition Card ── */
.nutrition-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 1rem 1.125rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-md);
}

.macro-section {
  padding: 0.35rem 0;
}

.macro-section:first-child {
  padding-top: 0;
}

.macro-section:last-child {
  padding-bottom: 0;
}

.macro-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
}

.macro-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.macro-ratio {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.macro-value {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.macros-divider {
  height: 1px;
  background: var(--border);
  margin: 0.25rem 0;
}

/* Calories — hero section */
.macro-calories {
  padding-bottom: 0.5rem;
}

.macro-calories .macro-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.macro-calories .macro-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* Progress bars */
.progress-container {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.progress-track {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--r-full);
  overflow: hidden;
}

.macro-calories .progress-track {
  height: 8px;
}

.progress-fill {
  height: 100%;
  border-radius: var(--r-full);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.progress-calories {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}

.progress-calories.bg-green-500 {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}

.progress-calories.bg-yellow-500 {
  background: linear-gradient(90deg, #eab308, #facc15);
}

.progress-calories.bg-red-500 {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.progress-proteines {
  background: linear-gradient(90deg, #e11d48, #fb7185);
}

.progress-glucides {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.progress-lipides {
  background: linear-gradient(90deg, #d97706, #fbbf24);
}

.progress-eau {
  background: linear-gradient(90deg, #0284c7, #38bdf8);
}

.progress-percentage {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 2.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Macro label & value colors */
.macro-proteines .macro-label {
  color: var(--color-protein);
}

.macro-proteines .macro-value {
  color: var(--color-protein);
}

.macro-glucides .macro-label {
  color: var(--color-carbs);
}

.macro-glucides .macro-value {
  color: var(--color-carbs);
}

.macro-lipides .macro-label {
  color: var(--color-fat);
}

.macro-lipides .macro-value {
  color: var(--color-fat);
}

.macro-eau .macro-label {
  color: var(--color-water);
}

.macro-eau .macro-value {
  color: var(--color-water);
}

.eau-status {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.375rem;
  font-weight: 500;
}

.eau-status.objectif-atteint {
  color: var(--primary);
}

/* ── Actions Grid ── */
.actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
  margin: 1.25rem 0 1rem;
}

.action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.action-hint {
  margin-top: 0.625rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  text-align: center;
  min-height: 1.125em;
}

/* Dictation buttons */
.dictation-btn {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.dictation-btn:hover {
  transform: translateY(-3px) scale(1.04);
  border-color: var(--primary);
  background: var(--surface-hover);
  box-shadow: var(--primary-glow), var(--shadow-lg);
}

.dictation-btn:active {
  transform: translateY(0) scale(0.97);
}

.dictation-text {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.dictation-btn .dictation-icon svg path {
  stroke: var(--primary);
  transition: stroke 0.2s;
}

.dictation-btn .dictation-icon svg {
  width: 28px;
  height: 28px;
}

.dictation-btn:hover .dictation-icon svg path {
  stroke: var(--primary-light);
}

/* Journal button border */
#btn-dicter {
  border-color: rgba(34, 197, 94, 0.3);
}

#btn-dicter:hover {
  background: rgba(34, 197, 94, 0.06);
}

/* Preferences button */
.dictation-btn-preferences {
  border-color: rgba(167, 139, 250, 0.3);
}

.dictation-btn-preferences:hover {
  border-color: var(--color-sport);
  background: rgba(167, 139, 250, 0.06);
  box-shadow: 0 0 24px rgba(167, 139, 250, 0.15), var(--shadow-lg);
}

.dictation-btn-preferences .dictation-icon svg path,
.dictation-btn-preferences .dictation-icon svg line {
  stroke: var(--color-sport);
}

.dictation-btn-preferences:hover .dictation-icon svg path,
.dictation-btn-preferences:hover .dictation-icon svg line {
  stroke: #c4b5fd;
}

.dictation-btn-preferences.listening {
  border-color: var(--color-sport);
  animation: pulse-border-purple 1.5s ease-in-out infinite;
}

.dictation-btn-preferences.listening .dictation-icon svg path {
  stroke: var(--color-sport);
}

.dictation-btn-preferences.listening .dictation-text {
  color: var(--color-sport);
}

/* Listening / Processing states */
.dictation-btn.listening {
  border-color: var(--danger);
  animation: pulse-border 1.5s ease-in-out infinite;
}

.dictation-btn.processing {
  opacity: 0.7;
  cursor: wait;
  animation: pulse 2s infinite;
}

.dictation-btn.processing .dictation-icon {
  animation: none;
}

/* ── Action Hint Popovers ── */
.action-hint-wrap {
  position: relative;
}

.action-hint-tappable {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.12);
  padding-bottom: 1px;
  transition: color 0.15s;
}

.action-hint-tappable svg {
  opacity: 0.4;
  flex-shrink: 0;
}

.action-hint-tappable:hover,
.action-hint-wrap.show .action-hint-tappable {
  color: var(--text-secondary);
}

.action-hint-tappable:hover svg,
.action-hint-wrap.show .action-hint-tappable svg {
  opacity: 0.7;
}

.action-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px) scale(0.96);
  width: max-content;
  max-width: 200px;
  background: #1e1e26;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r-sm);
  padding: 0.5rem 0.625rem;
  font-size: 0.6875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: all 0.15s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 30;
  pointer-events: none;
}

/* Left card: align popover to left edge */
.action-card:first-child .action-popover {
  left: 0;
  transform: translateX(0) translateY(-4px) scale(0.96);
}

.action-card:first-child .action-popover-arrow {
  left: 2rem;
}

/* Right card: align popover to right edge */
.action-card:last-child .action-popover {
  left: auto;
  right: 0;
  transform: translateX(0) translateY(-4px) scale(0.96);
}

.action-card:last-child .action-popover-arrow {
  left: auto;
  right: 2rem;
}

.action-hint-wrap.show .action-popover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.action-card:first-child .action-hint-wrap.show .action-popover {
  transform: translateX(0) translateY(0) scale(1);
}

.action-card:last-child .action-hint-wrap.show .action-popover {
  transform: translateX(0) translateY(0) scale(1);
}

.action-popover-arrow {
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: #1e1e26;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.action-popover em {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-muted);
  font-style: normal;
  font-size: 0.625rem;
}

/* legacy info-pill (unused) */
.info-pill {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 0.5rem 1rem;
  margin: 0 auto 1rem;
  width: fit-content;
  max-width: 92%;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all 0.25s;
  overflow: hidden;
}

.info-pill:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
}

.info-header {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.info-icon {
  font-size: 0.875rem;
}

.info-text {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.info-content {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  transition: all 0.25s;
  line-height: 1.5;
}

.info-pill.expanded .info-content {
  max-height: 80px;
  opacity: 1;
  margin-top: 0.375rem;
  padding-bottom: 0.125rem;
}

/* ── History Section ── */
.history-section {
  margin-top: 1.25rem;
}

.history-title {
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  background: var(--surface);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: var(--r-lg);
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.35;
}

.empty-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
}

.empty-subtext {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ── Unified Item Component ── */
.repas-item {
  display: flex;
  align-items: stretch;
  gap: 1rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  animation: slideInUp 0.4s ease-out;
  box-shadow: var(--shadow-sm);
}

.repas-item:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.repas-item .item-icon {
  font-size: 1.5rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: var(--r-md);
  flex-shrink: 0;
  color: var(--text-muted);
}

.repas-item .item-icon svg {
  width: 22px;
  height: 22px;
}

.repas-item.sport-item .item-icon {
  background: rgba(167, 139, 250, 0.1);
  color: var(--color-sport);
}

.repas-item.preference-item .item-icon {
  background: var(--bg);
  color: var(--text-muted);
}

.repas-item .item-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.25rem;
  padding-top: 0.125rem;
}

.repas-item .item-header {
  display: block;
  line-height: 1.3;
}

.repas-item .item-name {
  font-weight: 800;
  color: var(--text-primary);
  font-size: 1rem;
  letter-spacing: -0.01em;
  display: inline;
  margin-right: 0.25rem;
}

.repas-item .item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.repas-item .item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 0.5rem;
  flex-shrink: 0;
  padding-top: 0.125rem;
}

.repas-item .item-kcal {
  font-size: 1.125rem;
  font-weight: 900;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.repas-item .item-btns {
  display: flex;
  gap: 0.375rem;
}

/* Sport variant — blue subtle */
.repas-item.sport-item .item-kcal {
  color: #60a5fa;
}

.repas-item.sport-item .item-icon {
  background: rgba(96, 165, 250, 0.1);
  color: #60a5fa;
}

/* Macros Chips */
.macros-info {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-top: 0.125rem;
}

.macro {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-variant-numeric: tabular-nums;
}

.macro-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.macro.macro-proteines {
  color: var(--color-protein);
  background: rgba(251, 113, 133, 0.08);
  border-color: rgba(251, 113, 133, 0.15);
}

.macro.macro-glucides {
  color: var(--color-carbs);
  background: rgba(96, 165, 250, 0.08);
  border-color: rgba(96, 165, 250, 0.15);
}

.macro.macro-lipides {
  color: var(--color-fat);
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.15);
}

/* Unified Badge Class */
.badge {
  font-size: 0.625rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-db,
.badge-ia,
.badge-scan {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Shared Edit/Delete Buttons */
.btn-edit,
.btn-delete {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  background: var(--bg);
  color: var(--text-muted);
}

.btn-edit:hover {
  background: var(--surface-active);
  color: var(--text-primary);
  border-color: var(--border-hover);
  transform: scale(1.05);
}

.btn-delete {
  background: rgba(239, 68, 68, 0.05);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.15);
}

.btn-delete:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
  transform: scale(1.05);
}

.btn-edit svg,
.btn-delete svg {
  width: 16px;
  height: 16px;
}

/* ── Form elements (modals) ── */
.form-group {
  margin-bottom: 0.875rem;
}

.form-row {
  display: flex;
  gap: 0.75rem;
}

.form-row .form-group {
  flex: 1;
}

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

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input {
  width: 100%;
  padding: 0.65rem 0.875rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input-readonly {
  cursor: not-allowed;
  opacity: 0.6;
}

/* ── Modals ── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.modal.hidden {
  display: none;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.2s ease-out;
}

.modal-panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 92dvh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  animation: slideUp 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (min-width: 540px) {
  .modal {
    align-items: center;
    padding: 1.5rem;
  }

  .modal-panel {
    border-radius: var(--r-xl);
    max-width: 460px;
    animation: scaleIn 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  }
}

@media (min-width: 768px) {
  .modal-panel {
    max-width: 480px;
  }
}

.modal-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.settings-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.modal-panel-title {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.modal-close-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.modal-close-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.modal-panel-body {
  padding: clamp(0.5rem, 1.5dvh, 1rem) 1.125rem;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

/* ── Modal Actions ── */
.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.action-btn {
  width: 100%;
  padding: 0.65rem;
  border-radius: var(--r-md);
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  font-family: inherit;
}

.action-btn-primary {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.2);
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.06);
}

.action-btn-primary:hover {
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(34, 197, 94, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.1);
}

.action-btn-primary:active {
  transform: translateY(0);
}

.action-btn-secondary {
  background: var(--bg);
  color: var(--text-primary);
  border: 1.5px solid var(--border);
}

.action-btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
}

.action-btn-danger {
  background: rgba(127, 29, 29, 0.6);
  color: #fca5a5;
  border: 1px solid rgba(153, 27, 27, 0.5);
}

.action-btn-danger:hover {
  background: rgba(153, 27, 27, 0.7);
  color: #fff;
}


/* ── Settings Modal ── */
#modal-settings .modal-panel {
  background: #18181b;
}

@media (min-width: 540px) {
  #modal-settings .modal-panel {
    height: auto;
    max-height: 90dvh;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }
}

#modal-settings .modal-panel-header {
  background: rgba(24, 24, 27, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 1.25rem 1.5rem;
}

#modal-settings .modal-panel-title {
  font-size: 1.25rem;
}

/* User Email Badge */
.setting-value-email {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.35rem 0.75rem;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#modal-settings .modal-panel-body {
  padding: 1.25rem 1.25rem 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Settings Sections */
.settings-section {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.25rem;
  /* Consistent large gap between sections */
}

.settings-section:first-child {
  margin-top: 0.5rem;
}

.settings-section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding-left: 0.25rem;
  margin-bottom: 0.5rem;
  /* Closer to its section card */
}

.settings-section-header svg {
  opacity: 0.6;
  width: 14px;
  height: 14px;
}

/* Settings Card (Container for inputs) */
.settings-card {
  background: #202025;
  /* Slightly lighter surface */
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 0.5rem 1.25rem;
  /* Vertical padding handled by rows */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
}

.setting-input-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  min-height: 3.5rem;
}

.setting-input-row:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.setting-divider {
  display: none;
}

/* Remove old dividers, use border-bottom instead */

.setting-input-label {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  /* Lighter label */
  font-weight: 500;
}

/* Modern Input Wrapper (Spinner & Select) */
.setting-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0;
  /* Buttons attached to input */
  background: #131318;
  /* Darker background for input group */
  border-radius: 10px;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  /* Subtle border */
}

/* Spin Buttons (+/-) */
.spin-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
  font-size: 1.1rem;
  font-weight: 400;
  /* Thinner */
}

.spin-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.spin-btn:active {
  background: rgba(255, 255, 255, 0.05);
}

/* Number Input Field */
.setting-input {
  background: transparent;
  border: none;
  border-bottom: none;
  /* Reset old style */
  padding: 0 0.5rem;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  width: 60px;
  font-variant-numeric: tabular-nums;
  appearance: textfield;
  -moz-appearance: textfield;
}

.setting-input:focus {
  outline: none;
  background: transparent;
  border-bottom: none;
}

.setting-input-unit {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 600;
  padding-right: 0.75rem;
  padding-left: 0.25rem;
  min-width: 2.5rem;
  /* Fixed width for unit */
  text-align: left;
}



/* Custom Select Redesign - FIXED Positioning */
.custom-select {
  position: relative;
}

.custom-select.open {
  z-index: 110;
}

.custom-select-trigger {
  background: #131318;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.6rem 1rem;
  min-width: 140px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-primary);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  gap: 8px;
}

.custom-select-trigger:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: #1a1a20;
}

.custom-select-text {
  font-size: 0.9375rem;
  pointer-events: none;
}

.custom-select-chevron {
  color: var(--text-muted);
  transition: transform 0.2s;
}

.custom-select.open .custom-select-chevron {
  transform: rotate(180deg);
}

.custom-select-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 100%;
  background: #27272a;
  /* Zinc 800 */
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border-radius: 12px;
  padding: 6px;
  z-index: 100;

  /* Hiding logic */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.95);
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.custom-select.open .custom-select-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.custom-select-option {
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.custom-select-option:hover {
  background: var(--primary-subtle) !important;
  color: var(--primary-light) !important;
}

.custom-select-option.active {
  background: rgba(34, 197, 94, 0.15);
  /* Green tint */
  color: #4ade80;
  /* Green text */
  font-weight: 600;
}

/* Objectif Hint */
.objectif-hint {
  margin: 0.5rem 0 0;
  background: rgba(34, 197, 94, 0.05);
  border: 1px solid rgba(34, 197, 94, 0.15);
  border-radius: 12px;
  /* Standalone box now */
  padding: 0.75rem 1rem;
}

/* Actions Group — pushed to bottom via margin-top: auto in flex body */
.settings-bottom-group {
  margin-top: auto;
  padding-top: 0.5rem;
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Primary Save Button */
.settings-save-btn {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: white;
  border: none;
  border-radius: 14px;
  padding: 0.875rem;
  /* Slightly more compact */
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.settings-save-btn:hover {
  background: linear-gradient(135deg, #15803d, #14532d);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(22, 163, 74, 0.35);
}

.settings-save-btn svg {
  width: 20px;
  height: 20px;
}

/* Danger / Secondary Actions */
.settings-danger-row {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.settings-danger-inline {
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.2s;
  font-weight: 500;
}

.settings-danger-inline:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

.settings-danger-inline-red {
  color: #ef4444;
}

.settings-danger-inline-red:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
}

.settings-attribution {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-align: center;
  opacity: 0.6;
  line-height: 1.4;
  margin-top: 0.5rem;
}

.settings-attribution a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.2);
}

/* Mobile Tweaks */
@media (max-width: 380px) {
  .setting-input-row {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .setting-input-wrapper {
    margin-left: auto;
  }

  .custom-select-trigger {
    min-width: 100px;
  }
}


.custom-select-option:hover {
  background: var(--primary-subtle) !important;
  color: var(--primary-light) !important;
}

.custom-select-option.active {
  background: var(--primary-subtle);
  color: var(--primary-light);
  font-weight: 600;
}

.setting-input-unit {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 26px;
  text-align: left;
}

.setting-hint {
  font-size: 0.625rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0.25rem 0 0;
  opacity: 0.7;
}

/* Spin buttons */
.spin-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--r-sm);
  background: var(--primary-subtle);
  color: var(--primary);
  font-size: 1.125rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

.spin-btn:hover {
  background: rgba(34, 197, 94, 0.2);
  transform: scale(1.06);
}

.spin-btn:active {
  transform: scale(0.94);
  background: rgba(34, 197, 94, 0.3);
}

.settings-save-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: clamp(0.375rem, 0.8dvh, 0.75rem);
}

/* Danger row (inline) */
.settings-danger-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: clamp(0.25rem, 0.5dvh, 0.5rem);
}

.settings-danger-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.settings-danger-inline:hover {
  color: var(--text-secondary);
  border-color: var(--border-hover);
}

.settings-danger-inline-red {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.15);
}

.settings-danger-inline-red:hover {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.04);
}

.settings-danger-inline svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.settings-danger-inline:hover svg {
  opacity: 1;
}

/* legacy danger btn (unused) */
.settings-danger-btn {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.5rem 0;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s;
}

.settings-danger-btn:hover {
  color: #ef4444;
}

.settings-danger-btn svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.settings-danger-btn:hover svg {
  opacity: 1;
  color: #ef4444;
}

.settings-logout-btn {
  color: #ef4444;
}

.settings-logout-btn svg {
  opacity: 0.8;
}

/* Attribution */
/* Attribution */
.settings-attribution {
  font-size: 0.625rem;
  color: var(--text-muted);
  text-align: center;
  opacity: 0.5;
  line-height: 1.4;
  margin: 0;
  padding: 0;
  display: block;
  /* Ensure no weird inline gaps */
}

.settings-attribution a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Toast ── */
.toast-notification {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  font-size: 0.8125rem;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  animation: slideUpToast 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  max-width: calc(100vw - 2rem);
  width: max-content;
  text-align: center;
  word-break: break-word;
  box-sizing: border-box;
}

/* ── Water Controls ── */
.eau-controls {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.eau-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.eau-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  transform: scale(1.1);
}

.eau-btn-plus:hover {
  border-color: var(--color-water);
  color: var(--color-water);
}

.eau-btn-minus:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.eau-btn:active {
  transform: scale(0.92);
}

.eau-btn.loading {
  opacity: 0.4;
  pointer-events: none;
}

.eau-btn-edit {
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.eau-btn-edit:hover {
  background: var(--surface-hover);
  border-color: var(--color-water);
  color: var(--color-water);
}

.eau-btn-edit:active {
  transform: scale(0.94);
}

.eau-btn-large {
  width: 48px;
  height: 48px;
  font-size: 1.5rem;
}

.water-edit-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 1.25rem 0;
}

.water-edit-display {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  min-width: 100px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ── Preferences Section ── */
.preferences-diner-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.preferences-header {
  margin-bottom: 1rem;
}

.preferences-title {
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 0.25rem;
  letter-spacing: -0.01em;
}

.preferences-subtitle {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0;
}

.preference-item {
  margin-bottom: 0.5rem;
}

.preference-item:last-of-type {
  margin-bottom: 0.75rem;
}

.preference-item .details {
  font-size: 0.6875rem;
  color: var(--text-muted);
  opacity: 0.85;
}

.preference-source-db {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 700;
  background: rgba(34, 197, 94, 0.15);
  color: var(--primary);
  vertical-align: middle;
  margin-left: 4px;
}

.preference-source-ia {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  vertical-align: middle;
  margin-left: 4px;
}

.preferences-footer {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.875rem;
  padding: 0.5rem 0.25rem 0;
  margin-top: 0.5rem;
}

.preferences-footer-texts {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.375rem;
}

.preferences-date {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.preferences-sms {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.2;
}

.preference-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.btn-delete-pref {
  background: var(--danger-subtle) !important;
  border-color: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
}

.btn-delete-pref:hover {
  background: rgba(239, 68, 68, 0.18) !important;
}

.btn-delete-all-prefs {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
  padding: 0.4rem 0.75rem;
  border-radius: var(--r-md);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-delete-all-prefs:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}

.btn-delete-all-prefs:active {
  transform: translateY(0);
}

/* ── Animations ── */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(100%);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUpToast {
  from {
    opacity: 0;
    transform: translate(-50%, 16px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 0.7;
  }

  50% {
    opacity: 1;
  }
}

@keyframes pulse-border {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }

  70% {
    box-shadow: 0 0 0 12px rgba(239, 68, 68, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

@keyframes pulse-border-purple {
  0% {
    box-shadow: 0 0 0 0 rgba(167, 139, 250, 0.4);
  }

  70% {
    box-shadow: 0 0 0 12px rgba(167, 139, 250, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(167, 139, 250, 0);
  }
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  75% {
    transform: translateX(5px);
  }
}

/* ── Utility ── */
.hidden {
  display: none !important;
}

.animate-shake {
  animation: shake 0.3s ease-in-out;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .app-container {
    padding: 0.75rem 0.875rem 4rem;
  }

  .dictation-btn {
    width: 80px;
    height: 80px;
  }

  .dictation-btn .dictation-icon svg {
    width: 24px;
    height: 24px;
  }

  .preferences-footer {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .setting-input {
    width: 56px;
    font-size: 16px;
  }

  .spin-btn {
    width: 32px;
    height: 32px;
  }

  .settings-card {
    padding: 0 0.75rem;
  }

  .setting-value-email {
    max-width: 150px;
    font-size: 0.625rem;
  }

  .modal-panel-header {
    padding: 0.75rem 1rem;
  }

  #modal-settings .modal-panel-body {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (min-width: 640px) {
  .dictation-btn {
    width: 96px;
    height: 96px;
  }
}

/* Short screens (iPhone SE, etc.) */
@media (max-height: 700px) {
  .modal-panel-header {
    padding: 0.5rem 1rem;
  }

  .modal-panel-title {
    font-size: 1rem;
  }

  .modal-close-btn {
    width: 32px;
    height: 32px;
  }

  #modal-settings .modal-panel-body {
    padding: 0.5rem 1rem 0.5rem;
  }

  .settings-section-header {
    font-size: 0.5625rem;
    padding-bottom: 0.25rem;
  }

  .settings-section-header svg {
    width: 13px;
    height: 13px;
  }

  .setting-input-label {
    font-size: 0.75rem;
  }

  .setting-input-row {
    min-height: 38px;
    padding: 0.3rem 0;
  }

  .settings-card {
    padding: 0 0.75rem;
  }

  .action-btn {
    padding: 0.4375rem;
    font-size: 0.8125rem;
  }

  .spin-btn {
    width: 28px;
    height: 28px;
    font-size: 1rem;
  }

  .custom-select-trigger {
    padding: 5px 8px 5px 12px;
    min-width: 120px;
  }

  .custom-select-text {
    font-size: 0.75rem;
  }

  .settings-danger-inline {
    padding: 0.375rem 0.375rem;
    font-size: 0.6875rem;
  }
}

/* Tall screens (larger phones, tablets) */
@media (min-height: 850px) {
  .setting-input-row {
    padding: 0.625rem 0;
  }

  .settings-section-header {
    padding-bottom: 0.5rem;
  }
}

/* Tablet+ */
@media (min-width: 768px) {
  #modal-settings .modal-panel {
    max-width: 480px;
  }

  .settings-card {
    padding: 0.125rem 1.125rem;
  }
}

/* ========================================
   SCANNER
   ======================================== */

/* Scanner button — amber accent */
.dictation-btn-scanner {
  border-color: rgba(245, 158, 11, 0.3);
}

.dictation-btn-scanner:hover {
  border-color: var(--warning);
  background: rgba(245, 158, 11, 0.06);
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.15), var(--shadow-lg);
}

.dictation-btn-scanner .dictation-icon svg path,
.dictation-btn-scanner .dictation-icon svg line {
  stroke: var(--warning);
}

.dictation-btn-scanner:hover .dictation-icon svg path,
.dictation-btn-scanner:hover .dictation-icon svg line {
  stroke: #fbbf24;
}

.dictation-btn-scanner.processing {
  border-color: var(--warning);
  animation: pulse-border-amber 1.5s ease-in-out infinite;
}

@keyframes pulse-border-amber {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
  }

  70% {
    box-shadow: 0 0 0 12px rgba(245, 158, 11, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}

/* Middle card popover alignment */
.action-card:nth-child(2) .action-popover {
  left: 50%;
  transform: translateX(-50%) translateY(-4px) scale(0.96);
}

.action-card:nth-child(2) .action-popover-arrow {
  left: 50%;
}

.action-card:nth-child(2) .action-hint-wrap.show .action-popover {
  transform: translateX(-50%) translateY(0) scale(1);
}

/* 3rd card (last) popover — keep right-aligned */
.action-card:nth-child(3) .action-popover {
  left: auto;
  right: 0;
  transform: translateX(0) translateY(-4px) scale(0.96);
}

.action-card:nth-child(3) .action-popover-arrow {
  left: auto;
  right: 2rem;
}

.action-card:nth-child(3) .action-hint-wrap.show .action-popover {
  transform: translateX(0) translateY(0) scale(1);
}

/* Scanner Choice Modal — always fully visible */
#modal-scanner-choice .modal-panel {
  max-height: none;
  overflow: visible;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.scanner-choices {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.scanner-choice-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1rem 1.25rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  text-align: left;
}

.scanner-choice-btn:hover {
  border-color: var(--warning);
  background: rgba(245, 158, 11, 0.04);
}

.scanner-choice-btn:active {
  transform: scale(0.98);
}

.scanner-choice-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 158, 11, 0.1);
  border-radius: var(--r-md);
  color: var(--warning);
}

.scanner-choice-text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.scanner-choice-label {
  font-size: 1rem;
  font-weight: 700;
}

.scanner-choice-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Scanner Camera Modal */
.scanner-camera-panel {
  max-height: 95dvh;
}

.scanner-camera-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.5rem !important;
}

.scanner-video-container {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 3 / 4;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #000;
  position: relative;
}

.scanner-video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#scanner-barcode-reader {
  width: 100%;
  max-width: 400px;
}

#scanner-barcode-reader video {
  border-radius: var(--r-lg) !important;
}

.scanner-capture-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  max-width: 260px;
  margin: 1.5rem auto 0;
  text-align: center;
}

.scanner-status {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
  min-height: 1.25em;
}

/* Scanner Confirm Modal */
.scanner-product-name {
  text-align: center;
  margin-bottom: 1rem;
}

.scanner-product-label {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.scanner-macros-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
  margin-bottom: 1.25rem;
}

.scanner-macro-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.scanner-macro-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.scanner-macro-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.125rem;
}

.scanner-macro-prot .scanner-macro-value {
  color: var(--color-protein);
}

.scanner-macro-gluc .scanner-macro-value {
  color: var(--color-carbs);
}

.scanner-macro-lip .scanner-macro-value {
  color: var(--color-fat);
}

.scanner-destination-section {
  margin-bottom: 1rem;
}

.scanner-confirm-actions {
  gap: 0.625rem;
}

.scanner-confirm-actions .action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* 3-column responsive: smaller buttons on small screens */
@media (max-width: 640px) {
  .actions-grid {
    gap: 0.5rem;
  }

  .dictation-btn {
    width: 72px;
    height: 72px;
  }

  .dictation-btn .dictation-icon svg {
    width: 22px;
    height: 22px;
  }

  .dictation-text {
    font-size: 0.5625rem;
  }

  .action-hint {
    font-size: 0.625rem;
  }
}

@media (max-width: 360px) {
  .dictation-btn {
    width: 64px;
    height: 64px;
  }

  .dictation-btn .dictation-icon svg {
    width: 20px;
    height: 20px;
  }
}

/* ========================================
   LEGAL PAGES
   ======================================== */

.legal-container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  animation: fadeInUp 0.5s ease-out;
}

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--primary-light);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  transition: color 0.2s;
}

.legal-back:hover {
  color: var(--primary);
}

.legal-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  margin-bottom: 0.375rem;
}

.legal-update {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.legal-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.legal-section:last-of-type {
  border-bottom: none;
}

.legal-section h2 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary-light);
  margin-bottom: 0.75rem;
}

.legal-section h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 1rem 0 0.5rem;
}

.legal-section p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.legal-section ul {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0.75rem;
}

.legal-section ul li {
  position: relative;
  padding-left: 1.25rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 0.25rem;
}

.legal-section ul li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 700;
}

.legal-section a {
  color: var(--primary-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-section a:hover {
  color: var(--primary);
}

.legal-section strong {
  color: var(--text-primary);
}

/* Legal tables */
.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.8125rem;
}

.legal-table th,
.legal-table td {
  padding: 0.625rem 0.75rem;
  text-align: left;
  border: 1px solid var(--border);
}

.legal-table th {
  background: var(--surface);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.legal-table td {
  color: var(--text-secondary);
  line-height: 1.5;
}

.legal-table tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

/* Legal footer */
.legal-footer {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}

.legal-footer a {
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}

.legal-footer a:hover {
  color: var(--primary-light);
}

@media (max-width: 480px) {
  .legal-container {
    padding: 1.5rem 1rem 2rem;
  }

  .legal-title {
    font-size: 1.375rem;
  }

  .legal-table {
    font-size: 0.75rem;
  }

  .legal-table th,
  .legal-table td {
    padding: 0.5rem;
  }
}

/* ========================================
   CONSENT CHECKBOXES (signup)
   ======================================== */

.consent-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.consent-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  cursor: pointer;
}

.consent-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
  cursor: pointer;
}

.consent-checkbox .consent-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.consent-checkbox .consent-label a {
  color: var(--primary-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.consent-checkbox .consent-label a:hover {
  color: var(--primary);
}

.consent-error {
  font-size: 0.8125rem;
  color: var(--danger);
  margin-top: 0.125rem;
}

.consent-error:empty {
  display: none;
}

/* ========================================
   COOKIE / LOCALSTORAGE INFO BANNER
   ======================================== */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0.875rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease-out;
}

.cookie-banner.hidden {
  display: none;
}

.cookie-banner-text {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
}

.cookie-banner-close {
  padding: 0.4rem 1rem;
  background: var(--primary-subtle);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--r-sm);
  color: var(--primary-light);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: all 0.2s;
}

.cookie-banner-close:hover {
  background: rgba(34, 197, 94, 0.18);
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ========================================
   APP FOOTER (legal links)
   ======================================== */

.app-legal-footer {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 0 0.5rem;
  margin-top: 0.5rem;
}

.app-legal-footer a {
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}

.app-legal-footer a:hover {
  color: var(--primary-light);
}

/* ========================================
   AI MENTION BADGE
   ======================================== */

.ai-mention {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 0.375rem 0.75rem;
  margin-top: 0.5rem;
  background: rgba(167, 139, 250, 0.06);
  border: 1px solid rgba(167, 139, 250, 0.12);
  border-radius: var(--r-sm);
}

/* ========================================
   DELETE ACCOUNT / EXPORT BUTTONS
   ======================================== */

.settings-account-section {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.settings-account-row {
  display: flex;
  gap: 0.5rem;
}

.settings-account-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 0.625rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 0.6875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  color: var(--text-muted);
}

.settings-account-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  color: var(--text-secondary);
}

.settings-account-btn-danger {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.2);
}

.settings-account-btn-danger:hover {
  background: var(--danger-subtle);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

/* Login page footer */
.login-legal-footer {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.login-legal-footer a {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}

.login-legal-footer a:hover {
  color: var(--primary-light);
}

/* ========================================
   TAILWIND REPLACEMENT UTILITIES
   Used by login.html, app.html, nutrition.js
   ======================================== */

/* --- Progress bar colors (nutrition.js) --- */
.bar-green {
  background-color: #22c55e;
}

.bar-yellow {
  background-color: #eab308;
}

.bar-red {
  background-color: #ef4444;
}

/* --- Login page: forgot/reset password links --- */
.link-accent {
  font-size: 0.75rem;
  color: #34d399;
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}

.link-accent:hover {
  color: #6ee7b7;
}

/* --- Login page: panel headers (forgot/reset) --- */
.panel-header {
  text-align: center;
  margin-bottom: 1rem;
}

.panel-header h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 0.25rem;
}

.panel-header p {
  font-size: 0.875rem;
  color: #9ca3af;
  margin: 0;
}

/* --- Login page: forgot password wrapper --- */
.forgot-link-wrap {
  text-align: center;
  margin-bottom: 0.75rem;
}

.back-link-wrap {
  text-align: center;
  margin-top: 1rem;
}

/* --- Login page: recap hint box --- */
.recap-hint-box {
  margin-top: 0.5rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.recap-hint-box p {
  font-size: 0.75rem;
  color: #9898a0;
  margin: 0;
}

/* --- Login page: auth error box --- */
.auth-error-box {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(127, 29, 29, 0.5);
  border: 1px solid #ef4444;
  border-radius: 0.5rem;
  text-align: center;
}

.auth-error-box p {
  color: #fca5a5;
  font-weight: 500;
  margin: 0;
}

/* --- SVG spinner opacity (used in btn-loader) --- */
.opacity-25 {
  opacity: 0.25;
}

.opacity-75 {
  opacity: 0.75;
}