html, body { overflow: hidden; }
#map { position: fixed; inset: 0; }
#top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--safe-t) + 14px) 16px 28px;
  background: linear-gradient(var(--bg) 0%, color-mix(in srgb, var(--bg) 70%, transparent) 55%, transparent);
  pointer-events: none;
}
#top > * { pointer-events: auto; }
#top .wordmark { height: 15px; opacity: 0.95; }
#me { width: 44px; height: 44px; font-size: 14px; background-size: cover; background-position: center; box-shadow: 0 0 0 2px var(--bg); }
#me.photo { color: transparent; }

#sheet {
  position: fixed; left: 8px; right: 8px; bottom: calc(var(--safe-b) + 8px); z-index: 20;
  max-width: 520px; margin: 0 auto; padding: 20px; display: flex; flex-direction: column; gap: 14px;
  max-height: 78vh; overflow-y: auto; transition: transform 0.55s var(--ease);
}
#sheet.swap { animation: sheet-in 0.55s var(--ease); }
@keyframes sheet-in { from { transform: translateY(26px); opacity: 0; } }
#sheet h1 { font-size: 24px; }
#sheet .lead { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.big { font-size: 44px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.big small { font-size: 18px; font-weight: 600; color: var(--text-2); margin-left: 4px; letter-spacing: 0; }

#recenter { position: fixed; right: 14px; z-index: 15; bottom: 300px; transition: bottom 0.4s var(--ease); }
#banner {
  position: fixed; left: 12px; right: 12px; top: calc(var(--safe-t) + 64px); z-index: 12; max-width: 496px; margin: 0 auto;
  padding: 12px 16px; border-radius: 20px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 12px;
}
#banner .btn { margin-left: auto; }

/* where-to field and results */
.search { position: relative; }
.search .input { padding-left: 52px; }
.search svg { position: absolute; left: 18px; top: 17px; width: 22px; height: 22px; color: var(--text-3); pointer-events: none; }
.results { display: flex; flex-direction: column; gap: 6px; }
.result { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-row); text-align: left; width: 100%; transition: background 0.2s; }
.result:active { background: var(--hover); }
.result .ico { width: 38px; height: 38px; border-radius: 50%; background: var(--raised); display: grid; place-items: center; flex: none; color: var(--text-2); }
.result .ico svg { width: 18px; height: 18px; }

/* trip summary: two stops joined by a line */
.stops { display: grid; grid-template-columns: 20px 1fr auto; column-gap: 12px; row-gap: 0; align-items: center; }
.stops .mark { width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--text-2); justify-self: center; }
.stops .mark.to { border-color: var(--violet-light); background: var(--violet-light); border-radius: 3px; }
.stops .rail { width: 2px; height: 18px; background: var(--grey-600); justify-self: center; }
.stops .name { font-weight: 700; padding: 6px 0; }
.stops .label { font-size: 12px; color: var(--text-3); font-weight: 600; }

#centerpin {
  position: fixed; left: 50%; top: 50%; width: 34px; height: 44px; margin: -44px 0 0 -17px; z-index: 9; pointer-events: none;
  transition: transform 0.25s var(--ease);
}
#centerpin.moving { transform: translateY(-10px); }
#centerpin svg { filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.5)); }

/* find-my-cart arrow */
.finder { display: flex; align-items: center; gap: 18px; }
.compass { width: 92px; height: 92px; border-radius: 50%; background: var(--raised); display: grid; place-items: center; flex: none; position: relative; }
.compass svg { width: 44px; height: 44px; color: var(--violet-light); transition: transform 0.25s linear; }
.compass.close svg { color: var(--green); }

/* start-ride button: same press-and-fill as the cart's */
.startbtn { position: relative; overflow: hidden; min-height: 64px; font-size: 19px; }
.startbtn::before { content: ""; position: absolute; inset: 0; background: rgba(255, 255, 255, 0.22); transform: scaleX(var(--k, 0)); transform-origin: left; }
.startbtn span { position: relative; }

.progress { height: 6px; border-radius: 3px; background: var(--grey-600); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--violet-light); border-radius: 3px; transition: width 1s linear; }

.stars { display: flex; gap: 8px; justify-content: center; }
.stars button { font-size: 38px; line-height: 1; color: var(--grey-600); transition: transform 0.2s var(--ease), color 0.2s; }
.stars button.on { color: #ffd166; }
.stars button:active { transform: scale(0.85); }

/* account page */
#account {
  position: fixed; inset: 0; z-index: 40; background: var(--bg); overflow-y: auto;
  padding: calc(var(--safe-t) + 16px) 16px calc(var(--safe-b) + 24px); animation: rise 0.4s var(--ease);
}
#account .inner { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.switch { width: 52px; height: 32px; border-radius: 16px; background: var(--grey-600); position: relative; transition: background 0.25s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform 0.3s var(--ease); }
.switch.on { background: var(--violet); }
.switch.on::after { transform: translateX(20px); }

