/* ============ RESET / BASE ============ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #000;
  color: #111;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#phone {
  position: relative;
  width: 100%;
  max-width: 440px;
  height: 100dvh;
  margin: 0 auto;
  background: #fff;
  overflow: hidden;
}
/* desktop: phone-like frame */
@media (min-width: 460px) {
  body { display: flex; align-items: center; justify-content: center; }
  #phone { height: 92dvh; max-height: 940px; border-radius: 44px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
  .screen, #map { border-radius: 44px; }
}

/* ============ SCREENS ============ */
.screen { position: absolute; top: 0; left: 0; right: 0; bottom: 88px; display: none; overflow: hidden; }
.screen.is-active { display: block; }

/* ============ MAP SCREEN ============ */
#map { position: absolute; inset: 0; background: #e8e9ec; z-index: 1; }
.leaflet-container { font-family: inherit; background: #e7eaf0; }
.leaflet-control-attribution { font-size: 9px; opacity: .55; }

.map-top { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 8px); left: 0; right: 0; z-index: 900; padding: 6px 14px 0; }
.map-search-row { display: flex; gap: 10px; align-items: center; }
.searchbar {
  flex: 1; height: 52px; background: #fff; border-radius: 16px;
  display: flex; align-items: center; gap: 12px; padding: 0 18px;
  box-shadow: 0 6px 18px rgba(0,0,0,.16);
}
.ic-search { color: #8a8a8e; flex: none; }
.searchbar-ph { color: #9a9a9f; font-size: 17px; }
.map-filter-btn {
  width: 52px; height: 52px; background: #fff; border: none; border-radius: 16px;
  display: flex; align-items: center; justify-content: center; color: #2a2a2a;
  box-shadow: 0 6px 18px rgba(0,0,0,.16);
}

.chips { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 40px; background: #fff; border-radius: 20px;
  display: flex; align-items: center; gap: 7px; padding: 0 16px;
  font-size: 15px; font-weight: 600; color: #1c1c1e; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.badge { font-size: 11px; font-weight: 800; padding: 2px 5px; border-radius: 5px; line-height: 1; letter-spacing: .2px; }
.badge-hpc { background: #f4a51f; color: #1c1c1e; }
.badge-dc { background: #1f5bff; color: #fff; }
.badge-ac { background: #b6ec1f; color: #1c1c1e; }

/* charging pins (Leaflet divIcon) */
.pin { position: relative; width: 56px; height: 70px; filter: drop-shadow(0 5px 5px rgba(0,0,0,.35)); }
.pin-body {
  position: absolute; bottom: 2px; left: 50%;
  width: 48px; height: 48px; background: #1b1b1d; border-radius: 50% 50% 50% 0;
  transform: translateX(-50%) rotate(-45deg); transform-origin: center;
}
.pin-bolt { position: absolute; left: 50%; top: 24px; transform: translateX(-50%); z-index: 2; }
.pin-badge {
  position: absolute; top: -2px; left: 50%; transform: translateX(-50%); z-index: 3;
  font-size: 10px; font-weight: 800; padding: 2px 5px; border-radius: 5px; line-height: 1;
  box-shadow: 0 2px 4px rgba(0,0,0,.3);
}
.userdot { width: 26px; height: 26px; }
.userdot-core { width: 20px; height: 20px; border-radius: 50%; background: #1f6bff; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(31,107,255,.18), 0 2px 6px rgba(0,0,0,.3); margin: 3px; }

/* FABs */
.fab {
  background: #fff; border: none; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  color: #2a2a2a; box-shadow: 0 6px 16px rgba(0,0,0,.2); z-index: 800;
}
.fab-list { position: absolute; left: 18px; bottom: 20px; width: 58px; height: 50px; }
.fab-right { position: absolute; right: 18px; bottom: 20px; display: flex; flex-direction: column; gap: 14px; z-index: 800; }
.fab-route, .fab-nav { width: 58px; height: 50px; }
.scan-btn {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 8px;
  width: 78px; height: 78px; border-radius: 50%; border: 4px solid #fff;
  background: radial-gradient(circle at 50% 35%, #2b3550, #0a0d18 75%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 24px rgba(0,0,0,.4); z-index: 850;
}

/* ============ DISCOVER SCREEN ============ */
.screen-discover { background: #fff; display: none; flex-direction: column; }
.screen-discover.is-active { display: flex; }
.disc-search-wrap { position: relative; z-index: 5; background: #000; padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px 14px; flex: none; }
.searchbar-disc { height: 50px; box-shadow: none; border-radius: 26px; }
.searchbar-disc .searchbar-ph { color: #b8b8bd; }

.disc-scroll { flex: 1; overflow-y: auto; background: #fff; -webkit-overflow-scrolling: touch; padding-bottom: 16px; }
.disc-scroll::-webkit-scrollbar { display: none; }

.disc-card { background: #fff; border-radius: 22px 22px 0 0; padding: 14px 16px 6px; }

/* carousel */
.carousel { display: flex; gap: 12px; }
.slide { flex: none; border-radius: 18px; overflow: hidden; position: relative; }
.slide-1 {
  width: 100%; height: 200px;
  background: linear-gradient(120deg, #0a0f1c 0%, #122033 45%, #1c3350 100%);
}
.slide-peek { width: 26px; height: 200px; border-radius: 18px; background: linear-gradient(120deg,#1a4cff,#3f7bff); margin-right: -16px; }
.slide1-glow { position: absolute; right: -30px; top: -20px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(70,140,255,.55), transparent 65%); }
.slide1-heart { position: absolute; right: 40px; top: 58px; filter: drop-shadow(0 0 8px rgba(95,208,255,.9)); }
.slide1-figure {
  position: absolute; right: 0; top: 0; bottom: 0; width: 62%;
  background:
    radial-gradient(60px 90px at 70% 38%, rgba(225,190,150,.55), transparent 70%),
    radial-gradient(120px 150px at 78% 75%, rgba(120,80,50,.5), transparent 70%);
  mix-blend-mode: screen; opacity: .8;
}
.slide1-text {
  position: absolute; left: 22px; top: 26px; z-index: 4;
  color: #fff; font-size: 26px; font-weight: 800; line-height: 1.14; letter-spacing: -.3px;
  text-shadow: 0 2px 10px rgba(0,0,0,.5);
}
.heart-emoji { font-size: 22px; }
.slide1-chip {
  position: absolute; left: 22px; bottom: 20px; z-index: 4;
  width: 50px; height: 50px; border-radius: 15px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
}

/* app grid */
.grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 6px;
  padding: 22px 14px 6px;
}
.grid-item { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.tile {
  width: 66px; height: 66px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
}
.tile-dark { background: #232325; }
.tile-light { background: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.12); border: 1px solid #f0f0f2; }
.tile-label { font-size: 12.5px; color: #1c1c1e; font-weight: 500; text-align: center; max-width: 84px; }

/* category section */
.disc-section { background: #eef0f4; margin-top: 14px; padding: 18px 16px 28px; border-radius: 22px 22px 0 0; min-height: 320px; }
.cats { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cat {
  flex: none; height: 46px; padding: 0 22px; border-radius: 23px;
  display: flex; align-items: center; font-size: 16px; font-weight: 600;
  background: #fff; color: #8a8a90; border: 1px solid #e3e4e8;
}
.cat-active { background: #1c1c20; color: #fff; border-color: #1c1c20; }

.banner2 {
  position: relative; margin-top: 18px; height: 230px; border-radius: 18px; overflow: hidden;
  background: linear-gradient(135deg, #0b1418 0%, #0e1d22 55%, #14272b 100%);
}
.banner2-glow { position: absolute; left: -40px; bottom: -50px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(255,150,40,.45), transparent 65%); }
.banner2-text {
  position: absolute; left: 24px; top: 26px; color: #fff;
  font-size: 34px; font-weight: 800; line-height: 1.05; letter-spacing: -.5px;
}
.banner2-car {
  position: absolute; right: -10px; bottom: 16px; width: 150px; height: 90px;
  background:
    radial-gradient(40px 18px at 30% 80%, rgba(255,150,40,.6), transparent 70%),
    linear-gradient(180deg, rgba(255,255,255,.06), transparent);
  border-radius: 40px 40px 20px 20px;
}

/* ============ TAB BAR ============ */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1100;
  height: 88px; background: #fff; border-top: 1px solid #ececec;
  display: flex; align-items: flex-start; justify-content: space-around;
  padding-top: 9px;
}
.tab {
  background: none; border: none; flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  color: #b3b3ba; font-family: inherit;
}
.tab-lbl { font-size: 11.5px; font-weight: 500; }
.tab-ic-fill { display: none; }
.tab-clickable { cursor: pointer; }
.tab-disabled { cursor: default; }

/* active states driven by #phone[data-active] */
#phone[data-active="map"] .tab[data-tab="map"] { color: #141414; }
#phone[data-active="map"] .tab[data-tab="map"] .tab-lbl { font-weight: 700; }
#phone[data-active="discover"] .tab[data-tab="discover"] { color: #141414; }
#phone[data-active="discover"] .tab[data-tab="discover"] .tab-lbl { font-weight: 700; }
#phone[data-active="discover"] .tab[data-tab="discover"] .tab-ic-line { display: none; }
#phone[data-active="discover"] .tab[data-tab="discover"] .tab-ic-fill { display: block; }
