/* =========================================================
   زودني · نظام التصميم
   ========================================================= */

:root {
  /* الهوية */
  --brand: #0b3b2c;
  --brand-2: #14543f;
  --brand-3: #1d6b50;
  --brand-text: #0b3b2c;        /* لون النص/الحدود بلون الهوية */
  --brand-soft: #eaf3ef;        /* خلفية فاتحة بلون الهوية */
  --on-brand: #ffffff;
  --on-brand-soft: #c9ded5;     /* نص ثانوي فوق خلفية الهوية */

  --accent: #d4a93a;            /* ذهبي شمبانيا، نفس درجة الأيقونة الجديدة */
  --accent-2: #f2d27a;
  --on-accent: #3a2a00;

  /* الأسطح */
  --bg: #f4f7f5;
  --page: #e6ecea;
  --card: #ffffff;
  --card-2: #f8faf9;

  /* النصوص */
  --text: #12201b;
  --text-2: #33443d;
  --muted: #5b6d66;             /* تباين أعلى من السابق ليبين أوضح */

  /* الحدود */
  --line: #e0e8e4;
  --line-strong: #c8d6d0;

  /* حالات */
  --ok: #0f7a4e;
  --ok-bg: #e2f4ea;
  --warn: #8a6300;
  --warn-bg: #fcf2d6;
  --danger: #b23b3b;
  --danger-bg: #fbe9e9;
  --info-bg: #e9f2fb;

  /* الزوايا */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --radius: 18px;

  /* الظلال */
  --sh-1: 0 1px 2px rgba(11, 59, 44, .05), 0 2px 8px rgba(11, 59, 44, .05);
  --sh-2: 0 2px 6px rgba(11, 59, 44, .06), 0 12px 28px rgba(11, 59, 44, .08);
  --sh-3: 0 -8px 30px rgba(11, 59, 44, .10);
  --shadow: var(--sh-2);

  --font: "IBM Plex Sans Arabic", "Noto Sans Arabic", -apple-system,
          "SF Arabic", "Segoe UI", Tahoma, sans-serif;

  font-size: 17px;      /* أساس أكبر: كل النصوص بتكبر معه */
  color-scheme: light;
}

/* ===== الوضع الليلي (بيتفعل تلقائياً حسب الساعة) ===== */
html[data-theme="dark"] {
  --brand: #17614a;
  --brand-2: #114132;
  --brand-3: #1d6b50;
  --brand-text: #63d6a8;
  --brand-soft: #16302a;
  --on-brand: #ffffff;
  --on-brand-soft: #b3cec4;

  --accent: #e2b64a;
  --accent-2: #f6d97a;

  --bg: #0f1815;
  --page: #080d0b;
  --card: #17231f;
  --card-2: #1d2b26;

  --text: #eaf2ee;
  --text-2: #c3d3cc;
  --muted: #9db0a8;

  --line: #27352f;
  --line-strong: #3a4b44;

  --ok: #5fd3a5;
  --ok-bg: #14352a;
  --warn: #f0c458;
  --warn-bg: #33290f;
  --danger: #ef8a8a;
  --danger-bg: #3a1e1e;
  --info-bg: #16242f;

  --sh-1: 0 1px 2px rgba(0, 0, 0, .3);
  --sh-2: 0 4px 10px rgba(0, 0, 0, .3), 0 14px 34px rgba(0, 0, 0, .28);
  --sh-3: 0 -8px 30px rgba(0, 0, 0, .35);

  color-scheme: dark;
}

/* عرض التطبيق: عالموبايل كامل الشاشة (كان 430 ثابت، فعالآيفون الكبير
   430 < 440 نقطة ويطلع شريط فاتح عالحافتين). عالشاشات الكبيرة منحصرو بالنص. */
:root { --app-max: 100%; }
@media (min-width: 600px) { :root { --app-max: 430px; } }

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { height: 100%; }

body {
  min-height: 100%;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  background: var(--page);
  color: var(--text);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#app {
  width: 100%;
  max-width: var(--app-max);
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  box-shadow: 0 0 60px rgba(0, 0, 0, .16);
}

h1, h2, h3, h4 { line-height: 1.4; font-weight: 800; }

/* إتاحة: إطار واضح للتنقل بالكيبورد */
:focus-visible {
  outline: 3px solid var(--brand-text);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ===== الشاشات ===== */
.screen {
  display: none;
  min-height: 100dvh;
  padding-bottom: calc(146px + env(safe-area-inset-bottom));
  animation: fadeIn .28s ease;
}

/* الشاشات يلي فيها شريط تأكيد ثابت تحت: مساحة إضافية ليبين آخر المحتوى */
#screen-fuel, #screen-service {
  padding-bottom: calc(225px + env(safe-area-inset-bottom));
}
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.content { padding: 18px 16px; }

/* ===== أدوات نصية ===== */
.muted { color: var(--muted); }
.small { font-size: .9rem; line-height: 1.65; }
.tiny  { font-size: .84rem; line-height: 1.75; margin-top: 6px; }
.grow  { flex: 1; min-width: 0; }

.section-title {
  margin: 22px 0 12px;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text);
}

