@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=Noto+Sans+Bengali:wght@300;400;500;600;700&family=Noto+Sans+Tamil:wght@300;400;500;600;700&family=Noto+Sans+Telugu:wght@300;400;500;600;700&family=Noto+Sans+Devanagari:wght@300;400;500;600;700&display=swap');

/* ==========================================================================
   1. DESIGN SYSTEM VARIABLES (:root)
   ========================================================================== */
:root {
  /* Colors (3 Depths of Background) */
  --bg-base: #0D0D0D;             /* Deepest background */
  --bg-surface: #161616;          /* Card panels */
  --bg-elevated: #1E1E1E;         /* Hover states and dropdowns */

    /* Theme Colors Mappings */
  --bg-primary: var(--bg-base);
  --bg-secondary: var(--bg-surface);
  --bg-tertiary: var(--bg-elevated);

  /* Accents */
  --accent-primary: #FF6B35;       /* Primary Brand Orange */
  --accent-secondary: #FF8C42;     /* Lighter secondary orange */
  --accent-glow: rgba(255, 107, 53, 0.3);
  --accent-orange: var(--accent-primary);
  --accent-orange-glow: var(--accent-glow);
  --accent-orange-muted: rgba(255, 107, 53, 0.15);
   --accent-green: #00E676;         /* Neon Green for Exercise/Deficit */
  --accent-green-glow: rgba(0, 230, 118, 0.35);

  /* Glass Panels */
  --glass-bg: rgba(22, 22, 22, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);

  /* Text Colors */
  --text-primary: #F5F5F5;         /* Crisp main text */
  --text-secondary: #A3A3A3;       /* Muted secondary text */
  --text-tertiary: #737373;        /* Sub-metadata text */

  /* Status Colors */
  --success: #22C55E;
  --warning: #F59E0B;
  --danger: #EF4444;

   /* Typography Sizes (Converted to rem for clean scaling, baseline 16px) */
  --text-xs: 0.75rem;              /* 12px */
  --text-sm: 0.875rem;             /* 14px */
  --text-base: 1rem;               /* 16px */
  --text-lg: 1.125rem;             /* 18px */
  --text-xl: 1.25rem;              /* 20px */
  --text-2xl: 1.5rem;              /* 24px */
  --text-3xl: 2rem;                /* 32px */
  --text-4xl: 2.5rem;              /* 40px */

  /* Typography Fallbacks */
  --font-md: var(--text-base);
  --font-heading: var(--font-display);

  /* Typography Font Families & Weights */
  --font-display: 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-regional: 'Noto Sans', system-ui, sans-serif;

  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* Typography Line Heights */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;

  /* Spacing Scale (4px Base Unit) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Spacing Scale Mappings */
  --space-xxs: var(--space-1);     /* 4px */
  --space-xs: var(--space-2);      /* 8px */
  --space-sm: var(--space-3);      /* 12px */
  --space-md: var(--space-4);      /* 16px */
  --space-lg: var(--space-6);      /* 24px */
  --space-xl: var(--space-8);      /* 32px */
  --space-xxl: var(--space-12);    /* 48px */

  /* Shadows & Glows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px var(--accent-glow);

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

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;

  /* 3D Properties (GPU-Accelerated) */
  --perspective-card: 1000px;
  --perspective-container: 800px;
  --tilt-max: 3deg;
  --press-depth: translateZ(-2px);
}

/* ==========================================================================
   2. BASE & RESET STYLES
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--font-md);
  line-height: 1.6;
  overflow-x: hidden;
  padding-bottom: 180px; /* Leave room for mobile sticky footer by default */
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* ==========================================================================
   3. LAYOUT UTILITIES
   ========================================================================== */
.wrapper {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-md);
}

.main-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.sidebar-section {
  order: 1; /* Default mobile order: calculators first */
  width: 100%;
}

.food-section {
  order: 2; /* Default mobile order: list second */
  width: 100%;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }

/* ==========================================================================
   4. COMPONENT CLASSES
   ========================================================================== */

/* --- Header & Navigation --- */
header {
  border-bottom: 1px solid var(--border-color);
  background: rgba(10, 6, 5, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: var(--transition-smooth);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  position: relative;
}

.logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--font-xxl);
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  letter-spacing: -0.02em;
}

.logo span {
  color: var(--accent-orange);
  text-shadow: 0 0 12px var(--accent-orange-glow);
}

.nav-menu {
  position: fixed;
  top: 64px;
  right: -100%;
  width: 280px;
  height: calc(100vh - 64px);
  background: rgba(19, 13, 11, 0.98);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: var(--space-xxl) var(--space-lg);
  gap: var(--space-xl);
  list-style: none;
  transition: var(--transition-smooth);
  z-index: 999;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.6);
}

.nav-menu.active {
  right: 0;
}

.nav-menu a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 1.1rem;
  width: 100%;
  padding: var(--space-xs) 0;
  border-bottom: 1px solid rgba(255, 107, 53, 0.04);
  transition: var(--transition-smooth);
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--accent-orange);
  border-bottom-color: var(--accent-orange);
  padding-left: var(--space-xs);
}

/* Hamburger Toggle */
.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  cursor: pointer;
  z-index: 1001;
}

.menu-toggle .bar {
  width: 100%;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: var(--radius-full);
  transition: var(--transition-smooth);
}

.menu-toggle.active .bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.menu-toggle.active .bar:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active .bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* --- Glass Panels (Layout Cards) --- */
.glass-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-lg);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.glass-panel::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
  pointer-events: none;
  border: 1px solid transparent;
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.1), transparent) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
}

.panel-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--font-xxl);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  letter-spacing: -0.01em;
}

.panel-title span {
  color: var(--accent-orange);
}

/* --- Buttons --- */
.tab-btn {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 0.6rem 1.25rem;
  border-radius: 30px;
  font-family: var(--font-heading);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-sm);
}

