/*
  پنل موبایل — همان سیستم طراحی اپ ویندوزی و سایت (docs/DESIGN.md):
  یک اکسنت سبز، سبز‌-سیاه عمیق در تیره، کرم کاغذی در روشن؛ کارت‌های شیشه‌ای
  دوقاب. موبایل‌محور: نوار ناوبری پایین، دکمه‌ها حداقل ۴۴ پیکسل.
*/
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/vazirmatn-var.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root, [data-theme="dark"] {
  --bg: #0d100b;
  --glow: rgb(47 106 38 / .55);
  --glow2: rgb(28 58 23 / .5);
  --glass: rgb(26 30 22 / .62);
  --glass-strong: rgb(20 24 18 / .86);
  --shell: rgb(255 255 255 / .04);
  --line: rgb(255 255 255 / .08);
  --line-hi: rgb(255 255 255 / .12);
  --ink: #eef0e8;
  --ink2: #b2bbaa;
  --ink3: #8c9786;
  --accent: #7cb36a;
  --on-accent: #10160d;
  --accent-soft: #22311c;
  --ok: #79c08b;   --ok-soft: #1a2e1f;
  --warn: #e0b054; --warn-soft: #2e2614;
  --bad: #e57f72;  --bad-soft: #311a17;
  --track: rgb(255 255 255 / .08);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f6f4ec;
  --glow: rgb(207 227 196 / .9);
  --glow2: rgb(230 239 217 / .9);
  --glass: rgb(255 255 255 / .7);
  --glass-strong: rgb(251 250 245 / .92);
  --shell: rgb(0 0 0 / .03);
  --line: rgb(28 33 25 / .09);
  --line-hi: rgb(255 255 255 / .7);
  --ink: #1c2119;
  --ink2: #525b4c;
  --ink3: #6f786a;
  --accent: #4a7c3f;
  --on-accent: #fff;
  --accent-soft: #e4efdd;
  --ok: #3a7549;   --ok-soft: #e3f0e5;
  --warn: #8f6418; --warn-soft: #f6ecd6;
  --bad: #a23b31;  --bad-soft: #f6e3e0;
  --track: rgb(28 33 25 / .07);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: 'Vazirmatn', Tahoma, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
/* هاله‌های نرم پشت شیشه؛ ثابت و بدون رویداد تا اسکرول را سنگین نکنند */
body::before, body::after {
  content: '';
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(10px);
}
body::before { width: 120vw; height: 120vw; inset-inline-start: -40vw; top: -50vw; background: radial-gradient(var(--glow), transparent 68%); }
body::after  { width: 130vw; height: 130vw; inset-inline-end: -50vw; bottom: -60vw; background: radial-gradient(var(--glow2), transparent 68%); }

button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.dim { color: var(--ink3); }
.muted { color: var(--ink2); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.num { font-feature-settings: 'tnum'; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.hidden { display: none !important; }

.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--track); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── پوسته ───────────────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: var(--glass-strong);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.top h1 { font-size: 19px; margin: 0; flex: 1; font-weight: 800; }
.conn { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink3); }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); }

main { padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); max-width: 980px; margin: 0 auto; }

.nav {
  position: fixed; inset-inline: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px; border-radius: 24px;
  background: var(--glass-strong);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgb(0 0 0 / .25);
}
.nav button {
  border: 0; background: none; border-radius: 18px; min-height: 52px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; color: var(--ink2); cursor: pointer; position: relative;
}
.nav button.on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.nav svg { width: 22px; height: 22px; }
.badge { position: absolute; top: 4px; inset-inline-end: 14px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--warn); color: #1b1407; font-size: 11px; font-weight: 800; display: grid; place-items: center; }