/* صندوق ملاحظة/تنبيه واضح بالوضعين */
.note {
  background: var(--info-bg);
  color: var(--text-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: .86rem;
  line-height: 1.85;
  margin-top: 12px;
}
.note strong { color: var(--text); }
.note.warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); }
.note.warn strong { color: var(--warn); }

/* ===== أزرار ===== */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 54px;
  padding: 14px 18px; border: 0; border-radius: var(--r-md);
  font-size: 1rem; font-weight: 700; font-family: inherit; line-height: 1.3;
  cursor: pointer;
  transition: transform .1s ease, box-shadow .2s ease, opacity .2s ease, background .2s ease;
}
.btn:active { transform: scale(.985); }

.btn-primary {
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: 0 4px 14px rgba(11, 59, 44, .22);
}
.btn-primary:disabled { opacity: .4; box-shadow: none; cursor: not-allowed; }

/* زر البداية ذهبي متل الدبوس */
.btn-light {
  background: linear-gradient(180deg, #f6d97a 0%, #e2b64a 55%, #c9962e 100%);
  color: #2a1d00;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .45);
}

.btn-ghost {
  background: transparent; color: var(--brand-text);
  border: 1.5px solid var(--brand-text);
  margin-top: 12px;
}

.icon-btn {
  display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--line);
  color: var(--text);
  width: 44px; height: 44px; border-radius: var(--r-md);
  font-size: 1.15rem; cursor: pointer; flex-shrink: 0;
  transition: background .2s;
}
.icon-btn.call { background: var(--brand); border-color: transparent; }

/* ===== شاشة البداية ===== */
#screen-splash { padding-bottom: 0; }
.splash {
  min-height: 100dvh;
  /* نفس خلفية الأيقونة: توهّج أخضر بالنص وبيغمق عالأطراف */
  background:
    radial-gradient(75% 55% at 50% 32%, #1a5d46 0%, #0f4634 40%, #0b3b2c 68%, #06261c 100%);
  color: #fff;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px;
  /* حشوة سفلية أكبر: بترفع المحتوى شوي ليقل الفراغ فوق ويبقى قريب من شريط الطريق */
  padding: calc(26px + env(safe-area-inset-top)) 26px calc(58px + env(safe-area-inset-bottom));
  text-align: center;
  position: relative; overflow: hidden;
}
.splash > *:not(.splash-anim) { position: relative; z-index: 2; }

/* ===== الخلفية المتحركة (هادية ومو مشتّتة) ===== */
.splash-anim { position: absolute; inset: 0; z-index: 1; pointer-events: none; }

.splash-anim .fl {
  position: absolute; bottom: -70px;
  font-size: 22px; opacity: 0;
  animation: floatUp linear infinite;
}
.splash-anim .i1  { right: 8%;  font-size: 24px; animation-duration: 15s; animation-delay: 0s; }
.splash-anim .i2  { right: 22%; font-size: 20px; animation-duration: 17s; animation-delay: 3.5s; }
.splash-anim .i3  { right: 38%; font-size: 22px; animation-duration: 14s; animation-delay: 6.5s; }
.splash-anim .i4  { right: 55%; font-size: 20px; animation-duration: 18s; animation-delay: 2s; }
.splash-anim .i5  { right: 70%; font-size: 18px; animation-duration: 13s; animation-delay: 5s; }
.splash-anim .i6  { right: 84%; font-size: 20px; animation-duration: 16s; animation-delay: 8.5s; }
.splash-anim .i7  { right: 15%; font-size: 21px; animation-duration: 16s; animation-delay: 10.5s; }
.splash-anim .i8  { right: 48%; font-size: 17px; animation-duration: 14s; animation-delay: 9s; }
.splash-anim .i9  { right: 64%; font-size: 20px; animation-duration: 17s; animation-delay: 12s; }
.splash-anim .i10 { right: 30%; font-size: 19px; animation-duration: 15s; animation-delay: 5.5s; }

@keyframes floatUp {
  0%   { transform: translateY(0) scale(.7) rotate(0deg); opacity: 0; }
  10%  { opacity: .24; }
  60%  { opacity: .18; }
  100% { transform: translateY(-108dvh) scale(1.15) rotate(12deg); opacity: 0; }
}

/* الطريق والسيارة */
.splash-anim .road {
  position: absolute; bottom: calc(58px + env(safe-area-inset-bottom)); left: 0; right: 0; height: 2px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .22) 0 26px, transparent 26px 50px);
  animation: roadMove 1.4s linear infinite;
}
@keyframes roadMove {
  from { background-position-x: 0; }
  to   { background-position-x: -50px; }
}

.splash-anim .station {
  position: absolute; bottom: calc(72px + env(safe-area-inset-bottom)); font-size: 26px;
  transform: translateX(50%); opacity: .55;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .3));
}
.splash-anim .st1 { right: 14%; }
.splash-anim .st2 { right: 38%; }
.splash-anim .st3 { right: 62%; }
.splash-anim .st4 { right: 86%; }

.splash-anim .scar {
  position: absolute; bottom: calc(58px + env(safe-area-inset-bottom)); right: -10%;
  font-size: 34px; transform: translateX(50%); opacity: .8;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .35));
  animation: carTour 18s ease-in-out infinite;
}
@keyframes carTour {
  0%   { right: -10%; }
  6%   { right: 14%; }
  22%  { right: 14%; }
  29%  { right: 38%; }
  45%  { right: 38%; }
  52%  { right: 62%; }
  66%  { right: 62%; }
  73%  { right: 86%; }
  89%  { right: 86%; }
  100% { right: 110%; }
}

