@import url('https://fonts.googleapis.com/css2?family=Alexandria:wght@600;700;800;900&family=Baloo+Bhaijaan+2:wght@400;600;800&display=swap');
@import url('/assets/street.css');

/* ====================== الأساس ====================== */
:root {
  --bg: #2a0d26;
  --surface: #3a1636;
  --card: #3a1636;
  --line: rgba(255, 243, 220, .13);
  --line-2: rgba(255, 243, 220, .24);
  --text: #fff3dc;
  --muted: #cdb7bb;
  --a1: #f7b32b;
  --a2: #e8462c;
  --a3: #f7b32b;
  --danger: #ff7a66;
  --ok: #5dffb1;
  --grad: linear-gradient(#f7b32b, #f7b32b);
  --r: 22px;
  --ease: cubic-bezier(.2, .9, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --font-d: 'Alexandria', 'Baloo Bhaijaan 2', sans-serif;
  color-scheme: dark;
}

@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
::view-transition-old(root) { animation: .35s var(--ease) both vt-out; }
::view-transition-new(root) { animation: .5s var(--ease) both vt-in; }
@keyframes vt-out { to { opacity: 0; scale: .97;  } }
@keyframes vt-in { from { opacity: 0; scale: 1.03;  } }

* { box-sizing: border-box; }
html { -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: 'Baloo Bhaijaan 2', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  overflow-x: hidden;
}

a { color: var(--a1); text-decoration: none; }
h1, h2 { font-family: var(--font-d); font-weight: 800; line-height: 1.55; margin: 0 0 .5em; }
h3, h4 { font-family: 'Baloo Bhaijaan 2', sans-serif; font-weight: 800; line-height: 1.3; margin: 0 0 .5em; }
.grad-text { color: var(--a1); }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.hidden { display: none !important; }
.center { text-align: center; }
.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1 1 220px; }
.ltr { direction: ltr; unicode-bidi: isolate; }

.ic { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; }
.ic.flip { rotate: 180deg; }

/* ====================== الشريط العلوي ====================== */
.nav {
  position: sticky; top: 12px; z-index: 50;
  width: min(1180px, 100% - 24px); margin: 12px auto 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px 10px 10px;
  background: rgba(42, 13, 38, .55);
  
  border: 1px solid var(--line);
  border-radius: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--font-d); font-weight: 900; font-size: 1.35rem; }
.logo-mark { width: 38px; height: 38px; }
.logo-mark .wave { transform-origin: 20px 24px; }
@media (prefers-reduced-motion: no-preference) {
  .logo-mark .w2 { animation: wave 2.4s ease-out infinite; }
  .logo-mark .w3 { animation: wave 2.4s ease-out .4s infinite; }
}
@keyframes wave { 0%, 100% { opacity: .25; } 40% { opacity: 1; } }
.nav-links { display: flex; gap: 8px; align-items: center; }

/* ====================== الأزرار ====================== */
.btn {
  --bg-btn: var(--grad);
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px;
  border: 0; border-radius: 14px;
  background: var(--bg-btn);
  color: #24121f; font: 700 1rem/1.2 'Baloo Bhaijaan 2', sans-serif;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .35s var(--spring), box-shadow .35s var(--ease);
  box-shadow: 0 4px 0 #9c5a0b;
}
.btn::after { /* لمعة تعبر الزر */
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%);
  translate: 120% 0;
  transition: translate .7s var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #9c5a0b; }
