/* ==========================================================================
   TAD — design tokens
   Apple-like: system type, near-black ink on #F5F5F7, flat white tiles,
   one blue for actions, pills for controls. Shadow only on things that float.
   ========================================================================== */
:root {
  --canvas: #f5f5f7;
  --surface: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #424245;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --fill: #e8e8ed;          /* secondary buttons, segmented tracks, chips */
  --fill-2: #f2f2f4;        /* insets inside white tiles */
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --blue-soft: #e6f0fc;
  --link: #0066cc;
  --green: #1d7d36;
  --green-soft: #e7f6ea;
  --red: #d70015;
  --red-soft: #fdecec;
  --amber: #a14e00;
  --amber-soft: #fff3e0;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter",
          "Helvetica Neue", Helvetica, Arial, sans-serif;
  --r-xl: 28px;   /* hero, floating panel */
  --r-lg: 20px;   /* tiles */
  --r-md: 14px;   /* rows, options, inputs */
  --r-sm: 10px;
  --pill: 980px;
  --nav-h: 52px;
  --float: 0 18px 50px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.06);
  --ring: 0 0 0 4px rgba(0, 113, 227, 0.28);

  /* motion: soft expo-out settles, quick exits, a gentle spring for selection */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --spring-soft: cubic-bezier(0.3, 1.3, 0.6, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.022em;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 0;
}
[hidden] { display: none !important; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--ink); margin: 0 0 0.5em; font-weight: 700; }
h1 { font-size: 40px; line-height: 1.1; letter-spacing: -0.035em; }
h2 { font-size: 28px; line-height: 1.14; letter-spacing: -0.03em; }
h3 { font-size: 21px; line-height: 1.2; letter-spacing: -0.02em; font-weight: 600; }
p { margin: 0 0 0.8em; }
.muted { color: var(--muted); }
.small { font-size: 14px; letter-spacing: -0.01em; }
.lead { font-size: 21px; line-height: 1.38; color: var(--ink-2); letter-spacing: -0.02em; max-width: 34em; }
.lead-sm { font-size: 17px; color: var(--ink-2); }
.error { color: var(--red); font-size: 15px; margin: 12px 0 0; }
.hint { color: var(--muted); font-size: 14px; margin: 10px 2px; }
.nowrap { white-space: nowrap; }
.num, .money, .fare-big, .wallet-balance, .plan-total, .v-price, .stats strong, .trip-money { font-variant-numeric: tabular-nums; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.86em; background: var(--fill); padding: 2px 6px; border-radius: 6px; }

/* ---------- top bar (frosted) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 1000;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 max(22px, calc((100vw - 1080px) / 2));
  background: rgba(251, 251, 253, 0.78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.app-view .topbar { padding: 0 22px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 700;
  font-size: 19px; letter-spacing: -0.03em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-dot { width: 18px; height: 18px; border-radius: 6px; background: var(--ink); position: relative; }
.brand-dot::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--surface); }
.topbar nav { display: flex; align-items: center; gap: 22px; min-width: 0; }
.topbar nav a:not(.btn), .linklike { color: var(--ink-2); font-size: 14px; letter-spacing: -0.01em; white-space: nowrap;
  background: none; border: 0; padding: 0; font-family: inherit; cursor: pointer; }
.topbar nav a:not(.btn):hover, .linklike:hover { color: var(--ink); text-decoration: none; }
.nav-wallet { background: var(--fill); padding: 6px 12px; border-radius: var(--pill); color: var(--ink) !important;
  font-weight: 600; font-variant-numeric: tabular-nums; }
.nav-wallet.negative { background: var(--red-soft); color: var(--red) !important; }
form.inline { display: inline; margin: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 22px;
  background: var(--blue); color: #fff; border: 0; border-radius: var(--pill);
  font: 600 17px/1 var(--font); letter-spacing: -0.02em;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .25s var(--ease-out), transform .45s var(--spring), box-shadow .3s var(--ease-out);
}
.btn:hover { background: var(--blue-hover); text-decoration: none; color: #fff; }
.btn:active { transform: scale(0.955); transition-duration: .09s; }
.btn:disabled { background: var(--fill); color: #aeaeb2; cursor: not-allowed; transform: none; }
.btn-ghost { background: var(--fill); color: var(--ink); }
.btn-ghost:hover { background: #dedee3; color: var(--ink); }
.btn-small { min-height: 34px; padding: 0 15px; font-size: 14px; }
.btn-large { min-height: 52px; font-size: 17px; }
.btn-block { width: 100%; margin-top: 10px; }
.btn-dark { background: var(--ink); }
.btn-dark:hover { background: #000; }
.text-btn { background: none; border: 0; padding: 4px 0; color: var(--link); font: 500 15px var(--font);
  letter-spacing: -0.01em; cursor: pointer; }
.text-btn:hover { text-decoration: underline; }
.text-btn:disabled { color: var(--muted); cursor: default; text-decoration: none; }
.text-btn.danger, .linkbtn.danger { color: var(--red); }
.linkbtn { background: none; border: 0; padding: 0; font: 14px var(--font); color: var(--link); cursor: pointer; }
.icon-btn { background: var(--fill); border: 0; width: 26px; height: 26px; border-radius: 50%; font-size: 17px;
  line-height: 1; color: var(--ink-2); cursor: pointer; flex: none; }
.icon-btn:hover { background: #dedee3; }

/* ---------- segmented control ---------- */
.segmented { display: flex; background: var(--fill); border-radius: 11px; padding: 2px; gap: 2px; margin: 0 0 16px; }
.segmented button { flex: 1; border: 0; background: transparent; border-radius: 9px; padding: 8px 10px;
  font: 600 14px var(--font); letter-spacing: -0.01em; color: var(--ink-2); cursor: pointer; }