.splash-anim .fx {
  position: absolute; bottom: calc(96px + env(safe-area-inset-bottom)); font-size: 20px;
  transform: translateX(50%); opacity: 0;
}
.splash-anim .fx1 { right: 14%; animation: fxPop 18s ease-in-out infinite; animation-delay: 0s; }
.splash-anim .fx2 { right: 38%; animation: fxPop 18s ease-in-out infinite; animation-delay: 4.14s; }
.splash-anim .fx3 { right: 62%; animation: fxPop 18s ease-in-out infinite; animation-delay: 8.28s; }
.splash-anim .fx4 { right: 86%; animation: fxPop 18s ease-in-out infinite; animation-delay: 12.06s; }
@keyframes fxPop {
  0%   { opacity: 0; transform: translate(50%, 6px) scale(.5); }
  6%   { opacity: .85; transform: translate(50%, -6px) scale(1.05); }
  16%  { opacity: .7; transform: translate(50%, -20px) scale(1); }
  22%  { opacity: 0; transform: translate(50%, -30px) scale(.9); }
  100% { opacity: 0; }
}

/* الشعار: الدبوس الذهبي نفسو تبع الأيقونة، بلا مربع حوليه */
.splash-logo {
  width: 112px; height: 140px;
  display: grid; place-items: center;
  animation: bounce 3.2s ease-in-out infinite;
}
.splash-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.splash-title {
  font-size: 3.1rem; font-weight: 800; letter-spacing: 0;
  margin-top: 4px;
}
.splash-sub {
  color: rgba(255, 255, 255, .88);
  font-size: 1.04rem; line-height: 1.85; max-width: 345px;
}
.splash .btn { max-width: 320px; margin-top: 24px; }


.splash-services {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 9px; max-width: 345px; margin-top: 8px;
}
.splash-services > span {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(226, 182, 74, .45);
  padding: 10px 16px; border-radius: 999px;
  font-size: .88rem; font-weight: 600;
}

/* ===== الرئيسية ===== */
.home-header {
  background:
    radial-gradient(90% 90% at 80% 0%, #1a5d46 0%, transparent 60%),
    linear-gradient(160deg, var(--brand), #072a20);
  color: #fff;
  padding: 24px 16px 54px;
  padding-top: calc(24px + env(safe-area-inset-top));
  border-radius: 0 0 30px 30px;
}
.home-header .muted { color: var(--on-brand-soft); }
.home-header-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.home-header .icon-btn {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .2);
  color: #fff;
}
.loc-line { font-size: 1.08rem; font-weight: 700; margin-top: 3px; }

.car-card {
  margin-top: 20px; margin-bottom: -46px;
  background: var(--card); color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-2);
  padding: 14px; display: flex; align-items: center; gap: 12px;
  cursor: pointer; position: relative; z-index: 2;
  transition: transform .12s ease;
}
.car-card:active { transform: scale(.99); }
.car-emoji {
  font-size: 1.55rem; background: var(--brand-soft);
  width: 52px; height: 52px; border-radius: var(--r-md);
  display: grid; place-items: center; flex-shrink: 0;
}
.car-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.car-info strong { font-size: .98rem; }
.chev { color: var(--muted); font-size: 1.35rem; }

#screen-home .content { padding-top: 44px; }
#screen-home .content > .section-title:first-child { margin-top: 0; }

/* شبكة الخدمات */
.services-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.service {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 16px 14px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  font-family: inherit; font-size: .95rem; text-align: right; color: var(--text);
  cursor: pointer; box-shadow: var(--sh-1);
  transition: transform .12s ease, border-color .2s ease, box-shadow .2s ease;
}
.service:active { transform: scale(.975); }

/* خدمة مطفية من الـ CRM: بتضل مكانها بس رمادية ومقفلة.
   إخفاؤها كلياً بيخلي الزبون يظن إنو التطبيق ناقص أو خربان. */
