/* Hajde driver app — dark, high-contrast UI for night driving.
   Uses tokens.css / base.css components; everything here is app-specific layout. */

.drv {
  --tab-h: calc(62px + var(--safe-bottom));
  --sheet-bottom: var(--tab-h);
  --glass: rgba(22, 25, 31, .9);
  --glass-border: rgba(255, 255, 255, .08);
  --pickup: #3D8BFF;
  --trip: #F0353D;
  --taxi: var(--hajde-yellow);
  --vitrina: var(--vitrina-violet);
  position: relative;
  background: var(--bg);
  font-feature-settings: 'tnum' 1;
}
.drv.is-focus { --sheet-bottom: 0px; }
.drv .star { color: var(--taxi); }
.drv .num { font-variant-numeric: tabular-nums; }

.view { position: absolute; inset: 0; }
.view[hidden] { display: none; }

/* ── Map ───────────────────────────────────────────────────────────── */
/* map.js injects `.hm-map{position:relative}` after this file loads, so out-specify it */
.view > .drv-map.hm-map, .view > .drv-map { position: absolute; inset: 0; z-index: 0; background: #0E1116; }
.drv-map .hm-car-wrap:not(.is-hl) { opacity: .62; }
.drv-map .hm-car-wrap:not(.is-hl) .hm-car { width: 17px; height: 29px; }
.drv-map .hm-car-wrap:not(.is-hl) .hm-car svg { width: 17px; height: 29px; }
.drv-map .hm-car-wrap.is-hl .hm-car-halo { opacity: .7; }
#view-drive .drv-map .leaflet-bottom { bottom: calc(var(--sheet-h, 260px) + var(--sheet-bottom) + 2px); transition: bottom var(--dur-slow) var(--ease-out); }
#view-drive .drv-map .hm-badge { bottom: calc(var(--sheet-h, 260px) + var(--sheet-bottom) + 12px); left: 14px; transition: bottom var(--dur-slow) var(--ease-out); }
#view-drive .drv-map .leaflet-control-attribution { border-radius: 8px 0 0 8px; }
.drv .hm-pin-label { font-size: 11.5px; }

.map-shade { position: absolute; left: 0; right: 0; z-index: 1; pointer-events: none; }
.map-shade-top { top: 0; height: calc(var(--safe-top) + 96px); background: linear-gradient(180deg, rgba(17, 20, 24, .92) 0%, rgba(17, 20, 24, .55) 55%, rgba(17, 20, 24, 0) 100%); }
.map-shade-bottom { bottom: calc(var(--sheet-h, 260px) + var(--sheet-bottom) - 24px); height: 80px; background: linear-gradient(0deg, rgba(17, 20, 24, .45), rgba(17, 20, 24, 0)); transition: bottom var(--dur-slow) var(--ease-out); }

/* ── Top bar ───────────────────────────────────────────────────────── */
.topbar {
  position: absolute; z-index: 8;
  top: calc(var(--safe-top) + 2px); left: 14px; right: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.tb-avatar { position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%; padding: 2px; background: var(--glass); box-shadow: 0 0 0 1px var(--glass-border), 0 6px 18px rgba(0, 0, 0, .35); }
.tb-avatar .avatar { --size: 40px; background: linear-gradient(140deg, #2B313B, #1B1F25); color: #fff; font-size: 14px; letter-spacing: .02em; }
.tb-auto { position: absolute; right: -3px; bottom: -3px; width: 20px; height: 20px; border-radius: 50%; background: var(--taxi); box-shadow: 0 0 0 2.5px var(--bg); display: grid; place-items: center; }
.tb-auto::before { content: ""; width: 9px; height: 11px; background: var(--hajde-ink); clip-path: polygon(60% 0, 0 58%, 45% 58%, 35% 100%, 100% 40%, 55% 40%); }
.tb-auto[hidden] { display: none; }

.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 16px 0 14px; border-radius: 999px;
  background: var(--glass); color: var(--fg);
  box-shadow: 0 0 0 1px var(--glass-border), 0 6px 18px rgba(0, 0, 0, .35);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: 14px; font-weight: 750; letter-spacing: -.005em; white-space: nowrap;
  cursor: default;
}
.sp-dot { width: 9px; height: 9px; border-radius: 50%; background: #6E7582; flex: none; }
.status-pill[data-status="online"] .sp-dot { background: var(--success); color: var(--success); animation: pulse-ring 1.8s var(--ease-out) infinite; }
.status-pill[data-status="pickup"] .sp-dot { background: var(--pickup); }
.status-pill[data-status="arrived"] .sp-dot { background: var(--taxi); }
.status-pill[data-status="trip"] .sp-dot { background: var(--trip); }
.status-pill[data-status="offline"] .sp-text { color: var(--fg-muted); }

.earn-pill {
  display: inline-flex; align-items: baseline; gap: 6px;
  height: 40px; padding: 0 14px; border-radius: 999px;
  background: var(--glass); color: var(--fg);
  box-shadow: 0 0 0 1px var(--glass-border), 0 6px 18px rgba(0, 0, 0, .35);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  line-height: 40px; white-space: nowrap;
}
.ep-label { font-size: 12px; font-weight: 650; color: var(--fg-muted); }
.ep-value { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }

/* ── Turn-by-turn banner ───────────────────────────────────────────── */
.nav-banner {
  position: absolute; z-index: 7;
  top: calc(var(--safe-top) + 54px); left: 12px; right: 12px;
  border-radius: 22px; overflow: hidden;
  background: var(--taxi); color: var(--hajde-ink);
  box-shadow: 0 14px 36px rgba(0, 0, 0, .45), 0 0 0 1px rgba(0, 0, 0, .2);
  animation: rise-in var(--dur-slow) var(--ease-out) both;
}
.nav-banner[hidden] { display: none; }
.nav-banner.is-bump .nb-arrow { animation: nb-bump .5s var(--ease-spring); }
.nb-main { display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 12px; }
.nb-arrow { flex: none; width: 54px; height: 54px; border-radius: 15px; background: var(--hajde-ink); color: var(--taxi); display: grid; place-items: center; }
.nb-arrow svg { max-width: none; }
.nb-body { min-width: 0; flex: 1; }
.nb-text { font-size: 20px; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; }
.nb-sub { margin-top: 2px; font-size: 13px; font-weight: 650; opacity: .68; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb-then { display: flex; align-items: center; gap: 6px; padding: 7px 16px 8px; background: rgba(17, 20, 24, .1); font-size: 13px; font-weight: 750; }
.nb-then[hidden] { display: none; }
.nb-then > span:first-child { opacity: .62; font-weight: 650; }
.nb-then svg { max-width: none; }
@keyframes nb-bump { 0% { transform: scale(.82); } 100% { transform: none; } }

/* ── Demand hint ───────────────────────────────────────────────────── */
.demand-chip {
  position: absolute; z-index: 7;
  top: calc(var(--safe-top) + 54px); left: 12px; right: 12px;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px 10px 10px; border-radius: 18px;
  background: var(--glass); color: var(--fg); text-align: left;
  box-shadow: 0 0 0 1px rgba(255, 198, 41, .28), 0 10px 26px rgba(0, 0, 0, .38);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  animation: rise-in var(--dur-slow) var(--ease-out) both;
}
.demand-chip[hidden] { display: none; }
.dc-icon { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 198, 41, .16); color: var(--taxi); }
.dc-body { flex: 1; min-width: 0; display: grid; }
.dc-title { font-size: 14px; font-weight: 750; line-height: 1.3; letter-spacing: -.005em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-wrap: balance; }
.dc-sub { font-size: 12px; font-weight: 600; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demand-chip > svg { color: var(--fg-subtle); flex: none; }

.map-fab {
  position: absolute; z-index: 6; right: 14px;
  bottom: calc(var(--sheet-h, 260px) + var(--sheet-bottom) + 52px); /* clears the 2-line attribution */
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--glass); color: var(--pickup);
  box-shadow: 0 0 0 1px var(--glass-border), 0 8px 20px rgba(0, 0, 0, .4);
  transition: bottom var(--dur-slow) var(--ease-out);
}
.map-fab[hidden] { display: none; }

/* ── Drive sheet ───────────────────────────────────────────────────── */
.drive-sheet {
  position: absolute; z-index: 6; left: 0; right: 0;
  bottom: var(--sheet-bottom);
  padding: 8px 16px 16px;
  background: var(--surface);
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -1px 0 rgba(255, 255, 255, .06), 0 -14px 40px rgba(0, 0, 0, .5);
  transition: bottom var(--dur-slow) var(--ease-out);
}
.drv.is-focus .drive-sheet { padding-bottom: calc(var(--safe-bottom) + 10px); }
.drive-sheet::before { content: ""; display: block; width: 38px; height: 4px; border-radius: 3px; margin: 0 auto 12px; background: var(--border-strong); }
.drv[data-mode="online"] .drive-sheet::before { display: none; }

.ds-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.ds-eyebrow { font-size: 13px; font-weight: 650; color: var(--fg-muted); margin-bottom: 2px; }
.ds-title { font-family: var(--font-display); font-size: 20px; font-weight: 650; letter-spacing: -.025em; line-height: 1.2; }
.ds-sub { margin-top: 3px; font-size: 13.5px; font-weight: 550; color: var(--fg-muted); line-height: 1.35; }
.ds-sub b { color: var(--fg); font-weight: 750; }
.ds-head .btn-sm { flex: none; margin-top: 1px; }
.ds-head.is-center { align-items: center; margin-bottom: 4px; }
.ds-head.is-center .btn-sm { margin-top: 0; gap: 6px; }
.ds-sub-row { margin: 0 0 14px; }

.scan { position: relative; width: 120px; height: 4px; margin: 0 auto 14px; border-radius: 3px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.scan > span { position: absolute; top: 0; bottom: 0; width: 46%; border-radius: 3px; background: linear-gradient(90deg, transparent, var(--success), transparent); animation: scan 1.5s var(--ease-in-out) infinite; }
@keyframes scan { 0% { left: -46%; } 100% { left: 100%; } }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); padding: 12px 0; border-radius: 16px; background: var(--surface-2); }
.stat { display: grid; justify-items: center; gap: 1px; padding: 0 6px; min-width: 0; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat-v { font-size: 16px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; }
.stat-l { font-size: 11.5px; font-weight: 600; color: var(--fg-muted); }

.vit-card {
  display: flex; align-items: center; gap: 12px; width: 100%;
  margin-top: 10px; padding: 11px 14px 11px 11px; border-radius: 16px; text-align: left;
  background: linear-gradient(120deg, rgba(123, 92, 255, .24) 0%, rgba(90, 107, 255, .14) 55%, rgba(0, 209, 193, .1) 100%);
  box-shadow: inset 0 0 0 1px rgba(154, 130, 255, .32);
  color: var(--fg);
  transition: transform var(--dur-fast) var(--ease-out);
}
.vit-card:active { transform: scale(.985); }
.vit-mark { flex: none; width: 38px; height: 38px; border-radius: 11px; background: var(--vitrina-night); display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.vit-mark img { width: 24px; height: 24px; }
.vit-body { flex: 1; min-width: 0; display: grid; gap: 1px; }
.vit-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 750; white-space: nowrap; }
.vit-state { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 750; background: rgba(255, 255, 255, .08); color: var(--fg-muted); }
.vit-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.vit-state.is-on { background: rgba(0, 209, 193, .16); color: #4BE3D6; }
.vit-sub { font-size: 12px; font-weight: 550; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vit-val { flex: none; display: grid; justify-items: end; line-height: 1.15; }
.vit-val b { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.vit-val small { font-size: 11px; font-weight: 600; color: var(--fg-muted); }

.btn-go { margin-top: 14px; }
.btn .icon { width: 1.2em; height: 1.2em; }

/* navigation sheet parts */
.eta { display: grid; justify-items: center; gap: 2px; margin: -2px 0 14px; }
.eta-main { display: flex; align-items: baseline; gap: 10px; font-family: var(--font-display); font-weight: 650; letter-spacing: -.03em; }
.eta-min { font-size: 26px; }
.eta-km { font-size: 20px; color: var(--fg-muted); }
.eta-sep { width: 5px; height: 5px; border-radius: 50%; background: var(--fg-subtle); align-self: center; }
.eta-sub { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--fg-muted); }
.eta-sub b { color: var(--fg); font-weight: 750; }
.leg-dot { width: 8px; height: 8px; border-radius: 50%; }
.eta.is-done .eta-main { color: #4ADE80; }
.eta-done { display: inline-flex; align-items: center; gap: 9px; font-size: 24px; }
.eta-done svg { flex: none; }
.leg-dot.is-pickup { background: var(--pickup); }
.leg-dot.is-trip { background: var(--trip); }

.pax { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; background: var(--surface-2); }
.pax .avatar { --size: 44px; background: rgba(255, 198, 41, .14); color: var(--taxi); font-size: 15px; }
.pax-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.pax-name { display: flex; align-items: center; gap: 8px; font-size: 15.5px; font-weight: 750; white-space: nowrap; }
.pax-rate { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 700; color: var(--fg-muted); }
.pax-sub { display: flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--fg-muted); white-space: nowrap; }
.pax-sub svg { margin-left: 2px; }
.round-btn { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--fg); transition: background var(--dur-fast), transform var(--dur-fast); }
.round-btn:hover { background: #3A414D; }
.round-btn:active { transform: scale(.94); }
.pax.is-compact { padding: 10px 10px 10px 12px; }
.pax.is-compact .avatar { --size: 38px; font-size: 13px; }

.addr { display: flex; align-items: center; gap: 12px; padding: 14px 4px; }
.addr-ic { flex: none; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; }
.addr-ic.is-pickup { background: rgba(61, 139, 255, .16); color: #8DB9FF; }
.addr-ic.is-drop { background: rgba(240, 53, 61, .16); color: #FF8A8F; }
.addr-body { flex: 1; min-width: 0; display: grid; gap: 1px; }
.addr-t { font-size: 15px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.addr-s { font-size: 12.5px; font-weight: 600; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.addr-fare { flex: none; font-size: 15px; font-weight: 800; }

.wait-ring { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--taxi); background: rgba(255, 198, 41, .12); box-shadow: 0 0 0 0 rgba(255, 198, 41, .4); animation: wait-pulse 2s var(--ease-out) infinite; }
@keyframes wait-pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 198, 41, .35); } 100% { box-shadow: 0 0 0 14px rgba(255, 198, 41, 0); } }

.fare-row { display: flex; align-items: center; gap: 10px; padding: 14px 4px; font-size: 13px; font-weight: 600; color: var(--fg-muted); }
.fare-v { margin-left: auto; font-size: 16px; font-weight: 800; color: var(--fg); }
.fare-pay { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--surface-2); color: var(--fg); font-size: 12px; font-weight: 700; }
.btn.is-ready { animation: ready-glow 1.6s var(--ease-out) infinite; }
@keyframes ready-glow { 0% { box-shadow: 0 0 0 0 rgba(229, 38, 46, .55), 0 6px 16px -6px rgba(229, 38, 46, .7); } 100% { box-shadow: 0 0 0 14px rgba(229, 38, 46, 0), 0 6px 16px -6px rgba(229, 38, 46, .7); } }

/* ── Tab bar ───────────────────────────────────────────────────────── */
.tabbar {
  position: absolute; z-index: 9; left: 0; right: 0; bottom: 0;
  height: var(--tab-h); padding: 0 20px var(--safe-bottom);
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: #14171C; border-top: 1px solid rgba(255, 255, 255, .06);
  transition: transform var(--dur-slow) var(--ease-out);
}
.drv.is-focus .tabbar { transform: translateY(100%); pointer-events: none; }
.tab { display: grid; justify-items: center; align-content: center; gap: 3px; color: var(--fg-subtle); font-size: 11px; font-weight: 700; letter-spacing: .01em; transition: color var(--dur-fast); }
.tab.is-active { color: var(--fg); }
.tab.is-active svg { color: var(--brand-primary); }

/* ── Offer (full screen) ───────────────────────────────────────────── */
.offer-layer { position: absolute; inset: 0; z-index: 40; animation: fade-in var(--dur-base) var(--ease-out) both; }
.offer-layer[hidden] { display: none; }
.offer-layer.is-leaving { animation: fade-out var(--dur-base) var(--ease-out) both; }
.offer-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 12, 15, .82) 0%, rgba(10, 12, 15, .12) 22%, rgba(10, 12, 15, 0) 34%, rgba(10, 12, 15, .5) 50%, rgba(10, 12, 15, .9) 64%); }
.offer-top { position: absolute; top: calc(var(--safe-top) + 4px); left: 0; right: 0; display: flex; justify-content: center; }
.ot-badge { display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 18px 0 16px; border-radius: 999px; background: var(--taxi); color: var(--hajde-ink); font-size: 14px; font-weight: 800; letter-spacing: .01em; box-shadow: 0 10px 30px rgba(255, 198, 41, .35); animation: badge-pulse 1.2s var(--ease-in-out) infinite alternate; }
.ot-badge .dot-live { color: var(--hajde-ink); background: var(--hajde-ink); }
@keyframes badge-pulse { from { transform: scale(1); } to { transform: scale(1.045); } }

.offer-card {
  position: absolute; left: 10px; right: 10px; bottom: calc(var(--safe-bottom) + 4px);
  padding: 18px 18px 16px; border-radius: 30px;
  background: linear-gradient(180deg, #20252D 0%, #1B1F25 40%);
  box-shadow: 0 0 0 1.5px rgba(255, 198, 41, .55), 0 30px 60px rgba(0, 0, 0, .6);
  animation: offer-in 520ms var(--ease-spring) both, offer-glow 1.4s var(--ease-out) 520ms infinite;
}
@keyframes offer-in { 0% { transform: translateY(40px) scale(.96); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; opacity: 1; } }
@keyframes offer-glow {
  0% { box-shadow: 0 0 0 1.5px rgba(255, 198, 41, .6), 0 0 0 0 rgba(255, 198, 41, .32), 0 30px 60px rgba(0, 0, 0, .6); }
  100% { box-shadow: 0 0 0 1.5px rgba(255, 198, 41, .6), 0 0 0 16px rgba(255, 198, 41, 0), 0 30px 60px rgba(0, 0, 0, .6); }
}
.oc-head { display: flex; align-items: center; gap: 18px; }
.oc-ring { position: relative; flex: none; width: 108px; height: 108px; display: grid; place-items: center; align-content: center; }
.oc-ring svg { position: absolute; inset: 0; max-width: none; }
.ring-track { fill: none; stroke: rgba(255, 255, 255, .08); stroke-width: 8; }
.ring-bar { fill: none; stroke: var(--taxi); stroke-width: 8; stroke-linecap: round; transition: stroke var(--dur-base); }
.oc-ring.is-urgent .ring-bar { stroke: var(--brand-primary); }
.oc-sec { position: relative; font-family: var(--font-display); font-size: 36px; font-weight: 650; line-height: 1; letter-spacing: -.03em; }
.oc-unit { position: relative; margin-top: 3px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-muted); }
.oc-ring.is-urgent .oc-sec { color: #FF6B71; animation: sec-tick 1s var(--ease-out) infinite; }
@keyframes sec-tick { 0% { transform: scale(1.12); } 40% { transform: scale(1); } }
.oc-money { min-width: 0; display: grid; gap: 4px; }
.oc-label { font-size: 12px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--taxi); }
.oc-fare { font-family: var(--font-display); font-size: 40px; font-weight: 650; line-height: 1.05; letter-spacing: -.035em; white-space: nowrap; }
.oc-fare small { font-size: 17px; font-weight: 600; letter-spacing: -.01em; color: var(--fg-muted); }
.oc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.oc-tag { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--surface-3); font-size: 12px; font-weight: 700; color: var(--fg); }
.oc-rider { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.oc-rider .avatar { --size: 42px; background: rgba(255, 198, 41, .14); color: var(--taxi); font-size: 14px; }
.oc-rider .grow { display: grid; gap: 1px; min-width: 0; }
.oc-rider .oc-tag { flex: none; }
.oc-tag.is-cash { background: rgba(255, 198, 41, .14); color: var(--taxi); }
.ocr-name { font-size: 16px; font-weight: 750; }
.ocr-sub { font-size: 13px; font-weight: 600; color: var(--fg-muted); }
.oc-route { position: relative; display: grid; gap: 14px; padding: 14px 0 16px; }
.oc-route::before { content: ""; position: absolute; left: 7px; top: 30px; bottom: 44px; width: 2px; border-radius: 2px; background: repeating-linear-gradient(180deg, var(--fg-subtle) 0 4px, transparent 4px 8px); }
.ocs { display: flex; gap: 14px; align-items: flex-start; }
.ocs-mark { flex: none; width: 16px; height: 16px; margin-top: 12px; }
.ocs-mark.is-pickup { border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 4.5px var(--pickup); }
.ocs-mark.is-drop { border-radius: 4px; background: var(--trip); box-shadow: inset 0 0 0 4.5px #FF8A8F; }
.ocs-body { min-width: 0; display: grid; gap: 1px; }
.ocs-l { font-size: 12px; font-weight: 650; color: var(--fg-muted); }
.ocs-t { font-size: 16px; font-weight: 750; line-height: 1.3; letter-spacing: -.01em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.oc-actions { display: grid; grid-template-columns: 1fr 1.7fr; gap: 10px; }
.oc-actions .btn-lg { --btn-h: 60px; font-size: 17px; }
.oc-actions .btn-primary { box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 12px 28px -8px rgba(229, 38, 46, .75); }

/* ── Trip summary ──────────────────────────────────────────────────── */
.summary-layer { position: absolute; inset: 0; z-index: 45; background: rgba(9, 11, 14, .66); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); animation: fade-in var(--dur-base) var(--ease-out) both; }
.summary-layer[hidden] { display: none; }
.summary-layer.is-leaving { animation: fade-out var(--dur-base) var(--ease-out) both; }
.sum-card {
  position: absolute; left: 10px; right: 10px; bottom: calc(var(--safe-bottom) + 4px);
  display: grid; justify-items: center;
  padding: 26px 18px 14px; border-radius: 30px;
  background: linear-gradient(180deg, #20262E 0%, #1B1F25 45%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 30px 60px rgba(0, 0, 0, .6);
  animation: offer-in 560ms var(--ease-spring) both;
}
.sum-check { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--success); box-shadow: 0 0 0 8px rgba(22, 163, 74, .16), 0 12px 30px rgba(22, 163, 74, .35); animation: pop 520ms var(--ease-spring) 120ms both; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.sum-eyebrow { margin-top: 16px; font-size: 12px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-muted); }
.sum-amount { margin-top: 4px; display: flex; align-items: baseline; font-family: var(--font-display); font-size: 46px; font-weight: 650; letter-spacing: -.04em; line-height: 1.08; }
.sum-amount > span:first-child { color: #4ADE80; margin-right: 2px; }
.sum-amount small { font-size: 18px; font-weight: 600; color: var(--fg-muted); letter-spacing: -.01em; }
.sum-pay { margin-top: 8px; display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 650; color: var(--fg-muted); }
.sum-pay.is-cash { background: rgba(255, 198, 41, .14); color: var(--taxi); font-weight: 750; }
.sum-route { margin-top: 14px; display: flex; align-items: center; gap: 8px; max-width: 100%; font-size: 14px; font-weight: 700; color: var(--fg); }
.sum-route svg { color: var(--fg-subtle); }
.sum-rows { width: 100%; margin: 14px 0 16px; border-radius: 18px; background: var(--surface-2); padding: 2px 14px; }
.sr { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; font-size: 13.5px; font-weight: 600; color: var(--fg-muted); }
.sr + .sr { border-top: 1px solid var(--border); }
.sr > span { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.sr img { width: 18px; height: 18px; flex: none; }
.sr b { font-weight: 800; color: var(--fg); white-space: nowrap; }
.sr.is-ads b { color: #CFC3FF; }
.sum-pending { font-weight: 650 !important; color: var(--fg-subtle) !important; }
.sum-stars span { color: var(--taxi); letter-spacing: 1px; }
.sum-stars i { font-style: normal; color: var(--surface-3); }
.sum-auto { width: 100%; display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 12px; font-weight: 650; color: var(--fg-muted); white-space: nowrap; }
.sum-auto .progress { flex: 1; height: 4px; }
.sum-auto .progress > span { transition: none; background: var(--success); }

/* ── Settings sheet ────────────────────────────────────────────────── */
.settings-sheet { padding: 8px 16px calc(var(--safe-bottom) + 12px); max-height: 92%; background: var(--surface); }
.set-profile { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.set-profile .avatar { background: linear-gradient(140deg, var(--hajde-red), #F8653A); color: #fff; }
.set-profile .grow { display: grid; gap: 2px; }
.set-name { font-family: var(--font-display); font-size: 19px; font-weight: 650; letter-spacing: -.02em; }
.set-meta { font-size: 13px; font-weight: 600; color: var(--fg-muted); }
.set-vehicle { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 18px; background: var(--surface-2); }
.set-vehicle .grow { min-width: 0; display: grid; gap: 1px; }
.sv-model { font-size: 15px; font-weight: 750; }
.sv-sub { font-size: 12.5px; font-weight: 600; color: var(--fg-muted); }
.sv-ic { flex: none; color: var(--taxi); }
.plate { flex: none; display: inline-flex; align-items: stretch; height: 32px; border-radius: 6px; overflow: hidden; background: #F5F6F8; color: #111418; box-shadow: inset 0 0 0 1.5px #111418, 0 2px 6px rgba(0, 0, 0, .3); }
.plate-al { width: 17px; display: grid; place-items: end center; padding-bottom: 3px; background: #1E4DB7; color: #fff; font-size: 8px; font-weight: 800; }
.plate-n { display: grid; place-items: center; padding: 0 9px; font-family: var(--font-ui); font-size: 15px; font-weight: 800; letter-spacing: .04em; }
.set-classes { margin-top: 10px; }
.set-classes .chip { background: transparent; }
.set-group-label { margin: 18px 4px 8px; font-size: 11.5px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-subtle); }
.set-list { border-radius: 18px; background: var(--surface-2); overflow: hidden; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: default; }
label.set-row { cursor: pointer; }
.set-row + .set-row { border-top: 1px solid var(--border); }
.set-row > svg { color: var(--fg-subtle); flex: none; }
.set-ic { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-3); color: var(--fg); }
.set-ic.is-accent { background: rgba(255, 198, 41, .14); color: var(--taxi); }
.set-ic.is-vitrina { background: var(--vitrina-night); box-shadow: inset 0 0 0 1px rgba(154, 130, 255, .3); }
.set-ic img { width: 22px; height: 22px; }
.set-body { flex: 1; min-width: 0; display: grid; gap: 1px; }
.set-t { font-size: 14.5px; font-weight: 700; }
.set-s { font-size: 12.5px; font-weight: 550; color: var(--fg-muted); line-height: 1.35; }
.set-row .badge { flex: none; }
.set-row .badge .dot { width: 6px; height: 6px; }
.set-note { text-align: center; font-size: 12.5px; color: var(--fg-muted); }

/* ── Earnings view ─────────────────────────────────────────────────── */
.view-earnings { bottom: var(--tab-h); background: var(--bg-subtle); }
.earn-scroll { position: absolute; inset: var(--safe-top) 0 0 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px 22px; scrollbar-width: none; }
.earn-scroll::-webkit-scrollbar { display: none; }
/* title + period switch stay pinned under the status bar while the list scrolls */
.earn-head { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 -16px 8px; padding: 10px 16px 8px; background: var(--bg-subtle); }
.earn-head::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 14px; background: linear-gradient(var(--bg-subtle), transparent); pointer-events: none; }
.earn-title { font-family: var(--font-display); font-size: 24px; font-weight: 650; letter-spacing: -.03em; }
.earn-seg { padding: 3px; }
.earn-seg > button { min-height: 32px; padding: 0 12px; font-size: 13px; }
.earn-skel { display: grid; gap: 12px; }
.earn-hero { padding: 18px; border-radius: 24px; background: linear-gradient(160deg, #222831 0%, var(--surface) 60%); }
.eh-label { font-size: 13px; font-weight: 650; color: var(--fg-muted); }
.eh-total { margin-top: 2px; font-family: var(--font-display); font-size: 40px; font-weight: 650; letter-spacing: -.04em; line-height: 1.1; }
.eh-total small { font-size: 18px; font-weight: 600; color: var(--fg-muted); letter-spacing: -.01em; }
.eh-sub { margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--fg-muted); }
.eh-bar { display: flex; gap: 2px; height: 8px; margin: 16px 0 6px; border-radius: 4px; overflow: hidden; }
.eh-bar > span { min-width: 0; }
.eh-split { display: grid; }
.es-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; }
.es-row + .es-row { border-top: 1px solid var(--border); }
.es-ic { flex: none; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 17%, transparent); }
.es-row.is-ads .es-ic { background: var(--vitrina-night); box-shadow: inset 0 0 0 1px rgba(154, 130, 255, .35); }
.es-ic img { width: 22px; height: 22px; }
.es-body { flex: 1; min-width: 0; display: grid; gap: 1px; }
.es-name { font-size: 14.5px; font-weight: 700; }
.es-note { font-size: 12px; font-weight: 550; line-height: 1.35; color: var(--fg-muted); text-wrap: pretty; }
.es-val { flex: none; font-size: 15px; font-weight: 800; }

.earn-chart { margin-top: 12px; padding: 16px 14px 14px 16px; border-radius: 24px; }
.ec-title { font-size: 15px; font-weight: 750; }
.ec-sub { font-size: 12.5px; font-weight: 550; color: var(--fg-muted); }
.ec-plot { position: relative; margin-top: 12px; }
.ch-svg { width: 100%; height: auto; overflow: visible; max-width: none; }
.ch-grid { stroke: rgba(255, 255, 255, .06); stroke-width: 1; }
.ch-grid.is-base { stroke: rgba(255, 255, 255, .16); }
.ch-tick { fill: var(--fg-subtle); font-size: 10px; font-weight: 600; font-family: var(--font-ui); }
.ch-x { fill: var(--fg-muted); font-size: 10.5px; font-weight: 650; font-family: var(--font-ui); }
.ch-x.is-today { fill: var(--fg); font-weight: 800; }
.ch-cursor { stroke: rgba(255, 255, 255, .22); stroke-width: 1; }
.ch-hit { cursor: pointer; }
.ec-tip { position: absolute; top: -8px; z-index: 2; min-width: 150px; padding: 9px 11px; border-radius: 12px; background: #F5F6F8; color: var(--hajde-ink); box-shadow: 0 10px 30px rgba(0, 0, 0, .45); pointer-events: none; font-size: 12px; font-weight: 600; transform: translateY(-100%); }
.ec-tip[hidden] { display: none; }
.tt-date { color: #6B7280; font-weight: 650; }
.tt-total { font-size: 16px; font-weight: 800; margin: 1px 0 4px; }
.tt-row { display: flex; align-items: center; gap: 6px; }
.tt-row i { width: 8px; height: 8px; border-radius: 2px; }
.tt-row b { margin-left: auto; padding-left: 12px; font-weight: 800; }
.ec-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 12px; font-weight: 600; color: var(--fg-muted); }
.ec-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ec-legend i { width: 10px; height: 10px; border-radius: 3px; }

.earn-payout { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 14px 14px 14px 16px; border-radius: 20px; }
.ep-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(22, 163, 74, .16); color: #4ADE80; }
.earn-payout .grow { display: grid; gap: 1px; }
.ep-t { font-size: 14.5px; font-weight: 750; }
.ep-s { font-size: 12.5px; font-weight: 550; color: var(--fg-muted); }
.earn-payout .btn { flex: none; }

.earn-recent { margin-top: 22px; }
.er-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 2px 6px; }
.er-title { font-family: var(--font-display); font-size: 16px; font-weight: 650; letter-spacing: -.02em; }
.er-count { font-size: 12.5px; font-weight: 650; color: var(--fg-muted); }
.er-list { border-radius: 20px; background: var(--surface); box-shadow: 0 0 0 1px var(--border); padding: 0 14px; }
.er-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.er-item + .er-item { border-top: 1px solid var(--border); }
.er-ic { flex: none; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); color: var(--fg-muted); }
.er-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.er-route { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 14px; font-weight: 700; }
.er-route .ellipsis { min-width: 0; flex: 0 1 auto; }
.er-route svg { flex: none; color: var(--fg-subtle); }
.er-meta { font-size: 12px; font-weight: 550; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.er-star { color: var(--taxi); }
.er-val { flex: none; display: grid; justify-items: end; gap: 1px; }
.er-val .num { font-size: 14.5px; font-weight: 800; }
.er-tip, .er-ads { font-size: 11px; font-weight: 700; color: var(--fg-muted); }
.er-tip { color: #4ADE80; }

/* ── Misc ──────────────────────────────────────────────────────────── */
/* visible thousands gap (see ui.js numHtml) */
.nnsp { margin-left: .12em; letter-spacing: 0; }

/* toasts: keep the semantic icon colours in the dark theme */
.drv .toast-success .toast-icon { background: var(--success); color: #fff; }
.drv .toast-brand .toast-icon { background: var(--brand-primary); color: #fff; }
.drv .toast-accent .toast-icon { background: var(--taxi); color: var(--hajde-ink); }
.drv .toast-danger .toast-icon { background: var(--danger); color: #fff; }
.drv .toast-title { line-height: 1.3; }
.drv .toast-sub { line-height: 1.35; margin-top: 1px; }

/* the offer takes over the screen: fade the map chrome underneath */
.topbar, .demand-chip { transition: opacity var(--dur-base) var(--ease-out); }
.drv.has-offer .topbar, .drv.has-offer .demand-chip { opacity: 0; pointer-events: none; }
.conn-banner { position: absolute; z-index: 85; top: calc(var(--safe-top) + 2px); left: 12px; right: 12px; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--amber-soft); color: var(--amber-ink); font-size: 13.5px; font-weight: 700; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
.conn-banner[hidden] { display: none; }
.conn-banner .spinner { width: 16px; height: 16px; border-width: 2px; border-color: rgba(146, 64, 14, .3); border-top-color: var(--amber-ink); }
#toasts.is-top { top: calc(var(--safe-top) + 4px); width: calc(100% - 24px); }
/* while navigating, the turn banner owns the top: toasts sit just above the sheet instead */
.drv[data-mode="pickup"] #toasts.is-top, .drv[data-mode="arrived"] #toasts.is-top, .drv[data-mode="trip"] #toasts.is-top {
  top: auto; bottom: calc(var(--sheet-h, 300px) + 12px);
}
.drv.has-offer #toasts { display: none; }
.drv .empty { padding: 24px 12px; }
@keyframes fade-out { to { opacity: 0; } }

/* Short screens: framed on a ~768 px laptop (screen 560–700 px) or a small real phone.
   Keep the map visible while navigating: drop secondary rows, tighten the type. */
@media (min-width: 521px) and (max-height: 764px), (max-width: 520px) and (max-height: 700px) {
  .oc-ring { width: 92px; height: 92px; }
  .oc-ring svg { width: 92px; height: 92px; }
  .oc-sec { font-size: 30px; }
  .oc-fare { font-size: 34px; }
  .oc-rider { margin-top: 12px; padding: 9px 0; }
  .oc-route { gap: 10px; padding: 10px 0 12px; }
  .oc-actions .btn-lg { --btn-h: 54px; }

  .drive-sheet { padding-top: 6px; }
  .drive-sheet::before { margin-bottom: 8px; }
  .drv.is-focus .drive-sheet { padding-bottom: calc(var(--safe-bottom) + 6px); }
  .ds-head { margin-bottom: 10px; }
  .ds-title { font-size: 18px; }
  .ds-sub-row { margin-bottom: 10px; }
  .stat-row { padding: 9px 0; }
  .vit-card { margin-top: 8px; padding-top: 9px; padding-bottom: 9px; }
  .btn-go { margin-top: 10px; }
  .drive-sheet .btn-lg { --btn-h: 52px; }

  .eta { margin-bottom: 10px; }
  .eta-min { font-size: 22px; }
  .eta-km { font-size: 17px; }
  .pax { padding: 9px 10px; }
  .pax .avatar { --size: 38px; font-size: 13px; }
  .round-btn { width: 38px; height: 38px; }
  .addr-pickup, .fare-row { display: none; }
  .addr { padding: 10px 4px; }
  .ds-nav .pax + .btn, .ds-nav .pax + .addr-pickup + .btn, .ds-nav .pax + .fare-row + .btn { margin-top: 12px; }

  .nav-banner { top: calc(var(--safe-top) + 50px); border-radius: 18px; }
  .nb-main { padding: 9px 14px 9px 9px; gap: 10px; }
  .nb-arrow { width: 46px; height: 46px; border-radius: 13px; }
  .nb-arrow svg { width: 38px; height: 38px; }
  .nb-text { font-size: 18px; }
  .nb-sub { font-size: 12.5px; }
  .nb-then { padding: 5px 14px 6px; font-size: 12.5px; }

  .sum-card { padding-top: 18px; }
  .sum-check { width: 52px; height: 52px; }
  .sum-amount { font-size: 38px; }
  .sum-route { margin-top: 10px; }
  .sum-rows { margin: 10px 0 12px; }
  .sr { padding: 8px 0; }
}
