:root {
  color-scheme: dark;
  --bg: #080a12;
  --panel: rgba(18, 24, 42, 0.78);
  --panel-strong: rgba(28, 36, 62, 0.92);
  --text: #eef3ff;
  --muted: #9eaad0;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #8b5cf6;
  --accent-2: #28d7ff;
  --good: #3ee58f;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

body.rider-native {
  height: 100vh;
  height: 100svh;
  margin: 0;
  overflow: hidden;
  color: #1c1b1f;
  background: #f8f9fa;
  font-family: Roboto, Arial, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.rider-native-shell {
  height: 100vh;
  height: 100svh;
  min-height: 0;
  max-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f8f9fa;
}

.rider-app-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 82px;
  padding: max(16px, env(safe-area-inset-top)) 18px 14px;
  color: #fff;
  background: #e85d04;
  box-shadow: 0 2px 10px rgba(28, 27, 31, 0.18);
}

.rider-app-bar h1 {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: #fff;
  font-size: 1.32rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rider-account-button {
  position: relative;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0;
  overflow: hidden;
}

.rider-account-button::before {
  content: "";
  width: 31px;
  height: 31px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 35%, #fff 0 22%, transparent 23%),
    radial-gradient(circle at 50% 92%, #fff 0 38%, transparent 39%);
}

.rider-account-button.has-profile-photo {
  border: 2px solid rgba(255, 255, 255, 0.82);
  background: transparent;
}

.rider-account-button.has-profile-photo::before {
  display: none;
  background: none;
}

.rider-account-button img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.rider-home {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.rider-map-stage {
  position: relative;
  flex: 1;
  min-height: 420px;
  overflow: hidden;
  background: #e8e6e1;
}

.rider-native-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 420px;
  background: #e8e6e1;
}

.rider-native .customer-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 420px;
  border-radius: 0;
  background: #f4f4f2;
  touch-action: none;
  cursor: grab;
  user-select: none;
}

.rider-native .customer-map:active {
  cursor: grabbing;
}

.rider-native .map-placeholder {
  color: #757575;
  background: #f8f9fa;
  font-weight: 500;
}

.rider-map-top {
  position: absolute;
  z-index: 100;
  top: 12px;
  left: 12px;
  right: 12px;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.rider-native .map-status {
  justify-self: center;
  padding: 8px 12px;
  border: 0;
  border-radius: 12px;
  color: #1c1b1f;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 14px rgba(28, 27, 31, 0.16);
  font-size: 0.84rem;
  font-weight: 650;
}

.rider-native .map-details {
  position: static;
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 12px;
  color: #1c1b1f;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 14px rgba(28, 27, 31, 0.14);
  text-align: center;
}

.rider-native .map-details strong {
  display: none;
}

.rider-native .map-details span {
  color: rgba(28, 27, 31, 0.72);
  font-size: 0.82rem;
}

.rider-action-overlay {
  position: absolute;
  z-index: 120;
  left: 16px;
  right: 16px;
  bottom: max(30px, calc(env(safe-area-inset-bottom) + 14px));
  display: grid;
  justify-items: center;
  gap: 8px;
}

.rider-status-card {
  max-width: min(520px, 100%);
  padding: 10px 16px;
  border-radius: 12px;
  color: #1c1b1f;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 14px rgba(28, 27, 31, 0.18);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

.rider-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.rider-native .share-location-button,
.rider-native .request-ride-button,
.rider-native .cancel-ride-button,
.rider-native .end-ride-button {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(28, 27, 31, 0.14);
  font-size: 0.84rem;
  font-weight: 700;
}

.rider-native .share-location-button {
  color: #e85d04;
  background: rgba(255, 255, 255, 0.95);
}

.rider-native .request-ride-button,
.rider-native .end-ride-button {
  color: #fff;
  background: #e85d04;
}

.rider-native .cancel-ride-button {
  color: #fff;
  background: #ba1a1a;
}

.rider-chat-panel {
  flex: 0 0 auto;
  margin: 0 0 max(42px, calc(env(safe-area-inset-bottom) + 30px));
  border-radius: 0;
  color: #1c1b1f;
  background: #fff;
  box-shadow: 0 -6px 18px rgba(28, 27, 31, 0.18);
  position: relative;
  z-index: 140;
}

.rider-native .chat-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  color: #fff;
  background: #e85d04;
  font-weight: 700;
}

.rider-native .chat-tab #chatTabArrow {
  font-size: 1.6rem;
  line-height: 1;
}

.rider-native .chat-body {
  gap: 0;
  padding: 0;
}

.rider-native .chat-messages {
  max-height: 220px;
  padding: 8px;
  background: #fff;
}

.rider-native .chat-message {
  border-radius: 12px 12px 12px 2px;
  background: #e3f2fd;
  box-shadow: none;
}

.rider-native .chat-message.from-customer {
  border-radius: 12px 12px 2px 12px;
  color: #1c1b1f;
  background: rgba(232, 93, 4, 0.15);
}

.rider-native .chat-message.from-system {
  color: #1c1b1f;
  background: #f0f0f0;
}

.rider-native .chat-form {
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 6px;
  padding: 6px 8px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

.rider-native .chat-form input {
  border-radius: 24px;
  color: #111827;
  caret-color: #111827;
  background: #fff;
}

.rider-native .chat-form input::placeholder {
  color: #94a3b8;
}

.rider-native .chat-form button {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  overflow: hidden;
  color: transparent;
  background: #e85d04;
  position: relative;
}

.rider-native .chat-form button::before {
  content: "›";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.7rem;
  line-height: 1;
  transform: rotate(-45deg);
}

.rider-native .static-rider-marker {
  z-index: 80;
  left: 50%;
  top: 50%;
  width: 30px;
  height: 30px;
  border: 5px solid #fff;
  border-radius: 999px;
  background: #e85d04;
  box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.28), 0 8px 24px rgba(28, 27, 31, 0.35);
  transform: translate(-50%, -50%);
}

.rider-native .static-map-tile {
  image-rendering: auto;
}

.rider-native .static-map-linework-tile {
  mix-blend-mode: multiply;
  opacity: 0.72;
}

.rider-native .static-rider-marker::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: inherit;
  background: #fff;
}

.rider-account-dialog {
  width: min(420px, calc(100% - 28px));
}

.rider-native .account-card {
  border-color: rgba(232, 93, 4, 0.32);
  color: #1c1b1f;
  background: #fff;
}

.rider-native .account-card h2 {
  color: #1c1b1f;
  font-size: 1.55rem;
  letter-spacing: 0;
}

.rider-native .billing-toast-topline {
  color: #e85d04;
}

.rider-native .account-card p,
.rider-native .optional-label {
  color: rgba(28, 27, 31, 0.7);
}

.rider-native .account-card label {
  color: #1c1b1f;
}

.profile-photo-field {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-photo-preview {
  flex: 0 0 76px;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(232, 93, 4, 0.22);
  border-radius: 999px;
  color: #e85d04;
  background: rgba(232, 93, 4, 0.08);
  font-size: 0;
  overflow: hidden;
}

.profile-photo-preview::before {
  content: "";
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 35%, #e85d04 0 22%, transparent 23%),
    radial-gradient(circle at 50% 92%, #e85d04 0 38%, transparent 39%);
}

.profile-photo-preview.has-profile-photo::before {
  content: none;
}

.profile-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-photo-actions {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-photo-button,
.rider-native #removeProfilePhotoButton {
  min-height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  color: #e85d04;
  background: rgba(232, 93, 4, 0.08);
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
}

.rider-native .billing-toast-actions button,
.rider-native .billing-toast-actions a,
.rider-native #accountSendCodeButton,
.rider-native #verifyCodeButton,
.rider-native #loginSubmitButton,
.rider-native #updateSaveButton,
.rider-native #billingToastClose {
  border-radius: 999px;
  color: #fff;
  background: #e85d04;
  font-weight: 800;
}

.rider-native #accountCancelButton,
.rider-native #accountBackButton,
.rider-native #showLoginButton,
.rider-native #loginBackButton,
.rider-native #resendCodeButton,
.rider-native #updateCancelButton,
.rider-native #signOutButton {
  color: #e85d04;
  background: rgba(232, 93, 4, 0.08);
}

@media (max-width: 800px) {
  body.rider-native {
    height: 100svh;
    overflow: hidden;
  }

  .rider-native-shell {
    height: 100svh;
    max-height: 100svh;
  }

  .rider-home {
    overflow: hidden;
  }

  .rider-app-bar {
    min-height: 76px;
    padding: max(14px, env(safe-area-inset-top)) 16px 12px;
  }

  .rider-app-bar h1 {
    font-size: 1.24rem;
  }

  .rider-account-button {
    flex-basis: 52px;
    width: 52px;
    height: 52px;
  }

  .rider-map-top {
    top: 10px;
    left: 10px;
    right: 10px;
  }

  .rider-map-stage,
  .rider-native-map,
  .rider-native .customer-map {
    min-height: 0;
  }

  .rider-action-overlay {
    left: 12px;
    right: 12px;
    bottom: max(26px, calc(env(safe-area-inset-bottom) + 10px));
    gap: 8px;
  }

  .rider-actions {
    width: 100%;
  }

  .rider-native .share-location-button,
  .rider-native .request-ride-button,
  .rider-native .cancel-ride-button,
  .rider-native .end-ride-button {
    flex: 1 1 150px;
    min-height: 38px;
  }
}

body.underdog-client {
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
  color: #eef3ff;
  background: #0f172a;
  font-family: Roboto, Arial, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.underdog-client .client-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #0f172a;
}

.underdog-client .client-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: max(8px, env(safe-area-inset-top)) 12px 8px;
  background: #0f172a;
}

