/* ==========================================================================
   جنبك — نظام التصميم
   الهوية: أخضر زمردي #00A87E · كهرماني #FFB627 · حبري #0C1618
   RTL أولاً · واجهة هاتف بعرض أقصى 520px مركزية على الشاشات الكبيرة

   الألوان الأساسية تُعرَّف في public/css/brand.css — وهنا نربطها فقط،
   فتغيير الهوية يتم من ملف واحد.
   ========================================================================== */

/* ----------------------------------------------------------------------------
   لا ألوان هنا — أسماء هذا الملف مجرد أسماء مستعارة لرموز brand.css.
   قبل هذا كان app.css يعيد تعريف لوحة كاملة مختلفة، فبدا تطبيق الراكب
   والكابتن وكأنه منتج آخر غير السوق ولوحة التحكم. الآن مصدر اللون واحد،
   وتغيير الهوية من brand.css يسري على المنصة كلها.

   الاشتقاقات بـ color-mix تتبع --surface تلقائياً، فتعمل في الوضعين
   النهاري والليلي بلا كتلة تجاوز منفصلة.
   ---------------------------------------------------------------------------- */
:root{
  --brand:      var(--brand-500);
  --brand-soft: color-mix(in srgb, var(--brand-500) 14%, var(--surface));
  --brand-tint: color-mix(in srgb, var(--brand-500)  7%, var(--surface));

  --accent:      var(--accent-400);
  --accent-soft: color-mix(in srgb, var(--accent-400) 16%, var(--surface));

  /* شريط التنقل السفلي */
  --nav-bg:     var(--surface);
  --nav-active: color-mix(in srgb, var(--brand-500) 16%, var(--surface));

  --ok-soft:   var(--ok-bg);
  --err-soft:  var(--err-bg);
  --warn-soft: var(--warn-bg);

  --r:      var(--r-md);
  --r-full: var(--r-pill);

  --sh-1: var(--sh-xs);
  --sh-2: var(--sh-sm);
  --sh-3: var(--sh-lg);
  --sh-up: 0 -6px 26px rgba(12,22,24,.10);

  --app-w: 520px;

  --t: var(--t-base);
}

:root[data-theme="dark"] { --sh-up: 0 -6px 26px rgba(0,0,0,.5); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --sh-up: 0 -6px 26px rgba(0,0,0,.5); }
}

/* ================================================================== الأساس */
*,*::before,*::after{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--font);
  background:var(--surface-2);
  color:var(--ink);
  line-height:1.65;
  -webkit-font-smoothing:antialiased;
  overscroll-behavior-y:none;
}
h1,h2,h3,h4,p,figure{margin:0}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer;border:0;background:none}
a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}
ul{margin:0;padding:0;list-style:none}
:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
::-webkit-scrollbar{width:6px;height:6px}
::-webkit-scrollbar-thumb{background:var(--line-2);border-radius:99px}

/* ============================================================== هيكل التطبيق */
.app{
  max-width:var(--app-w);
  margin:0 auto;
  min-height:100dvh;
  background:var(--bg);
  position:relative;
  display:flex;
  flex-direction:column;
  box-shadow:0 0 60px rgba(0,0,0,.07);
  overflow:hidden;
}
.screen{
  flex:1;
  display:none;
  flex-direction:column;
  min-height:0;
  animation:fadeIn var(--t);
}
.screen.active{display:flex}
@keyframes fadeIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}

.scroll{
  flex:1;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  padding:14px 16px calc(var(--nav-h) + 22px);
}
.scroll.flush{padding-left:0;padding-right:0}
.no-nav .scroll{padding-bottom:22px}

/* ------------------------------------------------------------------ الترويسة */
.topbar{
  height:var(--header-h);
  display:flex;
  align-items:center;
  gap:12px;
  padding:0 14px;
  background:var(--surface);
  border-bottom:1px solid var(--line);
  flex:none;
  position:relative;
  z-index:5;
}
.topbar.plain{background:var(--bg);border-bottom:0}
.topbar h2{font-size:17px;font-weight:700;flex:1;text-align:center}
.topbar .icon-btn{flex:none}

.icon-btn{
  width:40px;height:40px;
  display:grid;place-items:center;
  border-radius:var(--r-full);
  color:var(--ink);
  transition:background var(--t-fast);
}
.icon-btn:active{background:var(--surface-2)}
.icon-btn.tinted{background:var(--brand-soft);color:var(--brand-700)}

/* -------------------------------------------------------------- شعار العلامة */
/* علامة جنبك العائمة فوق خريطة الشاشة الرئيسية */
.home-brand{
  display:inline-flex;align-items:center;gap:8px;
  padding:7px 14px 7px 8px;
  border-radius:var(--r-pill);
  background:color-mix(in srgb,var(--surface) 90%,transparent);
  backdrop-filter:blur(14px) saturate(1.5);
  -webkit-backdrop-filter:blur(14px) saturate(1.5);
  border:1px solid var(--line);
  box-shadow:var(--sh-sm);
  color:var(--ink);text-decoration:none;
  transition:transform var(--t-fast),box-shadow var(--t-fast);
}
.home-brand:active{transform:scale(.96)}
.home-brand .mk{
  width:28px;height:28px;flex:none;border-radius:9px;
  display:grid;place-items:center;
  background:var(--grad-brand);color:#fff;
}
.home-brand .mk svg{width:17px;height:17px}
.home-brand .wm{font-size:16px;font-weight:800;letter-spacing:-.4px;line-height:1}

/* =================================================================== البطاقات */
.card{
  background:var(--surface);
  border-radius:var(--r-lg);
  padding:16px;
  box-shadow:var(--sh-1);
  border:1px solid var(--line);
}
.card + .card{margin-top:12px}
.card.flat{box-shadow:none}
.card.tinted{background:var(--brand-tint);border-color:var(--brand-soft)}
.card-title{font-size:15px;font-weight:700;margin-bottom:4px}
.card-sub{font-size:12.5px;color:var(--muted);line-height:1.7}

.section-title{
  font-size:13px;font-weight:700;color:var(--muted);
  margin:20px 4px 9px;letter-spacing:.2px;
}
.section-title:first-child{margin-top:4px}