.service.svc-off {
  opacity: .45;
  filter: grayscale(1);
  cursor: not-allowed;
  pointer-events: none;
}
.service.svc-off .svc-note { color: #b3261e; font-weight: 700; }
.service strong { font-size: .98rem; line-height: 1.4; }
.service .small { color: var(--muted); }
.service-icon {
  font-size: 1.45rem; width: 48px; height: 48px; border-radius: var(--r-md);
  display: grid; place-items: center; margin-bottom: 6px;
}
.service-icon.fuel { background: #fdf1d4; }
.service-icon.ev   { background: #dcf1ff; }
.service-icon.oil  { background: #f2e6da; }
.service-icon.wash { background: #ddf5ea; }
.service-icon.battery { background: #e9e6fb; }
/* الخدمة الخامسة بتاخد عرض الصف كلو كبطاقة أفقية، بدل ما تضل لحالها */
.services-grid .service:nth-child(odd):last-child {
  grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 12px;
  display: grid; grid-template-columns: 48px 1fr; grid-template-rows: auto auto; column-gap: 12px; row-gap: 0;
}
.services-grid .service:nth-child(odd):last-child .service-icon { grid-row: 1 / 3; margin-bottom: 0; }
html[data-theme="dark"] .service-icon.fuel { background: #3a3216; }
html[data-theme="dark"] .service-icon.ev   { background: #16303f; }
html[data-theme="dark"] .service-icon.oil  { background: #382b1d; }
html[data-theme="dark"] .service-icon.wash { background: #14352a; }
html[data-theme="dark"] .service-icon.battery { background: #2a2545; }

/* البانر الترويجي */
.promo {
  margin-top: 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: var(--r-lg);
  padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  color: var(--on-accent);
  box-shadow: 0 8px 22px rgba(201, 150, 46, .28);
}
.promo strong { font-size: 1rem; }
.promo .small { opacity: .9; }
.promo-emoji { font-size: 2rem; flex-shrink: 0; }

/* الأسعار */
.prices { display: flex; flex-direction: column; gap: 8px; }
.price-row {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 13px 14px;
  display: flex; align-items: center; gap: 10px;
}
.price-row strong { flex: 1; font-size: .93rem; font-weight: 600; }
.price-tag { color: var(--brand-text); font-weight: 800; font-size: .95rem; }

/* ===== هيدر مسار الطلب ===== */
.flow-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  padding-top: calc(14px + env(safe-area-inset-top));
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.flow-header h2 { flex: 1; font-size: 1.12rem; font-weight: 800; }
.steps { display: flex; gap: 5px; }
.step-dot { width: 22px; height: 5px; border-radius: 3px; background: var(--line-strong); transition: background .25s; }
.step-dot.on { background: var(--accent); }

.flow-footer {
  position: fixed; bottom: 0; right: 50%; transform: translateX(50%);
  width: 100%; max-width: var(--app-max);
  background: var(--card); border-top: 1px solid var(--line);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  box-shadow: var(--sh-3);
  z-index: 6;
}
.total-line { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.total-line > .muted { font-size: .875rem; }
.total-line strong { color: var(--brand-text); font-size: 1.12rem; text-align: left; }

/* ===== بطاقات الاختيار ===== */
.choice-list { display: flex; flex-direction: column; gap: 10px; }
.choice {
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: var(--r-lg); padding: 14px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; transition: border-color .18s, background .18s, transform .1s;
}
.choice:active { transform: scale(.99); }
.choice.selected { border-color: var(--brand-text); background: var(--brand-soft); }
.choice .c-icon { font-size: 1.4rem; flex-shrink: 0; }
.choice .grow strong { display: block; font-size: .96rem; margin-bottom: 1px; }
.choice .grow .small { color: var(--muted); }
.choice .c-price { color: var(--brand-text); font-weight: 800; font-size: .92rem; white-space: nowrap; }

/* كمية */
.qty-box {
  background: var(--card); border-radius: var(--r-lg);
  border: 1px solid var(--line); padding: 20px; text-align: center;
  box-shadow: var(--sh-1);
}
.qty-value { font-size: 2.5rem; font-weight: 800; color: var(--brand-text); line-height: 1.2; }
.qty-controls { display: flex; justify-content: center; gap: 14px; margin-top: 14px; }
.qty-controls button {
  width: 54px; height: 54px; border-radius: var(--r-md); border: 0;
  background: var(--brand); color: #fff; font-size: 1.5rem; font-family: inherit;
  cursor: pointer; transition: transform .1s;
}
.qty-controls button:active { transform: scale(.95); }
.qty-controls button.minus { background: var(--brand-soft); color: var(--brand-text); }

.chips { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.chip {
  border: 1.5px solid var(--line); background: var(--card); color: var(--text);
  padding: 9px 15px; border-radius: 999px; cursor: pointer;
  font-family: inherit; font-size: .88rem; font-weight: 600;
  transition: background .18s, border-color .18s, color .18s;
}
.chip.selected { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ===== نماذج ===== */
.form { display: flex; flex-direction: column; gap: 15px; }
.form label {
  display: flex; flex-direction: column; gap: 7px;
  font-size: .9rem; font-weight: 700; color: var(--text-2);
}
.form input, .form select, .form textarea, #wallet-flow input:not([type=file]) {
  font-family: inherit; font-size: 1rem; font-weight: 600;
  padding: 14px; border-radius: var(--r-md);
  border: 1.5px solid var(--line); background: var(--card);
  color: var(--text); outline-color: var(--brand-text);
  transition: border-color .18s, box-shadow .18s;
}
.form input:focus, .form select:focus, .form textarea:focus, #wallet-flow input:focus {
  border-color: var(--brand-text);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-text) 18%, transparent);
  outline: none;
}
.form input::placeholder, .form textarea::placeholder { color: var(--muted); opacity: .85; font-weight: 400; }
.form select option { color: var(--text); background: var(--card); }
.form .btn { margin-top: 4px; }

/* ===== قوائم عامة ===== */
.list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 14px;
  display: flex; align-items: center; gap: 12px;
}
.list-item > span:first-child { font-size: 1.3rem; flex-shrink: 0; }
.list-item strong { font-size: .95rem; }
.list-item .muted { color: var(--muted); }

/* حاوية خريطة تحديد الموقع: خلفية هادية أثناء التحميل بدل الأبيض الفاضي */
#pick-map { background: var(--brand-soft); }
.leaflet-container { font-family: inherit; }

/* ===== تتبع الطلب ===== */
#screen-tracking { padding-bottom: 0; }
.map {
  height: 44dvh; position: relative; overflow: hidden;
  background: linear-gradient(140deg, #cfe6da, #b9d8c9);
}
html[data-theme="dark"] .map { background: var(--card); }
html[data-theme="dark"] .leaflet-tile { filter: brightness(.72) contrast(1.05) saturate(.85); }

.map-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .5) 2px, transparent 2px),
    linear-gradient(90deg, rgba(255, 255, 255, .5) 2px, transparent 2px);
  background-size: 64px 64px;
}
.map-route {
  position: absolute; top: 58%; right: 12%; width: 70%; height: 4px;
  background: repeating-linear-gradient(90deg, var(--brand) 0 14px, transparent 14px 24px);
  transform: rotate(-14deg); border-radius: 3px;
}
.map-pin { position: absolute; font-size: 2rem; }
.map-pin.dest { top: 44%; right: 8%; }
.map-pin.driver { top: 60%; right: 74%; transition: right 1s linear, top 1s linear; }

/* زر الرجوع فوق الخريطة: الزبون بيقدر يطلع من شاشة التتبع بأي وقت
   والطلب بيكمل بالخلفية (كان يضل معلّق فيها بلا أي مخرج) */
#screen-tracking { position: relative; }
.track-back {
  position: absolute; z-index: 1200;
  top: calc(12px + env(safe-area-inset-top)); inset-inline-start: 12px;
  border-radius: 50%; background: rgba(255,255,255,.94); color: #12201b;
  box-shadow: 0 4px 14px rgba(0,0,0,.25); border: 0; font-weight: 800;
}
.tracking-card {
  background: var(--card); border-radius: 28px 28px 0 0;
  margin-top: -26px; position: relative; z-index: 1100;
  padding: 22px 16px calc(22px + env(safe-area-inset-bottom));
  box-shadow: var(--sh-3);
  min-height: 56dvh;
}
.tracking-status { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.tracking-status strong { font-size: 1.05rem; }
.pulse {
  width: 13px; height: 13px; border-radius: 50%; background: #22c07a; flex-shrink: 0;
  animation: pulse 1.6s ease infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34, 192, 122, .5); }
  70%  { box-shadow: 0 0 0 12px rgba(34, 192, 122, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 192, 122, 0); }
}
.driver-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 12px;
}
.avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--brand-soft); display: grid; place-items: center; font-size: 1.4rem; flex-shrink: 0;
}

.order-summary {
  margin-top: 14px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--card-2);
  padding: 14px;
  display: flex; flex-direction: column; gap: 9px; font-size: .93rem;
}
.order-summary .row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.order-summary .row > span:first-child { color: var(--text-2); }
.order-summary .row > span:last-child { text-align: left; font-weight: 600; }
.order-summary .row strong { color: var(--brand-text); font-size: .98rem; text-align: left; }
.order-summary .row.ok, .order-summary .row.ok span { color: var(--ok); }

/* ===== طلباتي ===== */
.order-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 15px; margin-bottom: 10px;
  box-shadow: var(--sh-1);
}
.order-card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 6px; }
.order-card .top strong { font-size: .98rem; line-height: 1.5; }
.badge {
  font-size: .76rem; padding: 5px 11px; border-radius: 999px; font-weight: 700;
  white-space: nowrap; flex-shrink: 0;
}
.badge.done { background: var(--ok-bg); color: var(--ok); }
.badge.active { background: var(--warn-bg); color: var(--warn); }

