/* ============================================================================
   IRNSCA Nutrition Application — app styles
   Part 1: the original nutrition.html stylesheet, ported verbatim (identity,
   glassmorphism tokens, RTL, iOS/Safari performance rules — see SETUP.md §22.6).
   Part 2 (end of file): plugin additions — account chip, Google unlock CTA,
   locked cards, hearts, sign-in modal, content-protection layers, print guard.
   ============================================================================ */
@import url('https://fonts.googleapis.com/css2?family=ADLaM+Display&family=El+Messiri:wght@400;500;600;700&display=swap');

:root {
  /* Base Theme (Dark) */
  /* Colors */
  --bg-dark: #0a0b10;
  --bg-dark-alt: #13151f;

  /* Primary Neons */
  --neon-cyan: #00f3ff;
  --neon-purple: #9d00ff;
  --neon-pink: #ff00ea;
  --neon-blue: #0044ff;
  --neon-green: #00ff66;
  --neon-orange: #ff5500;

  /* Glass/Cards */
  --glass-bg: rgba(20, 22, 35, 0.55);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-highlight: rgba(255, 255, 255, 0.15);
  --glass-shadow: 0 4px 14px 0 rgba(0, 0, 0, 0.28);

  /* Text */
  --text-primary: #ffffff;
  --text-secondary: #b4c0d4;
  --text-muted: #8b99ad;

  /* Typography */
  --font-en: 'ADLaM Display', cursive;
  --font-fa: 'El Messiri', sans-serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-dark: #f0f4f8;
  --bg-dark-alt: #e2e8f0;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --glass-bg: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(0, 0, 0, 0.1);
  --glass-highlight: rgba(255, 255, 255, 0.8);
  --glass-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.08);
  --neon-cyan: #0088ff;
  --neon-purple: #7b00ff;
  --neon-pink: #d900c7;
  --neon-blue: #0022ff;
  --neon-green: #00b347;
  --neon-orange: #e64d00;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Lock horizontal overflow at every level so nothing ever bleeds off the sides */
html {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-en);
  line-height: 1.6;
  /* clip (not hidden) so it doesn't create a scroll container that breaks position:sticky */
  overflow-x: clip;
  max-width: 100%;
  min-height: 100vh;
  position: relative;
  transition: background-color var(--transition-slow);
}

/* Media never wider than its container — kills side overflow */
img, svg, video, canvas, table {
  max-width: 100%;
}

/* ============ STATIC THEME BACKGROUND (cheap, no flicker) ============ */
/* A single fixed layer with NO blur and NO animation. This is the big
   performance win for iOS/Safari — heavy filter:blur + infinite anims
   on a full-screen layer were the main cause of jank/crashes. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* Dark theme background */
  background:
    radial-gradient(60% 55% at 16% 4%, rgba(157, 0, 255, 0.20), transparent 70%),
    radial-gradient(55% 50% at 90% 10%, rgba(255, 0, 234, 0.16), transparent 70%),
    radial-gradient(70% 55% at 50% 104%, rgba(120, 0, 255, 0.14), transparent 70%);
}

/* Light theme background — softer tints so text stays crisp */
[data-theme="light"] body::before {
  background:
    radial-gradient(60% 55% at 16% 4%, rgba(157, 0, 255, 0.12), transparent 70%),
    radial-gradient(55% 50% at 90% 10%, rgba(255, 90, 200, 0.12), transparent 70%),
    radial-gradient(70% 55% at 50% 104%, rgba(150, 80, 255, 0.10), transparent 70%);
}

/* RTL Support */
[dir="rtl"] {
  font-family: var(--font-fa);
}

[dir="rtl"] .ml-auto {
  margin-right: auto;
  margin-left: 0;
}

[dir="rtl"] .mr-auto {
  margin-left: auto;
  margin-right: 0;
}

/* ============ GLOBAL FONT ENFORCEMENT ============
   The whole project uses ONLY two fonts, chosen automatically by language:
     • LTR  (English / German)  → ADLaM Display
     • RTL  (Persian / Arabic)  → El Messiri
   Everything inherits from <html>, and !important blocks any default
   browser / OS / WordPress / Elementor / library font from leaking in. */
html        { font-family: var(--font-en) !important; }
html[dir="rtl"] { font-family: var(--font-fa) !important; }
body, body *:not(svg):not(path):not(polyline):not(polygon):not(circle) {
  font-family: inherit !important;
}

/* Utilities */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: hidden;
}

.glass-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-highlight), transparent);
}

.text-gradient-cyan {
  background: linear-gradient(90deg, var(--neon-cyan), #fff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-purple {
  background: linear-gradient(90deg, var(--neon-purple), #fff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Language Selection Overlay */
#language-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 11, 16, 0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--transition-slow);
}

.lang-selector-card {
  width: 90%;
  max-width: 600px;
  padding: var(--space-xl);
  text-align: center;
  animation: float 6s ease-in-out infinite;
}

.lang-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-xl);
}

/* Flags are PNGs shown on their own — no card / frame behind them */
.lang-btn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lang-btn img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  /* Subtle soft glow only — no box */
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
  transition: transform var(--transition-normal), filter var(--transition-normal);
}

.lang-btn:hover {
  transform: translateY(-6px) scale(1.06);
}

.lang-btn:hover img {
  filter: drop-shadow(0 0 18px var(--neon-cyan));
}

@media (max-width: 768px) {
  .lang-grid {
    gap: var(--space-lg);
  }
  .lang-btn img {
    width: 90px;
    height: 90px;
  }
}

/* Main App Wrapper */
#app-wrapper {
  display: none;
  min-height: 100vh;
  flex-direction: column;
}

/* Brand Bar (top of page, scrolls away) — pinned to the top-right corner.
   Direction is locked LTR so the brand stays on the right in every language. */
.brand-bar {
  padding: var(--space-md) var(--space-lg) var(--space-sm);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  direction: ltr;
}

/* Controls Bar (sticky) — layout is locked LTR so flags/toggles never
   jump when the page switches between LTR and RTL languages. */
.controls-bar {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: var(--space-sm) var(--space-lg);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  direction: ltr;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  border-top: none;
  margin-bottom: var(--space-xl);
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.brand-logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 1px;
}

/* Brand logo image + name (clickable → irnsca.com) */
.brand-logo-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: transform var(--transition-fast);
}
.brand-logo-link:hover { transform: scale(1.04); }
/* Small, compact logo mark (much smaller than before) */
.brand-logo-img {
  height: 28px;
  width: auto;
  object-fit: contain;
  display: block;
}
.brand-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text-primary);
  white-space: nowrap;
}

.flag-switcher {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  direction: ltr;
}