.btn:hover::after { translate: -120% 0; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.ghost { background: rgba(255,255,255,.04); color: var(--text); border: 1px solid var(--line-2); box-shadow: none;  }
.btn.ghost:hover { background: rgba(255,255,255,.08); border-color: rgba(247,179,43,.5); }
.btn.danger { background: linear-gradient(120deg, #ff5470, #ff8a5b); color: #fff; box-shadow: 0 8px 30px -10px rgba(255,84,112,.6); }
.btn.wa { background: linear-gradient(120deg, #25d366, #12b886); color: #24121f; }
.btn.sm { padding: 7px 14px; font-size: .88rem; border-radius: 11px; }
.btn.block { width: 100%; }
.btn.icon-only { padding: 10px; aspect-ratio: 1; }
.btn.lg { padding: 16px 30px; font-size: 1.1rem; border-radius: 18px; }

/* ====================== البطاقات الزجاجية ====================== */
.glass {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px;
  
}
/* إضاءة تتبع الماوس على حدود البطاقة */
.glass.spot::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(247,179,43,.65), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .4s;
  pointer-events: none;
}
.glass.spot:hover::before { opacity: 1; }
[data-tilt] { transform: perspective(900px) rotateX(var(--rx, 0)) rotateY(var(--ry, 0)); transition: transform .5s var(--ease); transform-style: preserve-3d; }

/* ظهور العناصر عند التمرير */
@media (prefers-reduced-motion: no-preference) {
  [data-reveal] { opacity: 0; translate: 0 28px;  transition: opacity .9s var(--ease), translate .9s var(--ease), filter .9s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
  [data-reveal].in { opacity: 1; translate: 0 0; }
}

/* ====================== الحقول ====================== */
.field { position: relative; display: block; margin-top: 16px; }
.field > span { display: block; font-size: .9rem; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.field .ic.lead { position: absolute; inset-inline-start: 14px; bottom: 15px; color: var(--muted); transition: color .3s; pointer-events: none; }
.field:focus-within .ic.lead { color: var(--a1); }
input, select, textarea {
  width: 100%;
  padding: 13px 16px;
  background: rgba(255,255,255,.035);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  color: var(--text);
  font: inherit;
  transition: border-color .3s, background .3s, box-shadow .3s;
}
.field:has(.ic.lead) input { padding-inline-start: 44px; }
.field:has(.ic.lead) input.ltr { padding-left: 16px; padding-right: 44px; }
input::placeholder, textarea::placeholder { color: #5d6478; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--a1); background: rgba(247,179,43,.05); box-shadow: 0 0 0 4px rgba(247,179,43,.12); }
select option { background: var(--surface); }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--a1); flex: none; }
input[type=range] { padding: 0; accent-color: var(--a1); background: none; border: 0; box-shadow: none; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; font-size: .92rem; color: var(--muted); cursor: pointer; }
.pw-toggle { position: absolute; inset-inline-end: 8px; bottom: 7px; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 8px; }

/* ====================== أيقونات الأنواع المتحركة ====================== */
.type-ic { --duo: color-mix(in oklab, var(--c) 32%, transparent); display: inline-grid; place-items: center; color: var(--c); }
.type-ic svg { width: 100%; height: 100%; overflow: visible; }
.type-ic .steam path { stroke-dasharray: 8; stroke-dashoffset: 8; opacity: 0; }
.type-ic .lid, .type-ic .items, .type-ic .cherry, .type-ic .swing, .type-ic .awning, .type-ic .wheel { transform-box: fill-box; transform-origin: center; }
.type-ic .swing { transform-origin: 50% 0; }
.type-ic .awning { transform-origin: 50% 0; }
@media (prefers-reduced-motion: no-preference) {
  .anim-host:hover .type-ic .steam path, .type-ic.live .steam path, .is-selected .type-ic .steam path { animation: steam 1.6s ease-out infinite; }
  .anim-host:hover .type-ic .steam path:nth-child(2), .type-ic.live .steam path:nth-child(2), .is-selected .type-ic .steam path:nth-child(2) { animation-delay: .3s; }
  .anim-host:hover .type-ic .steam path:nth-child(3), .type-ic.live .steam path:nth-child(3), .is-selected .type-ic .steam path:nth-child(3) { animation-delay: .6s; }
  .anim-host:hover .ti-restaurant .lid, .type-ic.live .lid, .is-selected .ti-restaurant .lid { animation: lid 1.6s var(--spring) infinite; }
  .anim-host:hover .ti-market .wheel, .type-ic.live .wheel, .is-selected .ti-market .wheel { animation: spin 1s linear infinite; }
  .anim-host:hover .ti-market .items, .type-ic.live .items, .is-selected .ti-market .items { animation: hop .8s var(--spring) infinite alternate; }
  .anim-host:hover .ti-sweets .cherry, .type-ic.live .cherry, .is-selected .ti-sweets .cherry { animation: hop .6s var(--spring) infinite alternate; }
  .anim-host:hover .ti-clothing .swing, .type-ic.live .swing, .is-selected .ti-clothing .swing { animation: swing 1.4s ease-in-out infinite; }
  .anim-host:hover .ti-other .awning, .type-ic.live .awning, .is-selected .ti-other .awning { animation: flap 1.2s ease-in-out infinite; }
}
@keyframes steam { 0% { stroke-dashoffset: 8; opacity: 0; translate: 0 3px; } 40% { opacity: 1; } 100% { stroke-dashoffset: -8; opacity: 0; translate: 0 -4px; } }
@keyframes lid { 0%, 100% { translate: 0 0; rotate: 0deg; } 40% { translate: 0 -6px; rotate: -8deg; } }
@keyframes spin { to { rotate: 360deg; } }
@keyframes hop { to { translate: 0 -4px; } }
@keyframes swing { 0%, 100% { rotate: -9deg; } 50% { rotate: 9deg; } }
@keyframes flap { 0%, 100% { scale: 1 1; } 50% { scale: 1 1.08; } }

/* ====================== الصفحة الرئيسية ====================== */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; padding: 70px 0 40px; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; padding-top: 36px; } }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255,255,255,.04); font-size: .88rem; color: var(--muted); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--a1); box-shadow: 0 0 12px var(--a1); }
.hero h1 { font-size: clamp(2.3rem, 5.5vw, 4.2rem); font-weight: 900; margin: 18px 0 14px; }
.hero h1 .w { display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
  .hero h1 .w { animation: word-in 1s var(--ease) both; animation-delay: calc(var(--i) * 110ms + 150ms); }
}
@keyframes word-in { from { opacity: 0; translate: 0 .6em;  rotate: 0 0 1 4deg; } }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 34em; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }

