/* ═══════════════════════════════════════════════════
   ECO-MILES — Green Nature + Warm Earth Theme
   Font: Playfair Display (headings) + Nunito (body)
═══════════════════════════════════════════════════ */
:root {
  /* Core palette */
  --bg-deep:      #E8D5B0;
  --bg-dark:      #DCC89A;
  --bg-card:      #FFF8EE;
  --bg-card2:     #F2E5CF;

  /* Primary colours */
  --primary:      #2E7D32;
  --primary-dark: #1B5E20;
  --primary-mid:  #388E3C;
  --primary-light:#A5D6A7;
  --accent:       #F9A825;
  --accent-dark:  #F57F17;
  --earth:        #8D6E63;
  --earth-dark:   #5D4037;

  /* Named aliases (keep original names for JS compat) */
  --neon-cyan:    #2E7D32;
  --neon-pink:    #E65100;
  --neon-purple:  #8D6E63;
  --neon-green:   #388E3C;
  --neon-yellow:  #F9A825;

  /* Text */
  --text:         #1B1B1B;
  --text-muted:   #5D6B5A;
  --text-dim:     #9E9E8A;

  /* UI */
  --border:       rgba(46,125,50,0.18);
  --border-light: rgba(46,125,50,0.10);
  --shadow:       0 4px 20px rgba(46,125,50,0.10);
  --shadow-md:    0 8px 32px rgba(46,125,50,0.12);
  --shadow-warm:  0 4px 20px rgba(141,110,99,0.12);

  /* Glow replacements */
  --glow-cyan:    0 0 0 2px rgba(46,125,50,0.15), 0 4px 16px rgba(46,125,50,0.20);
  --glow-pink:    0 0 0 2px rgba(230,81,0,0.15), 0 4px 16px rgba(230,81,0,0.20);
  --glow-green:   0 0 0 2px rgba(56,142,60,0.15), 0 4px 16px rgba(56,142,60,0.20);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 15% 85%, rgba(141,110,99,0.18) 0%, transparent 45%),
    radial-gradient(circle at 85% 15%, rgba(249,168,37,0.10) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(165,214,167,0.08) 0%, transparent 60%),
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 40px,
      rgba(141,110,99,0.015) 40px,
      rgba(141,110,99,0.015) 41px
    );
}

/* ═══════════════════════════════════════════════════
   MULTI-PAGE SYSTEM
═══════════════════════════════════════════════════ */
.page-section {
  display: none;
}
.page-section.active-page {
  display: block;
  animation: pageIn 0.38s ease forwards;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════
   NAVIGATION
═══════════════════════════════════════════════════ */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(232,213,176,0.97);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(141,110,99,0.25);
  box-shadow: 0 2px 16px rgba(141,110,99,0.14);
  padding: 0 32px; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, rgba(46,125,50,0.12), rgba(165,214,167,0.2));
  border: 1.5px solid rgba(46,125,50,0.3);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; box-shadow: var(--shadow);
}
.logo-text {
  font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 700;
  color: var(--primary); letter-spacing: 0.04em;
  text-shadow: none;
}
.nav-links { display: flex; gap: 2px; align-items: center; }
.nav-link {
  color: var(--text-muted); text-decoration: none;
  font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
  padding: 7px 14px; border-radius: 20px;
  transition: all 0.2s; border: 1.5px solid transparent;
  font-family: 'Nunito', sans-serif;
}
.nav-link:hover {
  border-color: var(--border);
  color: var(--primary);
  background: rgba(46,125,50,0.06);
}
.nav-link.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 3px 12px rgba(46,125,50,0.25);
}
.nav-mobile-toggle {
  display: none;
  background: none; border: 1.5px solid var(--border);
  color: var(--primary); padding: 6px 12px; border-radius: 8px;
  cursor: pointer; font-size: 18px;
}

/* ═══════════════════════════════════════════════════
   HERO
═══════════════════════════════════════════════════ */
.hero {
  padding: 110px 32px 60px;
  background: linear-gradient(160deg, #E8D5B0 0%, #D9C49A 40%, #C8B48A 70%, #D6E8D0 100%);
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; top: -80px; right: -120px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(141,110,99,0.22) 0%, transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: '🌿';
  position: absolute; bottom: 20px; right: 60px;
  font-size: 120px; opacity: 0.06; pointer-events: none;
  transform: rotate(-15deg);
}
.hero-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 60px; align-items: center; position: relative; z-index: 1;
}
.hero-label {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(46,125,50,0.08); border: 1.5px solid rgba(46,125,50,0.25);
  color: var(--primary); font-size: 11px; font-weight: 700;
  font-family: 'Source Code Pro', monospace; letter-spacing: 0.12em;
  text-transform: uppercase; padding: 7px 16px; border-radius: 20px;
  margin-bottom: 20px;
}
.hero-title {
  font-family: 'Playfair Display', serif; font-size: clamp(28px, 4vw, 52px);
  color: var(--text); line-height: 1.12; letter-spacing: 0.01em;
  margin-bottom: 20px;
}
.hero-title em {
  font-style: italic; color: var(--primary);
}
.hero-subtitle {
  font-size: 16px; color: var(--text-muted);
  line-height: 1.75; max-width: 440px; margin-bottom: 28px; font-weight: 400;
}
.hero-stats { display: flex; gap: 36px; flex-wrap: wrap; margin-bottom: 32px; }
.hero-stat-val {
  font-family: 'Playfair Display', serif; font-size: 32px; font-weight: 700;
  color: var(--primary); display: block;
}
.hero-stat-label {
  font-size: 12px; color: var(--text-muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.hero-cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-cta-btn {
  padding: 13px 28px; border-radius: 14px; cursor: pointer;
  font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 700;
  letter-spacing: 0.03em; transition: all 0.25s; border: none;
}
.hero-cta-btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-mid));
  color: #fff; box-shadow: 0 4px 20px rgba(46,125,50,0.30);
}
.hero-cta-btn.primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 28px rgba(46,125,50,0.38);
}
.hero-cta-btn.secondary {
  background: rgba(46,125,50,0.08);
  border: 1.5px solid rgba(46,125,50,0.3);
  color: var(--primary);
}
.hero-cta-btn.secondary:hover {
  background: rgba(46,125,50,0.14);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(46,125,50,0.15);
}

.hero-visual { display: flex; flex-direction: column; gap: 12px; }
.hero-card {
  background: #FFF8EE; border: 1.5px solid rgba(141,110,99,0.20);
  border-radius: 16px; padding: 16px 20px;
  display: flex; align-items: center; gap: 16px;
  animation: floatIn 0.6s ease both;
  box-shadow: 0 4px 20px rgba(141,110,99,0.14);
  position: relative; overflow: hidden;
}
.hero-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--primary-light); border-radius: 0 2px 2px 0;
}
.hero-card:nth-child(2) { animation-delay: 0.1s; margin-left: 32px; }
.hero-card:nth-child(3) { animation-delay: 0.2s; }
.hero-card-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.hero-card-text { flex: 1; }
.hero-card-name { font-size: 14px; font-weight: 700; color: var(--text); }
.hero-card-detail { font-size: 12px; color: var(--text-muted); margin-top: 2px; font-family: 'Source Code Pro', monospace; }
.hero-card-co2 { font-size: 13px; font-weight: 700; font-family: 'Playfair Display', serif; white-space: nowrap; }
.hero-card-co2.high  { color: #E65100; }
.hero-card-co2.low   { color: var(--primary); }
.hero-card-co2.eco   { color: #33691E; }

/* ═══════════════════════════════════════════════════
   HOME PAGE NAV CARDS
═══════════════════════════════════════════════════ */
.home-page-nav-cards {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 14px; margin-top: 40px;
}
.pnav-card {
  background: #FFF8EE; border: 1.5px solid rgba(141,110,99,0.2);
  border-radius: 16px; padding: 24px 18px;
  cursor: pointer; transition: all 0.25s;
  text-align: center; position: relative; overflow: hidden;
  box-shadow: 0 4px 20px rgba(141,110,99,0.12);
}
.pnav-card:hover {
  border-color: var(--primary); transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(141,110,99,0.20);
}
.pnav-icon { font-size: 32px; display: block; margin-bottom: 10px; }
.pnav-title { font-family: 'Playfair Display', serif; font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.pnav-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin-bottom: 12px; }
.pnav-arrow {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; background: var(--primary);
  color: #fff; border-radius: 50%; font-size: 14px;
  transition: transform 0.2s;
}
.pnav-card:hover .pnav-arrow { transform: translateX(3px); }

/* ═══════════════════════════════════════════════════
   INTRO SECTION
═══════════════════════════════════════════════════ */
.intro-section {
  padding: 60px 32px;
  background: linear-gradient(180deg, #D9C49A 0%, #E0CC9E 50%, #E8D5B0 100%);
  border-top: 1px solid rgba(141,110,99,0.2);
}
.intro-inner { max-width: 1200px; margin: 0 auto; }
.intro-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; margin-top: 40px; }
.intro-card {
  background: #FFF8EE; border: 1.5px solid rgba(141,110,99,0.2);
  border-radius: 18px; padding: 30px 24px;
  position: relative; overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.2s;
  box-shadow: 0 4px 20px rgba(141,110,99,0.12);
}
.intro-card:hover {
  border-color: rgba(141,110,99,0.4);
  box-shadow: 0 12px 32px rgba(141,110,99,0.18);
  transform: translateY(-3px);
}
.intro-card-icon { font-size: 38px; margin-bottom: 16px; display: block; }
.intro-card-title {
  font-family: 'Playfair Display', serif; font-size: 16px; font-weight: 700;
  color: var(--primary); margin-bottom: 12px;
}
.intro-card-text { font-size: 14px; color: var(--text-muted); line-height: 1.75; }
.intro-card-stat {
  margin-top: 16px; padding: 10px 14px;
  background: rgba(141,110,99,0.08); border: 1px solid rgba(141,110,99,0.18);
  border-radius: 10px; font-family: 'Source Code Pro', monospace;
  font-size: 12px; color: var(--earth-dark);
}

/* ═══════════════════════════════════════════════════
   SECTION HEADERS
═══════════════════════════════════════════════════ */
.section-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 32px;
}
.section-title {
  font-family: 'Playfair Display', serif; font-size: 28px; font-weight: 700;
  color: var(--primary); letter-spacing: 0.01em;
}
.section-sub {
  font-size: 14px; color: var(--text-muted); margin-top: 5px;
  font-family: 'Nunito', sans-serif; font-weight: 400;
}

/* ═══════════════════════════════════════════════════
   CALCULATOR SECTION
═══════════════════════════════════════════════════ */
.app-section {
  padding: 72px 32px 40px;
  background: linear-gradient(180deg, #E8D5B0 0%, #DCC89A 50%, #D4BF92 100%);
}
.app-inner { max-width: 1300px; margin: 0 auto; }
.app-layout { display: grid; grid-template-columns: 400px 1fr; gap: 24px; align-items: start; }

/* ── CARDS ── */
.card {
  background: #FFF8EE; border: 1.5px solid rgba(141,110,99,0.22);
  border-radius: 18px; margin-bottom: 16px; overflow: hidden;
  box-shadow: 0 4px 20px rgba(141,110,99,0.12);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover { border-color: rgba(141,110,99,0.38); box-shadow: 0 8px 32px rgba(141,110,99,0.16); }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid rgba(141,110,99,0.14);
  background: linear-gradient(135deg, rgba(141,110,99,0.08), rgba(212,191,146,0.12));
}
.card-title {
  font-family: 'Playfair Display', serif; font-size: 13px; font-weight: 700;
  color: var(--primary); letter-spacing: 0.02em;
  display: flex; align-items: center; gap: 8px;
}
.card-title-icon { font-size: 14px; }
.card-body { padding: 16px 20px; }

/* City search */
.search-wrap { position: relative; margin-bottom: 12px; }
.search-input {
  width: 100%; padding: 11px 38px 11px 16px;
  background: #FFF8EE; border: 1.5px solid rgba(141,110,99,0.22);
  border-radius: 12px; color: var(--text); font-family: 'Nunito', sans-serif;
  font-size: 14px; outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(46,125,50,0.10);
}
.search-input::placeholder { color: var(--text-dim); }
.search-icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; pointer-events: none; opacity: 0.6; }
.search-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 100;
  background: #FFF8EE; border: 1.5px solid rgba(141,110,99,0.25);
  border-radius: 12px; max-height: 280px; overflow-y: auto; display: none;
  box-shadow: 0 8px 32px rgba(141,110,99,0.18);
}
.search-dropdown.open { display: block; }
.search-result {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; cursor: pointer; transition: background 0.15s;
  font-size: 14px; border-bottom: 1px solid rgba(141,110,99,0.08);
}
.search-result:last-child { border-bottom: none; }
.search-result:hover { background: rgba(141,110,99,0.07); color: var(--primary); }
.search-result-flag { font-size: 18px; }
.search-result-detail { font-size: 11px; color: var(--text-muted); font-family: 'Source Code Pro', monospace; margin-top: 1px; }
.selected-dest {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; background: rgba(141,110,99,0.08);
  border: 1.5px solid rgba(141,110,99,0.22); border-radius: 12px;
}
.dest-pin { font-size: 20px; }
.dest-name { font-size: 15px; font-weight: 700; color: var(--text); }
.dest-coords { font-size: 11px; color: var(--text-muted); font-family: 'Source Code Pro', monospace; margin-top: 2px; }

