:root {
  --green-900: #0b4838;
  --green-700: #116149;
  --green-100: #dff2ea;
  --ink: #17231f;
  --muted: #68756f;
  --line: #dce4e0;
  --surface: #ffffff;
  --canvas: #f4f7f5;
  --gold: #f3b51b;
  --red: #dc4b3e;
  --shadow: 0 12px 36px rgba(12, 43, 34, 0.14);
  font-family: "Noto Sans Thai", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
.app-shell { min-height: 100dvh; }
body.welcome-open { overflow: hidden; }
.welcome-overlay { position: fixed; z-index: 1800; inset: 0; display: grid; align-items: end; background: rgba(8, 25, 20, .46); }
.welcome-surface { width: 100%; padding: 28px 22px max(24px, env(safe-area-inset-bottom)); border-radius: 8px 8px 0 0; background: var(--surface); box-shadow: 0 -12px 36px rgba(12, 43, 34, .18); }
.welcome-mark { width: 52px; height: 52px; margin-bottom: 18px; }
.welcome-mark svg { width: 27px; height: 27px; }
.welcome-label { display: block; color: var(--green-700); font-size: 11px; font-weight: 700; }
.welcome-surface h1 { margin: 3px 0 3px; font-size: 30px; }
.welcome-surface > p { margin-bottom: 18px; color: var(--muted); font-size: 14px; }
.welcome-availability { min-height: 38px; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--canvas); font-size: 11px; }
.welcome-availability.online { color: var(--green-700); border-color: #9acbb9; background: #f2faf6; }
.welcome-availability.online .availability-dot { background: #199264; box-shadow: 0 0 0 3px rgba(25,146,100,.13); }
.welcome-availability.offline { color: #835a00; border-color: #e0c47b; background: #fff8e5; }
.welcome-availability.offline .availability-dot { background: #c58400; }
.welcome-driver { min-height: 68px; display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.welcome-driver > span { width: 42px; height: 42px; display: grid; place-items: center; flex: none; border-radius: 8px; color: var(--green-700); background: var(--green-100); }
.welcome-driver svg { width: 21px; height: 21px; }
.welcome-driver > div { min-width: 0; display: flex; flex-direction: column; }
.welcome-driver small { overflow-wrap: anywhere; color: var(--muted); font-size: 10px; }
.welcome-driver strong { overflow-wrap: anywhere; font-size: 14px; }
.welcome-surface .primary-button { margin-top: 18px; }
.welcome-location-note { min-height: 34px; display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--muted); font-size: 10px; }
.welcome-location-note svg { width: 14px; height: 14px; }
.topbar {
  height: 64px;
  padding: 0 max(18px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 500;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 19px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; color: white; background: var(--green-700); border-radius: 8px; font-size: 13px; }
.brand-mark svg { width: 21px; }
.brand-mark.large { width: 52px; height: 52px; border-radius: 8px; }
.icon-button, .field-action, .locate-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  display: grid;
  place-items: center;
  border-radius: 8px;
}
.icon-button svg, .field-action svg, .locate-button svg { width: 20px; height: 20px; }
.push-button.push-active { color: #fff; border-color: var(--green-700); background: var(--green-700); }
main { min-height: calc(100dvh - 64px); }
.map-stage { height: 39dvh; min-height: 260px; position: relative; background: #dce8e3; }
#map { position: absolute; inset: 0; z-index: 1; }
.map-status {
  position: absolute;
  z-index: 400;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  color: var(--green-900);
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(17,97,73,.18);
  border-radius: 8px;
  box-shadow: 0 5px 18px rgba(17, 42, 34, .12);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.map-status svg { width: 16px; }
.locate-button { position: absolute; z-index: 400; right: 16px; bottom: 16px; box-shadow: 0 5px 18px rgba(17,42,34,.16); }
.locate-button.following { color: #fff; border-color: var(--green-700); background: var(--green-700); }
.ride-panel { background: var(--surface); position: relative; z-index: 450; padding: 18px 20px max(24px, env(safe-area-inset-bottom)); }
.stepper { height: 43px; display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 16px; }
.step { position: relative; display: flex; flex-direction: column; align-items: center; color: #9aa49f; gap: 3px; font-size: 10px; }
.step::before { content: ""; position: absolute; height: 2px; left: -50%; right: 50%; top: 12px; background: var(--line); z-index: -1; }
.step:first-child::before { display: none; }
.step span { width: 25px; height: 25px; display: grid; place-items: center; background: #eef2f0; border-radius: 50%; font-size: 11px; font-weight: 700; }
.step.active, .step.complete { color: var(--green-700); }
.step.active span, .step.complete span { color: white; background: var(--green-700); }
.step.complete::before, .step.active::before { background: var(--green-700); }
.flow-screen { display: none; }
.flow-screen.active { display: block; animation: enter .24s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(5px); } }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 14px; font-size: 23px; line-height: 1.35; }
h2 { margin-bottom: 0; font-size: 20px; line-height: 1.35; }
.service-availability { min-height: 36px; display: flex; align-items: center; gap: 8px; margin: -5px 0 12px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--canvas); font-size: 11px; }
.availability-dot { width: 9px; height: 9px; border-radius: 50%; background: #9aa49f; }
.service-availability.online { color: var(--green-700); border-color: #9acbb9; background: #f2faf6; }
.service-availability.online .availability-dot { background: #199264; box-shadow: 0 0 0 3px rgba(25,146,100,.13); }
.service-availability.offline { color: #835a00; border-color: #e0c47b; background: #fff8e5; }
.service-availability.offline .availability-dot { background: #c58400; }
.route-inputs { position: relative; }
.location-field { min-height: 62px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); padding: 7px 8px 7px 14px; background: var(--surface); }
.pickup-field { border-radius: 8px 8px 0 0; }
.destination-field { border-top: 0; border-radius: 0 0 8px 8px; }
.location-field:focus-within { border-color: var(--green-700); box-shadow: inset 0 0 0 1px var(--green-700); z-index: 2; position: relative; }
.field-dot { width: 11px; height: 11px; border: 3px solid var(--green-700); border-radius: 50%; flex: none; }
.destination-field .field-dot { border-color: var(--red); border-radius: 2px; }
.field-content { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.field-content small, .screen-heading small { color: var(--muted); font-size: 11px; }
.field-content input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); padding: 1px 0; font-size: 15px; background: transparent; }
.field-content input::placeholder { color: #a0aaa5; }
.field-action { border: 0; width: 38px; height: 38px; color: var(--green-700); flex: none; }
.search-results { display: none; position: absolute; left: 0; right: 0; z-index: 600; background: white; border: 1px solid var(--line); box-shadow: var(--shadow); max-height: min(390px, 48dvh); overflow-y: auto; overscroll-behavior: contain; }
.search-results.visible { display: block; }
.search-results button { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: white; text-align: left; color: var(--ink); font-size: 13px; }
.search-results button:last-child { border-bottom: 0; }
.search-results-heading { padding: 8px 12px 5px; color: var(--muted); background: var(--canvas); border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 700; }
.search-result-item { min-height: 62px; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 8px 11px; }
.search-result-item:active { background: #f2faf6; }
.search-result-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; color: var(--green-700); background: var(--green-100); }
.search-result-icon svg { width: 17px; height: 17px; }
.search-result-copy { min-width: 0; display: flex; flex-direction: column; }
.search-result-copy strong { overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.search-result-copy small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.search-result-meta { color: var(--muted); font-size: 9px; white-space: nowrap; }
.search-results-message { min-height: 58px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; color: var(--muted); font-size: 11px; text-align: center; }
.search-results-message svg { width: 17px; height: 17px; flex: none; }
.search-more-button { min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 12px; color: var(--green-700) !important; font-size: 11px !important; font-weight: 700; }
.search-more-button svg { width: 16px; height: 16px; }
#pickupResults { top: 62px; }
#destinationResults { top: 123px; }
.primary-button, .secondary-button { min-height: 50px; width: 100%; border-radius: 8px; display: flex; align-items: center; justify-content: center; gap: 9px; font-weight: 700; margin-top: 16px; }
.primary-button { border: 0; color: white; background: var(--green-700); }
.primary-button:disabled { cursor: not-allowed; background: #adb8b3; }
.field-action:disabled, .location-field input:disabled { cursor: not-allowed; opacity: .55; }
.maplibregl-ctrl-bottom-right { max-width: calc(100% - 70px); }
.maplibregl-ctrl-attrib { font-family: "Noto Sans Thai", sans-serif; font-size: 9px; }
.primary-button svg, .secondary-button svg { width: 19px; }
.secondary-button { border: 1px solid var(--green-700); background: white; color: var(--green-700); }
.screen-heading { display: flex; align-items: center; gap: 12px; min-height: 44px; margin-bottom: 16px; }
.back-button { width: 40px; height: 40px; flex: none; }
.trip-metrics { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0; }
.trip-metrics > div { display: flex; align-items: center; gap: 10px; padding: 0 10px; }
.trip-metrics > div + div { border-left: 1px solid var(--line); }
.trip-metrics svg { color: var(--green-700); width: 21px; }
.trip-metrics span { display: flex; flex-direction: column; }
.trip-metrics strong { font-size: 15px; }
.trip-metrics small, .vehicle-copy small, .payment-option small, .promptpay-box small { color: var(--muted); font-size: 11px; }
.vehicle-row { min-height: 74px; margin-top: 16px; padding: 10px 12px; border: 2px solid var(--green-700); border-radius: 8px; display: flex; align-items: center; gap: 11px; background: #f6fbf8; }
.vehicle-icon { width: 46px; height: 46px; display: grid; place-items: center; color: var(--green-900); background: var(--green-100); border-radius: 8px; }
.vehicle-icon svg { width: 27px; }
.vehicle-copy { display: flex; flex: 1; flex-direction: column; }
.fare-price { font-size: 20px; }
.fare-note { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; padding: 10px 2px 0; }
.fare-note svg { width: 17px; color: var(--green-700); }
.pay-after-accept { min-height: 52px; display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 9px 11px; border-left: 3px solid var(--gold); background: #fff9e8; }
.pay-after-accept svg { width: 21px; color: #8a6100; flex: none; }
.pay-after-accept span { display: flex; flex-direction: column; }
.pay-after-accept strong { font-size: 12px; }
.pay-after-accept small { color: var(--muted); font-size: 10px; }
.payment-options { display: grid; gap: 9px; }
.accepted-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; color: white; background: var(--green-700); flex: none; }
.accepted-mark svg { width: 21px; }
.driver-confirmation { min-height: 64px; display: flex; align-items: center; gap: 11px; margin-bottom: 12px; padding: 9px 11px; border: 1px solid #9acbb9; border-radius: 8px; background: #f2faf6; }
.driver-confirmation > svg { width: 24px; color: var(--green-700); flex: none; }
.driver-confirmation > span { min-width: 0; display: flex; flex-direction: column; }
.driver-confirmation > span:nth-child(2) { flex: 1; }
.driver-confirmation small { color: var(--muted); font-size: 9px; }
.driver-confirmation strong { overflow-wrap: anywhere; font-size: 12px; }
.payment-countdown { flex: none; text-align: right; }
.payment-countdown strong { color: #8a6100; font-size: 18px; font-variant-numeric: tabular-nums; }
.payment-option { width: 100%; min-height: 64px; display: flex; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: white; text-align: left; color: var(--ink); }
.payment-option.selected { border: 2px solid var(--green-700); background: #f6fbf8; }
.payment-option > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.payment-option > svg { color: var(--green-700); width: 21px; }
.payment-logo { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; font-weight: 800; }
.promptpay-logo { color: white; background: #1b477c; }
.promptpay-box { min-height: 118px; display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 14px; border: 1px dashed #aebbb5; border-radius: 8px; background: var(--canvas); }
.promptpay-box img { width: 94px; height: 94px; image-rendering: crisp-edges; }
.promptpay-box > div { display: flex; flex-direction: column; }
.promptpay-box.hidden { display: none; }
.promptpay-box img.qr-error { visibility: hidden; }
.payment-message { min-height: 18px; margin: 8px 0 0; color: var(--red); font-size: 12px; text-align: center; }
.receipt-upload { margin-top: 12px; }
.receipt-picker { min-height: 66px; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 1px dashed #8ca99e; border-radius: 8px; color: var(--green-700); background: #f7fbf9; cursor: pointer; }
.receipt-picker > svg { width: 21px; flex: none; }
.receipt-picker > svg:last-child { width: 17px; margin-left: auto; color: var(--muted); }
.receipt-picker span { min-width: 0; display: flex; flex-direction: column; color: var(--ink); }
.receipt-picker strong { font-size: 13px; }
.receipt-picker small { color: var(--muted); font-size: 10px; }
.receipt-preview { min-height: 76px; display: flex; align-items: center; gap: 11px; padding: 9px; border: 1px solid #9acbb9; border-radius: 8px; background: #f2faf6; }
.receipt-preview > img, .receipt-file-icon { width: 56px; height: 56px; flex: none; border-radius: 6px; }
.receipt-preview > img { object-fit: cover; background: white; }
.receipt-file-icon { display: grid; place-items: center; color: var(--green-700); background: var(--green-100); }
.receipt-file-icon svg { width: 25px; }
.receipt-file-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; text-align: left; }
.receipt-file-copy strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.receipt-file-copy small { color: var(--muted); font-size: 9px; }
.receipt-preview .icon-button { flex: none; color: var(--red); }
.text-button { min-height: 40px; width: 100%; margin-top: 8px; border: 0; color: var(--muted); background: transparent; font: inherit; font-size: 12px; text-decoration: underline; }
.success-screen { text-align: center; padding: 16px 0 4px; }
.success-icon { width: 62px; height: 62px; margin: 0 auto 14px; display: grid; place-items: center; color: white; background: var(--green-700); border-radius: 50%; }
.success-icon svg { width: 32px; height: 32px; stroke-width: 3; }
.success-screen > small { color: var(--muted); }
.success-screen h2 { margin-top: 6px; font-size: 23px; }
.success-screen p { color: var(--muted); font-size: 14px; margin: 7px auto 16px; max-width: 320px; }
.loading-line { height: 4px; background: var(--green-100); overflow: hidden; margin: 0 auto 18px; max-width: 340px; }
.loading-line span { display: block; height: 100%; width: 38%; background: var(--green-700); animation: search 1.4s infinite ease-in-out; }
@keyframes search { from { transform: translateX(-100%); } to { transform: translateX(330%); } }
.tracking-details { margin-top: 16px; border-top: 1px solid var(--line); text-align: left; }
.tracking-details > div { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.tracking-details svg { width: 20px; color: var(--green-700); flex: none; }
.tracking-details span { min-width: 0; display: flex; flex-direction: column; }
.tracking-details small { color: var(--muted); font-size: 10px; }
.tracking-details strong { overflow-wrap: anywhere; font-size: 13px; }
.live-driver-marker { width: 42px; height: 42px; display: grid; place-items: center; border: 3px solid white; border-radius: 50%; color: #563d00; background: var(--gold); box-shadow: 0 3px 10px rgba(23,35,31,.28), 0 0 0 7px rgba(243,181,27,.2); }
.live-driver-marker svg { width: 21px; height: 21px; stroke-width: 2.5; }
.live-driver-marker.stale { box-shadow: 0 3px 10px rgba(23,35,31,.28), 0 0 0 7px rgba(220,75,62,.16); }
.live-driver-marker.disconnected { color: #fff; background: var(--red); }
.hidden { display: none !important; }
dialog { width: min(90vw, 390px); border: 0; border-radius: 8px; padding: 20px; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(8, 25, 20, .56); }
dialog.dialog-fallback { position: fixed; z-index: 2000; top: 50%; left: 50%; margin: 0; transform: translate(-50%, -50%); box-shadow: 0 0 0 100vmax rgba(8,25,20,.56), var(--shadow); }
.dialog-close { margin-left: auto; }
.dialog-content { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 2px 10px 12px; }
.dialog-content h2 { margin-top: 12px; }
.dialog-content img { width: 210px; height: 210px; margin: 12px 0; }
.dialog-content p { font-size: 11px; color: var(--muted); word-break: break-all; margin-bottom: 0; }
.push-setup-dialog { width: min(92vw, 410px); }
.push-setup-content { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 4px 6px; }
.push-setup-content h2 { margin: 10px 0 6px; font-size: 21px; }
.push-setup-content > p { color: var(--muted); font-size: 13px; line-height: 1.65; margin: 0 0 14px; }
.push-install-steps { width: 100%; margin: 0 0 16px; padding: 12px 12px 12px 34px; text-align: left; color: var(--ink); background: #f1f6f4; border: 1px solid #d9e7e2; border-radius: 6px; font-size: 13px; line-height: 1.8; }
.push-setup-content .primary-button.danger-action { background: #a83232; }
.push-setup-note { width: 100%; margin: 10px 0 0 !important; padding: 9px 10px; border-radius: 6px; color: #73510b !important; background: #fff6d9; }
.event-dialog { width: min(92vw, 430px); max-height: min(90dvh, 720px); overflow-y: auto; padding: 18px; }
.event-dialog-content { padding: 0 4px 4px; text-align: center; }
.event-icon { width: 58px; height: 58px; display: grid; place-items: center; margin: -20px auto 10px; border: 4px solid white; border-radius: 50%; color: #563d00; background: var(--gold); box-shadow: 0 4px 16px rgba(23,35,31,.18); }
.event-icon.payment, .event-icon.arrival { color: white; background: var(--green-700); }
.event-icon.warning { color: white; background: var(--red); }
.event-icon svg { width: 27px; height: 27px; }
.event-dialog-content > small { color: var(--muted); font-size: 10px; }
.event-dialog-content h2 { margin-top: 4px; font-size: 22px; }
.event-dialog-content > p { max-width: 340px; margin: 7px auto 14px; color: var(--muted); font-size: 13px; }
.event-route { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; }
.event-route > div { min-height: 56px; display: flex; align-items: center; gap: 10px; padding: 8px 2px; }
.event-route > div + div { border-top: 1px solid var(--line); }
.event-route svg { width: 19px; color: var(--green-700); flex: none; }
.event-route > div:nth-child(2) svg { color: var(--red); }
.event-route span { min-width: 0; display: flex; flex-direction: column; }
.event-route small, .event-summary small { color: var(--muted); font-size: 9px; }
.event-route strong { overflow-wrap: anywhere; font-size: 12px; }
.event-summary { min-height: 64px; display: grid; grid-template-columns: 1fr 1fr; align-items: center; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.event-summary > span { display: flex; flex-direction: column; }
.event-summary > span + span { border-left: 1px solid var(--line); }
.event-summary strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.event-actions { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 8px; }
.event-actions .primary-action, .event-actions .secondary-action { width: 100%; }
.event-actions .danger-action { border-color: var(--red); color: var(--red); }
.passenger-event-dialog .event-route { margin-top: 14px; }
.passenger-event-dialog .primary-button { margin-top: 14px; }
.receipt-review { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; margin-top: 12px; padding: 10px; border: 1px solid #9acbb9; border-radius: 8px; background: #f2faf6; text-align: left; }
.receipt-thumbnail { position: relative; width: 92px; height: 112px; overflow: hidden; padding: 0; border: 0; border-radius: 6px; background: white; }
.receipt-thumbnail > img { width: 100%; height: 100%; object-fit: cover; }
.receipt-thumbnail .receipt-file-icon { width: 100%; height: 100%; }
.receipt-zoom { position: absolute; right: 5px; bottom: 5px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; color: white; background: rgba(23, 35, 31, .78); }
.receipt-zoom svg { width: 15px; }
.receipt-review-copy { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.receipt-review-copy > strong { font-size: 12px; }
.receipt-review-copy > small { margin-bottom: 8px; overflow-wrap: anywhere; color: var(--muted); font-size: 9px; }
.receipt-review-copy > span { display: flex; align-items: flex-start; gap: 5px; margin-top: 4px; color: var(--green-700); font-size: 9px; }
.receipt-review-copy svg { width: 14px; height: 14px; flex: none; }
.receipt-dialog { width: min(96vw, 760px); height: min(94dvh, 900px); padding: 12px; overflow: hidden; }
.receipt-dialog-heading { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px 8px; }
.receipt-dialog-heading > div { min-width: 0; }
.receipt-dialog-heading small { color: var(--muted); font-size: 9px; }
.receipt-dialog-heading h2 { margin: 0; font-size: 17px; }
.receipt-full-stage { height: calc(100% - 118px); display: grid; place-items: center; overflow: auto; background: #e7ece9; }
.receipt-full-stage img { display: block; max-width: 100%; height: auto; margin: auto; }
.receipt-full-stage iframe { width: 100%; height: 100%; border: 0; background: white; }
.receipt-dialog .secondary-button { margin-top: 10px; }
.toast { position: fixed; z-index: 1000; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translate(-50%, 130%); max-width: calc(100vw - 32px); padding: 10px 14px; border-radius: 8px; background: var(--ink); color: white; box-shadow: var(--shadow); font-size: 13px; transition: transform .2s ease; text-align: center; }
.toast.visible { transform: translate(-50%, 0); }
.qr-page { min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: var(--green-900); }
.qr-sheet { width: min(100%, 430px); padding: 32px; background: white; border-radius: 8px; text-align: center; box-shadow: var(--shadow); }
.qr-sheet .brand-mark { margin: auto; }
.qr-sheet h1 { margin: 12px 0 0; }
.qr-sheet p { color: var(--muted); }
.qr-sheet img { display: block; width: 260px; max-width: 100%; height: auto; margin: 18px auto; }
.qr-sheet strong { display: block; color: var(--muted); font-size: 11px; word-break: break-all; }

.driver-page { min-height: 100dvh; }
.driver-topbar { position: sticky; top: 0; }
.driver-tools { display: flex; align-items: center; gap: 8px; }
.availability-switch { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; cursor: pointer; }
.availability-switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { width: 36px; height: 20px; padding: 2px; border-radius: 10px; background: #aeb8b3; transition: background .2s ease; }
.switch-track span { display: block; width: 16px; height: 16px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s ease; }
.availability-switch input:checked + .switch-track { background: #199264; }
.availability-switch input:checked + .switch-track span { transform: translateX(16px); }
.availability-switch input:focus-visible + .switch-track { outline: 2px solid var(--green-700); outline-offset: 2px; }
.gps-pill { height: 36px; display: flex; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--canvas); font-size: 11px; white-space: nowrap; }
.gps-pill.active { color: var(--green-700); border-color: #9acbb9; background: var(--green-100); }
.gps-pill svg { width: 15px; }
.driver-login-layout { min-height: calc(100dvh - 64px); display: grid; place-items: center; padding: 24px; }
.driver-login { width: min(100%, 380px); padding: 28px; border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: var(--shadow); }
.driver-login .brand-mark { margin-bottom: 16px; }
.driver-login h1 { margin-bottom: 4px; }
.driver-login > p { color: var(--muted); font-size: 13px; }
.driver-login-step { display: grid; gap: 14px; }
.driver-login-step.hidden { display: none; }
.driver-login label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 12px; }
.driver-login input { width: 100%; height: 48px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; outline: 0; color: var(--ink); font-size: 16px; }
.driver-login input:focus { border-color: var(--green-700); box-shadow: 0 0 0 2px rgba(17,97,73,.13); }
.driver-login .otp-input { font-size: 24px; font-weight: 700; text-align: center; }
.otp-delivery { margin: 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.otp-delivery strong { color: var(--ink); }
.otp-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.otp-actions button { min-height: 38px; padding: 0; border: 0; color: var(--green-700); background: transparent; font: inherit; font-size: 12px; font-weight: 600; }
.otp-actions button:disabled { color: var(--muted); }
.form-error { min-height: 18px; margin: 9px 0 0; color: var(--red) !important; text-align: center; }
.driver-main { min-height: calc(100dvh - 64px); }
.driver-map { height: 38dvh; }
#driverMap { position: absolute; inset: 0; z-index: 1; }
.driver-panel { padding: 20px; background: white; }
.driver-section-heading, .list-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.driver-section-heading { margin-bottom: 18px; }
.driver-section-heading small { color: var(--muted); font-size: 11px; }
.driver-section-heading h1 { margin: 0; }
.new-job-alert { width: 100%; min-height: 46px; display: flex; align-items: center; gap: 9px; padding: 8px 12px; border: 1px solid #d49a00; border-radius: 8px; color: #5d4300; background: #fff4cf; font: inherit; font-size: 12px; font-weight: 700; text-align: left; }
.new-job-alert span { min-width: 0; flex: 1; }
.new-job-alert svg { width: 18px; flex: none; }
.list-title { margin: 20px 0 10px; font-size: 15px; }
.count-badge { min-width: 24px; height: 24px; display: grid; place-items: center; padding: 0 7px; border-radius: 12px; background: var(--green-100); color: var(--green-700); font-size: 11px; font-weight: 700; }
.job-list { display: grid; gap: 10px; }
.job-card { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.active-job-card { border: 2px solid var(--green-700); background: #f8fcfa; }
.job-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.job-card-heading > span { display: flex; flex-direction: column; }
.job-card-heading small { color: var(--muted); font-size: 10px; }
.job-card-heading strong { font-size: 14px; }
.job-fare { font-size: 20px !important; }
.job-route { padding: 9px 0 3px; }
.job-route > div { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 10px; position: relative; }
.job-route > div:first-child::after { content: ""; position: absolute; top: 18px; bottom: -5px; left: 5px; width: 2px; background: var(--line); }
.route-dot { width: 11px; height: 11px; margin-top: 5px; border: 3px solid var(--green-700); border-radius: 50%; z-index: 1; background: white; }
.destination-dot { border-color: var(--red); border-radius: 2px; }
.job-route p { min-width: 0; display: flex; flex-direction: column; margin: 0 0 8px; }
.job-route small { color: var(--muted); font-size: 10px; }
.job-route strong { overflow-wrap: anywhere; font-size: 12px; }
.job-meta { display: flex; gap: 16px; padding: 8px 0; color: var(--muted); font-size: 11px; }
.job-meta span { display: flex; align-items: center; gap: 5px; }
.job-meta svg { width: 15px; }
.job-actions { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 8px; margin-top: 5px; }
.primary-action, .secondary-action { min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: 8px; font: inherit; font-size: 12px; font-weight: 700; text-decoration: none; }
.primary-action { border: 0; color: white; background: var(--green-700); }
.primary-action:disabled { cursor: not-allowed; color: #66716c; background: #dce4e0; }
.secondary-action { border: 1px solid var(--green-700); color: var(--green-700); background: white; }
.primary-action svg, .secondary-action svg { width: 16px; }
.empty-state { min-height: 100px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; border: 1px dashed #aebbb5; border-radius: 8px; color: var(--muted); font-size: 12px; }
.empty-state svg { width: 24px; }
.empty-state.small { min-height: 58px; }
.history-row { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.history-row > span { min-width: 0; display: flex; flex-direction: column; }
.history-row > span:last-child { flex: none; text-align: right; }
.history-row strong { font-size: 12px; }
.history-row small { max-width: 240px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.places-main { min-height: calc(100dvh - 64px); }
.places-map { height: 36dvh; }
#placesMap { position: absolute; inset: 0; z-index: 1; }
.places-panel { padding: 20px; background: white; }
.places-heading { margin-bottom: 12px; }
.place-search { position: relative; min-height: 50px; display: grid; grid-template-columns: 20px minmax(0, 1fr) 38px; align-items: center; gap: 8px; padding: 5px 6px 5px 12px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.place-search:focus-within { border-color: var(--green-700); box-shadow: 0 0 0 2px rgba(17,97,73,.12); }
.place-search > svg { width: 18px; color: var(--muted); }
.place-search > input { min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; }
.place-search > .icon-button { width: 38px; height: 38px; color: white; border: 0; background: var(--green-700); }
.place-search-results { position: absolute; z-index: 700; top: calc(100% + 5px); left: 0; right: 0; max-height: min(370px, 48dvh); overflow-y: auto; border: 1px solid var(--line); background: white; box-shadow: var(--shadow); }
.place-search-results > button { width: 100%; min-height: 58px; display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: center; gap: 8px; padding: 8px 11px; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); background: white; text-align: left; }
.place-search-results > button:last-child { border-bottom: 0; }
.place-search-results > button > span:first-child { width: 30px; height: 30px; display: grid; place-items: center; color: var(--green-700); background: var(--green-100); border-radius: 8px; }
.place-search-results > button svg { width: 16px; }
.place-search-results > button > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.place-search-results strong, .place-search-results small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-search-results strong { font-size: 11px; }
.place-search-results small { color: var(--muted); font-size: 9px; }
.place-editor { display: grid; gap: 10px; margin-top: 16px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.place-editor-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.place-editor-title small { color: var(--muted); font-size: 10px; }
.place-editor-title h2 { font-size: 16px; }
.place-editor label { min-width: 0; display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 10px; }
.place-editor input, .place-editor textarea, .place-editor select { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; outline: 0; color: var(--ink); background: white; font-size: 12px; }
.place-editor textarea { min-height: 58px; resize: vertical; }
.place-editor input:focus, .place-editor textarea:focus, .place-editor select:focus { border-color: var(--green-700); box-shadow: 0 0 0 2px rgba(17,97,73,.1); }
.coordinate-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.place-editor .primary-button { margin-top: 2px; }
.saved-places-heading { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; }
.saved-places-heading h2 { font-size: 15px; }
.saved-places-list { display: grid; margin-top: 8px; }
.saved-place-row { min-height: 72px; display: flex; align-items: center; gap: 7px; border-bottom: 1px solid var(--line); }
.saved-place-copy { min-width: 0; flex: 1; display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 9px; padding: 8px 0; border: 0; color: var(--ink); background: transparent; text-align: left; }
.saved-place-copy > span:first-child { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; color: var(--green-700); background: var(--green-100); }
.saved-place-copy svg { width: 17px; }
.saved-place-copy > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.saved-place-copy strong, .saved-place-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-place-copy strong { font-size: 12px; }
.saved-place-copy small { color: var(--muted); font-size: 9px; }
.saved-place-copy .saved-place-aliases { color: var(--green-700); }
.saved-place-actions { display: flex; gap: 5px; flex: none; }
.saved-place-actions .icon-button { width: 36px; height: 36px; }
.saved-place-actions .delete-place { color: var(--red); }

@media (min-width: 820px) {
  .welcome-overlay { align-items: stretch; justify-items: end; }
  .welcome-surface { width: 430px; display: flex; flex-direction: column; justify-content: center; padding: 42px; border-radius: 0; box-shadow: -12px 0 36px rgba(12,43,34,.18); }
  .app-shell { height: 100dvh; overflow: hidden; }
  main { display: grid; grid-template-columns: minmax(0, 1fr) 430px; }
  .map-stage { height: calc(100dvh - 64px); min-height: 0; }
  .ride-panel { height: calc(100dvh - 64px); padding: 24px 28px; overflow-y: auto; border-left: 1px solid var(--line); box-shadow: -8px 0 28px rgba(12, 43, 34, .08); }
  .stepper { margin-bottom: 24px; }
  h1 { font-size: 27px; }
  .driver-main { height: calc(100dvh - 64px); display: grid; grid-template-columns: minmax(0, 1fr) 430px; overflow: hidden; }
  .driver-main.hidden { display: none; }
  .driver-map { height: calc(100dvh - 64px); }
  .driver-panel { height: calc(100dvh - 64px); overflow-y: auto; border-left: 1px solid var(--line); box-shadow: -8px 0 28px rgba(12,43,34,.08); }
  .places-main { height: calc(100dvh - 64px); display: grid; grid-template-columns: minmax(0, 1fr) 460px; overflow: hidden; }
  .places-map { height: calc(100dvh - 64px); }
  .places-panel { height: calc(100dvh - 64px); overflow-y: auto; border-left: 1px solid var(--line); box-shadow: -8px 0 28px rgba(12,43,34,.08); }
}

@media (max-width: 819px) {
  .ride-panel { min-height: calc(61dvh - 64px); margin-top: -8px; border-radius: 8px 8px 0 0; }
  .driver-topbar {
    height: calc(58px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
    padding-left: 12px;
    padding-right: 12px;
  }
  .driver-topbar .brand { font-size: 15px; }
  .driver-topbar .brand-mark { width: 36px; height: 36px; }
  .driver-tools { gap: 6px; }
  .driver-tools .icon-button { width: 38px; height: 38px; }
  .driver-tools #managePlaces { display: none; }
  .driver-main { display: flex; flex-direction: column; min-height: calc(100dvh - 58px - env(safe-area-inset-top)); }
  .driver-map { flex: none; height: clamp(178px, 28dvh, 230px); min-height: 178px; }
  .driver-main.has-active-ride .driver-map { height: clamp(205px, 33dvh, 270px); }
  .driver-map .map-status { top: 10px; max-width: calc(100% - 112px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .driver-map .map-status span { overflow: hidden; text-overflow: ellipsis; }
  .gps-pill {
    position: absolute;
    z-index: 460;
    top: calc(68px + env(safe-area-inset-top));
    right: 12px;
    max-width: calc(100vw - 24px);
    box-shadow: 0 4px 14px rgba(12,43,34,.12);
  }
  .driver-panel { flex: 1; padding: 14px 14px max(22px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
  .driver-section-heading { margin-bottom: 10px; }
  .driver-section-heading h1 { font-size: 22px; }
  .driver-section-heading .icon-button { width: 38px; height: 38px; }
  .list-title { margin: 14px 0 8px; }
  .job-list { gap: 8px; }
  .job-card { padding: 12px; }
  .job-card-heading { padding-bottom: 8px; }
  .job-route { padding-top: 8px; }
  .job-meta { padding: 5px 0 8px; }
  .job-actions { grid-template-columns: 46px minmax(0, 1fr); }
  .job-actions .secondary-action span { display: none; }
  .job-actions .primary-action, .job-actions .secondary-action { min-height: 48px; }
  .new-job-alert { position: sticky; top: 0; z-index: 20; box-shadow: 0 4px 12px rgba(93,67,0,.1); }
  .event-dialog { width: calc(100vw - 24px); max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
}

@media (max-width: 390px) {
  .ride-panel { padding-left: 14px; padding-right: 14px; }
  .map-stage { min-height: 230px; }
  .step small { font-size: 9px; }
  .gps-pill span { display: none; }
  .gps-pill { width: 38px; padding: 0; justify-content: center; }
  .availability-switch strong { display: none; }
  .job-actions { grid-template-columns: 46px minmax(0, 1fr); }
}

@media (max-width: 350px) {
  .driver-tools { gap: 6px; }
  .driver-topbar { padding-left: 8px; padding-right: 8px; }
}

@media (max-width: 520px) {
  .driver-page .brand > span:last-child { display: none; }
}