.tab-btn:hover {
  border-color: var(--accent-orange);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.tab-btn.active {
  background: var(--accent-orange-muted);
  color: var(--accent-orange);
  border-color: var(--accent-orange);
  box-shadow: 0 0 12px rgba(255, 107, 53, 0.15);
}

.tab-btn.btn-burn {
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.tab-btn.btn-burn.active {
  background: rgba(0, 230, 118, 0.08);
  color: var(--accent-green);
  border-color: var(--accent-green);
  box-shadow: 0 0 12px rgba(0, 230, 118, 0.15);
}

.btn-reset {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 0.6rem 1.5rem;
  border-radius: 30px;
  font-family: var(--font-heading);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-reset:hover {
  border-color: var(--accent-orange);
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.btn-submit {
  background: var(--accent-orange);
  color: var(--bg-primary);
  border: none;
  outline: none;
  padding: 0.85rem 2.5rem;
  border-radius: 30px;
  font-family: var(--font-heading);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 12px var(--accent-orange-muted);
}

.btn-submit:hover {
  background: #ff7f4d;
  box-shadow: 0 0 18px var(--accent-orange-glow);
  transform: translateY(-2px);
}

/* --- Forms & Inputs --- */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: var(--font-sm);
  margin-bottom: var(--space-xs);
  font-weight: 500;
}

.form-label span.value-val {
  color: var(--accent-orange);
  font-weight: 600;
}

.range-input {
  width: 100%;
  -webkit-appearance: none;
  background: var(--bg-tertiary);
  height: 6px;
  border-radius: var(--radius-full);
  outline: none;
}

.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--accent-orange);
  cursor: pointer;
  box-shadow: 0 0 12px var(--accent-orange-glow);
  transition: transform 0.15s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.range-input::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

.toggle-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

.toggle-btn {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.toggle-btn:hover {
  border-color: var(--accent-orange);
  color: var(--text-primary);
}

.toggle-btn.active {
  background: var(--accent-orange-muted);
  color: var(--accent-orange);
  border-color: var(--accent-orange);
}

/* --- Segmented Control for Biological Gender --- */
.segmented-control {
  position: relative;
  display: flex;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  padding: 4px;
  margin-bottom: var(--space-md);
  overflow: hidden;
  height: 50px;
  align-items: center;
}

.segmented-slider {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: var(--accent-orange);
  border-radius: 25px;
  transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 0 15px var(--accent-orange-glow);
  z-index: 1;
}

.segmented-btn {
  position: relative;
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  height: 100%;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  z-index: 2;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.segmented-btn.active {
  color: var(--bg-primary);
}

/* --- Premium Custom Range Sliders --- */
.range-container {
  position: relative;
  width: 100%;
  height: 24px;
  display: flex;
  align-items: center;
  margin-top: 8px;
}

.range-input {
  position: relative;
  width: 100%;
  -webkit-appearance: none;
  background: var(--bg-tertiary) !important;
  height: 6px;
  border-radius: var(--radius-full);
  outline: none;
  z-index: 2;
  border: 1px solid rgba(255, 107, 53, 0.08);
}

/* Track Fills (underneath thumb) */
.range-track-fill {
  position: absolute;
  left: 0;
  height: 6px;
  background: var(--accent-orange);
  border-radius: var(--radius-full);
  z-index: 1;
  pointer-events: none;
  transition: width 0.05s linear;
  box-shadow: 0 0 10px var(--accent-orange-glow);
}

/* Thumb Styles */
.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-orange) !important;
  border: 2px solid var(--text-primary) !important;
  cursor: pointer;
  box-shadow: 0 0 12px var(--accent-orange-glow) !important;
  transition: transform 0.15s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.15s ease;
}

.range-input:active::-webkit-slider-thumb {
  transform: scale(1.35);
  box-shadow: 0 0 24px var(--accent-orange-glow), 0 0 0 8px rgba(255, 107, 53, 0.15) !important;
}

.range-input::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Sliding values dynamic animation */
.sliding-value {
  display: inline-block;
  transition: transform 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.2s ease;
}

.form-group.dragging .sliding-value {
  color: var(--accent-orange);
  transform: scale(1.25);
  text-shadow: 0 0 10px var(--accent-orange-glow);
}

/* --- Interactive Calculator Result Card --- */
.calculator-result-card {
  background: linear-gradient(135deg, rgba(25, 16, 14, 0.9) 0%, rgba(15, 10, 8, 0.95) 100%);
  border: 1px solid rgba(255, 107, 53, 0.18);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-top: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  box-shadow: var(--shadow-md);
  transform: translateY(10px);
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.25, 1, 0.5, 1), transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  position: relative;
  overflow: hidden;
}

.calculator-result-card.show {
  opacity: 1;
  transform: translateY(0);
}

/* Result Progress Ring */
.result-ring-container {
  position: relative;
  width: 90px;
  height: 90px;
  flex-shrink: 0;
}

.result-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.result-ring-track {
  fill: none;
  stroke: var(--bg-tertiary);
  stroke-width: 8;
}

.result-ring-fill {
  fill: none;
  stroke: var(--accent-green);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 251.2; /* 2 * PI * r = 2 * 3.14159 * 40 = 251.2 */
  stroke-dashoffset: 251.2;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 6px var(--accent-green-glow));
}

.result-ring-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.result-ring-percent {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-primary);
}