/* Ingredient list */
.ing-list { display: flex; flex-direction: column; gap: 10px; }
.ing-item {
  background: rgba(141,110,99,0.06); border: 1.5px solid rgba(141,110,99,0.18);
  border-radius: 14px; padding: 12px; transition: border-color 0.2s, transform 0.15s;
  animation: slideIn 0.3s ease;
}
.ing-item:hover { border-color: rgba(141,110,99,0.32); }
.ing-top { display: flex; gap: 8px; margin-bottom: 8px; }
.ing-select, .field-select {
  flex: 1; padding: 8px 10px;
  background: #FFF8EE; border: 1.5px solid rgba(141,110,99,0.22);
  border-radius: 10px; color: var(--text); font-family: 'Nunito', sans-serif;
  font-size: 13px; cursor: pointer; outline: none; transition: border-color 0.2s;
}
.ing-select:focus, .field-select:focus { border-color: var(--primary); }
.ing-del {
  width: 32px; height: 32px; background: rgba(230,81,0,0.08);
  border: 1.5px solid rgba(230,81,0,0.25); border-radius: 8px;
  color: #E65100; cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; flex-shrink: 0;
}
.ing-del:hover { background: rgba(230,81,0,0.15); box-shadow: 0 2px 8px rgba(230,81,0,0.2); }
.ing-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.field-label {
  font-size: 10px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: 4px;
  font-family: 'Source Code Pro', monospace;
}
.field-input {
  width: 100%; padding: 8px 10px;
  background: #FFF8EE; border: 1.5px solid rgba(141,110,99,0.22);
  border-radius: 10px; color: var(--text); font-family: 'Nunito', sans-serif;
  font-size: 14px; outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.field-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(46,125,50,0.08); }
.field-input.error { border-color: #E65100; animation: shake 0.3s ease; }
.ing-result-row {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 8px; border-top: 1px solid rgba(46,125,50,0.08);
}
.ing-origin { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.ing-metrics { display: flex; gap: 16px; }
.ing-metric { text-align: right; }
.ing-metric-val { font-family: 'Playfair Display', serif; font-size: 13px; color: var(--primary); font-weight: 600; }
.ing-metric-lbl { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }

/* Transport pills */
.transport-pill {
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
  padding: 2px 8px; border-radius: 6px; font-family: 'Source Code Pro', monospace;
}
.tp-air   { background: rgba(230,81,0,0.10);  color: #E65100;  border: 1px solid rgba(230,81,0,0.25); }
.tp-sea   { background: rgba(27,94,32,0.10);  color: #1B5E20;  border: 1px solid rgba(27,94,32,0.25); }
.tp-road  { background: rgba(51,105,30,0.10); color: #33691E;  border: 1px solid rgba(51,105,30,0.25); }
.tp-rail  { background: rgba(93,64,55,0.10);  color: #5D4037;  border: 1px solid rgba(93,64,55,0.25); }

.empty-state { text-align: center; padding: 28px 16px; }
.empty-icon { font-size: 40px; display: block; margin-bottom: 12px; }
.empty-title { font-family: 'Playfair Display', serif; font-size: 15px; color: var(--text-muted); margin-bottom: 6px; }
.empty-text { font-size: 13px; color: var(--text-dim); line-height: 1.6; }

.add-ing-btn {
  width: 100%; padding: 11px; margin-top: 10px;
  background: rgba(46,125,50,0.06);
  border: 1.5px dashed rgba(46,125,50,0.3);
  border-radius: 12px; color: var(--primary); cursor: pointer;
  font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 700;
  letter-spacing: 0.03em; display: flex; align-items: center;
  justify-content: center; gap: 8px; transition: all 0.2s;
}
.add-ing-btn:hover {
  background: rgba(46,125,50,0.12); border-style: solid;
  box-shadow: 0 3px 12px rgba(46,125,50,0.14);
}
.calc-btn {
  width: 100%; padding: 13px; margin-top: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-mid));
  border: none; border-radius: 14px;
  color: #FFFFFF; cursor: pointer;
  font-family: 'Nunito', sans-serif; font-size: 14px;
  font-weight: 800; letter-spacing: 0.04em;
  transition: all 0.25s; position: relative; overflow: hidden;
  box-shadow: 0 4px 16px rgba(46,125,50,0.28);
}
.calc-btn:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 8px 24px rgba(46,125,50,0.36);
}
.calc-btn.loading { pointer-events: none; }
.calc-btn.loading::after {
  content: '';
  position: absolute; left: 0; top: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.25) 50%, transparent 100%);
  animation: shimmer 1s infinite;
}

.loading-overlay {
  position: absolute; inset: 0; z-index: 50;
  background: rgba(250,243,224,0.88);
  display: none; align-items: center; justify-content: center;
  flex-direction: column; gap: 12px; border-radius: 18px;
}
.loading-overlay.show { display: flex; }
.loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(46,125,50,0.15);
  border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
.loading-text {
  font-family: 'Source Code Pro', monospace; font-size: 11px;
  color: var(--primary); letter-spacing: 0.12em;
}

.error-msg {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; margin-top: 8px;
  background: rgba(230,81,0,0.06); border: 1.5px solid rgba(230,81,0,0.25);
  border-radius: 10px; font-size: 12px; color: #E65100;
  font-family: 'Source Code Pro', monospace; animation: slideIn 0.2s ease;
}

/* ── SUMMARY CARDS ── */
.summary-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 16px; }
.summary-card {
  background: #FFF8EE; border: 1.5px solid rgba(141,110,99,0.22);
  border-radius: 18px; padding: 20px 16px; text-align: center;
  position: relative; overflow: hidden;
  box-shadow: 0 4px 20px rgba(141,110,99,0.12);
  transition: border-color 0.3s, transform 0.2s, box-shadow 0.2s;
}
.summary-card:hover { transform: translateY(-3px); box-shadow: 0 10px 32px rgba(141,110,99,0.18); }
.summary-card::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(46,125,50,0.05) 0%, transparent 70%);
  pointer-events: none;
}
.sc-co2::after  { background: radial-gradient(circle at 50% 0%, rgba(230,81,0,0.05) 0%, transparent 70%); }
.sc-count::after{ background: radial-gradient(circle at 50% 0%, rgba(56,142,60,0.05) 0%, transparent 70%); }
.sc-icon { font-size: 24px; display: block; margin-bottom: 8px; }
.sc-val {
  font-family: 'Playfair Display', serif; font-size: 24px; font-weight: 700;
  color: var(--primary); transition: color 0.3s;
}
.sc-co2 .sc-val { color: #E65100; }
.sc-count .sc-val { color: #33691E; }
.sc-unit { font-size: 10px; color: var(--text-muted); font-family: 'Source Code Pro', monospace; margin-top: 3px; }
.sc-label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.07em; margin-top: 5px; }

/* ── MAP ── */
.map-card {
  background: #FFF8EE; border: 1.5px solid rgba(141,110,99,0.22);
  border-radius: 18px; overflow: hidden; margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(141,110,99,0.12);
}
.map-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid rgba(141,110,99,0.14);
  background: linear-gradient(135deg, rgba(141,110,99,0.08), rgba(212,191,146,0.14));
}
.map-title { font-family: 'Playfair Display', serif; font-size: 13px; font-weight: 700; color: var(--primary); }
.map-legend { display: flex; gap: 12px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-muted); font-family: 'Source Code Pro', monospace; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
#map { height: 320px; width: 100%; }

/* Map view tabs */
.map-view-tabs {
  display: flex; gap: 6px; padding: 10px 16px 10px;
  border-bottom: 1px solid rgba(141,110,99,0.14);
  background: rgba(141,110,99,0.06);
}
.map-tab-btn {
  padding: 6px 14px; border-radius: 8px; cursor: pointer;
  font-family: 'Nunito', sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  border: 1.5px solid rgba(46,125,50,0.18); background: transparent;
  color: var(--text-muted); transition: all 0.2s;
}
.map-tab-btn:hover { color: var(--primary); border-color: rgba(46,125,50,0.35); }
.map-tab-btn.active {
  background: var(--primary); color: #fff;
  border-color: var(--primary); box-shadow: 0 3px 10px rgba(46,125,50,0.25);
}

/* SVG map — keep dark for arc contrast */
#svgMapWrap {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, #081a08 0%, #021005 60%, #050d10 100%);
  height: 440px; width: 100%;
  display: none; border-radius: 0 0 16px 16px;
  border-top: 1px solid rgba(46,125,50,0.15);
}
#svgMapWrap.active { display: block; }
#leafletMapWrap { display: block; }
#leafletMapWrap.hidden { display: none; }
.svg-map-infobar {
  position: absolute; top: 10px; left: 12px; right: 12px; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  pointer-events: none;
}
.svg-map-badge {
  background: rgba(5,20,5,0.85); border: 1px solid rgba(46,125,50,0.3);
  border-radius: 6px; padding: 4px 10px;
  font-family: 'Source Code Pro', monospace; font-size: 10px;
  color: rgba(165,214,167,0.8); letter-spacing: 0.08em;
}
.svg-map-legend-mini {
  display: flex; gap: 8px;
  background: rgba(5,20,5,0.85); border: 1px solid rgba(46,125,50,0.2);
  border-radius: 6px; padding: 4px 10px;
}
.svg-legend-dot { width: 6px; height: 6px; border-radius: 50%; display:inline-block; margin-right:3px; }
.svg-legend-item { font-family:'Source Code Pro',monospace; font-size:9px; color:rgba(200,230,200,0.6); display:flex; align-items:center; }
#routeSvg { width: 100%; height: 100%; display: block; position: absolute; top: 0; left: 0; }

/* SVG world elements */
.svg-world-bg { fill: #05100a; stroke: rgba(46,125,50,0.1); stroke-width: 0.5; }
.svg-grid-line { stroke: rgba(46,125,50,0.08); stroke-width: 0.3; fill: none; }
.svg-equator { stroke: rgba(165,214,167,0.25); stroke-width: 0.7; fill: none; }
.svg-tropic { stroke: rgba(165,214,167,0.10); stroke-width: 0.4; fill: none; stroke-dasharray: 3 5; }
.svg-land {
  fill: rgba(46,125,50,0.12);
  stroke: rgba(165,214,167,0.35);
  stroke-width: 0.7;
  filter: drop-shadow(0 0 2px rgba(46,125,50,0.2));
}

/* SVG tooltip */
#svgTooltip {
  position: absolute; pointer-events: none; z-index: 10;
  background: rgba(5,20,5,0.96); border: 1px solid rgba(165,214,167,0.3);
  border-radius: 10px; padding: 10px 14px;
  font-family: 'Nunito', sans-serif; font-size: 13px;
  color: #e8f5e9; box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  max-width: 200px; display: none; line-height: 1.55;
}
#svgTooltip.show { display: block; animation: fadeIn 0.15s ease; }
.svgtt-name { font-family: 'Playfair Display', serif; font-size: 12px; color: #A5D6A7; margin-bottom: 5px; font-weight: 700; }
.svgtt-detail { font-size: 11px; color: rgba(200,230,200,0.7); font-family: 'Source Code Pro', monospace; }
.svgtt-co2 { font-family: 'Playfair Display', serif; font-size: 13px; margin-top: 5px; font-weight: 700; }
#svgEmptyState {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: 'Nunito', sans-serif; color: rgba(165,214,167,0.5);
  font-size: 13px; gap: 10px; pointer-events: none;
}
#svgEmptyState .empty-globe { font-size: 40px; opacity: 0.3; }
#svgEmptyState span { opacity: 0.5; letter-spacing: 0.05em; }

