:root {
  --bg: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #f5b800;
  --green: #16a34a;
  --red: #dc2626;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: #e5e7eb;
  overscroll-behavior: none;
}

#map { position: fixed; inset: 0; z-index: 0; }

#topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(env(safe-area-inset-top) + 10px) 14px 10px;
  pointer-events: none;
}
#topbar > * { pointer-events: auto; }
.brand {
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
#installBtn {
  border: 0;
  background: var(--brand);
  color: var(--ink);
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

#sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 600;
  max-height: 75vh;
  overflow-y: auto;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  padding: 8px 16px calc(env(safe-area-inset-bottom) + 16px);
  box-shadow: 0 -6px 24px rgba(0,0,0,.18);
  max-width: 560px;
  margin: 0 auto;
}
.grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 12px; }
h2 { margin: 0 0 12px; font-size: 20px; }
.muted { color: var(--muted); font-size: 14px; }

.field {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f3f4f6;
  border-radius: 12px;
  padding: 0 12px;
  margin-bottom: 8px;
}
.field input {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 16px;
  padding: 14px 0;
  outline: none;
  color: var(--ink);
}
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.green { background: var(--green); }
.dot.red { background: var(--red); }

.list { list-style: none; margin: 8px 0 0; padding: 0; }
.list li {
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.list li b { display: block; font-size: 15px; }
.list li span { font-size: 13px; color: var(--muted); }

.row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; }
.row + .row { border-top: 1px solid var(--line); }
.fare { font-size: 28px; font-weight: 800; }

.btn {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 15px;
  font-size: 16px;
  font-weight: 700;
  background: var(--brand);
  color: var(--ink);
  margin-top: 12px;
}
.btn.ghost { background: #f3f4f6; }
.btn.danger { background: #fee2e2; color: var(--red); }

.driver { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--brand);
  display: grid; place-items: center;
  font-size: 22px; flex: none;
}
.otp {
  background: var(--ink); color: #fff;
  border-radius: 10px; padding: 6px 12px;
  font-weight: 800; letter-spacing: 3px;
}
.status-pill {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  font-size: 13px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
  margin-bottom: 8px;
}
.pulse { animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .4; } }

.stars { display: flex; justify-content: center; gap: 6px; margin: 10px 0; }
.stars button { border: 0; background: none; font-size: 34px; color: #d1d5db; padding: 0; }
.stars button.on { color: var(--brand); }

.pin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.4); }
.pin.pickup { background: var(--green); }
.pin.drop { background: var(--red); }
.pin.driver { background: var(--ink); }

#toast {
  position: fixed;
  top: 70px; left: 50%;
  transform: translateX(-50%);
  z-index: 700;
  background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: 10px;
  font-size: 14px;
}

/* ---- Login, profile, history ---- */
#topbar .actions { display: flex; gap: 8px; align-items: center; }
.round {
  width: 38px; height: 38px; border-radius: 50%; border: 0;
  background: #fff; font-size: 18px; box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.field .prefix { color: var(--muted); font-weight: 600; }
.field input.otp-input { letter-spacing: 8px; font-size: 22px; font-weight: 700; }
.hint { font-size: 13px; color: var(--muted); margin: 6px 2px; }
.hint.dev { background: #fef3c7; color: #92400e; padding: 6px 10px; border-radius: 8px; }
.linkbtn { border: 0; background: none; color: #2563eb; font-weight: 600; font-size: 14px; padding: 10px 0; }
.btn[disabled] { opacity: .55; }
.list li.action b { color: #2563eb; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #e5e7eb; text-transform: capitalize; }
.tag.completed { background: #dcfce7; color: #166534; }
.tag.cancelled, .tag.no_driver { background: #fee2e2; color: #991b1b; }
.tag.searching, .tag.assigned, .tag.in_progress { background: #fef3c7; color: #92400e; }
.history li { display: flex; justify-content: space-between; gap: 12px; cursor: default; }
.history li div:last-child { text-align: right; white-space: nowrap; }
.notice { background: #fff7ed; color: #9a3412; border-radius: 10px; padding: 8px 12px; font-size: 13px; margin: 8px 0 0; }
.leaflet-container { font: inherit; }
