/* SwiftDrop design system: emerald + saffron, mobile-first. */
:root {
  --brand: #059669; --brand-600: #047857; --brand-50: #ecfdf5; --brand-100: #d1fae5;
  --saffron: #f59e0b; --saffron-50: #fffbeb;
  --ink: #0f172a; --ink-2: #334155; --muted: #64748b; --line: #e2e8f0; --line-2: #f1f5f9;
  --bg: #f8fafc; --card: #ffffff; --danger: #dc2626; --danger-50: #fef2f2; --ok: #16a34a;
  --radius: 16px; --radius-sm: 10px; --shadow: 0 1px 2px rgba(15,23,42,.06), 0 8px 24px rgba(15,23,42,.06);
  --shadow-lg: 0 -8px 40px rgba(15,23,42,.18);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
.theme-dark {
  --ink: #f1f5f9; --ink-2: #cbd5e1; --muted: #94a3b8; --line: #1e293b; --line-2: #162032;
  --bg: #0b1120; --card: #111827; --brand-50: rgba(16,185,129,.12); --brand-100: rgba(16,185,129,.22);
  --saffron-50: rgba(245,158,11,.12); --danger-50: rgba(220,38,38,.14);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.45; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--brand-600); }
.theme-dark a { color: #34d399; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---- Layout ---- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 16px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.gap { gap: 12px; } .row.wrap-row { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid-2 { display: grid; gap: 16px; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 380px; align-items: start; } }
.muted { color: var(--muted); } .small { font-size: 13px; } .lead { font-size: 17px; }
.h1 { font-size: 26px; line-height: 1.2; margin: 0 0 6px; letter-spacing: -.02em; }
.h2 { font-size: 20px; margin: 0 0 4px; letter-spacing: -.01em; }
.h3 { font-size: 16px; margin: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.section-title { font-size: 18px; font-weight: 750; margin: 22px 0 10px; letter-spacing: -.01em; }

/* ---- App bar ---- */
.appbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.appbar .wrap { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 19px; letter-spacing: -.02em; text-decoration: none; color: var(--ink); }
.brand-mark { width: 30px; height: 30px; border-radius: 10px 10px 10px 3px; background: linear-gradient(135deg, var(--brand), #10b981 55%, var(--saffron)); display: grid; place-items: center; color: #fff; font-size: 16px; box-shadow: 0 4px 12px rgba(5,150,105,.35); }
.brand small { font-weight: 600; color: var(--muted); font-size: 12px; margin-left: 2px; }
.appbar .spacer { flex: 1; }
.addr-pill { display: inline-flex; align-items: center; gap: 6px; max-width: 46vw; padding: 7px 12px; border-radius: 999px; background: var(--line-2); border: 1px solid var(--line); cursor: pointer; font-size: 14px; font-weight: 600; }
.addr-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; cursor: pointer; position: relative; }
.icon-btn .dot { position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--saffron); border: 2px solid var(--card); }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 1px solid transparent; font-weight: 700; cursor: pointer; text-decoration: none; transition: transform .06s, background .15s, box-shadow .15s; white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(5,150,105,.3); }
.btn.primary:hover:not(:disabled) { background: var(--brand-600); }
.btn.accent { background: var(--saffron); color: #1f1300; }
.btn.ghost { background: var(--card); border-color: var(--line); color: var(--ink); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.google { background: #fff; color: #1f2937; border-color: #dadce0; }
.btn.block { width: 100%; }
.btn.lg { min-height: 56px; font-size: 17px; border-radius: 16px; }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.link { background: none; border: 0; padding: 0; color: var(--brand-600); font-weight: 600; cursor: pointer; text-decoration: underline; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 12px 0 2px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---- Forms ---- */
.lbl { font-size: 13px; font-weight: 650; color: var(--ink-2); margin-top: 4px; }
input, select, textarea { width: 100%; min-height: 46px; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-100); }
.phone-input { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.phone-input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-100); }
.phone-input .cc { display: flex; align-items: center; padding: 0 12px; background: var(--line-2); border-right: 1px solid var(--line); font-weight: 650; white-space: nowrap; }
.phone-input input { border: 0; box-shadow: none !important; border-radius: 0; }
.otp { letter-spacing: 12px; font-size: 24px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.form-error { color: var(--danger); font-size: 14px; min-height: 20px; }
.dev-otp { padding: 10px 12px; border-radius: 12px; font-size: 14px; background: var(--saffron-50); border: 1px dashed var(--saffron); color: #92400e; }
.theme-dark .dev-otp { color: #fcd34d; }
.dev-otp strong { letter-spacing: 3px; font-size: 16px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 650; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 46px; height: 28px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 3px solid var(--saffron); outline-offset: 2px; }

/* ---- Customer: hero, chips, cards ---- */
.hero { border-radius: 22px; padding: 22px; color: #fff; background: radial-gradient(120% 140% at 0% 0%, #10b981 0%, #047857 55%, #064e3b 100%); position: relative; overflow: hidden; }
.hero::after { content: "🛵"; position: absolute; right: 14px; top: 10px; font-size: 44px; opacity: .95; transform: scaleX(-1); pointer-events: none; }
.hero .h1, .hero p { padding-right: 56px; }
.hero .search { position: relative; z-index: 1; }
.hero p { margin: 4px 0 14px; opacity: .92; max-width: 34ch; }
.search { position: relative; }
.search input { padding-left: 42px; background: #fff; color: #0f172a; border: 0; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #64748b; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 650; cursor: pointer; min-height: 40px; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--card); border-color: var(--ink); }
.stores { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.store { text-align: left; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; cursor: pointer; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; width: 100%; }
.store:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(15,23,42,.12); }
.store.closed { opacity: .65; }
.cover { height: 128px; display: grid; place-items: center; font-size: 54px; position: relative; }
.cover.restaurant { background: linear-gradient(135deg, #fef3c7, #fde68a 60%, #fca5a5); }
.cover.pharmacy { background: linear-gradient(135deg, #d1fae5, #a7f3d0 60%, #99f6e4); }
.cover.grocery { background: linear-gradient(135deg, #e0f2fe, #bae6fd 60%, #c7d2fe); }
.cover .tag { position: absolute; left: 10px; top: 10px; background: rgba(15,23,42,.82); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px; font-family: var(--font); }
.cover .tag.closed { background: var(--danger); }
.store .body { padding: 12px 14px 14px; }
.store .name { font-weight: 750; font-size: 16px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; color: var(--muted); margin-top: 4px; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); }
.pill.green { background: var(--brand-50); color: var(--brand-600); }
.pill.amber { background: var(--saffron-50); color: #b45309; }
.pill.red { background: var(--danger-50); color: var(--danger); }
.theme-dark .pill.green { color: #34d399; } .theme-dark .pill.amber { color: #fbbf24; } .theme-dark .pill.red { color: #f87171; }

/* ---- Store page / menu ---- */
.store-hero { border-radius: 0 0 24px 24px; margin: -16px -16px 0; padding: 18px 16px 20px; }
.store-hero.cover { font-size: 16px; height: auto; display: block; }
.back-btn { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.9); color: #0f172a; border: 0; border-radius: 999px; padding: 8px 14px; font-size: 15px; font-weight: 700; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.sheet:focus { outline: none; }
.menu-nav { position: sticky; top: 61px; z-index: 10; background: var(--bg); padding: 8px 0; }
.menu-cat { margin-top: 18px; }
.menu-item { display: flex; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.menu-item .info { flex: 1; min-width: 0; }
.menu-item .title { font-weight: 700; }
.menu-item .desc { font-size: 13px; color: var(--muted); margin-top: 2px; }
.menu-item .price { font-weight: 700; margin-top: 4px; }
.menu-item.soldout { opacity: .5; }
.qty { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.qty button { width: 38px; height: 38px; border: 0; background: none; font-size: 20px; font-weight: 700; cursor: pointer; border-radius: 50%; color: var(--brand-600); }
.qty span { min-width: 22px; text-align: center; font-weight: 750; }
.add-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; font-size: 22px; font-weight: 700; cursor: pointer; box-shadow: 0 4px 12px rgba(5,150,105,.3); }

/* ---- Basket bar ---- */
.basket-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(14px, env(safe-area-inset-bottom)); z-index: 30; width: min(560px, calc(100% - 24px)); }
.basket-bar .btn { width: 100%; justify-content: space-between; min-height: 58px; border-radius: 18px; font-size: 16px; }
.basket-bar .count { background: rgba(255,255,255,.22); border-radius: 8px; padding: 2px 9px; }
body.has-basket main { padding-bottom: 96px; }

/* ---- Sheets ---- */
.sheet-back { position: fixed; inset: 0; z-index: 60; background: rgba(15,23,42,0); display: flex; align-items: flex-end; justify-content: center; transition: background .2s; }
.sheet-back.open { background: rgba(15,23,42,.45); }
.sheet { width: min(560px, 100%); max-height: 92vh; overflow: auto; background: var(--card); color: var(--ink); border-radius: 24px 24px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .25s cubic-bezier(.2,.8,.2,1); position: relative; }
.sheet-back.open .sheet { transform: none; }
@media (min-width: 700px) { .sheet-back { align-items: center; } .sheet { border-radius: 24px; } }
.sheet-close { position: absolute; right: 12px; top: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--line-2); cursor: pointer; font-size: 15px; }
.line-item { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; }
.totals { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }
.totals .grand { font-weight: 800; font-size: 18px; }
.addr-list { list-style: none; margin: 6px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.addr-list li { padding: 11px 13px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.addr-list li:last-child { border-bottom: 0; }
.addr-list li[aria-selected="true"], .addr-list li:hover { background: var(--brand-50); }
.addr-list .empty-opt { color: var(--muted); cursor: default; }
.notice { padding: 12px 14px; border-radius: 12px; font-size: 14px; background: var(--line-2); border: 1px solid var(--line); }
.notice.ok { background: var(--brand-50); border-color: var(--brand-100); }
.notice.warn { background: var(--saffron-50); border-color: #fcd34d; }
.notice.err { background: var(--danger-50); border-color: #fecaca; }

/* ---- Tracking (full-bleed map + bottom panel) ---- */
.track-page { position: fixed; inset: 0; z-index: 40; background: #0b1120; display: flex; flex-direction: column; }
/* !important: map libraries inject CSS later that sets position:relative,
   which would collapse these full-screen maps to a 300px default height. */
.track-map, .drv-map { position: absolute !important; inset: 0; width: 100%; height: 100%; }
.drv .maplibregl-ctrl-top-right, .track-page .maplibregl-ctrl-top-right { top: calc(56px + env(safe-area-inset-top)); }
.track-top { position: absolute; top: max(12px, env(safe-area-inset-top)); left: 12px; z-index: 5; }
.track-panel { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; max-height: 62vh; overflow: auto; background: var(--card); color: var(--ink); border-radius: 24px 24px 0 0; box-shadow: var(--shadow-lg); padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { .track-panel { left: 16px; right: auto; bottom: 16px; width: 400px; max-height: calc(100vh - 32px); border-radius: 24px; } }
.grabber { width: 42px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 12px; }
.eta-big { font-size: 34px; font-weight: 850; letter-spacing: -.03em; line-height: 1; }
.eta-big small { font-size: 15px; font-weight: 650; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.progress { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; list-style: none; padding: 0; margin: 14px 0; }
.progress li { height: 6px; border-radius: 9px; background: var(--line); }
.progress li.done { background: var(--brand); }
.progress li.now { background: linear-gradient(90deg, var(--brand), #6ee7b7, var(--brand)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .progress li.now, .puck-ring { animation: none !important; } }
.person { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--line-2); margin-top: 10px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--saffron)); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.handover-code { display: flex; justify-content: center; gap: 8px; margin: 12px 0; }
.handover-code span { width: 54px; height: 64px; border-radius: 14px; background: var(--card); border: 2px solid var(--brand); display: grid; place-items: center; font-size: 32px; font-weight: 850; font-variant-numeric: tabular-nums; }
.timeline { list-style: none; margin: 10px 0 0; padding: 0; font-size: 14px; }
.timeline li { display: flex; justify-content: space-between; padding: 4px 0; color: var(--muted); }
.timeline li.done { color: var(--ink); }

/* ---- AI: "What do you fancy?" + "What's happening?" ---- */
.ai-card { margin-top: 14px; padding: 16px; border-radius: 20px; background:
  linear-gradient(var(--card), var(--card)) padding-box,
  linear-gradient(120deg, #10b981, #f59e0b 55%, #ec4899) border-box; border: 2px solid transparent; box-shadow: var(--shadow); }
.ai-head { margin: 0 0 10px; font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.ai-ask { display: flex; gap: 8px; align-items: center; }
.ai-ask input { flex: 1; min-width: 0; }
.ai-mic { width: 46px; height: 46px; flex: none; border-radius: 12px; border: 1px solid var(--line); background: var(--line-2); font-size: 20px; cursor: pointer; }
.ai-mic.on { background: #fee2e2; border-color: #f87171; animation: micPulse 1s ease-in-out infinite; }
@keyframes micPulse { 50% { box-shadow: 0 0 0 6px rgba(248,113,113,.25); } }
.ai-card .chips { margin-top: 10px; }
.ai-loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 14px 4px 4px; font-weight: 600; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); animation: dot 1s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .15s; background: var(--saffron); } .dots i:nth-child(3) { animation-delay: .3s; background: #ec4899; }
@keyframes dot { 50% { transform: translateY(-5px); opacity: .5; } }
.ai-result { margin-top: 12px; padding: 14px; border-radius: 16px; background: var(--brand-50); border: 1px solid var(--brand-100); animation: aiIn .3s ease-out; }
@keyframes aiIn { from { opacity: 0; transform: translateY(6px); } }
.ai-title { font-size: 18px; font-weight: 800; }
.ai-reason { margin: 6px 0 4px; }
.ai-items { list-style: none; padding: 0; margin: 8px 0 10px; }
.ai-items li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dashed var(--brand-100); }
.ai-explain { margin: 4px 0 10px; }
.ai-bubble { margin: 0 0 8px; padding: 10px 14px; border-radius: 16px 16px 16px 4px; background: var(--brand-50); border: 1px solid var(--brand-100); animation: aiIn .3s ease-out; }
@media (prefers-reduced-motion: reduce) { .dots i, .ai-mic.on, .ai-result, .ai-bubble { animation: none !important; } }

/* ---- Map widgets ---- */
.map { position: relative; height: 420px; border-radius: var(--radius); overflow: hidden; background: #0b1120; }
.map-hud { position: absolute; top: 12px; left: 12px; z-index: 4; padding: 10px 14px; border-radius: 14px; color: #f8fafc; background: rgba(11,17,32,.74); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(10px); pointer-events: none; font-family: var(--font); }
.map-hud .big { font-size: 26px; font-weight: 850; line-height: 1.05; } .map-hud .big small { font-size: 13px; color: #cbd5e1; margin-left: 3px; }
.map-hud .sub { font-size: 12px; color: #cbd5e1; }
.map-cam { position: absolute; right: 12px; bottom: 12px; z-index: 4; padding: 8px 14px; border-radius: 999px; background: rgba(11,17,32,.8); color: #f8fafc; border: 1px solid rgba(255,255,255,.16); font-weight: 650; font-size: 13px; cursor: pointer; }
.track-page .map-cam { bottom: auto; top: max(12px, env(safe-area-inset-top)); right: 60px; }
.map-error { display: grid; place-items: center; height: 100%; color: #cbd5e1; padding: 20px; text-align: center; }
.mk { display: flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 14px 14px 14px 4px; background: #fff; color: #0f172a; box-shadow: 0 6px 18px rgba(0,0,0,.35); font: 700 12px var(--font); }
.mk-emoji { font-size: 20px; line-height: 1; }
.mk-home { background: var(--saffron); }
/* Live courier: centred on the position; the artwork rotates to the heading
   (per-frame from JS, already smoothed, so no CSS transition). */
.rider { position: relative; width: 72px; height: 72px; pointer-events: none; }
.rider-ring { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%;
  background: radial-gradient(circle, rgba(16,185,129,.55) 0%, rgba(16,185,129,.16) 55%, transparent 72%); animation: riderPulse 2s ease-out infinite; }
/* Pivot = scooter deck (50%, 72% of the art), placed exactly on the GPS point. */
.rider-art { position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -43px 0 0 -30px; transform-origin: 50% 72%;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.45)); }
.rider-art .rider-svg { display: block; animation: riderBob 1.2s ease-in-out infinite; }
@keyframes riderPulse { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes riderBob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -1.5px; } }
@media (prefers-reduced-motion: reduce) { .rider-ring, .rider-art { animation: none !important; } }
/* Small rider on the ops map */
.mk-rider { display: flex; flex-direction: column; align-items: center; font: 700 11px var(--font); color: #f8fafc; filter: drop-shadow(0 3px 5px rgba(0,0,0,.5)); }
.mk-rider .mk-label { background: rgba(11,17,32,.85); padding: 1px 7px; border-radius: 999px; margin-top: -2px; }
.mk-rider.off { opacity: .45; filter: grayscale(1); }
/* Rider as an avatar in cards */
.avatar.rider-avatar { background: linear-gradient(135deg, #d1fae5, #a7f3d0); overflow: hidden; }
.avatar.rider-avatar .rider-svg { width: 40px; height: 40px; margin-top: 4px; }
.rider-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.rider-pick button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px; border-radius: 14px; border: 2px solid var(--line); background: var(--line-2); cursor: pointer; font-weight: 650; color: inherit; }
.rider-pick button[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-50); }

/* ---- Toast ---- */
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 90; max-width: calc(100% - 32px); background: #0f172a; color: #f8fafc; padding: 12px 18px; border-radius: 14px; font-weight: 600; box-shadow: 0 12px 30px rgba(0,0,0,.3); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); }

/* ---- Driver app ---- */
.drv { position: fixed; inset: 0; display: flex; flex-direction: column; }

.drv-top { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 10px; right: 10px; z-index: 5; display: flex; gap: 8px; align-items: center; }
.drv-chip { background: rgba(11,17,32,.82); color: #f8fafc; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 14px; backdrop-filter: blur(10px); }
.drv-panel { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--card); border-radius: 24px 24px 0 0; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); max-height: 70vh; overflow: auto; }
@media (min-width: 900px) { .drv-panel { left: 16px; right: auto; bottom: 16px; width: 420px; border-radius: 24px; } }
.go-btn { width: 100%; min-height: 64px; border-radius: 20px; border: 0; font-size: 19px; font-weight: 850; cursor: pointer; letter-spacing: .02em; }
.go-btn.off { background: var(--brand); color: #fff; box-shadow: 0 10px 30px rgba(16,185,129,.35); }
.go-btn.on { background: var(--line-2); color: var(--ink); border: 1px solid var(--line); }
.offer-ring { --p: 100; width: 76px; height: 76px; border-radius: 50%; background: conic-gradient(var(--saffron) calc(var(--p) * 1%), var(--line) 0); display: grid; place-items: center; flex: none; }
.offer-ring span { width: 62px; height: 62px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-weight: 850; font-size: 20px; }
.stat-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
.stat { padding: 12px; border-radius: 14px; background: var(--line-2); }
.stat b { display: block; font-size: 22px; }
.code-entry { display: flex; gap: 8px; }
.code-entry input { max-width: 170px; }

/* ---- Kitchen board (merchant) ---- */
.board { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .board { grid-template-columns: repeat(3, 1fr); } }
.col { background: var(--line-2); border-radius: var(--radius); padding: 12px; min-height: 240px; }
.col h2 { font-size: 15px; display: flex; justify-content: space-between; margin: 2px 4px 10px; }
.ticket { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 10px; box-shadow: var(--shadow); }
.ticket.new { border-color: var(--saffron); box-shadow: 0 0 0 3px rgba(245,158,11,.25); }
.ticket .items { margin: 8px 0; padding-left: 18px; }
.ticket .items li { margin: 2px 0; }
.ticket .qtyb { font-weight: 850; }
.age { font-variant-numeric: tabular-nums; }
.age.late { color: var(--danger); font-weight: 800; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab { border: 0; background: none; padding: 12px 14px; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--ink); border-color: var(--brand); }

/* ---- Admin ---- */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.stats .stat { background: var(--card); border: 1px solid var(--line); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--muted); }
.status-dot.on { background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,.25); }
.empty { color: var(--muted); text-align: center; padding: 28px 12px; }
.auth-card { max-width: 440px; margin: 28px auto; }
.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 26px 16px 40px; }
.footer a { color: var(--muted); }
.prose { max-width: 760px; } .prose h2 { margin-top: 28px; } .prose li { margin: 4px 0; }