.result-ring-label {
  font-size: 0.6rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Result metrics */
.result-metrics {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.metric-item {
  display: flex;
  flex-direction: column;
}

.metric-title {
  font-size: 0.65rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-value {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.2;
}

.metric-value.orange {
  color: var(--accent-orange);
  text-shadow: 0 0 10px rgba(255, 107, 53, 0.2);
}

.metric-value.green {
  color: var(--accent-green);
  text-shadow: 0 0 10px rgba(0, 230, 118, 0.2);
}

.select-input {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  outline: none;
  transition: var(--transition-smooth);
}

.select-input:focus {
  border-color: var(--accent-orange);
  box-shadow: 0 0 10px rgba(255, 107, 53, 0.08);
}

.input-text {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.85rem 1.25rem;
  font-family: var(--font-body);
  outline: none;
  margin-bottom: var(--space-md);
  transition: var(--transition-smooth);
}

.input-text:focus {
  border-color: var(--accent-orange);
  box-shadow: 0 0 10px rgba(255, 107, 53, 0.08);
}

/* --- Search Bar --- */
.search-wrapper {
  margin-bottom: var(--space-lg);
  position: relative;
}

.search-container {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-xxs);
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-sm);
}

.search-container:focus-within {
  border-color: var(--accent-orange);
  box-shadow: 0 0 20px var(--accent-orange-muted);
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 0.75rem 1.25rem;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
}

.search-input::placeholder {
  color: var(--text-secondary);
}

.btn-clear-search {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0 var(--space-xs);
  font-size: 1.25rem;
  display: none;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.btn-clear-search:hover {
  color: var(--accent-primary);
}

.search-btn {
  background: var(--accent-orange);
  color: var(--bg-primary);
  border: none;
  outline: none;
  padding: 0 1.5rem;
  border-radius: calc(var(--radius-md) - 4px);
  font-family: var(--font-heading);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.search-btn:hover {
  background: #ff7f4d;
  box-shadow: 0 0 15px var(--accent-orange-glow);
}

/* --- Navigation & Tabs containers --- */
.tabs-container {
  display: flex;
  gap: var(--space-xs);
  overflow-x: auto;
  padding-bottom: var(--space-xs);
  margin-bottom: var(--space-xl);
  scrollbar-width: thin;
  scrollbar-color: var(--accent-orange) var(--bg-primary);
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
}

.tabs-container::-webkit-scrollbar {
  height: 4px;
}

.tabs-container::-webkit-scrollbar-thumb {
  background: var(--accent-orange);
  border-radius: 2px;
}

.mobile-category-container {
  display: none !important;
  margin-bottom: var(--space-xl);
}
.mobile-category-select {
  border-radius: 30px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 0.85rem 1.5rem;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1rem;
  color: var(--text-primary);
  width: 100%;
  outline: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-sm);
  background-image: linear-gradient(45deg, transparent 50%, var(--accent-orange) 50%), linear-gradient(135deg, var(--accent-orange) 50%, transparent 50%);
  background-position: calc(100% - 22px) calc(1em + 2px), calc(100% - 17px) calc(1em + 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.mobile-category-select:focus {
  border-color: var(--accent-orange);
  box-shadow: 0 0 15px var(--accent-orange-muted);
}

/* --- Concentric Calorie Radial Meter --- */
.meter-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: var(--space-lg) 0 var(--space-md) 0;
}

.radial-meter {
  position: relative;
  width: 200px;
  height: 200px;
}

.radial-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.radial-track {
  fill: none;
  stroke: var(--bg-tertiary);
  stroke-width: 12;
}

.radial-progress {
  fill: none;
  stroke: var(--accent-green);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 565.48;
  stroke-dashoffset: 565.48;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.5s ease;
  filter: drop-shadow(0 0 8px var(--accent-green-glow));
}

.radial-progress.exceeded {
  stroke: var(--accent-orange);
  filter: drop-shadow(0 0 8px var(--accent-orange-glow));
}

.radial-progress.positive {
  stroke: var(--accent-green);
  filter: drop-shadow(0 0 8px var(--accent-green-glow));
}

.meter-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.meter-val {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 2.4rem;
  color: var(--text-primary);
  line-height: 1.1;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.meter-lbl {
  font-size: var(--font-xs);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: var(--space-xxs);
}

.summary-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-top: var(--space-md);
  border-top: 1px solid var(--border-color);
  padding-top: var(--space-md);
  width: 100%;
}

.stat-item {
  text-align: center;
}

.stat-val {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.25rem;
}

.stat-val.orange {
  color: var(--accent-orange);
}

.stat-val.green {
  color: var(--accent-green);
}

.stat-lbl {
  font-size: var(--font-xs);
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-top: var(--space-xxs);
  letter-spacing: 0.05em;
}

/* --- Food Section & Cards Grid --- */
.food-section-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--font-xl);
  margin-bottom: var(--space-md);
  padding-left: var(--space-xs);
  border-left: 3px solid var(--accent-orange);
  letter-spacing: -0.01em;
}

.food-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-12);
  perspective: var(--perspective-container);
  transform-style: preserve-3d;
}

.food-card {
  background: var(--bg-surface);
  border: 1px solid var(--accent-glow);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
  position: relative;
  will-change: transform, box-shadow;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  min-height: 280px;
  transform-style: preserve-3d;
  perspective: var(--perspective-card);
}

.food-card:hover {
  transform: perspective(var(--perspective-card)) rotateX(var(--tilt-max)) rotateY(2deg) translateY(-6px);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-lg), 0 12px 30px var(--accent-glow);
}

.food-card.active {
  border-color: var(--accent-primary);
  border-left: 4px solid var(--accent-primary);
  background: linear-gradient(90deg, var(--accent-glow) 0%, var(--bg-surface) 100%);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.food-card.active.burn {
  border-color: var(--success);
  border-left: 4px solid var(--success);
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.04) 0%, var(--bg-surface) 100%);
  box-shadow: var(--shadow-lg), 0 0 15px rgba(34, 197, 94, 0.15);
}

/* Card Image Area (16:9 aspect ratio, placeholder gradient) */
.card-image-area {
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-elevated) 100%);
  border-bottom: 1px solid var(--accent-glow);
}

.card-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.15;
  transition: var(--transition-smooth);
}

.food-card:hover .card-image-placeholder {
  opacity: 0.28;
  transform: scale(1.05);
}

.placeholder-icon {
  font-size: 2.2rem;
}

