@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
body{font-family:'Inter',system-ui,sans-serif;background:#f5f5f5}

/* Nav demo */
.nav-demo{display:flex;align-items:center;justify-content:space-between;padding:0 40px;height:72px;background:#fff;border-bottom:1px solid #f0f0f0}
.nav-logo{display:flex;align-items:center;gap:10px}
.nav-brand{font-size:18px;font-weight:700;color:#111}
.nav-links{display:flex;gap:28px}
.nav-links a{font-size:14px;color:#374151;text-decoration:none}
.nav-cta{padding:10px 22px;background:#22c55e;color:#fff;border:none;border-radius:30px;font-size:14px;font-weight:600;cursor:pointer;font-family:'Inter',sans-serif}

/* STATS BAR */
.stats-bar{background:#fff;border-bottom:2px solid #86efac;box-shadow:0 2px 16px rgba(34,197,94,.12)}
.stats-inner{max-width:1200px;margin:0 auto;display:flex;align-items:center;justify-content:center;padding:0 40px;height:64px;gap:0}

/* STAT ITEM */
.stat-item{display:flex;align-items:center;gap:11px;flex:1;justify-content:center;padding:0 24px;position:relative;cursor:default}
.stat-item:hover .tooltip{opacity:1;visibility:visible;transform:translateY(0)}
.stat-icon{font-size:22px;flex-shrink:0}
.stat-body{display:flex;flex-direction:column;gap:2px}
.stat-value{font-size:18px;font-weight:800;color:#111;letter-spacing:-.5px;line-height:1;white-space:nowrap}
.stat-unit{font-size:12px;font-weight:500;color:#9ca3af}
.stat-green{color:#16a34a}
.stat-red{color:#dc2626}
.stat-label{font-size:11px;color:#9ca3af;white-space:nowrap}
.stat-divider{width:1px;height:32px;background:#86efac;flex-shrink:0}

/* TOOLTIP */
.tooltip{
  position:absolute;
  top:calc(100% + 10px);
  left:50%;transform:translateX(-50%) translateY(6px);
  width:280px;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:12px;
  box-shadow:0 8px 32px rgba(0,0,0,.12);
  padding:16px;
  z-index:999;
  opacity:0;visibility:hidden;
  transition:opacity .2s ease,transform .2s ease,visibility .2s;
  pointer-events:none;
}
.stat-item:hover .tooltip{pointer-events:all}

/* arrow */
.tooltip::before{
  content:'';position:absolute;
  top:-7px;left:50%;transform:translateX(-50%);
  width:12px;height:12px;
  background:#fff;border:1px solid #e5e7eb;
  border-right:none;border-bottom:none;
  transform:translateX(-50%) rotate(45deg);
}

.tip-header{display:flex;align-items:center;gap:8px;margin-bottom:10px}
.tip-icon{font-size:18px}
.tip-title{font-size:13px;font-weight:700;color:#111}
.tip-desc{font-size:12px;color:#4b5563;line-height:1.65;margin-bottom:12px}
.tip-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;border-top:1px solid #f3f4f6;padding-top:10px}
.tip-update{font-size:10px;color:#9ca3af;font-weight:500}
.tip-live{color:#16a34a}
.tip-link{font-size:11px;color:#16a34a;font-weight:600;text-decoration:none}
.tip-link:hover{text-decoration:underline}

/* clamp tooltip inside viewport */
.stat-item:first-child .tooltip{left:0;transform:translateY(6px)}
.stat-item:first-child .tooltip::before{left:24px}
.stat-item:last-child .tooltip{left:auto;right:0;transform:translateY(6px)}
.stat-item:last-child .tooltip::before{left:auto;right:24px;transform:rotate(45deg)}
.stat-item:first-child:hover .tooltip,.stat-item:last-child:hover .tooltip{transform:translateY(0)}

/* Responsive */
@media(max-width:768px){
  .stats-inner{flex-wrap:wrap;height:auto;padding:12px 16px;gap:10px}
  .stat-item{flex:calc(50% - 10px);justify-content:flex-start;padding:10px 12px;background:#f9fafb;border-radius:10px}
  .stat-divider{display:none}
  .nav-links{display:none}
  .nav-demo{padding:0 16px}
  .tooltip{position:fixed;top:auto;bottom:16px;left:16px!important;right:16px!important;width:auto;transform:none!important}
  .tooltip::before{display:none}
}
@media(max-width:480px){.stat-item{flex:100%}}

/* CO2 icon image */
.co2-img{width:28px;height:28px;object-fit:contain;flex-shrink:0}
.co2-img-sm{width:20px;height:20px;object-fit:contain;vertical-align:middle}