/* ── کارت شیشه‌ای دوقاب ─────────────────────────────────── */
.card {
  background: var(--shell);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 5px;
  margin-bottom: 14px;
}
.card > .core {
  background: var(--glass);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line-hi);
  border-radius: 17px;
  padding: 18px;
}
.card h2, .section-title { font-size: 16px; margin: 0 0 12px; font-weight: 700; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 700; }
.display { font-size: 34px; font-weight: 900; line-height: 1.2; margin: 4px 0; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 720px) { .grid4 { grid-template-columns: repeat(4, 1fr); } }
.stat b { display: block; font-size: 22px; font-weight: 800; }
.stat span { font-size: 12px; color: var(--ink3); }

/* ── فهرست ──────────────────────────────────────────────── */
.list { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 16px;
  background: var(--glass); border: 1px solid var(--line);
  cursor: pointer; min-height: 56px;
}
.row:active { transform: scale(.99); }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub { font-size: 12px; color: var(--ink3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .end { text-align: end; flex: none; }
.thumb { width: 52px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--accent-soft); flex: none; }

.chip { display: inline-flex; align-items: center; border-radius: 11px; padding: 2px 10px 3px; font-size: 12px; font-weight: 700; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }

.seg { display: flex; gap: 3px; padding: 3px; border-radius: 15px; background: var(--shell); border: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; margin-bottom: 12px; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: none; border: 0; background: none; border-radius: 12px; padding: 8px 14px; color: var(--ink2); font-weight: 600; cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--accent); color: var(--on-accent); }

.bar { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; margin-top: 4px; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 150px; }
.chart > div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; height: 100%; }
.chart i { display: block; width: 100%; max-width: 40px; border-radius: 8px 8px 3px 3px; background: var(--accent); opacity: .6; }
.chart i.top { opacity: 1; }
.chart small { font-size: 10px; color: var(--ink3); white-space: nowrap; }

