:root {
  --teal: #0f5e63; --teal-d: #0b4a4e; --teal-l: #e6f2f2;
  --ink: #1e293b; --muted: #64748b; --line: #e2e8f0; --bg: #f4f6f8; --card: #fff;
  --amber: #d97706; --amber-l: #fffbeb; --red: #dc2626; --red-l: #fef2f2; --green: #16a34a; --green-l: #f0fdf4;
  --r: 16px; --rc: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 18px/1.5 "Lato", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  padding-bottom: calc(110px + env(safe-area-inset-bottom));
}
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  background: var(--teal); color: #fff; padding: 14px 16px; padding-top: calc(14px + env(safe-area-inset-top));
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; }
.logo { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: #fff; color: var(--teal); font-weight: 900; }
main { max-width: 600px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border-radius: var(--r); padding: 20px; box-shadow: 0 1px 3px rgba(15, 23, 42, .08); margin-bottom: 16px; }
.center { text-align: center; }
h1 { font-size: 28px; line-height: 1.25; margin: 4px 0 12px; }
h2 { font-size: 22px; margin: 0 0 12px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 15px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 60px; padding: 12px 18px; border-radius: var(--rc); border: 2px solid var(--teal);
  background: var(--teal); color: #fff; font: inherit; font-size: 20px; font-weight: 700; cursor: pointer;
}
.btn:active { background: var(--teal-d); }
.btn.secondary { background: var(--card); color: var(--teal); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn + .btn { margin-top: 12px; }
.link { background: none; border: 0; color: inherit; font: inherit; font-size: 16px; text-decoration: underline; cursor: pointer; padding: 8px; }

.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 8px 0 4px; }
.progress > i { display: block; height: 100%; background: var(--teal); border-radius: 99px; transition: width .3s; }
.steplabel { font-weight: 700; color: var(--teal); font-size: 17px; }

.field { margin: 0 0 18px; }
.field > label, .field > .label { display: block; font-weight: 700; margin-bottom: 6px; }
.req { color: var(--red); }
.opt { color: var(--muted); font-weight: 400; font-size: 15px; }
input[type=text], input[type=date], input[type=email], input[type=tel], select, textarea {
  width: 100%; min-height: 56px; padding: 12px 14px; font: inherit; font-size: 19px; color: var(--ink);
  border: 2px solid var(--line); border-radius: var(--rc); background: #fff; appearance: none; -webkit-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% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-l); }
.invalid input, .invalid select, .invalid textarea { border-color: var(--red); }
.err { color: var(--red); font-size: 15px; margin-top: 4px; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chips label { flex: 1 1 140px; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 14px; border: 2px solid var(--line);
  border-radius: var(--rc); background: #fff; cursor: pointer; font-weight: 400; margin: 0; }
.chips input { width: 22px; height: 22px; accent-color: var(--teal); margin: 0; }
.chips label:has(input:checked) { border-color: var(--teal); background: var(--teal-l); font-weight: 700; }

.agree { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 2px solid var(--line); border-radius: var(--rc); background: #fff; cursor: pointer; }
.agree input { width: 26px; height: 26px; accent-color: var(--teal); flex: none; margin-top: 2px; }
.decl { background: #f8fafc; border-radius: var(--rc); padding: 14px; font-size: 16px; max-height: 340px; overflow: auto; margin-bottom: 16px; }

.doc { display: grid; grid-template-columns: 1fr auto; gap: 10px 12px; align-items: center; padding: 14px; border: 2px solid var(--line); border-radius: var(--rc); margin-bottom: 12px; }
.doc.done { border-color: var(--green); background: var(--green-l); }
.doc .name { font-weight: 700; }
.doc .state { font-size: 15px; color: var(--muted); }
.doc.done .state { color: var(--green); font-weight: 700; }
.doc .pick { min-height: 52px; width: auto; font-size: 18px; padding: 8px 16px; }
.doc img { grid-column: 1 / -1; width: 100%; max-height: 220px; object-fit: contain; border-radius: 10px; background: #fff; }
.doc input[type=file] { display: none; }

.banner { border-radius: var(--rc); padding: 14px 16px; margin-bottom: 16px; }
.banner.amber { background: var(--amber-l); color: #92400e; border: 1px solid #fcd34d; }
.banner.red { background: var(--red-l); color: #991b1b; border: 1px solid #fca5a5; }
.banner.green { background: var(--green-l); color: #166534; border: 1px solid #86efac; }

.foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}
.foot .row { max-width: 600px; margin: 0 auto; display: grid; grid-template-columns: 32% 1fr; gap: 12px; }
.foot .btn + .btn { margin-top: 0; }

.big-icon { font-size: 56px; line-height: 1; margin: 8px 0 12px; }
.spinner { width: 40px; height: 40px; margin: 12px auto; border-radius: 50%; border: 4px solid var(--teal-l); border-top-color: var(--teal); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.steps { list-style: none; padding: 0; margin: 0 0 8px; text-align: left; }
.steps li { padding: 6px 0 6px 34px; position: relative; }
.steps li::before { content: counter(s); counter-increment: s; position: absolute; left: 0; top: 6px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--teal-l); color: var(--teal); font-weight: 700; font-size: 14px; display: grid; place-items: center; }
.steps { counter-reset: s; }

#toast { position: fixed; left: 16px; right: 16px; bottom: calc(100px + env(safe-area-inset-bottom)); z-index: 10; max-width: 568px; margin: 0 auto;
  background: var(--ink); color: #fff; border-radius: var(--rc); padding: 14px 16px; font-size: 17px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }
#toast.error { background: var(--red); }
#toast.ok { background: var(--green); }
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ daily driver screens (phase 2) */
.foot .row.one { grid-template-columns: 1fr; }
.hero { background: var(--teal); color: #fff; border-radius: var(--r); padding: 18px 18px 16px; margin-bottom: 14px; }
.hero h1 { color: #fff; margin: 0; font-size: 28px; }
.hero-top { display: flex; align-items: center; justify-content: space-between; }
.hero-veh { opacity: .9; font-size: 16px; margin: 4px 0 12px; }
.iconbtn { background: rgba(255,255,255,.16); color: #fff; border: 0; border-radius: 12px; width: 48px; height: 48px; font-size: 24px; cursor: pointer; }
.pill { display: inline-block; border-radius: 99px; padding: 8px 14px; font-weight: 700; font-size: 15px; }
.pill.ghost { background: rgba(255,255,255,.18); }
.pill.green { background: var(--green); }
.pill.amber { background: var(--amber); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { position: relative; display: flex; flex-direction: column; gap: 2px; min-height: 128px; padding: 16px 14px 14px; border-radius: var(--r);
  background: var(--card); color: var(--ink); text-decoration: none; box-shadow: 0 1px 3px rgba(15,23,42,.08); border-left: 6px solid var(--teal); }
.tile:active { background: var(--teal-l); }
.tile.todo { border-left-color: var(--amber); background: var(--amber-l); }
.tile .ic { font-size: 28px; line-height: 1.1; }
.tile .tl { font-weight: 800; font-size: 18px; line-height: 1.2; margin-top: 6px; }
.tile .ts { color: var(--muted); font-size: 15px; }
.tile .dot { position: absolute; top: 14px; right: 14px; width: 12px; height: 12px; border-radius: 50%; background: var(--red); }

.screenhead { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.screenhead h1 { margin: 0; font-size: 26px; }
.back { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 12px; background: var(--card); color: var(--teal);
  font-size: 32px; font-weight: 700; text-decoration: none; box-shadow: 0 1px 3px rgba(15,23,42,.08); }
.pad0 { padding: 0; overflow: hidden; }
.sect { margin: 18px 4px 10px; font-size: 20px; }

.chk { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.chk:last-child { border-bottom: 0; }
.chk.failed { background: var(--red-l); }
.chk-l { font-size: 17px; line-height: 1.3; }
.crit { color: var(--amber); }
.seg { display: flex; flex: none; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { min-width: 64px; min-height: 48px; border: 0; background: #fff; font: inherit; font-size: 16px; font-weight: 700; color: var(--muted); cursor: pointer; }
.seg button + button { border-left: 2px solid var(--line); }
.seg button.on.pass { background: var(--green); color: #fff; }
.seg button.on.fail { background: var(--red); color: #fff; }
.sum { border-radius: var(--rc); padding: 12px 16px; font-weight: 800; margin-bottom: 16px; }
.sum.green { background: var(--green-l); color: #166534; }
.sum.amber { background: var(--amber-l); color: #92400e; }
.sum.red { background: var(--red-l); color: #991b1b; }

.photos { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.photos:empty { display: none; }
.ph { position: relative; width: 96px; height: 96px; border-radius: 12px; overflow: hidden; background: var(--line); }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph .pdf { display: grid; place-items: center; height: 100%; font-weight: 800; color: var(--muted); }
.ph button { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(220,38,38,.92); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; }
.photobtns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.photobtns .btn { min-height: 54px; font-size: 17px; }
.photobtns .btn + .btn { margin-top: 0; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid2 .field label { font-size: 16px; }
.kmq { color: var(--teal); font-size: 16px; margin: -6px 0 14px; }
.kmq:empty { display: none; }
.switch { display: flex; align-items: center; gap: 12px; min-height: 56px; margin: 0 0 14px; padding: 8px 14px; border: 2px solid var(--line); border-radius: var(--rc); cursor: pointer; font-weight: 700; }
.switch input { width: 26px; height: 26px; accent-color: var(--teal); margin: 0; }
.switch:has(input:checked) { border-color: var(--teal); background: var(--teal-l); }

.gps { font-size: 16px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spinner.sm { width: 18px; height: 18px; border-width: 3px; margin: 0; display: inline-block; }
.link.dark { color: var(--teal); padding: 0; font-size: 16px; }
.ck { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 16px; line-height: 1.35; }
.ck .ico { flex: none; width: 24px; font-weight: 900; font-size: 18px; }
.ck.ok .ico, .ok { color: var(--green); }
.ck.bad .ico, .bad { color: var(--red); }
.ck.warn .ico, .warn { color: var(--amber); }
.esc { color: #6b46c1; }
.ck-foot { padding: 12px 14px; font-weight: 700; font-size: 16px; }
.ck-foot.ok { background: var(--green-l); } .ck-foot.bad { background: var(--red-l); } .ck-foot.warn { background: var(--amber-l); }

.docrow { display: flex; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 17px; }
.docrow:last-child { border-bottom: 0; }
.docrow span:first-child { font-weight: 700; }
.docrow span:last-child { text-align: right; }
.rem { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: 2px solid var(--line); border-radius: var(--rc); padding: 14px; margin-bottom: 10px; cursor: pointer; }
.rem input { width: 24px; height: 24px; accent-color: var(--teal); flex: none; margin: 2px 0 0; }
.rem:has(input:checked) { border-color: var(--teal); background: var(--teal-l); }
.rem.sent { opacity: .8; }

.list { display: flex; flex-direction: column; gap: 10px; }
.note, .sub { background: var(--card); border-radius: var(--rc); padding: 14px 16px; box-shadow: 0 1px 3px rgba(15,23,42,.08); }
.note.unread { border-left: 6px solid var(--teal); }
.note-h, .sub-h { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.note-b { color: var(--muted); font-size: 16px; margin: 4px 0 8px; white-space: pre-line; }
.note-f { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.cat { font-size: 13px; font-weight: 800; text-transform: uppercase; color: var(--muted); flex: none; }
.btn.sm { min-height: 44px; width: auto; font-size: 16px; padding: 6px 14px; }
.st { font-size: 14px; font-weight: 800; text-align: right; }
.filters { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 12px; padding-bottom: 4px; }
.filters button { flex: none; min-height: 44px; padding: 6px 16px; border-radius: 99px; border: 2px solid var(--line); background: #fff; font: inherit; font-size: 16px; cursor: pointer; }
.filters button.on { border-color: var(--teal); background: var(--teal); color: #fff; font-weight: 700; }
@media (max-width: 360px) { .tile .tl { font-size: 16px; } .seg button { min-width: 54px; } }
/* freelancer order counts at sign-out */
.otypes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.otype { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 15px; }
.otype input { width: 100%; }

/* my traffic fines */
.fine.todo { border-left: 6px solid var(--red, #dc2626); }
.famt { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 8px 0 4px; font-size: 16px; }
.fbtns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.fbtns .btn { flex: 1 1 140px; }
.dedconf { margin-top: 10px; }
.st.ok, .small.ok { color: var(--green, #15803d); } .st.warn { color: #b45309; } .st.esc, .small.bad { color: #b91c1c; }
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 50; display: flex; align-items: flex-end; justify-content: center; padding: 16px; overflow-y: auto; }
.overlay[hidden] { display: none; }
.dlg { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto; margin: auto 0 0; }
@media (min-width: 600px) { .dlg { margin: auto; } }
body.noscroll { overflow: hidden; }
.dlg .fbtns { align-items: stretch; } .dlg .fbtns .btn { margin: 0; }

/* ---------------- right-to-left (Arabic / Urdu) ---------------- */
[dir=rtl] body { font-family: "Noto Naskh Arabic", "Geeza Pro", "Segoe UI", Tahoma, system-ui, sans-serif; }
[lang=ur] body { font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Urdu Typesetting", "Noto Naskh Arabic", Tahoma, system-ui, sans-serif; line-height: 1.9; }
[dir=rtl] select { background-position: 22px 50%, 16px 50%; padding-right: 14px; padding-left: 40px; }
[dir=rtl] .steps { text-align: right; }
[dir=rtl] .steps li::before { left: auto; right: 0; }
[dir=rtl] .tile { border-left: 0; border-right: 6px solid var(--teal); }
[dir=rtl] .tile.todo { border-right-color: var(--amber); }
[dir=rtl] .tile .dot { right: auto; left: 14px; }
[dir=rtl] .seg button + button { border-left: 0; border-right: 2px solid var(--line); }
[dir=rtl] .ph button { right: auto; left: 4px; }
[dir=rtl] .docrow span:last-child, [dir=rtl] .st { text-align: left; }
[dir=rtl] .note.unread { border-left: 0; border-right: 6px solid var(--teal); }
[dir=rtl] .fine.todo { border-left: 0; border-right: 6px solid var(--red, #dc2626); }
/* numbers, plates and emails stay left-to-right inside Arabic / Urdu text */
[dir=rtl] input[inputmode=numeric], [dir=rtl] input[inputmode=decimal], [dir=rtl] input[type=email], [dir=rtl] input[type=tel], [dir=rtl] input[type=number] { direction: ltr; text-align: right; }
.langpick { display: flex; gap: 6px; justify-content: center; margin: 0 0 12px; }
.langpick button { border: 2px solid var(--line); background: var(--card); color: var(--ink); border-radius: 99px; padding: 6px 14px; font-size: 15px; cursor: pointer; }
.langpick button.on { border-color: var(--teal); background: var(--teal); color: #fff; }
.langlist { display: grid; gap: 8px; margin-top: 6px; }
.langrow { display: flex; align-items: center; gap: 10px; border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 18px; }
.langrow input { width: 22px; height: 22px; }
[dir=rtl] .steps li { padding: 6px 34px 6px 0; }

/* ------------------------------------------------------------------ bottom tabs + list rows (Requests / Reports / My tasks) */
.foot .row.tabs { display: block; }
.foot:has(.tabbar) { padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
.tabbar { display: flex; max-width: 600px; margin: 0 auto; }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 700; position: relative; border-radius: 12px; min-height: 52px; }
.tabbar a .ti { font-size: 22px; line-height: 1.1; }
.tabbar a.on { color: var(--teal); background: var(--teal-l); }
.tabbar a .tb { position: absolute; top: 2px; inset-inline-end: calc(50% - 26px); background: var(--red); color: #fff; border-radius: 10px; font-size: 12px; padding: 0 6px; min-width: 18px; text-align: center; }
.tabhead { margin: 2px 2px 6px; } .tabhead h1 { margin: 0 0 2px; font-size: 26px; }
.sec { font-weight: 800; font-size: 14px; color: var(--muted); margin: 18px 4px 8px; text-transform: uppercase; letter-spacing: .04em; }
.navrow { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: var(--rc); padding: 14px; margin-bottom: 10px; border-inline-start: 6px solid var(--teal);
  color: var(--ink); text-decoration: none; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); min-height: 64px; }
.navrow .ni { font-size: 26px; width: 32px; text-align: center; } .navrow .nt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.navrow .nt b { font-size: 17px; } .navrow .nt small { color: var(--muted); font-size: 14px; white-space: pre-line; }
.navrow .ng { color: var(--muted); font-size: 22px; } [dir=rtl] .navrow .ng { transform: scaleX(-1); }
.navrow.red { border-inline-start-color: var(--red); background: var(--red-l); } .navrow.amb { border-inline-start-color: var(--amber); background: var(--amber-l); }
.link { display: inline-block; margin: 6px 4px; color: var(--teal); font-weight: 700; }
.spinner.sm { width: 26px; height: 26px; border-width: 3px; margin: 6px auto; }
.tile.red { border-left-color: var(--red); background: var(--red-l); }
[dir=rtl] .tile.red { border-right-color: var(--red); }
.jobopt { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-inline-start: 6px solid var(--teal); border-radius: var(--rc); padding: 12px; margin-bottom: 8px; cursor: pointer; }
.jobopt input { margin-top: 4px; width: 20px; height: 20px; flex: none; } .jobopt span { display: flex; flex-direction: column; } .jobopt small { color: var(--muted); font-size: 14px; }
.jobopt.amb { border-inline-start-color: var(--amber); background: var(--amber-l); } .jobopt.red { border-inline-start-color: var(--red); background: var(--red-l); }
.jobopt:has(input:checked) { outline: 2px solid var(--teal); }
.jobdone { margin: 4px 2px 8px; }
