/* CX Drive app design kit — shared by the rider and driver web apps.
   Brand: charcoal #1F2226, amber #F0A406 (from the logo). Amber surfaces carry charcoal text. */
:root {
  --brand: #F0A406; --brand-press: #D89300; --brand-tint: #FFF6E0; --brand-ink: #7A5200;
  --ink: #1F2226; --ink-2: #3A3E44; --muted: #5F656C; --line: #E6E7E4; --line-2: #D5D8D3;
  --bg: #F6F6F4; --card: #FFFFFF; --good: #1E6B45; --good-tint: #E4F2EA; --bad: #A12A1C; --bad-tint: #FCEAE7;
  --warn-ink: #5C4600; --warn-tint: #FFF3C9;
  --r-sm: 10px; --r: 14px; --r-lg: 22px;
  --shadow: 0 1px 2px rgba(31,34,38,.06), 0 4px 16px rgba(31,34,38,.08);
  --shadow-up: 0 -6px 24px rgba(31,34,38,.12);
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 16px; line-height: 1.4; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand-ink); }
img { max-width: 100%; }
h1, h2, h3, p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- layout ---------- */
.app { min-height: 100dvh; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; background: var(--bg); position: relative; }
.screen { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.screen.enter { animation: fade-in .22s ease; }
.pad { padding: 20px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 12px; }
.row > .grow { flex: 1; min-width: 0; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid-3 { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; }
.scroll-y { overflow-y: auto; -webkit-overflow-scrolling: touch; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes slide-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.12); opacity: .7; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + var(--safe-top)) 16px 10px; background: var(--ink); color: #fff; border-bottom: 3px solid var(--brand); }
.topbar .logo { height: 24px; display: block; }
.topbar .tag { font-size: 13px; font-weight: 600; color: #C9CDD2; }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; border: none; display: inline-grid; place-items: center; background: rgba(255,255,255,.1); color: inherit; cursor: pointer; }
.icon-btn.light { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.icon-btn svg { width: 22px; height: 22px; }

/* ---------- type ---------- */
.h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.h2 { font-size: 20px; font-weight: 750; letter-spacing: -.01em; }
.h3 { font-size: 16px; font-weight: 700; }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }
.big-num { font-size: 32px; font-weight: 800; letter-spacing: -.02em; }
.plate { display: inline-block; background: var(--brand); color: var(--ink); font-weight: 800; letter-spacing: .04em; padding: 6px 10px; border-radius: 6px; font-size: 15px; }

/* ---------- buttons ---------- */
.btn { min-height: 52px; padding: 0 18px; border-radius: var(--r); border: none; cursor: pointer; font-weight: 750; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--brand); color: var(--ink);
  transition: transform .06s ease, background .15s ease; text-decoration: none; }
.btn:active { transform: scale(.98); background: var(--brand-press); }
.btn.block { width: 100%; }
.btn.lg { min-height: 58px; font-size: 17px; border-radius: 16px; }
.btn.secondary { background: #fff; color: var(--ink); border: 1.5px solid var(--line-2); }
.btn.secondary:active { background: #F1F2EF; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.danger { background: var(--bad); color: #fff; }
.btn.ghost { background: transparent; color: var(--brand-ink); min-height: 44px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn .spinner { border-color: rgba(31,34,38,.25); border-top-color: var(--ink); }
.btn.dark .spinner, .btn.danger .spinner { border-color: rgba(255,255,255,.3); border-top-color: #fff; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--line-2); border-top-color: var(--brand); animation: spin .8s linear infinite; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* ---------- inputs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 14px; font-weight: 650; }
.input { height: 54px; border: 1.5px solid var(--line-2); border-radius: var(--r); padding: 0 16px; font-size: 17px; background: #fff; width: 100%; }
.input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 4px rgba(240,164,6,.18); }
.input.code { font-size: 28px; letter-spacing: .5em; text-align: center; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 14px; border-radius: 22px; border: 1.5px solid var(--line-2); background: #fff; font-weight: 650; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- cards, lists ---------- */
.card { background: var(--card); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.card.tint { background: var(--brand-tint); box-shadow: none; }
.option { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 66px; border-radius: var(--r); border: 2px solid var(--line); background: #fff; cursor: pointer; text-align: left; transition: border-color .15s, background .15s; }
.option[aria-checked="true"] { border-color: var(--brand); background: var(--brand-tint); }
.option .car { width: 48px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: #F1F2EF; flex: none; }
.searching svg { width: 34px; height: 34px; }
.btn svg { width: 20px; height: 20px; flex: none; }
.option[aria-checked="true"] .car { background: var(--brand); }
.option .price { font-weight: 800; font-size: 17px; }
.list-row { width: 100%; display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 10px 2px; border: none; background: none; border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; }
.list-row:last-child { border-bottom: none; }
.list-row .ico { width: 38px; height: 38px; border-radius: 19px; display: grid; place-items: center; background: #F1F2EF; flex: none; }
.list-row .ico svg { width: 18px; height: 18px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--good-tint); color: var(--good); }
.pill.warn { background: var(--warn-tint); color: var(--warn-ink); }
.pill.bad { background: var(--bad-tint); color: var(--bad); }
.pill.brand { background: var(--brand-tint); color: var(--brand-ink); }
.pill .dot { width: 8px; height: 8px; border-radius: 4px; background: currentColor; }
.divider { height: 1px; background: var(--line); margin: 4px 0; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.kv > span:first-child { color: var(--muted); }

/* ---------- map + bottom sheet ---------- */
.map-wrap { position: relative; flex: 1; min-height: 260px; background: #E8ECE5; overflow: hidden; }
.map { position: absolute; inset: 0; }
.map-fallback { position: absolute; inset: 0; background:
  linear-gradient(90deg, transparent 47%, #fff 47%, #fff 53%, transparent 53%) 0 0 / 160px 160px,
  linear-gradient(0deg, transparent 47%, #fff 47%, #fff 53%, transparent 53%) 0 0 / 220px 220px,
  linear-gradient(135deg, #E4EBDD 0%, #EEF1EA 60%, #E6ECE2 100%); }
.map-pin { position: absolute; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; pointer-events: none; transition: left .8s ease, top .8s ease; }
.map-pin .label { background: #fff; padding: 4px 8px; border-radius: 8px; font-size: 12px; font-weight: 700; box-shadow: var(--shadow); white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.map-pin .dot { width: 18px; height: 18px; border-radius: 9px; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.map-pin.pickup .dot { background: var(--good); }
.map-pin.drop .dot { background: var(--ink); border-radius: 4px; }
.map-pin.car .dot { background: var(--brand); width: 22px; height: 22px; border-radius: 11px; animation: pulse 2s ease infinite; }
.map-pin.me .dot { background: #2F7CF6; }
.map-float { position: absolute; z-index: 3; top: calc(12px + var(--safe-top)); left: 12px; right: 12px; display: flex; justify-content: space-between; pointer-events: none; }
.map-float > * { pointer-events: auto; }
.sheet { position: relative; z-index: 4; background: #fff; border-radius: 26px 26px 0 0; box-shadow: var(--shadow-up); margin-top: -26px;
  padding: 10px 20px calc(20px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 14px; max-height: 70dvh; overflow-y: auto; }
.sheet::before { content: ""; align-self: center; width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); flex: none; }
.where { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 0 16px; border-radius: var(--r); border: none; background: #F1F2EF; font-size: 17px; font-weight: 700; cursor: pointer; text-align: left; width: 100%; }
.where svg { width: 20px; height: 20px; flex: none; }
.route { display: flex; flex-direction: column; gap: 2px; background: #F6F6F4; border-radius: var(--r); padding: 6px 12px; }
.route button { all: unset; cursor: pointer; display: flex; align-items: center; gap: 12px; min-height: 48px; }
.route button:focus-visible { outline: 3px solid var(--brand); border-radius: 8px; }
.route .mark { width: 10px; height: 10px; border-radius: 5px; background: var(--good); flex: none; }
.route .mark.sq { background: var(--ink); border-radius: 2px; }
.route .t { display: flex; flex-direction: column; min-width: 0; }
.route .t small { color: var(--muted); font-size: 12px; }
.route .t b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }

/* ---------- bottom tab bar ---------- */
.tabbar { position: sticky; bottom: 0; z-index: 6; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: #fff; border-top: 1px solid var(--line); padding-bottom: var(--safe-bottom); }
.tabbar button { border: none; background: none; min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; border-top: 3px solid transparent; }
.tabbar button[aria-selected="true"] { color: var(--ink); border-top-color: var(--brand); }
.tabbar svg { width: 22px; height: 22px; }

/* ---------- full-screen panel (search, account) ---------- */
.panel { position: fixed; inset: 0; z-index: 20; background: var(--bg); display: flex; flex-direction: column; animation: slide-up .25s ease; max-width: 560px; margin: 0 auto; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: calc(12px + var(--safe-top)) 16px 12px; background: #fff; border-bottom: 1px solid var(--line); }
.panel-body { flex: 1; overflow-y: auto; padding: 16px 20px calc(24px + var(--safe-bottom)); }

/* ---------- toast, dialog ---------- */
.toast { position: fixed; left: 50%; bottom: calc(84px + var(--safe-bottom)); transform: translateX(-50%); z-index: 50; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow); max-width: calc(100vw - 32px); display: flex; align-items: center; gap: 12px; animation: fade-in .2s ease; }
.toast.bad { background: var(--bad); }
.toast button { background: var(--brand); color: var(--ink); border: none; border-radius: 8px; padding: 8px 12px; font-weight: 800; cursor: pointer; }
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(20,22,25,.5); display: flex; align-items: flex-end; justify-content: center; animation: fade-in .15s ease; }
.dialog { width: 100%; max-width: 560px; background: #fff; border-radius: 26px 26px 0 0; padding: 22px 20px calc(22px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 14px; animation: slide-up .25s ease; max-height: 92dvh; overflow-y: auto; }

/* ---------- install sheet ---------- */
.install-hero { display: flex; align-items: center; gap: 14px; }
.install-hero img { width: 64px; height: 64px; border-radius: 16px; box-shadow: var(--shadow); }
.steps { display: flex; flex-direction: column; gap: 10px; counter-reset: step; }
.steps li { list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r); background: #F6F6F4; font-weight: 600; }
.steps li::before { counter-increment: step; content: counter(step); width: 28px; height: 28px; border-radius: 14px; background: var(--brand); color: var(--ink); display: grid; place-items: center; font-weight: 800; flex: none; }
.steps svg { width: 22px; height: 22px; vertical-align: -5px; }
.install-banner { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border-radius: var(--r); background: #fff; border: 1px solid var(--line); }
.install-banner img { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.install-banner .t { flex: 1; min-width: 0; }
.install-banner .t b { display: block; font-size: 15px; }
.install-banner .t span, .install-banner .t b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.install-banner .t span { display: block; font-size: 13px; color: var(--muted); }

/* ---------- misc ---------- */
.stars { display: flex; gap: 6px; justify-content: center; }
.stars button { width: 52px; height: 52px; border: none; background: none; cursor: pointer; font-size: 38px; color: #C6CAC5; line-height: 1; }
.stars button.on { color: var(--brand); }
.countdown { width: 54px; height: 54px; border-radius: 27px; display: grid; place-items: center; font-weight: 800; font-size: 18px; background: conic-gradient(var(--brand) var(--p, 100%), #EEE 0); position: relative; }
.countdown::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #fff; }
.countdown span { position: relative; z-index: 1; }
.searching { width: 84px; height: 84px; border-radius: 42px; background: var(--brand-tint); display: grid; place-items: center; align-self: center; position: relative; }
.searching::before, .searching::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--brand); animation: ring 1.8s ease-out infinite; }
.searching::after { animation-delay: .9s; }
@keyframes ring { from { transform: scale(.7); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }
.big-toggle { width: 100%; min-height: 72px; border-radius: 20px; border: none; font-size: 20px; font-weight: 800; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 12px; }
.big-toggle.on { background: var(--good); color: #fff; }
.big-toggle.off { background: var(--brand); color: var(--ink); }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 110px; }
.bars div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.bars i { display: block; width: 100%; border-radius: 6px 6px 3px 3px; background: #F5D58C; }
.bars .today i { background: var(--brand); }
.bars .today { color: var(--ink); font-weight: 800; }
.doc-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.doc-row:last-child { border-bottom: none; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.brand-hero { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 10px; }
.brand-hero img { width: 210px; }