/* ── فرم ────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 13px; color: var(--ink2); font-weight: 600; }
.field .hint { font-size: 12px; color: var(--ink3); }
input[type=text], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px;
  background: var(--shell); border: 1px solid var(--line); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 90px; resize: vertical; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; margin-bottom: 8px; cursor: pointer; }
.switch input { appearance: none; width: 46px; height: 28px; border-radius: 14px; background: var(--track); position: relative; cursor: pointer; transition: background .2s; flex: none; }
.switch input::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink3); transition: inset-inline-start .2s, background .2s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { inset-inline-start: 21px; background: var(--on-accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 23px; border: 1px solid var(--line);
  background: var(--shell); font-weight: 700; cursor: pointer; text-decoration: none; color: var(--ink);
}
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn.danger { color: var(--bad); }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn.big { min-height: 56px; font-size: 17px; border-radius: 28px; }
/* لمس: پاسخ فشردن بی تأخیر ۳۰۰ میلی‌ثانیه‌ای */
.btn, .nav button, .tk-btn, .row { touch-action: manipulation; transition: transform .16s cubic-bezier(.32,.72,0,1), background-color .2s, opacity .2s; }
.btn:active:not(:disabled), .tk-btn:active, .nav button:active { transform: scale(.97); }
.btn:focus-visible, .tk-btn:focus-visible, .nav button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ── کارت فعال/غیرفعال پیک: کل کارت کلید است ─────────── */
.courier-state {
  border-radius: 22px; padding: 18px; margin-bottom: 14px; cursor: pointer; user-select: none;
  border: 1px solid var(--line); background: var(--shell); color: var(--ink);
  transition: background .2s, color .2s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.courier-state:active { transform: scale(.985); }
.courier-state:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.courier-state.on { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.courier-state .cs-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.courier-state .cs-name { font-weight: 700; font-size: 15px; opacity: .85; }
.courier-state .cs-status { font-weight: 900; font-size: 24px; margin-top: 2px; }
.courier-state .cs-hint { font-size: 13px; margin-top: 8px; opacity: .8; }
.courier-state .cs-gps { font-size: 12px; margin-top: 6px; opacity: .7; }
/* ── پنل پیک (بازطراحی ۱۳ آذر ۱۴۰۵) ───────────────────────────
   نشانه‌ی این صفحه «بلیت» سفارش است: کاغذ روشن مثل فیش چاپی رستوران روی زمینه‌ی تیره، با خط پرفراژ
   میان «به کجا» و «چقدر». کاغذ روشن در آفتاب هم خواناست. بقیه‌ی صفحه آرام و تیره می‌ماند. */
.ticket, .courier-due {
  --paper: #f4f1e7;
  --ink: #1d2219; --ink2: #4c5545; --ink3: #687262;
  --line: rgb(29 34 25 / .14); --shell: rgb(29 34 25 / .05);
  --accent: #3d7633; --on-accent: #fff; --accent-soft: #e1edd8;
  --ok: #2c6a3d; --ok-soft: #dfeee2; --warn: #7f540c; --warn-soft: #f5e6c6; --bad: #9d3228; --bad-soft: #f7dfdb;
  background: var(--paper); color: var(--ink);
}
[data-theme="light"] .ticket, [data-theme="light"] .courier-due { --paper: #fffdf7; }
.ticket {
  position: relative; border-radius: 22px; padding: 18px 18px 16px; margin-bottom: 14px;
  /* سایه‌ی رنگ‌دار هم‌رنگ زمینه، نه سیاه خالص */
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .7), 0 2px 4px rgb(6 10 5 / .25), 0 22px 40px -22px rgb(6 10 5 / .8);
}
[data-theme="light"] .ticket { box-shadow: 0 1px 2px rgb(60 70 40 / .12), 0 18px 34px -20px rgb(60 70 40 / .35); }
.ticket.fresh { animation: rise .42s cubic-bezier(.32,.72,0,1) both; }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }
.ticket.on-way { box-shadow: inset 0 3px 0 var(--warn), 0 2px 4px rgb(6 10 5 / .25), 0 22px 40px -22px rgb(6 10 5 / .8); }

.tk-head { display: flex; align-items: center; justify-content: space-between; }
.tk-code { font-size: 22px; font-weight: 900; letter-spacing: .05em; font-feature-settings: 'tnum'; }
.tk-who { font-size: 19px; font-weight: 800; line-height: 1.4; margin-top: 12px; }
.tk-phone { color: var(--ink2); font-size: 15px; font-weight: 600; font-feature-settings: 'tnum'; letter-spacing: .02em; }
.tk-addr { margin-top: 12px; padding: 10px 14px 12px; border-radius: 14px; background: var(--shell); }
.tk-zone { display: block; font-size: 12px; font-weight: 800; color: var(--accent); }
.tk-addr p { margin: 2px 0 0; font-size: 16px; line-height: 1.75; font-weight: 500; }
.tk-acts { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 8px; margin-top: 10px; }
.tk-acts > :only-child { grid-column: 1 / -1; }
.tk-btn {
  display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 10px;
  border-radius: 16px; border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  font-weight: 800; font-size: 16px; text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.tk-btn svg { width: 20px; height: 20px; flex: none; margin: 0 6px; color: var(--accent); }
.tk-note { margin-top: 12px; padding: 4px 12px; border-right: 3px solid var(--warn); font-size: 14px; color: var(--ink2); }
[dir=ltr] .tk-note { border-right: 0; border-left: 3px solid var(--warn); }
.tk-note b { color: var(--ink); }
.tk-items { list-style: none; margin: 12px 0 0; padding: 0; }
.tk-items li { display: grid; grid-template-columns: 2.4em 1fr; align-items: baseline; padding: 5px 0; font-size: 15px; border-bottom: 1px dotted var(--line); }
.tk-items li:last-child { border-bottom: 0; }
.tk-q { font-weight: 900; color: var(--accent); font-feature-settings: 'tnum'; }
/* خط پرفراژ با دو نیم‌دایره‌ی بریده در لبه‌ها */
.tk-tear { position: relative; height: 0; margin: 16px -18px 12px; border-top: 2px dashed var(--line); }
.tk-tear::before, .tk-tear::after { content: ''; position: absolute; top: -12px; width: 22px; height: 22px; border-radius: 50%; background: var(--bg); }
.tk-tear::before { left: -11px; } .tk-tear::after { right: -11px; }
.tk-row { display: grid; grid-template-columns: 1fr auto; grid-gap: 12px; align-items: baseline; padding: 3px 0; }
.tk-row span { color: var(--ink2); }
.tk-row b { font-weight: 800; font-feature-settings: 'tnum'; }
.tk-foot { display: grid; grid-gap: 8px; margin-top: 14px; }
.tk-foot .btn { margin: 0; }
.tk-foot .btn.danger { background: transparent; border-color: var(--bad-soft); }
/* پول نزد مشتری: نوار پهن جدا تا مبلغ بلند هم در کارت بماند */
.cr-pay { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 12px; margin: 6px 0; padding: 10px 14px; border-radius: 14px; background: var(--warn-soft); color: var(--warn); font-weight: 800; }
.cr-pay b { font-size: 20px; font-weight: 900; font-feature-settings: 'tnum'; }
.cr-pay.ok { background: var(--ok-soft); color: var(--ok); padding: 6px 14px; }

/* سربرگ و نوار پایین پیک */
.top-title { flex: 1; min-width: 0; line-height: 1.25; }
.top-title h1 { line-height: 1.25; }
.top-title .tiny { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.courier-main { padding-top: 14px; }
.courier-nav { grid-template-columns: repeat(5, 1fr); padding: 5px; }
.courier-nav button { min-height: 56px; padding: 4px 2px; line-height: 1.2; text-align: center; }
.courier-nav button span:not(.badge) { display: block; max-width: 100%; }
.courier-nav .badge { top: 3px; }
.courier-empty { padding: 44px 16px; }
.courier-empty b { display: block; color: var(--ink2); font-weight: 600; }

/* نصب روی صفحه‌ی خانه (PWA) */
.install { border-radius: 20px; padding: 14px 16px; background: var(--glass-strong); border: 1px dashed var(--line-hi); }
.in-head { display: flex; align-items: center; }
.in-icon { width: 44px; height: 44px; border-radius: 12px; flex: none; margin: 0 0 0 12px; box-shadow: 0 4px 12px rgb(0 0 0 / .3); }
[dir=ltr] .in-icon { margin: 0 12px 0 0; }
.in-head .grow { flex: 1; min-width: 0; }
.in-steps { margin: 12px 0 0; padding: 0 22px 0 0; font-size: 14px; line-height: 1.5; }
[dir=ltr] .in-steps { padding: 0 0 0 22px; }
.in-steps li { padding: 4px 0; }
[lang=fa] .in-steps { list-style-type: persian; } [lang=ar] .in-steps { list-style-type: arabic-indic; }
.in-steps li svg { width: 20px; height: 20px; vertical-align: -5px; margin: 0 6px; color: var(--accent); }
.in-acts { display: flex; justify-content: flex-end; margin-top: 10px; }
.in-acts .btn + .btn { margin-right: 8px; }
[dir=ltr] .in-acts .btn + .btn { margin-right: 0; margin-left: 8px; }
.login-col { width: 100%; max-width: 420px; }
.login-col .card { max-width: none; }
.login-col .install { margin-top: 4px; }

/* کارت کلید فعال/غیرفعال: نقطه‌ی تپنده یعنی «سر کار هستید» (تنها حرکت همیشگی صفحه) */
.courier-state .cs-status::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: currentColor; opacity: .35; margin: 0 0 0 10px; vertical-align: middle; }
[dir=ltr] .courier-state .cs-status::before { margin: 0 10px 0 0; }
.courier-state.on .cs-status::before { opacity: 1; animation: beat 1.8s cubic-bezier(.32,.72,0,1) infinite; }
@keyframes beat { 0% { box-shadow: 0 0 0 0 rgb(16 22 13 / .5); } 100% { box-shadow: 0 0 0 12px rgb(16 22 13 / 0); } }

/* مبلغ بزرگ تسویه و درآمد: همان کاغذ بلیت */
.courier-due { border-radius: 22px; padding: 18px; border: 0; box-shadow: inset 0 1px 0 rgb(255 255 255 / .7), 0 18px 36px -22px rgb(6 10 5 / .8); }
.courier-due .cd-amount { font-feature-settings: 'tnum'; letter-spacing: -.01em; }
.courier-due.due .cd-amount { color: var(--accent); }
.courier-due.owe .cd-amount { color: var(--warn); }
.courier-due .cd-label { font-weight: 700; font-size: 14px; opacity: .85; }
.courier-due .cd-amount { font-weight: 900; font-size: 30px; margin-top: 4px; }
.courier-due .cd-hint { font-size: 13px; margin-top: 6px; opacity: .8; }
.courier-state .cs-knob { flex: none; width: 58px; height: 34px; border-radius: 17px; background: var(--track); position: relative; }
.courier-state .cs-knob::after { content: ""; position: absolute; top: 4px; inset-inline-start: 4px; width: 26px; height: 26px; border-radius: 50%; background: var(--ink3); transition: inset-inline-start .2s; }
.courier-state.on .cs-knob { background: rgb(0 0 0 / .18); }
.courier-state.on .cs-knob::after { inset-inline-start: 28px; background: var(--on-accent); }
.btn:disabled { opacity: .45; cursor: default; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.fab { position: fixed; inset-inline-end: 18px; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 25; width: 56px; height: 56px; border-radius: 28px; border: 0; background: var(--accent); color: var(--on-accent); font-size: 28px; box-shadow: 0 8px 24px rgb(0 0 0 / .3); cursor: pointer; }

/* ── برگه‌ی پایین (به‌جای پنجره) ────────────────────────── */
.sheet-back { position: fixed; top: 0; right: 0; bottom: 0; left: 0; /* نه inset: Chrome 83 */ z-index: 60; background: rgb(0 0 0 / .5); display: flex; align-items: flex-end; justify-content: center; animation: fade .18s ease-out; }
.sheet {
  width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto;
  background: var(--glass-strong); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--line); border-bottom: 0;
  border-radius: 26px 26px 0 0;
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom));
  animation: up .26s cubic-bezier(.32,.72,0,1);
}
@media (min-width: 720px) { .sheet-back { align-items: center; } .sheet { border-radius: 26px; border-bottom: 1px solid var(--line); } }
.sheet .grip { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.sheet h2 { margin: 0 0 14px; font-size: 19px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.toast { position: fixed; z-index: 80; inset-inline: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); margin: 0 auto; max-width: 520px; padding: 12px 16px; border-radius: 16px; background: var(--glass-strong); backdrop-filter: blur(18px); border: 1px solid var(--line); box-shadow: 0 10px 30px rgb(0 0 0 / .3); animation: up .22s ease-out; }
.toast.bad { border-color: var(--bad); } .toast.ok { border-color: var(--ok); }

/* ── هشدار سفارش تازه ───────────────────────────────────── */
.alert { position: sticky; top: 64px; z-index: 19; margin: 10px 16px 0; padding: 12px 14px; border-radius: 18px; border: 2px solid var(--warn); background: var(--glass-strong); backdrop-filter: blur(18px); }
.alert .row { background: var(--warn-soft); border: 0; cursor: default; padding: 10px 12px; }
.alert .head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.alert .head b { flex: 1; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login .card { width: 100%; max-width: 420px; }
.brand { width: 56px; height: 56px; border-radius: 18px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 900; font-size: 28px; margin-bottom: 14px; }

.empty { text-align: center; color: var(--ink3); padding: 30px 10px; }
/* مقدار بلند (مبلغ، برچسب) به خط بعد می‌رود به‌جای بیرون زدن از کارت */
.kv { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 12px; padding: 4px 0; }
.kv > * { min-width: 0; overflow-wrap: anywhere; }
.kv > :last-child:not(:first-child) { margin-inline-start: auto; text-align: end; }
.kv span:first-child { color: var(--ink2); }
.chip { max-width: 100%; }
/* متن بی فاصله (نشانی، یادداشت مشتری) کارت را پهن‌تر از صفحه نکند */
.card > .core { min-width: 0; overflow-wrap: anywhere; }
.grid2 > .card, .grid4 > .card { margin-bottom: 0; display: flex; flex-direction: column; }
.grid2 > .card > .core, .grid4 > .card > .core { flex: 1; }
hr { border: 0; border-top: 1px dashed var(--line); margin: 12px 0; }

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

/* کاشی‌های برگه‌ی «بیشتر» */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tiles .row { padding: 14px 12px; min-height: 52px; }
.tiles .row .title { font-size: 15px; }

/* ── نقشه‌ی پیک‌ها و پنل پیک ── */
.fleet-map { height: 58vh; min-height: 280px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.btn.block { display: flex; align-items: center; justify-content: center; width: 100%; margin-top: 8px; text-decoration: none; }
.km-legend { color: var(--ink3); }

/* ── WebView قدیمی اندروید (پیش از Chrome 87): inset-inline-* را نمی‌شناسد ── */
@supports not (inset-inline-start: 0) {
  .nav { left: 10px; right: 10px; }
  .toast { left: 16px; right: 16px; }
  [dir=rtl] body::before { right: -40vw; } [dir=ltr] body::before { left: -40vw; }
  [dir=rtl] body::after  { left: -50vw; }  [dir=ltr] body::after  { right: -50vw; }
  [dir=rtl] .badge { left: 14px; }          [dir=ltr] .badge { right: 14px; }
  [dir=rtl] .fab { left: 18px; }            [dir=ltr] .fab { right: 18px; }
  .switch input::after, .courier-state .cs-knob::after { transition: right .2s, left .2s, background .2s; }
  [dir=rtl] .switch input::after { right: 3px; }  [dir=ltr] .switch input::after { left: 3px; }
  [dir=rtl] .switch input:checked::after { right: 21px; }  [dir=ltr] .switch input:checked::after { left: 21px; }
  [dir=rtl] .courier-state .cs-knob::after { right: 4px; }  [dir=ltr] .courier-state .cs-knob::after { left: 4px; }
  [dir=rtl] .courier-state.on .cs-knob::after { right: 28px; }  [dir=ltr] .courier-state.on .cs-knob::after { left: 28px; }
}

/* ── WebView قدیمی اندروید (پیش از Chrome 84): gap در flex نیست؛ console.js کلاس no-fgap می‌گذارد ── */
.no-fgap .top > * + * { margin-inline-start: 10px; }
.no-fgap .conn .dot { margin-inline-end: 6px; }
.no-fgap .nav button > * + * { margin-top: 2px; }
.no-fgap .list > * + * { margin-top: 8px; }
.no-fgap .row > * + * { margin-inline-start: 12px; }
.no-fgap .seg > * + * { margin-inline-start: 3px; }
.no-fgap .chart > * + * { margin-inline-start: 6px; }
.no-fgap .chart > div > * + * { margin-top: 4px; }
.no-fgap .field > * + * { margin-top: 6px; }
.no-fgap .switch > * + *, .no-fgap .courier-state .cs-row > * + *, .no-fgap .kv > * + * { margin-inline-start: 12px; }
.no-fgap .btn > * + * { margin-inline-start: 8px; }
.no-fgap .actions > * { margin-bottom: 8px; margin-inline-end: 8px; }
.no-fgap .actions { margin-bottom: -8px; }
.no-fgap .actions > :last-child, .no-fgap .actions > .block { margin-inline-end: 0; }
.no-fgap .alert .head > * + * { margin-inline-start: 8px; }
.no-fgap .stack > * + * { margin-top: 12px; }
.no-fgap .cr-pay > * + * { margin-inline-start: 12px; }