/* الرادار */
.radar { position: relative; aspect-ratio: 1; width: min(520px, 100%); margin-inline: auto; }
.radar .ring { position: absolute; inset: var(--in); border-radius: 50%; border: 1px solid rgba(247,179,43,.18); }
.radar .sweep {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(247,179,43,.35), transparent 22%);
  mask: radial-gradient(circle, #000 69%, transparent 70%);
}
.radar .pulse { position: absolute; inset: 46%; border-radius: 50%; border: 2px solid var(--a1); opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .radar .sweep { animation: spin 5s linear infinite; }
  .radar .pulse { animation: pulse-out 3s var(--ease) infinite; }
  .radar .pulse.p2 { animation-delay: 1.5s; }
}
@keyframes pulse-out { 0% { inset: 46%; opacity: .9; } 100% { inset: 0%; opacity: 0; } }
.radar .me {
  position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; translate: -50% -50%;
  border-radius: 50%; background: #fff; box-shadow: 0 0 0 6px rgba(247,179,43,.3), 0 0 40px var(--a1);
}
.radar .shop {
  position: absolute; left: var(--x); top: var(--y); translate: -50% -50%;
  width: 54px; height: 54px; padding: 10px; border-radius: 18px;
  background: rgba(42,13,38,.8); border: 1px solid color-mix(in oklab, var(--c) 60%, transparent);
  box-shadow: 0 0 30px -4px color-mix(in oklab, var(--c) 70%, transparent);
}
@media (prefers-reduced-motion: no-preference) {
  .radar .shop { animation: float 4s ease-in-out infinite; animation-delay: var(--d); }
}
@keyframes float { 50% { translate: -50% calc(-50% - 8px); } }
.notif {
  position: absolute; z-index: 3; inset-inline: 6% 6%; bottom: 4%;
  display: flex; gap: 12px; align-items: center;
  padding: 12px 14px; border-radius: 18px;
  background: rgba(47,16,41,.85); 
  border: 1px solid var(--line-2);
  box-shadow: 0 20px 50px -20px #000;
}
.notif .type-ic { width: 42px; height: 42px; padding: 6px; border-radius: 12px; background: rgba(255,255,255,.05); }
.notif b { display: block; font-size: .95rem; }
.notif small { color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .notif.show { animation: notif-in .8s var(--spring) both; }
}
@keyframes notif-in { from { opacity: 0; translate: 0 30px; scale: .9; } }

/* الشريط المتحرك */
.marquee { overflow: hidden; padding: 18px 0; border-block: 1px solid var(--line); mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); margin: 30px 0 60px; }
.marquee .track { display: flex; gap: 46px; width: max-content; }
@media (prefers-reduced-motion: no-preference) { .marquee .track { animation: marquee 30s linear infinite; } }
@keyframes marquee { to { translate: 50% 0; } }
.marquee .item { display: flex; align-items: center; gap: 10px; font-family: var(--font-d); font-weight: 600; color: var(--muted); white-space: nowrap; }
.marquee .type-ic { width: 34px; height: 34px; }

.section-title { text-align: center; font-size: clamp(1.7rem, 3.5vw, 2.6rem); font-weight: 900; margin-bottom: 8px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin: 36px 0 80px; }
.step .num { font-family: var(--font-d); font-weight: 900; font-size: 3.4rem; line-height: 1; opacity: .9; }
.step .ic { width: 34px; height: 34px; color: var(--a1); margin-bottom: 10px; }

.cta-band { text-align: center; padding: 50px 24px; margin-bottom: 60px; overflow: hidden; }
.cta-band::after { content: ''; position: absolute; inset: auto -20% -60% -20%; height: 120%; background: radial-gradient(closest-side, rgba(232,70,44,.35), transparent); z-index: -1; }

