/* Map-first layout for the customer and partner apps (ride-hailing style):
   full-screen map, floating controls on top, one bottom sheet for the current step. */
.mapapp { position: fixed; inset: 0; overflow: hidden; background: var(--bg); }
.mapapp #map { position: absolute; inset: 0; z-index: 0; }
.leaflet-container { font: inherit; background: #e9ecef; }
.leaflet-tile-pane { filter: saturate(.55) contrast(1.02); }
@media (prefers-color-scheme: dark) {
  .leaflet-container { background: #1b1f24; }
  .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9) saturate(.4); }
}

.float-top { position: absolute; top: 12px; left: 12px; right: 12px; z-index: 500; display: flex; gap: 8px; align-items: center; pointer-events: none; }
.float-top > * { pointer-events: auto; }
.float-top .spacer { flex: 1; pointer-events: none; }
.fab {
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--card); color: var(--ink);
  box-shadow: 0 2px 10px rgba(0,0,0,.18); display: grid; place-items: center; font-size: 1.15rem; flex: none;
}
.chip-float {
  background: var(--card); color: var(--ink); border: 0; border-radius: 999px; padding: 10px 14px; font-weight: 700; font-size: .88rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.18); white-space: nowrap;
}
.chip-float.chip-sos { background: var(--sos); color: #fff; }

/* compact chips for the request sheet, so the map (and the pin) stay visible */
.opt.compact { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: none; padding: 9px 12px; }
.opt.compact .ic { font-size: 1.1rem; margin: 0; }
.opt.compact strong { white-space: nowrap; }
.chip-float.online { background: var(--ok); color: #fff; }

/* bottom sheet */
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 600;
  max-width: 560px; margin: 0 auto; max-height: 80vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--card); border-radius: 22px 22px 0 0; box-shadow: 0 -6px 30px rgba(0,0,0,.18);
  padding: 8px 18px calc(18px + env(safe-area-inset-bottom));
}
.sheet::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 2px auto 12px; }
.sheet h1 { font-size: 1.3rem; letter-spacing: -.01em; }
.sheet .big { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin-bottom: 4px; }
.hr { height: 1px; background: var(--line); margin: 14px -18px; }