.empty { text-align: center; color: var(--muted); padding: 60px 20px; line-height: 1.9; }
.empty .e-icon { font-size: 3rem; display: block; margin-bottom: 10px; }

/* ===== المحفظة ===== */
.wallet-card {
  background:
    radial-gradient(90% 80% at 90% 0%, rgba(255, 255, 255, .13) 0%, transparent 60%),
    linear-gradient(150deg, var(--brand), #072a20);
  color: #fff; border-radius: var(--r-xl); padding: 24px;
  border: 1px solid rgba(226, 182, 74, .35);
  display: flex; flex-direction: column; gap: 4px;
  box-shadow: 0 12px 30px rgba(11, 59, 44, .25);
}
.wallet-card h1 { font-size: 2.1rem; letter-spacing: 0; }
.wallet-card .small { color: rgba(255, 255, 255, .82); }
.wallet-card .muted { color: var(--on-brand-soft); }

/* ===== التنقل السفلي ===== */
.bottom-nav {
  position: fixed; bottom: 0; right: 50%; transform: translateX(50%);
  width: 100%; max-width: var(--app-max);
  background: var(--card); border-top: 1px solid var(--line);
  display: flex; z-index: 10;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, .06);
}
.nav-item {
  flex: 1; background: none; border: 0; font-family: inherit;
  padding: 11px 0 9px; font-size: 1.2rem; cursor: pointer; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  position: relative; transition: color .2s;
}
.nav-item span { font-size: .78rem; font-weight: 700; }
.nav-item.active { color: var(--brand-text); }
.nav-item.active::before {
  content: ""; position: absolute; top: 0; right: 50%; transform: translateX(50%);
  width: 30px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent);
}
.bottom-nav.hidden { display: none; }