.top-btn-icon {
  /* Icon color follows the active theme live (black in light, white in dark) */
  background: rgba(127, 127, 127, 0.12);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-primary);
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}
[data-theme="light"] .top-btn-icon { color: #000; }
[data-theme="dark"]  .top-btn-icon { color: #fff; }
.top-btn-icon:hover {
  background: var(--glass-highlight);
  transform: translateY(-2px);
  border-color: var(--neon-cyan);
}
.top-btn-icon:focus { outline: none; }
.top-btn-icon:focus-visible {
  outline: 2px solid var(--neon-cyan);
  outline-offset: 2px;
}
.top-btn-icon:active { color: var(--neon-cyan); }

.lang-divider {
  width: 1px;
  height: 24px;
  background: var(--glass-border);
  margin: 0 4px;
}

.lang-btn-mini {
  background: transparent;
  border: 2px solid transparent;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  padding: 0;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.lang-btn-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}
.lang-btn-mini.active {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.4);
}
.lang-btn-mini:hover:not(.active) {
  transform: scale(1.1);
  border-color: var(--glass-highlight);
}

/* Dashboard Grid */
.dashboard-container {
  padding: 0 var(--space-lg) var(--space-xl);
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
  .dashboard-container {
    grid-template-columns: 300px 1fr;
  }
}

/* Sidebar / Menu */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* Whole button is a living, animated glass card (identical in all languages) */
.nav-item {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 58px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  /* Static colorful gradient (per-button color set below) — no animation */
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  transition: transform var(--transition-fast);
}

/* Static glassy highlight (no animation) */
.nav-item::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(60% 50% at 20% 10%, rgba(255, 255, 255, 0.32), transparent 60%);
}

/* Per-button color themes */
#nav-food-db     { background-image: linear-gradient(135deg, #00d977, #00bfd6, #0066ff); }
#nav-dashboard   { background-image: linear-gradient(135deg, #9d00ff, #ff00ea, #ff6ec7); }
#nav-builder     { background-image: linear-gradient(135deg, #ff8a00, #ffc400, #ff5e00); }
#nav-calculators { background-image: linear-gradient(135deg, #0044ff, #6a00ff, #00b3ff); }
#nav-curves      { background-image: linear-gradient(135deg, #ff416c, #ff7a18, #ffb347); }

/* Inline SVG nav icon (Response Curves) — inherits the white nav text colour */
.nav-icon svg {
  width: 100%;
  height: 100%;
  color: #fff;
}

/* Short menu label ("Curves") is desktop-hidden; the full label shows instead */
.nav-label-short { display: none; }

/* Raw PNG icon — no tile, box, frame or background behind it (≈2x bigger) */
.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  flex-shrink: 0;
  line-height: 1;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.3));
}

.nav-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nav-label {
  font-size: inherit;
}

[dir="rtl"] .nav-item {
  text-align: right;
}

.nav-item:hover {
  transform: translateY(-2px);
}

.nav-item.active {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: -2px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
}

/* Main Content Area */
.content-area {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

/* Sections */
.app-section {
  display: none;
  animation: fadeIn var(--transition-normal);
}

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

/* Summary Cards Grid */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.summary-card {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  position: relative;
  overflow: hidden;
}

.summary-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--neon-cyan);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-normal);
}

[dir="rtl"] .summary-card::after {
  transform-origin: right;
}

.summary-card:hover::after {
  transform: scaleX(1);
}

.summary-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.summary-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.summary-card.protein::after {
  background: var(--neon-purple);
}

.summary-card.carbs::after {
  background: var(--neon-pink);
}

.summary-card.fat::after {
  background: var(--neon-orange);
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
  border: none;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.12);
}

.btn:active {
  transform: translateY(2px) scale(0.98);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2), inset 0 2px 4px rgba(0,0,0,0.2);
}

.btn-primary {
  background: linear-gradient(135deg, var(--neon-cyan), #0088ff);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  box-shadow: 0 6px 15px rgba(0, 136, 255, 0.4), inset 0 2px 2px rgba(255,255,255,0.4);
  border: 1px solid rgba(0,136,255,0.5);
}

.btn-primary:hover {
  box-shadow: 0 8px 25px rgba(0, 136, 255, 0.6), inset 0 2px 2px rgba(255,255,255,0.5);
  transform: translateY(-3px);
  background: linear-gradient(135deg, #00bfff, #0066cc);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--glass-bg), var(--glass-highlight));
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15), inset 0 1px 1px rgba(255,255,255,0.1);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.3));
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

.btn-danger {
  background: linear-gradient(135deg, #ff3366, #cc0000);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  box-shadow: 0 6px 15px rgba(255, 0, 85, 0.4), inset 0 2px 2px rgba(255,255,255,0.4);
  border: 1px solid rgba(255,0,85,0.5);
}

.btn-danger:hover {
  box-shadow: 0 8px 25px rgba(255, 0, 85, 0.6), inset 0 2px 2px rgba(255,255,255,0.5);
  transform: translateY(-3px);
  background: linear-gradient(135deg, #ff4d79, #b30000);
}

/* Inputs & Forms */
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

.input-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.input-control {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  width: 100%;
}

.input-control:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

/* Data Tables */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

[dir="rtl"] .data-table {
  text-align: right;
}

.data-table th,
.data-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--glass-border);
}

.data-table th {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.875rem;
  white-space: nowrap;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Charts Container */
.chart-container {
  height: 300px;
  width: 100%;
  position: relative;
}

/* Meal Builder */
.meal-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.meal-card {
  padding: var(--space-md);
}

.meal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-md);
}

.meal-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.meal-item {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: var(--space-md);
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
}

.meal-item-actions {
  display: flex;
  gap: var(--space-xs);
}

/* Alerts / Toasts */
#toast-container {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  z-index: 9999;
}

[dir="rtl"] #toast-container {
  right: auto;
  left: var(--space-xl);
}

.toast {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  background: var(--bg-dark-alt);
  border: 1px solid var(--neon-cyan);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5), 0 0 10px rgba(0, 243, 255, 0.2);
  color: #fff;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[dir="rtl"] .toast {
  animation: slideInLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.error {
  border-color: #ff0055;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5), 0 0 10px rgba(255, 0, 85, 0.2);
}

/* Animations */
@keyframes float {

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

  50% {
    transform: translateY(-10px);
  }
}

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

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

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

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

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }

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

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform var(--transition-fast);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-md);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--neon-pink);
}

/* Food Selection Overlay styles */
.food-search-results {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-top: var(--space-md);
}

.food-result-item {
  padding: var(--space-sm) var(--space-md);
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.food-result-item:hover {
  background: rgba(0, 243, 255, 0.1);
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--glass-highlight);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--neon-cyan);
}

/* Static pink/purple tint over glass (animation removed — it caused
   full-element repaints that flickered when stacked with backdrop-filter) */
.live-gradient {
  background:
    linear-gradient(120deg,
      rgba(255, 0, 234, 0.10),
      rgba(157, 0, 255, 0.12),
      rgba(255, 80, 180, 0.08)),
    var(--glass-bg);
}

[data-theme="light"] .live-gradient {
  background:
    linear-gradient(120deg,
      rgba(255, 0, 234, 0.08),
      rgba(157, 0, 255, 0.08),
      rgba(255, 120, 200, 0.06)),
    var(--glass-bg);
}

/* Food name cell — image + name chips */
.food-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.food-name-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

/* Each name in its own framed chip — words stay on one line, chips wrap as a whole */
.food-chip {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  line-height: 1.3;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
}