.underdog-client .client-topbar p {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: #fff;
  font-size: 14px;
  line-height: 1.25;
}

.underdog-client .client-topbar button {
  flex: 0 0 104px;
  height: 44px;
  border-radius: 2px;
  color: #0f172a;
  background: #3ee58f;
  font-weight: 800;
}

.underdog-client .client-progress {
  height: 4px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.24);
}

.underdog-client .client-progress span {
  display: block;
  width: 72%;
  height: 100%;
  background: #3ee58f;
  animation: clientLoad 900ms ease-in-out infinite alternate;
}

.underdog-client .client-progress.loaded span {
  width: 100%;
  animation: none;
}

.underdog-client .client-progress.loaded {
  display: none;
}

@keyframes clientLoad {
  from { transform: translateX(-48%); }
  to { transform: translateX(112%); }
}

.underdog-client .client-webview {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: #080a12;
  -webkit-overflow-scrolling: touch;
}

.underdog-client .app-shell {
  width: min(1180px, calc(100% - 24px));
  min-height: auto;
  margin: 0 auto;
  padding: 18px 0 28px;
  display: block;
}

.underdog-client .topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.underdog-client .topbar h1 {
  grid-column: auto;
  justify-self: center;
  margin: 0;
  font-size: clamp(2rem, 10vw, 4.2rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.underdog-client .topbar-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.underdog-client .device-pill,
.underdog-client .ghost-link,
.underdog-client .menu-button {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border-radius: 999px;
  white-space: nowrap;
}

.underdog-client .rider-request-panel {
  border-radius: 22px;
}

@media (max-width: 800px) {
  body.underdog-client {
    overflow: hidden;
  }

  .underdog-client .client-topbar {
    min-height: 60px;
  }

  .underdog-client .client-webview {
    overflow-y: auto;
  }

  .underdog-client .app-shell {
    width: 100%;
    min-height: 0;
    padding: 8px;
  }

  .underdog-client .topbar {
    grid-template-columns: 1fr auto;
    margin-bottom: 8px;
  }

  .underdog-client .device-pill {
    display: none;
  }

  .underdog-client .topbar h1 {
    justify-self: start;
    font-size: 1.9rem;
  }

  .underdog-client .ghost-link {
    display: none;
  }

  .underdog-client .panel {
    padding: 10px;
    border-radius: 18px;
  }

  .underdog-client .panel-heading {
    margin-bottom: 10px;
  }

  .underdog-client .ride-request-card {
    grid-template-columns: 1fr 1fr;
  }

  .underdog-client #rideRequestStatus {
    grid-column: 1 / -1;
  }

  .underdog-client .rider-map-shell,
  .underdog-client .rider-map-shell .customer-map {
    min-height: 54svh;
  }
}

body.android-driver {
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
  color: #111827;
  background: #f8fafc;
  font-family: Roboto, Arial, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.android-driver button,
.android-driver textarea {
  font: inherit;
}

.android-app-shell {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
}

.android-toolbar,
.android-subtoolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 96px;
  padding: 28px 16px 18px;
  color: #fff;
  background: #111827;
}

.android-toolbar h1,
.android-subtoolbar h2 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: clamp(1.55rem, 5.4vw, 2rem);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.1;
  white-space: nowrap;
}