.mapboxgl-ctrl-top-left { top: calc(var(--safe-t) + 58px); }

/* The panel tucks down while the map is being moved, leaving its handle and title showing. */
#sheet { padding-top: 26px; }
#sheet::before { content: ""; position: absolute; top: 9px; left: 50%; width: 44px; height: 5px; margin-left: -22px; border-radius: 3px; background: var(--border-strong); }
#sheet.peek { transform: translateY(calc(100% - 64px)); overflow: hidden; }
#sheet.swap.peek { animation: none; }
@media (max-height: 640px) {
  #sheet { max-height: 70vh; gap: 10px; padding: 24px 16px 16px; }
  #sheet h1 { font-size: 20px; }
  .big { font-size: 36px; }
}

.stoprow { display: block; text-align: left; min-width: 0; width: 100%; }
button.stoprow:active { opacity: 0.6; }
.marker-curb { width: 44px; height: 44px; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.55)); }
.marker-curb svg { width: 44px; height: 44px; display: block; }

/* The two round map buttons ride above the panel; they hide rather than climb into the header. */
#satbtn, #recenter { width: 44px; height: 44px; }
#satbtn svg, #recenter svg { width: 20px; height: 20px; }
#satbtn { position: fixed; top: auto; right: 14px; bottom: 360px; z-index: 15; transition: bottom 0.4s var(--ease), opacity 0.25s; }
#recenter { transition: bottom 0.4s var(--ease), opacity 0.25s; }
.fab-hidden { opacity: 0; pointer-events: none; }

/* --- favourites, above the recents in Where to --- */
.favs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; padding: 2px 4px; }
.favs::-webkit-scrollbar { display: none; }
.fav { display: flex; align-items: center; gap: 8px; padding: 10px 14px 10px 10px; border-radius: 999px; background: var(--raised);
  font-weight: 700; font-size: 14px; white-space: nowrap; flex: none; }