/* SVG arc animation */
@keyframes dashDraw { from { stroke-dashoffset: var(--path-len); } to { stroke-dashoffset: 0; } }
.arc-animate { animation: dashDraw 1.4s cubic-bezier(0.4,0,0.2,1) forwards; }
.route-arc { fill: none; stroke-linecap: round; filter: url(#arcGlow); transition: opacity 0.3s, stroke-width 0.2s; cursor: pointer; }
.route-arc:hover { opacity: 1 !important; stroke-width: 3.5 !important; filter: url(#arcGlowStrong) !important; }
.arc-air  { stroke: #ff7043; }
.arc-sea  { stroke: #00f5ff; }
.arc-road { stroke: #00ff88; }
.arc-rail { stroke: #bf00ff; }
.dest-marker { fill: #ff00aa; filter: url(#markerGlow); cursor: pointer; }
.origin-marker { cursor: pointer; transition: r 0.2s; }
.origin-marker:hover { r: 7; }
@keyframes markerPulse { 0%, 100% { r: 4; opacity: 1; } 50% { r: 7; opacity: 0.4; } }
.marker-pulse-ring { fill: none; stroke-width: 1.5; animation: markerPulse 2s ease-in-out infinite; opacity: 0.6; }

/* Alternatives below map */
#altMapPanel {
  margin-top: 0; background: rgba(46,125,50,0.04);
  border: 1.5px solid rgba(46,125,50,0.18); border-top: none;
  border-radius: 0 0 16px 16px; padding: 14px 18px; display: none;
}
#altMapPanel.show { display: block; }
.alt-map-title {
  font-family: 'Playfair Display', serif; font-size: 12px; font-weight: 700;
  color: var(--primary); margin-bottom: 10px; display: flex; align-items: center; gap: 8px;
}
.alt-map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.alt-map-item {
  display: flex; align-items: center; gap: 8px;
  background: #FFF8EE; border: 1.5px solid rgba(141,110,99,0.18);
  border-radius: 10px; padding: 8px 12px; font-size: 12px;
  transition: border-color 0.2s;
}
.alt-map-item:hover { border-color: rgba(141,110,99,0.35); }
.alt-map-from { color: #E65100; font-weight: 700; }
.alt-map-arrow { color: var(--text-dim); flex-shrink: 0; }
.alt-map-to { color: var(--primary); font-weight: 700; }
.alt-map-origin { font-size: 10px; color: var(--text-dim); font-family: 'Source Code Pro', monospace; margin-top: 2px; }

/* ── IMPACT METER ── */
.impact-card {
  background: #FFF8EE; border: 1.5px solid rgba(141,110,99,0.22);
  border-radius: 18px; padding: 18px 20px; margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(141,110,99,0.12);
}
.impact-title {
  display: flex; justify-content: space-between; align-items: center;
  font-family: 'Playfair Display', serif; font-size: 13px; font-weight: 700;
  color: var(--primary); margin-bottom: 12px;
}
.impact-val { font-size: 13px; color: #E65100; font-weight: 700; }
.impact-track {
  height: 10px; background: rgba(141,110,99,0.15); border-radius: 6px;
  overflow: hidden; margin-bottom: 6px;
}
.impact-fill {
  height: 100%; border-radius: 6px;
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1), background 0.4s;
  min-width: 0;
}
.impact-scale {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--text-dim);
  font-family: 'Source Code Pro', monospace; margin-bottom: 16px;
}
.breakdown-title {
  font-family: 'Playfair Display', serif; font-size: 12px; font-weight: 700;
  color: var(--text-muted); margin-bottom: 10px;
}
.breakdown-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.br-label { font-size: 12px; color: var(--text-muted); width: 60px; flex-shrink: 0; font-family: 'Source Code Pro', monospace; }
.br-track { flex: 1; height: 8px; background: rgba(141,110,99,0.12); border-radius: 4px; overflow: hidden; }
.br-fill { height: 100%; border-radius: 4px; transition: width 0.6s cubic-bezier(0.4,0,0.2,1); }
.br-val { font-size: 12px; color: var(--text-muted); font-family: 'Playfair Display', serif; font-weight: 600; width: 60px; text-align: right; flex-shrink: 0; }

/* ── ALT CARD ── */
.alt-card {
  background: rgba(46,125,50,0.04); border: 1.5px solid rgba(46,125,50,0.18);
  border-radius: 18px; padding: 18px 20px; animation: slideIn 0.3s ease;
  box-shadow: var(--shadow);
}
.alt-header { font-family: 'Playfair Display', serif; font-size: 14px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.alt-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; line-height: 1.5; }
.alt-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid rgba(46,125,50,0.08); font-size: 13px;
}
.alt-item:last-child { border-bottom: none; }
.alt-from { color: #E65100; font-weight: 700; }
.alt-arrow { color: var(--text-dim); }
.alt-to { color: var(--primary); font-weight: 700; flex: 1; }
.alt-save {
  font-size: 10px; color: #E65100; font-family: 'Source Code Pro', monospace;
  background: rgba(230,81,0,0.08); padding: 2px 7px; border-radius: 5px;
  border: 1px solid rgba(230,81,0,0.2);
}

/* ── INGREDIENT CHART ── */
.ingChart-card {
  background: #FFF8EE; border: 1.5px solid rgba(141,110,99,0.22);
  border-radius: 18px; padding: 18px 20px; margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(141,110,99,0.12);
}
.ingChart-title { font-family: 'Playfair Display', serif; font-size: 13px; font-weight: 700; color: var(--primary); margin-bottom: 16px; }
.ingChart-wrap { position: relative; height: 200px; }

/* ── EXPLAIN PANEL ── */
.explain-panel {
  background: #FFF8EE; border: 1.5px solid rgba(141,110,99,0.22);
  border-radius: 18px; padding: 18px 20px; margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(141,110,99,0.10);
}
.explain-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  background: none; border: none; cursor: pointer;
  font-family: 'Playfair Display', serif; font-size: 13px; font-weight: 700;
  color: var(--primary); padding: 0; text-align: left;
}
.explain-toggle .chevron { transition: transform 0.3s; color: var(--text-muted); font-size: 14px; }
.explain-panel.open .chevron { transform: rotate(180deg); color: var(--primary); }
.explain-body { max-height: 0; overflow: hidden; transition: max-height 0.4s cubic-bezier(0.4,0,0.2,1); }
.explain-panel.open .explain-body { max-height: 800px; }
.explain-inner { padding-top: 16px; }
.explain-formula-block {
  background: rgba(46,125,50,0.05); border-left: 3px solid var(--primary);
  padding: 12px 14px; border-radius: 0 10px 10px 0; margin-bottom: 12px;
  font-family: 'Source Code Pro', monospace; font-size: 12px;
  color: var(--primary); line-height: 1.8;
}
.explain-formula-block.green { border-left-color: #33691E; color: #33691E; background: rgba(51,105,30,0.05); }
.explain-text { font-size: 13px; color: var(--text-muted); line-height: 1.7; margin-bottom: 12px; }
.explain-label {
  font-size: 10px; color: var(--text-dim); font-family: 'Source Code Pro', monospace;
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px;
}
.explain-example {
  background: rgba(46,125,50,0.05); border: 1.5px solid rgba(46,125,50,0.15);
  border-radius: 10px; padding: 12px 14px;
  font-family: 'Source Code Pro', monospace; font-size: 12px;
  color: var(--primary); line-height: 1.8;
}

/* ── TRANSPORT COMPARE ── */
.transport-compare-card {
  background: #FFF8EE; border: 1.5px solid rgba(141,110,99,0.22);
  border-radius: 18px; padding: 18px 20px; margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(141,110,99,0.10);
}
.transport-compare-title { font-family: 'Playfair Display', serif; font-size: 13px; font-weight: 700; color: var(--primary); margin-bottom: 16px; }
.transport-mode-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 16px; }
.tm-btn {
  padding: 10px 8px; border-radius: 12px; border: 1.5px solid rgba(141,110,99,0.2);
  cursor: pointer; font-family: 'Nunito', sans-serif; font-size: 12px; font-weight: 700;
  letter-spacing: 0.03em; text-transform: uppercase; text-align: center;
  transition: all 0.2s; background: rgba(141,110,99,0.08); color: var(--text-muted);
}
.tm-btn.air:hover, .tm-btn.air.active   { background: rgba(230,81,0,0.1); border-color: #E65100; color: #E65100; box-shadow: 0 3px 10px rgba(230,81,0,0.2); }
.tm-btn.sea:hover, .tm-btn.sea.active   { background: rgba(27,94,32,0.1); border-color: #1B5E20; color: #1B5E20; box-shadow: 0 3px 10px rgba(27,94,32,0.2); }
.tm-btn.road:hover,.tm-btn.road.active  { background: rgba(51,105,30,0.1); border-color: #33691E; color: #33691E; box-shadow: 0 3px 10px rgba(51,105,30,0.2); }
.tm-btn.rail:hover,.tm-btn.rail.active  { background: rgba(93,64,55,0.1); border-color: #5D4037; color: #5D4037; box-shadow: 0 3px 10px rgba(93,64,55,0.2); }
.tm-icon { font-size: 18px; display: block; margin-bottom: 4px; }
.tm-co2-display {
  text-align: center; padding: 10px;
  background: var(--bg-card2); border-radius: 10px;
  font-family: 'Source Code Pro', monospace; font-size: 12px; color: var(--text-muted);
  min-height: 42px; display: flex; align-items: center; justify-content: center;
  transition: all 0.3s; border: 1px solid var(--border-light);
}

/* ═══════════════════════════════════════════════════
   FOOD SELECTOR
═══════════════════════════════════════════════════ */
.food-selector-section {
  padding: 80px 32px 60px;
  background: linear-gradient(180deg, #DCC89A 0%, #D4BF92 40%, #E8D5B0 100%);
}
.food-selector-inner { max-width: 1300px; margin: 0 auto; }
.food-cat-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.food-cat-tab {
  padding: 8px 18px; border-radius: 20px; cursor: pointer;
  font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 600;
  letter-spacing: 0.02em; border: 1.5px solid rgba(141,110,99,0.22);
  background: #FFF8EE; color: var(--text-muted); transition: all 0.2s;
}
.food-cat-tab:hover { border-color: rgba(141,110,99,0.42); color: var(--earth-dark); background: rgba(141,110,99,0.08); }
.food-cat-tab.active {
  background: var(--primary); border-color: var(--primary);
  color: #fff; box-shadow: 0 3px 12px rgba(46,125,50,0.25);
}
.food-search-wrap { position: relative; margin-bottom: 20px; max-width: 440px; }
.food-search-input {
  width: 100%; padding: 11px 42px 11px 18px;
  background: #FFF8EE; border: 1.5px solid rgba(141,110,99,0.22);
  border-radius: 24px; color: var(--text); font-family: 'Nunito', sans-serif;
  font-size: 14px; outline: none; transition: all 0.2s;
  box-shadow: 0 2px 10px rgba(141,110,99,0.08);
}
.food-search-input:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(46,125,50,0.10);
}
.food-search-input::placeholder { color: var(--text-dim); }
.food-search-icon { position:absolute; right:16px; top:50%; transform:translateY(-50%); font-size:14px; pointer-events:none; opacity:0.5; }
.food-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px;
}
.food-item-card {
  background: #FFF8EE; border: 1.5px solid rgba(141,110,99,0.16);
  border-radius: 16px; padding: 16px 12px 12px;
  cursor: pointer; transition: all 0.2s; text-align: center;
  position: relative; overflow: hidden;
  animation: fadeCardIn 0.3s ease both;
  box-shadow: 0 2px 10px rgba(141,110,99,0.10);
}
@keyframes fadeCardIn { from { opacity:0; transform:scale(0.95); } to { opacity:1; transform:scale(1); } }
.food-item-card:hover {
  border-color: rgba(141,110,99,0.35); background: #FFF3E0;
  transform: translateY(-3px); box-shadow: 0 8px 24px rgba(141,110,99,0.16);
}
.food-item-card.selected {
  border-color: var(--primary); background: rgba(46,125,50,0.05);
  box-shadow: 0 0 0 3px rgba(46,125,50,0.12), 0 8px 24px rgba(141,110,99,0.14);
}
.food-item-card.selected::after {
  content: '✓'; position: absolute; top: 6px; right: 8px;
  color: var(--primary); font-size: 12px; font-weight: 800;
}
.food-item-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  border-radius: 16px 16px 0 0;
  background: var(--primary-light); opacity: 0; transition: opacity 0.2s;
}
.food-item-card:hover::before, .food-item-card.selected::before { opacity: 1; }
.food-item-card.air-card::before  { background: #E65100; }
.food-item-card.sea-card::before  { background: var(--primary); }
.food-item-card.road-card::before { background: #33691E; }
.food-item-card.rail-card::before { background: #8D6E63; }
.food-item-emoji { font-size: 28px; display: block; margin-bottom: 8px; line-height: 1; }
.food-item-name { font-size: 12px; font-weight: 700; color: var(--text); letter-spacing: 0.01em; margin-bottom: 5px; line-height: 1.2; }
.food-item-origin {
  font-size: 10px; color: var(--text-muted); font-family: 'Source Code Pro', monospace;
  display: flex; align-items: center; justify-content: center; gap: 4px; margin-bottom: 6px;
}
.food-item-transport { display: inline-block; font-size: 9px; font-weight: 700; padding: 2px 7px; border-radius: 6px; letter-spacing: 0.04em; font-family: 'Source Code Pro', monospace; }
.food-item-add {
  margin-top: 8px; width: 100%; padding: 6px 0;
  background: rgba(46,125,50,0.08); border: 1.5px solid rgba(46,125,50,0.25);
  border-radius: 8px; color: var(--primary); font-size: 11px;
  font-weight: 700; font-family: 'Nunito', sans-serif;
  letter-spacing: 0.04em; cursor: pointer;
  opacity: 0; transform: translateY(4px); transition: all 0.2s;
}
.food-item-card:hover .food-item-add { opacity: 1; transform: translateY(0); }
.food-item-card.selected .food-item-add {
  opacity: 1; transform: translateY(0);
  background: rgba(46,125,50,0.14); border-color: var(--primary);
}
.food-item-add:hover { background: rgba(46,125,50,0.2) !important; }
.food-selector-footer {
  margin-top: 20px; padding: 14px 20px;
  background: #FFF8EE; border: 1.5px solid rgba(141,110,99,0.22);
  border-radius: 16px; display: flex; align-items: center;
  justify-content: space-between; gap: 16px; flex-wrap: wrap;
  box-shadow: 0 4px 20px rgba(141,110,99,0.12);
}
.food-selector-count {
  font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 600;
  color: var(--primary); display: flex; align-items: center; gap: 10px;
}
.food-selector-count span { color: var(--text-muted); font-size: 12px; }
.food-clear-btn {
  padding: 9px 16px; background: rgba(230,81,0,0.07);
  border: 1.5px solid rgba(230,81,0,0.25); border-radius: 10px;
  color: #E65100; cursor: pointer;
  font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 700;
  letter-spacing: 0.02em; transition: all 0.2s;
}
.food-clear-btn:hover { background: rgba(230,81,0,0.14); }
.food-add-to-calc-btn {
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-mid));
  border: none; border-radius: 12px; color: #fff; cursor: pointer;
  font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 800;
  letter-spacing: 0.04em; transition: all 0.25s;
  box-shadow: 0 4px 14px rgba(46,125,50,0.28);
}
.food-add-to-calc-btn:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  transform: translateY(-2px); box-shadow: 0 7px 20px rgba(46,125,50,0.36);
}
.food-add-to-calc-btn:disabled { opacity: 0.4; cursor: default; box-shadow: none; transform: none; }
.food-no-results {
  grid-column: 1/-1; text-align: center; padding: 48px 16px;
  font-family: 'Nunito', sans-serif; font-size: 14px; color: var(--text-dim);
}
.food-no-results-icon { font-size: 40px; display: block; margin-bottom: 12px; opacity: 0.35; }

/* ═══════════════════════════════════════════════════
   ENVIRONMENTAL EQUIVALENTS
═══════════════════════════════════════════════════ */
.env-section {
  padding: 60px 32px;
  background: linear-gradient(180deg, #D4BF92 0%, #C8B080 30%, #D9C49A 100%);
  border-top: 1px solid rgba(141,110,99,0.2);
}
.env-inner { max-width: 1200px; margin: 0 auto; }
.env-equivalents { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-top: 32px; }
.env-card {
  background: #FFF8EE; border: 1.5px solid rgba(141,110,99,0.2);
  border-radius: 18px; padding: 22px 16px; text-align: center;
  transition: all 0.2s; box-shadow: 0 4px 20px rgba(141,110,99,0.12);
}
.env-card:hover { border-color: rgba(141,110,99,0.38); transform: translateY(-3px); box-shadow: 0 10px 28px rgba(141,110,99,0.18); }
.env-icon { font-size: 34px; display: block; margin-bottom: 12px; }
.env-val { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 700; color: var(--primary); margin-bottom: 5px; }
.env-label { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* ═══════════════════════════════════════════════════
   CHARTS SECTION
═══════════════════════════════════════════════════ */
.chart-section { padding: 80px 32px; background: linear-gradient(160deg, #E8D5B0 0%, #DCC89A 60%, #D4BF92 100%); }
.chart-inner { max-width: 1000px; margin: 0 auto; }
.chart-wrap {
  background: #FFF8EE; border: 1.5px solid rgba(141,110,99,0.22);
  border-radius: 20px; padding: 28px; margin-top: 32px;
  box-shadow: 0 8px 32px rgba(141,110,99,0.16);
}
.chart-canvas-wrap { position: relative; height: 320px; }
.chart-note {
  font-size: 12px; color: var(--text-dim);
  font-family: 'Source Code Pro', monospace; margin-top: 16px; text-align: center;
}

/* ═══════════════════════════════════════════════════
   HOW IT WORKS
═══════════════════════════════════════════════════ */
.how-section {
  padding: 80px 32px 40px;
  background: linear-gradient(180deg, #DCC89A 0%, #D4BF92 50%, #C8B080 100%);
}
.how-inner { max-width: 1100px; margin: 0 auto; }
.how-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 40px; }
.how-card {
  background: #FFF8EE; border: 1.5px solid rgba(141,110,99,0.22);
  border-radius: 20px; padding: 28px 24px;
  box-shadow: 0 4px 20px rgba(141,110,99,0.12);
}
.how-card-title {
  font-family: 'Playfair Display', serif; font-size: 15px; font-weight: 700;
  color: var(--primary); margin-bottom: 16px;
}
.formula-block {
  background: rgba(46,125,50,0.05); border-left: 3px solid var(--primary);
  padding: 14px 16px; border-radius: 0 10px 10px 0; margin-bottom: 14px;
  font-family: 'Source Code Pro', monospace; font-size: 13px;
  color: var(--primary); line-height: 1.8;
}
.formula-block.green { border-left-color: #33691E; color: #33691E; background: rgba(51,105,30,0.04); }
.emission-table { width: 100%; border-collapse: collapse; }
.emission-table th, .emission-table td {
  padding: 10px 12px; text-align: left;
  border-bottom: 1px solid rgba(141,110,99,0.12); font-size: 13px;
}
.emission-table th {
  font-family: 'Nunito', sans-serif; font-size: 11px; font-weight: 800;
  color: var(--primary); letter-spacing: 0.06em; text-transform: uppercase;
}
.emission-table td { color: var(--text-muted); font-family: 'Source Code Pro', monospace; }
.emission-table tr:last-child td { border-bottom: none; }
.emission-bar { display: inline-block; height: 6px; border-radius: 3px; vertical-align: middle; margin-left: 6px; }

/* ═══════════════════════════════════════════════════
   FAQ
═══════════════════════════════════════════════════ */
.faq-section {
  padding: 60px 32px 80px;
  background: linear-gradient(180deg, #C8B080 0%, #D4BF92 50%, #DCC89A 100%);
  border-top: 1px solid rgba(141,110,99,0.2);
}
.faq-inner { max-width: 860px; margin: 0 auto; }
.faq-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 36px; }
.faq-chip {
  font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 700;
  padding: 9px 20px; border: 1.5px solid rgba(141,110,99,0.22); border-radius: 20px;
  background: #FFF8EE; color: var(--text-muted); cursor: pointer; transition: all 0.2s;
}
.faq-chip:hover { border-color: rgba(141,110,99,0.42); color: var(--earth-dark); background: rgba(141,110,99,0.08); }
.faq-chip.active { border-color: var(--primary); color: #fff; background: var(--primary); box-shadow: 0 3px 12px rgba(46,125,50,0.25); }
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  border: 1.5px solid rgba(141,110,99,0.18); border-radius: 16px; overflow: hidden;
  background: #FFF8EE; box-shadow: 0 3px 14px rgba(141,110,99,0.10); transition: all 0.2s;
}
.faq-item.open { border-color: rgba(141,110,99,0.35); box-shadow: 0 8px 28px rgba(141,110,99,0.16); }
.faq-q {
  width: 100%; display: flex; align-items: center; gap: 14px;
  padding: 20px 24px; background: transparent; border: none; cursor: pointer;
  font-family: 'Nunito', sans-serif; font-size: 16px; font-weight: 700;
  color: var(--text); letter-spacing: 0.01em; text-align: left;
  transition: color 0.2s, background 0.2s;
}
.faq-q:hover { color: var(--primary); background: rgba(46,125,50,0.03); }
.faq-item.open .faq-q { color: var(--primary); background: rgba(46,125,50,0.04); }
.faq-q-icon { font-size: 18px; flex-shrink: 0; }
.faq-q span:nth-child(2) { flex: 1; }
.faq-chevron { font-size: 16px; color: var(--text-muted); transition: transform 0.3s ease, color 0.2s; flex-shrink: 0; }
.faq-item.open .faq-chevron { transform: rotate(180deg); color: var(--primary); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.45s cubic-bezier(0.4,0,0.2,1); }
.faq-item.open .faq-a { max-height: 1400px; }
.faq-a > * { padding: 0 24px; }
.faq-a > p { font-size: 14px; line-height: 1.8; color: var(--text-muted); padding-bottom: 16px; }
.faq-a > p:first-child { padding-top: 6px; }
.faq-a strong { color: var(--text); }
.faq-fact-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; padding: 0 24px 20px !important; }
.faq-fact {
  background: rgba(141,110,99,0.06); border: 1.5px solid rgba(141,110,99,0.15);
  border-radius: 12px; padding: 14px; text-align: center;
}
.faq-fact-val { font-family: 'Playfair Display', serif; font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.faq-fact-desc { font-size: 11px; font-family: 'Source Code Pro', monospace; color: var(--text-dim); line-height: 1.5; }

/* ═══════════════════════════════════════════════════
   SUGGESTIONS / TIPS
═══════════════════════════════════════════════════ */
.suggest-section {
  padding: 80px 32px;
  background: linear-gradient(160deg, #E8D5B0 0%, #D9C49A 40%, #C8B080 80%, #BFA870 100%);
}
.suggest-inner { max-width: 1200px; margin: 0 auto; }
.suggest-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; margin-top: 32px; }
.suggest-card {
  background: #FFF8EE; border: 1.5px solid rgba(141,110,99,0.18);
  border-radius: 20px; padding: 28px 22px; transition: all 0.25s;
  box-shadow: 0 4px 20px rgba(141,110,99,0.12);
}
.suggest-card:hover {
  border-color: rgba(141,110,99,0.38);
  box-shadow: 0 12px 32px rgba(141,110,99,0.18);
  transform: translateY(-4px);
}
.suggest-icon { font-size: 32px; margin-bottom: 14px; display: block; }
.suggest-title {
  font-family: 'Playfair Display', serif; font-size: 16px; font-weight: 700;
  color: var(--primary); margin-bottom: 10px;
}
.suggest-text { font-size: 14px; color: var(--text-muted); line-height: 1.75; }
.suggest-tip {
  margin-top: 14px; padding: 10px 14px;
  background: rgba(141,110,99,0.08); border: 1px solid rgba(141,110,99,0.18);
  border-radius: 10px; font-size: 12px; color: var(--earth-dark);
  font-family: 'Source Code Pro', monospace; line-height: 1.55;
}

/* ═══════════════════════════════════════════════════
   SMART INSIGHTS
═══════════════════════════════════════════════════ */
.insights-section { margin-top: 16px; animation: slideIn 0.4s ease; }
.insights-card {
  background: #FFF8EE; border: 1.5px solid rgba(141,110,99,0.22);
  border-radius: 18px; overflow: hidden; box-shadow: 0 4px 20px rgba(141,110,99,0.12);
}
.insights-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid rgba(141,110,99,0.12);
  background: linear-gradient(135deg, rgba(141,110,99,0.08), rgba(212,191,146,0.12));
}
.insights-title {
  font-family: 'Playfair Display', serif; font-size: 14px; font-weight: 700;
  color: var(--primary); display: flex; align-items: center; gap: 8px;
}
.rating-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Playfair Display', serif; font-size: 18px; font-weight: 900;
  padding: 4px 16px; border-radius: 10px; letter-spacing: 0.05em;
}
.rating-A { background: rgba(46,125,50,0.10); color: #1B5E20; border: 1.5px solid rgba(46,125,50,0.3); }
.rating-B { background: rgba(56,142,60,0.10); color: #2E7D32; border: 1.5px solid rgba(56,142,60,0.3); }
.rating-C { background: rgba(249,168,37,0.10); color: #F57F17; border: 1.5px solid rgba(249,168,37,0.35); }
.rating-D { background: rgba(230,81,0,0.10);  color: #BF360C; border: 1.5px solid rgba(230,81,0,0.3); }
.rating-E { background: rgba(183,28,28,0.10); color: #B71C1C; border: 1.5px solid rgba(183,28,28,0.3); }
.insights-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.insight-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px; border-radius: 12px; border: 1.5px solid transparent;
  font-size: 13px; line-height: 1.6; transition: border-color 0.2s;
}
.insight-item.warn    { background: rgba(230,81,0,0.05);   border-color: rgba(230,81,0,0.15); }
.insight-item.good    { background: rgba(46,125,50,0.05);  border-color: rgba(46,125,50,0.15); }
.insight-item.info    { background: rgba(249,168,37,0.05); border-color: rgba(249,168,37,0.15); }
.insight-item.compare { background: rgba(141,110,99,0.05); border-color: rgba(141,110,99,0.18); }
.insight-item.fact    { background: rgba(33,150,83,0.04);  border-color: rgba(33,150,83,0.15); }
.insight-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.insight-text { color: var(--text); }
.insight-text strong        { color: var(--primary); }
.insight-text .highlight-pink  { color: #E65100; font-weight: 700; }
.insight-text .highlight-green { color: var(--primary); font-weight: 700; }
.insight-text .highlight-yellow{ color: var(--accent); font-weight: 700; }

/* ═══════════════════════════════════════════════════
   INTERACTIVE DASHBOARD
═══════════════════════════════════════════════════ */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.dash-card {
  background: #FFF8EE; border: 1.5px solid rgba(141,110,99,0.22);
  border-radius: 18px; padding: 16px 18px;
  box-shadow: 0 4px 20px rgba(141,110,99,0.12);
}
.dash-card-title {
  font-family: 'Playfair Display', serif; font-size: 13px; font-weight: 700;
  color: var(--primary); margin-bottom: 14px;
}
.dash-chart-wrap { position: relative; height: 180px; }
.pie-wrap { height: 180px; display: flex; align-items: center; justify-content: center; }

/* Tooltip system */
.tooltip-host { position: relative; display: inline-flex; align-items: center; }
.tooltip-icon {
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(46,125,50,0.10); border: 1px solid rgba(46,125,50,0.25);
  color: var(--primary); font-size: 9px; font-family: 'Playfair Display', serif;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: help; margin-left: 6px; flex-shrink: 0;
}
.tooltip-bubble {
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%);
  background: #FFF8EE; border: 1.5px solid rgba(141,110,99,0.25);
  border-radius: 12px; padding: 12px 16px;
  font-family: 'Nunito', sans-serif; font-size: 12px;
  color: var(--text); line-height: 1.6;
  width: 240px; pointer-events: none; opacity: 0;
  transition: opacity 0.2s; z-index: 200;
  box-shadow: 0 8px 28px rgba(141,110,99,0.18);
}
.tooltip-bubble::after {
  content: ''; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%); border: 5px solid transparent;
  border-top-color: rgba(141,110,99,0.25);
}
.tooltip-host:hover .tooltip-bubble { opacity: 1; }
.tooltip-bubble-title {
  font-family: 'Playfair Display', serif; font-size: 11px;
  color: var(--primary); margin-bottom: 5px; display: block; font-weight: 700;
}

/* ═══════════════════════════════════════════════════
   FIELD TOOLTIPS
═══════════════════════════════════════════════════ */
.field-with-tip { display: flex; align-items: center; gap: 6px; }
.field-tip-icon {
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(46,125,50,0.08); border: 1px solid rgba(46,125,50,0.25);
  color: var(--primary); font-size: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: help; font-family: 'Nunito', sans-serif; flex-shrink: 0; position: relative;
}
.field-tip-icon:hover .tip-bubble { opacity: 1; pointer-events: auto; }
.tip-bubble {
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%); background: #FFF8EE;
  border: 1.5px solid rgba(141,110,99,0.25); border-radius: 12px;
  padding: 12px 16px; font-size: 12px; color: var(--text); line-height: 1.65;
  width: 260px; font-family: 'Nunito', sans-serif;
  opacity: 0; pointer-events: none; transition: opacity 0.2s; z-index: 300;
  box-shadow: 0 8px 28px rgba(141,110,99,0.16); white-space: normal;
}
.tip-bubble-title {
  font-family: 'Playfair Display', serif; font-size: 11px; font-weight: 700;
  color: var(--primary); margin-bottom: 5px; display: block;
}
.tip-bubble::after {
  content: ''; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%); border: 5px solid transparent;
  border-top-color: rgba(141,110,99,0.25);
}

/* ═══════════════════════════════════════════════════
   COMPARE MODE
═══════════════════════════════════════════════════ */
.compare-toggle-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; margin-top: 10px;
  background: rgba(141,110,99,0.06); border: 1.5px solid rgba(141,110,99,0.2);
  border-radius: 12px; cursor: pointer; transition: all 0.2s;
}
.compare-toggle-bar:hover { border-color: rgba(141,110,99,0.4); box-shadow: 0 4px 14px rgba(141,110,99,0.1); }
.compare-toggle-label {
  font-family: 'Nunito', sans-serif; font-size: 12px; font-weight: 700;
  color: var(--earth); letter-spacing: 0.03em;
  display: flex; align-items: center; gap: 8px;
}
.compare-toggle-switch {
  width: 40px; height: 22px; background: rgba(141,110,99,0.15);
  border: 1.5px solid rgba(141,110,99,0.35); border-radius: 11px;
  position: relative; transition: background 0.2s;
}
.compare-toggle-switch::after {
  content: ''; position: absolute; width: 16px; height: 16px;
  background: var(--earth); border-radius: 50%; top: 2px; left: 2px;
  transition: transform 0.2s; box-shadow: 0 2px 6px rgba(141,110,99,0.4);
}
.compare-toggle-bar.active .compare-toggle-switch { background: rgba(141,110,99,0.25); }
.compare-toggle-bar.active .compare-toggle-switch::after { transform: translateX(18px); }
.compare-panel {
  display: none; animation: slideIn 0.3s ease;
  background: rgba(141,110,99,0.04); border: 1.5px solid rgba(141,110,99,0.18);
  border-radius: 14px; padding: 16px; margin-top: 10px;
}
.compare-panel.open { display: block; }
.compare-panel-title { font-family: 'Playfair Display', serif; font-size: 12px; font-weight: 700; color: var(--earth); margin-bottom: 14px; }
.compare-ing-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.compare-ing-item {
  display: flex; gap: 8px; align-items: center;
  background: #FFF8EE; border: 1.5px solid rgba(141,110,99,0.15);
  border-radius: 10px; padding: 8px 10px;
}
.compare-ing-item select, .compare-ing-item input {
  background: rgba(141,110,99,0.06); border: 1.5px solid rgba(141,110,99,0.2);
  border-radius: 8px; color: var(--text); font-family: 'Nunito', sans-serif;
  font-size: 12px; padding: 5px 8px; outline: none;
}
.compare-ing-item select:focus, .compare-ing-item input:focus { border-color: var(--earth); }
.compare-ing-item input { width: 70px; }
.compare-ing-del {
  width: 28px; height: 28px; background: rgba(230,81,0,0.08);
  border: 1.5px solid rgba(230,81,0,0.25); border-radius: 8px;
  color: #E65100; cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.compare-add-btn {
  width: 100%; padding: 8px; margin-bottom: 10px;
  background: rgba(141,110,99,0.07); border: 1.5px dashed rgba(141,110,99,0.3);
  border-radius: 10px; color: var(--earth); cursor: pointer;
  font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 700; transition: all 0.2s;
}
.compare-add-btn:hover { background: rgba(141,110,99,0.14); border-style: solid; }
.compare-calc-btn {
  width: 100%; padding: 11px;
  background: linear-gradient(135deg, var(--earth), #A1887F);
  border: none; border-radius: 12px; color: #fff; cursor: pointer;
  font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 800;
  letter-spacing: 0.04em; transition: all 0.25s;
  box-shadow: 0 4px 14px rgba(141,110,99,0.3);
}
.compare-calc-btn:hover {
  background: linear-gradient(135deg, var(--earth-dark), var(--earth));
  transform: translateY(-1px); box-shadow: 0 6px 18px rgba(141,110,99,0.38);
}
.compare-result { display: none; margin-top: 14px; animation: slideIn 0.3s ease; }
.compare-result.show { display: block; }
.compare-result-card {
  background: rgba(141,110,99,0.05); border: 1.5px solid rgba(141,110,99,0.25);
  border-radius: 14px; padding: 18px;
}
.compare-scenarios { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.compare-scenario-box {
  border-radius: 12px; padding: 14px;
  border: 1.5px solid rgba(46,125,50,0.15); background: rgba(46,125,50,0.04);
}
.compare-scenario-box.scenario-b {
  border-color: rgba(141,110,99,0.2); background: rgba(141,110,99,0.04);
}
.compare-scenario-label {
  font-family: 'Nunito', sans-serif; font-size: 10px; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 8px; color: var(--primary);
}
.compare-scenario-box.scenario-b .compare-scenario-label { color: var(--earth); }
.compare-scenario-co2 {
  font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 700;
  color: var(--primary); margin-bottom: 4px;
}
.compare-scenario-box.scenario-b .compare-scenario-co2 { color: var(--earth); }
.compare-scenario-dist { font-size: 12px; color: var(--text-muted); font-family: 'Source Code Pro', monospace; }
.compare-verdict {
  text-align: center; padding: 14px;
  background: rgba(46,125,50,0.06); border: 1.5px solid rgba(46,125,50,0.2);
  border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.5;
}
.compare-verdict .verdict-pct {
  font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 700;
  color: var(--primary); display: block; margin: 4px 0;
}
.compare-verdict.worse { background: rgba(230,81,0,0.05); border-color: rgba(230,81,0,0.2); }
.compare-verdict.worse .verdict-pct { color: #E65100; }

/* ═══════════════════════════════════════════════════
   LOADING OVERLAY (full screen)
═══════════════════════════════════════════════════ */
.calc-loading-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(220,200,154,0.94); backdrop-filter: blur(6px);
  display: none; flex-direction: column; align-items: center;
  justify-content: center; gap: 20px;
}
.calc-loading-overlay.show { display: flex; }
.calc-loading-ring {
  width: 64px; height: 64px; position: relative;
}
.calc-loading-ring::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid rgba(46,125,50,0.12);
}
.calc-loading-ring::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--primary); border-right-color: rgba(46,125,50,0.4);
  animation: spin 0.8s linear infinite;
}
.calc-loading-orb {
  position: absolute; inset: 10px; border-radius: 50%;
  background: radial-gradient(circle, rgba(46,125,50,0.12), transparent);
  animation: orbPulse 1.5s ease-in-out infinite;
}
@keyframes orbPulse { 0%,100%{transform:scale(0.8);opacity:0.5} 50%{transform:scale(1.1);opacity:1} }
.calc-loading-label {
  font-family: 'Playfair Display', serif; font-size: 16px; font-weight: 700;
  color: var(--primary); letter-spacing: 0.05em;
}
.calc-loading-steps { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.calc-step {
  font-family: 'Source Code Pro', monospace; font-size: 12px; color: var(--text-dim);
  letter-spacing: 0.05em; opacity: 0; transition: opacity 0.4s, color 0.3s;
}
.calc-step.active { opacity: 1; color: var(--primary); }
.calc-step.done { opacity: 0.4; color: var(--text-muted); }

/* ═══════════════════════════════════════════════════
   RESULT REVEAL
═══════════════════════════════════════════════════ */
.result-reveal { opacity: 0; transform: translateY(10px); transition: opacity 0.4s ease, transform 0.4s ease; }
.result-reveal.visible { opacity: 1; transform: translateY(0); }
.summary-card { transition: border-color 0.3s, transform 0.2s, box-shadow 0.3s; }
.summary-card.highlight { box-shadow: 0 0 0 3px rgba(46,125,50,0.2), var(--shadow-md); border-color: rgba(46,125,50,0.45); }

/* ═══════════════════════════════════════════════════
   CHATBOT
═══════════════════════════════════════════════════ */
#chatBtn {
  position: fixed; bottom: 28px; right: 28px; z-index: 999;
  width: 58px; height: 58px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-mid));
  border: none; cursor: pointer; font-size: 24px;
  box-shadow: 0 4px 20px rgba(46,125,50,0.40), 0 0 0 0 rgba(46,125,50,0.3);
  display: flex; align-items: center; justify-content: center;
  animation: chatPulse 2.5s infinite; transition: transform 0.2s;
}
#chatBtn:hover { transform: scale(1.08); }
@keyframes chatPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(46,125,50,0.40), 0 0 0 0 rgba(46,125,50,0.3); }
  50%       { box-shadow: 0 4px 20px rgba(46,125,50,0.50), 0 0 0 12px rgba(46,125,50,0); }
}
#chatWindow {
  position: fixed; bottom: 100px; right: 28px; z-index: 998;
  width: 340px; max-height: 520px;
  background: #FFF8EE; border: 1.5px solid rgba(141,110,99,0.25);
  border-radius: 20px; display: none; flex-direction: column;
  box-shadow: 0 12px 48px rgba(141,110,99,0.20); overflow: hidden;
  animation: slideUp 0.3s ease;
}
#chatWindow.open { display: flex; }
@keyframes slideUp { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
.chat-header {
  background: linear-gradient(135deg, rgba(141,110,99,0.12), rgba(212,191,146,0.18));
  padding: 14px 18px; border-bottom: 1px solid rgba(141,110,99,0.15);
  display: flex; align-items: center; justify-content: space-between;
}
.chat-header-left { display: flex; align-items: center; gap: 10px; }
.chat-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(46,125,50,0.12); border: 1.5px solid rgba(46,125,50,0.3);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.chat-header-title { font-family: 'Playfair Display', serif; font-size: 13px; font-weight: 700; color: var(--primary); }
.chat-status { font-size: 10px; color: #388E3C; font-family: 'Source Code Pro', monospace; }
.chat-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 18px; padding: 2px 6px; border-radius: 5px; transition: color 0.2s; }
.chat-close:hover { color: #E65100; }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  scrollbar-width: thin; scrollbar-color: rgba(46,125,50,0.2) transparent;
}
.chat-msg {
  max-width: 85%; font-size: 13px; line-height: 1.6;
  padding: 10px 14px; border-radius: 12px;
  animation: msgIn 0.25s ease;
}
@keyframes msgIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }
.chat-msg.bot {
  background: rgba(141,110,99,0.08); border: 1.5px solid rgba(141,110,99,0.18);
  color: var(--text); border-radius: 4px 14px 14px 14px; align-self: flex-start;
}
.chat-msg.user {
  background: var(--primary); color: #fff;
  border-radius: 14px 4px 14px 14px; align-self: flex-end;
}
.chat-questions {
  padding: 10px 12px; border-top: 1px solid rgba(141,110,99,0.14);
  display: flex; flex-direction: column; gap: 5px;
}
.chat-q-btn {
  background: rgba(141,110,99,0.07); border: 1.5px solid rgba(141,110,99,0.18);
  border-radius: 10px; padding: 8px 12px; color: var(--earth-dark);
  cursor: pointer; font-family: 'Nunito', sans-serif; font-size: 12px;
  font-weight: 600; text-align: left; transition: all 0.2s;
}
.chat-q-btn:hover { background: rgba(141,110,99,0.14); border-color: var(--earth); }

/* ═══════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════ */
footer {
  padding: 40px 32px;
  background: linear-gradient(135deg, #1B5E20 0%, #2E7D32 100%);
  text-align: center;
}
.footer-logo {
  font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 700;
  color: #fff; letter-spacing: 0.05em; margin-bottom: 12px;
}
.footer-text {
  font-size: 13px; font-family: 'Nunito', sans-serif;
  color: rgba(255,255,255,0.65); line-height: 1.8;
}
.footer-links {
  display: flex; justify-content: center; gap: 20px;
  margin-top: 16px; flex-wrap: wrap;
}
.footer-link {
  font-size: 12px; color: rgba(255,255,255,0.75);
  font-family: 'Nunito', sans-serif; font-weight: 600;
  text-decoration: none; transition: color 0.2s;
}
.footer-link:hover { color: #A5D6A7; }
.footer-credits {
  font-size: 11px; color: rgba(255,255,255,0.45);
  font-family: 'Source Code Pro', monospace; margin-top: 14px;
}

/* ═══════════════════════════════════════════════════
   LEAFLET OVERRIDES
═══════════════════════════════════════════════════ */
.leaflet-container { font-family: 'Nunito', sans-serif; background: #081a08 !important; }
.leaflet-tile { filter: invert(1) hue-rotate(180deg) brightness(0.75) saturate(0.4) !important; }
.leaflet-popup-content-wrapper {
  border-radius: 14px; background: #FFF8EE;
  border: 1.5px solid rgba(141,110,99,0.25);
  box-shadow: 0 8px 32px rgba(141,110,99,0.20);
  font-family: 'Nunito', sans-serif; color: var(--text);
}
.leaflet-popup-tip { background: #FFF8EE; }
.leaflet-popup-content { margin: 12px 16px; font-size: 13px; line-height: 1.6; }
.popup-title { font-weight: 700; font-family: 'Playfair Display', serif; font-size: 13px; color: var(--primary); margin-bottom: 4px; }
.popup-detail { color: var(--text-muted); font-family: 'Source Code Pro', monospace; font-size: 12px; }
.popup-co2 { font-weight: 700; font-family: 'Playfair Display', serif; color: #E65100; margin-top: 4px; }

/* ═══════════════════════════════════════════════════
   SCROLLBAR
═══════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: rgba(46,125,50,0.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(46,125,50,0.45); }

/* ═══════════════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════════════ */
@keyframes floatIn   { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }
@keyframes slideIn   { from { opacity:0; transform:translateX(-10px); } to { opacity:1; transform:translateX(0); } }
@keyframes spin      { to { transform:rotate(360deg); } }
@keyframes shake     { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-4px)} 75%{transform:translateX(4px)} }
@keyframes shimmer   { from{transform:translateX(-100%)} to{transform:translateX(100%)} }
@keyframes fadeIn    { from{opacity:0;transform:translateY(4px)} to{opacity:1;transform:translateY(0)} }
@keyframes calcPulse { 0%{box-shadow:none} 50%{box-shadow:0 0 20px rgba(46,125,50,0.3)} 100%{box-shadow:none} }

/* ═══════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════ */
@media (max-width: 1080px) {
  .home-page-nav-cards { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 960px) {
  .app-layout { grid-template-columns: 1fr; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .intro-grid, .env-equivalents, .suggest-grid { grid-template-columns: 1fr 1fr; }
  .how-grid { grid-template-columns: 1fr; }
  .faq-fact-row { grid-template-columns: 1fr 1fr; }
  .transport-mode-grid { grid-template-columns: repeat(2,1fr); }
  .home-page-nav-cards { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 600px) {
  body { padding-top: 0; }
  nav { padding: 0 16px; height: 58px; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column;
    position: fixed; top: 58px; left: 0; right: 0;
    background: rgba(220,200,154,0.99);
    padding: 16px; border-bottom: 1.5px solid rgba(141,110,99,0.25);
    gap: 4px; z-index: 999; box-shadow: 0 8px 28px rgba(141,110,99,0.18);
  }
  .nav-link.active { display: inline-flex; justify-content: flex-start; }
  .nav-mobile-toggle { display: flex; align-items: center; justify-content: center; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .compare-scenarios { grid-template-columns: 1fr; }
  .app-section, .intro-section, .env-section, .chart-section, .how-section, .suggest-section { padding: 60px 16px 40px; }
  .faq-section { padding: 60px 16px 80px; }
  .food-selector-section { padding: 72px 16px 40px; }
  .summary-grid { grid-template-columns: 1fr; }
  .intro-grid, .env-equivalents, .suggest-grid { grid-template-columns: 1fr; }
  .home-page-nav-cards { grid-template-columns: 1fr; }
  .faq-chips { gap: 8px; }
  .faq-chip { font-size: 12px; padding: 7px 14px; }
  .faq-q { padding: 16px; font-size: 14px; }
  #chatWindow { width: calc(100vw - 32px); right: 16px; }
  .hero { padding: 80px 20px 50px; }
  .hero-stats { gap: 20px; }
  .hero-cta-row { flex-direction: column; }
  .hero-cta-btn { text-align: center; }
}


/* ═══════════════════════════════════════════════════
   BROWN EARTH ACCENT ADDITIONS
═══════════════════════════════════════════════════ */

/* ─── Brown accent stripe on first section of each page ─── */
.page-section.active-page > section:first-child { position: relative; }
.page-section.active-page > section:first-child::before {
  content: none;
}

/* ─── Brown left-edge accent on card hover ─── */
.card { position: relative; }
.card:hover::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg,#8D6E63,#D4BF92,#8D6E63);
  border-radius: 18px 0 0 18px;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: #DCC89A; }
::-webkit-scrollbar-thumb { background: rgba(141,110,99,0.55); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(93,64,55,0.75); }

/* ─── Section-title decorative underline ─── */
.section-title::after {
  content: ''; display: block; width: 48px; height: 3px;
  background: linear-gradient(90deg,#8D6E63,#D4BF92);
  border-radius: 2px; margin-top: 8px;
}

/* ─── Summary card dividers & left accents ─── */
.summary-card + .summary-card { border-left: 1px solid rgba(141,110,99,0.12); }
.sc-distance { border-left: 3px solid rgba(141,110,99,0.35); }
.sc-co2      { border-left: 3px solid rgba(230,81,0,0.35); }
.sc-count    { border-left: 3px solid rgba(46,125,50,0.35); }

/* ─── Ingredient result row border ─── */
.ing-result-row { border-top-color: rgba(141,110,99,0.12); }

/* ─── pnav card top accent strip ─── */
.pnav-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg,#8D6E63,#D4BF92,#A1887F);
  border-radius: 16px 16px 0 0; opacity: 0; transition: opacity 0.2s;
}
.pnav-card:hover::before { opacity: 1; }

/* ─── Section background parallax feel ─── */
.intro-section,.app-section,.food-selector-section,
.env-section,.chart-section,.how-section,.faq-section,.suggest-section {
  background-attachment: fixed;
}

/* ═══════════════════════════════════════════════════
   ECO-MILES CINEMATIC FEATURE STYLES
   Particles · Scroll Reveal · Ripple
   Timeline · Parallax · Tilt · Passport Stamp
═══════════════════════════════════════════════════ */

/* ── GLOBAL PARTICLES LAYER ── */
#ecoParticlesBg {
  position: fixed; inset: 0; z-index: -1;
  pointer-events: none; overflow: hidden;
}
.eco-particle {
  position: absolute; bottom: -60px;
  animation: floatLeaf linear infinite;
  will-change: transform;
  user-select: none;
  filter: blur(0.4px);
  pointer-events: none;
}
@keyframes floatLeaf {
  0%   { transform: translateY(0)       rotate(0deg)   translateX(0); opacity: 0; }
  5%   { opacity: 1; }
  50%  { transform: translateY(-50vh)   rotate(180deg) translateX(var(--drift, 60px)); }
  95%  { opacity: 0.8; }
  100% { transform: translateY(-105vh)  rotate(360deg) translateX(0); opacity: 0; }
}

/* Hero-specific particle container (parallax target) */
.eco-particles-hero {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0;
}

/* ── SCROLL REVEAL ── */
.sr-init {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.22,1,0.36,1);
}
.sr-init.sr-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── HERO WORD-BY-WORD REVEAL ── */
.hero-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(16px) rotateX(-20deg);
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.22,1,0.36,1);
  transform-origin: bottom center;
}
.hero-word-visible {
  opacity: 1;
  transform: translateY(0) rotateX(0deg);
}

/* ── SCROLL INDICATOR ── */
.scroll-indicator {
  position: absolute; bottom: 28px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; color: rgba(93,64,55,0.55);
  font-family: 'Source Code Pro', monospace; font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  animation: scrollBounce 2s ease-in-out infinite;
  z-index: 2; cursor: pointer;
}
.scroll-indicator-arrow {
  font-size: 18px; line-height: 1;
  animation: arrowBounce 1.4s ease-in-out infinite;
}
@keyframes scrollBounce {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1; }
}
@keyframes arrowBounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(5px); }
}

/* ── JOURNEY TIMELINE ── */
.journey-section {
  padding: 60px 32px;
  background: linear-gradient(160deg, #C8B080 0%, #BFA870 50%, #D4BF92 100%);
}
.journey-inner { max-width: 1100px; margin: 0 auto; }
#journeyTimeline {
  display: flex; align-items: flex-start;
  justify-content: center; gap: 0;
  margin-top: 48px; position: relative;
  flex-wrap: wrap;
}
.jt-step {
  display: flex; flex-direction: column; align-items: center;
  width: 120px; text-align: center;
  opacity: 0; transform: translateY(24px) scale(0.9);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22,1,0.36,1);
}
.jt-step.jt-active {
  opacity: 1; transform: translateY(0) scale(1);
}
.jt-icon-wrap {
  width: 64px; height: 64px; border-radius: 50%;
  background: #FFF8EE;
  border: 2px solid rgba(141,110,99,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; margin-bottom: 10px;
  box-shadow: 0 4px 16px rgba(141,110,99,0.20);
  transition: box-shadow 0.3s, border-color 0.3s;
}
.jt-step.jt-active .jt-icon-wrap {
  border-color: var(--primary);
  box-shadow: 0 4px 18px rgba(46,125,50,0.22);
}
.jt-label {
  font-family: 'Playfair Display', serif; font-size: 13px; font-weight: 700;
  color: #5D4037; margin-bottom: 4px;
}
.jt-desc {
  font-size: 11px; color: #8D6E63; line-height: 1.4;
  font-family: 'Source Code Pro', monospace;
}
.jt-conn {
  display: flex; align-items: center; justify-content: center;
  width: 60px; padding-bottom: 28px;
  opacity: 0; transition: opacity 0.4s ease;
  flex-shrink: 0;
}
.jt-conn.jt-conn-active { opacity: 1; }
.jt-conn-line {
  flex: 1; height: 2px;
  background: linear-gradient(90deg, #8D6E63, var(--primary), #8D6E63);
  border-radius: 1px; position: relative; overflow: hidden;
}
.jt-conn-line::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.5) 50%, transparent 100%);
  animation: connShimmer 2s linear infinite;
}
@keyframes connShimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}
.jt-conn-arrow {
  font-size: 14px; color: #8D6E63; flex-shrink: 0; margin-left: 3px;
}

/* ── RIPPLE WAVE ── */
.ripple-wave {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,0.35);
  transform: scale(0);
  animation: rippleExpand 0.65s ease-out forwards;
  pointer-events: none; z-index: 0;
}
@keyframes rippleExpand {
  to { transform: scale(1); opacity: 0; }
}
/* Ensure buttons have overflow:hidden for ripple */
.calc-btn, .hero-cta-btn, .food-add-to-calc-btn,
.add-ing-btn, .compare-calc-btn, .map-tab-btn,
.food-cat-tab, .nav-link {
  overflow: hidden; position: relative;
}

/* ── CARD TILT (3-D feel) ── */
.food-item-card, .intro-card, .pnav-card, .suggest-card {
  transform-style: preserve-3d;
  will-change: transform;
}

/* ── PASSPORT STAMP ── */
.passport-stamp {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 15px; font-weight: 900; letter-spacing: 0.12em;
  color: var(--primary); border: 3px solid var(--primary);
  border-radius: 12px; pointer-events: none;
  opacity: 0; transform: scale(0.6) rotate(-12deg);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.22,1,0.36,1);
  background: rgba(46,125,50,0.06);
  z-index: 10;
}
.passport-stamp-in {
  opacity: 1; transform: scale(1.05) rotate(-6deg);
}
.passport-stamp-out {
  opacity: 0; transform: scale(0.85) rotate(0deg);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ── CARBON PULSE on impact fill ── */
@keyframes carbonPulse {
  0%   { box-shadow: 0 0 0 0 rgba(46,125,50,0.55); }
  50%  { box-shadow: 0 0 0 8px rgba(46,125,50,0); }
  100% { box-shadow: 0 0 0 0 rgba(46,125,50,0); }
}
.impact-fill.carbon-pulse {
  animation: carbonPulse 0.6s ease forwards;
}

/* ── HERO CINEMATIC LABEL pulse ── */
.hero-label {
  animation: labelPulse 3s ease-in-out infinite;
}
@keyframes labelPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46,125,50,0.2); }
  50%       { box-shadow: 0 0 14px 3px rgba(46,125,50,0.12); }
}