/* Category-specific Mesh Gradients for food picture placeholders */
.gradient-assamese {
  background: linear-gradient(135deg, #3a1c12 0%, #ff6b35 100%);
}
.gradient-northeast {
  background: linear-gradient(135deg, #1b3a1e 0%, #4caf50 100%);
}
.gradient-staples {
  background: linear-gradient(135deg, #3a2e12 0%, #ffc107 100%);
}
.gradient-snacks {
  background: linear-gradient(135deg, #3a1224 0%, #e91e63 100%);
}
.gradient-beverages {
  background: linear-gradient(135deg, #12343a 0%, #00bcd4 100%);
}
.gradient-burn {
  background: linear-gradient(135deg, #112c24 0%, #00e676 100%);
}
.gradient-default {
  background: linear-gradient(135deg, #1f1412 0%, #281a17 100%);
}

/* Future-proofing for food images if added */
.card-image-area img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  transition: var(--transition-smooth);
}

.food-card:hover .card-image-area img {
  transform: scale(1.05);
}

/* Calorie Badge top-right */
.calorie-badge {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  background: var(--accent-primary);
  color: var(--bg-base);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: var(--font-bold);
  font-size: var(--text-xs);
  box-shadow: var(--shadow-sm);
  z-index: 2;
  transition: transform var(--transition-fast);
}

.calorie-badge.burn {
  background: var(--success);
}

/* Card Body padding */
.card-body {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-2);
}

.card-title {
  font-family: var(--font-display);
  font-weight: var(--font-semibold);
  font-size: var(--text-lg);
  color: var(--text-primary);
  line-height: var(--leading-tight);
}

.card-title .regional-lang {
  display: block;
  font-family: var(--font-regional);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: var(--font-normal);
  margin-top: 2px;
}

.indicator-dot {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  border: 1px solid var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: transparent;
  transition: var(--transition-base);
}

.food-card.active .indicator-dot {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--bg-base);
}

.food-card.active.burn .indicator-dot {
  background: var(--success);
  border-color: var(--success);
  color: var(--bg-base);
}

.card-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
  flex-grow: 1;
  line-height: var(--leading-normal);
}

.card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-bottom .card-controls {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.serving-lbl {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.serving-lbl span {
  display: block;
  font-family: var(--font-display);
  font-weight: var(--font-bold);
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-top: 2px;
}

.food-card.active.burn .serving-lbl span {
  color: var(--success);
}

.card-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--accent-glow);
}

.card-controls.burn {
  border-color: rgba(34, 197, 94, 0.2);
}

.control-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition-fast);
  outline: none;
}

.control-btn:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--bg-base);
}

.control-btn.btn-burn:hover {
  background: var(--success);
  border-color: var(--success);
  color: var(--bg-base);
}

/* Button Active Press Depth Animation */
.control-btn:active,
.btn-add-plate:active {
  transform: var(--press-depth) scale(0.97);
}

/* Full-width Add to Plate / Burn Button */
.btn-add-plate {
  width: 100%;
  background: var(--accent-primary);
  color: var(--bg-base);
  border: none;
  outline: none;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-weight: var(--font-bold);
  cursor: pointer;
  transition: transform var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: 0 4px 12px var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
}

.btn-add-plate:hover {
  background: var(--accent-secondary);
  box-shadow: 0 0 15px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-add-plate.burn {
  background: var(--success);
  color: var(--bg-base);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.15);
}

.btn-add-plate.burn:hover {
  background: #33ff99;
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.3);
}

.control-qty {
  font-family: var(--font-display);
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
  min-width: 15px;
  text-align: center;
}

/* --- Floating Footer Thali Bar & collapsible drawer --- */
.thali-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
  background: rgba(13, 13, 13, 0.95);
  border-top: 1px solid var(--accent-glow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 100;
  transform: translateY(100%) rotateX(-5deg);
  transform-origin: bottom center;
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), height 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
  perspective: 800px;
  height: 80px; /* default collapsed height on mobile */
}

.thali-footer.visible {
  transform: translateY(0) rotateX(0deg);
}

@media (min-width: 768px) {
  .thali-footer {
    height: 90px; /* desktop height */
    padding-bottom: 0;
  }
}

.thali-footer.expanded {
  height: 60vh;
}

.thali-drag-handle {
  width: 40px;
  height: 4px;
  background: var(--text-tertiary);
  border-radius: 2px;
  margin: var(--space-2) auto 0 auto;
  cursor: pointer;
}
@media (min-width: 768px) {
  .thali-drag-handle {
    display: none;
  }
}

.thali-bar {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  cursor: pointer;
  position: relative;
}
@media (min-width: 768px) {
  .thali-bar {
    padding: var(--space-3) var(--space-4);
    cursor: default;
    gap: var(--space-4);
  }
}
.thali-info {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 1;
  min-width: 0;
}

@media (min-width: 768px) {
  .thali-info {
    gap: var(--space-3);
    flex-shrink: 0;
  }
}
.thali-icon-container {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--accent-primary);
  position: relative;
  box-shadow: 0 0 8px var(--accent-glow);
}
@media (min-width: 768px) {
  .thali-icon-container {
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
    box-shadow: 0 0 10px var(--accent-glow);
  }
}
.thali-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--accent-primary);
  color: var(--bg-base);
  font-family: var(--font-display);
  font-weight: var(--font-bold);
  font-size: 9px;
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (min-width: 768px) {
  .thali-badge {
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    font-size: var(--text-xs);
  }
}
.thali-text {
  text-align: left;
}
.thali-title {
  font-family: var(--font-display);
  font-weight: var(--font-semibold);
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.2;
}
@media (min-width: 768px) {
  .thali-title {
    font-size: var(--text-base);
  }
}
.thali-title span {
  color: var(--accent-primary);
}
.thali-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
}
@media (min-width: 768px) {
  .thali-subtitle {
    font-size: var(--text-xs);
  }
}
/* Absolute positioned progress bar at the top on mobile, normal in desktop */
.thali-progress-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: none;
  height: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

@media (min-width: 768px) {
  .thali-progress-wrapper {
    position: static;
    max-width: 400px;
    height: auto;
    gap: var(--space-1);
  }
}

.thali-progress-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-elevated);
  border: none;
  border-radius: 0;
  overflow: hidden;
}

@media (min-width: 768px) {
  .thali-progress-bar {
    height: 8px;
    border-radius: var(--radius-full);
    border: 1px solid var(--accent-glow);
  }
}

.thali-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 0;
  transition: width 0.3s ease;
  box-shadow: 0 0 8px var(--accent-glow);
}

@media (min-width: 768px) {
  .thali-progress-fill {
    border-radius: var(--radius-full);
  }
}

.thali-progress-label {
  display: none;
}

@media (min-width: 768px) {
  .thali-progress-label {
    display: inline;
    font-size: var(--text-xs);
    color: var(--text-secondary);
    font-weight: var(--font-medium);
  }
}

.thali-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-shrink: 1;
  min-width: 0;
  width: auto;
}

