:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1d2129;
  --panel-3: #242932;
  --border: #343a46;
  --text-primary: #f5f3ee;
  --text-secondary: #d5d5d5;
  --text-muted: #aeb3bd;
  --hw-gold: #ffc107;
  --passenger-brand-primary: #000000;
  --passenger-on-primary: #ffffff;
  --passenger-on-accent: #111111;
  --attention: #ff6b6b;
  --success: #43c980;
  color-scheme: dark;
}

html { background: #000; }
body {
  min-height: 100%;
  background:
    radial-gradient(circle at 50% -16rem, rgba(255,193,7,.12), transparent 32rem),
    linear-gradient(180deg, #090a0c 0, var(--bg) 24rem);
  letter-spacing: -.005em;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .13;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 24px 24px;
}

header {
  min-height: 66px; padding: max(9px, env(safe-area-inset-top)) 16px 9px;
  background: var(--passenger-brand-primary); border-color: rgba(255,255,255,.25); backdrop-filter: blur(18px);
}
header img { height: 44px; width: auto; }
header { color: var(--passenger-on-primary); }
header img[hidden], .center-panel img[hidden] { display: none; }
header #operatorHeaderName { max-width: 42vw; font-size: 1rem; overflow-wrap: anywhere; }
header .powered-by { margin-left: auto; color: var(--passenger-on-primary); font-size: .7rem; opacity: .9; white-space: nowrap; }
#whoami { color: var(--passenger-on-primary); }
#whoami { max-width: 48%; text-align: right; color: var(--passenger-on-primary); }
.account-menu-wrap { position: relative; flex: none; }
.account-menu-wrap[hidden], #accountMenu[hidden] { display: none; }
#accountMenuButton { min-width: 44px; min-height: 44px; border: 1px solid var(--border); border-radius: 9px; background: var(--panel-3); color: var(--text-primary); font-size: 1.25rem; cursor: pointer; }
#accountMenu { position: absolute; right: 0; top: calc(100% + 6px); width: min(220px, 70vw); z-index: 35; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-3); box-shadow: 0 12px 28px rgba(0,0,0,.45); }
#accountMenu button { width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 7px; background: transparent; color: var(--text-primary); text-align: left; font: inherit; cursor: pointer; }
#accountMenu button:hover, #accountMenu button:focus-visible { background: var(--panel-2); }
main { max-width: 520px; padding: 18px 14px calc(32px + env(safe-area-inset-bottom)); }
.service-health { max-width: 492px; margin: 12px auto 0; padding: 12px 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; border: 2px solid var(--hw-gold); border-radius: 10px; background: #000; color: #fff; }
.service-health[hidden] { display: none; }
.service-health strong, .service-health span { display: block; }
.service-health span { color: var(--text-secondary); margin-top: 3px; font-size: .82rem; }
.service-health[data-kind="critical"] { border-color: var(--attention); }

h1, h2, h3 { letter-spacing: -.035em; }
h1 { font-size: clamp(1.8rem, 7vw, 2.35rem); line-height: 1.06; }
h2 { font-size: 1.25rem; line-height: 1.15; }
h3 { margin: 0; font-size: 1rem; }
p { margin: .55rem 0; }
.eyebrow { color: var(--hw-gold); font-size: .7rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; margin-bottom: 5px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.lede { color: var(--text-secondary); font-size: .96rem; margin: 10px 0 0; max-width: 34rem; }
.hint { color: var(--text-muted); line-height: 1.45; }
.muted-strong { color: var(--text-secondary); font-weight: 750; }

.panel {
  background: linear-gradient(145deg, rgba(29,33,41,.98), rgba(18,20,25,.98));
  border-color: rgba(255,255,255,.13); border-radius: 20px; padding: 18px; margin-bottom: 14px;
  box-shadow: 0 18px 55px rgba(0,0,0,.22);
}
.hero-panel { padding: 22px 18px; overflow: hidden; position: relative; }
.hero-panel::after { content: ""; position: absolute; width: 150px; height: 150px; right: -68px; top: -72px; border: 28px solid rgba(255,193,7,.12); border-radius: 50%; }
.center-panel { max-width: 440px; margin: 4vh auto; padding: 20px; }
.center-panel img.brand { height: 116px; }
.tagline { color: var(--text-secondary); font-size: .92rem; }

label { margin: 14px 0 6px; color: var(--text-secondary); font-size: .78rem; letter-spacing: .015em; }
input, select, textarea {
  min-height: 50px; border-radius: 13px; padding: 13px 14px; background: #111319;
  border-color: #3a404c; transition: border-color .16s ease, box-shadow .16s ease;
}
input::placeholder, textarea::placeholder { color: #868c96; }
input:focus, select:focus, textarea:focus { border-color: var(--hw-gold); box-shadow: 0 0 0 3px rgba(255,193,7,.13); }
:focus-visible { outline: 3px solid var(--hw-gold); outline-offset: 3px; }

.btn { min-height: 50px; border-radius: 13px; padding: 13px 17px; font-size: .94rem; transition: transform .12s ease, filter .12s ease; }
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--hw-gold); color: var(--passenger-on-accent); box-shadow: 0 8px 24px rgba(255,193,7,.14); }
.btn-secondary { background: #242932; border-color: #3c4350; }
.btn-quiet { background: transparent; color: var(--text-secondary); border: 1px solid transparent; }
.btn-danger { background: rgba(255,107,107,.12); color: #ffb2b2; border: 1px solid rgba(255,107,107,.38); }
.btn-sm { min-height: 44px; }
.button-stack { display: grid; gap: 9px; margin-top: 16px; }
.button-row { display: flex; gap: 9px; align-items: center; }
.button-row > * { flex: 1; }

.overlay { background: rgba(0,0,0,.76); backdrop-filter: blur(8px); }
.overlay-panel {
  display: flex; flex-direction: column; width: min(100%, 520px); max-height: min(94dvh, 920px);
  padding: 0; overflow: hidden; border-radius: 24px 24px 0 0; background: #15181e;
  border: 1px solid rgba(255,255,255,.16); box-shadow: 0 -24px 80px rgba(0,0,0,.48);
}
.overlay-header { flex: none; min-height: 66px; padding: 14px 16px 10px; margin: 0; border-bottom: 1px solid rgba(255,255,255,.08); }
#newBookingBody, #actionBody { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.action-sheet #actionBody { padding: 4px 18px calc(18px + env(safe-area-inset-bottom)); }
.btn-icon { border-radius: 999px; background: rgba(255,255,255,.07); min-height: 46px; min-width: 46px; }

.booking-flow { min-height: min(620px, calc(94dvh - 67px)); display: flex; flex-direction: column; }
.booking-progress { flex: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; padding: 14px 18px 0; }
.booking-progress span { height: 3px; border-radius: 999px; background: #343945; }
.booking-progress span.done, .booking-progress span.active { background: var(--hw-gold); }
.booking-step-label { padding: 10px 18px 0; color: var(--text-muted); font-size: .74rem; font-weight: 750; }
.booking-screen { flex: 1; padding: 10px 18px 24px; }
.booking-screen h3 { font-size: 1.65rem; line-height: 1.08; margin-bottom: 7px; }
.booking-actions {
  flex: none; position: sticky; bottom: 0; display: grid; grid-template-columns: auto 1fr; gap: 9px;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(21,24,30,.72), #15181e 24%); border-top: 1px solid rgba(255,255,255,.08);
}
.booking-actions.solo { grid-template-columns: 1fr; }
.booking-actions .btn-quiet { width: auto; min-width: 88px; }
.field-error { color: #ffb2b2; font-size: .82rem; min-height: 1.2rem; margin: 10px 0 0; }

.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 14px 0; }
.choice-card { min-height: 62px; padding: 11px; border-radius: 14px; border: 1px solid #3b414d; background: #111319; color: var(--text-primary); text-align: left; cursor: pointer; }
.choice-card strong { display: block; font-size: .94rem; }
.choice-card span { display: block; color: var(--text-muted); font-size: .74rem; margin-top: 2px; }
.choice-card.selected { border-color: var(--hw-gold); background: rgba(255,193,7,.11); box-shadow: inset 0 0 0 1px rgba(255,193,7,.35); }
.compact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.section-rule { height: 1px; background: rgba(255,255,255,.09); margin: 17px 0; }

.address-field { position: relative; }
.address-suggestions { border-radius: 0 0 13px 13px; background: #20242c; }
.address-suggestion { min-height: 50px; padding: 12px; }
.address-suggestion.active { background: rgba(255,193,7,.12); }
.stop-item { align-items: flex-start; background: transparent; border: 0; padding: 0; margin: 8px 0; }
.stop-remove { min-width: 46px; min-height: 50px; border-radius: 12px; color: #ff9f9f; background: rgba(255,107,107,.08); }
.route-fields { position: relative; padding-left: 24px; }
.route-fields::before { content: ""; position: absolute; left: 7px; top: 36px; bottom: 38px; width: 2px; background: linear-gradient(var(--hw-gold), #686f7b); }
.route-marker { position: relative; }
.route-marker::before { content: ""; position: absolute; left: -22px; top: 42px; width: 9px; height: 9px; border-radius: 50%; background: var(--hw-gold); box-shadow: 0 0 0 4px #15181e; }
.route-marker.destination::before { border-radius: 2px; background: #f5f3ee; }

.review-card, .route-card { background: #101217; border: 1px solid rgba(255,255,255,.12); border-radius: 16px; padding: 14px; margin: 13px 0; }
.review-line { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.review-line:last-child { border-bottom: 0; }
.review-line span { color: var(--text-muted); font-size: .78rem; }
.review-line strong { max-width: 65%; text-align: right; font-size: .85rem; }
.fare-preview { text-align: left; border-radius: 16px; background: rgba(255,193,7,.08); border-color: rgba(255,193,7,.32); padding: 14px; }
.fare-preview .amount { font-size: 2rem; color: var(--text-primary); }
.secure-note { display: flex; gap: 9px; align-items: flex-start; color: var(--text-muted); font-size: .78rem; }
.secure-note::before { content: "✓"; display: grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 50%; background: rgba(67,201,128,.14); color: var(--success); font-weight: 900; }

.status-hero { position: relative; padding: 21px 18px; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 5px 10px; border-radius: 999px; background: rgba(255,193,7,.12); color: #ffd654; font-size: .72rem; font-weight: 850; letter-spacing: .035em; }
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-heading { font-size: 1.72rem; margin: 12px 0 6px; }
.job-route { display: grid; gap: 9px; margin: 16px 0 8px; }
.route-point { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; font-size: .9rem; }
.route-point::before { content: ""; width: 9px; height: 9px; margin: 5px 0 0 4px; border-radius: 50%; background: var(--hw-gold); }
.route-point.destination::before { border-radius: 2px; background: var(--text-primary); }
.route-point.stop::before { background: #7b8290; }
.status-track { flex-direction: row; gap: 5px; margin: 18px 0 4px; }
.status-step { flex: 1; display: block; padding: 0; opacity: 1; }
.status-step .step-dot { width: 100%; height: 4px; border-radius: 999px; background: #3c424d; }
.status-step .step-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.status-step.active .step-dot { box-shadow: none; }
.driver-card { gap: 12px; justify-content: flex-start; border: 1px solid rgba(255,255,255,.1); border-radius: 16px; background: #111319; padding: 14px; }
.driver-avatar { width: 54px; height: 54px; border-radius: 15px; background: var(--hw-gold); color: #000; display: grid; place-items: center; font-weight: 900; overflow: hidden; flex: none; }
.freshness { margin-top: 7px; padding: 8px 10px; border-radius: 10px; background: rgba(67,201,128,.09); color: #a8eac5; font-size: .76rem; }
.freshness.stale, .freshness.unavailable { background: rgba(255,193,7,.09); color: #ffe08a; }
.customer-tracking-map-slot { height: 220px; border-radius: 16px; border: 1px solid rgba(255,255,255,.1); }
.detail-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; }
.detail-chip { padding: 6px 9px; border-radius: 999px; background: #292e38; color: var(--text-secondary); font-size: .72rem; }

.notice { border-radius: 14px; padding: 12px 13px; background: rgba(79,140,255,.1); border: 1px solid rgba(79,140,255,.26); color: #c9ddff; font-size: .84rem; }
.notice.attention { background: rgba(255,193,7,.09); border-color: rgba(255,193,7,.3); color: #ffe49b; }
.notice.error { background: rgba(255,107,107,.1); border-color: rgba(255,107,107,.3); color: #ffc0c0; }
.booking-row { cursor: default; border-radius: 14px; padding: 13px; }
.booking-row .job-route { margin: 0 0 7px; }
#toast { bottom: calc(18px + env(safe-area-inset-bottom)); min-width: min(300px, 88vw); border-radius: 12px; background: #292e38; box-shadow: 0 14px 40px rgba(0,0,0,.45); }

@media (min-width: 560px) {
  .overlay { align-items: center; padding: 22px; }
  .overlay-panel { border-radius: 24px; }
}
@media (max-width: 430px) {
  header { flex-wrap: nowrap; padding-left: 14px; padding-right: 14px; }
  header img { height: 40px; max-width: 45vw; }
  #whoami { flex: none; font-size: .68rem; }
  .overlay-panel { max-height: 96dvh; }
  .booking-flow { min-height: calc(96dvh - 67px); }
  .booking-screen { padding-left: 16px; padding-right: 16px; }
  .booking-actions { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 350px) {
  .compact-grid, .choice-grid { grid-template-columns: 1fr; }
  .booking-screen h3 { font-size: 1.45rem; }
  .review-line { display: block; }
  .review-line strong { display: block; max-width: none; text-align: left; margin-top: 3px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