.fav .ico { width: 28px; height: 28px; border-radius: 50%; background: var(--violet); color: #fff; display: grid; place-items: center; }
.fav .ico svg { width: 15px; height: 15px; }
.fav.add { background: transparent; border: 1px dashed var(--border-strong); color: var(--text-2); padding-left: 14px; }
.fav:active { transform: scale(0.96); }

/* --- account and settings --- */
#account .inner { padding-bottom: 12px; }
.acct-head { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0 4px; text-align: center; }
.acct-photo { width: 104px; height: 104px; border-radius: 50%; background: var(--violet); color: #fff; display: grid; place-items: center;
  font-size: 34px; font-weight: 700; background-size: cover; background-position: center; position: relative; }
.acct-photo .cam { position: absolute; right: -2px; bottom: -2px; width: 36px; height: 36px; border-radius: 50%; background: var(--surface);
  border: 3px solid var(--bg); display: grid; place-items: center; color: var(--text); }
.acct-photo .cam svg { width: 17px; height: 17px; }
.acct-name { font-size: 24px; font-weight: 700; }
.acct-mail { color: var(--text-3); font-size: 14px; }
.menu { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; overflow: hidden; }
.menu-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 15px 16px; text-align: left; border-top: 1px solid var(--border); }
.menu-row:first-child { border-top: 0; }
.menu-row:active { background: var(--hover); }
.menu-row .mi { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; color: #fff; }
.menu-row .mi svg { width: 20px; height: 20px; }
.menu-row .chev { color: var(--text-3); display: grid; }
.menu-row .chev svg { width: 18px; height: 18px; }
.menu-row .val { color: var(--text-3); font-size: 14px; font-weight: 600; }
.subpage { display: flex; flex-direction: column; gap: 16px; animation: slide-in 0.35s var(--ease); }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } }
.set-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-top: 1px solid var(--border); }
.set-row:first-child { border-top: 0; }
.set-row .grow > div:first-child { font-weight: 700; }
.seg { display: flex; background: var(--raised); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { flex: 1; padding: 9px 6px; border-radius: 10px; font-weight: 700; font-size: 14px; color: var(--text-2); }
.seg button.on { background: var(--violet); color: #fff; }
.field-label { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); margin: 0 4px -8px; }
.initials-in { text-transform: uppercase; letter-spacing: 0.2em; font-weight: 700; }

/* ride history */
.trip { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; overflow: hidden; }
.trip img, .trip .nomap { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; background: var(--raised); }
.trip .nomap { display: grid; place-items: center; color: var(--text-3); font-size: 13px; font-weight: 600; }
.trip .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.trip .stars-sm { color: #ffd166; letter-spacing: 2px; font-size: 14px; }
.trip .stats { display: flex; gap: 14px; color: var(--text-3); font-size: 13px; font-weight: 600; flex-wrap: wrap; }
.empty { text-align: center; color: var(--text-3); padding: 28px 12px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty svg { width: 34px; height: 34px; }
.icon-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.icon-pick button { width: 46px; height: 46px; border-radius: 50%; background: var(--raised); display: grid; place-items: center; color: var(--text-2); }
.icon-pick button.on { background: var(--violet); color: #fff; }
.icon-pick svg { width: 20px; height: 20px; }

/* --- a support call, minimised to a bar at the top --- */
.callbar-mini { position: fixed; left: 12px; right: 12px; top: calc(var(--safe-t) + 10px); z-index: 70; max-width: 496px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 14px; border-radius: 999px; background: var(--green); color: #04140a;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); animation: rise 0.35s var(--ease); font-weight: 700; }
.callbar-mini.ringing { background: var(--violet); color: #fff; }
.callbar-mini .grow { min-width: 0; }
.callbar-mini small { display: block; font-weight: 600; opacity: 0.8; }
.callbar-mini .iconbtn { width: 40px; height: 40px; background: rgba(0, 0, 0, 0.18); color: inherit; }
.callbar-mini .iconbtn.end { background: var(--red); color: #fff; }
.callbar-mini .iconbtn svg { width: 18px; height: 18px; }
.callsheet .minimise { position: absolute; top: calc(var(--safe-t) + 14px); left: 14px; width: 44px; height: 44px; background: var(--raised); }

.walkline { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 600; }
.walkline svg { width: 16px; height: 16px; color: var(--text); }
.offline { position: fixed; left: 50%; transform: translateX(-50%); top: calc(var(--safe-t) + 10px); z-index: 85; padding: 10px 16px; border-radius: 999px;
  background: var(--amber); color: #1a1200; font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.offline.ok { background: var(--green); color: #04140a; }
.aspects { display: flex; flex-direction: column; gap: 6px; }
.aspect { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; background: var(--raised); border-radius: 14px; font-weight: 600; }
.thumb { width: 44px; height: 40px; border-radius: 12px; font-size: 18px; filter: grayscale(1); opacity: 0.55; transition: transform .2s var(--ease); }
.thumb.on { background: var(--violet-soft); filter: none; opacity: 1; transform: scale(1.08); }

/* first-launch welcome and the install nudge */
.onboard { position: fixed; inset: 0; z-index: 88; display: grid; place-items: end center; padding: 16px; padding-bottom: calc(var(--safe-b) + 16px);
  background: color-mix(in srgb, var(--bg) 70%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); animation: fade .3s; transition: opacity .3s; }
.onboard.out { opacity: 0; }
.ob-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: 30px; padding: 28px 24px 22px;
  display: flex; flex-direction: column; gap: 12px; text-align: center; align-items: center; position: relative; animation: rise .45s var(--ease); }
.ob-skip { position: absolute; top: 12px; right: 12px; }
.ob-art { width: 96px; height: 96px; border-radius: 30px; display: grid; place-items: center; color: #fff; margin: 10px 0 6px;
  background: linear-gradient(135deg, var(--violet-light), var(--violet)); box-shadow: 0 16px 40px rgba(70,53,224,.35); }
.ob-art svg { width: 46px; height: 46px; }
.ob-card h1 { font-size: 24px; }
.ob-dots { display: flex; gap: 6px; margin: 6px 0 4px; }
.ob-dots span { width: 7px; height: 7px; border-radius: 4px; background: var(--grey-600); transition: width .3s var(--ease), background .3s; }
.ob-dots span.on { width: 22px; background: var(--violet); }
.install { position: fixed; left: 12px; right: 12px; top: calc(var(--safe-t) + 66px); z-index: 30; max-width: 496px; margin: 0 auto; border-radius: 22px;
  padding: 12px 10px 12px 12px; display: flex; align-items: center; gap: 12px; animation: rise .4s var(--ease); }
.install .mi { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff; flex: none; }
.install .mi svg { width: 20px; height: 20px; }
/* Never squash the panel's contents to fit a short screen (it hid the favourites row): scroll. */
#sheet > * { flex-shrink: 0; }
