:root {
  color-scheme: light;
  --bg: #0f1115;
  --text: #0d0f14;
  --muted: rgba(13, 15, 20, 0.62);
  --border: rgba(13, 15, 20, 0.12);
  --surface: rgba(255, 255, 255, 0.96);
  --primary: #ffd400;
  --primaryText: #111;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial,
    "Noto Sans", "Liberation Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}

.map {
  position: fixed;
  inset: 0;
}

.topbar {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  z-index: 1000;
}

.brand {
  font-weight: 800;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status {
  font-size: 12px;
  color: var(--muted);
}

.toastHost {
  position: fixed;
  left: 12px;
  right: 12px;
  top: 74px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: none;
  padding: 12px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
}

.toastTitle {
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 2px;
}

.toastSub {
  font-size: 13px;
  color: var(--muted);
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  border: 1px solid var(--border);
  border-bottom: 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.18);
  z-index: 1000;
  will-change: transform;
  transition: transform 180ms ease;
}

.sheet.dragging {
  transition: none;
}

.grab {
  width: 120px;
  height: 26px;
  background: transparent;
  border-radius: 999px;
  margin: 6px auto 0;
  cursor: grab;
  touch-action: none;
  position: relative;
}

.grab::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 46px;
  height: 5px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 999px;
}

.sheetInner {
  padding: 12px 14px 18px;
  max-width: 720px;
  margin: 0 auto;
}

.addr {
  display: grid;
  gap: 10px;
}

.field {
  display: grid;
  grid-template-columns: 16px 1fr;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.04);
}

.inputWrap {
  position: relative;
}

.locBtn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 10px;
  border-radius: 12px;
  font-weight: 900;
}

.inputWrap input {
  padding-right: 62px;
}

.suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  z-index: 2000;
  display: none;
}

.suggest.open {
  display: block;
}

.suggestItem {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  cursor: pointer;
  font-size: 14px;
}

.suggestItem:last-child {
  border-bottom: 0;
}

.suggestItem:hover {
  background: rgba(0, 0, 0, 0.04);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.dotA {
  background: #28a745;
}

.dotB {
  background: #111;
}

input {
  width: 100%;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 15px;
}

.priceInput {
  max-width: 140px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
}

.tariffs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.tariff {
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.04);
  cursor: pointer;
  font-weight: 700;
}

.tariff.active {
  background: var(--primary);
  border-color: rgba(0, 0, 0, 0.12);
}

.primary {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: var(--primary);
  color: var(--primaryText);
  cursor: pointer;
  font-weight: 900;
}

.ghost {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  color: inherit;
}

.topNav {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
}

.topNav .ghost {
  border-color: transparent;
  background: transparent;
  font-weight: 900;
  padding: 8px 12px;
}

.topNav .ghost:hover {
  background: rgba(0, 0, 0, 0.04);
}

.topNav .ghost.active {
  background: var(--primary);
  border-color: rgba(0, 0, 0, 0.12);
}

.menuRow {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
}

.icon svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
}

.price {
  font-weight: 900;
  font-size: 18px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.orders {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  max-height: 220px;
  overflow: auto;
  padding-right: 4px;
}

.order {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 6px;
  background: rgba(0, 0, 0, 0.03);
}

.orderRed {
  border-color: rgba(231, 76, 60, 0.55);
  background: rgba(231, 76, 60, 0.12);
}

.orderYellow {
  border-color: rgba(255, 212, 0, 0.65);
  background: rgba(255, 212, 0, 0.18);
}

.orderGreen {
  border-color: rgba(40, 167, 69, 0.55);
  background: rgba(40, 167, 69, 0.14);
}

.orderCardY {
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
}

.orderTop {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.orderId {
  font-weight: 900;
}

.orderRoute {
  margin-top: 4px;
  font-weight: 800;
  line-height: 1.2;
}

.orderRoute .arrow {
  color: var(--muted);
  font-weight: 900;
}

.orderMeta {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.05);
  color: #111;
  white-space: nowrap;
}

.chipRed {
  background: rgba(255, 59, 48, 0.14);
  border-color: rgba(255, 59, 48, 0.25);
}

.chipYellow {
  background: rgba(255, 204, 0, 0.18);
  border-color: rgba(255, 204, 0, 0.3);
}

.chipGreen {
  background: rgba(52, 199, 89, 0.14);
  border-color: rgba(52, 199, 89, 0.25);
}

.chipBlue {
  background: rgba(10, 132, 255, 0.14);
  border-color: rgba(10, 132, 255, 0.25);
}

.chipGray {
  background: rgba(142, 142, 147, 0.14);
  border-color: rgba(142, 142, 147, 0.25);
}

.orderActions {
  margin-top: 8px;
}

.orderActions .row {
  gap: 8px;
}

.orderActions button {
  padding: 9px 12px;
  border-radius: 14px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
  margin: 14px 0 10px;
}

.hidden {
  display: none;
}

.statusCard {
  margin-top: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.04);
  padding: 12px;
}

/* Client status coloring */
#statusCard.statusOffered,
#statusCard.statusAssigned {
  background: rgba(255, 204, 0, 0.18);
  border-color: rgba(255, 204, 0, 0.35);
}

#statusCard.statusEnRoute {
  background: rgba(10, 132, 255, 0.14);
  border-color: rgba(10, 132, 255, 0.28);
}

#statusCard.statusArrived {
  background: rgba(52, 199, 89, 0.14);
  border-color: rgba(52, 199, 89, 0.25);
}

.statusTitle {
  font-weight: 900;
  font-size: 16px;
}

.statusSub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.offers {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.offers.hidden {
  display: none;
}

.offerItem {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.04);
  padding: 10px 10px;
}

.offerTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.offerDriver {
  font-weight: 900;
  font-size: 14px;
}

.offerCar {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.offerPrice {
  font-weight: 900;
}

.taxiDivIcon {
  background: transparent;
  border: none;
}

.taxiPin {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.22));
  transform: rotate(var(--rot, 0deg));
  transform-origin: 50% 50%;
}

.taxiPin svg {
  display: block;
}

body.driverCompact .hideWhenCompact {
  display: none !important;
}

#myOrdersWrap {
  display: none !important;
}

body.driverShowMine #myOrdersWrap {
  display: block !important;
}

body.clientCompact .hideWhenClientCompact {
  display: none;
}

#driverActions {
  margin-top: 10px;
}

#driverMiniCard {
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.82);
  padding: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
}

body.driverCompact #driverMiniCard {
  background: rgba(255, 255, 255, 0.92);
}

#driverMiniCard #driverTripLine {
  margin-top: 8px;
  font-weight: 800;
  color: #111;
}

body.driverCompact #driverMiniCard #driverClientPhone {
  font-weight: 700;
}

/* Status button feedback (driver) */
button.ghost.statusPending {
  background: rgba(255, 204, 0, 0.22);
  border-color: rgba(255, 204, 0, 0.4);
}

button.ghost.statusActive {
  background: rgba(52, 199, 89, 0.18);
  border-color: rgba(52, 199, 89, 0.35);
}

@media (max-width: 720px) {
  .topbar {
    top: 10px;
    left: 10px;
    right: 10px;
  }
}