.android-menu-button,
.android-back-button {
  flex: 0 0 52px;
  width: 52px;
  height: 48px;
  padding: 0;
  color: #fff;
  background: transparent;
  font-size: 2.45rem;
  line-height: 1;
}

.android-back-button {
  font-size: 3rem;
}

.android-screen {
  min-height: 0;
}

.active-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.android-ride-panel {
  padding: 28px 20px 16px;
  background: #f8fafc;
}

.android-meter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 16px;
}

.android-meter-value {
  color: #111827;
  font-size: clamp(3.25rem, 12vw, 4.4rem);
  font-weight: 900;
  line-height: 0.95;
  text-align: center;
}

.android-meter-value.fare {
  color: #16a34a;
}

.android-rate-text {
  margin: 22px 0 14px;
  color: #475569;
  font-size: 1.55rem;
  line-height: 1.2;
}

.android-button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.android-action-button,
.android-full-button {
  min-height: 62px;
  padding: 0 16px;
  border-radius: 0;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
}

.android-action-button.start,
.android-full-button.accept {
  background: #16a34a;
}

.android-action-button.end {
  background: #f97316;
}

.android-full-button.decline {
  margin-top: 10px;
  background: #dc2626;
}

.android-full-button.navy {
  margin-top: 10px;
  background: #111827;
}