/* ===== شات الدعم ===== */
#screen-chat { padding-bottom: 0; display: none; }
#screen-chat.active { display: flex; flex-direction: column; height: 100dvh; }
.chat-body {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
  background: var(--bg);
}
.msg-bubble {
  max-width: 80%; padding: 11px 15px; border-radius: 18px;
  font-size: .95rem; line-height: 1.7; word-break: break-word;
}
.msg-bubble.me {
  align-self: flex-start;
  background: var(--brand); color: #fff;
  border-bottom-left-radius: 5px;
}
.msg-bubble.them {
  align-self: flex-end;
  background: var(--card); color: var(--text);
  border: 1px solid var(--line);
  border-bottom-right-radius: 5px;
}
.msg-bubble .t { display: block; font-size: .7rem; opacity: .7; margin-top: 4px; }
.chat-footer {
  display: flex; gap: 8px; align-items: center;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--card); border-top: 1px solid var(--line);
}
.chat-footer input {
  flex: 1; font-family: inherit; font-size: 1rem;
  padding: 13px 16px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--bg); color: var(--text);
  outline-color: var(--brand-text);
}
.chat-send {
  width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0;
  border: 0; background: var(--brand); color: #fff;
  font-size: 1.2rem; cursor: pointer; transform: scaleX(-1);
}

/* ===== توست ===== */
.toast {
  position: fixed; bottom: 100px; right: 50%; transform: translateX(50%) translateY(20px);
  background: var(--text); color: var(--bg);
  padding: 13px 22px; border-radius: 999px; font-size: .93rem; font-weight: 600;
  box-shadow: var(--sh-2);
  opacity: 0; pointer-events: none; transition: all .3s ease; z-index: 50;
  max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(50%) translateY(0); }

/* ===== ورقة منزلقة من تحت · مستعملة بالإشعارات ===== */
.sheet-wrap {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(9, 22, 18, .45);
  display: flex; align-items: flex-end; justify-content: center;
}
/* خاصية hidden لازم تغلب دايماً: كلاسات متل .btn و .form و .promo بتعطي display
   وكانت عم تلغيها (زر «سجّل دخولك» كان يبين للمسجّل، وزر الخروج للزائر) */
[hidden] { display: none !important; }
.sheet-wrap[hidden] { display: none; }
.sheet {
  background: var(--card); color: var(--text);
  width: 100%; max-width: 520px;
  border-radius: 22px 22px 0 0;
  padding: 18px 18px calc(20px + env(safe-area-inset-bottom));
  box-shadow: var(--sh-2);
  max-height: 85vh; overflow-y: auto;
  animation: sheet-up .22s ease;
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-head h3 { font-size: 1.05rem; font-weight: 800; }
.sheet-x {
  border: 0; background: var(--bg); color: var(--muted);
  width: 34px; height: 34px; border-radius: 50%;
  font-size: .95rem; font-family: inherit; cursor: pointer;
}

.notif-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 0;
}
.notif-row strong { font-size: .95rem; }
.notif-row p { margin-top: 3px; line-height: 1.5; }

/* المفتاح */
.notif-toggle {
  flex: 0 0 auto;
  width: 52px; height: 30px; border-radius: 999px;
  border: 0; padding: 3px; cursor: pointer;
  background: var(--line-strong); transition: background .2s ease;
  display: flex; align-items: center;
}
.notif-toggle .knob {
  width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3);
  transition: transform .2s ease;
}
/* المطفي عأول السطر والمشغّل عآخرو: بالعربي (rtl) بيمشي لليسار،
   وبالإنكليزي (ltr) لليمين. قبل كان ثابت لليسار فبالإنكليزي يطلع مقلوب */
.notif-toggle[aria-checked="true"] { background: var(--ok); }
.notif-toggle[aria-checked="true"] .knob { transform: translateX(-22px); }
[dir="ltr"] .notif-toggle[aria-checked="true"] .knob { transform: translateX(22px); }
.notif-toggle[disabled] { opacity: .5; cursor: not-allowed; }