@media (min-width: 768px) {
  .thali-actions {
    gap: var(--space-4);
    flex-shrink: 0;
  }
}
.thali-net-readout-wrapper {
  font-size: 0.9rem;
  color: var(--text-primary);
  white-space: nowrap;
  margin-right: 0.35rem;
}
@media (min-width: 768px) {
  .thali-net-readout-wrapper {
    font-size: var(--text-base);
  }
}
/* Collapsible drawer items list */
.thali-drawer-content {
  display: none;
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-4);
  height: calc(100% - 90px);
  overflow-y: auto;
}

.thali-footer.expanded .thali-drawer-content {
  display: block;
}

.drawer-section-title {
  font-family: var(--font-display);
  font-weight: var(--font-bold);
  font-size: var(--text-lg);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  text-align: left;
}

.thali-items-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: 0;
}

.thali-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--accent-glow);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.thali-item-row:hover {
  background: var(--bg-elevated);
}

.thali-item-name-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.thali-item-name {
  font-weight: var(--font-semibold);
  font-size: var(--text-base);
  color: var(--text-primary);
}

.thali-item-qty-desc {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.thali-item-calories {
  font-weight: var(--font-bold);
  font-size: var(--text-base);
  color: var(--accent-primary);
  margin-left: auto;
  margin-right: var(--space-4);
}

.thali-item-calories.burn {
  color: var(--success);
}

.btn-delete-item {
  background: transparent;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: var(--space-2);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
  font-size: 1.1rem;
}

.btn-delete-item:hover {
  background: rgba(239, 68, 68, 0.1);
}
/* --- Info/Scientific Overview Section --- */
.info-section {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  border: 1px solid var(--border-color);
  margin-top: var(--space-xxl);
  margin-bottom: var(--space-lg);
}

.info-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.6rem;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
  display: block;
}

.info-title span {
  color: var(--accent-orange);
}

.info-block {
  margin-bottom: var(--space-lg);
}

.info-block:last-child {
  margin-bottom: 0;
}

.info-subtitle {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.15rem;
  margin-bottom: var(--space-xs);
  color: var(--accent-orange);
}

.info-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* --- Compliance & Informative layouts --- */
.compliance-container {
  max-width: 800px;
  margin: var(--space-xl) auto;
  padding: 0 var(--space-md);
}

.compliance-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--font-title);
  margin-bottom: var(--space-md);
  color: var(--text-primary);
  border-bottom: 2px solid var(--accent-orange);
  padding-bottom: var(--space-xs);
}

.compliance-content {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.compliance-content h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--text-primary);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-xs);
}

.compliance-content p {
  margin-bottom: var(--space-md);
}

.compliance-content ul {
  margin-bottom: var(--space-md);
  padding-left: var(--space-lg);
}

.compliance-content li {
  margin-bottom: var(--space-xxs);
}

.contact-form {
  margin-top: var(--space-lg);
}

/* --- AdSense Placeholders --- */
.adsense-placeholder {
  display: none !important;
  width: 100%;
  margin: var(--space-md) 0;
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px dashed rgba(255, 107, 53, 0.1);
  align-items: center;
  justify-content: center;
  min-height: 90px;
  color: var(--text-secondary);
  font-size: var(--font-xs);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  overflow: hidden;
  position: relative;
}

.adsense-placeholder::before {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 107, 53, 0.03), transparent);
  animation: shine 3s infinite;
}

.ads-sidebar {
  min-height: 250px;
}

.ads-in-feed {
  min-height: 120px;
}

/* --- Footer Compliance panel --- */
footer {
  background: #080404;
  border-top: 1px solid var(--border-color);
  padding: var(--space-xxl) var(--space-md) var(--space-3xl);
  color: var(--text-secondary);
  font-size: var(--font-sm);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

.footer-brand h4 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.footer-brand h4 span {
  color: var(--accent-orange);
}

.footer-brand p {
  line-height: 1.6;
  max-width: 400px;
}

.footer-links h5 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  font-size: 1rem;
  margin-bottom: var(--space-sm);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.footer-links ul {
  list-style: none;
}

.footer-links ul li {
  margin-bottom: var(--space-xs);
}

.footer-links ul a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition-smooth);
}

.footer-links ul a:hover {
  color: var(--accent-orange);
  padding-left: 4px;
}