.android-action-button:disabled,
.android-full-button:disabled {
  opacity: 0.48;
}

.android-status-text,
.android-request-text {
  margin: 18px 0 0;
  color: #475569;
  font-size: 1.45rem;
  line-height: 1.28;
}

.android-status-text.strong,
.android-request-text {
  color: #111827;
}

.android-map-section {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #dde7da;
}

.android-map {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #dde7da;
}

.android-map-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #334155;
  background: linear-gradient(135deg, #dbeafe, #dcfce7);
  font-size: 1.3rem;
  font-weight: 800;
}

.android-map-tiles,
.android-map-tile,
.android-map-marker {
  position: absolute;
}

.android-map-tiles {
  inset: 0;
}

.android-map-tile {
  width: 256px;
  height: 256px;
}

.android-map-marker {
  z-index: 50;
  transform: translate(-50%, -84%);
}

.android-map-marker.driver {
  width: 76px;
  height: 76px;
  border-radius: 999px;
}

.android-map-marker.customer {
  width: 32px;
  height: 32px;
  border: 4px solid #fff;
  border-radius: 999px;
  background: #2563eb;
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.45);
  transform: translate(-50%, -50%);
}

.android-coordinate-banner {
  position: absolute;
  z-index: 100;
  top: 12px;
  left: 12px;
  right: 12px;
  padding: 12px 18px;
  color: #fff;
  background: rgba(17, 24, 39, 0.88);
  font-size: clamp(1.05rem, 4vw, 1.8rem);
  line-height: 1.22;
  text-align: center;
}

.android-menu-popover {
  position: fixed;
  z-index: 500;
  min-width: 230px;
  padding: 8px 0;
  color: #111827;
  background: #fff;
  box-shadow: 0 18px 60px rgba(15, 23, 42, 0.28);
}

.android-menu-popover button {
  width: 100%;
  padding: 14px 18px;
  color: #111827;
  background: transparent;
  font-size: 1rem;
  text-align: left;
}

.android-menu-popover button:hover {
  background: #f1f5f9;
}

.android-subscreen {
  flex: 1;
  min-height: 0;
  background: #f8fafc;
}

.android-subcontent {
  display: grid;
  gap: 18px;
  padding: 24px;
  overflow: auto;
}

.android-sales-total {
  color: #16a34a;
  font-size: 1.8rem;
  line-height: 1.2;
}

.android-details-text {
  margin: 0;
  color: #475569;
  font-size: 1.05rem;
  line-height: 1.35;
}

.android-history-log,
.android-chat-log {
  min-height: 180px;
  margin: 0;
  white-space: pre-wrap;
  color: #111827;
  background: transparent;
  font: inherit;
  line-height: 1.4;
}

.android-chat-input {
  width: 100%;
  min-height: 92px;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  color: #111827;
  background: #fff;
  resize: vertical;
}

.android-chat-threads {
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: #475569;
}

.android-chat-thread {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #111827;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.android-chat-thread strong {
  font-size: 1.05rem;
}

