:root {
  --bg: #f3f5f9; --card: #fff; --text: #172033; --muted: #6b7489; --line: #e4e8f0;
  --primary: #2f6fed; --primary-soft: #e8f0ff;
  --green: #16a34a; --green-soft: #e7f7ec;
  --amber: #d97706; --amber-soft: #fff4e0;
  --red: #dc2626; --red-soft: #fdecec;
  --violet: #7c3aed; --violet-soft: #f1eafe;
  --radius: 16px; --shadow: 0 1px 2px rgba(16,24,40,.05), 0 4px 16px rgba(16,24,40,.06);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { min-height: 100vh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }

.top { position: sticky; top: 0; z-index: 20; background: var(--card); border-bottom: 1px solid var(--line);
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; display: flex; align-items: center; gap: 12px; }
.top .logo { width: 36px; height: 36px; border-radius: 10px; flex: none; }
.top .t1 { font-weight: 700; font-size: 16px; line-height: 1.2; }
.top .t2 { color: var(--muted); font-size: 12.5px; }
.top .grow { flex: 1; min-width: 0; }
.top .grow > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.live.on { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }

main { max-width: 720px; margin: 0 auto; padding: 16px; }
h2 { font-size: 18px; margin: 4px 0 12px; }
h3 { font-size: 15px; margin-bottom: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--card); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 20px; line-height: 1.2; }
.stat span { color: var(--muted); font-size: 12.5px; }