.food-chip-primary {
  font-weight: 700;
  color: var(--text-primary);
  border-color: rgba(0, 243, 255, 0.45);
  background: linear-gradient(135deg, rgba(0, 243, 255, 0.18), rgba(157, 0, 255, 0.14));
}

/* English (secondary) name — distinct yellow chip with black text */
.food-chip-sub {
  font-size: 0.8rem;
  font-weight: 700;
  color: #1a1500;
  background: linear-gradient(135deg, #ffe600, #ffc107);
  border-color: rgba(0, 0, 0, 0.28);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22), inset 0 1px 1px rgba(255, 255, 255, 0.5);
}

/* =========================================================
   Detail metrics — capsule category headers + metric row cards
   (premium fitness-app look, glassmorphism-lite, mobile-first)
   ========================================================= */
.metric-group {
  display: flex;
  flex-direction: column;
}

/* Large rounded gradient capsule with inner glow, soft 3D & a slow shine */
.cat-capsule {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: 58px;
  padding: 0 22px;
  margin: 2px 0 12px;
  border-radius: 26px;
  background: linear-gradient(135deg, var(--cap-a), var(--cap-b));
  box-shadow:
    0 10px 22px -10px var(--cap-a),
    inset 0 1px 0 rgba(255, 255, 255, 0.40),
    inset 0 -3px 9px rgba(0, 0, 0, 0.14);
  isolation: isolate;
}
.cat-capsule .cap-text {
  position: relative;
  z-index: 1;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
}
/* GPU-only shine: a light streak swept across via transform (no repaint) */
.cat-capsule::before {
  content: '';
  position: absolute;
  top: 0;
  left: -60%;
  width: 38%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-18deg) translateX(0);
  will-change: transform;
  animation: capsuleShine 7s ease-in-out infinite;
  z-index: 0;
}
@keyframes capsuleShine {
  0%        { transform: skewX(-18deg) translateX(0); }
  55%, 100% { transform: skewX(-18deg) translateX(520%); }
}