.android-chat-thread span {
  color: #64748b;
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.android-dialog {
  width: min(420px, calc(100% - 32px));
  border: 0;
  padding: 0;
  color: #111827;
  background: transparent;
}

.android-dialog::backdrop {
  background: rgba(15, 23, 42, 0.44);
}

.android-dialog-card {
  padding: 22px;
  background: #fff;
  box-shadow: 0 22px 80px rgba(15, 23, 42, 0.34);
}

.android-dialog-photo {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 0 12px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e2e8f0;
}

.android-dialog-card h2 {
  margin: 0 0 12px;
  color: #111827;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.android-dialog-card p {
  margin: 0 0 20px;
  color: #475569;
}

.android-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.android-dialog-actions button {
  padding: 10px 14px;
  color: #111827;
  background: transparent;
  font-weight: 800;
  text-transform: uppercase;
}

.android-dialog-actions button:last-child {
  color: #16a34a;
}

.android-dialog-actions button:disabled {
  color: #94a3b8;
}

.android-toast {
  position: fixed;
  z-index: 700;
  left: 50%;
  bottom: 28px;
  max-width: min(420px, calc(100% - 32px));
  padding: 12px 18px;
  color: #fff;
  background: rgba(17, 24, 39, 0.92);
  transform: translateX(-50%);
  text-align: center;
}

@media (min-width: 720px) {
  body.android-driver {
    background: #d1d5db;
  }

  .android-app-shell {
    width: min(460px, 100%);
    min-height: 100vh;
    margin: 0 auto;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12), 0 24px 80px rgba(15, 23, 42, 0.22);
  }

  .android-toolbar,
  .android-subtoolbar {
    min-height: 118px;
    padding-top: 44px;
  }

  .android-toolbar h1,
  .android-subtoolbar h2 {
    font-size: 1.65rem;
  }

  .android-rate-text,
  .android-status-text,
  .android-request-text {
    font-size: 1.15rem;
  }

  .android-action-button,
  .android-full-button {
    min-height: 58px;
    font-size: 1.1rem;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(139, 92, 246, 0.38), transparent 34rem),
    radial-gradient(circle at top right, rgba(40, 215, 255, 0.22), transparent 30rem),
    linear-gradient(135deg, #080a12 0%, #10162a 52%, #06070d 100%);
  color: var(--text);
}

body.focus {
  --accent: #28d7ff;
  --accent-2: #ffcf5a;
}

[hidden] {
  display: none !important;
}

button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 26px 0 44px;
}

.topbar {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 30px;
}

.topbar h1 {
  grid-column: 2;
  margin: 0;
  text-align: center;
  font-size: clamp(2rem, 5vw, 4.2rem);
  letter-spacing: -0.08em;
  line-height: 0.9;
}

.device-pill,
.ghost-button,
.ghost-link,
.primary-button {
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}

.device-pill {
  padding: 10px 14px;
  color: var(--muted);
}

.ghost-button,
.ghost-link {
  justify-self: end;
  padding: 10px 15px;
  color: var(--text);
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.ghost-button:hover,
.ghost-link:hover,
.primary-button:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.32);
}

.primary-button {
  padding: 11px 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06101c;
  font-weight: 800;
}

.hero-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 32px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 28px;
  align-items: center;
  min-height: 300px;
  padding: clamp(28px, 5vw, 58px);
  overflow: hidden;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h2, h3, p { margin-top: 0; }

h2 {
  max-width: 820px;
  margin-bottom: 18px;
  font-size: clamp(2.15rem, 5.4vw, 5.4rem);
  letter-spacing: -0.08em;
  line-height: 0.93;
}

h3 {
  margin-bottom: 16px;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
}

.lede {
  max-width: 660px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.1rem;
}

.status-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 172px;
  height: 172px;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(40, 215, 255, 0.25), rgba(139, 92, 246, 0.12) 48%, rgba(255,255,255,0.04));
}

.status-orb strong {
  font-size: 2.4rem;
  letter-spacing: -0.08em;
}

.status-orb small {
  color: var(--muted);
  transform: translateY(-22px);
}

.pulse {
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(62, 229, 143, 0.7);
  border-radius: 50%;
  animation: breathe 2.4s infinite ease-in-out;
}

@keyframes breathe {
  0%, 100% { transform: scale(0.96); opacity: 0.45; }
  50% { transform: scale(1.08); opacity: 1; }
}

.grid {
  display: grid;
  grid-template-columns: 1.5fr 0.9fr;
  gap: 18px;
  margin-top: 18px;
}

.panel {
  padding: 24px;
}

.panel.wide {
  grid-row: span 2;
}

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.experiment-list {
  display: grid;
  gap: 12px;
}

.experiment-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.055);
  transition: transform 160ms ease, background 160ms ease;
}

.experiment-card:hover {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.09);
}

.experiment-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(139, 92, 246, 0.18);
}

.experiment-card h4 {
  margin: 0 0 3px;
}

.experiment-card p {
  margin: 0;
  color: var(--muted);
}

.badge {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(62, 229, 143, 0.12);
  color: var(--good);
  font-size: 0.78rem;
  font-weight: 800;
}

.spec-list {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.spec-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.spec-list span { color: var(--muted); }
.spec-list strong { text-align: right; }

.accent-panel {
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.88), rgba(40, 215, 255, 0.32));
}

.accent-panel p:not(.eyebrow) {
  color: rgba(255, 255, 255, 0.86);
}

.light {
  justify-self: start;
  background: rgba(255, 255, 255, 0.18);
}

