/* TaxiOK brand: green #238c23, light theme (matches taxi-ok-mini-app and driver-standards) */
:root {
  --brand: #238c23;
  --brand-dark: #1a6b18;
  --brand-tint: #eaf4ea;
  --brand-line: #b9ceb9;
  --ink: #1d2a1d;
  --ink-2: #3d4a3d;
  --muted: #5d6b5d;
  --line: #dde6dd;
  --bg: #f5f8f5;
  --surface: #ffffff;
  --danger: #dc2626;
  --danger-tint: #fdeceb;
  /* Chart series (validated CVD-safe on white): full = brand green, partial = blue */
  --s-full: #238c23;
  --s-partial: #2563eb;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --shadow: 0 1px 2px rgba(29, 42, 29, .05), 0 8px 24px -12px rgba(29, 42, 29, .14);
  --safe-b: env(safe-area-inset-bottom);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 Figtree, -apple-system, "Segoe UI", Roboto, sans-serif; overflow-x: clip; }
body { padding-bottom: calc(84px + var(--safe-b)); min-height: 100dvh; }
body.locked { overflow: hidden; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-weight: 500; }
.mono { font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-weight: 700; letter-spacing: .04em; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.neg { color: var(--danger); font-weight: 600; }

/* ---------- boot / gate ---------- */
.boot, .gate { padding: 28px 20px; max-width: 520px; margin: 0 auto; }
.boot-logo, .gate-logo { width: 150px; height: auto; margin: 8px 0 28px; }
.sk { border-radius: var(--r-md); background: linear-gradient(90deg, #e9efe9 0%, #f4f8f4 50%, #e9efe9 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; margin-bottom: 14px; }
.sk-line { height: 16px; width: 45%; }
.sk-block { height: 76px; }
.sk-btn { height: 56px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.gate h1 { font-size: 24px; margin-bottom: 8px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.logo { height: 26px; width: auto; }
.topbar-title { font-weight: 700; color: var(--ink-2); padding-left: 10px; border-left: 1px solid var(--line); line-height: 1; }
.topbar-user { margin-left: auto; font-size: 13px; color: var(--muted); max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tab { padding: 16px 16px 8px; max-width: 560px; margin: 0 auto; }
.tab.stale > * { opacity: .6; transition: opacity .2s; }
.page-title { font-size: 26px; font-weight: 800; margin: 4px 0 14px; }
.section-title { font-size: 15px; font-weight: 700; margin: 26px 0 10px; display: flex; gap: 8px; align-items: baseline; }
.section-title .muted { font-size: 13px; }
.hint { font-size: 13px; color: var(--muted); margin: 8px 2px 0; }
.hint.center { text-align: center; }
.hint:empty { display: none; }

/* ---------- stepper ---------- */
.stepper { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0; margin: 0 0 18px; }
.stepper li { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); padding-top: 10px; border-top: 3px solid var(--line); transition: border-color .3s var(--ease), color .3s; }
.stepper b { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--line); color: var(--muted); transition: background .3s var(--ease); }
.stepper li.active { color: var(--ink); border-color: var(--brand); }
.stepper li.active b { background: var(--brand); color: #fff; }
.stepper li.passed { border-color: var(--brand-line); }
.stepper li.passed b { background: var(--brand-tint); color: var(--brand); }

.step { animation: rise .35s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------- plate input (Uzbek plate look) ---------- */
.field-label { display: block; font-size: 14px; font-weight: 600; color: var(--ink-2); margin: 4px 2px 8px; }
.plate-field { position: relative; display: flex; align-items: stretch; background: #fff; border: 3px solid var(--ink); border-radius: 12px; box-shadow: var(--shadow); transition: border-color .2s, box-shadow .2s; }
.plate-field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(35,140,35,.15); }
.plate-field input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; padding: 16px 14px; font: 700 30px/1.1 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.plate-field input::placeholder { color: #c3ccc3; }
.plate-flag { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 0 12px; border-left: 2px solid var(--ink); }
.plate-flag i { display: block; width: 26px; height: 5px; border-radius: 1px; }
.plate-flag i:nth-child(1) { background: #1eb3e6; }
.plate-flag i:nth-child(2) { background: #fff; outline: 1px solid #e3e3e3; }
.plate-flag i:nth-child(3) { background: #1eb53a; }
.plate-flag b { font-size: 11px; font-weight: 800; color: var(--ink); text-align: center; margin-top: 1px; }

.plate-mini { display: inline-block; font: 700 22px/1 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .08em; padding: 8px 12px; border: 2.5px solid var(--ink); border-radius: 9px; background: #fff; }

/* ---------- buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin-top: 12px;
  min-height: 50px; padding: 12px 16px; border-radius: var(--r-md); border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink); font-weight: 700; font-size: 16px;
  transition: transform .15s var(--ease), background .2s;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 8px 20px -10px rgba(35,140,35,.7); }
.btn.primary:active:not(:disabled) { background: var(--brand-dark); }
.btn.big { min-height: 58px; font-size: 17px; }
.btn:disabled { background: #e3ebe3; border-color: #e3ebe3; color: #8fa08f; box-shadow: none; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: #f3c9c6; }
.btn.loading span { opacity: .5; }
.btn.loading::after { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.back { display: flex; width: fit-content; align-items: center; gap: 4px; border: 0; background: none; color: var(--brand); font-weight: 600; padding: 4px 0; margin-bottom: 10px; }
.back .ic { width: 18px; height: 18px; }
.icon-btn { border: 0; background: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }
.icon-btn:active { background: var(--bg); color: var(--danger); }

/* ---------- inputs ---------- */
.input { width: 100%; border: 1.5px solid var(--line); background: #fff; border-radius: var(--r-sm); padding: 12px 14px; font: inherit; color: var(--ink); outline: none; transition: border-color .2s, box-shadow .2s; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(35,140,35,.14); }
.form { display: flex; flex-direction: column; gap: 14px; }
.form .btn { margin-top: 2px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field small { font-size: 12px; color: var(--muted); }
.switch { display: flex; gap: 10px; align-items: center; font-size: 14px; font-weight: 600; }
.switch input { width: 20px; height: 20px; accent-color: var(--brand); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow); }
.form.card + .section-title, .list + .form.card { margin-top: 12px; }

/* ---------- new car: brand choice ---------- */
.note { background: var(--brand-tint); border-left: 4px solid var(--brand); padding: 12px 14px; border-radius: 0 var(--r-sm) var(--r-sm) 0; font-size: 14px; color: var(--ink-2); margin: 12px 0 14px; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 12px; border-radius: var(--r-lg); border: 2px solid var(--line); background: #fff; transition: border-color .2s, transform .15s var(--ease), box-shadow .2s; }
.choice:active { transform: scale(.98); }
.choice[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(35,140,35,.12); }
.choice-art { width: 100%; height: 64px; margin-bottom: 6px; }
.choice-title { font-weight: 700; font-size: 14px; line-height: 1.25; }
.choice-sub { font-size: 12.5px; color: var(--muted); }
.choice-sub b { color: var(--ink); }
.choice-check { position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; transform: scale(0); transition: transform .25s var(--ease); }
.choice-check .ic { width: 15px; height: 15px; stroke-width: 2.5; }
.choice[aria-pressed="true"] .choice-check { transform: scale(1); }
#model { margin-bottom: 4px; }
.choice.wide { grid-column: span 2; padding: 12px 44px 12px 12px; }
.note.bad { background: var(--danger-tint); border-left-color: var(--danger); color: #8f1d1d; }

/* ---------- paid wash ---------- */
.paid-card { margin-top: 14px; background: #fff; border: 2px solid var(--s-partial); border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--shadow); }
.paid-top { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--s-partial); margin-bottom: 8px; }
.paid-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 15px; }
.paid-row span { color: var(--muted); }
.paid-row b { font-variant-numeric: tabular-nums; text-align: right; }
.paid-row.total b { font-size: 20px; }
.paid-offer { margin: 4px 0 6px; padding: 14px; border-radius: var(--r-lg); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); text-align: left; }
.paid-offer-text { display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--muted); }
.paid-offer-text b { color: var(--ink); font-size: 16px; }
.paid-offer .btn { margin-top: 12px; background: var(--s-partial); border-color: var(--s-partial); box-shadow: 0 8px 20px -10px rgba(37,99,235,.7); }
.btn.pay { background: var(--s-partial); border-color: var(--s-partial); box-shadow: 0 8px 20px -10px rgba(37,99,235,.7); }
.pay-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--s-partial); }

/* ---------- known car: quota ---------- */
.quota-card { margin-top: 14px; background: linear-gradient(135deg, #2a9a2a, #1d7a1d); color: #fff; border-radius: var(--r-lg); padding: 16px 18px; box-shadow: 0 14px 30px -18px rgba(29,122,29,.9); }
.quota-top { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.ok-dot { width: 8px; height: 8px; border-radius: 50%; background: #b8f5b8; animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(184,245,184,.7); } 70%, 100% { box-shadow: 0 0 0 8px rgba(184,245,184,0); } }
.quota-num { margin-top: 6px; }
.quota-num b { font-size: 46px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.quota-num span { font-size: 18px; font-weight: 600; opacity: .85; }
.quota-caption { margin: 4px 0 12px; font-size: 14px; opacity: .9; }
.meter { height: 6px; border-radius: 3px; background: rgba(255,255,255,.25); overflow: hidden; }
.meter i { display: block; height: 100%; background: #fff; border-radius: 3px; transition: width .5s var(--ease); }
.meter.low i { background: #ffd27a; }
.quota-meta { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; opacity: .9; }
.sheet .quota-card { margin: 0 0 16px; }
.sheet .quota-card div b { font-size: 36px; font-weight: 800; }
.sheet .quota-card p { margin: 4px 0 0; font-size: 14px; opacity: .9; }
.quota-card.is-out { background: linear-gradient(135deg, #e25555, #c62f2f); box-shadow: 0 14px 30px -18px rgba(198,47,47,.9); }

/* ---------- shots ---------- */
.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shot { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-lg); border: 2px dashed var(--brand-line); background: var(--brand-tint); overflow: hidden; padding: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; text-align: left; transition: transform .15s var(--ease); }
.shot:active { transform: scale(.98); }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.shot-guide { position: absolute; left: 14%; top: 12%; width: 72%; height: 52%; fill: none; stroke: var(--brand); stroke-width: 4; stroke-linejoin: round; opacity: .5; }
.shot-label, .shot-state { position: relative; z-index: 1; padding: 0 10px; }
.shot-label { font-weight: 700; font-size: 14px; color: var(--ink); }
.shot-state { font-size: 12px; font-weight: 600; color: var(--brand); padding-bottom: 9px; }
.shot.filled { border: 0; background: #1d2a1d; }
.shot.filled img { opacity: 1; }
.shot.filled .shot-guide { display: none; }
.shot.filled::after { content: ""; position: absolute; inset: auto 0 0 0; height: 55%; background: linear-gradient(transparent, rgba(16,24,16,.78)); }
.shot.filled .shot-label { color: #fff; }
.shot.filled .shot-state { color: #c8f0c8; }
.shot.filled .shot-label::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #5ee05e; margin-right: 6px; vertical-align: 1px; }

/* ---------- result screens ---------- */
.result { text-align: center; padding-top: 8px; }
.result-icon { width: 76px; height: 76px; border-radius: 50%; margin: 6px auto 14px; display: grid; place-items: center; color: #fff; animation: pop .45s var(--ease); }
.result-icon .ic { width: 40px; height: 40px; stroke-width: 2.4; }
.result-icon.good { background: var(--brand); box-shadow: 0 0 0 10px var(--brand-tint); }
.result-icon.bad { background: var(--danger); box-shadow: 0 0 0 10px var(--danger-tint); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.result-title { font-size: 22px; font-weight: 800; margin: 14px 8px 8px; line-height: 1.25; }
#step-denied .result-title { color: var(--danger); }
.result-text { color: var(--muted); margin: 0 12px 18px; font-size: 15px; }
.topup { display: flex; align-items: center; gap: 14px; text-align: left; padding: 16px; border-radius: var(--r-lg); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.topup > .ic { width: 44px; height: 44px; padding: 10px; border-radius: 12px; background: var(--brand-tint); color: var(--brand); }
.topup span { display: block; font-size: 13px; color: var(--muted); font-weight: 500; }
.topup b { display: block; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- lists ---------- */
.today { margin-top: 28px; }
.today-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.today-head h2 { font-size: 16px; font-weight: 700; }
.count { min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px; background: var(--brand-tint); color: var(--brand); font-weight: 800; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.list { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.list:empty { display: none; }
.row-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; animation: rise .35s var(--ease) both; }
.row-item:first-child { border-top: 0; }
.row-item:nth-child(2) { animation-delay: 30ms; } .row-item:nth-child(3) { animation-delay: 60ms; } .row-item:nth-child(4) { animation-delay: 90ms; }
.row-item:nth-child(5) { animation-delay: 120ms; } .row-item:nth-child(n+6) { animation-delay: 150ms; }
button.row-item:active { background: var(--bg); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-sub { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.row-chev { width: 18px; height: 18px; color: #a9b6a9; }
.num { font-weight: 800; font-variant-numeric: tabular-nums; }
.thumbs { display: flex; flex: none; }
.thumbs img { width: 46px; height: 36px; object-fit: cover; border-radius: 8px; background: var(--bg); border: 2px solid #fff; }
.thumbs img + img { margin-left: -14px; }
.type { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: var(--ink-2); }
.type i { width: 8px; height: 8px; border-radius: 2px; }
.type-full i { background: var(--s-full); }
.type-partial i { background: var(--s-partial); }
.type-none i { background: #9aa79a; }
.quota-pill { font-size: 13px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--brand-tint); color: var(--brand); font-variant-numeric: tabular-nums; }
.quota-pill.out { background: var(--danger-tint); color: var(--danger); }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--brand-tint); color: var(--brand); flex: none; }
.empty { padding: 22px 16px; text-align: center; color: var(--muted); font-size: 14px; background: #fff; }
.empty p { margin: 0; }
.empty-ic { width: 34px; height: 34px; margin: 0 auto 8px; color: var(--brand-line); display: block; }
.empty.small { padding: 16px; }

/* ---------- reports ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 10px; padding: 0 16px 4px; scrollbar-width: none; }
.chip { flex: none; border: 1.5px solid var(--line); background: #fff; padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink-2); transition: background .2s var(--ease), color .2s; }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.dates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dates label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.dates input { border: 1.5px solid var(--line); background: #fff; border-radius: var(--r-sm); padding: 10px; font: inherit; color: var(--ink); width: 100%; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); animation: rise .35s var(--ease) both; min-width: 0; }
.stat b { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat-sub { font-size: 12.5px; color: var(--muted); }
.stat.hero { grid-column: span 2; background: linear-gradient(135deg, #2a9a2a, #1d7a1d); color: #fff; border: 0; }
.stat.hero .stat-label, .stat.hero .stat-sub { color: rgba(255,255,255,.85); }
.stat.hero b { font-size: 38px; }
.stat.wide { grid-column: span 2; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw-full { background: var(--s-full); }
.sw-partial { background: var(--s-partial); }
.chart { padding: 14px 12px 10px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; }
.bar-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.bar { width: min(80%, 22px); height: calc(100% - 16px); display: flex; flex-direction: column-reverse; justify-content: flex-start; gap: 2px; }
.bar i { display: block; width: 100%; }
.bar i:last-child { border-radius: 4px 4px 0 0; }
.bar .f { background: var(--s-full); }
.bar .p { background: var(--s-partial); }
.bar-lbl { font-size: 10px; color: var(--muted); height: 14px; margin-top: 2px; white-space: nowrap; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .muted { margin-left: auto; }

.search { display: flex; align-items: center; gap: 8px; background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 0 12px; margin-bottom: 12px; }
.search:focus-within { border-color: var(--brand); }
.search .ic { color: var(--muted); width: 20px; height: 20px; }
.search input { flex: 1; border: 0; outline: none; background: none; padding: 13px 0; font: inherit; text-transform: uppercase; }

/* ---------- tab bar ---------- */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; background: rgba(255,255,255,.96); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.tabs button { flex: 1; border: 0; background: none; padding: 9px 0 10px; display: flex; flex-direction: column; align-items: center; gap: 3px; color: #8c998c; font-size: 11.5px; font-weight: 600; position: relative; }
.tabs button[aria-current="page"] { color: var(--brand); }
.tabs button[aria-current="page"]::before { content: ""; position: absolute; top: -1px; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }

/* ---------- camera ---------- */
.camera { position: fixed; inset: 0; z-index: 50; background: #0d120d; display: flex; flex-direction: column; color: #fff; }
.cam-live { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.cam-live video { width: 100%; height: 100%; object-fit: cover; }
.cam-top { position: absolute; top: 0; left: 0; right: 0; padding: calc(16px + env(safe-area-inset-top)) 18px 40px; background: linear-gradient(rgba(13,18,13,.75), transparent); }
.cam-step { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--brand); }
.cam-hint { margin: 10px 0 0; font-size: 17px; font-weight: 700; line-height: 1.3; text-shadow: 0 1px 6px rgba(0,0,0,.4); }
.cam-guide { position: absolute; left: 50%; top: 54%; transform: translate(-50%, -50%); fill: none; stroke: rgba(255,255,255,.9); stroke-width: 3; stroke-dasharray: 10 8; stroke-linejoin: round; filter: drop-shadow(0 0 4px rgba(0,0,0,.5)); transition: opacity .3s; }
.guide-side { width: 88%; max-width: 560px; }
.guide-rear { width: 62%; max-width: 360px; }
.camera[data-shot="side"] .guide-rear, .camera[data-shot="rear"] .guide-side { opacity: 0; }
.cam-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.cam-flash.go { animation: flash .35s ease-out; }
@keyframes flash { from { opacity: .85; } }
.cam-bar { display: flex; justify-content: space-around; align-items: center; padding: 18px 0 calc(22px + var(--safe-b)); background: #0d120d; }
.cam-round { width: 52px; height: 52px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center; }
.cam-round.ghost { background: none; }
.shutter { width: 76px; height: 76px; border-radius: 50%; border: 5px solid #fff; background: var(--brand); box-shadow: inset 0 0 0 4px #0d120d; transition: transform .12s var(--ease); }
.shutter:active { transform: scale(.9); }
.cam-error { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 24px; gap: 8px; }
.cam-error .ic { width: 48px; height: 48px; color: var(--brand-line); }
.cam-error .btn { max-width: 320px; }

/* ---------- sheet / viewer / toast ---------- */
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(16,24,16,.45); display: flex; align-items: flex-end; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-height: 90dvh; overflow-y: auto; background: var(--bg); border-radius: 22px 22px 0 0; padding: 10px 16px calc(20px + var(--safe-b)); animation: up .35s var(--ease); }
.sheet::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: #c7d2c7; margin: 0 auto 14px; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.photo-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.photo-pair figure { margin: 0; }
.photo-pair img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-md); cursor: zoom-in; background: #dfe7df; }
.photo-pair figcaption { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 4px; }
.facts { margin: 14px 0 0; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 4px 14px; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.facts div:first-child { border-top: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; text-align: right; }
.viewer { position: fixed; inset: 0; z-index: 60; background: rgba(13,18,13,.94); display: grid; place-items: center; padding: 16px; }
.viewer img { max-width: 100%; max-height: 100%; border-radius: 10px; }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(92px + var(--safe-b)); z-index: 70; background: var(--ink); color: #fff; padding: 13px 16px; border-radius: var(--r-md); text-align: center; font-size: 14px; font-weight: 600; box-shadow: 0 12px 30px -10px rgba(0,0,0,.4); animation: rise .3s var(--ease); }
.toast.error { background: var(--danger); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

#denied-pay-no { font-size: 15px; color: var(--ink-2); background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; margin: 0 0 4px; text-align: left; }
.cash-card { margin-top: 14px; padding: 16px; border-radius: var(--r-lg); background: #fff; border: 2px dashed #c9d3c9; }
.cash-card b { font-size: 17px; }
.cash-card p { margin: 6px 0 4px; color: var(--ink-2); font-size: 15px; }
#paid-reason { margin-top: 14px; }
#paid-loading { margin-top: 14px; height: 120px; }
#brand-prev { text-transform: none; }

.callsign { margin: 8px 0 0; font-size: 14px; font-weight: 600; color: var(--ink-2); }

.driver-line { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; border-radius: var(--r-md); background: #fff; border: 1px solid var(--line); font-size: 14px; }
.driver-line .who { font-weight: 700; }
.driver-line .bonus { font-weight: 800; color: var(--s-partial); font-variant-numeric: tabular-nums; white-space: nowrap; }
.driver-line .bonus small { font-weight: 600; color: var(--muted); margin-right: 4px; }
.driver-line.muted-line { color: var(--muted); }
.driver-line.loading { color: var(--muted); }

.no-photo { width: 46px; height: 36px; border-radius: 8px; background: var(--bg); color: var(--muted); font-size: 9px; font-weight: 700; display: grid; place-items: center; text-align: center; line-height: 1.1; }

.shots .shot.single { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.guide-34 { width: 90%; max-width: 560px; }
.amount-input { width: 140px; text-align: right; font: 800 20px/1.2 Figtree, sans-serif; border: 1.5px solid var(--line); border-radius: 10px; padding: 6px 10px; color: var(--ink); outline: none; }
.amount-input:focus { border-color: var(--s-partial); }
.paid-row.total { align-items: center; }
.lang-switch { margin-left: 8px; display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; padding: 2px; background: #fff; }
.lang-switch b { font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 999px; color: var(--muted); }
.lang-switch b.on { background: var(--brand); color: #fff; }
.topbar-user { margin-left: auto; }

/* Uzbek license plate */
.uzplate { display: inline-flex; align-items: stretch; background: #fff; border: 3px solid #111; border-radius: 9px;
  box-shadow: 0 2px 0 rgba(0,0,0,.08), 0 8px 20px -12px rgba(0,0,0,.35); font: 700 26px/1 "JetBrains Mono", ui-monospace, monospace;
  color: #111; overflow: hidden; height: 50px; }
.uzplate .uzp-region { display: grid; place-items: center; padding: 0 12px; border-right: 3px solid #111; letter-spacing: .02em; }
.uzplate .uzp-number { display: grid; place-items: center; padding: 0 14px; letter-spacing: .08em; white-space: nowrap; }
.uzplate .uzp-flag { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 0 9px; }
.uzplate .uzp-flag i { display: block; width: 24px; height: 5px; border-radius: 1px; }
.uzplate .uzp-flag i:nth-child(1) { background: #1eb3e6; }
.uzplate .uzp-flag i:nth-child(2) { background: #fff; outline: 1px solid #ddd; }
.uzplate .uzp-flag i:nth-child(3) { background: #1eb53a; }
.uzplate .uzp-flag b { font: 800 11px/1 Figtree, sans-serif; text-align: center; margin-top: 1px; }
.result .uzplate { margin: 0 auto; }
@media (max-width: 360px) { .uzplate { font-size: 22px; height: 44px; } .uzplate .uzp-number { padding: 0 10px; } }

/* FE-Schrift: the typeface of real Uzbek license plates */
@font-face { font-family: "FE-Font"; src: url("fonts/fe-font.ttf") format("truetype"); font-display: swap; }
.uzplate .uzp-region, .uzplate .uzp-number { font-family: "FE-Font", "JetBrains Mono", ui-monospace, monospace; font-weight: 400; font-size: 30px; letter-spacing: .04em; }
.plate-field input { font-family: "FE-Font", "JetBrains Mono", ui-monospace, monospace; font-weight: 400; font-size: 32px; }

/* Uzbek plate, matched to the reference: grey frame, mounting dots, flag + blue UZ */
.uzplate { height: 56px; border: 3px solid #5f6680; border-radius: 10px; color: #1f2133; background: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,.06), 0 10px 22px -14px rgba(20,22,40,.45); align-items: center; padding: 0 4px; }
.uzplate .uzp-dot { width: 6px; height: 6px; border-radius: 50%; background: #1f2133; margin: 0 4px; flex: none; }
.uzplate .uzp-region { border-right: 3px solid #5f6680; padding: 0 12px 0 6px; height: 100%; font-size: 34px; }
.uzplate .uzp-number { padding: 0 12px 0 14px; font-size: 34px; letter-spacing: .12em; word-spacing: .1em; }
.uzplate .uzp-flag { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 0 4px 0 2px; }
.uzplate .uzp-stripes { display: flex; flex-direction: column; width: 28px; }
.uzplate .uzp-stripes i { display: block; height: 5px; width: 100%; border-radius: 0; outline: none; }
.uzplate .uzp-stripes i:nth-child(1) { background: #4aa3c7; }
.uzplate .uzp-stripes i:nth-child(2) { background: #fff; height: 2px; border-top: 1px solid #e05555; border-bottom: 1px solid #e05555; }
.uzplate .uzp-stripes i:nth-child(3) { background: #5cb54d; }
.uzplate .uzp-flag b { font: 800 15px/1 Figtree, sans-serif; color: #4aa3c7; letter-spacing: .02em; margin-top: 2px; }
@media (max-width: 380px) {
  .uzplate { height: 50px; }
  .uzplate .uzp-region, .uzplate .uzp-number { font-size: 29px; }
  .uzplate .uzp-number { padding: 0 8px 0 10px; letter-spacing: .08em; }
}
.uzplate .uzp-stripes { width: 32px; }
.uzplate .uzp-flag b { font-size: 21px; font-weight: 800; margin-top: 1px; }
@media (max-width: 380px) { .uzplate .uzp-flag b { font-size: 18px; } .uzplate .uzp-stripes { width: 28px; } }
/* UZ mark and top flag stripe: muted steel blue as on real plates */
.uzplate .uzp-flag b { color: #4597b4; }
.uzplate .uzp-stripes i:nth-child(1) { background: #4597b4; }
.uzplate .uzp-stripes i:nth-child(3) { background: #62b04f; }

/* Plate input styled as the Uzbek plate: grey frame, mounting dots, flag + blue UZ */
.plate-field { border: 3px solid #5f6680; border-radius: 12px; align-items: center; padding: 0 8px; }
.plate-field::before, .plate-field::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #1f2133; flex: none; }
.plate-field::after { order: 3; }
.plate-field:focus-within { border-color: var(--brand); }
.plate-field input { color: #1f2133; letter-spacing: .12em; padding: 14px 10px; }
.plate-field input::placeholder { color: #c9cdd8; }
.plate-flag { order: 2; border-left: 0; padding: 0 8px 0 4px; gap: 1px; align-items: center; }
.plate-flag i { width: 32px; height: 5px; border-radius: 0; outline: none; }
.plate-flag i:nth-child(1) { background: #4597b4; }
.plate-flag i:nth-child(2) { background: #fff; height: 2px; border-top: 1px solid #e05555; border-bottom: 1px solid #e05555; outline: none; }
.plate-flag i:nth-child(3) { background: #62b04f; }
.plate-flag b { font: 800 21px/1 Figtree, sans-serif; color: #4597b4; margin-top: 2px; }

/* Driver card: one place for name, callsign, car and bonus balance */
.driver-card { margin-top: 12px; display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.dc-avatar { width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--brand-tint); color: var(--brand); font-weight: 800; font-size: 16px; }
.dc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dc-name { font-size: 16px; font-weight: 800; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-sub { font-size: 13px; color: var(--muted); font-weight: 600; }
.dc-bonus { text-align: right; flex: none; display: flex; flex-direction: column; }
.dc-bonus small { font-size: 12px; color: var(--muted); font-weight: 600; }
.dc-bonus b { font-size: 18px; font-weight: 800; color: var(--s-partial); font-variant-numeric: tabular-nums; white-space: nowrap; }
.driver-card.loading .dc-name, .driver-card.muted-card .dc-name { font-size: 14px; color: var(--muted); font-weight: 600; white-space: normal; }
/* plate badge scales with the screen so the widest plate (01 A 123 BC) always fits */
.uzplate { max-width: 100%; }
.uzplate .uzp-region, .uzplate .uzp-number { font-size: clamp(22px, 7.6vw, 34px); }
.uzplate .uzp-number { letter-spacing: .08em; padding: 0 10px 0 12px; }

/* Framing guide: rear three-quarter car drawing used as a mask, tinted per place */
.car-guide { display: block; -webkit-mask: url("img/car-34.webp") center / contain no-repeat; mask: url("img/car-34.webp") center / contain no-repeat; }
.shot .shot-guide.car-guide { position: absolute; left: 8%; right: 8%; top: 10%; width: auto; height: 62%; background: var(--brand); opacity: .45; stroke: none; }
.cam-guide.car-guide { width: 92%; max-width: 620px; aspect-ratio: 2 / 1; height: auto; background: #fff; opacity: .85;
  filter: drop-shadow(0 0 3px rgba(0,0,0,.6)); stroke: none; }

/* Branding choice: same sedan drawing; branded = green + TaxiOK badge, plain = grey */
.car-art { position: relative; display: block; width: 100%; height: 72px; margin-bottom: 6px; }
.car-art .car-line { position: absolute; inset: 0; }
.car-art.branded .car-line { background: var(--brand); }
.car-art.plain .car-line { background: #9aa3ad; }
.car-art .car-badge { position: absolute; left: 30%; top: 44%; width: 30px; height: auto; border-radius: 4px;
  background: #fff; padding: 1px 2px; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.choice[aria-pressed="true"] .car-art.plain .car-line { background: #6f7a86; }

/* Plate on the car step: centered on a soft full-width plate holder */
#step-car .car-plate { display: flex; width: fit-content; margin: 4px auto 0; }
#step-car .back + .car-plate { margin-top: 8px; }
#step-car .car-plate { position: relative; }
#step-car .car-plate::before { content: ""; position: absolute; inset: -14px -100vw; z-index: -1;
  background: linear-gradient(180deg, transparent, rgba(35,140,35,.06) 30%, rgba(35,140,35,.06) 70%, transparent); }
#step-car { position: relative; z-index: 0; overflow: hidden; }

/* Branding choice: the answer reads first (pill + Yes/No), the drawing supports it */
.choice-pill { align-self: flex-start; font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; margin-bottom: 4px; }
.choice-pill.free { background: var(--brand-tint); color: var(--brand); }
.choice-pill.paid { background: #e8efff; color: var(--s-partial); }
.choice .choice-title { font-size: 15px; }
.choice[data-type="none"][aria-pressed="true"] { border-color: var(--s-partial); box-shadow: 0 0 0 4px rgba(37,99,235,.12); }
.choice[data-type="none"] .choice-check { background: var(--s-partial); }
.car-art { height: 64px; }
/* Branded car reads as wrapped: green checker band along the side + big OK badge + green glow */
.car-art.branded { background: radial-gradient(60% 55% at 50% 70%, rgba(35,140,35,.16), transparent 70%); border-radius: 12px; }
.car-art.branded::before { content: ""; position: absolute; left: 7%; width: 47%; top: 50%; height: 18%; transform: skewY(-4deg);
  background: repeating-conic-gradient(var(--brand) 0 25%, rgba(35,140,35,.25) 0 50%) 0 0 / 8px 8px; opacity: .85; border-radius: 3px; }
.car-art.branded .car-badge { left: 22%; top: 30%; width: 40px; z-index: 1; }
.car-art.branded .car-line { z-index: 1; }
.car-art.plain .car-line { background: #a7afb8; }
/* clean: no badge, no band — green car vs grey car */
.car-art.branded::before { content: none; }
.car-art .car-badge { display: none; }

/* pull to refresh */
html, body { overscroll-behavior-y: contain; }
.ptr { position: fixed; top: 0; left: 50%; z-index: 60; width: 40px; height: 40px; margin-left: -20px; border-radius: 50%;
  background: var(--card, #fff); color: var(--brand); box-shadow: 0 2px 10px rgba(0,0,0,.15); display: grid; place-items: center;
  transform: translateY(-48px); opacity: 0; pointer-events: none; }
.ptr .ic { width: 22px; height: 22px; }
.ptr.ready .ic { color: var(--brand-dark); }
.ptr.spin { transition: transform .2s; }
.ptr.spin .ic { animation: spin .8s linear infinite; }
.ptr.back { transition: transform .2s, opacity .2s; }

.role-btn { border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px;
  padding: 6px 10px; font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; }
.role-btn:active { background: var(--bg); }

/* free wash: sum put into the wash machine, may be lowered (e.g. 15 000 is enough) */
.free-amount { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.25); font-size: 14px; font-weight: 600; }
.free-amount .amount-input { border-color: transparent; }

/* branded card when TM has no active driver for the car */
.choice.locked { opacity: .5; background: var(--bg); }
.choice.locked .choice-pill { filter: grayscale(1); }
.choice.locked .choice-sub { color: var(--danger); }