/* black primary CTA */
.cta { display: flex; width: 100%; align-items: center; justify-content: center; gap: 8px; padding: 15px; border: 0; border-radius: 12px;
  background: #111; color: #fff; font-weight: 800; font-size: 1rem; text-decoration: none; }
@media (prefers-color-scheme: dark) { .cta { background: #fff; color: #111; } }
.cta:disabled { opacity: .4; cursor: not-allowed; }
.cta.ok { background: var(--ok); color: #fff; }
.cta.sos { background: var(--sos); color: #fff; }
.cta.secondary { background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
.cta-row { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }

/* horizontal choosers */
.hscroll { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -2px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.opt {
  flex: none; min-width: 108px; max-width: 150px; text-align: left; padding: 11px 12px; border-radius: 12px;
  border: 2px solid transparent; background: var(--bg); color: var(--ink);
}
.opt .ic { font-size: 1.3rem; display: block; margin-bottom: 4px; }
.opt strong { display: block; font-size: .86rem; line-height: 1.2; }
.opt .small { color: var(--muted); }
.opt.on { border-color: var(--ink); background: var(--card); }
.seg { display: inline-flex; background: var(--bg); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 999px; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.12); }

.where { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; background: var(--bg); }
.where .dot { width: 10px; height: 10px; border-radius: 2px; background: var(--ink); flex: none; }
.where input { border: 0; background: transparent; padding: 0; font-weight: 600; }
.where input:focus { outline: none; }

/* centre pin for choosing where the vehicle is */
.center-pin { position: absolute; left: 50%; top: 38%; z-index: 450; /* top is set from JS to the visible map's middle */ transform: translate(-50%, -100%); pointer-events: none; }
.center-pin .head { width: 22px; height: 22px; border-radius: 50%; background: #111; border: 6px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); margin: 0 auto; transition: transform .15s; }
.center-pin .stem { width: 3px; height: 16px; background: #111; margin: 0 auto; }
.center-pin .label { position: absolute; bottom: 46px; left: 50%; transform: translateX(-50%); background: #111; color: #fff;
  padding: 6px 10px; border-radius: 8px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.center-pin.lift .head { transform: translateY(-8px); }

/* map markers */
.mk { display: grid; place-items: center; border-radius: 50%; box-shadow: 0 2px 8px rgba(0,0,0,.35); font-size: 15px; }
.mk.mech { width: 34px; height: 34px; background: #111; color: #fff; border: 2px solid #fff; }
.mk.mech.me { background: var(--brand); }
.mk.mech.off { background: #8a919c; }
.mk.job { width: 20px; height: 20px; background: #111; border: 5px solid #fff; border-radius: 4px; }
.mk.job.sos { background: var(--sos); }
.mk.dot { width: 16px; height: 16px; border: 3px solid #fff; }
.leaflet-marker-icon.glide { transition: transform 1.8s linear; }
.leaflet-zoom-anim .leaflet-marker-icon.glide { transition: none; }

.pulse { position: absolute; left: 50%; top: 38%; z-index: 440; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--brand); pointer-events: none; }
.pulse::before, .pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--brand); animation: ring 2s ease-out infinite; }
.pulse::after { animation-delay: 1s; }
@keyframes ring { from { transform: scale(1); opacity: .5; } to { transform: scale(14); opacity: 0; } }

.searchbar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; margin: 12px 0; }
.searchbar span { display: block; height: 100%; width: 35%; background: var(--ink); border-radius: 2px; animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
@media (prefers-reduced-motion: reduce) { .pulse::before, .pulse::after, .searchbar span { animation: none; } }

/* person card */
.person { display: flex; gap: 12px; align-items: center; }
.person .avatar { width: 54px; height: 54px; font-size: 1.1rem; background: var(--ink); color: var(--bg); }
.person .meta { flex: 1; min-width: 0; }
.person .meta strong { font-size: 1.05rem; }
.iconbtn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--bg); color: var(--ink); display: grid; place-items: center; font-size: 1.1rem; text-decoration: none; flex: none; }
.stars { display: flex; justify-content: center; gap: 6px; margin: 8px 0 14px; }
.stars button { background: none; border: 0; font-size: 2.4rem; color: var(--line); padding: 0; line-height: 1; }
.stars button.on { color: #f5a623; }

/* drawer */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 900; }
.drawer { position: fixed; top: 0; bottom: 0; left: 0; width: min(360px, 88vw); z-index: 901; background: var(--card); overflow-y: auto; padding: 20px 18px; box-shadow: 4px 0 30px rgba(0,0,0,.25); }
.drawer .item { display: block; width: 100%; text-align: left; padding: 14px 0; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); font-weight: 600; font-size: 1rem; }

/* incoming request (partner side) */
.ring { --p: 100; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; flex: none;
  background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--line) 0); }
.ring span { width: 46px; height: 46px; border-radius: 50%; background: var(--card); display: grid; place-items: center; }
.go { width: 84px; height: 84px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; font-weight: 900; font-size: 1.3rem;
  box-shadow: 0 6px 24px rgba(240,90,26,.45); margin: 4px auto 10px; display: grid; place-items: center; }
.stat-row { display: flex; gap: 18px; }
.stat-row > div { flex: 1; }
.stat-row .v { font-weight: 800; font-size: 1.15rem; }
.stat-row .k { font-size: .75rem; color: var(--muted); }

/* inspection report */
.check { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: 0; }
.check .note { grid-column: 1 / -1; }
.check .note input { padding: 8px 10px; font-size: .88rem; }
.tri { display: inline-flex; gap: 4px; }
.tri button { border: 1.5px solid var(--line); background: var(--card); color: var(--muted); border-radius: 8px; padding: 5px 8px; font-size: .78rem; font-weight: 700; }
.tri button.on.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.tri button.on.attention { background: #d98a00; border-color: #d98a00; color: #fff; }
.tri button.on.urgent { background: var(--bad); border-color: var(--bad); color: #fff; }
.res { font-size: .75rem; font-weight: 800; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.res.ok { background: var(--ok-soft); color: var(--ok); }
.res.attention { background: var(--warn-soft); color: var(--warn); }
.res.urgent { background: var(--bad-soft); color: var(--bad); }
.report-sum { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 10px; }