/* ==================================================== حقول الموقع (من/إلى أين) */
.locfield{
  display:flex;align-items:center;gap:12px;
  background:var(--surface);
  border-radius:var(--r-lg);
  padding:12px 14px;
  box-shadow:var(--sh-2);
  border:1px solid transparent;
  width:100%;
  text-align:right;
  transition:border-color var(--t-fast);
}
.locfield + .locfield{margin-top:10px}
.locfield:active{border-color:var(--brand)}
.locfield .dot{
  width:34px;height:34px;flex:none;
  display:grid;place-items:center;
  border-radius:var(--r-full);
  color:var(--brand);
}
.locfield .dot.ring{border:3px solid var(--brand);width:20px;height:20px;margin:7px}
.locfield .body{flex:1;min-width:0}
.locfield .lbl{font-size:14.5px;font-weight:700;line-height:1.3}
.locfield .val{
  font-size:12.5px;color:var(--muted);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.locfield .val.filled{color:var(--ink-2)}
.locfield .chev{color:var(--muted-2);flex:none}
.locfield .clear{color:var(--muted-2);flex:none;padding:4px}

/* ------------------------------------------------------- زر «تحديد موقعي الحالي» */
.btn-outline-locate{
  width:100%;
  display:flex;align-items:center;justify-content:center;gap:9px;
  padding:13px;
  border:1.5px solid var(--brand);
  border-radius:var(--r);
  color:var(--brand-700);
  font-weight:700;font-size:14.5px;
  background:var(--surface);
  transition:background var(--t-fast);
}
.btn-outline-locate:active{background:var(--brand-soft)}

/* ==================================================================== الأزرار */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:9px;
  padding:15px 22px;
  border-radius:var(--r);
  background:var(--brand);
  color:#fff;
  font-weight:700;font-size:15.5px;
  width:100%;
  transition:transform var(--t-fast), background var(--t-fast), opacity var(--t-fast);
  box-shadow:0 4px 14px rgba(245,162,29,.28);
}
.btn:active{transform:scale(.985);background:var(--brand-600)}
.btn[disabled]{opacity:.5;pointer-events:none;box-shadow:none}
.btn.dark{background:var(--ink);color:#fff;box-shadow:0 4px 14px rgba(20,20,20,.22)}
.btn.ghost{background:var(--surface);color:var(--ink);border:1.5px solid var(--line-2);box-shadow:none}
.btn.danger{background:var(--err);box-shadow:0 4px 14px rgba(214,69,69,.25)}
.btn.danger-ghost{background:var(--surface);color:var(--err);border:1.5px solid var(--err);box-shadow:none}
.btn.sm{padding:10px 16px;font-size:13.5px;width:auto;border-radius:var(--r-sm)}
.btn.auto{width:auto}
.btn-row{display:flex;gap:10px}
.btn-row .btn{flex:1}

/* ================================================================== النماذج */
.field{margin-bottom:14px}
.field label{display:block;font-size:13px;font-weight:700;margin-bottom:7px}
.input, .select, .textarea{
  width:100%;
  padding:13px 15px;
  background:var(--surface);
  border:1.5px solid var(--line);
  border-radius:var(--r);
  font-size:14.5px;
  transition:border-color var(--t-fast), box-shadow var(--t-fast);
}
.input:focus,.select:focus,.textarea:focus{
  outline:none;border-color:var(--brand);box-shadow:0 0 0 4px var(--brand-soft);
}
.input::placeholder,.textarea::placeholder{color:var(--muted-2)}
.textarea{min-height:104px;resize:vertical;line-height:1.7}
.input-icon{position:relative}
.input-icon .input{padding-right:44px}
.input-icon svg{position:absolute;right:14px;top:50%;transform:translateY(-50%);color:var(--muted)}
.hint{font-size:11.5px;color:var(--muted);margin-top:6px}
.err-text{font-size:11.5px;color:var(--err);margin-top:6px;display:none}
.field.invalid .input,.field.invalid .select{border-color:var(--err)}
.field.invalid .err-text{display:block}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:10px}

/* رمز التحقق */
.otp-row{display:flex;gap:10px;justify-content:center;direction:ltr;margin:6px 0 4px}
.otp-row input{
  width:56px;height:64px;
  text-align:center;font-size:26px;font-weight:800;
  border:1.5px solid var(--line);border-radius:var(--r);
  background:var(--surface);
}
.otp-row input:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 4px var(--brand-soft)}

/* المفاتيح (Switch) */
.switch{position:relative;width:52px;height:30px;flex:none}
.switch input{position:absolute;opacity:0;width:100%;height:100%;margin:0;cursor:pointer;z-index:2}
.switch .track{
  position:absolute;inset:0;background:var(--line-2);
  border-radius:var(--r-full);transition:background var(--t);
}
.switch .thumb{
  position:absolute;top:3px;right:3px;
  width:24px;height:24px;border-radius:var(--r-full);
  background:var(--surface);box-shadow:var(--sh-1);
  transition:transform var(--t);
}
.switch input:checked ~ .track{background:var(--brand)}
.switch input:checked ~ .thumb{transform:translateX(-22px)}

/* ================================================== قوائم الإعدادات / الحساب */
.list{
  background:var(--surface);
  border-radius:var(--r-lg);
  border:1px solid var(--line);
  overflow:hidden;
}
.list-item{
  display:flex;align-items:center;gap:13px;
  padding:14px 15px;
  width:100%;text-align:right;
  border-bottom:1px solid var(--line);
  transition:background var(--t-fast);
}
.list-item:last-child{border-bottom:0}
.list-item:active{background:var(--surface-2)}
.list-item .ic{
  width:38px;height:38px;flex:none;
  display:grid;place-items:center;
  border-radius:var(--r-sm);
  background:var(--surface-2);color:var(--ink-2);
}
.list-item .ic.brand{background:var(--brand-soft);color:var(--brand-700)}
.list-item .ic.danger{background:var(--err-soft);color:var(--err)}
/* العنوان والوصف عنصرا span، فبلا block يلتصقان في سطر واحد —
   وهذا يمسّ كل قوائم التطبيق لا هذه الشاشة وحدها. */