/* ====================== المعالج (التسجيل) ====================== */
.auth-wrap { width: min(760px, 100% - 24px); margin: 28px auto 60px; }
.progress { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 22px; }
.progress .seg { height: 6px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.progress .seg i { display: block; height: 100%; width: 0; background: var(--grad); transition: width .7s var(--ease); }
.progress .seg.done i { width: 100%; }
.step-label { display: flex; justify-content: space-between; color: var(--muted); font-size: .88rem; margin-bottom: 6px; }
.wstep { display: none; }
.wstep.on { display: block; }
@media (prefers-reduced-motion: no-preference) {
  .wstep.on { animation: step-in .7s var(--ease) both; }
  .wstep.on.back { animation-name: step-in-back; }
}
@keyframes step-in { from { opacity: 0; translate: -40px 0;  } }
@keyframes step-in-back { from { opacity: 0; translate: 40px 0;  } }
.wstep h2 { font-size: 1.7rem; }
.wnav { display: flex; justify-content: space-between; gap: 12px; margin-top: 26px; }

.type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
@media (max-width: 600px) { .type-grid { grid-template-columns: repeat(2, 1fr); } }
.type-card {
  position: relative; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 22px 10px 16px; border-radius: 20px;
  background: rgba(255,255,255,.03); border: 1px solid var(--line);
  transition: transform .4s var(--spring), border-color .3s, background .3s;
}
.type-card input { position: absolute; opacity: 0; pointer-events: none; }
.type-card .type-ic { width: 64px; height: 64px; transition: transform .5s var(--spring); }
.type-card b { font-family: var(--font-d); font-weight: 600; }
.type-card:hover { transform: translateY(-4px); border-color: var(--line-2); }
.type-card.is-selected { border-color: var(--c); background: color-mix(in oklab, var(--c) 12%, transparent); box-shadow: 0 0 0 4px color-mix(in oklab, var(--c) 18%, transparent), 0 20px 40px -20px var(--c); }
.type-card.is-selected .type-ic { transform: scale(1.12); }
.type-card .tick { position: absolute; top: 10px; inset-inline-start: 10px; width: 24px; height: 24px; border-radius: 50%; background: var(--c); color: #000; display: grid; place-items: center; scale: 0; transition: scale .4s var(--spring); }
.type-card.is-selected .tick { scale: 1; }
.type-card .tick .ic { width: 14px; height: 14px; }

.summary { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; padding: 18px; border-radius: 18px; background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 600; }

/* نجاح */
.success { text-align: center; padding: 30px 0; }
.success .burst { position: relative; width: 140px; height: 140px; margin: 0 auto 20px; display: grid; place-items: center; }
.success .burst .core { width: 90px; height: 90px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; color: #24121f; box-shadow: 0 0 60px var(--a1); }
.success .burst .core .ic { width: 44px; height: 44px; stroke-width: 2.6; }
.success .burst .ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--a1); }
@media (prefers-reduced-motion: no-preference) {
  .success .burst .core { animation: pop .8s var(--spring) both; }
  .success .burst .ic path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .6s .5s var(--ease) forwards; }
  .success .burst .ring { animation: pulse-ring 1.6s var(--ease) infinite; }
  .success .burst .ring:nth-child(2) { animation-delay: .5s; }
}
@keyframes pop { from { scale: 0; rotate: -90deg; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pulse-ring { from { scale: .6; opacity: 1; } to { scale: 1.6; opacity: 0; } }

/* ====================== الخرائط ====================== */
.map { position: relative; height: 380px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line-2); background: #2f1029; isolation: isolate; }
.map.tall { height: min(560px, 70vh); }
.map::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 80px 10px rgba(7,8,13,.8); border-radius: inherit; z-index: 2; }
.map-tools { position: absolute; z-index: 3; top: 12px; inset-inline: 12px; display: flex; gap: 8px; }
.map-tools .search { flex: 1; position: relative; }
.map-tools input { background: rgba(42,13,38,.82);  padding-inline-start: 42px; }
.map-tools .search .ic { position: absolute; z-index: 1; inset-inline-start: 14px; top: 50%; translate: 0 -50%; color: var(--muted); }
.map-tools .btn {  background: rgba(42,13,38,.82); color: var(--text); border: 1px solid var(--line-2); box-shadow: none; }
.results { position: absolute; z-index: 4; top: 62px; inset-inline: 12px; max-height: 240px; overflow: auto; background: rgba(47,16,41,.95); border: 1px solid var(--line-2); border-radius: 14px;  }
.results button { display: block; width: 100%; text-align: start; padding: 10px 14px; background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--text); font: inherit; cursor: pointer; }
.results button:hover { background: rgba(247,179,43,.08); }
.map-hint { position: absolute; z-index: 3; bottom: 12px; inset-inline-start: 12px; padding: 6px 12px; border-radius: 10px; background: rgba(42,13,38,.82); font-size: .82rem; color: var(--muted);  }