.segmented button[aria-checked="true"] { background: var(--surface); color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 1px 1px rgba(0,0,0,.04); }
.segmented.compact { margin: 0; min-width: 210px; }
.segmented.has-thumb { position: relative; isolation: isolate; }
.segmented.has-thumb button { position: relative; z-index: 1; transition: color .3s var(--ease-out); }
.segmented.has-thumb button[aria-checked="true"] { background: transparent; box-shadow: none; }
.seg-thumb { position: absolute; z-index: 0; top: 2px; bottom: 2px; left: 2px; width: 0; border-radius: 9px; background: var(--surface);
  box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 1px 1px rgba(0,0,0,.04);
  transition: transform .52s var(--spring-soft), width .52s var(--spring-soft); }
.segmented button:active { transform: scale(.96); }
.segmented.compact button { padding: 6px 10px; }

/* ---------- forms ---------- */
.form > div { margin-bottom: 16px; }
.form label, .field-group label, .card-form label { display: block; font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
input, select, textarea { font: 17px var(--font); letter-spacing: -0.02em; color: var(--ink); }
.form input, .form select, .form textarea, .panel input:not([type=checkbox]), .panel select, .panel textarea,
.field-group input, .card-form input, .claim-form input, .section-tools select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  margin-top: 6px; transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px !important; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue) !important; box-shadow: var(--ring); }
.form .helptext, .form ul { font-size: 13px; color: var(--muted); margin: 6px 0 0; padding-left: 18px; }
.form .errorlist { color: var(--red); list-style: none; padding: 0; font-size: 14px; }
.form input[type=checkbox], .form input[type=radio], .check input {
  width: 18px; height: 18px; flex: none; margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none;
  -webkit-appearance: auto; appearance: auto; accent-color: var(--blue); }
.field-label { display: block; font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 0;
  font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field-row > .field-label { margin: 0; }
.field-stack { margin: 18px 0 0; }
.field-stack .segmented { margin: 0; }
.field-row select { width: auto !important; flex: 1; max-width: 260px; margin: 0 !important; }
.field-group { margin-top: 14px; display: grid; gap: 10px; }
.field-group label { margin: 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex !important; align-items: center; gap: 10px; font-weight: 500 !important; color: var(--ink) !important; font-size: 15px !important; }

/* ---------- flash ---------- */
.flash-stack { position: fixed; top: calc(var(--nav-h) + 12px); left: 50%; transform: translateX(-50%); z-index: 1100;
  display: grid; gap: 8px; width: min(520px, calc(100% - 32px)); }
.flash { background: rgba(29,29,31,.92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  color: #fff; padding: 13px 18px; border-radius: 14px; box-shadow: var(--float); font-size: 15px;
  animation: toast-in .6s var(--spring-soft) both, toast-out .5s var(--ease-in) 5.5s forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-18px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-12px) scale(.98); visibility: hidden; } }
.flash-error { background: var(--red); }