.list-item .txt{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.list-item .t{display:block;font-size:14.5px;font-weight:600;line-height:1.35}
.list-item .s{
  display:block;font-size:12px;color:var(--muted);line-height:1.5;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.list-item .end{color:var(--muted-2);flex:none;display:flex;align-items:center;gap:8px}
.list-item.danger .t{color:var(--err)}

/* ====================================================== بطاقة الملف الشخصي */
.profile-hero{
  background:var(--brand);
  border-radius:var(--r-xl);
  padding:16px;
  display:flex;align-items:center;gap:14px;
  color:#fff;
  box-shadow:0 8px 24px rgba(245,162,29,.3);
}
.profile-hero .name{font-size:18px;font-weight:800;flex:1}
.profile-hero .meta{font-size:12.5px;opacity:.92}
.avatar{
  width:64px;height:64px;flex:none;
  border-radius:var(--r-full);
  background:var(--surface);
  color:var(--brand);
  display:grid;place-items:center;
  font-size:26px;font-weight:800;
  overflow:hidden;position:relative;
}
.avatar img{width:100%;height:100%;object-fit:cover}
.avatar.sm{width:44px;height:44px;font-size:17px}
.avatar.md{width:52px;height:52px;font-size:20px}
.avatar .cam{
  position:absolute;bottom:-2px;right:-2px;
  width:26px;height:26px;border-radius:var(--r-full);
  background:var(--ink);color:#fff;
  display:grid;place-items:center;border:2px solid var(--surface);
}

/* ============================================================ شريط التنقل */
.tabbar{
  height:var(--nav-h);
  flex:none;
  display:grid;
  grid-auto-flow:column;
  grid-auto-columns:1fr;
  align-items:center;
  background:var(--nav-bg);
  padding:0 8px;
  padding-bottom:env(safe-area-inset-bottom);
  position:sticky;bottom:0;z-index:20;
}
.tab{
  display:flex;flex-direction:column;align-items:center;gap:3px;
  padding:7px 4px;
  border-radius:var(--r);
  color:var(--ink-2);
  font-size:11px;font-weight:600;
  transition:color var(--t-fast), background var(--t-fast);
}
.tab .tab-ic{
  width:52px;height:30px;
  display:grid;place-items:center;
  border-radius:var(--r-full);
  transition:background var(--t);
}
.tab.active{color:var(--brand-700)}
.tab.active .tab-ic{background:var(--nav-active)}
.tab .badge{
  position:absolute;transform:translate(-14px,-8px);
  min-width:17px;height:17px;padding:0 4px;
  background:var(--err);color:#fff;
  font-size:10px;font-weight:700;
  border-radius:var(--r-full);
  display:grid;place-items:center;
}

/* ================================================================== الخريطة */
.map{width:100%;height:100%;background:var(--surface-2);z-index:0}
.map-wrap{position:relative;flex:1;min-height:220px}
/* الارتفاع بالنسبة المئوية داخل flex قد يُحسب صفراً في بعض المتصفحات،
   فنملأ الحاوية بالتموضع المطلق لضمان ظهور الخريطة دائماً. */
.map-wrap > .map{position:absolute;inset:0;height:auto;width:auto}
.map-box{
  height:190px;border-radius:var(--r-lg);overflow:hidden;
  border:1px solid var(--line);position:relative;
}
.map-fab{
  position:absolute;z-index:400;
  width:44px;height:44px;
  border-radius:var(--r-full);
  background:var(--surface);color:var(--ink);
  display:grid;place-items:center;
  box-shadow:var(--sh-2);
}
.map-fab.bl{bottom:14px;left:14px}
.map-hint{
  position:absolute;top:12px;left:50%;transform:translateX(-50%);
  z-index:400;background:var(--surface);
  padding:8px 16px;border-radius:var(--r-full);
  font-size:12.5px;font-weight:600;box-shadow:var(--sh-2);
  white-space:nowrap;
}
.leaflet-container{font:inherit !important;background:var(--surface-2) !important}
.leaflet-control-attribution{font-size:9px !important;opacity:.65}

/* دبابيس الخريطة */
.pin{
  width:30px;height:30px;border-radius:50% 50% 50% 0;
  transform:rotate(-45deg);
  border:2.5px solid #fff;box-shadow:0 3px 8px rgba(0,0,0,.3);
}
.pin.pickup{background:var(--brand)}
.pin.dropoff{background:var(--err)}
.car-marker{
  width:34px;height:34px;
  display:grid;place-items:center;
  background:var(--ink);color:var(--brand);
  border-radius:var(--r-full);
  border:2.5px solid #fff;
  box-shadow:0 3px 10px rgba(0,0,0,.35);
  transition:transform .6s linear;
}

/* ==================================== الشاشة الرئيسية: أزرار الخدمات الأربعة */
.services{
  background:var(--surface);
  border-radius:var(--r-xl);
  padding:14px 8px;
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:4px;
  box-shadow:var(--sh-3);
}
.service{
  display:flex;flex-direction:column;align-items:center;gap:7px;
  padding:6px 2px;
  border-radius:var(--r);
  color:var(--ink);
  transition:background var(--t-fast);
}
.service:active{background:var(--brand-tint)}
.service .si{color:var(--brand);height:26px;display:grid;place-items:center}
.service .sl{font-size:11.5px;font-weight:600;text-align:center;line-height:1.3}

/* ============================================================ الأوراق السفلية */
.sheet-backdrop{
  position:fixed;inset:0;z-index:900;
  background:rgba(15,15,15,.45);
  backdrop-filter:blur(2px);
  opacity:0;pointer-events:none;
  transition:opacity var(--t);
}
.sheet-backdrop.open{opacity:1;pointer-events:auto}
.sheet{
  position:fixed;
  left:50%;bottom:0;
  transform:translate(-50%,100%);
  width:min(100%,var(--app-w));
  max-height:88dvh;
  z-index:901;
  background:var(--surface);
  border-radius:var(--r-xl) var(--r-xl) 0 0;
  box-shadow:var(--sh-up);
  display:flex;flex-direction:column;
  transition:transform var(--t);
  padding-bottom:env(safe-area-inset-bottom);
}
.sheet.open{transform:translate(-50%,0)}
.sheet-grip{
  width:44px;height:5px;border-radius:99px;
  background:var(--line-2);
  margin:10px auto 4px;flex:none;
}
.sheet-head{
  display:flex;align-items:center;gap:12px;
  padding:6px 18px 12px;flex:none;
}
.sheet-head h3{font-size:17px;font-weight:800;flex:1}
.sheet-head .sub{font-size:12.5px;color:var(--muted);font-weight:500}
.sheet-body{overflow-y:auto;padding:0 16px 16px}
.sheet-foot{padding:12px 16px 18px;flex:none;border-top:1px solid var(--line)}

/* ------------------------------------------------- خيارات نوع الرحلة (الأسعار) */
.ride-opt{
  display:flex;align-items:center;gap:13px;
  padding:14px;
  border:1.5px solid var(--line);
  border-radius:var(--r-lg);
  width:100%;text-align:right;
  transition:border-color var(--t-fast), background var(--t-fast);
  background:var(--surface);
}
.ride-opt + .ride-opt{margin-top:10px}
.ride-opt.selected{border-color:var(--brand);background:var(--brand-tint)}
.ride-opt .ri{
  width:44px;height:44px;flex:none;
  display:grid;place-items:center;
  color:var(--brand);
}
.ride-opt .rb{flex:1;min-width:0}
.ride-opt .rn{font-size:15px;font-weight:700}
.ride-opt .rd{font-size:12px;color:var(--muted)}
.ride-opt .rp{text-align:left;flex:none}
.ride-opt .rp b{font-size:15.5px;font-weight:800;display:block;white-space:nowrap}
.ride-opt .rp small{font-size:10.5px;color:var(--muted);white-space:nowrap}

/* ================================================================== الحالات */
.empty{
  text-align:center;
  padding:60px 26px;
  display:flex;flex-direction:column;align-items:center;gap:11px;
}
.empty .ei{color:var(--brand);opacity:.95}
.empty h3{font-size:17px;font-weight:800}
.empty p{font-size:13px;color:var(--muted);line-height:1.8;max-width:300px}

.skeleton{
  background:linear-gradient(90deg,var(--surface-2) 25%,var(--line) 50%,var(--surface-2) 75%);
  background-size:200% 100%;
  animation:shimmer 1.3s infinite;
  border-radius:var(--r-sm);
}
@keyframes shimmer{from{background-position:200% 0}to{background-position:-200% 0}}

.spinner{
  width:20px;height:20px;flex:none;
  border:2.5px solid rgba(255,255,255,.35);
  border-top-color:#fff;
  border-radius:50%;
  animation:spin .7s linear infinite;
}
.spinner.dark{border-color:var(--line-2);border-top-color:var(--brand)}
.spinner.lg{width:38px;height:38px;border-width:3.5px}
@keyframes spin{to{transform:rotate(360deg)}}

/* ================================================================== الشارات */
.chip{
  display:inline-flex;align-items:center;gap:5px;
  padding:4px 11px;border-radius:var(--r-full);
  font-size:11.5px;font-weight:700;
  background:var(--surface-2);color:var(--ink-2);
}
.chip.brand{background:var(--brand-soft);color:var(--brand-700)}
.chip.ok{background:var(--ok-soft);color:var(--ok)}
.chip.err{background:var(--err-soft);color:var(--err)}
.chip.warn{background:var(--warn-soft);color:var(--warn)}
.chip.dot::before{content:'';width:6px;height:6px;border-radius:50%;background:currentColor}

.filters{display:flex;gap:8px;overflow-x:auto;padding:2px 0 12px;scrollbar-width:none}
.filters::-webkit-scrollbar{display:none}
.filter{
  padding:8px 16px;border-radius:var(--r-full);
  background:var(--surface);border:1.5px solid var(--line);
  font-size:13px;font-weight:600;white-space:nowrap;flex:none;
}
.filter.active{background:var(--brand);border-color:var(--brand);color:#fff}

/* ============================================================ عنصر الرحلة */
.trip-item{
  display:flex;gap:13px;align-items:flex-start;
  padding:14px;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--r-lg);
  width:100%;text-align:right;
}
.trip-item + .trip-item{margin-top:10px}
.trip-item .ti{
  width:42px;height:42px;flex:none;
  border-radius:var(--r-sm);
  background:var(--brand-soft);color:var(--brand-700);
  display:grid;place-items:center;
}
.trip-item .tb{flex:1;min-width:0}
.trip-item .tt{font-size:14px;font-weight:700;display:flex;align-items:center;gap:7px}
.trip-item .tr{
  font-size:12.5px;color:var(--muted);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px;
}
.trip-item .tm{font-size:11.5px;color:var(--muted-2);margin-top:5px}
.trip-item .tf{text-align:left;flex:none;font-weight:800;font-size:14.5px;white-space:nowrap}

/* مسار من/إلى */
.route{position:relative;padding-right:22px}
.route::before{
  content:'';position:absolute;right:5px;top:12px;bottom:12px;
  width:2px;background:var(--line-2);
}
.route-pt{position:relative;padding:6px 0;font-size:13.5px}
.route-pt::before{
  content:'';position:absolute;right:-21px;top:12px;
  width:11px;height:11px;border-radius:50%;
  background:var(--brand);border:2.5px solid var(--surface);
  box-shadow:0 0 0 1.5px var(--brand);
}
.route-pt.to::before{background:var(--err);box-shadow:0 0 0 1.5px var(--err)}
.route-pt .rl{font-size:11px;color:var(--muted);font-weight:600}
.route-pt .rv{font-weight:600;line-height:1.5}

/* ======================================================= بطاقة السائق/الرحلة */
.driver-card{display:flex;align-items:center;gap:13px}
.driver-card .dn{font-size:16px;font-weight:800}
.driver-card .dv{font-size:12.5px;color:var(--muted)}
.driver-card .da{display:flex;gap:8px;flex:none}
.round-btn{
  width:44px;height:44px;border-radius:var(--r-full);
  display:grid;place-items:center;
  background:var(--brand-soft);color:var(--brand-700);
}
.round-btn.dark{background:var(--ink);color:#fff}
.round-btn.ok{background:var(--ok-soft);color:var(--ok)}

.stars{display:inline-flex;gap:2px;color:var(--brand);align-items:center}
.stars-pick{display:flex;gap:10px;justify-content:center;padding:8px 0 4px}
.stars-pick button{color:var(--line-2);transition:transform var(--t-fast),color var(--t-fast)}
.stars-pick button.on{color:var(--brand)}
.stars-pick button:active{transform:scale(1.15)}

/* ==================================================== إحصائيات وأرباح الكابتن */
.stat-hero{
  background:var(--ink);
  border-radius:var(--r-xl);
  padding:20px;color:#fff;
}
.stat-hero .lbl{font-size:12.5px;opacity:.72}
.stat-hero .big{font-size:34px;font-weight:800;line-height:1.25;margin-top:2px}
.stat-hero .sub{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:16px}
/* `>` ضروري: بدونه يلتقط المحدّد ‎.l‎ و‎.v‎ الداخليين فيصير لكل
   منهما صندوق مستقل، وتظهر البطاقة الواحدة أربع بطاقات. */
.stat-hero .sub > div{background:rgba(255,255,255,.09);border-radius:var(--r);padding:11px 13px}
.stat-hero .sub .l{font-size:11.5px;opacity:.7}
.stat-hero .sub .v{font-size:16px;font-weight:800;margin-top:1px}

.progress{height:8px;background:var(--surface-2);border-radius:99px;overflow:hidden;margin:10px 0}
.progress span{display:block;height:100%;background:var(--brand);border-radius:99px;transition:width var(--t)}

.kv{display:flex;justify-content:space-between;gap:12px;padding:9px 0;font-size:13.5px}
.kv + .kv{border-top:1px dashed var(--line)}
.kv .k{color:var(--muted)}
.kv .v{font-weight:700}
.kv.total{font-size:16px;padding-top:13px;margin-top:4px;border-top:1.5px solid var(--line)}
.kv.total .v{color:var(--brand-700);font-weight:800}

/* ------------------------------------------------ مفتاح اتصال الكابتن (متصل) */
.online-toggle{
  display:flex;align-items:center;gap:13px;
  background:var(--surface);
  border-radius:var(--r-lg);
  padding:13px 15px;
  box-shadow:var(--sh-2);
}
.online-toggle .st{flex:1}
.online-toggle .st .t{font-size:15.5px;font-weight:800;display:flex;align-items:center;gap:8px}
.online-toggle .st .s{font-size:12px;color:var(--muted)}
.online-toggle .led{width:10px;height:10px;border-radius:50%;background:var(--muted-2)}
.online-toggle.on .led{background:var(--ok);box-shadow:0 0 0 4px var(--ok-soft)}

/* ======================================================== عرض الرحلة للكابتن */
.offer-timer{
  height:6px;background:var(--line);border-radius:99px;overflow:hidden;margin-bottom:14px;
}
.offer-timer span{
  display:block;height:100%;background:var(--brand);
  transition:width 1s linear;
}
.offer-fare{
  text-align:center;padding:6px 0 14px;
}
.offer-fare .amt{font-size:32px;font-weight:800;color:var(--brand-700);line-height:1.2}
.offer-fare .meta{font-size:12.5px;color:var(--muted)}

/* ================================================================== التنبيهات */
.toast-wrap{
  position:fixed;top:14px;left:50%;transform:translateX(-50%);
  z-index:1000;width:min(94%,var(--app-w));
  display:flex;flex-direction:column;gap:8px;pointer-events:none;
}
.toast{
  background:var(--ink);color:#fff;
  padding:12px 16px;border-radius:var(--r);
  font-size:13.5px;font-weight:600;
  box-shadow:var(--sh-3);
  display:flex;align-items:center;gap:10px;
  animation:toastIn .28s cubic-bezier(.2,.9,.3,1.4);
}
.toast.ok{background:var(--ok)}
.toast.err{background:var(--err)}
.toast.warn{background:var(--warn);color:#221a00}
@keyframes toastIn{from{opacity:0;transform:translateY(-16px) scale(.96)}to{opacity:1;transform:none}}

/* ---------------------------------------------------------- شاشة البدء */
.splash{
  position:fixed;inset:0;z-index:1100;
  background:var(--surface);
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:26px;
  transition:opacity .4s ease, visibility .4s;
}
.splash.hide{opacity:0;visibility:hidden}
.splash{gap:0;background:var(--grad-hero)}

/* علامة جنبك: دبّوس الموقع — «جنبك» = القريب منك */
.splash-mark{
  width:76px;height:76px;display:grid;place-items:center;
  border-radius:24px;background:var(--grad-brand);color:#fff;
  box-shadow:var(--sh-brand);
  animation:jb-pop .5s var(--ease-spring) both;
}
.splash-mark svg{width:42px;height:42px}
.splash-wm{
  margin-top:18px;font-size:34px;font-weight:800;letter-spacing:-1px;color:var(--ink);
  animation:jb-fade-up .5s var(--ease-out) .08s both;
}
.splash-sub{
  margin-top:6px;font-size:13.5px;font-weight:600;color:var(--muted);
  animation:jb-fade-up .5s var(--ease-out) .16s both;
}
.splash-bar{
  margin-top:26px;width:132px;height:4px;border-radius:999px;
  background:var(--line);overflow:hidden;
}
.splash-bar i{
  display:block;width:42%;height:100%;border-radius:999px;
  background:var(--grad-brand);
  animation:splash-slide 1.15s var(--ease) infinite;
}
@keyframes splash-slide{
  0%{transform:translateX(140%)}
  100%{transform:translateX(-240%)}
}

/* ==================================================== شاشات الدخول والتسجيل */
/* هيكل واحد لكل شاشات المصادقة: خلفية هوية خفيفة، علامة جنبك، ثم المحتوى. */

.auth-screen{
  position:relative;
  min-height:100%;
  display:flex;flex-direction:column;justify-content:center;
  padding:26px 18px calc(26px + env(safe-area-inset-bottom));
  overflow-y:auto;
}
.auth-screen.compact{justify-content:flex-start;padding-top:12px}

/* وهج الهوية خلف المحتوى — يعطي الشاشة عمقاً بلا صورة */
.auth-wash{
  position:absolute;inset:0;z-index:0;pointer-events:none;
  background:var(--grad-hero);
}

.auth-brand{position:relative;z-index:1;text-align:center;margin-bottom:22px}

.jb-mark{
  display:inline-grid;place-items:center;
  border-radius:22px;
  background:var(--grad-brand);color:#fff;
  box-shadow:var(--sh-brand);
}
.jb-mark svg{width:56%;height:56%}
.jb-mark.otp{background:var(--grad-accent);color:#2A1C00;box-shadow:var(--sh-accent)}

.auth-wm{margin-top:14px;font-size:29px;font-weight:800;letter-spacing:-.8px;color:var(--ink)}
.auth-sub{margin-top:4px;font-size:13px;font-weight:600;color:var(--muted)}

.auth-body{position:relative;z-index:1;width:100%;max-width:420px;margin-inline:auto}
.auth-h1{font-size:21px;font-weight:800;letter-spacing:-.02em;text-align:center}
.auth-p{margin-top:6px;margin-bottom:22px;font-size:13.5px;color:var(--muted);
        text-align:center;line-height:1.9}
.auth-p b{color:var(--ink);display:inline-block}
.auth-link{color:var(--brand-600);font-weight:700}

/* فاصل «أو» */
.auth-or{display:flex;align-items:center;gap:12px;margin:20px 0 14px;
         color:var(--muted);font-size:12px}
.auth-or::before,.auth-or::after{content:"";flex:1;height:1px;background:var(--line)}

.auth-legal{margin-top:26px;text-align:center;font-size:11.5px;color:var(--muted);line-height:2}
.auth-legal a{color:var(--brand-600);font-weight:700}

/* بطاقتا اختيار الحساب */
.choice-grid{display:grid;gap:12px}
.choice-card{
  display:flex;align-items:center;gap:14px;width:100%;text-align:start;
  min-height:76px;padding:16px;
  border-radius:var(--r-lg);
  background:var(--surface);
  border:1.5px solid var(--line);
  box-shadow:var(--sh-sm);
  color:var(--ink);
  transition:transform var(--t-fast),border-color var(--t-fast),box-shadow var(--t-fast);
}
.choice-card:hover{border-color:var(--brand-400);box-shadow:var(--sh-md);transform:translateY(-2px)}
.choice-card:active{transform:scale(.985)}
.choice-card .ic{
  width:50px;height:50px;flex:none;border-radius:var(--r-sm);
  display:grid;place-items:center;
  background:var(--brand-50);color:var(--brand-600);
}
.choice-card .bd{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.choice-card .t{font-size:16.5px;font-weight:800}
.choice-card .s{font-size:12.5px;color:var(--muted);line-height:1.6}
.choice-card .ch{flex:none;color:var(--muted-2)}
.choice-card:hover .ch{color:var(--brand-500)}
:root[data-theme="dark"] .choice-card .ic{
  background:color-mix(in srgb,var(--brand-500) 15%,var(--surface))}

/* ----------------------------------------------------- خريطة رحلة الكابتن */
.ct-map-wrap{flex:none;height:34vh;min-height:230px;margin:0 0 4px;border-radius:0;border-inline:0}
.ct-map-wrap .canvas{height:100%}

/* تعليمة الانعطاف التالية داخل شريط الخريطة */
.jb-map-hud .nav-step{
  max-width:100%;font-size:12.5px;font-weight:700;color:var(--brand-700);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
:root[data-theme="dark"] .jb-map-hud .nav-step{color:var(--brand-300)}

@media (min-width:560px){
  .ct-map-wrap{border-radius:var(--r-lg);border-inline:1px solid var(--line);margin:0 14px 6px}
}

/* ------------------------------------------------------- الصفحات القانونية */
.legal-doc{
  background:var(--surface);border:1px solid var(--line);
  border-radius:var(--r-lg);padding:18px;
  font-size:14px;line-height:2;color:var(--ink-2);
}
.legal-doc h3{font-size:17px;margin:22px 0 8px;color:var(--brand-700)}
.legal-doc h3:first-child{margin-top:0}
.legal-doc h4{font-size:14.5px;margin:16px 0 6px;color:var(--ink)}
.legal-doc p{margin:8px 0}
.legal-doc ul{padding-inline-start:20px;margin:8px 0}
.legal-doc li{margin:4px 0}
.legal-doc b{color:var(--ink)}
.legal-meta{margin-top:16px;text-align:center;font-size:11.5px;
            color:var(--muted);line-height:2}

/* ------------------------------------------------------------- أدوات مساعدة */
.hidden{display:none !important}
.center{text-align:center}
.row{display:flex;align-items:center;gap:10px}
.row.between{justify-content:space-between}
.grow{flex:1}
.mt-1{margin-top:6px}.mt-2{margin-top:12px}.mt-3{margin-top:18px}.mt-4{margin-top:26px}
.mb-2{margin-bottom:12px}.mb-3{margin-bottom:18px}
.muted{color:var(--muted)}
.small{font-size:12.5px}
.tiny{font-size:11.5px}
.bold{font-weight:700}
.xbold{font-weight:800}
.brand-c{color:var(--brand-700)}
.err-c{color:var(--err)}
.ok-c{color:var(--ok)}
.nowrap{white-space:nowrap}
.truncate{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ltr{direction:ltr}
.tabular{font-variant-numeric:tabular-nums}
.divider{height:1px;background:var(--line);margin:14px 0}

/* شاشات أكبر: إطار الهاتف */
@media (min-width:560px){
  body{padding:18px 0;background:var(--surface-2)}
  .app{min-height:calc(100dvh - 36px);border-radius:26px;overflow:hidden}
}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms !important;transition-duration:.01ms !important}
}

/* ================================================ رفع الإيصال والتنبيهات */

/* منطقة اختيار ملف — تُستخدم لإيصالات السداد ومستندات الكابتن */
.upload-drop{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;
  min-height:96px;padding:16px;
  border:1.5px dashed var(--line);border-radius:var(--r);
  color:var(--muted);font-size:13px;font-weight:600;text-align:center;
  background:var(--surface-2);cursor:pointer;transition:var(--t-fast);
}
.upload-drop:hover{border-color:var(--brand-500);color:var(--brand-600);background:var(--brand-50)}
.upload-drop.has{
  border-style:solid;border-color:var(--brand-500);
  color:var(--brand-700);background:var(--brand-50);
}
.upload-drop svg{opacity:.8}
:root[data-theme="dark"] .upload-drop:hover,
:root[data-theme="dark"] .upload-drop.has{
  background:color-mix(in srgb,var(--brand-500) 13%,var(--surface));
}

/* سطر تنبيه هادئ داخل البطاقات */
.notice{
  display:flex;align-items:flex-start;gap:9px;
  padding:11px 13px;border-radius:var(--r-sm);
  background:var(--warn-bg);color:var(--warn);
  font-size:12.5px;font-weight:600;line-height:1.8;
}
.notice svg{flex:none;margin-top:2px}
.notice.ok{background:var(--ok-bg);color:var(--ok)}
.notice.info{background:var(--info-bg);color:var(--info)}

/* ==================================================== شريط لسانين (Segmented) */
.seg{
  display:flex;gap:4px;padding:4px;
  background:var(--surface-2);border-radius:var(--r-full);
  border:1px solid var(--line);
}
.seg-b{
  flex:1;padding:10px 12px;border-radius:var(--r-full);
  font-size:13.5px;font-weight:700;color:var(--muted);
  transition:var(--t-fast);
}
.seg-b.on{background:var(--surface);color:var(--brand-700);box-shadow:var(--sh-1)}
.seg-b:focus-visible{outline:2px solid var(--brand);outline-offset:2px}

/* ------------------------------------------------------ شريط ترويسي للخدمة */
.hero-band{
  position:relative;overflow:hidden;
  border-radius:var(--r-lg);
  padding:20px 18px;
  background:var(--grad-hero);
  border:1px solid var(--line);
}
.hero-band .hb-t{font-family:var(--font-display);font-size:19px;font-weight:800;line-height:1.4}
.hero-band .hb-s{margin-top:5px;font-size:12.5px;color:var(--muted);line-height:1.8}

/* ------------------------------------------------------------ خطّ زمني */
.tl{position:relative;padding-inline-start:22px}
.tl::before{
  content:"";position:absolute;inset-block:6px;inset-inline-start:5px;
  width:2px;background:var(--line);border-radius:2px;
}
.tl .ev{position:relative;padding:0 0 16px}
.tl .ev::before{
  content:"";position:absolute;inset-inline-start:-21px;top:4px;
  width:12px;height:12px;border-radius:50%;
  background:var(--surface);border:2.5px solid var(--line);
}
.tl .ev.now::before{border-color:var(--brand);background:var(--brand)}
.tl .ev .s{font-weight:700;font-size:13.5px}
.tl .ev .t{font-size:11.5px;color:var(--muted-2);margin-top:3px}

/* ------------------------------------------------------------ فقاعات المراسلة */
.chat-list{display:flex;flex-direction:column;gap:9px}
.bubble{
  max-width:82%;padding:11px 13px;border-radius:var(--r);
  font-size:13.5px;line-height:1.8;
}
.bubble.me{align-self:flex-start;background:var(--brand-soft);color:var(--brand-800, var(--ink))}
.bubble.them{align-self:flex-end;background:var(--surface);border:1px solid var(--line)}

/* ------------------------------------------------- قائمة مستندات الشريك */
.doc-list{display:flex;flex-direction:column;gap:7px}
.doc-row{
  display:flex;align-items:center;gap:10px;width:100%;text-align:start;
  padding:11px 13px;border-radius:var(--r-sm);
  border:1.5px dashed var(--line);background:var(--surface-2);
  transition:var(--t-fast);
}
.doc-row:hover{border-color:var(--brand-500);background:var(--brand-tint)}
.doc-row .ic{flex:none;color:var(--muted);display:flex}
.doc-row .t{flex:1;font-size:13.5px;font-weight:600}
.doc-row .s{flex:none;font-size:11.5px;color:var(--muted);font-weight:700}
.doc-row.done{
  border-style:solid;border-color:var(--ok);
  background:var(--ok-bg);
}
.doc-row.done .ic,.doc-row.done .s{color:var(--ok)}

/* ==================================================== مبدّل الوضعيات */
.mode-list{display:flex;flex-direction:column;gap:9px}
.mode-row{
  display:flex;align-items:center;gap:13px;
  padding:14px;border-radius:var(--r);
  border:1.5px solid var(--line);background:var(--surface);
  color:var(--ink);text-decoration:none;
  transition:var(--t-fast);
}
.mode-row:hover{border-color:var(--brand-400);background:var(--brand-tint)}
.mode-row.on{border-color:var(--brand);background:var(--brand-soft)}
.mode-row .ic{
  width:44px;height:44px;flex:none;border-radius:var(--r-sm);
  display:grid;place-items:center;
  background:var(--brand-50);color:var(--brand-600);
}
.mode-row.on .ic{background:var(--brand);color:#fff}
.mode-row .bd{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.mode-row .t{font-size:14.5px;font-weight:700}
.mode-row .s{font-size:12px;color:var(--muted);line-height:1.6}
.mode-row .ch{flex:none;color:var(--muted-2)}
.mode-row .now{
  flex:none;font-size:11px;font-weight:700;
  padding:3px 9px;border-radius:var(--r-pill);
  background:var(--brand);color:#fff;
}
:root[data-theme="dark"] .mode-row .ic{
  background:color-mix(in srgb,var(--brand-500) 15%,var(--surface));
}

/* ------------------------------------------ رسم أعمدة مبسّط (بلا مكتبة) */
.bars{
  display:flex;align-items:flex-end;gap:3px;
  height:110px;padding:4px 0;
}
.bar-col{flex:1;display:flex;align-items:flex-end;height:100%;min-width:3px}
.bar{
  width:100%;border-radius:4px 4px 0 0;
  background:var(--grad-brand);
  transition:height var(--t);
}
.bar-col:hover .bar{filter:brightness(1.1)}

/* ========================================================= سوق الشحن */

/* بطاقة عرض شركة شحن — المقارنة بصرية: السعر أبرز ما فيها */
.bid-card{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--r-lg);
  padding:14px;margin-bottom:10px;
  box-shadow:var(--sh-1);
}
.bid-card.won{border-color:var(--ok);background:var(--ok-soft)}
.bid-card.out{opacity:.55}
.bid-card .was{
  font-size:12px;font-weight:600;color:var(--muted);
  text-decoration:line-through;margin-inline-start:6px;
}

/* بطاقة دعوة كبيرة — الطريق الرئيسي في الشاشة */
.cta-card{
  display:flex;align-items:center;gap:13px;width:100%;
  background:var(--grad-brand);color:#fff;
  border-radius:var(--r-lg);padding:16px;
  box-shadow:var(--sh-2);text-align:start;
  transition:transform var(--t-fast);
}
.cta-card:active{transform:scale(.985)}
.cta-card .cc-ic{
  flex:none;width:46px;height:46px;border-radius:var(--r);
  background:rgba(255,255,255,.18);
  display:grid;place-items:center;
}
.cta-card .cc-txt{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.cta-card .cc-t{font-size:16px;font-weight:800}
.cta-card .cc-s{font-size:12.5px;opacity:.9;line-height:1.6}
.cta-card .cc-end{flex:none;opacity:.85}

/* مؤشّر حياة الإشارة — النقطة تنبض ما دامت المركبة ترسل */
.live{display:inline-flex;align-items:center;gap:5px}
.live .dot{
  width:7px;height:7px;border-radius:50%;
  background:var(--muted-2);flex:none;
}
.live.on  .dot{background:var(--ok);animation:livePulse 1.8s ease-in-out infinite}
.live.warn .dot{background:var(--warn)}
.live.off .dot{background:var(--muted-2)}
.live.on  {color:var(--ok)}
.live.warn{color:var(--warn)}

@keyframes livePulse{
  0%,100%{box-shadow:0 0 0 0 var(--ok-soft)}
  50%    {box-shadow:0 0 0 4px transparent}
}
@media (prefers-reduced-motion:reduce){
  .live.on .dot{animation:none}
}

/* خانة اختيار داخل النماذج — كانت مستعملة بلا تنسيق */
.chk{
  display:flex;align-items:center;gap:10px;
  font-size:13.5px;cursor:pointer;
  padding:9px 11px;border-radius:var(--r);
  border:1px solid var(--line);background:var(--surface);
}
.chk input{
  width:19px;height:19px;flex:none;
  accent-color:var(--brand);cursor:pointer;
}
.chk:has(input:checked){
  border-color:var(--brand);background:var(--brand-soft);
}
.chk:has(input:focus-visible){outline:2px solid var(--brand);outline-offset:2px}

/* ================================================ خريطة كثافة الطلب */

.map-fab.bl2{bottom:66px;left:14px}
/* الحالة المفعّلة بلون الطلب نفسه، فالزر يشرح ما يُظهره */
.map-fab.on{background:#F1C40F;color:#3D2E00}

.heat-legend{
  position:absolute;z-index:400;
  bottom:14px;right:14px;
  background:var(--surface);
  border-radius:var(--r);
  padding:9px 11px;
  box-shadow:var(--sh-2);
  display:flex;flex-direction:column;gap:5px;
  min-width:132px;
}
.heat-legend .hl-t{font-size:11.5px;font-weight:700}
.heat-legend .hl-bar{
  height:8px;border-radius:99px;
  /* نفس تدرّج الخلايا: من الأصفر الشفاف إلى المشبع */
  background:linear-gradient(to left,
    rgba(241,196,15,.14), rgba(241,196,15,.65));
  border:1px solid var(--line);
}
.heat-legend .hl-x{
  display:flex;justify-content:space-between;
  font-size:10px;color:var(--muted);
}
.heat-legend .hl-n{
  display:flex;align-items:center;gap:5px;
  font-size:10px;color:var(--muted);
  border-top:1px solid var(--line);padding-top:5px;
}
.heat-legend .sw{
  width:11px;height:11px;flex:none;border-radius:3px;
  background:rgba(241,196,15,.45);
}
.heat-legend .sw.unmet{border:2px solid #EA580C}

/* التلميح فوق خليّة — يبقى مقروءاً على الخريطة الفاتحة والداكنة */
.leaflet-tooltip{
  background:var(--ink) !important;color:#fff !important;
  border:0 !important;border-radius:var(--r-sm) !important;
  font-size:11.5px !important;font-weight:600 !important;
  box-shadow:var(--sh-2) !important;
}
.leaflet-tooltip::before{border-top-color:var(--ink) !important}

/* ==================================================== الباقات التجارية */

/* ‏--pc‎: لون الباقة من الإدارة، ويرتدّ إلى لون العلامة إن لم يُضبط */
.plan-now,.plan-card,.plan-strip{--pc:var(--brand-500)}

/* بطاقة «باقتك الآن» */
.plan-now{
  background:var(--ink);color:#fff;
  border-radius:var(--r-xl);padding:18px;
  border-top:4px solid var(--pc);
}
.plan-now .pn-top{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.plan-now .pn-l{font-size:11.5px;opacity:.7}
.plan-now .pn-n{font-size:20px;font-weight:800;line-height:1.35;margin-top:2px}
.plan-now .pn-b{
  font-size:10.5px;font-weight:700;vertical-align:middle;
  padding:2px 8px;border-radius:99px;
  background:var(--pc);color:#fff;
}
.plan-now .pn-a{
  font-size:11px;font-weight:700;flex:none;
  padding:4px 10px;border-radius:99px;
  background:rgba(255,255,255,.14);
}
.plan-now .pn-e{font-size:11.5px;opacity:.7;margin-top:6px}
.plan-now .pn-g{display:flex;flex-direction:column;gap:11px;margin-top:15px}
.plan-now .pg-h{display:flex;justify-content:space-between;font-size:12px;margin-bottom:5px}
.plan-now .pg-v{font-weight:800}
.plan-now .pg-i{font-size:10.5px;font-weight:600;opacity:.7}
.plan-now .pg-t{display:block;height:6px;border-radius:99px;background:rgba(255,255,255,.16);overflow:hidden}
.plan-now .pg-f{display:block;height:100%;border-radius:99px;background:var(--pc);transition:width var(--t)}
.plan-now .pg.full .pg-f{background:var(--warn)}
.plan-now .pg.full .pg-v{color:var(--warn)}

/* بطاقة باقة في قائمة المقارنة */
.plan-card{
  background:var(--surface);
  border:1px solid var(--line);
  border-inline-start:4px solid var(--pc);
  border-radius:var(--r-lg);
  padding:16px;margin-bottom:12px;
  box-shadow:var(--sh-1);
}
.plan-card.cur{border-color:var(--ok);background:var(--ok-soft)}
.plan-card .pc-n{font-size:16px;font-weight:800}
.plan-card .pc-b{
  font-size:10px;font-weight:700;vertical-align:middle;
  padding:2px 8px;border-radius:99px;background:var(--pc);color:#fff;
}
.plan-card .pc-d{font-size:12.5px;color:var(--muted);line-height:1.7;margin-top:3px}
.plan-card .pc-p{flex:none;text-align:center}
.plan-card .pc-v{display:block;font-size:20px;font-weight:800;color:var(--pc);line-height:1.2}
.plan-card .pc-u{display:block;font-size:10.5px;color:var(--muted)}
.plan-card .pc-cur{
  display:flex;align-items:center;justify-content:center;gap:7px;
  font-size:13px;font-weight:700;color:var(--ok);
  padding:11px;margin-top:8px;
  border-radius:var(--r);background:var(--surface);
}

/* قائمة المزايا — منفعة في كل سطر */
.pc-f{display:flex;flex-direction:column;gap:7px;margin:13px 0 0}
.pc-f li{display:flex;align-items:flex-start;gap:8px;font-size:13px;line-height:1.6}
.pc-f li svg{flex:none;margin-top:3px;color:var(--ok)}

/* شريط الباقة داخل لوحات التاجر والشركة */
.plan-strip{
  background:var(--surface);
  border:1px solid var(--line);
  border-inline-start:3px solid var(--pc);
  border-radius:var(--r);
  padding:11px 13px;margin-top:12px;
}
.plan-strip.paid{background:color-mix(in srgb,var(--pc) 7%,var(--surface))}
.plan-strip .ps-h{display:flex;justify-content:space-between;align-items:center;gap:10px}
.plan-strip .ps-n{
  display:flex;align-items:center;gap:6px;
  font-size:13px;font-weight:700;min-width:0;
}
.plan-strip .ps-n svg{flex:none;color:var(--pc)}
.plan-strip .ps-b{
  font-size:9.5px;font-weight:700;
  padding:2px 7px;border-radius:99px;background:var(--pc);color:#fff;
}
.plan-strip .ps-up{
  flex:none;font-size:11.5px;font-weight:700;
  padding:5px 12px;border-radius:99px;
  background:var(--pc);color:#fff;
}
.plan-strip .ps-g{display:flex;flex-direction:column;gap:7px;margin-top:10px}
.psg{display:flex;align-items:center;gap:9px;font-size:11.5px}
.psg-l{flex:none;min-width:64px;color:var(--muted)}
.psg-t{flex:1;height:5px;border-radius:99px;background:var(--surface-2);overflow:hidden}
.psg-f{display:block;height:100%;border-radius:99px;background:var(--pc);transition:width var(--t)}
.psg-v{flex:none;font-weight:700;font-variant-numeric:tabular-nums}
/* المستنفَد بلون التحذير: الرقم وحده لا يلفت النظر أثناء التصفّح */
.psg.full .psg-f{background:var(--warn)}
.psg.full .psg-v{color:var(--warn)}

/* نِسَب مثل «3 / 10»: تُعزَل اتجاهياً وإلا عُرضت مقلوبة في سياق عربي
   فقُرئت عكس معناها (٠ من ١٠ تبدو ١٠ من ٠). */
.num{direction:ltr;unicode-bidi:isolate;font-variant-numeric:tabular-nums}

/* ====================================================== التحليلات */

.lvl-tag{
  font-size:11.5px;color:var(--muted);
  padding:6px 11px;border-radius:99px;
  background:var(--surface-2);display:inline-block;margin-bottom:4px;
}

/* رسم أعمدة */
.chart .ch-bars{display:flex;align-items:flex-end;gap:3px;height:120px}
.ch-col{flex:1;display:flex;flex-direction:column;align-items:center;
  justify-content:flex-end;height:100%;min-width:0}
.ch-bar{
  width:100%;max-width:26px;border-radius:5px 5px 0 0;
  background:var(--grad-brand);transition:height var(--t);
}
/* الذروة تُبرَز: العين تبحث عنها أولاً فلا تُترك لتُحسَب بالنظر */
.ch-bar.peak{background:var(--accent-400)}
.ch-x{font-size:9px;color:var(--muted);margin-top:5px;
  white-space:nowrap;overflow:hidden;max-width:100%}
.ch-max{font-size:10.5px;color:var(--muted);text-align:center;margin-top:7px}

/* أشرطة أفقية — أنسب للأسماء العربية الطويلة */
.ch-rank{display:flex;flex-direction:column;gap:11px}
.chr-h{display:flex;justify-content:space-between;gap:10px;font-size:12.5px;margin-bottom:4px}
.chr-n{font-weight:600;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chr-v{font-weight:800;flex:none}
.chr-t{display:block;height:7px;border-radius:99px;background:var(--surface-2);overflow:hidden}
.chr-f{display:block;height:100%;border-radius:99px;background:var(--grad-brand)}
.chr-s{font-size:10.5px;color:var(--muted);margin-top:3px}

/* بطاقة مؤشّر */
.kpi{background:var(--surface);border:1px solid var(--line);
  border-radius:var(--r);padding:12px 13px}
.kpi-l{font-size:11px;color:var(--muted);font-weight:600}
.kpi-v{font-size:19px;font-weight:800;line-height:1.3;margin-top:2px}
.kpi-s{font-size:10.5px;color:var(--muted);margin-top:2px}
.kpi-d{font-size:11px;font-weight:700;margin-top:2px}
.kpi-d.up{color:var(--ok)}
.kpi-d.down{color:var(--err)}

/* ربحية المنتجات */
.prof{display:flex;flex-direction:column;gap:12px}
.pf{border-bottom:1px solid var(--line);padding-bottom:11px}
.pf:last-child{border-bottom:0;padding-bottom:0}
.pf-h{display:flex;justify-content:space-between;gap:10px;font-size:13.5px}
.pf-n{font-weight:600;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pf-r{font-weight:800;flex:none}
.pf-m{display:flex;justify-content:space-between;gap:10px;
  font-size:11px;color:var(--muted);margin-top:4px;flex-wrap:wrap}
.pf-g{font-weight:700}
/* الهامش بلون حالته: الرقم وحده لا يقول أهو جيّد أم ضعيف */
.pf-g.ok{color:var(--ok)}
.pf-g.warn{color:var(--warn)}
.pf-g.low{color:var(--err)}
.pf-g.none{color:var(--muted-2);font-weight:600}

/* أنت مقابل السوق */
.vs{display:flex;align-items:center;gap:11px;padding:10px 0;
  border-bottom:1px dashed var(--line)}
.vs:last-child{border-bottom:0}
.vs-l{flex:none;min-width:96px;font-size:12px;color:var(--muted)}
.vs-b{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;font-size:12px}
.vs-me{font-weight:600}
.vs-mk{color:var(--muted);font-size:11px}
/* عزل اتجاهي: «‎-63.4٪» بلا عزل تُرسم «63.4٪-» فتبدو الإشارة لاحقة
   لا سابقة، وقد تُقرأ موجبة. */
.vs-p{
  flex:none;font-size:13px;font-weight:800;
  direction:ltr;unicode-bidi:isolate;
}
.vs-p.up{color:var(--ok)}
.vs-p.down{color:var(--err)}

/* ما هو مقفل خلف باقة أعلى */
.locked-box{
  background:var(--surface-2);
  border:1px dashed var(--line-2);
  border-radius:var(--r-lg);padding:15px;margin-top:18px;
}
.lb-h{display:flex;align-items:center;gap:7px;font-size:13px;font-weight:700;color:var(--muted)}
.lb-l{margin-top:9px;display:flex;flex-direction:column;gap:6px}
.lb-l li{font-size:12.5px;color:var(--muted);padding-inline-start:16px;position:relative}
.lb-l li::before{content:"•";position:absolute;inset-inline-start:4px;color:var(--muted-2)}