/* علامات المحلات على الخريطة */
.mk { width: 52px; height: 62px; cursor: pointer; } /* لا نغيّر position: MapLibre يجعلها absolute */
.mk .pinbody {
  position: absolute; inset: 0 0 10px 0;
  border-radius: 18px 18px 18px 4px; rotate: -45deg; scale: .8;
  background: linear-gradient(145deg, color-mix(in oklab, var(--c) 85%, #fff), var(--c));
  box-shadow: 0 10px 30px -6px var(--c), inset 0 0 0 2px rgba(255,255,255,.25);
}
.mk .type-ic { position: absolute; inset: 7px 9px 19px 9px; color: #fff; --duo: rgba(255,255,255,.25); }
.mk .halo { position: absolute; left: 50%; bottom: -4px; width: 16px; height: 6px; translate: -50% 0; border-radius: 50%; background: var(--c); filter: blur(3px); }
.mk .halo::before, .mk .halo::after { content: ''; position: absolute; inset: -6px -10px; border-radius: 50%; border: 2px solid var(--c); opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .mk { animation: drop .9s var(--spring) both; animation-delay: var(--d, 0s); }
  .mk .halo::before { animation: halo 2.2s ease-out infinite; }
  .mk .halo::after { animation: halo 2.2s ease-out 1.1s infinite; }
}
.mk:hover { z-index: 5; }
.mk:hover .pinbody { scale: .92; }
@keyframes drop { from { translate: 0 -60px; opacity: 0; } }
@keyframes halo { from { inset: -2px -4px; opacity: .9; } to { inset: -16px -26px; opacity: 0; } }
.me-dot { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 4px solid #3b82f6; box-shadow: 0 0 0 8px rgba(59,130,246,.25), 0 0 30px #3b82f6; }

.maplibregl-popup-content { background: rgba(47,16,41,.95) !important; color: var(--text); border: 1px solid var(--line-2); border-radius: 16px !important; padding: 14px 16px !important; font-family: 'Baloo Bhaijaan 2', sans-serif; box-shadow: 0 20px 50px -10px #000 !important; direction: rtl; text-align: right; min-width: 200px; }
.maplibregl-popup-tip { border-top-color: rgba(47,16,41,.95) !important; border-bottom-color: rgba(47,16,41,.95) !important; }
.maplibregl-popup-close-button { color: var(--muted); font-size: 18px; inset-inline-start: 4px; right: auto; }
.maplibregl-ctrl-group { background: rgba(42,13,38,.85) !important; border: 1px solid var(--line-2); }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1); }
.maplibregl-ctrl-attrib { background: rgba(42,13,38,.6) !important; color: var(--muted); font-size: 10px; }
.maplibregl-ctrl-attrib a { color: var(--muted); }

/* ====================== لوحات التحكم ====================== */
.app { display: grid; grid-template-columns: 250px 1fr; gap: 20px; width: min(1360px, 100% - 24px); margin: 12px auto 40px; }
.side {
  position: sticky; top: 12px; height: calc(100dvh - 24px);
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px 12px;
  background: rgba(42,13,38,.6); 
  border: 1px solid var(--line); border-radius: var(--r);
}
.side .brand { padding: 6px 8px 18px; }
.side .who { display: flex; gap: 10px; align-items: center; padding: 12px; margin-bottom: 10px; border-radius: 16px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.side .who .type-ic { width: 40px; height: 40px; }
.side .who b { display: block; line-height: 1.3; font-size: .95rem; }
.side .who small { color: var(--muted); }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 13px; border: 0; background: none;
  color: var(--muted); font: 600 .97rem 'Baloo Bhaijaan 2', sans-serif; cursor: pointer; text-align: start;
  transition: color .3s, background .3s;
}
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.04); }
.nav-item.active { color: var(--text); background: linear-gradient(90deg, transparent, rgba(247,179,43,.12)); }
.nav-item.active::before { content: ''; position: absolute; inset-inline-start: -12px; top: 22%; bottom: 22%; width: 4px; border-radius: 4px; background: var(--grad); box-shadow: 0 0 14px var(--a1); }
.nav-item.active .ic { color: var(--a1); }
.side .spacer { flex: 1; }
.main { min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 6px 0 20px; flex-wrap: wrap; }
.topbar h1 { font-size: 1.8rem; margin: 0; }
.mobile-nav { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; padding-bottom: 80px; }
  .side { display: none; }
  .mobile-nav {
    display: flex; position: fixed; z-index: 60; bottom: 10px; inset-inline: 10px;
    justify-content: space-around; padding: 6px;
    background: rgba(42,13,38,.88); 
    border: 1px solid var(--line-2); border-radius: 20px;
  }
  .mobile-nav .nav-item { flex-direction: column; gap: 2px; padding: 8px 6px; font-size: .7rem; }
  .mobile-nav .nav-item.active::before { display: none; }
}
.panel { display: none; }
.panel.on { display: block; }
@media (prefers-reduced-motion: no-preference) {
  .panel.on > * { animation: step-in .6s var(--ease) both; animation-name: rise; }
  .panel.on > *:nth-child(2) { animation-delay: .07s; }
  .panel.on > *:nth-child(3) { animation-delay: .14s; }
  .panel.on > *:nth-child(4) { animation-delay: .21s; }
}
@keyframes rise { from { opacity: 0; translate: 0 18px; } }