/* Metric rows: one column on mobile, two when there's room */
.metric-rows {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
@media (min-width: 600px) {
  .metric-rows { grid-template-columns: 1fr 1fr; }
}

/* Each metric = an independent rounded glass card: [value] ... [titles] */
.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(80, 220, 160, 0.20);
  box-shadow:
    0 2px 5px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  min-width: 0;
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.metric-row:hover,
.metric-row:active {
  transform: scale(1.03);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
}

[data-theme="light"] .metric-row {
  background: rgba(255, 255, 255, 0.80);
  border-color: rgba(60, 200, 140, 0.30);
  box-shadow:
    0 2px 5px rgba(60, 120, 90, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.70);
}

.metric-row .mr-value {
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--mr-color, var(--text-primary));
  white-space: nowrap;
  flex-shrink: 0;
}
.metric-row .mr-titles {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  line-height: 1.2;
  min-width: 0;
}
.metric-row .mr-title-primary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}
.metric-row .mr-title-sub {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Value colour-coded by category */
.metric-row.cat-nutrition   { --mr-color: #22c55e; }
.metric-row.cat-fats        { --mr-color: #f97316; }
.metric-row.cat-glycemic    { --mr-color: #0ea5e9; }
.metric-row.cat-minerals    { --mr-color: #14b8c4; }
.metric-row.cat-amino       { --mr-color: #a35fff; }
.metric-row.cat-performance { --mr-color: #ec4899; }
.metric-row.cat-other       { --mr-color: #4b8f7a; }

[data-theme="light"] .metric-row.cat-nutrition   { --mr-color: #16a34a; }
[data-theme="light"] .metric-row.cat-fats        { --mr-color: #ea580c; }
[data-theme="light"] .metric-row.cat-glycemic    { --mr-color: #0284c7; }
[data-theme="light"] .metric-row.cat-minerals    { --mr-color: #0e9aa7; }
[data-theme="light"] .metric-row.cat-amino       { --mr-color: #7c3aed; }
[data-theme="light"] .metric-row.cat-performance { --mr-color: #db2777; }
[data-theme="light"] .metric-row.cat-other       { --mr-color: #3f7a66; }

/* Small info/description button next to nutrition labels — custom alert icon */
.info-btn {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: none;
  background: transparent;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform var(--transition-fast), filter var(--transition-fast);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.info-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.info-btn:hover {
  transform: scale(1.15);
  filter: drop-shadow(0 0 4px rgba(255, 200, 0, 0.6));
}

/* Food card thumbnails — raw PNG, no frame/box */
.food-thumb {
  width: 64px;
  height: 64px;
  object-fit: contain;
  vertical-align: middle;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* =========================================
   SLIDING UNIT TOGGLE (Serving / 100g)
   ========================================= */
.slide-toggle {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  padding: 3px;
  direction: ltr;
  user-select: none;
}

.slide-toggle .slide-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--neon-cyan), #0088ff);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4);
  transition: transform var(--transition-normal);
  z-index: 0;
}

.slide-toggle[data-active="gram"] .slide-thumb {
  transform: translateX(100%);
}

.slide-toggle .slide-opt {
  position: relative;
  z-index: 1;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.8rem;
  /* Equal-width options so the sliding thumb (50%) lands precisely */
  width: 84px;
  padding: 6px 0;
  text-align: center;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition-fast);
  /* No browser focus box / outline / tap highlight — only the slider shows state */
  outline: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: none;
}

.slide-toggle .slide-opt:focus,
.slide-toggle .slide-opt:focus-visible,
.slide-toggle .slide-opt:active {
  outline: none;
  box-shadow: none;
  border: none;
}

.slide-toggle .slide-opt.active {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* =========================================
   SLIDING THEME TOGGLE (Light / Dark PNGs)
   ========================================= */
.theme-toggle {
  position: relative;
  width: 66px;
  height: 34px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.28);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
}

.theme-toggle .theme-ico {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  object-fit: contain;
  opacity: 0.5;
  transition: opacity var(--transition-normal);
  pointer-events: none;
}

.theme-toggle .theme-ico-light { left: 7px; }
.theme-toggle .theme-ico-dark  { right: 7px; }

.theme-toggle .theme-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffffff, #d7e3f3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  transition: transform var(--transition-normal);
  z-index: 2;
}

/* Light => thumb sits over the sun icon (left); Dark => slides to moon (right) */
[data-theme="light"] .theme-toggle .theme-ico-light { opacity: 1; }
[data-theme="dark"]  .theme-toggle .theme-ico-dark  { opacity: 1; }
[data-theme="dark"]  .theme-toggle .theme-thumb { transform: translateX(32px); }

/* =========================================
   FOOD DATABASE — COMPACT CARD LIST + ACCORDION
   ========================================= */
/* Sticky search bar — pinned just below the sticky top controls bar */
.food-search-sticky {
  position: -webkit-sticky;
  position: sticky;
  top: 58px;
  z-index: 900;
  margin-bottom: var(--space-md);
}

/* Selected card scrolls to sit right under the sticky search bar */
.food-card {
  scroll-margin-top: 130px;
}

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

/* On tablet/desktop keep a tidy, app-like centered column (not stretched wide) */
@media (min-width: 769px) {
  .food-search-sticky,
  .food-list {
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
  }
}

.food-card {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  /* Skip rendering work for off-screen cards — big win on iOS/Safari with long lists */
  content-visibility: auto;
  contain-intrinsic-size: 0 130px;
}

.food-card.open {
  border-color: rgba(0, 243, 255, 0.5);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
}

/* Compact card: LEFT column = English name (top) + image (below);
   RIGHT column = the four key macros; far right = accordion toggle arrow. */
.food-head {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
  /* Lock LTR so the English name stays top-left & macros stay right in every language */
  direction: ltr;
}

.food-head-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  flex-shrink: 0;
  min-width: 0;
}

/* English name chip — sits at the top-left of the card */
.food-head .food-chip-en {
  max-width: 150px;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-primary);
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  border-color: rgba(0, 243, 255, 0.45);
  background: linear-gradient(135deg, rgba(0, 243, 255, 0.18), rgba(157, 0, 255, 0.14));
}

.food-head .food-thumb {
  width: 96px;
  height: 96px;
  align-self: flex-start;
}

/* Right column — the four key macros stacked as compact label/value rows */
.food-macros {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
  align-self: center;
}

/* Each macro = a self-contained, color-coded badge (same chip language as
   the food-name chips). Colour tells the metric apart at a glance. */
.macro {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--m-bd);
  background: var(--m-bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
  min-width: 0;
}

.macro-lbl {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 700;
  color: var(--m-fg);
  opacity: 0.82;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.macro-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--m-fg);
  white-space: nowrap;
}

/* Per-metric colour: Calories→blue, Protein→purple, Carbs→pink, Fat→red.
   Base values target the dark theme; light-mode overrides follow below. */
.macro.cal  { --m-bg: linear-gradient(135deg, rgba(59, 130, 246, 0.22), rgba(59, 130, 246, 0.10)); --m-bd: rgba(59, 130, 246, 0.55); --m-fg: #8ab8ff; }
.macro.pro  { --m-bg: linear-gradient(135deg, rgba(157, 0, 255, 0.22), rgba(157, 0, 255, 0.10)); --m-bd: rgba(157, 0, 255, 0.55); --m-fg: #cd97ff; }
.macro.carb { --m-bg: linear-gradient(135deg, rgba(255, 79, 163, 0.22), rgba(255, 79, 163, 0.10)); --m-bd: rgba(255, 79, 163, 0.55); --m-fg: #ff95c6; }
.macro.fat  { --m-bg: linear-gradient(135deg, rgba(255, 71, 71, 0.22), rgba(255, 71, 71, 0.10)); --m-bd: rgba(255, 71, 71, 0.55); --m-fg: #ff9494; }

[data-theme="light"] .macro.cal  { --m-bg: linear-gradient(135deg, rgba(59, 130, 246, 0.16), rgba(59, 130, 246, 0.07)); --m-bd: rgba(59, 130, 246, 0.45); --m-fg: #1d4ed8; }
[data-theme="light"] .macro.pro  { --m-bg: linear-gradient(135deg, rgba(147, 51, 234, 0.16), rgba(147, 51, 234, 0.07)); --m-bd: rgba(147, 51, 234, 0.45); --m-fg: #7c3aed; }
[data-theme="light"] .macro.carb { --m-bg: linear-gradient(135deg, rgba(236, 72, 153, 0.16), rgba(236, 72, 153, 0.07)); --m-bd: rgba(236, 72, 153, 0.45); --m-fg: #db2777; }
[data-theme="light"] .macro.fat  { --m-bg: linear-gradient(135deg, rgba(239, 68, 68, 0.16), rgba(239, 68, 68, 0.07)); --m-bd: rgba(239, 68, 68, 0.45); --m-fg: #dc2626; }

/* Accordion toggle — a down-chevron that rotates when the card opens
   (replaces the old "+" button) */
.food-toggle {
  flex-shrink: 0;
  align-self: flex-start;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--transition-normal), background var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

/* Accordion icon — custom PNG that swaps with the colour theme.
   Default (dark) theme → yellow mark; light theme → white mark. */
.food-toggle .toggle-ico {
  width: 18px;
  height: 18px;
  display: block;
  background: center / contain no-repeat;
  background-image: url("https://irnsca.com/wp-content/uploads/2026/06/accordion-yellow.png");
}
[data-theme="light"] .food-toggle .toggle-ico {
  background-image: url("https://irnsca.com/wp-content/uploads/2026/06/accordion-white.png");
}
.food-toggle:hover { background: var(--glass-highlight); }
.food-card.open .food-toggle { transform: rotate(180deg); }

/* "+" Add-to-Meal-Planner button — sits right next to the Amount field */
.food-add-plus {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(0, 136, 255, 0.5);
  background: linear-gradient(135deg, var(--neon-cyan), #0088ff);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(0, 136, 255, 0.35);
  transition: transform var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}
.food-add-plus:hover { transform: scale(1.1); }
.food-add-plus:active { transform: scale(0.95); }

/* Collapsible details — smooth height animation via grid-template-rows */
.food-details {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--transition-normal);
}

.food-card.open .food-details {
  grid-template-rows: 1fr;
}

.food-details-clip {
  overflow: hidden;
  min-height: 0;
}

/* Internal scroll area so the food header can stay sticky while scrolling */
.food-details-scroll {
  max-height: 320px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-top: 1px solid var(--glass-border);
}

/* Sticky mini-header (image + names) pinned at the top of the open details */
.details-sticky {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-dark-alt);
  border-bottom: 1px solid var(--glass-border);
}

.details-sticky .food-thumb { width: 38px; height: 38px; }

.details-sticky .stk-names {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.details-sticky .food-chip { padding: 2px 10px; font-size: 0.75rem; }

.details-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.details-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.details-metrics {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* =========================================
   📱 MOBILE RESPONSIVENESS & APP-LIKE UI
   ========================================= */
@media (max-width: 768px) {
  body {
    font-size: 14px;
  }
  /* LIGHTER MOBILE UI — backdrop-filter is the #1 cause of jank/crashes on
     iOS Safari, so drop it entirely and make panels (near-)opaque instead. */
  :root { --glass-bg: rgba(18, 20, 32, 0.92); }
  [data-theme="light"] { --glass-bg: rgba(255, 255, 255, 0.94); }
  .glass-panel,
  .controls-bar,
  .food-chip,
  .metric-row,
  .modal-overlay {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  /* Opaque modal backdrop instead of an expensive blur layer */
  .modal-overlay { background: rgba(0, 0, 0, 0.82); }
  .brand-bar {
    padding: 12px 14px 6px;
  }
  .controls-bar {
    padding: 8px 12px;
    margin-bottom: 12px;
  }
  /* Tiny logo mark on mobile so the header stays compact & professional.
     Shrunk to roughly a third of its previous footprint (kept legible). */
  .brand-logo-img { height: 10px; max-width: 38px; }
  .brand-name { font-size: 0.9rem; }
  .brand-bar { padding: 8px 12px 4px; }
  .flag-switcher {
    gap: 6px;
    justify-content: center;
    width: 100%;
  }
  .dashboard-container {
    grid-template-columns: 1fr;
    padding: 10px;
    gap: 15px;
  }
  .sidebar {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: var(--radius-md);
  }
  /* Tidy 2-per-row menu — no horizontal scroll */
  .sidebar nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  /* Icon-on-top tiles on mobile so the bigger PNG icons sit cleanly */
  .nav-item {
    min-height: 52px;
    padding: 12px 10px;
    font-size: 0.9rem;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
    text-align: center;
    white-space: normal;
  }
  .nav-icon { width: 62px; height: 62px; }
  /* On the narrow 2-per-row mobile menu, show the short "Curves" label */
  #nav-curves .nav-label-full { display: none; }
  #nav-curves .nav-label-short { display: inline; }
  .content-area {
    padding-bottom: 80px;
  }
  .glass-panel {
    padding: 15px;
  }
  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hide-on-mobile {
    display: none !important;
  }

  /* Sticky search sits just under the (shorter) mobile controls bar */
  .food-search-sticky { top: 52px; }
  .food-card { scroll-margin-top: 120px; }

  /* ---- Compact, image-forward food cards on mobile ---- */
  .food-head {
    gap: 10px;
    padding: 10px;
  }
  /* Bigger product image so it reads at a glance */
  .food-head .food-thumb {
    width: 112px;
    height: 112px;
  }
  .food-head .food-chip-en {
    max-width: 116px;
    font-size: 0.8rem;
    padding: 3px 10px;
  }
  .food-macros { gap: 5px; align-self: stretch; }
  .macro { padding: 5px 10px; }
  .macro-val { font-size: 0.9rem; }
  .macro-lbl { font-size: 0.6rem; }
  .food-toggle { width: 30px; height: 30px; }
  .food-toggle svg { width: 16px; height: 16px; }
  .food-details-scroll { max-height: 60vh; }

  /* German has long compound words (e.g. "Makronährstoffverteilung",
     "Lebensmitteldatenbank") that overflow narrow mobile containers.
     Allow them to break/hyphenate so text stays inside its box.
     NOTE: the food-card macro labels (.macro-lbl) are deliberately
     excluded — they keep the universal nowrap + ellipsis behaviour used
     by every language; forcing word-break on them breaks their truncation
     on Chromium/Samsung Internet and pushes the values out of the chip. */
  html[lang="de"] .nav-item,
  html[lang="de"] .summary-card,
  html[lang="de"] .glass-panel h1,
  html[lang="de"] .glass-panel h2,
  html[lang="de"] .glass-panel h3,
  html[lang="de"] .section-title,
  html[lang="de"] label,
  html[lang="de"] button {
    overflow-wrap: anywhere;
    word-break: break-word;
    -webkit-hyphens: auto;
    hyphens: auto;
    min-width: 0;
  }

  /* The German food cards must use the EXACT same sizing as the English
     ones — no German-specific override. min-width:auto is the default the
     English/Persian/Arabic labels already use, so the macro chips keep
     identical dimensions across every language. */
  html[lang="de"] .macro-lbl {
    min-width: auto;
  }
}

/* Respect users who prefer less motion — kill background/button animations */
@media (prefers-reduced-motion: reduce) {
  .lang-selector-card { animation: none !important; }
  .food-details { transition: none !important; }
  .cat-capsule::before { animation: none !important; opacity: 0; }
  .metric-row { transition: none !important; }
  .rc-cat-body { transition: none !important; }
}

/* ====================================================================
   RESPONSE CURVES SECTION
   ==================================================================== */
/* Keep the section in a tidy centered column like the food database */
@media (min-width: 769px) {
  #curves-section .food-search-sticky,
  .rc-column { max-width: 660px; margin-left: auto; margin-right: auto; }
}
.rc-column { display: flex; flex-direction: column; gap: var(--space-md); }

/* Typeahead search results */
.rc-search-results {
  margin-top: var(--space-sm);
  display: none;
  flex-direction: column;
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
}
.rc-search-results.open { display: flex; }
.rc-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  cursor: pointer;
  text-align: start;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
[data-theme="light"] .rc-result-item { background: rgba(0, 0, 0, 0.03); }
.rc-result-item:hover,
.rc-result-item.active {
  border-color: var(--neon-cyan);
  background: rgba(0, 243, 255, 0.10);
}
.rc-result-name { font-weight: 700; }
.rc-result-sub { font-size: 0.78rem; color: var(--text-muted); margin-inline-start: auto; }

/* All-foods grid (name + image), Food-Database style */
.rc-food-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(144px, 1fr));
  gap: 12px;
}
.rc-food-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  transition: transform var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}
[data-theme="light"] .rc-food-card { background: rgba(0, 0, 0, 0.03); }
.rc-food-card:hover { transform: translateY(-2px); border-color: var(--neon-cyan); }
.rc-food-card.active {
  border-color: var(--neon-cyan);
  background: rgba(0, 243, 255, 0.12);
  box-shadow: 0 0 12px rgba(0, 243, 255, 0.18);
}
.rc-food-card-img {
  width: 74px;
  height: 74px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}
.rc-food-card-noimg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  filter: none;
}
.rc-food-card-name { font-weight: 700; font-size: 0.9rem; line-height: 1.3; }
.rc-food-card-sub { font-size: 0.74rem; color: var(--text-muted); }
.rc-food-empty {
  grid-column: 1 / -1;
  padding: 24px;
  text-align: center;
  color: var(--text-secondary);
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-md);
  font-weight: 600;
}
@media (max-width: 768px) {
  .rc-food-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
  .rc-food-card { padding: 10px 8px; }
  .rc-food-card-img { width: 60px; height: 60px; }
}

/* Selected food banner */
.rc-selected-food {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(255, 65, 108, 0.18), rgba(255, 122, 24, 0.12));
  border: 1px solid var(--glass-border);
}
.rc-selected-food .rc-sel-label { font-size: 0.75rem; color: var(--text-muted); }
.rc-selected-food .rc-sel-name { font-size: 1.15rem; font-weight: 800; color: var(--text-primary); }
.rc-selected-food .rc-sel-sub { font-size: 0.8rem; color: var(--text-secondary); }

/* Status / empty / hint messages */
.rc-status {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--glass-border);
  color: var(--text-secondary);
  text-align: center;
  font-weight: 600;
}
.rc-status.error { color: var(--neon-orange); border-color: rgba(255, 85, 0, 0.4); }

/* Accordion of indicator categories */
.rc-accordion { display: flex; flex-direction: column; gap: 12px; }
.rc-cat {
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  overflow: hidden;
}
.rc-cat-header {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 18px;
  border: none;
  cursor: pointer;
  color: #fff;
  font-family: inherit;
  font-weight: 800;
  font-size: 1rem;
  text-align: start;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  background: linear-gradient(135deg, var(--cap-a), var(--cap-b));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.rc-cat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  font-size: 1.1rem;
}
.rc-cat-title { flex: 1; min-width: 0; }
.rc-cat-count {
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.9;
  background: rgba(0, 0, 0, 0.18);
  padding: 2px 9px;
  border-radius: var(--radius-full);
}
.rc-cat-chevron {
  flex-shrink: 0;
  transition: transform var(--transition-normal);
  font-size: 1.1rem;
  line-height: 1;
}
.rc-cat.open .rc-cat-chevron { transform: rotate(180deg); }
.rc-cat-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-normal);
}
.rc-cat.open .rc-cat-body { max-height: 640px; }
.rc-indicator-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}
.rc-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-align: start;
  transition: transform var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}
[data-theme="light"] .rc-indicator { background: rgba(0, 0, 0, 0.03); }
.rc-indicator:hover { transform: translateY(-1px); border-color: var(--neon-cyan); }
.rc-indicator.active {
  border-color: var(--neon-cyan);
  background: rgba(0, 243, 255, 0.12);
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.15);
}
.rc-indicator .rc-ind-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--neon-cyan); flex-shrink: 0;
}
.rc-indicator .rc-ind-name { flex: 1; min-width: 0; }
.rc-indicator .rc-ind-flag { font-size: 0.7rem; color: var(--text-muted); }

/* Chart card */
.rc-chart-card { padding: var(--space-lg); margin-top: var(--space-md); }
.rc-chart-head { margin-bottom: var(--space-sm); }
.rc-chart-food { font-size: 0.8rem; color: var(--text-muted); font-weight: 700; }
.rc-chart-title { font-size: 1.25rem; font-weight: 800; color: var(--text-primary); }
.rc-chart-desc { font-size: 0.85rem; color: var(--text-secondary); margin-top: 4px; line-height: 1.6; }
.rc-chart-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: var(--space-md) 0;
}
.rc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
}
[data-theme="light"] .rc-chip { background: rgba(0, 0, 0, 0.04); }
.rc-chip b { color: var(--text-primary); font-weight: 800; }
.rc-chart { width: 100%; height: 340px; }
.rc-chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 220px;
  text-align: center;
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--glass-border);
  color: var(--text-secondary);
  font-weight: 700;
}
.rc-chart-actions { margin-top: var(--space-md); display: flex; justify-content: flex-start; }

/* Indicator explanation (rich HTML pulled from the sheet's *Explain columns) */
.rc-chart-explain {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--glass-border);
  font-size: 0.9rem;
  line-height: 1.85;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}
.rc-chart-explain > :first-child { margin-top: 0; }
.rc-chart-explain > :last-child { margin-bottom: 0; }
.rc-chart-explain h1,
.rc-chart-explain h2,
.rc-chart-explain h3,
.rc-chart-explain h4,
.rc-chart-explain h5 {
  color: var(--text-primary);
  font-weight: 800;
  line-height: 1.4;
  margin: var(--space-md) 0 var(--space-xs);
}
.rc-chart-explain h1 { font-size: 1.2rem; }
.rc-chart-explain h2 { font-size: 1.1rem; }
.rc-chart-explain h3 { font-size: 1.02rem; }
.rc-chart-explain h4,
.rc-chart-explain h5 { font-size: 0.92rem; }
.rc-chart-explain p { margin: 0 0 var(--space-sm); }
.rc-chart-explain ul,
.rc-chart-explain ol { margin: 0 0 var(--space-sm); padding-inline-start: 1.4em; }
.rc-chart-explain li { margin-bottom: 4px; }
.rc-chart-explain strong,
.rc-chart-explain b { color: var(--text-primary); font-weight: 800; }
.rc-chart-explain a { color: var(--neon-cyan); text-decoration: underline; }
.rc-chart-explain img { max-width: 100%; height: auto; border-radius: var(--radius-md); }
.rc-chart-explain table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-sm) 0;
  font-size: 0.85rem;
}
.rc-chart-explain th,
.rc-chart-explain td {
  border: 1px solid var(--glass-border);
  padding: 6px 9px;
  text-align: start;
}
.rc-chart-explain th { color: var(--text-primary); font-weight: 800; }
[dir="rtl"] .rc-chart-explain { text-align: right; }