.ride-cost-panel {
  border-color: rgba(62, 229, 143, 0.35);
  background: linear-gradient(145deg, rgba(12, 31, 27, 0.92), rgba(18, 24, 42, 0.78));
}

.ride-cost-value {
  margin: 8px 0 8px;
  color: var(--good);
  font-size: clamp(2.5rem, 7vw, 4.8rem);
  font-weight: 900;
  letter-spacing: -0.08em;
  line-height: 0.95;
}

.ride-cost-meta {
  margin: 0;
  color: var(--muted);
}

.ride-log-panel {
  border-color: rgba(40, 215, 255, 0.32);
}

.ride-log {
  display: grid;
  gap: 10px;
  max-height: 330px;
  overflow: auto;
  padding-right: 4px;
}

.ride-log-empty {
  margin: 0;
  color: var(--muted);
}

.ride-log-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
}

.ride-log-item strong,
.ride-log-item span,
.ride-log-item small {
  display: block;
}

.ride-log-item span,
.ride-log-item small {
  color: var(--muted);
}

.ride-log-item small {
  grid-column: 1 / -1;
  font-size: 0.78rem;
}

.ride-log-price {
  color: var(--good);
  font-size: 1.55rem;
  font-weight: 900;
}

.sales-panel {
  border-color: rgba(255, 207, 90, 0.38);
  background: linear-gradient(145deg, rgba(39, 31, 12, 0.92), rgba(18, 24, 42, 0.78));
}

.sales-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.sales-metric {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.06);
}

.sales-metric span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sales-metric strong {
  display: block;
  color: #ffcf5a;
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 950;
  letter-spacing: -0.08em;
  line-height: 0.95;
}

.sales-meta {
  margin: 14px 0 0;
  color: var(--muted);
}

.map-panel {
  grid-column: 1 / -1;
  border-color: rgba(40, 215, 255, 0.38);
  background: linear-gradient(145deg, rgba(8, 24, 38, 0.94), rgba(18, 24, 42, 0.78));
}

.map-heading {
  align-items: center;
}

.map-status {
  padding: 9px 12px;
  border: 1px solid rgba(40, 215, 255, 0.34);
  border-radius: 999px;
  color: #28d7ff;
  background: rgba(40, 215, 255, 0.11);
  font-size: 0.86rem;
  font-weight: 800;
}

.customer-map {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  background: #dde7da;
  touch-action: none;
}

.rider-map-shell {
  margin: 12px 0;
  min-height: 360px;
}

.rider-map-shell .customer-map {
  min-height: 360px;
}

.map-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #334155;
  background:
    radial-gradient(circle at 30% 20%, rgba(62, 229, 143, 0.18), transparent 34%),
    linear-gradient(135deg, #dbeafe, #dcfce7);
  font-weight: 900;
  text-align: center;
}

.static-map-tiles,
.static-map-tile,
.static-rider-marker {
  position: absolute;
}

.static-map-tiles {
  inset: 0;
  transform-origin: center center;
  will-change: transform;
}

.static-map-tile {
  width: 256px;
  height: 256px;
}

.static-rider-marker {
  z-index: 50;
  left: 50%;
  top: 50%;
  width: 76px;
  height: 76px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.account-dialog {
  width: min(420px, calc(100% - 28px));
  border: 0;
  border-radius: 24px;
  padding: 0;
  color: #eef3ff;
  background: transparent;
}

.account-dialog::backdrop {
  background: rgba(3, 7, 18, 0.72);
  backdrop-filter: blur(5px);
}

.account-card {
  display: grid;
  gap: 12px;
  padding: 20px;
  border: 1px solid rgba(62, 229, 143, 0.62);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(8, 20, 34, 0.98), rgba(20, 29, 50, 0.98));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.account-card[hidden] {
  display: none;
}

.account-card h2 {
  margin: 0;
  font-size: 1.8rem;
  letter-spacing: -0.05em;
}

.account-card p {
  margin: 0;
  color: #cbd5e1;
  font-weight: 700;
}

.account-card label {
  display: grid;
  gap: 6px;
  color: #e2e8f0;
  font-weight: 900;
}

.optional-label {
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 800;
}

.account-card input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.38);
  border-radius: 14px;
  color: #0f172a;
  background: #f8fafc;
  font: inherit;
  font-weight: 800;
}

.account-error {
  min-height: 1.2em;
  color: #fecaca !important;
}

#accountSaveButton,
#accountCancelButton {
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 950;
}

#accountSaveButton {
  color: #052e16;
  background: #3ee58f;
}

#accountCancelButton {
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.24);
}

.customer-map-shell {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: #dde7da;
}

.customer-map .leaflet-control-attribution,
.customer-map .leaflet-control-zoom a {
  color: #0f172a;
}