/* ── HERO background gradient animation ── */
.hero {
  background-size: 200% 200%;
  animation: heroGradientShift 12s ease-in-out infinite;
}
@keyframes heroGradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── PAGE ENTRANCE animation ── */
.page-entered > section {
  animation: pageEnter 0.45s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── FOOD PASSPORT badge (eco score on card) ── */
.food-eco-badge {
  position: absolute; top: 8px; left: 8px;
  font-size: 10px; font-weight: 800;
  font-family: 'Source Code Pro', monospace;
  padding: 2px 7px; border-radius: 6px;
  letter-spacing: 0.06em;
  pointer-events: none;
}
.food-eco-badge.eco-low    { background: rgba(27,94,32,0.12);  color: #1B5E20;  border: 1px solid rgba(27,94,32,0.25); }
.food-eco-badge.eco-mid    { background: rgba(249,168,37,0.12); color: #F57F17;  border: 1px solid rgba(249,168,37,0.3); }
.food-eco-badge.eco-high   { background: rgba(230,81,0,0.12);  color: #E65100;  border: 1px solid rgba(230,81,0,0.25); }

/* ── MICRO: nav link hover glow ── */
.nav-link:hover {
  text-shadow: 0 0 8px rgba(46,125,50,0.18);
}

/* ── MICRO: calc button shimmer on idle ── */
.calc-btn::before {
  content: '';
  position: absolute; top: 0; left: -75%; width: 50%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.18), transparent);
  transform: skewX(-20deg);
  animation: btnShimmer 4s ease-in-out infinite;
}
@keyframes btnShimmer {
  0%, 70%, 100% { left: -75%; opacity: 0; }
  40%           { left: 130%; opacity: 1; }
}

/* ── MICRO: hero stat underline grow ── */
.hero-stat-val {
  position: relative; display: inline-block;
}
.hero-stat-val::after {
  content: ''; position: absolute; bottom: -3px; left: 0; right: 0;
  height: 2px; background: linear-gradient(90deg, var(--primary), #A5D6A7);
  border-radius: 1px; transform: scaleX(0);
  transition: transform 0.4s ease;
  transform-origin: left;
}
.hero-stats:hover .hero-stat-val::after { transform: scaleX(1); }

/* ── MICRO: pnav card shine on hover ── */
.pnav-card::after {
  content: '';
  position: absolute; top: -50%; left: -60%;
  width: 40%; height: 200%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.18), transparent);
  transform: skewX(-20deg) translateX(0);
  transition: transform 0.5s ease;
  pointer-events: none;
}
.pnav-card:hover::after { transform: skewX(-20deg) translateX(300%); }

/* ── MICRO: smooth focus glow on all inputs ── */
.field-input:focus,
.ing-select:focus,
.field-select:focus,
.search-input:focus,
.food-search-input:focus {
  box-shadow: 0 0 0 3px rgba(46,125,50,0.12), 0 2px 8px rgba(141,110,99,0.10);
  border-color: var(--primary);
  outline: none;
}

/* ── RESPONSIVE for timeline ── */
@media (max-width: 768px) {
  #journeyTimeline {
    flex-direction: column; align-items: center; gap: 0;
  }
  .jt-conn {
    width: auto; height: 36px; padding: 0 0 0 28px;
    flex-direction: column; justify-content: center;
  }
  .jt-conn-line { width: 2px; height: 36px; flex: none; }
  .jt-conn-arrow { display: none; }
}