.btn { border: 0; border-radius: 12px; padding: 11px 16px; font-weight: 600; cursor: pointer; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:disabled { opacity: .55; }
.btn.block { width: 100%; padding: 14px; font-size: 16px; }
.btn.sm { padding: 7px 12px; font-size: 13.5px; border-radius: 10px; }
.btn.ghost { background: var(--primary-soft); color: var(--primary); }
.btn.green { background: var(--green); }
.btn.amber { background: var(--amber); }
.btn.red { background: var(--red); }
.btn.light { background: #eef1f6; color: var(--text); }
.btn.outline { background: transparent; color: var(--text); border: 1px solid var(--line); }

.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.b-green { background: var(--green-soft); color: var(--green); }
.b-amber { background: var(--amber-soft); color: var(--amber); }
.b-red { background: var(--red-soft); color: var(--red); }
.b-blue { background: var(--primary-soft); color: var(--primary); }
.b-violet { background: var(--violet-soft); color: var(--violet); }
.b-gray { background: #eef1f6; color: var(--muted); }

.list > .item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.list > .item:first-child { border-top: 0; }
.item .name { font-weight: 600; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 700; flex: none; }

input, select, textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 16px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; }
.checks input { width: auto; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font-weight: 600; cursor: pointer; }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.seg { display: flex; background: #e9edf4; border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 12px; overflow-x: auto; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 10px; border-radius: 9px; font-weight: 600; color: var(--muted); white-space: nowrap; cursor: pointer; }
.seg button.on { background: #fff; color: var(--text); box-shadow: var(--shadow); }

.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: var(--card); border-top: 1px solid var(--line); display: flex; padding-bottom: env(safe-area-inset-bottom); }
.tabs button { flex: 1; border: 0; background: none; padding: 8px 2px 9px; font-size: 11.5px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; }
.tabs button i { font-style: normal; font-size: 21px; line-height: 1.1; }
.tabs button.on { color: var(--primary); font-weight: 700; }
body.no-tabs { padding-bottom: 24px; }

/* Login */
.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 24px; max-width: 420px; margin: 0 auto; }
.login .logo { width: 72px; height: 72px; border-radius: 20px; margin: 0 auto 14px; display: block; }
.login h1 { text-align: center; font-size: 26px; }
.login p.sub { text-align: center; color: var(--muted); margin-bottom: 24px; }
.phone-in { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.phone-in b { padding: 0 4px 0 12px; color: var(--muted); font-weight: 600; }
.phone-in input { border: 0; padding-left: 4px; }

/* Slider */
.slider { position: relative; height: 62px; border-radius: 31px; background: linear-gradient(90deg, var(--green-soft), #d9f2e1); overflow: hidden; user-select: none; touch-action: none; }
.slider .txt { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; color: var(--green); letter-spacing: .3px; pointer-events: none; padding-left: 40px; }
.slider .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--green); opacity: .18; width: 62px; border-radius: 31px; }
.slider .knob { position: absolute; left: 5px; top: 5px; width: 52px; height: 52px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 22px; box-shadow: 0 3px 10px rgba(22,163,74,.4); cursor: grab; }
.slider.done { background: var(--green); }
.slider.done .txt { color: #fff; }

/* Pickup timeline */
.steps { display: flex; justify-content: space-between; margin: 14px 0 6px; position: relative; }
.steps::before { content: ""; position: absolute; left: 18px; right: 18px; top: 15px; height: 3px; background: var(--line); }
.step { position: relative; text-align: center; flex: 1; font-size: 11.5px; color: var(--muted); }
.step .dot { width: 32px; height: 32px; border-radius: 50%; background: #fff; border: 3px solid var(--line); margin: 0 auto 4px; display: grid; place-items: center; font-size: 14px; position: relative; }
.step.done .dot { border-color: var(--green); background: var(--green); color: #fff; }
.step.cur .dot { border-color: var(--primary); animation: pulse 1.6s infinite; }
.step.done, .step.cur { color: var(--text); font-weight: 600; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(47,111,237,.45); } 100% { box-shadow: 0 0 0 12px rgba(47,111,237,0); } }

.req { border-radius: 14px; padding: 14px; margin-bottom: 10px; border: 2px solid transparent; background: var(--card); box-shadow: var(--shadow); }
.req.arrived { border-color: var(--red); background: #fff7f7; }
.req.preparing { border-color: var(--amber); }
.req.on_way { border-color: var(--primary-soft); }
.req .big { font-size: 18px; font-weight: 700; }
.req.flash { animation: flash 1s 3; }
@keyframes flash { 50% { background: #ffe1e1; } }

.banner { border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; }
.banner:has(> div):not(.inst) { display: flex; gap: 10px; align-items: center; }
.banner.info { background: var(--primary-soft); }
.banner.warn { background: var(--amber-soft); }
.banner.err { background: var(--red-soft); }

table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th, table.t td { padding: 9px 6px; border-top: 1px solid var(--line); text-align: left; }
table.t th { color: var(--muted); font-weight: 600; border-top: 0; }
table.t td.n, table.t th.n { text-align: center; }
.scroll-x { overflow-x: auto; }

/* Modal */
.ov { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--card); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); animation: up .18s ease-out; }
@media (min-width: 640px) { .ov { align-items: center; } .sheet { border-radius: 20px; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.sheet .hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet .hd h3 { margin: 0; font-size: 17px; }
.x { border: 0; background: #eef1f6; width: 32px; height: 32px; border-radius: 50%; font-size: 18px; cursor: pointer; }
.err-msg { background: var(--red-soft); color: var(--red); padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; font-size: 14px; }

.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #172033; color: #fff; padding: 11px 16px; border-radius: 12px; z-index: 60; font-size: 14px; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.err { background: var(--red); }

.empty { text-align: center; color: var(--muted); padding: 24px 8px; }
.empty i { display: block; font-style: normal; font-size: 34px; margin-bottom: 6px; }
.pw-box { background: var(--green-soft); border-radius: 12px; padding: 12px; font-size: 15px; }
.pw-box b { font-size: 18px; letter-spacing: 1px; }

/* Til tanlash */
.langs { display: inline-flex; background: #e9edf4; border-radius: 10px; padding: 3px; gap: 2px; }
.langs.center { display: flex; width: max-content; margin: 0 auto 18px; }
.langs button { border: 0; background: transparent; padding: 6px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.langs button.on { background: #fff; color: var(--text); box-shadow: var(--shadow); }
/* O'rnatish yo'riqnomasi */
.steps-list { padding-left: 22px; }
.steps-list li { margin-bottom: 12px; line-height: 1.5; }
