* { box-sizing: border-box; }
:root {
  --ink: #162f2c; --muted: #526763; --teal: #11534a;
  --line: #d7e2de; --lime: #cded82; --sand: #f5f7f4;
  color-scheme: light;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}
body { margin: 0; background: var(--sand); color: var(--ink); }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid #40876d; outline-offset: 3px; }
[hidden] { display: none !important; }
.rider-entry { max-width: 24rem; padding-bottom: 2rem; }
.rider-entry .submit-button { margin-top: 0; }
.sandbox-notice { margin: 1rem 0 0; padding: .75rem 1rem; background: #fff2cc; border: 1px solid #dcb655; color: #5b440c; font-weight: 600; border-radius: .75rem; }
#auth-help { max-width: 38rem; }
#position-hint { margin: 0 0 .6rem; color: var(--muted); font-size: .875rem; }
.wrap { width: min(1376px, calc(100% - clamp(32px, 8vw, 144px))); margin-inline: auto; }
.topbar { border-bottom: 1px solid var(--line); background: #fff; }
.nav { height: 76px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; gap: 11px; align-items: center; font-size: 27px; font-weight: 800; }
.brand-times { font: 20px Arial,sans-serif; color: #8fa19b; }
.brand .partner { color: #455a53; font-weight: 650; }
.brand-mark { width: 39px; height: 39px; border-radius: 12px; background: var(--teal); display: flex; flex-direction: column; gap: 3px; justify-content: center; align-items: center; transform: rotate(-5deg); }
.brand-mark i { width: 20px; height: 3px; border-radius: 3px; background: #d9f5a3; transform: skew(-32deg); }
.brand-mark i:nth-child(2) { width: 14px; margin-inline-end: 6px; }
.brand-mark i:nth-child(3) { width: 9px; margin-inline-end: 11px; }
.nav-tools { display: flex; align-items: center; gap: 17px; }
.nav-caption { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.logout-button { border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--teal); min-height: 42px; padding: 6px 13px; font-weight: 600; }
.logout-button:hover { background: var(--sand); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #8a9692; }
body[data-mode="production"] .live-dot { background: #36875e; }
body[data-mode="simulation"] .live-dot { background: #bd8143; }
.map-shortcut { display: none; }
#auth-help { margin: 0 0 16px; }
#auth-help a,.map-shortcut { color: var(--teal); text-underline-offset: 3px; font-weight: 650; }
#auth-help a { display: inline-block; margin-top: 6px; padding-block: 5px; }
.intro { padding: clamp(24px, 4vw, 53px) 0 clamp(22px, 3vw, 36px); }
h1,h2,p { margin: 0; }
h1 { font-size: clamp(36px, 4.2vw, 64px); font-weight: 750; line-height: 1.25; letter-spacing: -.04em; }
.intro p { color: var(--muted); font-size: clamp(15px, 1.4vw, 19px); margin-top: 9px; line-height: 1.75; }
.workspace { display: grid; grid-template-columns: minmax(290px,.72fr) minmax(0,1.45fr); gap: 22px; align-items: stretch; padding-bottom: 40px; }
.form-panel,.map-panel { background: #fff; border: 1px solid var(--line); border-radius: 20px; min-width: 0; overflow: hidden; }
.form-panel { padding: clamp(20px,2.2vw,33px); display: flex; flex-direction: column; }
h2 { font-size: 21px; line-height: 1.45; font-weight: 700; }
.panel-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.section-icon { width: 29px; height: 29px; border-radius: 9px; background: #edf5de; color: #345346; display: grid; place-items: center; font: 23px/1 Arial,sans-serif; }
.place { border: 0; margin: 0; padding: 0; min-width: 0; }
.place + .place { margin-top: 25px; }
.service-field { margin-top: 23px; }
.service-field label { display: block; font-size: 16px; font-weight: 650; margin-bottom: 7px; }
.service-field select { width: 100%; min-height: 46px; font: inherit; font-size: 16px; color: var(--ink); background: #f8faf8; border: 1px solid var(--line); padding: 7px 10px; border-radius: 9px; }
.service-field select:focus-visible { outline: 3px solid #40876d; outline-offset: 3px; }
.service-field select:disabled { color: var(--muted); }
.service-field p { margin-top: 5px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.service-field p:empty { display: none; }
.place legend { font-size: 16px; font-weight: 650; padding: 0; margin: 0 0 9px; }
.point-symbol { display: inline-block; width: 12px; height: 12px; background: #fff; border: 3px solid var(--teal); vertical-align: middle; margin-inline-end: 7px; }
.point-symbol.origin { border-radius: 50%; }
.point-symbol.destination { border-radius: 3px; border-color: #b45d36; }
.coordinates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.coordinates label { color: var(--muted); font-size: 12px; display: flex; flex-direction: column; gap: 6px; }
.coordinates input { color: var(--ink); background: #f8faf8; border: 1px solid var(--line); border-radius: 9px; width: 100%; height: 45px; padding: 0 11px; text-align: left; font: 500 15px/1.4 Consolas, monospace; }
.coordinates input[aria-invalid="true"] { border-color: #b44229; background: #fff5ef; }
.submit-button { margin: 29px 0 0; border: 0; background: var(--teal); color: #fff; width: 100%; display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 17px; border-radius: 10px; font-size: 16px; font-weight: 650; }
.submit-button:hover { background: #0a4038; }
.submit-button:disabled { opacity: .7; cursor: progress; }
.button-arrow { font: 24px/1 Arial,sans-serif; color: var(--lime); }
.booking-note { text-align: center; margin-top: 13px; font-size: 13px; line-height: 1.65; color: var(--muted); }
.booking-panel { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.form-panel:has(#trip-form[hidden]) .booking-panel { margin: 0; border: 0; padding: 0; }
.rider-field { display: grid; gap: 5px; margin-top: 12px; }
.rider-field label,.trip-review dt { color: var(--muted); font-size: 14px; }
.rider-field input { padding: 10px 12px; color: var(--ink); border: 1px solid var(--line); border-radius: 9px; }
.rider-field input[aria-invalid="true"] { border-color: #ab482c; }
.trip-review { margin: 12px 0; }
.trip-review div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-block: 7px; border-bottom: 1px solid var(--line); }
.trip-review dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; text-align: end; }
.booking-panel .submit-button { margin-top: 14px; justify-content: center; }
.booking-panel p { color: var(--muted); line-height: 1.65; margin-top: 6px; }
.text-button { background: transparent; border: 0; color: var(--teal); text-decoration: underline; text-underline-offset: 4px; padding: 6px 0; }
#booking-status { overflow-wrap: anywhere; }
.tracking-panel { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; padding: 20px 16px; margin-block: 13px 20px; border-radius: 13px; background: #eaf3ed; color: var(--teal); }
.tracking-copy h3 { margin: 0; font-size: clamp(20px, 3vw, 30px); line-height: 1.35; }
.tracking-copy p { font-size: 14px; margin: 6px 0 0; }
.tracking-indicator { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid #acd1bd; border-radius: 50%; background: #d2e8d9; }
.tracking-indicator i { width: 12px; height: 12px; border-radius: 50%; background: var(--teal); }
.tracking-panel[data-stage="searching"] .tracking-indicator i { animation: searching-ring 2.3s ease-out infinite; }
@keyframes searching-ring { from { box-shadow: 0 0 0 0 #2b855a70; } to { box-shadow: 0 0 0 12px transparent; } }
.tracking-panel:is([data-stage="cancelled"],[data-stage="no_driver"],[data-stage="unavailable"]) { background: #f7f1e9; }
.tracking-panel .text-button { grid-column: 2; justify-self: start; font-size: 14px; }
.workspace:has(#receipt:not([hidden])) { max-width: 44rem; margin-inline: auto; grid-template-columns: 1fr; }
#new-trip { color: var(--teal); background: transparent; border: 1px solid var(--line); }
#driver-card,#trip-card { margin-block: 20px; }
#driver-heading,#trip-heading { font-size: 19px; margin: 0 0 7px; }
#driver-phone { display: inline-block; color: var(--teal); text-underline-offset: 3px; }
#driver-map,#trip-map { height: clamp(220px, 37vh, 350px); border: 1px solid var(--line); border-radius: 12px; background: #e3ebe4; direction: ltr; }
.driver-map-key { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 13px; }
.driver-map-key span { display: inline-flex; align-items: center; gap: 5px; }
.driver-map-key i { width: 12px; height: 10px; display: inline-block; }
.car-key-dot { background: var(--teal); border-radius: 3px; }
.pickup-key-dot { background: #b56332; border: 2px solid #fcf3df; box-shadow: 0 0 0 1px #96502e; border-radius: 50%; }
#fit-driver,#fit-trip { margin-inline-start: auto; font-size: 13px; }
.driver-car-icon,.driver-pickup-icon,.trip-car-icon,.trip-destination-icon { background: transparent; border: 0; }
.destination-key-dot,.destination-marker { background: #813f87; transform: rotate(45deg); border: 2px solid white; box-shadow: 0 0 0 1px #703976; }
.destination-marker { display: block; width: 18px; height: 18px; margin: 2px; }
.car-marker { box-sizing: border-box; position: relative; display: block; width: 31px; height: 42px; border: 3px solid white; border-radius: 10px; background: #11534a; box-shadow: 0 0 0 1px #548172,0 3px 7px #1e453f65; }
.car-marker::before,.car-marker::after { content:""; position:absolute; left:4px; right:4px; height:6px; background:#c5e4d9; border-radius:3px; }
.car-marker::before { top:6px; } .car-marker::after { bottom:5px; height:4px; }
.pickup-marker { display: block; width: 20px; height: 20px; border: 4px solid white; border-radius: 50%; background: #b56332; box-shadow: 0 0 0 2px #985732,0 2px 7px #58361a55; }
#driver-location-note,#trip-location-note { color: var(--muted); font-size: 13px; margin-block-start: 6px; }
.final-fare-card { border: 1px solid var(--line); border-radius: 12px; padding: 17px; margin: 15px 0; background: #f4f6f2; }
.final-fare-card h3 { margin: 0; font-size: 17px; }
.final-fare-card[data-state="final"] { border-color: #b7d2ba; background: #f0f6e4; }
#final-fare-amount:not(:empty) { display: block; margin-top: 4px; font-size: clamp(26px, 5vw, 40px); color: var(--teal); line-height: 1.4; }
.workspace:has(#booking-panel:not([hidden])) .map-panel { align-self: start; width: 100%; }
.workspace:has(.map-panel[hidden]) { grid-template-columns: minmax(0, min(100%, 34rem)); }
.result { border-radius: 11px; background: #edf4ed; border: 1px solid #d7e9d7; padding: 12px 14px; margin-top: 15px; line-height: 1.6; }
.result strong { display: block; font-size: 22px; }
.result .result-label { display: block; font-size: 13px; }
.result .detail { font-size: 13px; color: #3d564c; }
.result.error { background: #fff4eb; border-color: #eed2bd; color: #6d3423; }
.result.pending,.result.notice { background: #f3f6f5; border-color: var(--line); }
.map-panel { display: flex; flex-direction: column; }
.map-toolbar { display: flex; justify-content: space-between; gap: 8px; align-items: center; min-height: 70px; padding: 10px 20px; }
.selector { display: flex; border-radius: 20px; padding: 3px; background: #f0f4f1; }
.selector button { display: inline-flex; align-items:center; border: 1px solid transparent; padding: 4px 11px; min-height: 32px; font-size: 13px; font-weight: 650; color: var(--muted); background: transparent; border-radius: 20px; }
.selector button[aria-pressed="true"] { border-color: #cfdbd5; background: white; color: var(--ink); box-shadow: 0 1px 2px #21453612; }
.selector button .point-symbol { width: 9px; height: 9px; border-width: 2px; }
.map-stage { position: relative; isolation: isolate; flex: 1; min-height: clamp(360px,37vw,565px); }
#map { position: absolute; inset: 0; background: #e3ebe4; direction: ltr; z-index: 0; }
#map.leaflet-container { cursor: crosshair; }
.map-fallback { position: absolute; top: 15px; left: 14px; right: 14px; background: #fffffff2; color: #3c5548; border: 1px solid var(--line); border-radius: 9px; padding: 11px 14px; font-size: 14px; z-index: 1; pointer-events: none; }
.fit-button { position: absolute; z-index: 2; bottom: 26px; left: 12px; display: grid; place-items: center; width: 37px; height: 37px; border-radius: 9px; border: 1px solid #bccdc7; background: #fff; color: var(--teal); box-shadow: 0 1px 3px #233e3925; font: 24px/1 Arial,sans-serif; }
.map-instruction { display: flex; gap: 8px; align-items: center; color: #445b52; padding: 13px 20px; min-height: 49px; font-size: 13px; line-height: 1.5; }
.tap-icon { font: 23px/1 Arial,sans-serif; color: var(--teal); }
.leaflet-control-container .leaflet-bar { border: 1px solid #b8c7c0; border-radius: 8px; overflow: hidden; }
.leaflet-control-container .leaflet-control-zoom a { color: var(--teal); }
.leaflet-control-attribution { font: 10px/1.3 Arial,sans-serif; }
.pin-surface { background: none; border: 0; }
.pin { display: grid; place-items: center; width: 28px; height: 28px; border: 3px solid #fff; background: var(--teal); color: #fff; border-radius: 50% 50% 50% 3px; transform: rotate(-45deg); box-shadow: 0 2px 5px #25403855; }
.pin::after { content: ""; width: 8px; height: 8px; border: 2px solid #fff; border-radius: 50%; }
.pin.end { background: #a65430; }
.pin.end::after { border-radius: 1px; transform: rotate(45deg); }
@media (min-width: 1600px) { .map-stage { min-height: 520px; } }
@media (max-width: 850px) { .wrap { width: calc(100% - 36px); } .workspace { grid-template-columns: minmax(260px,.8fr) minmax(0,1fr); gap: 13px; } .map-toolbar { padding-inline: 13px; } .form-panel { padding: 19px; } }
@media (max-width: 690px) {
  .nav { height: 61px; } .brand { font-size: 23px; gap: 8px; } .brand-mark { width: 32px; height: 32px; border-radius: 9px; } .nav-caption { font-size: 12px; }
  .workspace { display: flex; flex-direction: column; } .map-panel { order: -1; } .map-stage { min-height: 285px; } .map-toolbar { min-height: 51px; }
  h2 { font-size: 18px; } .map-instruction { min-height: 39px; padding: 8px 14px; } .form-panel { padding: 18px; } .panel-heading { margin-bottom: 16px; }
  .place + .place { margin-top: 17px; } .submit-button { margin-top: 20px; } .map-panel,.form-panel { border-radius: 14px; } .intro { padding: 20px 0 18px; } .intro p { margin-top: 5px; }
  .nav-tools { gap: 8px; } .logout-button { font-size: 12px; min-height: 44px; padding-inline: 9px; }
  .intro h1 { font-size: clamp(28px, 8vw, 43px); }
  .map-shortcut { display: inline-flex; align-items: center; min-height: 44px; font-size: 12px; flex-shrink: 0; margin-inline-start: auto; }
  .map-instruction { flex-wrap: wrap; gap: 3px 7px; padding-block: 1px; }
  .selector button,.text-button,.submit-button { min-height: 44px; }
  .coordinates input,.rider-field input { font-size: 16px; }
  #review-title,#receipt-title,#booking-status,#estimate,#result,#map-title { scroll-margin-block: 12px; }
  #receipt .trip-review div:first-child { display: grid; justify-content: start; }
  #receipt .trip-review div:first-child dd { text-align: start; }
}
@media (max-width: 380px) {
  .nav { min-height: 61px; height: auto; padding-block: 5px; }
  .nav-tools { flex-wrap: wrap; justify-content: end; gap: 3px 7px; }
  .brand { font-size: 20px; gap: 5px; flex-shrink: 0; } .brand-mark { width: 28px; height: 28px; }
  .map-toolbar { gap: 3px; padding-inline: 9px; } .selector button { padding-inline: 8px; }
}
@media (prefers-reduced-motion: reduce) { *,*::after,*::before { scroll-behavior:auto !important; transition-duration:0s !important; animation-duration:0s !important; } }