@media (max-width: 600px) {
  .journey-section { padding: 48px 16px; }
}

/* ═══════════════════════════════════════════════════
   LOGO  ·  New PNG logo styles
═══════════════════════════════════════════════════ */
.logo-icon {
  width: auto; height: 46px;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0;
}
.logo-img {
  height: 44px; width: auto;
  object-fit: contain;
  display: block;
  border-radius: 0;
  mix-blend-mode: multiply;
  transition: filter 0.3s ease, transform 0.25s ease;
}
.logo:hover .logo-img { transform: scale(1.06); }

/* Dark mode logo — invert so it looks good on dark bg */
[data-theme="dark"] .logo-img {
  mix-blend-mode: normal;
  filter: brightness(1.15) saturate(1.1);
}
.footer-logo-img {
  height: 26px; width: auto;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 8px;
  filter: brightness(1.4) saturate(0.8);
}

/* ═══════════════════════════════════════════════════
   DARK MODE VARIABLES
═══════════════════════════════════════════════════ */
:root {
  --transition-theme: background-color 0.35s ease, color 0.35s ease,
                      border-color 0.35s ease, box-shadow 0.35s ease;
}

/* Apply smooth transitions to themed elements */
body, nav, .card, .hero, .intro-card, .summary-card, .map-card,
.impact-card, .ingChart-card, .explain-panel, .transport-compare-card,
.alt-card, .dash-card, .insights-card, .how-card, .faq-item,
.suggest-card, .env-card, .chart-wrap, .pnav-card, .food-item-card,
.food-selector-footer, #chatWindow, .carbon-score-card, .badges-card,
.history-card, .weekly-summary, .hero-card, .ing-item {
  transition: var(--transition-theme);
}

