:root {
  color-scheme: dark;
  font-family: "Inter", "Avenir Next", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #e8eaec;
  background: #0c0d0f;
  font-synthesis: none;
  line-height: 1.5;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input { font: inherit; }
button, input { touch-action: manipulation; }

main {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
}

.driver-profile-button {
  position: fixed;
  z-index: 1200;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  width: 52px;
  height: 52px;
  padding: 2px;
  border: 1px solid #34393d;
  border-radius: 50%;
  background: #141618;
  box-shadow: 0 4px 16px #00000066;
  cursor: pointer;
}
.driver-profile-button img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.driver-profile-button:hover { border-color: #a4abb1; }
.driver-profile-button:focus-visible { outline: 3px solid #e8eaec; outline-offset: 3px; }
.map-screen[inert] { visibility: hidden; }
.driver-profile {
  min-height: 100vh;
  min-height: 100svh;
  padding: max(28px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  background: #141618;
}
.driver-profile-content {
  display: flex;
  flex-direction: column;
  min-height: calc(100svh - max(28px, env(safe-area-inset-top)) - max(24px, env(safe-area-inset-bottom)));
  max-width: 520px;
  margin: 0 auto;
}
.driver-profile-label { margin: 0 0 12px; color: #a4abb1; text-align: center; }
.driver-profile-details { margin: 0 0 24px; text-align: center; }
.driver-profile h1 { margin: 0 0 4px; font-size: clamp(2.25rem, 8vw, 3rem); line-height: 1.2; }
.driver-profile-model { margin: 0; color: #a4abb1; font-size: 1.125rem; }
.driver-profile-plate { margin: 4px 0 0; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 1.25rem; font-weight: 600; }
.driver-profile-photo { display: block; flex-shrink: 0; width: min(180px, 55vw); height: auto; aspect-ratio: 1; margin: 0 auto; border: 3px solid #34393d; border-radius: 50%; object-fit: cover; }
.driver-profile-vehicle { position: relative; display: block; width: 100%; max-width: 360px; height: auto; margin: -28px auto 16px; }
.driver-profile-bio {
  display: grid;
  gap: 14px;
  margin: 0 0 24px;
  padding: 18px;
  list-style: none;
  background: #1b1e21;
  border: 1px solid #2d3134;
  border-radius: 14px;
}
.driver-profile-bio li { display: flex; align-items: center; gap: 12px; color: #e8eaec; }
.driver-profile-bio svg { flex: 0 0 20px; width: 20px; height: 20px; fill: currentColor; }
.driver-profile .go-button { margin-top: auto; }

.map-backdrop { position: fixed; inset: 0; background: #171a18; }
.map { position: absolute; inset: 0; }
.map.pinning, .map.pinning * { cursor: crosshair; }
body.pin-mode .booking-sheet { display: none; }
.map-pin { position: relative; display: block; width: 32px; height: 58px; filter: drop-shadow(0 3px 4px #000000a6); }
.pickup-pin { color: #22c55e; }
.dropoff-pin { color: #ef4444; }
.map-pin-label {
  position: absolute; top: calc(100% + 2px); left: 50%; transform: translateX(-50%);
  padding: 1px 6px; border-radius: 6px; background: #0c0d0fcc; color: #fff;
  font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none;
}
.map.pinning .dropoff-pin { cursor: grab; touch-action: none; }
.map.pinning .dropoff-pin:active { cursor: grabbing; }
.map-pin svg { display: block; width: 100%; height: 100%; }
.pin-panel {
  position: absolute;
  z-index: 1000;
  inset: auto 0 0;
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 20px max(20px, env(safe-area-inset-bottom));
  background: #141618;
  border: 1px solid #26292c;
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -16px 48px #00000066;
}
.pin-hint { margin: 0; color: #a4abb1; font-size: 13px; }
.pin-address { min-height: 1.5em; margin: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.pin-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.pin-actions .go-button { min-height: 48px; padding: 10px 16px; }
.map:focus-visible { outline: 3px solid #22c55e; outline-offset: -3px; }
.map-warning {
  position: absolute;
  z-index: 1100;
  top: max(76px, calc(env(safe-area-inset-top) + 64px));
  right: max(12px, env(safe-area-inset-right));
  max-width: min(260px, 75%);
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  color: #e8c08a;
  background: #221c13;
  box-shadow: 0 2px 8px #00000066;
  font-size: 13px;
}

.booking-sheet {
  position: fixed;
  inset: auto 0 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 560px;
  max-height: calc(100svh - 72px);
  margin: 0 auto;
  padding: 12px 20px max(24px, env(safe-area-inset-bottom));
  overflow: hidden;
  overscroll-behavior: contain;
  background: #141618;
  border: 1px solid #26292c;
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -16px 48px #00000066;
}
.sheet-handle {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: grab;
  touch-action: none;
}
.sheet-handle::before { content: ""; width: 44px; height: 5px; border-radius: 999px; background: #626a71; }
.sheet-handle:active { cursor: grabbing; }
.sheet-handle:hover::before { background: #a4abb1; }
.sheet-handle:focus-visible { outline: 3px solid #e8eaec; outline-offset: -3px; }
.sheet-content {
  display: flex;
  flex-direction: column;
  gap: inherit;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.booking-sheet.collapsed { gap: 8px; }
.booking-sheet.collapsed .sheet-content { display: none; }
.collapsed-action-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.collapsed-action-buttons .search-popup-action { justify-content: center; padding: 12px 4px; }
.collapsed-action-buttons .search-popup-action:disabled { cursor: default; opacity: 0.5; }
.trip-greeting {
  min-height: 1.3em;
  margin: 0;
  font-size: clamp(18px, 4.5vw, 24px);
  font-weight: 650;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.trip-details { display: grid; gap: 20px; min-width: 0; margin: 0; padding: 0; border: 0; }
.current-date-time { font-size: clamp(24px, 5vw, 30px); font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.trip-details:disabled input { color: #a4abb1; }
.trip-details:disabled .location-button, .trip-details:disabled .clear-button { cursor: default; opacity: 0.5; }
@media (prefers-reduced-motion: no-preference) {
  .booking-sheet { transition: transform 0.35s ease-out; }
}
.location-field, .search-anchor { position: relative; min-width: 0; }
label { display: block; margin-bottom: 10px; font-size: 15px; font-weight: 650; }
.search-bar {
  display: flex;
  align-items: center;
  min-height: 58px;
  padding-right: 16px;
  background: #1b1e21;
  border: 1px solid #2d3134;
  border-radius: 14px;
}
.pickup-field .search-bar { box-shadow: 0 0 12px #22c55e33; }
.dropoff-field .search-bar { box-shadow: 0 0 12px #f8717133; }
.stops { display: grid; gap: 20px; }
.stops:empty { display: none; }
.add-stop, .location-action {
  justify-self: start;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  color: #a4abb1;
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.add-stop { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; margin-block: -10px; }
.add-stop::before, .add-stop::after { content: ""; flex: 1; height: 1px; background: #626a71; }
.add-stop span { font-size: 24px; }
.location-action { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; }
.add-stop:hover, .location-action:hover { color: #e8eaec; background: #1b1e21; }
.add-stop:focus-visible, .location-action:focus-visible { outline: 3px solid #e8eaec; outline-offset: 3px; }
.search-bar:focus-within { outline: 3px solid #e8eaec; outline-offset: 2px; }
.search-bar:has(input[aria-invalid="true"]) { border: 3px solid #f87171; box-shadow: none; outline: none; }
input { width: 100%; min-width: 0; min-height: 56px; padding: 12px 0; border: 0; outline: none; color: inherit; background: transparent; font-size: 16px; }
input::placeholder { color: #8b9196; opacity: 1; }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
.location-button, .clear-button {
  display: grid;
  place-items: center;
  flex: 0 0 52px;
  width: 52px;
  min-height: 56px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  color: #a4abb1;
  background: transparent;
  cursor: pointer;
}
.location-button:hover { color: #e8eaec; }
.location-button[aria-busy="true"] { cursor: progress; opacity: 0.6; }
.clear-button { flex-basis: 44px; width: 44px; margin-right: -12px; }
.clear-button:hover { color: #e8eaec; }
.location-button svg, .clear-button svg, .search-popup-action svg, .location-action svg { flex-shrink: 0; width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.location-button:focus-visible, .clear-button:focus-visible, .go-button:focus-visible, .secondary-button:focus-visible, .rate-card-toggle:focus-visible, a:focus-visible { outline: 3px solid #e8eaec; outline-offset: 3px; }

.suggestions {
  position: absolute;
  inset: calc(100% + 8px) 0 auto;
  z-index: 1000;
  max-height: min(300px, 40svh);
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #16181a;
  border: 1px solid #2d3134;
  border-radius: 14px;
  box-shadow: 0 12px 32px #000000a6;
}
.suggestion { min-height: 60px; padding: 12px; border-radius: 9px; overflow-wrap: anywhere; cursor: pointer; }
.suggestion:hover, .suggestion[aria-selected="true"] { background: #1c2b21; }
.suggestion strong, .suggestion small { display: block; }
.suggestion strong { font-size: 14px; font-weight: 600; }
.suggestion small { color: #8b9196; font-size: 12px; }
.search-popup-results { margin: 0; padding: 0; list-style: none; }
.search-popup-action {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 12px;
  border: 0;
  border-radius: 9px;
  color: #e8eaec;
  background: transparent;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.search-popup-action:hover { background: #1c2b21; }
.search-popup-action:focus-visible { outline: 3px solid #e8eaec; outline-offset: -3px; }
.search-popup-action[aria-busy="true"] { cursor: progress; opacity: 0.6; }
.search-feedback { margin: 8px 0 0; color: #a4abb1; font-size: 13px; overflow-wrap: anywhere; }

.go-button {
  width: 100%;
  min-height: 58px;
  padding: 16px 24px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: #2563eb;
  font-size: 17px;
  font-weight: 650;
  cursor: pointer;
}
.go-button:hover { background: #1d4ed8; }
.go-button:disabled { color: #9aa0a6; background: #34393d; cursor: default; }
.booking-actions { display: flex; gap: 10px; }
.booking-actions .go-button, .booking-actions .secondary-button { flex: 1; min-width: 0; min-height: 58px; }
.secondary-button { min-height: 44px; padding: 10px 16px; border: 1px solid #34393d; border-radius: 12px; color: #e8eaec; background: #1b1e21; cursor: pointer; }
.secondary-button:disabled { opacity: 0.5; cursor: default; }
.stripe-attribution { display: none; margin: -10px 0 0; color: #a4abb1; font-size: 12px; text-align: center; }
#change-trip:not([hidden]) + .stripe-attribution { display: block; }
.schedule-options { display: grid; gap: 12px; padding: 16px; border: 1px solid #34393d; border-radius: 16px; background: #1b1e21; }
.schedule-details { display: grid; gap: 14px; min-width: 0; margin: 0; padding: 0; border: 0; }
.schedule-details legend { margin-bottom: 12px; font-size: 16px; font-weight: 650; }
.schedule-choice { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.schedule-choice label { display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 0; cursor: pointer; }
.schedule-choice input { width: 20px; min-height: 20px; margin: 0; padding: 0; accent-color: #22c55e; }
.schedule-choice input:focus-visible, .schedule-field input:focus-visible { outline: 3px solid #e8eaec; outline-offset: 3px; }
.schedule-field { min-width: 0; }
.schedule-field label { margin-bottom: 6px; font-size: 14px; }
.schedule-field input { min-height: 48px; padding: 10px 12px; border: 1px solid #34393d; border-radius: 10px; background: #141618; }
.schedule-details:disabled input { color: #a4abb1; }
.schedule-hint { margin: 0; color: #a4abb1; font-size: 12px; }
.payment-section { display: grid; gap: 10px; }
.booking-sheet[data-view="checkout"] .schedule-options { display: none; }
.payment-header { display: grid; gap: 4px; }
.payment-header h1 { margin: 0; font-size: clamp(20px, 5vw, 26px); font-weight: 700; line-height: 1.2; }
.payment-header h1:focus { outline: none; }
.checkout-step { margin: 0; color: #4ade80; font-size: 12px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; }
.checkout-intro { margin: 0; color: #a4abb1; font-size: 14px; }
.payment-trip { padding: 18px; border: 1px solid #34393d; border-radius: 16px; background: #1b1e21; }
.payment-trip h2 { margin: 0 0 12px; color: #e8eaec; font-size: 16px; font-weight: 650; }
.payment-trip-details { display: grid; gap: 10px; margin: 0; font-size: 14px; }
.payment-trip-details > div { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; }
.payment-trip-details dt { color: #a4abb1; }
.payment-trip-details dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.wallet-heading { margin: 6px 0 0; font-size: 16px; font-weight: 650; }
.wallet-status { margin: 0; color: #a4abb1; font-size: 13px; }
.wallet-divider { display: flex; align-items: center; gap: 12px; margin: 4px 0; color: #a4abb1; font-size: 13px; }
.wallet-divider::before, .wallet-divider::after { content: ""; flex: 1; height: 1px; background: #34393d; }
.receipt-field { padding-bottom: 16px; border-bottom: 1px solid #34393d; }
.receipt-field input { padding: 12px; border: 1px solid #34393d; border-radius: 10px; background: #1b1e21; }
.receipt-field input:focus-visible { outline: 3px solid #e8eaec; outline-offset: 3px; }
.receipt-field input[aria-invalid="true"] { border-color: #f87171; }
.fare-summary { padding: 18px; border: 1px solid #34393d; border-radius: 16px; background: #1b1e21; }
.fare-summary-heading { display: flex; align-items: center; gap: 4px; margin-bottom: 12px; }
.fare-summary h2 { margin: 0; color: #e8eaec; font-size: 16px; font-weight: 650; }
.rate-card-toggle { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; color: #a4abb1; background: transparent; cursor: pointer; }
.rate-card-toggle:hover { color: #e8eaec; background: #30363b; }
.rate-card-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fare-details, .rate-details { display: grid; gap: 8px; margin: 0; }
.fare-details > div, .rate-details > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.fare-details dt, .rate-details dt { color: #a4abb1; }
.fare-details dd, .rate-details dd { margin: 0; text-align: right; font-weight: 600; }
.fare-details { font-size: 14px; }
.fare-details .fare-total { padding-bottom: 10px; margin-bottom: 2px; border-bottom: 1px solid #34393d; }
.fare-total dt { color: #e8eaec; font-weight: 600; }
.fare-total dd { color: #fff; font-size: 24px; font-weight: 700; }
.fare-minimum { margin: 10px 0 0; color: #a4abb1; font-size: 12px; }
.rate-card { margin-top: 12px; padding-top: 12px; border-top: 1px solid #34393d; }
.rate-details { padding-bottom: 4px; margin-bottom: 12px; font-size: 13px; }
.rate-card h3 { margin: 0 0 8px; color: #e8eaec; font-size: 13px; font-weight: 650; }
.rate-multipliers { overflow-x: auto; }
.rate-multipliers table { width: 100%; border-collapse: collapse; font-size: 12px; text-align: left; }
.rate-multipliers th, .rate-multipliers td { padding: 6px 8px 6px 0; white-space: nowrap; }
.rate-multipliers th { color: #a4abb1; font-weight: 500; }
.rate-multipliers tbody th { color: #e8eaec; font-weight: 500; }
.rate-note { margin: 8px 0 0; color: #a4abb1; font-size: 12px; line-height: 1.5; }
.form-error, .booking-status, .storage-warning { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.form-error { color: #f87171; }
.booking-status { color: #4ade80; }
.storage-warning { color: #d9a85c; }
.booking-note { margin: 0; color: #8b9196; font-size: 12px; }
.booking-note a { color: inherit; }

@media (min-width: 840px) {
  .booking-sheet { padding: 12px 32px 32px; gap: 24px; }
}

@media (max-height: 500px) {
  .booking-sheet { max-height: 65svh; }
}