.notif-state { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.notif-help {
  font-size: .82rem; line-height: 1.6; margin-top: 10px;
  background: var(--warn-bg); color: var(--warn);
  border-radius: 12px; padding: 10px 12px;
}
.notif-help[hidden] { display: none; }

/* ===== احترام تفضيل تقليل الحركة ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ===== شاشات صغيرة ===== */
@media (max-width: 360px) {
  .splash-title { font-size: 2.3rem; }
  .services-grid { gap: 10px; }
  .service { padding: 14px 12px; }
}

/* ===== الإنكليزي (LTR): الصفحة بتنقلب لحالها مع dir="ltr"،
   بس محاذاة النصوص المكتوبة صراحةً لازم تنعكس ===== */
[dir="ltr"] input, [dir="ltr"] select, [dir="ltr"] textarea { text-align: left; }
[dir="ltr"] .total-line strong { text-align: right; }
[dir="ltr"] .order-summary .row > span:last-child,
[dir="ltr"] .order-summary .row strong { text-align: right; }
[dir="ltr"] #lang-btn, #lang-btn { font-size: .8rem; font-weight: 700; letter-spacing: .3px; white-space: nowrap; }
[dir="ltr"] .service { text-align: left; }

/* ===== أيقونات الواجهة: خط واحد، بتاخد اللون من النص ===== */
.ico { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: inline-block; vertical-align: -.14em; flex-shrink: 0; }
.service-icon .ico { width: 26px; height: 26px; }
.service-icon.fuel { color: #a8740e; }
.service-icon.ev   { color: #1f6fae; }
.service-icon.oil  { color: #8a5a2b; }
.service-icon.wash { color: #13805a; }
html[data-theme="dark"] .service-icon.fuel { color: #f2cf6c; }
html[data-theme="dark"] .service-icon.ev   { color: #7cc2f5; }
html[data-theme="dark"] .service-icon.oil  { color: #e3aa76; }
html[data-theme="dark"] .service-icon.wash { color: #62d6a4; }
.nav-item .ico { width: 23px; height: 23px; stroke-width: 1.9; }
.nav-item.active .ico { stroke-width: 2.2; }
.icon-btn .ico { width: 20px; height: 20px; }
#lang-btn { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: .85rem; }
#lang-btn .ico { width: 17px; height: 17px; }
.loc-line .ico { color: var(--accent); width: 18px; height: 18px; }
.car-emoji .ico { width: 28px; height: 28px; color: var(--brand-text); }
.car-card .chev { display: grid; place-items: center; color: var(--muted); }
.car-card .chev .ico { width: 20px; height: 20px; }
.promo-emoji .ico { width: 40px; height: 40px; stroke-width: 1.5; }
.price-row .price-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-text); flex-shrink: 0; }
.price-row .price-ic .ico { width: 19px; height: 19px; }
.choice .c-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-text); display: grid; place-items: center; }
.choice .c-icon .ico { width: 22px; height: 22px; }
.choice.selected .c-icon { background: var(--brand-text); color: var(--card); }
.splash-services > span { display: inline-flex; align-items: center; gap: 6px; }
.splash-services .ico { width: 16px; height: 16px; color: var(--accent-2, #f2cf6c); }
.avatar .ico { width: 24px; height: 24px; color: var(--brand-text); }
.icon-btn.call .ico { color: #fff; }
.map-truck { width: 38px; height: 38px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; border: 2.5px solid #f2cf6c; box-shadow: 0 3px 8px rgba(0,0,0,.35); }
.map-truck .ico { width: 20px; height: 20px; }

/* ===== شعار شاشة البداية: الدبوس ع الطريق متل أيقونة التطبيق ===== */
.splash-brand { position: relative; display: flex; flex-direction: column; align-items: center; margin-bottom: 4px; }
.splash-road { width: 190px; height: 285px; display: block; overflow: visible; }
.splash-road .sr-pin { animation: pin-float 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center bottom; }
.splash-road .sr-dash { animation: road-run 1.1s linear infinite; }
@keyframes pin-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes road-run { to { stroke-dashoffset: -21; } }
/* الاسم قاعد فوق الطريق، متل الأيقونة */
.splash-brand .splash-title { position: absolute; bottom: 38px; margin: 0; text-shadow: 0 3px 14px rgba(0, 0, 0, .55); }
@media (prefers-reduced-motion: reduce) { .splash-road .sr-pin, .splash-road .sr-dash { animation: none; } }
@media (max-height: 700px) { .splash-road { width: 160px; height: 240px; } .splash-brand .splash-title { bottom: 14px; font-size: 2.5rem; } }

/* ===== تعطّلت سيارتي (طوارئ) ===== */
.rescue-btn {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: start;
  margin: 2px 0 6px; padding: 13px 15px; border: 0; border-radius: var(--r-lg);
  background: linear-gradient(135deg, #c0392b, #8e1f16); color: #fff;
  font-family: inherit; cursor: pointer; box-shadow: 0 8px 20px rgba(192, 57, 43, .28);
}
.rescue-btn .grow { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.rescue-btn strong { font-size: 1rem; }
.rescue-btn .small { opacity: .9; font-size: .82rem; }
.rescue-btn .rescue-ic { width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, .16); display: grid; place-items: center; flex-shrink: 0; }
.rescue-btn .rescue-ic .ico { width: 23px; height: 23px; }
.rescue-btn .chev .ico { width: 18px; height: 18px; opacity: .8; }
.rescue-hero { display: flex; align-items: center; gap: 12px; background: var(--danger-bg); color: var(--danger); border-radius: var(--r-lg); padding: 14px 16px; }
.rescue-hero > span { width: 46px; height: 46px; border-radius: 14px; background: var(--danger); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.rescue-hero .ico { width: 26px; height: 26px; }
.rescue-hero p { margin: 0; font-weight: 700; line-height: 1.7; font-size: .92rem; }
.choice .c-icon.rescue-ic { background: var(--danger-bg); color: var(--danger); }
.choice.disabled { opacity: .55; cursor: default; }
.rescue-note { background: var(--danger-bg); color: var(--danger); border-radius: var(--r-md); padding: 11px 14px; font-weight: 700; font-size: .88rem; margin-bottom: 12px; }

/* ===== تذكير الزيت / الغسيل بالرئيسية ===== */
.car-reminder { display: flex; align-items: center; gap: 10px; margin: 8px 0 4px; padding: 12px 14px; border-radius: var(--r-md); border: 1.5px solid; cursor: pointer; }
.car-reminder .grow { flex: 1; }
.car-reminder strong { font-size: .95rem; }
.car-reminder p { margin: 2px 0 0; opacity: .85; }
.car-reminder.due { background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 35%, transparent); color: var(--danger); }
.car-reminder.soon { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 35%, transparent); color: var(--warn); }
.car-reminder .chip { flex-shrink: 0; padding: 8px 13px; }

/* ===== ملف السيارة ===== */
.cf-head { margin-bottom: 12px; }
.cf-head > span:first-child { width: 42px; height: 42px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-text); display: grid; place-items: center; }
.cf-head .ico { width: 24px; height: 24px; }
.cf-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 15px; margin-bottom: 12px; box-shadow: var(--sh-1); }
.cf-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.cf-top strong { display: inline-flex; align-items: center; gap: 7px; font-size: .98rem; }
.cf-top .ico { width: 20px; height: 20px; color: var(--brand-text); }
.cf-row { display: flex; justify-content: space-between; gap: 10px; font-size: .88rem; padding: 4px 0; }
.cf-row span:first-child { color: var(--muted); flex-shrink: 0; }
.cf-row span:last-child { text-align: end; font-weight: 600; }
.cf-st { font-size: .74rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.cf-st.ok { background: var(--ok-bg); color: var(--ok); }
.cf-st.soon { background: var(--warn-bg); color: var(--warn); }
.cf-st.due { background: var(--danger-bg); color: var(--danger); }
.cf-st.unknown { background: var(--card-2); color: var(--muted); border: 1px solid var(--line); }
.cf-bar { height: 7px; border-radius: 99px; background: var(--card-2); border: 1px solid var(--line); overflow: hidden; margin: 8px 0 4px; }
.cf-bar i { display: block; height: 100%; border-radius: 99px; background: var(--ok); }
.cf-bar.soon i { background: var(--warn); }
.cf-bar.due i { background: var(--danger); }
.cf-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.cf-actions .btn { flex: 1; min-width: 140px; margin: 0; }
.btn.btn-sm { padding: 11px 12px; font-size: .88rem; }
.cf-form { margin-top: 12px; }
.cf-km { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cf-km b { flex-basis: 100%; font-size: 1.15rem; }
.cf-km input { flex: 1; min-width: 0; font-family: inherit; font-size: 1rem; font-weight: 600; padding: 11px 12px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--card); color: var(--text); }
.cf-remind { display: flex; gap: 10px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 13px 15px; margin-bottom: 6px; cursor: pointer; }
.cf-remind input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--brand); flex-shrink: 0; }
.chip.cf-open { margin-top: 7px; padding: 6px 11px; font-size: .8rem; }

/* ===== ادعُ صاحبك ===== */
.inv-hero { text-align: center; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-radius: var(--r-xl); padding: 20px 16px 18px; margin-bottom: 12px; box-shadow: var(--sh-2); }
.inv-hero h2 { margin: 4px 0 6px; font-size: 1.35rem; color: #f2cf6c; }
.inv-hero p { margin: 0; opacity: .9; }
.inv-gift { width: 54px; height: 54px; margin: 0 auto 8px; border-radius: 16px; background: rgba(255, 255, 255, .14); display: grid; place-items: center; }
.inv-gift .ico { width: 30px; height: 30px; color: #f2cf6c; }
.inv-code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 2rem; font-weight: 800; letter-spacing: 6px; text-align: center; padding: 10px; border: 2px dashed var(--accent, #e2b64a); border-radius: var(--r-md); color: var(--brand-text); }
.inv-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.inv-stats div { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 6px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.inv-stats b { font-size: 1.3rem; color: var(--brand-text); }
.inv-stats span { font-size: .76rem; color: var(--muted); }
.invite-promo { cursor: pointer; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: var(--sh-2); }
.invite-promo .inv-prize { color: #f2cf6c; }
.invite-promo .promo-emoji .ico { color: #f2cf6c; }
.invite-btn { font-weight: 700; }

/* ===== حساب الشركة ===== */
.company-card { border-color: var(--brand); border-width: 1.5px; }
.company-card > span:first-child { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-text); display: grid; place-items: center; }
.company-card .ico { width: 22px; height: 22px; }
.co-car { display: flex; flex-direction: column; gap: 6px; font-size: .88rem; font-weight: 700; color: var(--text-2); margin: 2px 4px 6px; }
.co-car select { font-family: inherit; font-size: .95rem; font-weight: 600; padding: 11px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--card); color: var(--text); }

/* ===== النقاط ===== */
.pts-hero .pts-big { font-size: 2.6rem; margin: 2px 0 10px; color: #f2cf6c; }
.pts-hero .cf-bar { margin: 0 auto 10px; max-width: 280px; }
.pts-rw.can { border-color: var(--accent, #d4a93a); border-width: 1.5px; }
.pts-rw > span:first-child { width: 38px; height: 38px; border-radius: 11px; background: var(--brand-soft); color: var(--brand-text); display: grid; place-items: center; }
.pts-rw .ico { width: 20px; height: 20px; }
.pts-new { border: 2px dashed var(--accent, #d4a93a); text-align: center; }
.points-btn b { color: var(--accent, #d4a93a); }
