:root{
  --navy:#0c1c2a;
  --panel:#0f2335;
  --text:#e7eef6;
  --muted:#b8c6d4;
  --green:#79d98c;
  --pill:#173247;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

/* SSO Overlay Styles */
.sso-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  margin: 8px 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #1e293b;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.sso-btn:hover { background: #f8fafc; border-color: #cbd5e1; }
.sso-btn.btn-apple { background: #000; color: #fff; border-color: #000; }
.sso-btn.btn-google { background: #4285f4; color: #fff; border-color: #4285f4; }
.sso-row { display: flex; flex-direction: column; gap: 4px; }

/* Demo Push Banner */
.demo-push {
  position: fixed;
  bottom: 100px;
  left: 16px;
  right: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  animation: slideUp 0.3s ease-out;
}
@keyframes slideUp {
  from { transform: translateY(100px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

*{box-sizing:border-box}
html,body,#app{height:100%;margin:0;overflow:hidden}
body{
font-family: -apple-system, system-ui, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
background:var(--bg);color:var(--text);
overflow:hidden;
}

/* Removed conflicting full-screen map rule - map is now contained in card */
.ui-layer{position:relative; z-index:2}

.full-height{ height: calc(100vh - 56px - 36px); }

/* Top */
.app-top{position:fixed; top:0; left:0; right:0; z-index:3}
.brandbar{display:flex; align-items:center; justify-content:center; gap:.75rem; height:56px; background:var(--surface); border-bottom:1px solid rgba(0,0,0,.06)}
.brand-word{letter-spacing:.35rem;font-weight:800}
.brand-bolt{width:20px;height:20px;filter:invert(1)}
.deal-banner{background:var(--green); color:#0b1a26; font-weight:800; text-align:center; padding:.6rem 1rem}

.main-layer{padding-top:108px; padding-bottom:100px}

/* Pages */
.page{
  display:none; 
  padding-top: 0;
  height: calc(100vh - var(--tabbar-height, 76px));
  overflow: hidden;
}
.page .page.stack {
  display: grid !important; /* Override for nested page elements */
}
.page.active{
  display:block !important;
}
.page:not(.active){
  display:none !important;
}

/* Allow Wallet and Me page content to be visible */
.page-scroll {
  display: block !important;
}

/* Ensure Wallet and Me pages are visible when active */
#page-wallet.active,
#page-profile.active {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  z-index: 1 !important;
  height: auto !important;
  overflow: visible !important;
}

/* ===== Explore Page - Apple Maps-style Redesign ===== */

/* Full-screen Explore page */
.page-explore-fullscreen {
  position: relative;
  height: calc(100vh - var(--tabbar-height, 76px));
  overflow: hidden;
  padding: 0;
  background: #f6f7f9;
}

/* Full-screen map background */
.explore-map-fullscreen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.explore-map-fullscreen .leaflet-container {
  height: 100% !important;
  width: 100% !important;
  background: #e5e7eb;
}

/* Top overlay: Search + Suggestions */
.explore-top-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: calc(env(safe-area-inset-top, 0) + 8px) 16px 0;
  pointer-events: none;
}

.explore-top-overlay > * {
  pointer-events: auto;
}

/* Search bar - Google Maps style (light) */
.explore-search-bar {
  margin: 8px 0 10px;
}

.search-bar-input {
  display: flex;
  align-items: center;
  background: #FFFFFF !important;
  border-radius: 22px !important;
  border: none !important;
  padding: 0 16px;
  box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.08) !important;
  gap: 12px;
  height: 48px;
  backdrop-filter: none !important;
}

.search-icon {
  width: 20px;
  height: 20px;
  color: #6E6E6E !important;
  flex-shrink: 0;
  stroke: #6E6E6E !important;
}

#explore-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  color: #6E6E6E !important;
  background: transparent;
}

#explore-search-input::placeholder {
  color: #6E6E6E !important;
}

.search-voice-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #6E6E6E !important;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.2s;
}

.search-voice-btn:hover {
  color: #4A4A4A !important;
}

.search-voice-btn svg {
  width: 20px;
  height: 20px;
  fill: #6E6E6E !important;
}

/* Suggestions row (chips) - Google Maps style (light) */
.explore-suggestions-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-padding-left: 16px;
  scroll-padding-right: 16px;
}

.explore-suggestions-row::-webkit-scrollbar {
  display: none;
}

.suggestion-chip {
  background: #FFFFFF;
  border: 1px solid #E5E5E5;
  border-radius: 18px;
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #4A4A4A;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: none;
  height: 32px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.suggestion-chip:hover {
  background: #F9F9F9;
  border-color: #D5D5D5;
}

.suggestion-chip.active {
  background: rgba(47, 107, 255, 0.12);
  border: none;
  color: #2F6BFF;
  font-weight: 600;
  box-shadow: none;
}

/* Recommended Perks Container - Single card with 3 compact perks */
/* Positioned above tab bar - accounts for tab bar height + safe area + gap */
.recommended-perks-container {
  position: fixed;
  bottom: calc(var(--tabbar-height, 76px) + env(safe-area-inset-bottom, 0px) + 16px);
  left: 16px;
  right: 16px;
  z-index: 1000; /* High enough to be visible above map */
  pointer-events: none;
  opacity: 0; /* Start hidden, will be animated in */
}

.recommended-perks-container.visible {
  pointer-events: auto;
  animation: recommendedPerksFadeIn 0.25s ease-out forwards;
  opacity: 1;
}

@keyframes recommendedPerksFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.recommended-perks-card {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 24px;
  box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.08);
  padding: 10px 16px;
  pointer-events: auto;
}

.recommended-perks-title {
  font-size: 15px;
  font-weight: 600;
  color: #333333;
  margin-bottom: 8px;
  text-align: left;
}

.recommended-perks-row {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: stretch;
  overflow: visible;
}

/* Compact Perk Card - variant for Recommended Perks */
.perk-card-compact {
  flex: 1;
  min-width: 0;
  height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
  padding: 6px 0;
  background: transparent;
  border: none;
}

.perk-card-compact:hover {
  transform: translateY(-2px);
}

.perk-card-compact:active {
  transform: translateY(0);
}

.perk-card-compact .perk-card-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #f4f5f7;
  margin: 0 auto;
}

.perk-card-compact .perk-card-reward {
  font-size: 13px;
  font-weight: 600;
  color: #2F6BFF;
  margin: 0;
  text-align: center;
  line-height: 1.3;
}

.perk-card-compact .perk-card-walk {
  font-size: 11px;
  color: #6B7280;
  margin: 0;
  text-align: center;
  line-height: 1.3;
}