.customer-map .leaflet-marker-icon {
  border-radius: 999px;
}

.map-details {
  position: absolute;
  z-index: 500;
  top: 10px;
  left: 10px;
  right: 10px;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(17, 24, 39, 0.88);
  pointer-events: none;
  text-align: center;
}

.map-details strong {
  color: #fff;
  font-size: 1.2rem;
  line-height: 1.18;
}

.map-details span {
  font-size: 0.82rem;
}

.map-note-overlay {
  position: absolute;
  z-index: 650;
  right: 10px;
  bottom: 10px;
  width: min(270px, calc(100% - 20px));
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 16px;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.22);
}

.map-note-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.map-note-header button,
.show-map-note-button {
  padding: 7px 10px;
  border-radius: 999px;
  color: #eaf2ff;
  background: #111827;
  font-weight: 900;
}

.map-note-overlay textarea {
  width: 100%;
  min-height: 58px;
  resize: vertical;
  padding: 8px 10px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 12px;
  font: inherit;
  font-size: 0.86rem;
}

.show-map-note-button {
  position: absolute;
  z-index: 650;
  right: 10px;
  bottom: 10px;
}

.ride-request-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px;
  border-radius: 14px;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.16);
}

.share-location-button,
.request-ride-button,
.cancel-ride-button,
.end-ride-button {
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 900;
}

.share-location-button {
  color: #dff7ff;
  background: #2563eb;
}

.request-ride-button {
  color: #052e16;
  background: #3ee58f;
}

.cancel-ride-button {
  color: #fff;
  background: #dc2626;
}

.end-ride-button {
  color: #fff7ed;
  background: #b45309;
}

.share-location-button:disabled,
.request-ride-button:disabled,
.cancel-ride-button:disabled,
.end-ride-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

#rideRequestStatus {
  min-width: 0;
  font-size: 0.86rem;
  font-weight: 700;
}

.chat-panel {
  margin: 0 0 12px;
  border-radius: 16px;
  overflow: hidden;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.12);
}

.chat-tab {
  width: 100%;
  padding: 10px 14px;
  color: #eaf2ff;
  background: #111827;
  font-weight: 900;
  text-align: left;
}

.chat-body {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.chat-messages {
  max-height: 150px;
  overflow-y: auto;
  display: grid;
  gap: 8px;
}

.chat-message {
  max-width: 86%;
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 14px;
  background: #e2e8f0;
}

.chat-message.from-customer {
  justify-self: end;
  color: #052e16;
  background: #bbf7d0;
}

.chat-message.from-driver {
  justify-self: start;
  color: #172554;
  background: #dbeafe;
}

.chat-message strong,
.chat-message small {
  font-size: 0.7rem;
  opacity: 0.75;
}

.chat-message span {
  font-size: 0.86rem;
  font-weight: 750;
}

.chat-empty {
  color: #475569;
  font-size: 0.82rem;
  font-weight: 700;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.chat-form input {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 999px;
  color: #111827;
  caret-color: #111827;
  background: #fff;
  font: inherit;
}

.chat-form button {
  padding: 10px 14px;
  border-radius: 999px;
  color: #052e16;
  background: #3ee58f;
  font-weight: 900;
}

.billing-toast {
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: grid;
  place-items: start center;
  padding: max(18px, env(safe-area-inset-top)) 14px 14px;
  background: rgba(3, 7, 18, 0.34);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.billing-toast.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.billing-toast-card {
  width: min(430px, 100%);
  padding: 18px;
  border: 1px solid rgba(62, 229, 143, 0.62);
  border-radius: 24px;
  color: #eef3ff;
  background: linear-gradient(145deg, rgba(8, 20, 34, 0.97), rgba(20, 29, 50, 0.97));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55), 0 0 0 6px rgba(62, 229, 143, 0.10);
}

.billing-toast-topline {
  color: #3ee58f;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.billing-toast h2 {
  margin: 6px 0 8px;
  font-size: 1.9rem;
  letter-spacing: -0.06em;
}

.billing-toast p {
  margin-bottom: 14px;
  color: #cbd5e1;
  font-weight: 700;
}

.billing-toast-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#billingToastAmount {
  color: #ffcf5a;
  font-size: 2rem;
  font-weight: 950;
}

#billingToastClose {
  min-width: 96px;
  padding: 12px 16px;
  border-radius: 999px;
  color: #052e16;
  background: #3ee58f;
  font-weight: 950;
}