.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { overflow: hidden; padding: 18px; }
.stat .ic { width: 22px; height: 22px; color: var(--a1); }
.stat .val { display: block; font-family: var(--font-d); font-size: 2.2rem; font-weight: 800; line-height: 1.15; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat .lbl { color: var(--muted); font-size: .9rem; }
.stat .type-ic { width: 30px; height: 30px; }
.stat::after { content: ''; position: absolute; width: 120px; height: 120px; inset-inline-end: -40px; top: -40px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in oklab, var(--c, var(--a1)) 30%, transparent), transparent); pointer-events: none; }

.card-title { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; margin-bottom: 14px; }
.card-title .ic { color: var(--a1); }

.qr-box { display: grid; place-items: center; gap: 12px; text-align: center; }
.qr-frame { position: relative; padding: 14px; border-radius: 22px; background: #fff; width: 230px; }
.qr-frame svg { display: block; width: 100%; height: auto; }
.qr-frame::before { content: ''; position: absolute; inset: -3px; z-index: -1; border-radius: 24px; background: conic-gradient(from var(--ang, 0deg), var(--a1), var(--a2), var(--a3), var(--a1)); }
@property --ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@media (prefers-reduced-motion: no-preference) { .qr-frame::before { animation: ang 4s linear infinite; } }
@keyframes ang { to { --ang: 360deg; } }

table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { padding: 12px 10px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: .85rem; position: sticky; top: 0; background: rgba(47,16,41,.95); }
tbody tr { transition: background .25s; }
tbody tr:hover { background: rgba(255,255,255,.025); }
.table-wrap { overflow: auto; max-height: 560px; border-radius: 14px; }
.cell-shop { display: flex; align-items: center; gap: 10px; }
.cell-shop .type-ic { width: 34px; height: 34px; padding: 5px; border-radius: 11px; background: rgba(255,255,255,.04); }
.cell-shop b { display: block; line-height: 1.3; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: rgba(46,229,157,.12); color: var(--ok); white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.off { background: rgba(255,84,112,.12); color: var(--danger); }
.badge.idle { background: rgba(255,255,255,.06); color: var(--muted); }
.badge.gold { background: rgba(255,181,71,.14); color: var(--a3); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.chip { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255,255,255,.03); color: var(--muted); font: inherit; font-size: .85rem; cursor: pointer; transition: all .25s; }
.chip:hover, .chip.on { color: var(--text); border-color: var(--a1); background: rgba(247,179,43,.08); }

.offer { position: relative; padding: 16px 18px; border-radius: 18px; background: linear-gradient(135deg, rgba(255,181,71,.1), rgba(255,92,140,.06)); border: 1px dashed rgba(255,181,71,.45); }
.offer h4 { margin: 0 0 4px; font-size: 1.05rem; }
.offer .actions { display: flex; gap: 8px; margin-top: 10px; }
.offer.off { filter: grayscale(1); opacity: .6; }
.list > * + * { margin-top: 12px; }

.msg { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line); transition: opacity .4s; }
.msg .bubble { flex: 1; padding: 12px 14px; border-radius: 16px 16px 4px 16px; background: rgba(37,211,102,.1); border: 1px solid rgba(37,211,102,.25); white-space: pre-wrap; font-size: .93rem; }
.msg.sent { opacity: .45; }

/* المخططات */
.typebars .tb { display: grid; grid-template-columns: 34px 1fr 3ch; gap: 12px; align-items: center; padding: 7px 0; }
.typebars .tb .type-ic { width: 30px; height: 30px; }
.typebars .lbl { font-size: .9rem; display: flex; justify-content: space-between; }
.typebars .track { height: 10px; border-radius: 4px; background: rgba(255,255,255,.05); overflow: hidden; margin-top: 4px; }
.typebars .fill { height: 100%; border-radius: 4px; background: var(--c); width: 0; transition: width 1.2s var(--ease); }
.typebars .n { font-family: var(--font-d); font-weight: 800; text-align: end; font-variant-numeric: tabular-nums; }
.bars { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 170px; padding-top: 10px; border-bottom: 1px solid var(--line-2); }
.bars .b { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: default; }
.bars .b i { display: block; width: 100%; height: 0; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--a1); opacity: .85; transition: height 1s var(--ease), opacity .2s; transition-delay: calc(var(--i) * 18ms); }
.bars .b:hover i { opacity: 1; }
.bars .tip { position: absolute; top: -30px; left: 50%; translate: -50% 0; padding: 4px 10px; border-radius: 8px; background: #000; border: 1px solid var(--line-2); font-size: .78rem; white-space: nowrap; display: none; pointer-events: none; z-index: 2; }
.bars .b:hover .tip { display: block; }
/* التلميح يفتح نحو داخل المخطط حتى لا يخرج عن الشاشة */
.bars .b:nth-child(-n+15) .tip { left: auto; right: 0; translate: 0 0; }
.bars .b:nth-child(n+16) .tip { left: 0; translate: 0 0; }
.bars-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: .78rem; margin-top: 6px; }