[data-theme="dark"] {
  --bg-deep:      #0F172A;
  --bg-dark:      #0A0F1E;
  --bg-card:      #1E293B;
  --bg-card2:     #162032;
  --primary:      #22C55E;
  --primary-dark: #16A34A;
  --primary-mid:  #4ADE80;
  --primary-light:#86EFAC;
  --accent:       #FBBF24;
  --accent-dark:  #F59E0B;
  --earth:        #A78BFA;
  --earth-dark:   #7C3AED;
  --neon-cyan:    #22C55E;
  --neon-pink:    #F87171;
  --neon-purple:  #A78BFA;
  --neon-green:   #4ADE80;
  --neon-yellow:  #FBBF24;
  --text:         #F8FAFC;
  --text-muted:   #94A3B8;
  --text-dim:     #64748B;
  --border:       rgba(34,197,94,0.20);
  --border-light: rgba(34,197,94,0.10);
  --shadow:       0 4px 20px rgba(0,0,0,0.35);
  --shadow-md:    0 8px 32px rgba(0,0,0,0.45);
  --shadow-warm:  0 4px 20px rgba(0,0,0,0.30);
}

/* Dark backgrounds for main sections */
[data-theme="dark"] body {
  background: #0F172A;
  background-image:
    radial-gradient(circle at 15% 85%, rgba(34,197,94,0.08) 0%, transparent 45%),
    radial-gradient(circle at 85% 15%, rgba(251,191,36,0.05) 0%, transparent 45%);
}
[data-theme="dark"] nav {
  background: rgba(15,23,42,0.97);
  border-bottom-color: rgba(34,197,94,0.15);
}
[data-theme="dark"] .hero {
  background: linear-gradient(160deg, #0F172A 0%, #111827 40%, #0D2818 100%);
}
[data-theme="dark"] .intro-section,
[data-theme="dark"] .app-section,
[data-theme="dark"] .food-selector-section,
[data-theme="dark"] .env-section,
[data-theme="dark"] .chart-section,
[data-theme="dark"] .how-section,
[data-theme="dark"] .faq-section,
[data-theme="dark"] .suggest-section,
[data-theme="dark"] .journey-section,
[data-theme="dark"] .history-section {
  background: linear-gradient(180deg, #0F172A 0%, #111827 100%);
}
[data-theme="dark"] .card,
[data-theme="dark"] .summary-card,
[data-theme="dark"] .map-card,
[data-theme="dark"] .impact-card,
[data-theme="dark"] .ingChart-card,
[data-theme="dark"] .explain-panel,
[data-theme="dark"] .transport-compare-card,
[data-theme="dark"] .alt-card,
[data-theme="dark"] .dash-card,
[data-theme="dark"] .insights-card,
[data-theme="dark"] .how-card,
[data-theme="dark"] .faq-item,
[data-theme="dark"] .suggest-card,
[data-theme="dark"] .env-card,
[data-theme="dark"] .chart-wrap,
[data-theme="dark"] .pnav-card,
[data-theme="dark"] .food-item-card,
[data-theme="dark"] .food-selector-footer,
[data-theme="dark"] .hero-card,
[data-theme="dark"] .carbon-score-card,
[data-theme="dark"] .badges-card,
[data-theme="dark"] .history-card,
[data-theme="dark"] .ing-item {
  background: #1E293B;
  border-color: rgba(34,197,94,0.18);
}
[data-theme="dark"] .card-header,
[data-theme="dark"] .map-header,
[data-theme="dark"] .map-view-tabs,
[data-theme="dark"] .insights-header,
[data-theme="dark"] .badges-card > .badges-title,
[data-theme="dark"] .cs-header {
  background: rgba(34,197,94,0.06);
  border-color: rgba(34,197,94,0.12);
}
[data-theme="dark"] .search-input,
[data-theme="dark"] .ing-select,
[data-theme="dark"] .field-select,
[data-theme="dark"] .field-input,
[data-theme="dark"] .food-search-input,
[data-theme="dark"] .food-cat-tab,
[data-theme="dark"] .faq-chip {
  background: #162032;
  border-color: rgba(34,197,94,0.22);
  color: var(--text);
}
[data-theme="dark"] .search-dropdown { background: #1E293B; border-color: rgba(34,197,94,0.25); }
[data-theme="dark"] .search-result:hover { background: rgba(34,197,94,0.08); }
[data-theme="dark"] .selected-dest { background: rgba(34,197,94,0.08); border-color: rgba(34,197,94,0.2); }
[data-theme="dark"] #chatWindow { background: #1E293B; border-color: rgba(34,197,94,0.2); }
[data-theme="dark"] .chat-msg.bot { background: rgba(34,197,94,0.06); border-color: rgba(34,197,94,0.15); }
[data-theme="dark"] .faq-q:hover { background: rgba(34,197,94,0.05); }
[data-theme="dark"] .faq-item.open .faq-q { background: rgba(34,197,94,0.07); }
[data-theme="dark"] .food-item-card:hover { background: #243450; }
[data-theme="dark"] .food-item-card.selected { background: rgba(34,197,94,0.08); }
[data-theme="dark"] .tooltip-bubble,
[data-theme="dark"] .tip-bubble {
  background: #1E293B;
  border-color: rgba(34,197,94,0.25);
  color: var(--text);
}
[data-theme="dark"] footer {
  background: linear-gradient(135deg, #0A1628 0%, #111827 100%);
}
[data-theme="dark"] ::-webkit-scrollbar-track { background: #0F172A; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(34,197,94,0.35); }
[data-theme="dark"] .eco-facts-bar { background: rgba(15,23,42,0.95); border-color: rgba(34,197,94,0.2); }

/* ── Dark mode nav link ── */
[data-theme="dark"] .nav-link:hover { background: rgba(34,197,94,0.08); color: #4ADE80; }
[data-theme="dark"] .nav-link.active { background: #22C55E; color: #0F172A; }

/* ── Theme Toggle Button ── */
.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(46,125,50,0.10);
  border: 1.5px solid rgba(46,125,50,0.25);
  cursor: pointer; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.25s; flex-shrink: 0; margin-left: 8px;
}
.theme-toggle:hover {
  background: rgba(46,125,50,0.18);
  transform: scale(1.08) rotate(20deg);
}
.theme-toggle.dark-active {
  background: rgba(251,191,36,0.15);
  border-color: rgba(251,191,36,0.35);
}
[data-theme="dark"] .theme-toggle {
  background: rgba(34,197,94,0.12);
  border-color: rgba(34,197,94,0.3);
}

/* ═══════════════════════════════════════════════════
   CARBON SCORE SYSTEM
═══════════════════════════════════════════════════ */
.carbon-score-section { margin-bottom: 16px; }
.carbon-score-card {
  background: #FFF8EE;
  border: 1.5px solid rgba(46,125,50,0.2);
  border-radius: 20px; padding: 22px 24px;
  box-shadow: var(--shadow);
  text-align: center;
}
.cs-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid rgba(141,110,99,0.12);
}
.cs-title {
  font-family: 'Playfair Display', serif; font-size: 14px;
  font-weight: 700; color: var(--primary);
}
.cs-grade {
  font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 900;
  padding: 4px 16px; border-radius: 10px; border: 1.5px solid;
}
.cs-ring-wrap {
  position: relative; width: 130px; height: 130px;
  margin: 0 auto 16px;
}
.cs-ring { width: 130px; height: 130px; transform: rotate(-90deg); }
.cs-ring-bg {
  fill: none; stroke: rgba(141,110,99,0.15); stroke-width: 10;
}
.cs-ring-fill {
  fill: none; stroke-width: 10; stroke-linecap: round;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.22,1,0.36,1),
              stroke 0.4s ease;
}
.cs-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.cs-score {
  font-family: 'Playfair Display', serif; font-size: 34px; font-weight: 900;
  color: var(--text); line-height: 1;
}
.cs-score-label {
  font-size: 11px; color: var(--text-muted);
  font-family: 'Source Code Pro', monospace;
}
.cs-category {
  font-family: 'Playfair Display', serif; font-size: 16px; font-weight: 700;
  margin-bottom: 8px;
}
.cs-comparison {
  font-size: 13px; color: var(--text-muted); line-height: 1.6;
  margin-bottom: 14px; font-style: italic;
}
.cs-recs { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.cs-rec-item {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12px; color: var(--text-muted); line-height: 1.5;
  background: rgba(46,125,50,0.05); border-radius: 8px; padding: 7px 10px;
}
.cs-rec-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 4px;
}

/* ═══════════════════════════════════════════════════
   GAMIFICATION BADGES
═══════════════════════════════════════════════════ */
.badges-section { margin-bottom: 16px; }
.badges-card {
  background: #FFF8EE; border: 1.5px solid rgba(141,110,99,0.2);
  border-radius: 20px; overflow: hidden; box-shadow: var(--shadow);
}
.badges-title {
  font-family: 'Playfair Display', serif; font-size: 14px; font-weight: 700;
  color: var(--primary); padding: 14px 20px;
  border-bottom: 1px solid rgba(141,110,99,0.12);
  background: rgba(141,110,99,0.06);
}
.badges-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; padding: 16px;
}
.badge-item {
  border-radius: 14px; padding: 14px 10px; text-align: center;
  border: 1.5px solid; transition: all 0.25s; cursor: default;
  position: relative;
}
.badge-unlocked {
  background: rgba(46,125,50,0.07);
  border-color: rgba(46,125,50,0.3);
  box-shadow: 0 3px 14px rgba(46,125,50,0.12);
  animation: badgePop 0.5s cubic-bezier(0.22,1,0.36,1);
}
.badge-locked {
  background: rgba(141,110,99,0.05);
  border-color: rgba(141,110,99,0.15);
  opacity: 0.55;
  filter: grayscale(0.5);
}
.badge-unlocked:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 8px 22px rgba(46,125,50,0.18); }
@keyframes badgePop { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.badge-icon { font-size: 28px; margin-bottom: 6px; line-height: 1; }
.badge-name { font-family: 'Playfair Display', serif; font-size: 11px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.badge-desc { font-size: 10px; color: var(--text-muted); line-height: 1.4; font-family: 'Source Code Pro', monospace; }
.badge-check {
  position: absolute; top: 6px; right: 8px;
  font-size: 11px; color: var(--primary); font-weight: 900;
}
.badge-lock { position: absolute; top: 6px; right: 8px; font-size: 10px; opacity: 0.4; }

/* ── Badge Unlock Popup ── */
.badge-popup {
  position: fixed; top: 80px; right: 24px; z-index: 9999;
  background: #FFF8EE; border: 2px solid rgba(46,125,50,0.4);
  border-radius: 20px; padding: 20px 24px; text-align: center;
  box-shadow: 0 12px 40px rgba(46,125,50,0.25);
  min-width: 200px;
  opacity: 0; transform: translateX(60px) scale(0.85);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.22,1,0.36,1);
}
.badge-popup-in { opacity: 1; transform: translateX(0) scale(1); }
.badge-popup-out { opacity: 0; transform: translateX(60px) scale(0.85); transition-duration: 0.4s; }
.badge-popup-icon { font-size: 36px; margin-bottom: 6px; animation: badgeFloat 1.5s ease-in-out infinite; }
@keyframes badgeFloat { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)} }
.badge-popup-title { font-size: 10px; font-family: 'Source Code Pro', monospace; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; }
.badge-popup-name  { font-family: 'Playfair Display', serif; font-size: 15px; font-weight: 700; color: var(--primary); margin: 4px 0; }
.badge-popup-desc  { font-size: 11px; color: var(--text-muted); }
[data-theme="dark"] .badge-popup { background: #1E293B; border-color: rgba(34,197,94,0.4); }
[data-theme="dark"] .carbon-score-card,
[data-theme="dark"] .badges-card { background: #1E293B; border-color: rgba(34,197,94,0.18); }

/* ═══════════════════════════════════════════════════
   HISTORY PAGE
═══════════════════════════════════════════════════ */
.history-section { padding: 80px 32px 60px; background: linear-gradient(180deg, #E8D5B0 0%, #DCC89A 100%); }
.history-inner { max-width: 1000px; margin: 0 auto; }
.clear-history-btn {
  display: none; align-items: center; gap: 6px;
  padding: 9px 18px; background: rgba(230,81,0,0.08);
  border: 1.5px solid rgba(230,81,0,0.25); border-radius: 10px;
  color: #E65100; cursor: pointer;
  font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 700;
  transition: all 0.2s;
}
.clear-history-btn:hover { background: rgba(230,81,0,0.16); }

/* Weekly summary */
.weekly-summary {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 12px;
  margin-bottom: 28px;
}
.ws-card {
  background: #FFF8EE; border: 1.5px solid rgba(141,110,99,0.2);
  border-radius: 16px; padding: 18px 14px; text-align: center;
  box-shadow: var(--shadow); transition: all 0.2s;
}
.ws-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.ws-icon { font-size: 24px; display: block; margin-bottom: 6px; }
.ws-val  { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 700; color: var(--primary); }
.ws-label{ font-size: 11px; color: var(--text-muted); font-family: 'Source Code Pro', monospace; margin-top: 3px; }

/* History cards */
.history-list { display: flex; flex-direction: column; gap: 12px; }
.history-empty { text-align: center; padding: 60px 24px; color: var(--text-muted); }
.history-empty-title { font-family: 'Playfair Display', serif; font-size: 16px; color: var(--text-muted); margin-top: 12px; }
.history-empty-sub   { font-size: 13px; color: var(--text-dim); margin-top: 6px; }
.history-card {
  display: flex; align-items: center; gap: 16px;
  background: #FFF8EE; border: 1.5px solid rgba(141,110,99,0.18);
  border-radius: 16px; padding: 16px 20px;
  box-shadow: var(--shadow); transition: all 0.25s;
}
.history-card:hover { transform: translateX(4px); box-shadow: var(--shadow-md); border-color: rgba(46,125,50,0.3); }
.hc-left { flex-shrink: 0; }
.hc-grade {
  font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 900;
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid;
}
.hc-body { flex: 1; min-width: 0; }
.hc-dest { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.hc-ings { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.hc-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--text-dim); font-family: 'Source Code Pro', monospace; }
.hc-right { text-align: right; flex-shrink: 0; }
.hc-co2 { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 700; color: #E65100; }
.hc-unit{ font-size: 11px; color: var(--text-muted); font-family: 'Source Code Pro', monospace; }

[data-theme="dark"] .history-section { background: linear-gradient(180deg,#0F172A,#111827); }
[data-theme="dark"] .ws-card,
[data-theme="dark"] .history-card   { background: #1E293B; border-color: rgba(34,197,94,0.18); }

/* ═══════════════════════════════════════════════════
   ECO FACTS CAROUSEL (fixed bottom bar)
═══════════════════════════════════════════════════ */
.eco-facts-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: rgba(232,213,176,0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(141,110,99,0.2);
  padding: 8px 24px; text-align: center;
  font-family: 'Source Code Pro', monospace; font-size: 12px;
  color: var(--earth-dark); letter-spacing: 0.04em;
}
.eco-facts-track {
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 1; transform: translateY(0);
}

/* ═══════════════════════════════════════════════════
   BACK TO TOP
═══════════════════════════════════════════════════ */
.back-to-top {
  position: fixed; bottom: 48px; right: 28px; z-index: 997;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--primary); color: #fff;
  border: none; cursor: pointer; font-size: 18px; font-weight: 700;
  box-shadow: 0 4px 16px rgba(46,125,50,0.35);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(20px) scale(0.85);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.22,1,0.36,1);
  pointer-events: none;
}
.back-to-top.btt-visible { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.back-to-top:hover { transform: translateY(-3px) scale(1.08); box-shadow: 0 7px 22px rgba(46,125,50,0.45); }

/* ── Adjust chatbot position to clear eco-facts bar ── */
#chatBtn    { bottom: 56px; }
#chatWindow { bottom: 112px; }

/* ── Responsive history ── */
@media (max-width: 760px) {
  .weekly-summary { grid-template-columns: repeat(2,1fr); }
  .badges-grid    { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 480px) {
  .weekly-summary { grid-template-columns: 1fr; }
  .hc-meta        { flex-direction: column; gap: 4px; }
}