@media (max-width: 800px) {
  html,
  body {
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .app-shell {
    width: 100%;
    min-height: 100svh;
    padding: 8px;
    display: flex;
    flex-direction: column;
  }

  .topbar {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
  }

  .topbar h1 {
    margin: 0;
    font-size: 1.8rem;
    letter-spacing: -0.06em;
  }

  .device-pill,
  .ghost-button,
  .hero-card {
    display: none;
  }

  main,
  .grid {
    min-height: 0;
  }

  main {
    flex: 1;
    min-height: 0;
  }

  .grid {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto minmax(360px, 60svh);
    gap: 8px;
    margin-top: 0;
  }

  .panel {
    min-width: 0;
    padding: 10px;
    border-radius: 18px;
  }

  .panel h3 {
    margin-bottom: 8px;
    font-size: 1rem;
  }

  .eyebrow {
    margin-bottom: 4px;
    font-size: 0.64rem;
  }

  .sales-grid {
    gap: 8px;
  }

  .sales-metric {
    padding: 10px;
    border-radius: 14px;
  }

  .sales-metric span {
    margin-bottom: 4px;
    font-size: 0.66rem;
  }

  .sales-metric strong {
    font-size: 1.8rem;
  }

  .sales-meta {
    margin-top: 8px;
    font-size: 0.78rem;
  }

  .ride-cost-panel,
  .ride-log-panel,
  .sales-panel {
    min-height: 0;
  }

  .ride-cost-value {
    font-size: 1.85rem;
  }

  .ride-cost-meta,
  .sales-meta {
    margin-bottom: 0;
  }

  .ride-log {
    max-height: 72px;
    overflow: auto;
  }

  .ride-log-item {
    padding: 7px;
    border-radius: 12px;
  }

  .map-panel {
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
  }

  .map-heading {
    display: block;
    margin-bottom: 8px;
  }

  .map-status {
    display: none;
  }

  .customer-map {
    min-height: 0;
    height: 100%;
    border-radius: 16px;
  }

  .customer-map-shell {
    min-height: 0;
    height: 100%;
    min-height: 360px;
    border-radius: 16px;
  }

  .map-details {
    top: 8px;
    left: 8px;
    right: 8px;
    padding: 8px 10px;
    gap: 3px;
    font-size: 0.76rem;
  }

  .map-details strong,
  .map-details span {
    width: 100%;
    white-space: normal;
    overflow: hidden;
  }

  .map-details strong {
    font-size: 1rem;
  }

  .ride-request-card {
    grid-template-columns: 1fr;
    gap: 5px;
    margin-bottom: 8px;
    padding: 8px;
  }

  .share-location-button,
  .request-ride-button,
  .cancel-ride-button,
  .end-ride-button {
    width: 100%;
    padding: 9px 12px;
  }

  #rideRequestStatus {
    text-align: center;
    font-size: 0.74rem;
  }
}
.topbar-actions {
  grid-column: 3;
  justify-self: end;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.menu-button {
  width: fit-content;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #06101c;
  background: linear-gradient(135deg, var(--accent-2), var(--good));
  backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
  font-weight: 900;
  transition: transform 160ms ease, border-color 160ms ease, filter 160ms ease;
}

.menu-button:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.32);
}

body.dashboard-panels-hidden .ride-cost-panel,
body.dashboard-panels-hidden .ride-log-panel,
body.dashboard-panels-hidden .sales-panel {
  display: none;
}

body.dashboard-panels-hidden .grid {
  grid-template-columns: 1fr;
}

body.dashboard-panels-hidden .map-panel {
  grid-column: 1 / -1;
}

@media (max-width: 800px) {
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    justify-content: stretch;
  }

  .topbar h1 {
    justify-self: start;
  }

  .topbar-actions {
    justify-self: end;
    gap: 0;
  }

  .menu-button {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 12px;
    font-size: 0.82rem;
  }

  body.dashboard-panels-hidden .grid {
    grid-template-rows: minmax(520px, calc(100svh - 64px));
  }
}

@media (max-width: 800px) {
  body.rider-native {
    height: 100svh;
    max-height: 100svh;
    overflow: hidden;
  }

  body.rider-native .rider-native-shell,
  body.rider-native .rider-home {
    min-height: 0;
    max-height: 100svh;
    overflow: hidden;
  }
}

.google-sign-in { display:flex; align-items:center; justify-content:center; gap:0.7rem; width:100%; padding:0.8rem; border:1px solid #cbd5e1; border-radius:0.6rem; background:#fff; color:#1f2937; font:inherit; font-weight:600; cursor:pointer; }
.google-sign-in span { color:#4285f4; font-size:1.3rem; font-weight:700; }
.auth-divider { text-align:center; font-size:0.85rem; }