/* ====================== بطاقة الولاء ====================== */
.loyalty {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 26px; border-radius: 28px; min-height: 230px;
  background: color-mix(in oklab, var(--c) 42%, #2a0d26);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 30px 60px -30px var(--c);
}
.loyalty .head { display: flex; align-items: center; gap: 12px; }
.loyalty .head .type-ic { width: 52px; height: 52px; padding: 8px; border-radius: 16px; background: rgba(0,0,0,.3); color: #fff; --duo: rgba(255,255,255,.2); }
.loyalty .shop { font-family: var(--font-d); font-size: 1.4rem; font-weight: 800; line-height: 1.3; }
.stamps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 22px 0 14px; }
.stamp { aspect-ratio: 1; border-radius: 50%; border: 2px dashed rgba(255,255,255,.25); display: grid; place-items: center; }
.stamp.on { border: 0; background: var(--a1); color: #24121f; }
.stamp .ic { width: 55%; height: 55%; stroke-width: 2.6; }
@media (prefers-reduced-motion: no-preference) { .stamp.on { animation: pop .7s var(--spring) both; animation-delay: calc(var(--i) * 80ms + .3s); } }

.near-banner { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 18px; background: linear-gradient(120deg, rgba(255,181,71,.2), rgba(255,92,140,.15)); border: 1px solid rgba(255,181,71,.5); margin-bottom: 16px; font-weight: 600; }
.near-banner .ic { width: 28px; height: 28px; color: var(--a3); }
@media (prefers-reduced-motion: no-preference) { .near-banner .ic { animation: hop .6s var(--spring) infinite alternate; } }

/* ====================== قائمة العروض القريبة ====================== */
.nearby-layout { display: grid; grid-template-columns: 400px 1fr; gap: 16px; width: min(1360px, 100% - 24px); margin: 16px auto 30px; height: calc(100dvh - 110px); min-height: 520px; }
.nearby-layout .map { height: 100%; }
.nearby-list { overflow: auto; padding-inline-end: 4px; }
@media (max-width: 900px) { .nearby-layout { grid-template-columns: 1fr; height: auto; } .nearby-layout .map { height: 55vh; order: -1; } }
.place { cursor: pointer; transition: transform .35s var(--spring), border-color .3s; }
.place:hover { transform: translateX(-4px); border-color: var(--line-2); }
.place .head { display: flex; gap: 12px; align-items: center; }
.place .type-ic { width: 46px; height: 46px; padding: 7px; border-radius: 14px; background: rgba(255,255,255,.04); }
.dist { font-family: var(--font-d); font-weight: 800; color: var(--a1); }

/* ====================== التنبيهات ====================== */
#toast {
  position: fixed; z-index: 9999; bottom: 24px; left: 50%;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: 16px;
  background: rgba(47,16,41,.95); border: 1px solid var(--line-2); 
  box-shadow: 0 20px 50px -10px #000;
  translate: -50% 140%; opacity: 0;
  transition: translate .6s var(--spring), opacity .4s;
  font-weight: 600; max-width: calc(100% - 32px);
}
#toast.show { translate: -50% 0; opacity: 1; }
#toast .ic { color: var(--ok); }
#toast.err .ic { color: var(--danger); }

.empty { text-align: center; padding: 30px 10px; color: var(--muted); }
.empty .ic { width: 46px; height: 46px; opacity: .5; display: block; margin: 0 auto 10px; }

.loader { width: 44px; height: 44px; margin: 60px auto; border-radius: 50%; border: 3px solid rgba(255,255,255,.08); border-top-color: var(--a1); animation: spin .8s linear infinite; }

@media print {
  body::before, body::after, .side, .mobile-nav, .topbar, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .print-only { display: block !important; }
  .glass { border: 0; background: none; backdrop-filter: none; }
}
.print-only { display: none; }

/* ====================== شاشة مسح الكاشير ====================== */
.scanner { position: relative; aspect-ratio: 4 / 3; border-radius: 18px; overflow: hidden; background: #000; margin-bottom: 12px; }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 12% 20%; border: 2px solid var(--a1); border-radius: 18px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35); overflow: hidden; }
.scan-frame i { position: absolute; inset-inline: 0; top: 0; height: 2px; background: var(--a1); box-shadow: 0 0 14px var(--a1); }
@media (prefers-reduced-motion: no-preference) { .scan-frame i { animation: scan-line 2s ease-in-out infinite alternate; } }
@keyframes scan-line { to { top: calc(100% - 2px); } }

/* شريط الجوال يتمرر أفقياً لأن عناصره كثرت */
@media (max-width: 900px) {
  .mobile-nav { justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .mobile-nav .nav-item { flex: none; min-width: 66px; align-items: center; }
}

/* ====================== نافذة تفاصيل المشترك ====================== */
dialog.drawer {
  margin: 0; margin-inline-start: auto;
  width: min(640px, 100%); height: 100dvh; max-height: 100dvh; max-width: 100%;
  padding: 24px; border: 0; border-inline-start: 1px solid var(--line-2);
  background: #2f1029; color: var(--text);
  overscroll-behavior: contain;
}
dialog.drawer::backdrop { background: rgba(3, 4, 8, .65);  overflow: hidden; overscroll-behavior: contain; }
dialog.drawer[open] {
  @media (prefers-reduced-motion: no-preference) { animation: drawer-in .45s var(--ease) both; }
}
@keyframes drawer-in { from { opacity: 0; translate: -48px 0; } }
.dhead { font-size: 1rem; margin: 22px 0 10px; color: var(--muted); }
.dstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.dstats > div { padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.dstats b { display: block; font-family: var(--font-d); font-size: 1.4rem; font-variant-numeric: tabular-nums; }

/* الأرقام بخط واضح: أصفار خط العناوين تشبه الرقم العربي ٥ */
.stat .val, .typebars .n, .dist, .dstats b, .step .num { font-family: 'Baloo Bhaijaan 2', sans-serif; font-weight: 800; }
.stat::after { display: none; }
.h1-plain { font-family: 'Baloo Bhaijaan 2', sans-serif; }

.mk .type-ic { --ic-accent: #fff; }
.loyalty .head .type-ic { --ic-accent: #fff; }

.type-card b { font-family: 'Baloo Bhaijaan 2', sans-serif; font-weight: 800; font-size: 1.05rem; }

/* نتائج تدقيق الواجهات */
.btn.wa { box-shadow: 0 4px 0 #0c6b45; }
.btn.danger { box-shadow: 0 4px 0 #8f2a1d; }
.btn.ghost { box-shadow: none; }
.msg .bubble { overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 640px) {
  .msg { flex-wrap: wrap; }
  .msg > div:first-child { flex: 1 1 auto !important; width: auto !important; }
  .msg .bubble { flex: 1 0 100%; order: 3; }
}
/* أهداف اللمس على الجوال */
@media (max-width: 600px) {
  .btn.sm, .chip, .pw-toggle { min-height: 42px; }
  .chip { display: inline-flex; align-items: center; }
  .pw-toggle { min-width: 42px; bottom: 4px; }
  .btn.icon-only.sm { min-width: 42px; }
  input[type=range] { min-height: 40px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .stats > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .nav .btn.sm { min-height: 40px; }
}
/* الجداول تتحول إلى بطاقات على الجوال والآيباد */
@media (max-width: 1100px) {
  .table-wrap { max-height: none; overflow: visible; }
  table.cards-sm thead { display: none; }
  table.cards-sm, table.cards-sm tbody, table.cards-sm tr, table.cards-sm td { display: block; width: 100%; }
  table.cards-sm tr { background: rgba(255, 243, 220, .05); border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px; margin-bottom: 10px; }
  table.cards-sm td { border: 0; padding: 5px 0; }
  table.cards-sm td[data-label] { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: start !important; }
  table.cards-sm td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .88rem; font-weight: 600; flex: none; }
  table.cards-sm td[data-label].ltr { direction: rtl; }
  table.cards-sm td:last-child { display: flex; flex-wrap: wrap; gap: 8px; white-space: normal !important; padding-top: 10px; }
  table.cards-sm td[colspan] { display: block; }
}

#latest .row { flex-wrap: nowrap; }
#latest .cell-shop { min-width: 0; flex: 1; }
#latest .row > .row { flex: none; flex-wrap: nowrap; }
@media (max-width: 600px) { #latest .row > .row .muted { display: none; } }

/* الجوالات الصغيرة: النص يلتف بدل أن يُقص */
@media (max-width: 600px) {
  .btn { white-space: normal; text-align: center; }
  .wnav { flex-wrap: wrap; }
  .wnav .btn { flex: 1 1 130px; }
}

/* الآيباد: البطاقات في عمودين */
@media (min-width: 721px) and (max-width: 1100px) {
  table.cards-sm tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  table.cards-sm tr { margin-bottom: 0; }
  table.cards-sm td[colspan] { grid-column: 1 / -1; }
}
/* القائمة الجانبية تبقى كاملة على الشاشات القصيرة */
.side { overflow-y: auto; scrollbar-width: none; }
@media (max-height: 860px) {
  .side { gap: 2px; padding-block: 10px; }
  .side .brand { padding-bottom: 8px; }
  .side .who { margin-bottom: 4px; padding: 8px 12px; }
  .side .nav-item { padding-block: 7px; }
}
/* بطاقات الأرقام في صف واحد على الآيباد */
@media (min-width: 601px) and (max-width: 1100px) {
  .stats { grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); }
  .stat { padding: 14px; }
  .stat .val { font-size: 1.8rem; }
}