/* Branded Charger Pins */
.charger-pin-marker {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.leaflet-marker-icon.charger-pin-marker {
  background: transparent !important;
  border: none !important;
}

.charger-pin {
  position: relative;
  display: inline-block;
  cursor: pointer;
  transform-origin: center bottom;
  will-change: transform;
  opacity: 0;
  animation: pinBounceIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes pinBounceIn {
  0% {
    opacity: 0;
    transform: translateY(-20px) scale(var(--pin-scale, 1));
  }
  60% {
    transform: translateY(2px) scale(var(--pin-scale, 1));
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(var(--pin-scale, 1));
  }
}

.charger-pin-circle {
  position: relative;
  z-index: 1;
}

.charger-pin-circle img {
  display: block;
}

.charger-pin-tail {
  position: absolute;
  z-index: 0;
  pointer-events: none;
}

/* Pin hover effect */
.charger-pin-marker:hover .charger-pin {
  filter: brightness(1.1);
}

/* AirDrop-style popover */
.merchant-popover {
  position: absolute;
  bottom: calc(var(--tabbar-height, 76px) + env(safe-area-inset-bottom, 0px) + 140px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  pointer-events: auto;
}

.popover-content {
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  min-width: 280px;
  max-width: 320px;
  text-align: center;
  animation: popoverIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes popoverIn {
  from {
    opacity: 0;
    transform: translateX(-50%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
}

.popover-logo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 12px;
}

.popover-name {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 8px;
}

.popover-text {
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 20px;
  line-height: 1.5;
}

.popover-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.popover-actions .btn-primary {
  background: #2F6BFF;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.popover-actions .btn-primary:hover {
  background: #2563eb;
}

.popover-actions .btn-link {
  background: none;
  border: none;
  color: #2F6BFF;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px;
  text-decoration: underline;
}

/* Dark mode support (if system prefers dark) - Updated to match light design */
@media (prefers-color-scheme: dark) {
  .search-bar-input {
    background: #FFFFFF !important;
    border: none !important;
    box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.08) !important;
  }
  
  .suggestion-chip {
    background: #FFFFFF !important;
    border: 1px solid #E5E5E5 !important;
    color: #4A4A4A !important;
  }
  
  .suggestion-chip:hover {
    background: #F9F9F9 !important;
    border-color: #D5D5D5 !important;
  }
  
  .suggestion-chip.active {
    background: rgba(47, 107, 255, 0.12) !important;
    border: none !important;
    color: #2F6BFF !important;
    font-weight: 600 !important;
  }
  
  .popover-content {
    background: #1f2937;
    color: #f9fafb;
  }
  
  #explore-search-input {
    color: #6E6E6E !important;
  }
  
  #explore-search-input::placeholder {
    color: #6E6E6E !important;
  }
}

/* Flexible spacer to fill remaining space */
.flex-spacer{
  flex: 0 1 auto;
  min-height: 8px;
  max-height: 40px;
}

/* Activity page styling */
.activity-content{
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 16px;
  overflow-y: auto;
}

.card{ background:#fff; border-radius:16px; box-shadow:0 10px 30px rgba(0,0,0,.06); margin:12px; }
.card--pad{ padding:14px 16px; }
.row{ display:flex; gap:12px; }
.center{ align-items:center; }
.space-between{ justify-content:space-between; }
.eyebrow{ font-size:12px; color:#6b7280; text-transform:uppercase; letter-spacing:.08em; }
.amount{ font-weight:700; }

.rep-card .rep-head{ font-size:18px; font-weight:800; margin-bottom:8px; }
.rep-row{ display:flex; align-items:center; gap:14px; }
.rep-icon{ color: var(--brand, #3b5bfd); }
.rep-main{ flex:1; }
.rep-score{ font-weight:800; font-size:24px; }
.rep-sub{ font-size:12px; color:#6b7280; margin-top:2px; }

.list{ list-style:none; padding:0; margin:8px 0 0; }
.list-item{ display:flex; align-items:center; gap:12px; padding:10px 0; border-top:1px solid #f0f2f5; }
.list-item:first-child{ border-top:none; }
.col{ flex:1; }
.title{ font-weight:600; }
.sub{ font-size:12px; color:#6b7280; }
.avatar{ width:36px; height:36px; border-radius:50%; background:#eef2ff; display:flex; align-items:center; justify-content:center; font-weight:700; color:#3b82f6; }

.badge{ font-size:11px; padding:4px 8px; border-radius:999px; font-weight:700; }
.badge--bronze   { background:#f6e0c8; color:#7a4e1d; }
.badge--silver   { background:#e9edf2; color:#4b5563; }
.badge--gold     { background:#fde68a; color:#78350f; }
.badge--platinum { background:#e5e7eb; color:#111827; }
.badge--guardian { background:#d1fae5; color:#065f46; }

/* Cards */
.card{background:var(--surface); color:var(--text); border-radius:28px; box-shadow: 0 10px 30px rgba(2, 8, 20, .06); padding:22px}
.hub-card{width:92%; margin:0 auto; position:fixed; left:50%; transform:translateX(-50%); bottom:88px}
.content-card{width:92%; margin:100px auto 0}

/* Hub */
.hub-name{font-size:32px; line-height:1.1; margin:0 0 .25rem}
.hub-subtitle{color:var(--muted); font-weight:800; margin-bottom:.75rem}

.pill-row{display:flex; gap:.6rem; margin-bottom:.8rem}
.pill{background:var(--pill); color:var(--text); padding:.4rem .7rem; border-radius:18px; font-weight:700; font-size:.9rem}

.logo-row{display:flex; gap:.7rem; margin:.4rem 0 1rem}
.merchant-logo{width:48px;height:48px;border-radius:50%;object-fit:cover;display:block;box-shadow:0 2px 8px rgba(0,0,0,.35)}

.meta-line{display:flex; gap:.5rem; align-items:center; color:var(--muted); margin-bottom:1rem}
.dot{opacity:.6}

/* Buttons */
.btn{border:0; cursor:pointer; font-weight:800; border-radius:18px}
.btn-primary{background:var(--green); color:#0a1a26; padding:1rem 1.2rem}
.btn-wide{width:100%}
.pill-btn{background:#102e41; color:var(--text); padding:.7rem 1rem}

/* Charge/Wallet/Profile */
.section-title{margin:0 0 .5rem; font-size:28px}
.balance{font-size:36px; font-weight:900; margin:.25rem 0 .75rem}
.list{list-style:none; padding:0; margin:.75rem 0 0}
.list li{display:flex; justify-content:space-between; padding:.6rem 0; border-bottom:1px solid rgba(255,255,255,.06)}
.row{display:flex}
.gap{gap:.75rem}
.muted{color:var(--muted)}
.prefs{display:grid; grid-template-columns:1fr 1fr; gap:.5rem 1rem; margin:.5rem 0 1rem}

/* Bottom Nav */
.bottom-nav{position:fixed; left:0; right:0; bottom:0; height:72px; display:flex; justify-content:space-around; align-items:center; background:var(--nav-bg); backdrop-filter: saturate(180%) blur(10px); z-index:3; border-top:1px solid rgba(0,0,0,.06)}
.bottom-nav .tab{background:transparent; border:0; color:var(--nav-label); display:flex; flex-direction:column; gap:.25rem; align-items:center; font-weight:700}
.bottom-nav .tab.active{color:var(--nav-label-active); font-weight:800}
.bottom-nav img{width:22px;height:22px;color:var(--nav-icon); filter: none; opacity: 0.95;}
.bottom-nav .tab.active img{color:var(--nav-icon-active); opacity: 1;}

.card{background:var(--card); border:1px solid #e2e8f0; border-radius:var(--radius-2); padding:var(--space-4); box-shadow:var(--shadow-1);}
.grid{display:grid; gap:16px; grid-template-columns:1fr; }
@media(min-width:980px){ .grid{grid-template-columns:1fr 1fr 1fr;} }
.text-quiet{color:var(--text-quiet)}
.h2{font-size:18px; font-weight:700; margin:0 0 8px}
.h3{font-size:16px; font-weight:700; margin:0 0 6px}

/* Walking Route Styles */
.route-badge{
  position:absolute;
  left:16px;
  top:12px;
  background:#fff;
  border-radius:12px;
  padding:6px 10px;
  font-weight:700;
  box-shadow:0 4px 16px rgba(0,0,0,.12);
}

.walk-cta{
  position:relative;
  margin:8px 16px 0;
  padding:10px 12px;
  border-radius:12px;
  background:color-mix(in srgb, var(--brand) 14%, #fff);
  font-weight:600;
}

.walk-cta button{
  background:var(--brand);
  color:#fff;
  border:0;
  border-radius:10px;
  padding:8px 12px;
  margin-left:8px;
}

/* Deprecate QR scanning UI (kept in DOM for safety, hidden visually) */
/* Removed scan panel styles */

/* Charge tab: simple verify-by-location button */
.verify-card{
  margin:16px; padding:16px; border-radius:14px;
  background:#fff; box-shadow:0 6px 20px rgba(0,0,0,.08);
}

.verify-card h3{ margin:0 0 8px; font-size:16px; }

.verify-btn{
  display:inline-block; background:var(--brand); color:#fff;
  border:0; border-radius:10px; padding:10px 14px; font-weight:700;
}

/* Safe-area spacing for tab bar & Leaflet attribution */
.leaflet-control-attribution, .leaflet-bottom { 
  margin-bottom: calc(var(--tabbar-height, 72px) + env(safe-area-inset-bottom, 0px)); 
}

/* Map container styling */
#map, .map-shell { 
  border-radius: 18px; 
  overflow: hidden; 
}

/* Header */
.topbar{
  height:52px; display:flex; align-items:center; justify-content:center;
  background:#fff; position:sticky; top:0; z-index:100;
  box-shadow:0 2px 8px rgba(0,0,0,.05);
}
.brand-logo{
  font-weight: 600; 
  letter-spacing: 0.04em; 
  font-size: 20px;
  color: var(--brand-blue);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.brand-logo .bolt{ 
  color: #F5B400;
  font-size: 18px;
}

/* Tabbar */
.tabbar{
  position:fixed; left:0; right:0; bottom:0; height:var(--tabbar-height);
  display:flex; align-items:center; justify-content:space-around;
  padding: 8px 12px calc(env(safe-area-inset-bottom,0px) + 8px);
  background:rgba(255,255,255,.85); backdrop-filter: blur(10px);
  box-shadow:0 -8px 20px rgba(0,0,0,.12); z-index:30;
  border-radius: 20px 20px 0 0;
}
.tab{
  flex:1; display:flex; flex-direction:column; align-items:center; gap:6px;
  min-width:48px; color: #A0A3B1; text-decoration:none;
  padding: 8px; /* Ensure 48px minimum tap area */
}
.tab .icon{
  width:24px; height:24px; stroke: currentColor; fill:none; stroke-width:1.5;
}
.tab .label{ font-size:12px; color:#A0A3B1; font-weight:500; }
.tab.active{ color: var(--brand-blue); }
.tab.active .label{ color: var(--brand-blue); font-weight:600; }

/* Centered Earn pill - aligned with nav icons */
.earn-pill{
  position:absolute; bottom: calc(env(safe-area-inset-bottom,0px) + var(--tabbar-height) - 36px);
  left:50%; transform: translateX(-50%);
  background: var(--brand-blue); color:#fff; width:56px; height:56px;
  border-radius:18px; display:flex; align-items:center; justify-content:center; flex-direction:column;
  box-shadow:0 4px 12px rgba(47,111,224,0.15);
  z-index:31; pointer-events:auto;
}
.earn-pill .icon{ width:20px; height:20px; color:#fff; stroke-width:1.5; }
.earn-pill .label{ color:#fff; font-weight:600; margin-top:2px; font-size:10px; }

/* Earn button outline matches nav icon color */
.tabbar .tab--primary {
  border: 2px solid var(--icon-muted) !important; /* same as inactive icon color */
  box-shadow: 0 10px 28px rgba(0,0,0,0.18);
}

/* CSS Variables for consistent styling */
:root {
  --icon-stroke: #9aa3af;        /* navbar outline gray */
  --brand: #3B82F6;              /* Nerava text blue */
  --tabbar-height: 76px;
}

.map-card{border-radius:20px;overflow:hidden;box-shadow:0 10px 24px rgba(0,0,0,.12);background:#fff;margin:16px}
#map{width:100%;height:220px}

.leaflet-bottom.leaflet-right{ display:none !important; }

/* Center Earn FAB vertically relative to tabbar, and give side spacing */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; height: var(--tabbar-height, 76px); }
.tabbar .fab {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--tabbar-height, 76px) - 48px);
  width: 88px; height: 56px; border-radius: 16px;
  background: var(--brand, #3B82F6); color: #fff;
  border: 2px solid var(--icon-stroke, #98A2B3);
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
}

/* Give breathing room to tabs adjacent to FAB */
.tabbar .tab[data-tab="charge"] { margin-right: 28px; }
.tabbar .tab[data-tab="wallet"] { margin-left: 28px; }

/* Spacing tweaks for Earn pill */
.tabbar{ padding: 8px 18px calc(env(safe-area-inset-bottom,0) + 8px); }
.tabbar .main{ transform: translateY(-10px); } /* reduce float height */
.tabbar .tab{ margin: 0 18px; }               /* a bit more gap */

/* Keep Earn pill clear of the map */
.tabbar--pill {
  z-index: 10;
  transform: translateY(-12px);
}

/* Ensure tab items distribute evenly with space-around */
.tabbar-inner{
  position:relative; width:100%; height:100%;
  display:flex; align-items:center; justify-content:space-around;
  gap:0;
}
.tabbar .tab{ flex: 0 0 auto; }


/* Enhanced Explore page styling */
.mini-sheet__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.perk-reward {
  font-size: 14px;
  color: var(--brand);
  font-weight: 600;
  margin-top: 4px;
}

.perk-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.btn-secondary {
  background: #f5f5f5;
  color: #666;
  border: 1px solid #e0e0e0;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: #e8e8e8;
}

/* Route badge styling */
.route-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #666;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* AI badge styling */
.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--brand);
  color: #fff;
  padding: 4px 8px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 10px;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
  white-space: nowrap;
}

/* --- Explore polish --- */
.route-badge{
  position:absolute; left:18px; top:18px; z-index:400;
  background: var(--brand); color:#fff; font-weight:700;
  padding:8px 12px; border-radius:999px; box-shadow:0 8px 24px rgba(0,0,0,.12);
  display:flex; align-items:center; gap:8px;
}
.route-badge.hidden{ display:none; }
.route-badge .bolt{ width:14px; height:14px; display:inline-block; }

.perk-card{
  margin:16px 18px 8px; padding:14px; border-radius:16px;
  background:#fff; box-shadow:0 10px 24px rgba(0,0,0,.07);
}
.perk-card.hidden{ display:none; }
.perk-card .row{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.perk-card .meta{ color:#667085; font-size:13px; margin-top:6px; }
.perk-card .brand{ display:flex; align-items:center; gap:10px; }
.perk-card .brand img{ width:36px; height:36px; border-radius:10px; object-fit:cover; }
.perk-card .ai-badge{
  display:inline-flex; align-items:center; gap:6px; margin-left:8px;
  background: var(--brand); color:#fff; padding:4px 10px; border-radius:999px; font-weight:700; font-size:12px;
}

.view-more{ padding:8px 18px 18px; }
.btn-secondary{
  width:100%; padding:12px 14px; border-radius:12px;
  background:#f3f4f6; border:1px solid #e5e7eb; color:#111827; font-weight:600;
}

/* Merchant logo marker */
.leaflet-div-icon.merchant-logo{
  background:#fff; border:2px solid var(--brand); border-radius:14px; box-shadow:0 6px 16px rgba(0,0,0,.16);
  width:44px; height:44px; display:flex; align-items:center; justify-content:center;
}
.leaflet-div-icon.merchant-logo img{ width:34px; height:34px; border-radius:8px; object-fit:cover; }

/* Ensure #map stays clipped nicely */
#map{ border-radius:20px; overflow:hidden; }

/* Map card */
.map-card{
  margin:16px; border-radius:18px; overflow:hidden;
  box-shadow:0 10px 30px rgba(0,0,0,.08);
  background:#fff;
}
#map{ width:100%; height:220px; }
.leaflet-control-attribution{
  margin-bottom: calc( env(safe-area-inset-bottom, 0px) + var(--tabbar-height) + 8px ) !important;
}
.map{width:100%;height:320px}
.route-badge{position:absolute;left:12px;top:12px;display:flex;align-items:center;gap:6px;background:rgba(0,0,0,.64);color:#fff;padding:8px 12px;border-radius:999px;font-weight:600}
.route-badge .bolt{color:#ffd54a}
.hidden{display:none!important}

/* Section title */
.section-title { margin: 20px 0 10px; color: var(--ink-700); font-weight:700; opacity:.5; }
.perk-card{display:grid;grid-template-columns:auto 1fr auto;gap:12px;align-items:center;background:var(--card);border-radius:16px;padding:12px 14px;box-shadow:0 8px 24px rgba(16,24,40,.12)}
.perk-logo{width:48px;height:48px;border-radius:12px;background:#eef3ff;display:grid;place-items:center;font-size:24px}
.ai-chip{display:inline-flex;align-items:center;gap:6px;background:var(--brand);color:white;padding:4px 8px;border-radius:999px;font-size:12px;font-weight:700;margin-bottom:6px}
.perk-meta,.perk-dist{color:var(--muted);font-size:13px;margin:2px 0}
/* ---------- Primary Buttons (incl. Claim) ---------- */
.btn, .btn-primary{
  background: var(--brand); color: var(--brand-ink-contrast);
  border: none; border-radius: 999px; padding: 12px 18px; font-weight:700;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--brand) 25%, transparent);
}
.btn:active{ transform: scale(.98) }
.btn-primary{background:var(--brand);color:var(--brand-ink-contrast);border:0;border-radius:12px;padding:10px 12px;font-weight:800}
.btn-secondary{background:#eef2f7;color:#0b1220;border:0;border-radius:12px;padding:10px 12px;font-weight:700}
.view-more{display:flex;justify-content:center;margin:16px 0 4px}

/* ---------- Tabbar (same height, bigger icons) ---------- */
.tabbar{
  position: sticky; bottom:0; z-index: 30;
  height: var(--tabbar-height); display:flex; align-items:center; justify-content:space-around;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,.85); border-top: 1px solid rgba(0,0,0,.06);
}
.tab{
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:6px; width:20%; height:100%;
}
.tab .icon{ font-size: 28px; line-height: 1; color:#a0a6b2 }       /* light grey */
.tab .label{ font-size:14px; color:#6c7280 }
.tab.active .icon, .tab.active .label{ color: var(--brand) }

/* Raised Claim button stays same size; color now brand */
.tab.claim .pill{
  height:54px; width:96px; border-radius: 28px; background:#000; /* keep black pill per your look */
  display:flex; align-items:center; justify-content:center;
}
.tab.claim .icon{ color:#fff } /* claim icon white on black pill */
.tab-primary{align-self:center;justify-self:center;background:var(--brand);color:var(--brand-ink-contrast);border-radius:22px;padding:10px 18px;font-weight:800;transform:translateY(-10px)}

/* Leaflet attribution safe area */
.leaflet-control-attribution{ margin-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); }

/* === NEW EXPLORE UI STYLES === */
:root{ 
  --brand:#3B82F6; 
  --ink:#0B1220; 
  --muted:#94A3B8; 
  --tabbar-h:88px; 
}

.map-card{ 
  padding:16px 16px 8px; 
}

.map-frame{ 
  border-radius:24px; 
  overflow:hidden; 
  box-shadow:0 8px 30px rgba(0,0,0,.08); 
}

.map{ 
  width:100%; 
  height:56vh; 
}

/* Hide Leaflet attribution & flag */
.leaflet-control-attribution, .leaflet-bottom.leaflet-right{ 
  display:none !important; 
}

.perk-card{ 
  margin:12px 16px 8px; 
  padding:14px; 
  border-radius:18px; 
  background:#fff;
  box-shadow:0 8px 30px rgba(0,0,0,.06); 
}

.perk__ai{ 
  display:inline-flex; 
  align-items:center; 
  gap:6px; 
  padding:6px 10px;
  border-radius:999px; 
  font-size:12px; 
  font-weight:700; 
  color:#fff; 
  background:var(--brand); 
}

.perk__body{ 
  display:grid; 
  grid-template-columns:auto 1fr auto; 
  gap:12px; 
  align-items:center; 
  margin-top:10px; 
}

.perk__logo{ 
  width:44px; 
  height:44px; 
  border-radius:12px; 
  display:grid; 
  place-items:center; 
  background:#EEF2FF; 
  font-size:20px; 
}

.perk__name{ 
  font-weight:800; 
  font-size:18px; 
  color:var(--ink); 
}

.perk__desc{ 
  color:#64748B; 
  font-size:14px; 
}

.perk__cta{ 
  background:var(--brand); 
  color:#fff; 
  border:0; 
  border-radius:14px; 
  padding:10px 14px; 
  font-weight:800; 
}

.viewmore-fab{ 
  position:fixed; 
  left:16px; 
  top:calc(64px + 10px); 
  z-index:40; 
  width:88px; 
  height:88px;
  border-radius:999px; 
  background:var(--brand); 
  color:#fff; 
  border:0; 
  box-shadow:0 18px 40px rgba(59,130,246,.35); 
}

/* Earn button spacing + outline tone */
.tabbar{ 
  height:var(--tabbar-h); 
}

.tabbar .pill{ 
  background:var(--brand); 
  border:2px solid #6B7DA6; 
} /* outline matches icon stroke */

.tabbar .tab:nth-child(2), .tabbar .tab:nth-child(4){ 
  margin:0 6px; 
} /* breathing room around pill */

/* --- Map card --- */
.map-card{
  margin: 0 16px 14px;
  border-radius: var(--radius-xxl);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  background: #fff;
}
.map-card #map{ width: 100%; height: 100%; }

/* --- Tab bar --- */
.tabbar{
  position: fixed; left: 0; right: 0; bottom: 0;
  height: var(--nav-height);
  display: grid; grid-template-columns: repeat(5,1fr);
  align-items: center;
  padding: 10px 18px calc(10px + env(safe-area-inset-bottom));
  backdrop-filter: blur(16px);
  background: linear-gradient(180deg, rgba(255,255,255,0.86), rgba(255,255,255,0.96));
  box-shadow: 0 -10px 25px rgba(17,24,39,0.10);
  border-top-left-radius: var(--radius-xxl);
  border-top-right-radius: var(--radius-xxl);
  z-index: 20;
}
.tabbar .tab{
  display:flex; flex-direction:column; align-items:center; gap:4px;
  color: var(--ink-weak); text-decoration:none; user-select:none;
}
.tabbar .tab .icon{
  width: 28px; height: 28px; display:grid; place-items:center;
}
.tabbar .tab .icon svg{
  width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 2.2;
}
.tabbar .tab .label{
  font-size: 14px; line-height: 16px; color: inherit;
}
.tabbar .tab.active{ color: var(--brand-blue); }

/* --- Center FAB (Earn) --- */
#fab-earn{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: var(--fab-size);
  height: var(--fab-size);
  border-radius: var(--fab-radius);
  bottom: calc(var(--fab-overlap) + env(safe-area-inset-bottom, 0px));
  z-index: 1000;                 /* above tabbar */
  box-shadow: var(--fab-shadow);
  background: var(--brand-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink-weak); /* gray outline to match nav icons */
}
#fab-earn .fab-content{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
#fab-earn .icon{ width: 24px; height: 24px; }
#fab-earn .icon svg{ width: 24px; height: 24px; stroke:#fff; fill:none; stroke-width:2.4; }
#fab-earn .label{ font-weight:600; font-size:12px; line-height:1; }

/* spacing so neighbors don't crowd the FAB */
.tabbar .tab:nth-child(3){ margin: 0 14px; }  /* center slot gutters */

/* ========= Explore layout ========= */
.explore-stack{
  display:flex;
  flex-direction:column;
  gap:16px;
  padding:16px 16px 12px;
}
.card{
  background:#fff;
  border-radius:20px;
  box-shadow:0 8px 24px rgba(16,24,40,.08);
}

/* Map card */
.map-card{ padding:12px; }
#map-card{
  overflow:hidden;
  border-radius:16px;
}
#map.leaflet-host{
  width:100%;
  height:220px;          /* map height - leave space for info bar */
  border-radius:16px;    /* rounded corners for the map */
  overflow:hidden;        /* ensure content stays within bounds */
}
.leaflet-container{
  border-radius:16px;    /* enforce rounded tiles inside */
  overflow:hidden;        /* prevent map from extending beyond container */
}

/* Perk card */
.perk-card{ padding:16px; }
.perk-chip{
  display:inline-flex; align-items:center; gap:6px;
  padding:6px 12px; border-radius:999px;
  background:#000; color:#fff; font-weight:700; font-size:12px; margin-bottom:12px;
}
.perk-chip .bolt{ font-size:14px; }
.perk-row{ display:grid; grid-template-columns:auto 1fr auto; gap:12px; align-items:center; }
.perk-logo{
  width:56px; height:56px; border-radius:14px; object-fit:cover;
  background:#f2f4f7;
}
.perk-copy h3{ margin:0 0 6px; font-size:18px; line-height:1.2; }
.perk-copy p{ margin:0; color:#6b7280; font-size:14px; }
.btn{ border:0; cursor:pointer; }
.btn-black{
  background:#000; color:#fff; font-weight:700; padding:10px 14px; border-radius:16px;
}
.btn-ghost{
  width:100%;
  background:rgba(17,24,39,0.06);
  color:#0f172a;
  font-weight:700;
  padding:14px 16px;
  border-radius:16px;
}

/* View more above nav: respects safe area + nav height; DOES NOT move Earn button */
.view-more-wrap{
  position:sticky; bottom:calc(var(--tabbar-height,72px) + env(safe-area-inset-bottom) + 8px);
  padding:0 16px 8px;
}

/* Ensure the big floating Earn stays as-is (no vertical changes) */
.fab-earn{ /* class should already exist; no position edits here */ }

/* ========= Explore Map Card Layout ========= */

/* MAP CARD: fixed height, rounded, no overlap */
.map-card{
  position: relative;
  border-radius: 18px;
  overflow: visible;
  background: #fff;
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
  margin: 16px 20px 14px;
  z-index: 0;
}
.map-card .leaflet-container{ height:100% !important; width:100%; }

/* Hide Leaflet attribution area permanently */
.leaflet-bottom.leaflet-right{ display:none !important; }

/* Section title */
.section-title{
  margin: 2px 20px 6px;
  font-weight: 700;
  font-size: 20px;
  color: #222;
}

/* PERK CARD */
.perk-card{
  position: relative;
  z-index: 1;
  margin: 0 20px 8px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(0,0,0,.07);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 56px 1fr;
  grid-template-rows: auto auto;
  gap: 12px 12px;
  align-items: center;
}
.perk-logo{
  width: 56px; height: 56px;
  border-radius: 12px;
  background:#f2f4f7;
  display:grid; place-items:center;
  grid-row: 1 / span 2;
}
.perk-headline{
  display:flex; justify-content:space-between; align-items:center;
}
.ai-chip{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 10px; border-radius:999px;
  font-weight:700; font-size:12px;
  color: var(--brand-blue, #3b6fe8);
  background: color-mix(in srgb, var(--brand-blue, #3b6fe8) 12%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--brand-blue, #3b6fe8) 28%, transparent);
}
.ai-chip svg{ width:14px; height:14px; color:currentColor; }
.perk-merchant{
  font-weight:700; font-size:18px; color:#111;
}
.perk-address{
  margin-top:2px; color:#667085; font-size:12px;
}
.perk-details{
  color:#344054; font-size:14px; margin-top:6px;
}

/* Buttons */
.btn-ghost, .btn-primary{
  display:inline-flex; align-items:center; justify-content:center;
  width:100%;
  border-radius:14px; height:48px;
  font-weight:700;
}
.btn-primary{
  background:#fff; /* matches "View more" style */
  border:1px solid #e6e7eb;
  box-shadow: 0 10px 22px rgba(0,0,0,.06);
  color:#111;
}
.btn-ghost{
  background:#f6f7fb;
  color:#0f172a;
}

/* View more placement (above tabbar) */
.view-more-wrap{
  position: relative;
  padding: 10px 20px calc(var(--tabbar-height,72px) + 10px);
}

/* ========= HEADER LOGO STYLING ========= */
.brand-logo{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px; /* minimal spacing like in image */
  font-weight: 700; /* bold weight like in image */
  letter-spacing: 0.04em;
  font-size: 28px;
  line-height: 1;
  padding-top: 8px; /* reduced top padding */
}
.brand-logo .brand-word{ 
  color: #2563EB !important; /* medium-dark blue like in image */
}
.brand-logo .brand-bolt{ 
  color: #FFD700 !important; /* bright golden yellow - cannot be overridden */
  display: inline-block;
  vertical-align: middle; /* ensure proper vertical alignment */
  line-height: 0.875; /* custom line height for bolt positioning */
}

/* ========= NAVBAR STYLING ========= */
.tabbar .tab{
  color: var(--ink-500); /* inactive tab text */
}
.tabbar .tab.active{
  color: var(--ink-900); /* active tab text */
}
.tabbar .tab .icon svg{
  stroke: currentColor; /* icons match text color */
}

/* ========= EARN FAB RESTORED ========= */
#fab-earn{
  background: #2563EB;
  color: #FFF;
  border-radius: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  border: none;
}
#fab-earn .icon{ color: #FFF; }
#fab-earn .label{ color: #FFF; font-weight: 600; }

/* ========= EXPLORE PAGE LAYOUT ========= */

/* ========= EXPLORE PAGE LAYOUT - VIEWPORT FIT ========= */

/* Ensure Explore page fits within viewport */
#page-explore{
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Map card - responsive height */
.map-card{
  background: #ffffff;
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  margin: 12px 16px 8px;
  overflow: hidden;
  flex: 0 0 auto;
}
.map-card .map-frame{
  overflow: hidden;
  border-radius: 16px;
  height: 220px;
}
.map-card #map{
  width: 100%;
  height: 100%;
  border-radius: 16px;
}

/* Section title - "Nearby perk" */
.section-title{
  margin: 4px 16px 4px;
  color: var(--ink-900);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: .2px;
  flex: 0 0 auto;
}

/* AI badge - brand blue styling */
.ai-chip{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #eef2ff;
  color: #2563EB;
  border: 1px solid #dbe1ff;
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  margin: 4px 16px 8px;
  white-space: nowrap;
  flex: 0 0 auto;
}
.ai-chip svg{
  width: 14px;
  height: 14px;
  color: #2563EB;
}

/* Perk card - responsive with viewport fit */
.perk-card{
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #ffffff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  margin: 0 16px 8px;
  flex: 0 0 auto;
}
.perk-card__body{
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  flex: 1;
}
.perk-card__text{
  min-width: 0;
}
.perk-title{
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-900);
  margin: 0 0 4px;
}
.perk-address{
  color: #64748b;
  font-size: 14px;
  margin: 0 0 4px;
}
.perk-sub{
  color: #64748b;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}
.perk-card__media{
  order: 2;
  align-self: start;
}
.perk-card__media .perk-logo{
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: contain;
  background: #FFF;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Buttons - light green primary for "Charge here" */
.btn,
.btn-wide{
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  padding: 14px 18px;
  border: 2px solid #22C55E !important; /* Light green border for edge visibility - force override */
  background: #22C55E !important; /* Light green background - force override */
  color: #FFF !important;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
  box-shadow: 0 2px 10px rgba(34, 197, 94, 0.25) !important; /* subtle green shadow for edge visibility */
}
.btn-primary{
  background: #22C55E !important; /* Light green background - force override */
  color: #FFF !important;
  border: 2px solid #22C55E !important; /* Light green border for edge visibility - force override */
}
.btn-primary:hover{
  filter: brightness(1.05);
}
.btn-primary:active{
  transform: translateY(1px);
}

/* CTA sits at bottom of card */
.perk-card .btn-primary{
  margin-top: auto;
  width: 100%;
  border-radius: 16px;
}

/* View more button - sits above nav bar */
.view-more{
  background: #f5f7fb !important; /* previous grey color - force override */
  color: #0b1020 !important; /* previous text color - force override */
  border: 1px solid rgba(2,16,43,.06) !important; /* previous border - force override */
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  flex: 0 0 auto;
}

/* Next charger: outline variant with light red */
.btn-primary-outline{
  border: 2px solid #EF4444 !important; /* Light red border - force override */
  background: #fff !important;
  color: #EF4444 !important; /* Light red text - force override */
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15) !important; /* subtle red shadow for edge visibility */
}
.btn-primary-outline:active{ transform: translateY(1px); }
#next-charger-btn .btn__icon{ margin-right: 8px; }

/* Keep action cards above tabbar with safe-area */
.action-card{ 
  margin: 12px 16px; 
  padding: 0; /* remove any default padding */
}
.action-card .btn{
  width: 100%; /* ensure button takes full width of container */
  margin: 0; /* remove any button margins */
}
@supports (padding: max(0px)){
  .action-card:last-of-type{ margin-bottom: max(16px, env(safe-area-inset-bottom)); }
}

/* Map info bar */
.map-info-bar{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px 12px;
  background: #f8f9fa;
  min-height: 40px;
  border-radius: 0 0 16px 16px;
  margin: 0 -12px -12px -12px;
}
.map-info-left{
  display: flex;
  align-items: center;
}
.tesla-logo{
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.map-info-right{
  display: flex;
  align-items: center;
}
.driving-time{
  font-size: 14px;
  font-weight: 600;
  color: #2563EB;
  background: #eef2ff;
  padding: 4px 8px;
  border-radius: 8px;
}

/* Legacy support for existing classes */
.section { padding: 8px 20px 12px; }

.h2 {
  font-size: 22px; font-weight: 700; letter-spacing: .2px;
  color: #121212; margin: 6px 0 10px;
}

#perk-badge-row { margin: 4px 0 12px; }
.perk-badge {
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 12px; border-radius:999px;
  color: var(--brand, #3B6FE8); background: color-mix(in srgb, var(--brand, #3B6FE8) 12%, white);
  border: 1px solid color-mix(in srgb, var(--brand, #3B6FE8) 30%, white);
  font-weight:600; font-size:14px;
}
.perk-badge .bolt { font-size:14px; line-height:0; }

.btn-wide {
  width:100%; margin-top:12px;
  height:52px; border-radius:14px; font-weight:700; font-size:16px;
  /* background and border overridden by specific button classes */
  box-shadow:0 8px 18px rgba(16,24,40,.07);
}
.btn-ghost {
  background: #f5f7fb; color:#0b1020; border:1px solid rgba(2,16,43,.06);
}
#view-more { margin-top:0; }

/* Map card spacing above perk section */
#mapCard { margin: 14px 20px 10px; }

/* ====== Activity v2 ====== */
.card{ background:#fff; border-radius:16px; box-shadow:0 10px 30px rgba(0,0,0,.06); margin:12px; }
.card--pad{ padding:14px 16px; }
.row{ display:flex; gap:12px; }
.space-between{ justify-content:space-between; }
.center{ align-items:center; }
.col{ display:flex; flex-direction:column; }

.eyebrow{ font-size:12px; color:#6b7280; text-transform:uppercase; letter-spacing:.08em; }
.title{ font-weight:600; }
.sub{ font-size:12px; color:#6b7280; }
.amount{ margin-left:auto; font-weight:700; }

.list{ list-style:none; padding:0; margin:8px 0 0; }
.list-item{ display:flex; align-items:center; gap:12px; padding:10px 0; border-top:1px solid #f0f2f5; }
.list-item:first-child{ border-top:none; }
.avatar{ width:36px; height:36px; border-radius:50%; background:#eef2ff; display:flex; align-items:center; justify-content:center; font-weight:700; color:#3b82f6; }

/* Reputation block */
.rep-card--centered{ display:flex; flex-direction:column; align-items:center; text-align:center; }
.rep-head{ font-size:20px; font-weight:800; color:#1e3a8a; margin-bottom:10px; }
.rep-stack{ display:flex; flex-direction:column; align-items:center; gap:6px; }

.rep-icon--vertical{ width:64px; height:120px; position:relative; color:#1e3a8a; }
.rep-icon--vertical svg{ width:100%; height:100%; }
.rep-icon--vertical::after{
  content:'';
  position:absolute; bottom:12px; left:50%; transform:translateX(-50%);
  width:28px; height:48px; border-radius:6px;
  background:linear-gradient(to top,#22c55e 60%,#f0fdf4 100%);
  animation:batteryPulse 2.8s ease-in-out infinite; opacity:.9;
}
@keyframes batteryPulse{
  0%{ height:24px; background:linear-gradient(to top,#22c55e 40%,#f0fdf4 100%); }
  50%{ height:48px; background:linear-gradient(to top,#16a34a 60%,#dcfce7 100%); }
  100%{ height:24px; background:linear-gradient(to top,#22c55e 40%,#f0fdf4 100%); }
}

.rep-tier{ font-weight:700; font-size:16px; color:#475569; }
.rep-score{ font-weight:800; font-size:32px; color:#1e3a8a; }
.rep-sub{ font-size:13px; color:#6b7280; margin-top:4px; }

/* Streak chip */
.chip{ padding:6px 10px; border-radius:999px; background:#f1f5f9; color:#334155; font-size:12px; font-weight:600; }
.chip--streak{ background:#ecfdf5; color:#0f766e; }

/* Progress */
.rep-progress{ width:220px; display:flex; flex-direction:column; align-items:center; gap:6px; margin-top:2px; }
.rep-progress__bar{ width:100%; height:8px; border-radius:999px; background:#e5e7eb; overflow:hidden; }
.rep-progress__fill{ height:100%; width:0%; background:#3b82f6; transition:width .6s ease; }
.rep-progress__label{ font-size:12px; color:#6b7280; }

/* Tier badges */
.badge{ padding:6px 10px; border-radius:999px; font-size:12px; font-weight:700; line-height:1; }
.badge--tier{ background:#f1f5f9; color:#475569; }
.badge--bronze{ background:#FFF7ED; color:#B45309; }
.badge--silver{ background:#F1F5F9; color:#475569; }
.badge--gold{ background:#FEF3C7; color:#B45309; }
.badge--platinum{ background:#ECFEFF; color:#0E7490; }

/* ====== Activity v3 Readability & Scrolling ====== */
/* Readability tweaks */
.dark{ color:#111827; }         /* near-black */
.dark-90{ color:#1f2937; }      /* slate-800 */
.dark-70{ color:#374151; }      /* slate-700 */
.eyebrow{ color:#374151; }      /* darker than before */
.title{ color:#111827; }

/* Tighter row and scrolling list */
.list-item--tight{ padding:8px 0; }
.list--people{ max-height: 320px; overflow-y:auto; -webkit-overflow-scrolling: touch; }

/* Make list scrollbars subtle (optional) */
.list--people::-webkit-scrollbar{ width:6px; }
.list--people::-webkit-scrollbar-thumb{ background:#e5e7eb; border-radius:999px; }

/* ====== Reputation counts + Saved intents ====== */
.rep-meta{ display:flex; gap:8px; justify-content:center; margin-top:8px; }
.rep-pill{ background:#f4f6ff; border:1px solid #e2e8ff; color:#334155; padding:6px 10px; border-radius:999px; font-size:12px; }

.list--intents{ list-style:none; margin:8px 0 0; padding:0; }
.intent{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 0; border-top:1px solid #f1f5f9; }
.intent:first-child{ border-top:none; }
.intent .title{ font-weight:600; color:#0f172a; }
.intent .sub{ font-size:12px; color:#64748b; margin-top:2px; }
.intent__cta{ display:flex; gap:8px; }
.btn{ padding:8px 12px; border-radius:10px; border:1px solid #e2e8f0; background:#fff; }
.btn-blue{ background:#3b5bfd; border-color:#3b5bfd; color:#fff; }

/* ========== Wallet & Me ========== */
.page { padding: 12px 12px 96px; }                 /* bottom room for tabbar */
.stack { display: grid; gap: 12px; }

/* Base text */
body { color: #111827; }

/* Kill any global opacity used before */
.muted, .soft, .dim, .is-dimmed { opacity: 1 !important; color: #4b5563 !important; }

/* Headings / labels */
.h1, .page-title { color: #111827; }
.section-title, .eyebrow { color: #374151; }

/* Compact global typography */
body {
  font-size: 14px;
  line-height: 1.4;
  color: #111827;
  overflow-y: auto;
}

/* Card layout refinements */
.card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(17,24,39,.06);
  padding: 16px;
  border: 1px solid rgba(17,24,39,.04);
  margin: 10px;
}

.card--pad { padding: 14px 16px; }
.card--xl { padding: 16px 18px; }

/* Compact headers */
.card h1, .card h2, .card h3, .card h4 {
  margin: 4px 0;
  font-weight: 600;
}

.card-title { font-weight: 600; font-size: 15px; color: #0f172a; letter-spacing:.1px; }
.kicker { color:#334155; font-size:12px; text-transform:uppercase; letter-spacing:.08em; }

.row { display:flex; align-items:center; gap:12px; }
.row-between { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.col { display:grid; gap:4px; }

/* Wallet page specific */
.wallet-balance {
  font-size: 26px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.1;
}

.wallet-streak {
  font-size: 13px;
  color: #475569;
}

.wallet-section h3 {
  font-size: 15px;
  margin-bottom: 4px;
  font-weight: 600;
}

.amount-lg { font-size: 26px; font-weight: 700; color:#1e293b; line-height:1.1; }
.subtle { color:#334155; }

/* Subtle gray text for secondary content */
.subtext {
  color: #64748b;
  font-size: 13px;
}

.btn {
  display:inline-flex; align-items:center; justify-content:center;
  height:40px; padding:10px 18px; border-radius:10px; font-weight:600;
  border:1px solid transparent; cursor:pointer; user-select:none;
  font-size: 14px;
}
.btn-primary { background:#22c55e; color:#fff; }
.btn-success { background:#30b566; color:#fff; }
.btn-secondary { background:#f1f5f9; color:#0f172a; }
.btn-ghost   { background:#f8fafc; color:#0f172a; border-color:#e2e8f0; }
.btn-block { width:100%; }

.pill {
  display:inline-flex; align-items:center; gap:8px; height:28px;
  padding:0 10px; border-radius:999px; font-weight:700; font-size:12px;
  background:#eef2ff; color:#3b5bfd;
  border:1px solid #e5e7eb;
}

.list { list-style:none; margin:0; padding:0; }
.li {
  display:flex; align-items:center; gap:12px;
  padding:14px 0; border-top:1px solid #f1f5f9;
}
.li:first-child { border-top:none; }
.li .avatar {
  width:36px; height:36px; border-radius:8px; background:#eef2ff;
  display:flex; align-items:center; justify-content:center;
  color:#3b5bfd; font-weight:800;
}

/* List items for compact layout */
.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid #f1f5f9;
  font-size: 13px;
}

.list-item:first-child { border-top: none; }

.badge {
  padding:3px 8px; border-radius:8px; font-weight:600; font-size:12px;
  background:#e2e8f0; color:#0f172a;
}
.badge.good { background:#dcfce7; color:#166534; }
.badge.warn { background:#fff7ed; color:#9a3412; }

/* Me page specific */
.profile-summary {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-summary img, .profile-summary .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.profile-summary .info {
  flex: 1;
}

/* Toggle switches */
.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
}

.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.hr { height:1px; background:#f1f5f9; margin:8px 0; }

/* Scroll container for smaller viewports */
.page-scroll {
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-bottom: 24px;
}

/* Subtle rows inside cards */
.row--subtle { color: #4b5563; }

/* Pills / chips */
.pill { color: #374151; background: #f7f9fc; }

/* Amounts / numbers */
.amount, .stat { color: #111827; font-weight: 700; }

/* Lists separators */
.list .list-item { border-color: rgba(17,24,39,.08); }

/* Buttons keep strong text */
.btn, .btn-primary, .btn-ghost { color: #ffffff; }
.btn-ghost { color: #374151; }

/* Ensure readable caption text */
.caption { color: #4b5563; }

/* Prevent header or cards from using translucent backgrounds */
.header, .wallet-hero, .profile-card { background: #ffffff; }

/* Layout safety near tab bar */
.page {
  padding-bottom: calc(92px + 24px);
}

/* Tighten vertical rhythm on Wallet/Me */
.card + .card { margin-top: 14px; }
.section { margin: 16px 0; }

/* Wallet specific rows */
.wallet-earn-row .label { color: #374151; }
.wallet-earn-row .value { color: #111827; font-weight: 600; }

/* Me switches/labels */
.me-toggle .label { color: #374151; }
.me-section-title { color: #111827; font-weight: 700; }

/* Remove any blur filters from legacy glass styles */
.glass, .frost { backdrop-filter: none !important; background: #ffffff !important; }

/* Responsive adjustments */
@media (max-height: 750px) {
  .wallet-balance { font-size: 22px; }
  .btn { padding: 8px 16px; font-size: 13px; height: 36px; }
  .card { padding: 10px 14px; margin: 8px; }
  .page-scroll { max-height: calc(100vh - 100px); }
}