.footer-bottom {
  max-width: 1200px;
  margin: var(--space-xl) auto 0;
  padding-top: var(--space-md);
  border-top: 1px solid rgba(255, 107, 53, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.footer-bottom p {
  font-size: 0.8rem;
}

/* ==========================================================================
   5. KEYFRAMES & MICRO-ANIMATIONS
   ========================================================================== */
@keyframes shine {
  0% { left: -150%; }
  50% { left: 150%; }
  100% { left: 150%; }
}

/* Food Card Entrance Animation */
@keyframes cardEntrance {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.food-card:not(.skeleton-card) {
  animation: cardEntrance 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* 3D button press active effects on other controls */
.tab-btn:active,
.gender-btn:active,
.btn-reset:active,
.search-btn:active,
#btn-apply-target:active,
.mobile-category-select:active {
  transform: var(--press-depth) scale(0.97);
  filter: brightness(0.9);
}

/* Skeleton Loading State Shimmer & Pulse */
.skeleton-card {
  pointer-events: none;
  border-color: rgba(255, 107, 53, 0.05) !important;
}
.skeleton-element {
  background: linear-gradient(
    90deg,
    rgba(31, 20, 18, 0.6) 25%,
    rgba(40, 26, 23, 0.8) 37%,
    rgba(31, 20, 18, 0.6) 63%
  );
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* Toast Container & Toasts */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  pointer-events: none;
  max-width: 350px;
  width: calc(100% - 48px);
}

@media (max-width: 600px) {
  .toast-container {
    top: 16px;
    right: 16px;
    left: 16px;
    width: calc(100% - 32px);
    max-width: none;
  }
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg), 0 10px 30px rgba(0, 0, 0, 0.5);
  color: var(--text-primary);
  pointer-events: auto;
  animation: toastEntrance 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity var(--transition-base), transform var(--transition-base);
}

.toast.hide {
  opacity: 0;
  transform: translateY(-20px) scale(0.9);
}

@keyframes toastEntrance {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast-success {
  border-left: 4px solid var(--success);
}
.toast-success i {
  color: var(--success);
}

.toast-danger {
  border-left: 4px solid var(--danger);
}
.toast-danger i {
  color: var(--danger);
}

.toast-info {
  border-left: 4px solid var(--accent-primary);
}
.toast-info i {
  color: var(--accent-primary);
}


/* Onboarding Tour styles */
.tour-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  pointer-events: auto;
  animation: tourFadeIn 0.3s ease forwards;
}

.tour-tooltip {
  position: absolute;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--accent-orange-muted);
  box-shadow: var(--shadow-lg), 0 0 25px var(--accent-orange-glow);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  max-width: 320px;
  width: calc(100% - 32px);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  animation: tourScaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.tour-tooltip-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.tour-tooltip-body {
  font-size: var(--text-sm);
  color: var(--text-primary);
  line-height: var(--leading-normal);
}

.tour-tooltip-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-xs);
}

.tour-badge {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-weight: 500;
}

.tour-btn {
  background: var(--accent-primary);
  color: var(--bg-base);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.tour-btn:hover {
  background: var(--accent-secondary);
  transform: translateY(-1px);
}

.tour-btn-skip {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.tour-btn-skip:hover {
  border-color: rgba(255, 255, 255, 0.5);
  color: var(--text-primary);
}

.tour-highlight {
  position: relative;
  z-index: 10001 !important;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6), 0 0 15px var(--accent-orange-glow) !important;
  pointer-events: auto !important;
  border-color: var(--accent-orange) !important;
  background-color: var(--bg-surface) !important;
}

@keyframes tourFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes tourScaleUp {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* Stylized Empty State Placeholders */
.empty-plate-state {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  width: 100%;
}

.empty-search-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-xxl) var(--space-md);
  background: var(--glass-bg);
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin: var(--space-md) 0;
}

/* ==========================================================================
   6. RESPONSIVE MEDIA QUERIES (Mobile-First)
   ========================================================================== */

/* Small Devices (Landscape / Tablet-ish): Min 600px */
@media (min-width: 600px) {
  .food-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Medium Devices (Tablets): Min 768px */
@media (min-width: 768px) {
  body {
    padding-bottom: 120px; /* Standard bottom padding for desktop footer bar */
  }

  .nav-menu {
    position: static;
    width: auto;
    height: auto;
    background: transparent;
    border-left: none;
    flex-direction: row;
    padding: 0;
    gap: 1.5rem;
    box-shadow: none;
  }

  .nav-menu a {
    font-size: 0.95rem;
    padding: 0;
    border-bottom: none;
  }

  .nav-menu a:hover,
  .nav-menu a.active {
    padding-left: 0;
  }

  .menu-toggle {
    display: none;
  }

  .tabs-container {
    display: flex; /* Display tabs list on tablets/desktops */
  }

  .mobile-category-container {
    display: none; /* Hide mobile category dropdown */
  }

  .thali-bar {
    flex-direction: row;
    padding: 1.25rem var(--space-lg);
    text-align: left;
    gap: var(--space-lg);
  }

  .thali-actions {
    width: auto;
    justify-content: flex-end;
  }

  .info-section {
    padding: 2.5rem;
  }

  .footer-content {
    grid-template-columns: 2fr 1fr 1fr;
  }

    .footer-bottom {
    flex-direction: row;
    align-items: flex-start;
  }
}

/* Large Devices (Desktops): Min 992px */
@media (min-width: 992px) {
  .main-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: var(--space-xxl);
    align-items: start;
    max-width: 1280px;
    margin: 0 auto;
  }
  .sidebar-section {
    order: 2; /* Sidebar on the right on desktops */
    position: sticky;
    top: var(--space-md);
    height: fit-content;
    z-index: 10;
    width: 380px;
    display: flex;
    justify-content: center;
  }
  .food-section {
    order: 1; /* Food section on the left on desktops */
  }

  .food-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

/* ==========================================================================
   Icon Card Area & Category Gradients
   ========================================================================== */
.card-icon-area {
  position: relative;
  height: 120px; /* Mobile height default */
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
  z-index: 1;
}

/* 5% Opacity CSS dot pattern overlay for texture */
.card-icon-area::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 1px);
  background-size: 8px 8px;
  opacity: 0.05;
  z-index: 2;
  pointer-events: none;
}