/* ---------- pages ---------- */
.page { max-width: 1080px; margin: 0 auto; padding: 40px 22px 96px; }
.page-head { margin: 8px 0 32px; }
.page-head h1 { font-size: 48px; }
.card, .tile { background: var(--surface); border-radius: var(--r-lg); padding: 28px; }
.card.narrow { max-width: 460px; margin: 24px auto; padding: 36px; }
.card.narrow h1 { font-size: 32px; }
.tile-group { margin-top: 36px; display: grid; gap: 14px; }
.tile-group > h2 { font-size: 24px; margin: 0 0 2px; }
.empty, .empty-state { padding: 22px; border-radius: var(--r-md); color: var(--muted); text-align: center; background: var(--fill-2); }
.empty-state { text-align: left; background: var(--surface); border-radius: var(--r-lg); padding: 28px; }
.empty-state p { margin-bottom: 6px; }
.empty-state .btn { margin-top: 12px; }
.back-link { font-size: 15px; }
.tabs { display: flex; background: var(--fill); padding: 2px; border-radius: 11px; margin-bottom: 22px; }
.tabs a { flex: 1; text-align: center; padding: 8px; border-radius: 9px; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.tabs a:hover { text-decoration: none; }
.tabs a.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.note { background: var(--amber-soft); color: #5b3400; border-radius: var(--r-md); padding: 14px 16px; font-size: 15px; margin: 0 0 16px; }
.note-bad { background: var(--red-soft); color: #7a0010; }
.note-ok { background: var(--green-soft); color: #0e4a1f; }
.note a { color: inherit; text-decoration: underline; }

/* ---------- home ---------- */
.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; padding: 48px 0 24px; }
.hero h1 { font-size: clamp(48px, 7vw, 84px); line-height: 1.02; letter-spacing: -0.045em; margin-bottom: 20px; }
.hero .lead { margin-bottom: 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.route-card { margin: 0; background: var(--surface); border-radius: var(--r-xl); padding: 26px 26px 22px; }
.route-card svg { width: 100%; height: auto; display: block; }
.route-card .route-path { fill: none; stroke: var(--blue); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: draw 2.2s cubic-bezier(.65,0,.35,1) .3s forwards; }
.route-card .route-ghost { fill: none; stroke: var(--fill); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.route-card .node { opacity: 0; animation: pop .35s ease forwards; }
.route-card text { font: 600 17px var(--font); fill: var(--ink); letter-spacing: -0.02em; }
.route-card text.sub { font-weight: 400; fill: var(--muted); }
.route-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-top: 1px solid var(--fill); margin-top: 8px; padding-top: 16px; }
.route-foot span { font-size: 15px; }
.route-foot strong { font-size: 24px; letter-spacing: -0.03em; white-space: nowrap; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 56px; }
.feature { background: var(--surface); border-radius: var(--r-lg); padding: 28px; }
.feature h3 { font-size: 24px; letter-spacing: -0.03em; margin-bottom: 8px; }
.feature p { color: var(--ink-2); margin: 0; }

/* ---------- map apps ---------- */
body.app-view { overflow: hidden; }
.map-layout { position: relative; height: calc(100vh - var(--nav-h)); height: calc(100dvh - var(--nav-h)); }
.map { position: absolute; inset: 0; z-index: 1; background: #e9e9ec; }
.panel {
  position: absolute; z-index: 500; top: 18px; left: 18px; bottom: 18px;
  width: 400px; max-width: calc(100% - 36px); overflow-y: auto; overscroll-behavior: contain;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-radius: var(--r-xl); box-shadow: var(--float); padding: 24px 22px;
}
.panel-title { font-size: 32px; letter-spacing: -0.04em; margin-bottom: 16px; }
.panel h2 { font-size: 24px; }
.leaflet-control-attribution { font-size: 10px !important; background: rgba(255,255,255,.7) !important; border-radius: 6px 0 0 0; }
.leaflet-control-zoom a { border-radius: 10px !important; }
.leaflet-bar { border: 0 !important; box-shadow: 0 2px 10px rgba(0,0,0,.12) !important; border-radius: 12px !important; overflow: hidden; }

/* route editor */
.route { position: relative; background: var(--surface); border-radius: var(--r-md); padding: 4px; display: grid; gap: 2px;
  box-shadow: inset 0 0 0 1px var(--line); }
.route::before { content: ""; position: absolute; left: 21px; top: 26px; bottom: 26px; width: 2px; background: var(--fill); }
.trip-field { position: relative; display: flex; align-items: center; gap: 12px; padding: 2px 10px 2px 14px; border-radius: 11px; }
.trip-field.selecting { background: var(--blue-soft); }
.trip-field input { flex: 1; min-width: 0; border: 0 !important; background: transparent !important; box-shadow: none !important;
  padding: 11px 0 !important; margin: 0 !important; font-size: 17px; border-radius: 0 !important; }
.pin { position: relative; z-index: 1; flex: none; width: 14px; height: 14px; display: grid; place-items: center; }
.pin-pickup { background: var(--ink); border-radius: 50%; box-shadow: 0 0 0 3px var(--surface); }
.pin-dropoff { background: var(--ink); border-radius: 3px; box-shadow: 0 0 0 3px var(--surface); }
.pin-stop { width: 18px; height: 18px; margin: 0 -2px; border-radius: 50%; background: var(--blue); color: #fff;
  font-size: 11px; font-weight: 700; box-shadow: 0 0 0 3px var(--surface); }
.route-tools { display: flex; justify-content: space-between; margin: 8px 2px 0; }
.search-results { list-style: none; margin: 6px 0 0; padding: 6px; background: var(--surface); border-radius: var(--r-md);
  max-height: 260px; overflow-y: auto; box-shadow: var(--float); position: relative; z-index: 10; }
.search-results li { padding: 10px 12px; font-size: 15px; cursor: pointer; border-radius: 10px; }
.search-results li:hover, .search-results li:focus { background: var(--fill-2); outline: none; }

.trip-meta { font-size: 14px; color: var(--muted); margin: 14px 2px 10px; }
.vehicle-options { display: grid; gap: 8px; }
.vehicle-option { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--r-md); border: 0; background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; text-align: left; font: inherit; color: inherit;
  transition: box-shadow .35s var(--ease-out), background-color .35s var(--ease-out), transform .45s var(--spring); }
.vehicle-option:hover { box-shadow: inset 0 0 0 1px #aeaeb2; }
.vehicle-option.selected { box-shadow: inset 0 0 0 2px var(--blue); background: var(--blue-soft); }
.vehicle-option.unavailable { opacity: 0.5; }
.v-icon { width: 46px; height: 26px; border-radius: 8px; background: var(--ink); position: relative; }
.v-icon::before, .v-icon::after { content: ""; position: absolute; bottom: -4px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--ink-2); box-shadow: 0 0 0 2px var(--surface); }
.v-icon::before { left: 7px; } .v-icon::after { right: 7px; }
.v-comfort { background: #3a3a3c; } .v-xl { height: 30px; width: 46px; background: #48484a; }
.v-info { display: grid; line-height: 1.25; }
.v-info strong { font-size: 17px; font-weight: 600; }
.v-info small { color: var(--muted); font-size: 13px; }
.v-price { font-weight: 600; display: grid; justify-items: end; font-size: 17px; }
.surge { display: inline-block; font-size: 12px; font-weight: 600; color: var(--amber); background: var(--amber-soft);
  border-radius: var(--pill); padding: 2px 8px; margin-left: 4px; }
.saving { display: inline-block; font-size: 13px; font-weight: 600; color: var(--green); background: var(--green-soft);
  border-radius: var(--pill); padding: 1px 8px; }
.day-chips { display: flex; gap: 6px; }
.day { flex: 1; aspect-ratio: 1; max-width: 42px; border-radius: 50%; border: 0; background: var(--fill); color: var(--ink-2);
  font: 600 14px var(--font); cursor: pointer; }
.day { transition: background-color .3s var(--ease-out), color .3s var(--ease-out), transform .45s var(--spring); }
.day:active { transform: scale(.88); transition-duration: .08s; }
.day.on { background: var(--blue); color: #fff; }
.quote { font-size: 15px; color: var(--ink-2); margin: 16px 2px 0; }
.wallet-line { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--muted); margin: 14px 2px 4px; }

.status-banner { font-weight: 700; font-size: 24px; letter-spacing: -0.03em; line-height: 1.2; margin: 4px 0 14px; }
.status-banner[data-status="arrived"] { color: var(--green); }
.searching { display: flex; gap: 6px; padding: 0 0 16px; }
.searching span { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); animation: pulse 1.2s infinite ease-in-out; }
.searching span:nth-child(2) { animation-delay: .15s; } .searching span:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }

.driver-card, .rider-card { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--surface);
  border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--fill); margin-bottom: 14px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center;
  font-weight: 700; flex: none; text-transform: uppercase; }
.plate { margin-left: auto; font-weight: 700; background: var(--fill); padding: 6px 10px; border-radius: 8px; letter-spacing: .04em;
  font-size: 15px; font-variant-numeric: tabular-nums; }

.itinerary { list-style: none; margin: 0 0 14px; padding: 0; position: relative; display: grid; gap: 10px; }
.itinerary::before { content: ""; position: absolute; left: 6px; top: 10px; bottom: 10px; width: 2px; background: var(--fill); }
.itinerary li { position: relative; display: flex; gap: 14px; align-items: flex-start; }
.itinerary li > span:nth-child(2) { display: grid; line-height: 1.3; }
.itinerary li strong { font-size: 15px; font-weight: 600; }
.it-dot { flex: none; position: relative; z-index: 1; width: 14px; height: 14px; margin-top: 3px; background: var(--ink);
  border-radius: 50%; box-shadow: 0 0 0 3px var(--surface); }
.it-dropoff .it-dot { border-radius: 3px; }
.it-stop .it-dot { background: var(--blue); }
.it-stop.done .it-dot { background: var(--green); }
.it-stop.next strong { color: var(--blue); }
.itinerary .tick { margin-left: auto; color: var(--green); font-weight: 700; }
.itinerary.compact { gap: 4px; margin: 6px 0 0; }
.itinerary.compact::before { top: 6px; bottom: 6px; left: 4px; }
.itinerary.compact .it-dot { width: 10px; height: 10px; margin-top: 5px; }

.trip-summary { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 6px 0; font-size: 15px; }
.trip-summary dt { color: var(--muted); }
.trip-summary dd { margin: 0; }
.trip-summary .itinerary { margin: 0; }
.fare-big { font-size: 48px; font-weight: 700; letter-spacing: -0.04em; margin: 0 0 4px; line-height: 1.05; }
.stars { display: flex; gap: 4px; margin: 4px 0 12px; }
.stars button { font-size: 30px; background: none; border: 0; cursor: pointer; color: #d2d2d7; padding: 0 2px; }
.stars button.on { color: #ff9f0a; }
#rate-box textarea { margin-top: 0 !important; }
.pay-box { border-radius: var(--r-md); padding: 16px; margin: 14px 0; display: grid; gap: 8px; background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--fill); }
.pay-box.cash { background: var(--amber-soft); box-shadow: none; }
.pay-box .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.code-box { display: grid; gap: 4px; justify-items: start; background: var(--fill-2); border-radius: var(--r-md); padding: 16px; margin: 14px 0; }
.code-box strong { font-size: 30px; letter-spacing: 0.12em; font-variant-numeric: tabular-nums; }
.code-box.inline { margin: 16px 0 0; }

/* driver */
.driver-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.driver-head h2 { margin-bottom: 2px; font-size: 28px; letter-spacing: -0.035em; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0; }
.stats-4 { grid-template-columns: repeat(4, 1fr); }
.stats-2 { grid-template-columns: repeat(2, 1fr); }
.stats > div, .stats > a { background: var(--surface); border-radius: var(--r-md); padding: 12px 8px; display: grid; text-align: center;
  color: inherit; box-shadow: inset 0 0 0 1px var(--fill); }
.stats > a:hover { text-decoration: none; box-shadow: inset 0 0 0 1px var(--line); }
.stats strong { font-size: 17px; letter-spacing: -0.02em; }
.stats span { font-size: 12px; color: var(--muted); }
.stats .neg strong, .stats > a.neg strong { color: var(--red); }
.location-tools { margin-bottom: 10px; }
.field-inline { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 14px; }
.request-list { display: grid; gap: 10px; }
.request-card { background: var(--surface); border-radius: var(--r-md); padding: 14px; display: grid; gap: 4px; box-shadow: inset 0 0 0 1px var(--fill); }
.req-top { display: flex; align-items: center; gap: 8px; }
.req-top strong { font-size: 24px; letter-spacing: -0.03em; }
.req-top .muted { margin-left: auto; }
.req-actions { display: flex; gap: 8px; margin-top: 10px; }
.req-actions .btn { flex: 1; }
#nav-link { display: block; text-align: center; margin-top: 12px; }
.switch { position: relative; width: 51px; height: 31px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.slider { position: absolute; inset: 0; background: #e9e9ea; border-radius: 31px; transition: background .2s; }
.slider { transition: background-color .35s var(--ease-out); }
.slider::before { content: ""; position: absolute; width: 27px; height: 27px; left: 2px; top: 2px; background: #fff; border-radius: 50%;
  transition: transform .5s var(--spring-soft), width .25s var(--ease-out); box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.16); }
.switch:active .slider::before { width: 33px; }
.switch input:checked + .slider::before { transition: transform .5s var(--spring-soft), width .25s var(--ease-out), margin .25s var(--ease-out); }
.switch:active input:checked + .slider::before { margin-left: -6px; }
.switch input:checked + .slider { background: #34c759; }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:focus-visible + .slider { box-shadow: var(--ring); }

/* map markers */
.mk { width: 100%; height: 100%; display: grid; place-items: center; font-size: 17px; }
.mk-pickup { background: var(--ink); border-radius: 50%; box-shadow: 0 0 0 4px #fff, 0 3px 10px rgba(0,0,0,.3); }
.mk-dropoff { background: var(--ink); border-radius: 5px; box-shadow: 0 0 0 4px #fff, 0 3px 10px rgba(0,0,0,.3); }
.mk-stop { background: var(--blue); color: #fff; border-radius: 50%; font: 700 12px var(--font);
  box-shadow: 0 0 0 3px #fff, 0 3px 10px rgba(0,0,0,.25); }
.mk-request { background: #ff9f0a; border-radius: 50%; box-shadow: 0 0 0 4px #fff, 0 0 0 10px rgba(255,159,10,.25); }
.mk-car { filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.mk-me { background: #fff; border-radius: 50%; box-shadow: 0 0 0 3px var(--blue), 0 4px 12px rgba(0,0,0,.25); }

/* ---------- tables, badges ---------- */
.history-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.history-head h1 { font-size: 48px; margin: 0; }
.history-head .stats { grid-template-columns: repeat(2, minmax(140px, 1fr)); margin: 0; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-lg); }
.table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--r-lg); overflow: hidden; font-size: 15px; }
.table th, .table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--fill); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table th { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: -0.01em; }
.table .num { text-align: right; white-space: nowrap; }
.table.compact th, .table.compact td { padding: 11px 12px; }
.trip-cell { display: grid; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: -0.005em; padding: 3px 10px; border-radius: var(--pill);
  background: var(--fill); color: var(--ink-2); white-space: nowrap; vertical-align: middle; }
.badge-completed, .badge-confirmed, .badge-paid, .badge-active, .badge-succeeded { background: var(--green-soft); color: var(--green); }
.badge-pending, .badge-awaiting_cash, .badge-scheduled, .badge-requested, .badge-accepted, .badge-arrived, .badge-in_progress, .badge-released { background: var(--amber-soft); color: var(--amber); }
.badge-available { background: var(--blue-soft); color: var(--blue); }
.badge-declined, .badge-disputed, .badge-outstanding, .badge-failed, .badge-review, .badge-rejected { background: var(--red-soft); color: var(--red); }
.badge-cancelled, .badge-expired, .badge-none, .badge-refunded, .badge-missed, .badge-finished { background: var(--fill); color: var(--muted); }
.pos { color: var(--green); } .neg { color: var(--red); }
.statement tr.reversed td { opacity: .5; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.detail { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.detail-map { min-height: 460px; border-radius: var(--r-lg); overflow: hidden; }
.detail .card h1 { font-size: 36px; }
.rate-form { margin-top: 18px; display: grid; gap: 10px; }

/* ---------- wallet ---------- */
.wallet-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; padding: 36px; border-radius: var(--r-xl); }
.wallet-balance { font-size: 64px; font-weight: 700; letter-spacing: -0.05em; margin: 0 0 12px; line-height: 1; }
.wallet-balance.negative { color: var(--red); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: var(--fill); border-radius: var(--pill); padding: 5px 12px; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chip-warn { background: var(--amber-soft); color: var(--amber); }
.chip-bad { background: var(--red-soft); color: var(--red); }
.wallet-nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: 15px; }
.wallet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.wallet-grid h2, .section h2 { font-size: 24px; }
.section { margin-top: 14px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.section-head h2 { margin: 0; }
.section-tools { display: flex; gap: 8px; align-items: center; }
.section-tools select { width: auto; margin: 0; padding: 7px 12px; font-size: 15px; }
.form.stacked { display: grid; gap: 14px; }
.form.stacked label { margin: 0; }
.money-input { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-top: 6px; }
.money-input:focus-within { border-color: var(--blue); box-shadow: var(--ring); }
.money-input span { padding: 0 2px 0 14px; color: var(--muted); font-weight: 600; }
.money-input input, .form .money-input input { border: 0 !important; box-shadow: none !important; margin: 0 !important; padding: 11px 14px 11px 4px; width: 100%; background: transparent; }
.money-input.small { margin: 0; }
.money-input.small input { padding: 7px 8px 7px 2px !important; width: 96px; font-size: 15px; }
.money-input.small span { padding-left: 10px; }
.quick-amounts { display: flex; gap: 8px; }
.quick-amounts button { flex: 1; border: 0; background: var(--fill); border-radius: var(--pill); padding: 8px; font: 600 15px var(--font); cursor: pointer; color: var(--ink); }
.quick-amounts button:hover { background: #dedee3; }
.card-list { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 8px; }
.card-list li { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--r-md); background: var(--fill-2); flex-wrap: wrap; }
.card-list li > span:nth-child(2) { flex: 1; display: grid; min-width: 160px; }
.card-list form { margin: 0; }
.card-chip { width: 64px; height: 42px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; background: #3a3a3c;
  border-radius: 8px; letter-spacing: -0.01em; }
.brand-visa { background: #1a1f71; } .brand-mastercard { background: #1d1d1f; } .brand-amex { background: #2e77bb; }
.brand-discover { background: #d35400; } .brand-unionpay { background: #b5121b; } .brand-verve { background: #00425f; }
.add-card summary { list-style: none; display: inline-flex; }
.add-card summary::-webkit-details-marker { display: none; }
.add-card[open] summary { margin-bottom: 16px; }
.card-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; max-width: 580px; }
.card-form .span-2 { grid-column: span 2; }
.card-form label { margin-bottom: 14px; }
.exchange-list { display: grid; gap: 10px; margin-bottom: 18px; }
.exchange { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px; background: var(--amber-soft);
  border-radius: var(--r-md); flex-wrap: wrap; }
.exchange.disputed { background: var(--red-soft); }
.exchange-main strong { font-size: 21px; letter-spacing: -0.02em; }
.exchange-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.exchange-actions form, .inline-form { margin: 0; display: flex; gap: 6px; align-items: center; }
.cash-form { display: grid; grid-template-columns: 1fr 1.4fr 0.8fr 1fr auto; gap: 10px; align-items: end; }
.cash-form label { margin: 0; }
.activity { list-style: none; padding: 0; margin: 0; display: grid; }
.activity li { display: grid; grid-template-columns: 120px 1fr; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--fill); font-size: 15px; }
.activity li:last-child { border-bottom: 0; }
.activity li[class*="failed"], .activity li.act-cash_disputed { color: var(--red); }
.show-sm { display: none; }

/* ---------- bookings ---------- */
.ready-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.tile.ready { display: grid; gap: 6px; background: var(--blue-soft); }
.route-line { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; margin: 2px 0 6px; }
.gift-note { font-style: italic; color: var(--ink-2); }
.tile.claim { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; margin-top: 14px; }
.tile.claim h2 { font-size: 24px; margin-bottom: 4px; }
.tile.claim p { margin: 0; }
.claim-form { display: flex; gap: 10px; align-items: center; }
.claim-form input { margin: 0; width: 200px; letter-spacing: 0.08em; text-transform: uppercase; }
.plan-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.plan-head h3 { font-size: 24px; letter-spacing: -0.03em; margin-bottom: 4px; }
.plan-side { text-align: right; flex: none; }
.plan-total { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; margin: 8px 0 0; }
.plan-side .muted { margin: 0; }
.plan-trips { margin-top: 16px; border-top: 1px solid var(--fill); padding-top: 12px; }
.plan-trips summary { cursor: pointer; font-weight: 600; font-size: 15px; color: var(--link); }
.trip-rows { list-style: none; margin: 10px 0 0; padding: 0; }
.trip-row { display: grid; grid-template-columns: 1.2fr auto 1fr auto; gap: 12px; align-items: center; padding: 10px 0;
  border-bottom: 1px solid var(--fill); font-size: 15px; }
.trip-row:last-child { border-bottom: 0; }
.trip-row .trip-money { text-align: right; color: var(--ink-2); }
.trip-row .trip-action { display: flex; gap: 14px; justify-content: flex-end; align-items: center; }
.trip-row .trip-action form { margin: 0; }
.trip-row.cancelled, .trip-row.missed { color: var(--muted); }
.plan-cancel { margin: 12px 0 0; }
.plan-cancelled, .plan-finished { opacity: .75; }

/* ---------- mobile testing page (dev) ---------- */
.connect { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 32px; align-items: start; }
.connect-qr { text-align: center; position: sticky; top: calc(var(--nav-h) + 20px); }
.qr-frame svg { width: 100%; max-width: 300px; height: auto; display: block; margin: 0 auto; }
.connect-url { font-size: 15px; word-break: break-all; display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; margin: 14px 0; }
.connect-targets { margin: 0 0 10px; }
.reach { font-size: 14px; min-height: 1.4em; margin: 0; }
.reach .ok { color: var(--green); font-weight: 600; }
.reach .bad { color: var(--red); }
.checklist { padding-left: 22px; display: grid; gap: 12px; }
.checklist strong { display: block; }
.ip-list { display: flex; gap: 8px; flex-wrap: wrap; }
.ip-list .badge { font-size: 14px; padding: 6px 12px; }

/* ---------- small screens ---------- */
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 16px; }
  .features { grid-template-columns: 1fr; margin-top: 32px; }
  .detail, .wallet-grid, .connect { grid-template-columns: 1fr; }
  .detail-map { min-height: 280px; }
  .connect-qr { position: static; }
  .cash-form, .card-form { grid-template-columns: 1fr; }
  .card-form .span-2 { grid-column: auto; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .topbar, .app-view .topbar { padding: 0 14px; gap: 12px; }
  .topbar nav { gap: 14px; overflow-x: auto; scrollbar-width: none; flex: 1 1 auto; justify-content: flex-end; }
  .topbar nav::-webkit-scrollbar { display: none; }
  .brand { font-size: 17px; }
  .topbar:has(.nav-wallet) .brand-name { display: none; }
  .topbar nav { gap: 16px; }
  .hide-sm { display: none !important; }
  .page { padding: 24px 16px 72px; }
  .page-head h1, .history-head h1 { font-size: 36px; }
  .lead { font-size: 18px; }
  .card, .tile, .feature, .empty-state { padding: 22px 18px; }
  .wallet-hero { padding: 26px 20px; }
  .wallet-balance { font-size: 48px; }
  .panel { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-width: 100%; max-height: 62%;
    border-radius: 24px 24px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
  .panel::before { content: ""; display: block; width: 36px; height: 5px; border-radius: 3px; background: #c7c7cc; margin: -6px auto 12px; }
  .panel-title { font-size: 26px; }
  .history-table th:nth-child(3), .history-table td:nth-child(3) { display: none; }
  .statement th:first-child, .statement td:first-child { display: none; }
  .statement th, .statement td { padding: 10px 8px; font-size: 14px; }
  .show-sm { display: inline; }
  .activity li { grid-template-columns: 1fr; gap: 2px; }
  .plan-head { flex-direction: column; }
  .plan-side { text-align: left; }
  .trip-row { grid-template-columns: 1fr auto; }
  .trip-row .trip-money { text-align: left; }
  .claim-form, .claim-form input { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .route-card .route-path { stroke-dashoffset: 0; }
  .route-card .node { opacity: 1; }
}
.claim-form input::placeholder { text-transform: none; letter-spacing: -0.01em; }


/* ==========================================================================
   Motion layer
   ========================================================================== */

/* Pages: the browser cross-fades between pages where it can (Chrome, Edge,
   Safari 18.2+); the top bar stays put and the current-page pill glides. */
@view-transition { navigation: auto; }
.topbar { view-transition-name: topbar; }
.topbar nav a[aria-current="page"] { view-transition-name: nav-current; }
::view-transition-old(root) { animation: vt-out .22s var(--ease-in) both; }
::view-transition-new(root) { animation: vt-in .62s var(--ease-out) both; }
::view-transition-group(nav-current) { animation-duration: .55s; animation-timing-function: var(--spring-soft); }
@keyframes vt-out { to { opacity: 0; transform: scale(.985); filter: blur(2px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px) scale(1.01); filter: blur(3px); } }

.topbar nav a[aria-current="page"]:not(.btn) { color: var(--ink); background: var(--fill); padding: 6px 12px; margin: -6px -12px; border-radius: var(--pill); font-weight: 600; }
.nav-wallet { position: relative; }
.nav-wallet.negative::after { content: ""; position: absolute; top: 2px; right: 2px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 0 2px var(--canvas); }
.nav-wallet.negative { background: var(--fill); color: var(--ink) !important; }

/* Floating panel: arrives once, then slides aside when the map takes over. */
.panel {
  transition: transform .62s var(--ease-out), opacity .45s var(--ease-out), box-shadow .45s var(--ease-out);
  animation: panel-in .8s var(--ease-out) .05s backwards;
  will-change: transform;
}
@keyframes panel-in { from { opacity: 0; transform: translateX(-28px) scale(.985); } }
.map-expanded .panel { transform: translateX(calc(-100% - 40px)); opacity: 0; pointer-events: none;
  transition: transform .55s var(--ease-in-out), opacity .35s var(--ease-in) .1s; }

.map-peek {
  position: absolute; z-index: 600; top: 18px; left: 18px; display: inline-flex; align-items: center; gap: 10px;
  max-width: min(360px, calc(100% - 36px)); padding: 11px 18px 11px 14px; border: 0; border-radius: var(--pill);
  background: rgba(255,255,255,.88); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--float); font: 600 15px var(--font); letter-spacing: -0.015em; color: var(--ink); cursor: pointer;
  opacity: 0; transform: translateY(-14px) scale(.94); pointer-events: none;
  transition: opacity .3s var(--ease-in), transform .35s var(--ease-in);
}
.peek-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.peek-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); flex: none; box-shadow: 0 0 0 0 rgba(0,113,227,.5);
  animation: peek-pulse 2s var(--ease-out) infinite; }
@keyframes peek-pulse { 70% { box-shadow: 0 0 0 9px rgba(0,113,227,0); } 100% { box-shadow: 0 0 0 0 rgba(0,113,227,0); } }
.map-expanded .map-peek { opacity: 1; transform: none; pointer-events: auto;
  transition: opacity .45s var(--ease-out) .25s, transform .7s var(--spring-soft) .25s; }

/* Map pins drop in with a little spring; the pickup "ping" ripples while searching. */
.mk { animation: mk-in .6s var(--spring) both; }
@keyframes mk-in { from { opacity: 0; transform: translateY(-10px) scale(.4); } }
.mk-ping { position: relative; animation: none; pointer-events: none; }
.mk-ping i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(0,113,227,.55); background: rgba(0,113,227,.08);
  animation: ping 2.7s var(--ease-out) infinite; opacity: 0; }
.mk-ping i:nth-child(2) { animation-delay: .9s; }
.mk-ping i:nth-child(3) { animation-delay: 1.8s; }
@keyframes ping { 0% { transform: scale(.12); opacity: .95; } 100% { transform: scale(1); opacity: 0; } }
.leaflet-zoom-anim .leaflet-zoom-animated { transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1) !important; }
.leaflet-fade-anim .leaflet-tile { transition: opacity .25s var(--ease-out); }
.leaflet-control-zoom a { transition: background-color .2s var(--ease-out), transform .35s var(--spring); }
.leaflet-control-zoom a:active { transform: scale(.9); }

/* ---------- map style switcher (top-right glass button + popover) ---------- */
.leaflet-top.leaflet-right .map-style { margin: 14px 14px 0 0; }
.map-style { position: relative; font-family: var(--font); }
.map-style-toggle {
  display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.88); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 4px 16px rgba(0,0,0,.14); color: var(--ink); cursor: pointer;
  transition: transform .4s var(--spring), background-color .3s var(--ease-out), color .3s var(--ease-out);
}
.map-style-toggle:active { transform: scale(.9); transition-duration: .08s; }
.map-style-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.map-style.open .map-style-toggle { background: var(--ink); color: #fff; }
.map-style-toggle:focus-visible, .map-style-menu button:focus-visible { outline: none; box-shadow: var(--ring); }
.map-style-menu {
  position: absolute; top: 50px; right: 0; display: grid; gap: 2px; min-width: 156px; padding: 6px;
  border-radius: 18px; background: rgba(255,255,255,.92); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
  box-shadow: var(--float);
  opacity: 0; transform: translateY(-6px) scale(.9); transform-origin: top right; visibility: hidden;
  transition: opacity .18s var(--ease-in), transform .2s var(--ease-in), visibility 0s linear .2s;
}
.map-style.open .map-style-menu { opacity: 1; transform: none; visibility: visible;
  transition: opacity .3s var(--ease-out), transform .55s var(--spring-soft), visibility 0s; }
.map-style-menu button {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 7px 12px 7px 7px; border: 0; border-radius: 12px;
  background: transparent; color: var(--ink); font: 600 14px var(--font); letter-spacing: -0.01em; text-align: left; cursor: pointer;
  transition: background-color .2s var(--ease-out);
}
.map-style-menu button:hover { background: var(--fill-2); }
.map-style-menu button[aria-checked="true"] { color: var(--blue); }
.map-style-menu button[aria-checked="true"]::after { content: "✓"; margin-left: auto; font-weight: 700; }
.map-style.open .map-style-menu button { animation: style-row-in .45s var(--ease-out) backwards; }
.map-style.open .map-style-menu button:nth-child(2) { animation-delay: .04s; }
.map-style.open .map-style-menu button:nth-child(3) { animation-delay: .08s; }
@keyframes style-row-in { from { opacity: 0; transform: translateX(8px); } }
/* Little previews of each style */
.swatch { flex: none; width: 30px; height: 30px; border-radius: 9px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1);
  transition: transform .45s var(--spring); }
.map-style-menu button[aria-checked="true"] .swatch { box-shadow: inset 0 0 0 1px rgba(0,0,0,.1), 0 0 0 2px #fff, 0 0 0 4px var(--blue); }
.swatch-standard, .swatch-light, .swatch-dark { background:
  linear-gradient(28deg, transparent 46%, #f7d38a 46% 54%, transparent 54%),
  linear-gradient(-62deg, transparent 58%, #fff 58% 66%, transparent 66%),
  radial-gradient(circle at 78% 22%, #aad3df 0 26%, transparent 27%),
  radial-gradient(circle at 18% 82%, #c8e7b4 0 30%, transparent 31%), #f2efe9; }
/* Previews use the very same filters as the map, so they always match. */
.swatch-light { filter: grayscale(.92) brightness(1.06) contrast(.88); }
.swatch-dark { filter: invert(1) hue-rotate(180deg) grayscale(.35) brightness(.88) contrast(.9) saturate(.7); }

/* Map styles: the same OpenStreetMap tiles, recoloured in the browser. Every
   style uses the same list of filter functions so switching glides smoothly. */
.leaflet-tile-pane {
  filter: invert(0) hue-rotate(0deg) grayscale(0) brightness(1) contrast(1) saturate(1);
  transition: filter .7s var(--ease-in-out);
}
.map-style-light .leaflet-tile-pane {
  filter: invert(0) hue-rotate(0deg) grayscale(.92) brightness(1.06) contrast(.88) saturate(1);
}
.map-style-dark .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) grayscale(.35) brightness(.88) contrast(.9) saturate(.7);
}
@media (prefers-reduced-motion: reduce) { .leaflet-tile-pane { transition: none; } }

/* Dark map: matching background while tiles load, brighter route, dark controls */
.leaflet-container { transition: background-color .5s var(--ease-out); }
.leaflet-container.map-style-light { background: #eeeeee; }
.leaflet-container.map-dark { background: #202124; }
.map-dark .rs-route { stroke: #2997ff; }
.map-dark .leaflet-control-attribution { background: rgba(28,28,30,.72) !important; color: #a1a1a6; }
.map-dark .leaflet-control-attribution a { color: #d1d1d6; }
.map-dark .leaflet-bar a { background: #2c2c2e; color: #f5f5f7; border-color: #3a3a3c; }
.map-dark .leaflet-bar a:hover { background: #3a3a3c; }
.map-dark .map-style-toggle { background: rgba(58,58,60,.9); color: #f5f5f7;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), 0 4px 16px rgba(0,0,0,.4); }
.map-dark .map-style.open .map-style-toggle { background: #f5f5f7; color: var(--ink); }
.map-dark .mk-ping i { border-color: rgba(41,151,255,.7); background: rgba(41,151,255,.12); }

/* Focus/hover lift on pointer devices (PS5-style focus). */
@media (hover: hover) and (pointer: fine) {
  .vehicle-option:hover, .request-card:hover, .tile.ready:hover, .feature:hover {
    transform: translateY(-2px); }
  .request-card, .tile.ready, .feature { transition: transform .45s var(--spring-soft), box-shadow .35s var(--ease-out); }
  .request-card:hover { box-shadow: inset 0 0 0 1px var(--line), 0 10px 28px rgba(0,0,0,.08); }
}
.vehicle-option.selected { animation: select-ring .9s var(--ease-out); }
@keyframes select-ring { 0% { box-shadow: inset 0 0 0 2px var(--blue), 0 0 0 0 rgba(0,113,227,.35); }
  100% { box-shadow: inset 0 0 0 2px var(--blue), 0 0 0 10px rgba(0,113,227,0); } }

/* Hidden amounts */
.secret-value { display: none; }
.secret-mask { color: var(--muted); letter-spacing: 0.08em; font-weight: inherit; }
.secrets-shown .secret-value { display: inline; }
.secrets-shown .secret-mask { display: none; }
.reveal-btn { display: inline-flex; align-items: center; gap: 7px; border: 0; background: var(--fill); color: var(--ink-2);
  border-radius: var(--pill); padding: 7px 14px 7px 11px; font: 600 14px var(--font); letter-spacing: -0.01em; cursor: pointer;
  transition: background-color .25s var(--ease-out), transform .45s var(--spring); }
.reveal-btn:active { transform: scale(.95); transition-duration: .08s; }
.reveal-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.reveal-btn[aria-pressed="true"] { background: var(--blue-soft); color: var(--blue); }
.hero-row, .head-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.hero-row p { margin: 0; }
.head-row h1 { margin: 0; }
.history-head > div:first-child { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

@media (max-width: 760px) {
  .panel { animation-name: sheet-in; }
  @keyframes sheet-in { from { opacity: 0; transform: translateY(60px); } }
  /* Map takes over: the sheet drops to a peek you can tap to bring back. */
  .map-expanded .panel { transform: translateY(calc(100% - 74px)); opacity: 1; pointer-events: auto;
    transition: transform .6s var(--ease-in-out); overflow: hidden; }
  .map-peek { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .mk-ping { display: none; }
  .peek-dot { animation: none; }
}

/* ---------- online payments ---------- */
.pay-note { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; }
.pay-note svg { flex: none; width: 16px; height: 16px; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.bank-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px; border-radius: var(--r-md);
  background: var(--fill-2); animation: fade-up .45s var(--ease-out); }
.bank-fields .span-2 { grid-column: span 2; margin: 0; }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } }
.muted-list li { opacity: .62; }
.pay-handoff { max-width: 520px; margin: 48px auto; text-align: center; padding: 36px 28px; }
.pay-handoff h1 { font-size: 30px; margin: 14px 0 8px; }
.pay-handoff .btn { margin-top: 18px; }
.spinner { width: 42px; height: 42px; margin: 0 auto; border-radius: 50%; border: 3px solid var(--fill);
  border-top-color: var(--blue); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sim-pay { text-align: left; }
.sim-pay h1, .sim-pay > .badge { text-align: left; }
.sim-cards { border: 0; padding: 0; margin: 8px 0 4px; display: grid; gap: 8px; }
.sim-card { display: flex !important; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--r-md);
  background: var(--fill-2); cursor: pointer; transition: box-shadow .25s var(--ease-out); }
.sim-card:has(input:checked) { box-shadow: inset 0 0 0 2px var(--blue); background: var(--blue-soft); }
.sim-card input { width: auto; accent-color: var(--blue); }
.sim-card > span { display: grid; }
@media (max-width: 760px) {
  .bank-fields { grid-template-columns: 1fr; }
  .bank-fields .span-2 { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