@media (max-width: 768px) {
  .rc-chart { height: 280px; }
  .rc-cat-header { font-size: 0.92rem; padding: 10px 14px; }
}

/* ============================================================================
   PART 2 — PLUGIN ADDITIONS
   ============================================================================ */

:root {
  --nutri-heart: #ff3d7f;
  --nutri-ok: #22c55e;
  --nutri-warn: #f59e0b;
  --nutri-bad: #ff4d6d;
  --nutri-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --nutri-ease-spring: cubic-bezier(0.2, 1.6, 0.4, 1);
}

/* Root wrapper (shortcode + standalone) */
.nutrition-app-root { position: relative; }
body.nutri-standalone { margin: 0; }

/* Utility */
.nutri-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.nutri-hidden { display: none !important; }

/* ---------------------------------------------------------------------------
   Account chip (controls bar)
   --------------------------------------------------------------------------- */
.nutri-auth-slot { display: flex; align-items: center; position: relative; }
.nutri-auth-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px 0 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--glass-border);
  background: #fff; color: #1f1f1f;
  font-family: inherit; font-weight: 700; font-size: 0.82rem;
  cursor: pointer; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}
.nutri-auth-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(66,133,244,0.35); }
.nutri-auth-btn:focus-visible, .nutri-avatar-btn:focus-visible { outline: 2px solid var(--neon-cyan); outline-offset: 2px; }
.nutri-auth-btn .nutri-g-wrap { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #fff; }
.nutri-g { width: 18px; height: 18px; display: block; }
.nutri-avatar-btn {
  width: 36px; height: 36px; border-radius: 50%; padding: 0; cursor: pointer; overflow: hidden;
  border: 2px solid var(--neon-cyan); background: linear-gradient(135deg, #9d00ff, #00bfd6);
  color: #fff; font-weight: 800; font-family: inherit; display: grid; place-items: center;
  box-shadow: 0 0 10px rgba(0,243,255,0.35);
}
.nutri-avatar-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nutri-menu {
  position: absolute; top: calc(100% + 10px); left: 0; z-index: 1200; min-width: 230px;
  background: var(--bg-dark-alt); border: 1px solid var(--glass-border); border-radius: var(--radius-md);
  box-shadow: 0 18px 40px rgba(0,0,0,0.45); padding: 8px; display: none;
}
.nutri-menu.open { display: block; animation: nutri-drop 0.18s var(--nutri-ease-out); }
.nutri-menu__head { padding: 8px 10px 10px; border-bottom: 1px solid var(--glass-border); margin-bottom: 6px; }
.nutri-menu__name { font-weight: 800; color: var(--text-primary); }
.nutri-menu__mail { font-size: 0.75rem; color: var(--text-muted); overflow-wrap: anywhere; }
.nutri-menu button { width: 100%; display: flex; align-items: center; gap: 10px; text-align: start; padding: 10px; min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--text-primary); font-family: inherit; font-size: 0.9rem; cursor: pointer; }
.nutri-menu button:hover, .nutri-menu button:focus-visible { background: rgba(0,243,255,0.1); outline: none; }
@keyframes nutri-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* Nav lock badge (My Dashboard for visitors) */
.nav-item .nav-lock { margin-inline-start: auto; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,0.28); flex-shrink: 0; }
.nav-item .nav-lock svg { width: 14px; height: 14px; color: #fff; }
.nutri-signed-in .nav-item .nav-lock { display: none; }
@media (max-width: 768px) { .nav-item .nav-lock { position: absolute; top: 6px; inset-inline-end: 6px; margin: 0; } }

/* ---------------------------------------------------------------------------
   Google unlock button — living conic ring (compositor-only transform
   animation, no filter / backdrop blur, so it stays smooth on iOS lists)
   --------------------------------------------------------------------------- */
.nutri-gbtn {
  position: relative; display: inline-flex; align-items: stretch;
  padding: 2px; border: 0; border-radius: var(--radius-full);
  background: transparent; cursor: pointer; isolation: isolate; overflow: hidden;
  font-family: inherit; color: #1f1f1f; max-width: 100%; text-align: start;
  box-shadow: 0 6px 22px rgba(66,133,244,0.28), 0 2px 8px rgba(0,0,0,0.25);
  transition: transform 0.25s var(--nutri-ease-out), box-shadow 0.25s var(--nutri-ease-out);
  -webkit-tap-highlight-color: transparent;
}
.nutri-gbtn__ring {
  position: absolute; left: 50%; top: 50%; z-index: -1;
  width: 260%; aspect-ratio: 1 / 1;
  background: conic-gradient(from 0deg, #4285F4, #34A853, #FBBC05, #EA4335, #ff00ea, #9d00ff, #00f3ff, #4285F4);
  transform: translate(-50%, -50%) rotate(0deg);
  animation: nutri-ring 3.6s linear infinite;
  will-change: transform;
}
@keyframes nutri-ring { to { transform: translate(-50%, -50%) rotate(360deg); } }
.nutri-gbtn__inner {
  position: relative; z-index: 1; overflow: hidden;
  display: flex; align-items: center; gap: 10px;
  padding: 6px 16px 6px 6px; min-height: 44px; width: 100%;
  border-radius: var(--radius-full); background: #ffffff;
}
[dir="rtl"] .nutri-gbtn__inner { padding: 6px 6px 6px 16px; }
.nutri-gbtn__g { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.18); }
.nutri-gbtn__g .nutri-g { width: 20px; height: 20px; }
.nutri-gbtn__text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.nutri-gbtn__text b { font-size: 0.92rem; font-weight: 800; color: #1f1f1f; letter-spacing: 0.1px; }
.nutri-gbtn__text small { font-size: 0.72rem; font-weight: 600; color: #4b5563; white-space: normal; }
.nutri-gbtn__shine {
  position: absolute; top: 0; left: -40%; width: 30%; height: 100%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(66,133,244,0.18), transparent);
  transform: skewX(-18deg) translateX(0);
  animation: nutri-shine 3.8s ease-in-out infinite;
  will-change: transform;
}
@keyframes nutri-shine { 0% { transform: skewX(-18deg) translateX(0); } 55%, 100% { transform: skewX(-18deg) translateX(560%); } }
.nutri-gbtn:hover { transform: translateY(-2px) scale(1.015); box-shadow: 0 10px 30px rgba(66,133,244,0.42), 0 4px 12px rgba(0,0,0,0.3); }
.nutri-gbtn:active { transform: translateY(0) scale(0.985); }
.nutri-gbtn:focus-visible { outline: 3px solid var(--neon-cyan); outline-offset: 3px; }
.nutri-gbtn--xl .nutri-gbtn__inner { min-height: 56px; padding-inline-end: 22px; }
.nutri-gbtn--xl .nutri-gbtn__g { width: 44px; height: 44px; }
.nutri-gbtn--xl .nutri-gbtn__text b { font-size: 1.02rem; }
.nutri-gbtn--block { display: flex; width: 100%; }

/* ---------------------------------------------------------------------------
   Locked food cards (70 % of foods for visitors): name + image stay visible,
   the data area is replaced by the Google unlock CTA
   --------------------------------------------------------------------------- */
.food-card.is-locked { border-style: dashed; border-color: rgba(66,133,244,0.45); }
.food-card.is-locked .food-head { cursor: default; }
.food-head-left .nutri-thumb-wrap { position: relative; display: inline-block; }
.nutri-lock-badge {
  position: absolute; bottom: 2px; inset-inline-end: 2px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #4285F4, #9d00ff); box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.nutri-lock-badge svg { width: 14px; height: 14px; }
.nutri-lock-cta { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.nutri-lock-cta .nutri-lock-note { font-size: 0.72rem; color: var(--text-secondary); line-height: 1.5; }
.nutri-lock-cta .nutri-gbtn { width: 100%; }
.nutri-lock-cta .nutri-gbtn__inner { padding-block: 5px; }
.nutri-unlock-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 14px 16px; margin: 0 auto var(--space-md); max-width: 620px;
  border-radius: var(--radius-md); border: 1px solid rgba(66,133,244,0.35);
  background: linear-gradient(135deg, rgba(66,133,244,0.16), rgba(157,0,255,0.12), rgba(255,0,234,0.08));
}
.nutri-unlock-banner[hidden] { display: none; }
.nutri-unlock-banner__text { display: flex; flex-direction: column; gap: 2px; min-width: 200px; flex: 1; }
.nutri-unlock-banner__text b { font-size: 0.98rem; color: var(--text-primary); }
.nutri-unlock-banner__text span { font-size: 0.8rem; color: var(--text-secondary); }
.nutri-unlock-meter { height: 6px; border-radius: 99px; background: rgba(255,255,255,0.12); overflow: hidden; margin-top: 6px; }
.nutri-unlock-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #34A853, #00f3ff); }

/* Response curves: locked foods */
.rc-food-card { position: relative; }
.rc-food-card.is-locked { border-style: dashed; }
.rc-food-card .nutri-lock-badge { top: 8px; bottom: auto; inset-inline-end: 8px; }
.rc-locked { padding: var(--space-lg); border-radius: var(--radius-md); border: 1px dashed rgba(66,133,244,0.45); background: linear-gradient(135deg, rgba(66,133,244,0.12), rgba(157,0,255,0.10)); display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.rc-locked[hidden] { display: none; }
.rc-locked p { color: var(--text-secondary); font-size: 0.9rem; max-width: 460px; }
.rc-chart-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.rc-chart-head-text { min-width: 0; }

/* ---------------------------------------------------------------------------
   Heart (save / like)
   --------------------------------------------------------------------------- */
.nutri-heart {
  position: relative; flex-shrink: 0;
  width: 34px; height: 34px; padding: 0; border-radius: 50%;
  display: inline-grid; place-items: center; cursor: pointer;
  border: 1px solid var(--glass-border); background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.nutri-heart svg { width: 18px; height: 18px; display: block; overflow: visible; }
.nutri-heart svg path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; transition: fill 0.2s; }
.nutri-heart:hover { color: var(--nutri-heart); border-color: rgba(255,61,127,0.45); }
.nutri-heart:active { transform: scale(0.92); }
.nutri-heart:focus-visible { outline: 2px solid var(--nutri-heart); outline-offset: 2px; }
.nutri-heart[aria-pressed="true"] { color: var(--nutri-heart); border-color: rgba(255,61,127,0.6); background: rgba(255,61,127,0.14); }
.nutri-heart[aria-pressed="true"] svg path { fill: currentColor; }
.nutri-heart.is-pop svg { animation: nutri-heart-pop 0.5s var(--nutri-ease-spring); }
.nutri-heart.is-pop::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--nutri-heart); opacity: 0;
  animation: nutri-heart-ring 0.55s var(--nutri-ease-out);
}
@keyframes nutri-heart-pop { 0% { transform: scale(1); } 35% { transform: scale(1.35); } 65% { transform: scale(0.9); } 100% { transform: scale(1); } }
@keyframes nutri-heart-ring { 0% { opacity: 0.9; transform: scale(0.6); } 100% { opacity: 0; transform: scale(1.5); } }
.nutri-heart--sm { width: 26px; height: 26px; }
.nutri-heart--sm svg { width: 14px; height: 14px; }
.nutri-heart--lg { width: 42px; height: 42px; }
.nutri-heart--lg svg { width: 22px; height: 22px; }
.nutri-heart--onfill { background: rgba(255,255,255,0.22); border-color: rgba(255,255,255,0.45); color: #fff; }
.nutri-heart--onfill[aria-pressed="true"] { background: #fff; color: var(--nutri-heart); }
.food-head-actions { display: flex; flex-direction: column; gap: 8px; align-items: center; flex-shrink: 0; }
.cat-capsule { justify-content: space-between; gap: 10px; }
.cat-capsule .nutri-heart { position: relative; z-index: 1; }
.metric-row .mr-title-primary .nutri-heart { margin-inline-start: 2px; }

/* ---------------------------------------------------------------------------
   Sign-in modal
   --------------------------------------------------------------------------- */
.nutri-login-card { max-width: 440px; text-align: center; padding: 34px 26px 26px; position: relative; }
.nutri-login-close { position: absolute; top: 10px; inset-inline-end: 12px; }
.nutri-login-art { position: relative; width: 92px; height: 92px; margin: 0 auto 14px; }
.nutri-login-art span { position: absolute; inset: 0; border-radius: 50%; }
.nutri-login-art span:nth-child(1) { background: conic-gradient(#4285F4, #34A853, #FBBC05, #EA4335, #4285F4); animation: nutri-ring-a 6s linear infinite; -webkit-mask: radial-gradient(circle, transparent 60%, #000 61%); mask: radial-gradient(circle, transparent 60%, #000 61%); }
.nutri-login-art span:nth-child(2) { inset: 16px; background: linear-gradient(135deg, #9d00ff, #00f3ff); opacity: 0.85; }
.nutri-login-art span:nth-child(3) { inset: 34px; background: #fff; box-shadow: 0 0 20px rgba(255,255,255,0.6); }
@keyframes nutri-ring-a { to { transform: rotate(360deg); } }
.nutri-login-title { font-size: 1.3rem; font-weight: 800; margin-bottom: 8px; color: var(--text-primary); }
.nutri-login-text { color: var(--text-secondary); font-size: 0.92rem; line-height: 1.7; margin-bottom: 18px; }
.nutri-login-fine { margin-top: 14px; font-size: 0.72rem; color: var(--text-muted); line-height: 1.6; }
/* IRNSCA account (e-mail + password) — shown only when the server offers it */
.nutri-pw-block[hidden] { display: none; }
.nutri-pw-or { display: flex; align-items: center; gap: 10px; margin: 16px 0 10px; color: var(--text-muted); font-size: 0.78rem; }
.nutri-pw-or::before, .nutri-pw-or::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,0.14); }
.nutri-pw-form { display: grid; gap: 8px; text-align: start; }
.nutri-pw-form .screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.nutri-pw-title { font-weight: 700; font-size: 0.92rem; color: var(--text-primary); margin: 0 0 2px; }
.nutri-pw-form input { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.06); color: var(--text-primary); font-size: 0.95rem; box-sizing: border-box; }
.nutri-pw-form input:focus { outline: 2px solid #00bfd6; outline-offset: 1px; }
.nutri-pw-submit { min-height: 44px; border: 0; border-radius: 12px; background: linear-gradient(135deg, #9d00ff, #00bfd6); color: #fff; font-weight: 700; font-size: 0.95rem; cursor: pointer; }
.nutri-pw-submit:disabled { opacity: 0.6; cursor: progress; }
.nutri-pw-msg { min-height: 1.2em; margin: 0; font-size: 0.8rem; }
.nutri-pw-msg.is-error { color: #ff5577; }
.nutri-pw-msg.is-ok { color: #22c55e; }
.nutri-pw-hint { margin: 0; font-size: 0.72rem; color: var(--text-muted); line-height: 1.6; }

/* ---------------------------------------------------------------------------
   Content protection layers (see protection.js — real effects only)
   --------------------------------------------------------------------------- */
.nutri-noselect, .nutri-noselect * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.nutri-noselect input, .nutri-noselect textarea, .nutri-noselect select, .nutri-noselect [contenteditable="true"] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
.nutri-nodrag img, .nutri-nodrag svg { -webkit-user-drag: none; }

.nutri-shield {
  position: fixed; inset: 0; z-index: 2147483000; display: none;
  align-items: center; justify-content: center; padding: 24px;
  background: #05060a; color: #fff; text-align: center;
}
.nutri-shield__box { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 360px; }
.nutri-shield__box svg { width: 54px; height: 54px; color: var(--neon-cyan); }
.nutri-shield__box b { font-size: 1.1rem; }
.nutri-shield__box span { font-size: 0.85rem; color: #9aa8bd; line-height: 1.6; }
/* When shielded, the real content is not painted at all (visibility, not blur). */
html.nutri-shielded .nutri-shield { display: flex; }
html.nutri-shielded #app-wrapper,
html.nutri-shielded .modal-overlay,
html.nutri-shielded #toast-container,
html.nutri-shielded #language-overlay { visibility: hidden !important; }

.nutri-watermark {
  position: fixed; inset: 0; z-index: 2100; pointer-events: none; display: none;
  background-repeat: repeat; opacity: 0.07;
}
html.nutri-wm-on .nutri-watermark { display: block; }
[data-theme="light"] .nutri-watermark { opacity: 0.06; }

@media print {
  html.nutri-noprint #nutrition-app-root { display: none !important; }
  html.nutri-noprint body::after {
    content: "This content is protected and cannot be printed. (Greenway of Health / IRNSCA)";
    display: block; padding: 40px; font: 16px sans-serif; color: #000; text-align: center;
  }
}

/* Mobile: keep the new controls tidy */
@media (max-width: 768px) {
  .nutri-auth-btn .nutri-auth-label { display: none; }
  .nutri-auth-btn { padding: 0 4px; }
  .nutri-menu { position: fixed; top: 64px; left: 12px; right: 12px; }
  .nutri-lock-cta .nutri-gbtn__text small { display: none; }
  .nutri-unlock-banner { margin-inline: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .nutri-gbtn__ring, .nutri-gbtn__shine, .nutri-login-art span { animation: none !important; }
  .nutri-heart.is-pop svg, .nutri-heart.is-pop::after { animation: none !important; }
  .nutri-menu.open { animation: none; }
}