/* Category-specific gradients */
.gradient-assamese { background: linear-gradient(135deg, #1E3A5F, #0D2137); } /* Fish/Seafood themed */
.gradient-northeast { background: linear-gradient(135deg, #7F1D1D, #450A0A); } /* Meat themed */
.gradient-vegetables { background: linear-gradient(135deg, #14532D, #052E16); } /* Plant themed */
.gradient-staples { background: linear-gradient(135deg, #713F12, #422006); }    /* Grains themed */
.gradient-snacks { background: linear-gradient(135deg, #9A3412, #431407); }     /* Street food themed */
.gradient-beverages { background: linear-gradient(135deg, #581C87, #3B0764); }  /* Drinks themed */
.gradient-burn { background: linear-gradient(135deg, #C2410C, #7C2D12); }       /* Activity themed */

.card-icon-area i {
  font-size: 48px;
  color: var(--text-primary);
  opacity: 0.8;
  z-index: 3;
  transition: transform var(--transition-base);
}

/* Scale icon slightly on card hover */
.food-card:hover .card-icon-area i {
  transform: scale(1.1);
}

/* Media Query: Desktop size card header */
@media (min-width: 1024px) {
  .card-icon-area {
    height: 160px; /* Desktop height */
  }
}

/* ==========================================================================
   7. BMR & COMPARISON RESPONSIVE GRIDS
   ========================================================================== */
.bmr-calculator-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.compare-selector-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

@media (min-width: 600px) {
  .compare-selector-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 768px) {
  .bmr-calculator-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: var(--space-lg);
    align-items: stretch;
  }
  
  .bmr-results-col {
    display: flex;
  }
  
  .bmr-results-col .calculator-result-card {
    margin-top: 0 !important;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    text-align: center;
    flex-grow: 1;
  }
  
  .bmr-results-col .calculator-result-card .result-ring-container {
    width: 110px;
    height: 110px;
    margin-bottom: var(--space-md);
  }
  
   .bmr-results-col .calculator-result-card .result-metrics {
    width: 100%;
    align-items: center;
  }
}

/* Prefers Reduced Motion (Accessibility & Performance) */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-delay: 0s !important;
    animation-duration: 0s !important;
    animation-iteration-count: 1 !important;
    transition-delay: 0s !important;
    transition-duration: 0s !important;
    scroll-behavior: auto !important;
  }
  .food-card:hover {
    transform: none !important;
    box-shadow: var(--shadow-md) !important;
  }
  .food-card {
    animation: none !important;
  }
  .toast {
    animation: none !important;
  }
   .thali-footer {
    transition: none !important;
    transform: translateY(0) rotateX(0) !important;
  }
}

/* ==========================================================================
   Live Digital Katori-Thali Builder Styles
   ========================================================================== */

/* 1. Mobile Tab Switcher Bar */
.mobile-tab-bar {
  display: none; /* Hidden on desktop */
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 4px;
  margin-bottom: var(--space-lg);
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-md);
  width: 100%;
  box-sizing: border-box;
}

.mobile-tab-btn {
  width: 48%;
  flex: 0 0 48%;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-weight: var(--font-semibold);
  font-size: 0.85rem;
  padding: 8px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  transition: all 0.3s ease;
  white-space: nowrap;
}
.mobile-tab-btn.active {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.mobile-thali-badge {
  background: #fff;
  color: var(--accent-primary);
  font-size: 0.75rem;
  font-weight: var(--font-bold);
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 2px;
}

/* Tab display toggles for mobile viewports */
@media (max-width: 640px) {
   .mobile-tab-bar {
    display: flex !important;
  }
  
  /* Hide sidebar-section by default on mobile */
  #sidebar-section {
    display: none;
  }
  
  #sidebar-section.active {
    display: block;
  }
  
  #food-section {
    display: block;
  }
  
  #food-section.hidden {
    display: none;
  }
}

/* 2. Thali Builder Layout & Plate */
.thali-builder-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  width: 100%;
}

.thali-builder-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: var(--space-xs);
  margin-bottom: var(--space-xs);
}

.thali-status-badge {
  font-size: 0.75rem;
  font-family: var(--font-display);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.thali-status-badge.status-balanced {
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.05);
}

.thali-status-badge.status-warning {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.05);
}

.thali-status-badge.status-danger {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.05);
}

.thali-plate-wrapper {
  position: relative;
  margin: var(--space-lg) 0;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  perspective: 1000px;
}

.thali-plate {
  position: relative;
  border-radius: 50%;
  background: radial-gradient(circle, #1e1e1e 0%, #0d0d0d 100%);
  border: 4px solid rgba(255, 255, 255, 0.08);
  transition: box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  width: 280px;
  height: 280px;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  box-shadow: var(--shadow-lg), inset 0 4px 20px rgba(0, 0, 0, 0.6);
}

@media (min-width: 640px) {
  .thali-plate {
    width: 340px;
    height: 340px;
  }
}
.thali-plate-rim {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  bottom: 8px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

/* Thali Glow Border States */
.thali-plate.glow-green {
  border-color: #22c55e;
  box-shadow: var(--shadow-lg), 0 0 35px rgba(34, 197, 94, 0.3), inset 0 4px 20px rgba(0, 0, 0, 0.6);
}

.thali-plate.glow-yellow {
  border-color: #f59e0b;
  box-shadow: var(--shadow-lg), 0 0 35px rgba(245, 158, 11, 0.3), inset 0 4px 20px rgba(0, 0, 0, 0.6);
}

.thali-plate.glow-red {
  border-color: #ef4444;
  box-shadow: var(--shadow-lg), 0 0 35px rgba(239, 68, 68, 0.35), inset 0 4px 20px rgba(0, 0, 0, 0.6);
  animation: thaliRedPulse 1.5s infinite ease-in-out;
}

@keyframes thaliRedPulse {
  0% { transform: scale(1.0); }
  50% { transform: scale(1.015); }
  100% { transform: scale(1.0); }
}

/* 3. Katori Bowl Elements */
.thali-katori {
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  border: 2px solid rgba(255, 255, 255, 0.25);
  z-index: 10;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
}

@media (min-width: 1024px) {
  .thali-katori {
    width: 56px;
    height: 56px;
  }
}

.thali-katori:hover {
  transform: translate(-50%, -50%) scale(1.15) !important;
  box-shadow: 0 0 20px rgba(255, 107, 53, 0.4);
}

.thali-katori i {
  font-size: 1.1rem;
  color: #ffffff;
  pointer-events: none;
}
@media (min-width: 1024px) {
  .thali-katori i {
    font-size: 1.3rem;
  }
}

.katori-label {
  position: absolute;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  color: var(--text-secondary);
  font-family: var(--font-display);
  white-space: nowrap;
  background: rgba(13, 13, 13, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 1024px) {
  .katori-label {
    top: 60px;
    font-size: 0.7rem;
  }
}

.katori-portion-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--accent-primary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: bold;
  padding: 1px 5px;
  border-radius: 10px;
  border: 1.5px solid #1c1210;
  pointer-events: none;
  box-shadow: var(--shadow-sm);
  z-index: 12;
}

/* 4. Portion Popup Control */
.portion-popup {
  position: absolute;
  background: #181413;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: var(--space-4);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.65), 0 0 15px rgba(255, 107, 53, 0.05);
  z-index: 100;
  width: 250px;
  transform: translate(-50%, -110%);
  animation: popupEntrance 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popupEntrance {
  from {
    opacity: 0;
    transform: translate(-50%, -95%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -110%) scale(1.0);
  }
}

.popup-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.portion-options {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-3);
}

.portion-opt-btn {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-1);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all 0.2s ease;
}

.portion-opt-btn:hover {
  background: rgba(255, 107, 53, 0.05);
  border-color: rgba(255, 107, 53, 0.3);
}

.portion-opt-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.portion-opt-btn.active span {
  color: #fff !important;
}

.portion-opt-btn .portion-name {
  font-family: var(--font-display);
  font-weight: var(--font-bold);
  font-size: 0.75rem;
  color: var(--text-primary);
}

.portion-opt-btn .portion-mult {
  font-size: 0.65rem;
  color: var(--text-secondary);
}

.popup-info {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: var(--font-body);
}

.popup-info span {
  font-family: var(--font-display);
  font-weight: var(--font-bold);
  color: var(--accent-primary);
}

.popup-close-btn {
  position: absolute;
  top: 8px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.popup-close-btn:hover {
  color: var(--accent-primary);
}

/* 5. Thali Footer Stats & Actions */
.thali-builder-footer {
  width: 100%;
  border-top: 1px solid var(--border-color);
  padding-top: var(--space-md);
  margin-top: var(--space-xs);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.thali-builder-stats {
  font-size: 0.9rem;
  font-family: var(--font-body);
  color: var(--text-secondary);
}

.thali-builder-stats span {
  font-family: var(--font-heading);
  font-weight: var(--font-bold);
  color: var(--accent-primary);
  font-size: 1.05rem;
}

.thali-builder-actions {
  display: flex;
  gap: var(--space-sm);
}

.thali-builder-actions .btn-submit {
  flex: 1;
  padding: 10px 16px;
  font-size: 0.85rem;
  border-radius: var(--radius-full);
}
/* Footer Social Links */
.footer-copyright-area {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-xs);
}

@media (max-width: 768px) {
  .footer-copyright-area {
    align-items: center;
    text-align: center;
  }
}

.footer-socials {
  display: none; /* Hidden until official social media pages are active */
  gap: var(--space-md);
}
.footer-socials a {
  color: var(--text-secondary);
  font-size: 1.35rem;
  transition: color 0.2s ease, transform 0.2s ease;
  display: inline-flex;
}

.footer-socials a:hover {
  color: var(--accent-orange);
  transform: translateY(-2px);
}
/* Calculator Trust Badge */
.calculator-trust-badge {
  display: flex;
  align-items: flex-start;
  gap: var(--space-xs);
  margin-top: var(--space-md);
  padding: var(--space-xs) var(--space-sm);
  background: rgba(255, 107, 53, 0.03);
  border: 1px solid rgba(255, 107, 53, 0.1);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.calculator-trust-badge i {
  color: var(--accent-orange);
  font-size: 1.25rem;
  margin-top: 2px;
  flex-shrink: 0;
}

.calculator-trust-badge p {
  margin: 0;
}

.calculator-trust-badge a {
  color: var(--accent-orange);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.calculator-trust-badge a:hover {
  text-decoration: underline;
}
/* ==========================================================================
   Phase 2: Explainer Video / Visual Animation Styles
   ========================================================================== */
.explainer-dashboard {
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-align: left;
}

.explainer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  align-items: center;
}

@media (min-width: 768px) {
  .explainer-grid {
    grid-template-columns: 1.15fr 1.35fr;
    gap: var(--space-xl);
  }
}

.explainer-heading {
  margin-top: 0;
  margin-bottom: var(--space-md);
  color: var(--accent-orange);
  font-size: 1.25rem;
  font-family: var(--font-heading);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.explainer-steps {
  list-style-type: none;
  padding-left: 0;
  margin: 0 0 var(--space-md) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.explainer-step-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}

.explainer-step-num {
  width: 28px;
  height: 28px;
  background: rgba(255, 107, 53, 0.1);
  border: 1.5px solid var(--accent-orange);
  color: var(--accent-orange);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: var(--font-bold);
  font-size: 0.85rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.explainer-step-item strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.explainer-step-item p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.explainer-guide-actions {
  margin-top: var(--space-sm);
}

/* Right Column: Animation Window */
.explainer-animation-col {
  position: relative;
  background: #0f0a09;
  border: 1.5px solid rgba(255, 107, 53, 0.1);
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 1.6 / 1;
  width: 100%;
  box-shadow: inset 0 2px 20px rgba(0, 0, 0, 0.8);
}

/* Touch-Safe Mobile Overlay */
.explainer-mobile-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 10, 9, 0.85);
  backdrop-filter: blur(2px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

/* Hide mobile overlay on desktop by default unless active */
@media (min-width: 768px) {
  .explainer-mobile-overlay {
    display: none; /* Desktop handles hover overrides seamlessly */
  }
}

.explainer-play-btn {
  background: var(--accent-orange);
  color: #000;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-display);
  font-weight: var(--font-bold);
  font-size: 0.85rem;
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
  transition: transform 0.2s ease;
}

.explainer-play-btn:hover {
  transform: scale(1.05);
}

/* Manual Play/Pause Control Button */
.explainer-control-btn {
  position: absolute;
  bottom: 12px;
  left: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(15, 10, 9, 0.75);
  border: 1px solid rgba(255, 107, 53, 0.3);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 50;
  transition: all 0.2s ease;
}

.explainer-control-btn:hover {
  background: var(--accent-orange);
  color: #000;
  border-color: var(--accent-orange);
  box-shadow: 0 0 10px rgba(255, 107, 53, 0.4);
}

/* Stage & Hud */
.explainer-visual-stage {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-xs);
}

.explainer-visual-hud {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  pointer-events: none;
}

.hud-badge {
  background: rgba(255, 107, 53, 0.15);
  border: 1px solid var(--accent-orange);
  color: var(--accent-orange);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: var(--font-display);
  font-weight: var(--font-semibold);
  transition: all 0.3s ease;
}

.hud-badge.hud-warning {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #ef4444;
}

.hud-cal-wheel {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: var(--font-body);
}

.explainer-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* CSS transition classes managed by script */
#explainer-katori {
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
  transform-origin: 0px 0px;
}

#explainer-portion-hud {
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

#explainer-ring-fill {
  transition: stroke-dashoffset 0.5s ease, stroke 0.5s ease;
}

#explainer-ripple {
  transform-origin: center;
}

#explainer-cursor {
  pointer-events: none;
}

/* Animations for simulated interactions */
.click-active {
  animation: svgClickPulse 0.2s ease;
}

@keyframes svgClickPulse {
  0% { transform: scale(1.0); }
  50% { transform: scale(0.92); }
  100% { transform: scale(1.0); }
}
