/* نظام التصميم الموحد — الألوان الأساسية تأتي من لوحة الإدارة عبر متغيرات --primary و--accent... */
:root {
  --primary: #13654F; --primary-dark: #0B4637; --accent: #D69A2D; --info: #2E7FA8; --bg-brand: #EEF3F0;
  --bg: var(--bg-brand); --surface: #fff; --surface-2: #F4F8F6; --ink: #17241F; --muted: #5D6F68; --line: #D5E0DB;
  --danger: #B53A2E; --ok: #1E7A4C; --on-primary: #fff; --on-accent: #2b1d00;
  --f-display: "Reem Kufi", "Noto Kufi Arabic", Tahoma, sans-serif;
  --f-body: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  --r: 14px; --tap: 44px; --shadow: 0 10px 30px -18px rgba(10, 40, 30, .45);
  --safe-b: max(env(safe-area-inset-bottom, 0px), var(--safe-area-inset-bottom, 0px)); --safe-t: max(env(safe-area-inset-top, 0px), var(--safe-area-inset-top, 0px));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #0E1714; --surface: #16221E; --surface-2: #1C2B26; --ink: #E7EFEB; --muted: #9DB0A8; --line: #2A3B35; color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #0E1714; --surface: #16221E; --surface-2: #1C2B26; --ink: #E7EFEB; --muted: #9DB0A8; --line: #2A3B35; color-scheme: dark; }

* { box-sizing: border-box; }
html { font-size: calc(16px * var(--font-scale, 1)); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); line-height: 1.65; min-height: 100vh; }
img { max-width: 100%; display: block; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.25; margin: 0; text-wrap: balance; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; min-width: 0 !important; padding: 0 !important; margin: -1px !important; border: 0 !important; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; opacity: 0; pointer-events: none; }
[hidden] { display: none !important; }
svg.i { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[dir="ltr"] svg.i.flip, [dir="rtl"] .back-ic { transform: scaleX(1); }
[dir="ltr"] .back-ic { transform: scaleX(-1); }

/* ===== شاشة التحميل ===== */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 10px; background: radial-gradient(circle at 50% 40%, var(--primary), var(--primary-dark)); color: #fff; text-align: center; }
.boot img { border-radius: 22px; }
.boot-name { font-family: var(--f-display); font-size: 2.2rem; }
.boot-bar { width: 120px; height: 4px; background: rgba(255,255,255,.2); border-radius: 4px; overflow: hidden; margin-top: 14px; }
.boot-bar i { display: block; width: 45%; height: 100%; background: var(--accent); border-radius: 4px; animation: ld 1.3s ease-in-out infinite; }
@keyframes ld { 0% { transform: translateX(120%); } 100% { transform: translateX(-240%); } }

/* ===== هيكل التطبيق ===== */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.appbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); padding: calc(8px + var(--safe-t)) 14px 8px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid transparent; }
.appbar.scrolled { border-bottom-color: var(--line); }
.appbar .title { flex: 1; min-width: 0; font-family: var(--f-display); font-size: 1.3rem; color: var(--primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib { width: var(--tap); height: var(--tap); border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface); border: 1px solid var(--line); cursor: pointer; position: relative; color: var(--ink); flex: none; text-decoration: none; }
.ib .dot { position: absolute; top: 6px; inset-inline-end: 6px; min-width: 18px; height: 18px; padding: 0 4px; font-size: .7rem; line-height: 18px; text-align: center; background: var(--danger); color: #fff; border-radius: 9px; font-weight: 700; }
main.page { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 8px 16px calc(96px + var(--safe-b)); display: flex; flex-direction: column; gap: 14px; }
.tabbar { position: fixed; bottom: 0; inset-inline: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(8px + var(--safe-b)); }
.tabbar a { display: grid; justify-items: center; gap: 2px; font-size: .72rem; color: var(--muted); text-decoration: none; min-height: var(--tap); padding-top: 2px; }
.tabbar a.on { color: var(--primary); font-weight: 700; }
.tabbar a.fab .fab-ic { background: var(--accent); color: var(--on-accent); width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; margin-top: -22px; box-shadow: var(--shadow); }
@media (min-width: 1000px) {
  .tabbar { top: 0; bottom: 0; inset-inline-end: auto; width: 96px; grid-template-columns: 1fr; grid-auto-rows: min-content; align-content: start; gap: 10px; padding-top: 90px; border-top: 0; border-inline-end: 1px solid var(--line); }
  .tabbar a.fab .fab-ic { margin-top: 0; }
  .shell { padding-inline-start: 96px; }
  main.page { padding-bottom: 40px; }
}

/* ===== المكونات ===== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: grid; gap: 8px; min-width: 0; color: inherit; text-decoration: none; }
a.card:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); }
.stack { display: grid; gap: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 600px) { .grid2 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.grow { flex: 1; min-width: 0; }
.ttl { font-weight: 700; font-size: 1rem; overflow-wrap: anywhere; }
.ttl.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { font-size: .82rem; color: var(--muted); }
.body-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; padding: 2px 10px; border-radius: 999px; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.b-off { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); }
.b-urg { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.b-gold { background: color-mix(in srgb, var(--accent) 24%, transparent); color: color-mix(in srgb, var(--accent) 55%, var(--ink)); }
.b-info { background: color-mix(in srgb, var(--info) 16%, transparent); color: var(--info); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; padding: 10px 18px; min-height: var(--tap); font-weight: 700; border: 1px solid transparent; cursor: pointer; text-decoration: none; font-size: .95rem; }
.btn.p { background: var(--primary); color: var(--on-primary); }
.btn.g { background: var(--accent); color: var(--on-accent); }
.btn.o { background: var(--surface); color: var(--primary); border-color: var(--line); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.ghost { background: transparent; color: var(--primary); padding-inline: 8px; }
.btn.w { width: 100%; }
.btn.sm { min-height: 34px; padding: 4px 12px; font-size: .85rem; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.busy::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; animation: sp .7s linear infinite; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip { flex: none; padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .85rem; cursor: pointer; min-height: 36px; }
.chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; color: var(--muted); }
.search input { border: 0; background: transparent; flex: 1; min-height: var(--tap); outline: none; color: var(--ink); min-width: 0; }
.hero { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; border-radius: 18px; padding: 18px; display: grid; gap: 6px; position: relative; overflow: hidden; }
.hero > * { position: relative; z-index: 1; }
.hero h2 { font-size: 1.35rem; }
.hero p { margin: 0; opacity: .93; }
.hero::after { content: ""; position: absolute; inset-block-end: -50px; inset-inline-end: -40px; width: 140px; height: 140px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 30%, transparent); z-index: 0; }
.hero.gold { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--primary))); color: var(--on-accent); }
.sec-h { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; font-size: 1.05rem; margin-top: 4px; }
.sec-h a { font-size: .85rem; text-decoration: none; }
.shortcuts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.sc { display: grid; justify-items: center; gap: 6px; font-size: .78rem; text-align: center; text-decoration: none; color: var(--ink); }
.sc .sc-ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--primary); position: relative; }
.sc .sc-tag { position: absolute; top: -6px; inset-inline-end: -8px; font-size: .62rem; }
.thumb { width: 64px; height: 64px; border-radius: 12px; flex: none; object-fit: cover; background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 40%, var(--surface-2)), color-mix(in srgb, var(--primary) 28%, var(--surface-2))); }
.cover { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 12px; background: var(--surface-2); }
.mk { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: grid; color: inherit; text-decoration: none; min-width: 0; }
.mk .img { aspect-ratio: 4/3; width: 100%; object-fit: cover; background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 30%, var(--surface-2)), color-mix(in srgb, var(--info) 25%, var(--surface-2))); }
.mk .in { padding: 8px 10px 10px; display: grid; gap: 2px; min-width: 0; }
.mk .ttl { font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.price { font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.av { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; color: #fff; background: var(--info); object-fit: cover; overflow: hidden; }
.av.lg { width: 84px; height: 84px; font-size: 2rem; font-family: var(--f-display); background: var(--accent); color: var(--on-accent); border: 4px solid var(--bg); }
.gallery { display: grid; grid-auto-flow: column; grid-auto-columns: 85%; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; }
/* الصور: كاملة بنسبتها الأصلية من غير قص */
.mg { position: relative; margin: 6px 0; }
.mg img { display: block; width: 100%; height: auto; max-height: 82vh; object-fit: contain; border-radius: 12px; background: var(--surface-2); cursor: zoom-in; }
.mg-many .mg-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 6px; border-radius: 12px; scrollbar-width: none; overscroll-behavior-x: contain; }
.mg-many .mg-track::-webkit-scrollbar { display: none; }
.mg-slide { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; background: var(--surface-2); border-radius: 12px; overflow: hidden; display: grid; place-items: center; max-height: 82vh; }
.mg-slide img, .mg-slide video { width: 100%; height: 100%; max-height: none; object-fit: contain; border-radius: 0; background: transparent; }
.mg-slide video { background: #000; }
.mg-count { position: absolute; top: 10px; inset-inline-end: 10px; background: rgba(0,0,0,.6); color: #fff; font-size: 13px; padding: 3px 10px; border-radius: 999px; pointer-events: none; direction: ltr; }
/* العارض بملء الشاشة */
.no-scroll, .no-scroll body { overflow: hidden !important; }
.viewer { position: fixed; inset: 0; z-index: 1000; background: #000; color: #fff; }
.vw-track { position: absolute; inset: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.vw-track::-webkit-scrollbar { display: none; }
.vw-slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; display: grid; place-items: center; overflow: hidden; }
.vw-slide img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; user-select: none; -webkit-user-drag: none; touch-action: pan-x pinch-zoom; }
.vw-slide.zoom { overflow: auto; place-items: start; }
.vw-slide.zoom img { max-width: none; max-height: none; width: 250%; cursor: zoom-out; }
.vw-close, .vw-nav { position: absolute; border: 0; background: rgba(255,255,255,.14); color: #fff; border-radius: 50%; width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(4px); }
.vw-close { top: max(12px, env(safe-area-inset-top)); inset-inline-start: 12px; }
.vw-close svg.i { width: 22px; height: 22px; }
.vw-nav { top: 50%; transform: translateY(-50%); font-size: 30px; line-height: 1; }
.vw-prev { left: 10px; } .vw-next { right: 10px; }
.vw-nav:disabled { opacity: .25; cursor: default; }
.vw-count { position: absolute; top: max(20px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); font-size: 15px; background: rgba(0,0,0,.45); padding: 4px 12px; border-radius: 999px; direction: ltr; }
@media (hover: none) { .vw-nav { display: none; } }
.gallery img { scroll-snap-align: center; border-radius: 12px; width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--surface-2); }
.actions { display: flex; gap: 4px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 6px; }
.act { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 0; padding: 6px 10px; border-radius: 10px; color: var(--muted); cursor: pointer; min-height: 38px; font-size: .88rem; }
.act.on { color: var(--primary); font-weight: 700; }
.act:hover { background: var(--surface-2); }
.verified { color: var(--info); font-size: .8rem; font-weight: 700; display: inline-flex; align-items: center; gap: 3px; }
.verified svg.i { width: 16px; height: 16px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.notice { background: color-mix(in srgb, var(--info) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--info) 30%, var(--line)); border-radius: 12px; padding: 12px; font-size: .9rem; }
.notice.warn { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border-radius: 12px; padding: 4px; }
.seg a, .seg button { padding: 8px; text-align: center; border-radius: 9px; text-decoration: none; color: var(--muted); border: 0; background: transparent; cursor: pointer; font-weight: 600; }
.seg .on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* ===== النماذج ===== */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.lbl { font-weight: 600; font-size: .92rem; }
.req { color: var(--danger); }
.field input, .field textarea, .field select { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 12px; min-height: var(--tap); font-size: 1rem; }
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--primary); outline: 2px solid color-mix(in srgb, var(--primary) 25%, transparent); }
.help { color: var(--muted); font-size: .8rem; }
.ferr { color: var(--danger); font-size: .82rem; }
.form-err { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); padding: 10px 12px; border-radius: 10px; font-weight: 600; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 6px 0; flex-wrap: wrap; }
.check input { width: 22px; height: 22px; accent-color: var(--primary); margin-top: 2px; }
.check small { width: 100%; color: var(--muted); padding-inline-start: 32px; }
.form-actions { display: grid; gap: 8px; }
.img-list { display: flex; flex-wrap: wrap; gap: 8px; }
.img-item { position: relative; width: 84px; height: 84px; }
.img-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.img-x { position: absolute; top: -6px; inset-inline-end: -6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--danger); color: #fff; display: grid; place-items: center; cursor: pointer; }
.img-x svg.i { width: 14px; height: 14px; }
.upload-btn { justify-self: start; }
.img-ph { width: 100%; height: 100%; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font-size: 28px; }
.img-item.is-vid .vid-badge { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 22px; text-shadow: 0 1px 6px rgba(0,0,0,.6); pointer-events: none; }
.img-item.uploading .img-ph { place-items: start center; padding-top: 12px; font-size: 22px; }
.img-item.uploading .up-prog { position: absolute; inset-inline: 6px; bottom: 6px; display: grid; gap: 3px; text-align: center; }
.img-item.uploading .up-prog b { font-size: 12px; color: var(--ink, #17241F); }
.img-item.uploading .bar { display: block; height: 6px; border-radius: 4px; background: rgba(0,0,0,.12); overflow: hidden; }
.img-item.uploading .bar i { display: block; height: 100%; background: var(--primary); transition: width .2s; }
video.vid { width: 100%; border-radius: 12px; background: #000; display: block; }
.mg-one video.vid { max-height: 82vh; height: auto; object-fit: contain; }

/* ===== الدخول ===== */
.auth { max-width: 460px; margin: 0 auto; width: 100%; padding: calc(24px + var(--safe-t)) 16px 40px; display: grid; gap: 16px; }
.auth-head { display: grid; justify-items: center; text-align: center; gap: 8px; }
.auth-head img { width: 72px; height: 72px; border-radius: 18px; }
.choice { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; text-align: start; width: 100%; }
.choice:hover, .choice.on { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }
.choice .ic { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); flex: none; }
.choice b { display: block; font-size: 1.05rem; }

/* ===== القائمة الجانبية ===== */
.drawer-back { position: fixed; inset: 0; background: rgba(10, 20, 16, .5); z-index: 50; display: flex; }
.drawer { width: min(86%, 340px); background: var(--surface); height: 100%; padding: calc(16px + var(--safe-t)) 12px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.drawer .it { display: flex; gap: 12px; align-items: center; padding: 11px 10px; border-radius: 12px; color: var(--ink); text-decoration: none; min-height: var(--tap); }
.drawer .it:hover, .drawer .it.on { background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); }
.drawer .it .badge { margin-inline-start: auto; }
.drawer hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; width: 100%; }

/* ===== المحادثات ===== */
.chat { display: flex; flex-direction: column; gap: 6px; min-height: 50vh; }
.bubble { max-width: 80%; padding: 8px 12px; border-radius: 16px; overflow-wrap: anywhere; white-space: pre-wrap; }
.bubble.me { background: var(--primary); color: #fff; align-self: flex-start; border-end-start-radius: 4px; }
.bubble.them { background: var(--surface); border: 1px solid var(--line); align-self: flex-end; border-end-end-radius: 4px; }
.bubble img { border-radius: 10px; margin-bottom: 4px; max-height: 260px; }
.bubble .meta { color: inherit; opacity: .75; font-size: .72rem; }
.composer { position: sticky; bottom: calc(70px + var(--safe-b)); display: flex; gap: 8px; align-items: flex-end; background: var(--bg); padding: 8px 0; }
@media (min-width: 1000px) { .composer { bottom: 0; } }
.composer textarea { flex: 1; border: 1px solid var(--line); border-radius: 20px; padding: 10px 14px; background: var(--surface); resize: none; max-height: 140px; min-height: var(--tap); }

/* ===== حالات ===== */
.spin-wrap { display: grid; place-items: center; padding: 30px; }
.spin { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: sp .8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 30px 16px; color: var(--muted); display: grid; justify-items: center; gap: 10px; }
.empty-ic { width: 60px; height: 60px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; color: var(--primary); }
.empty.err { color: var(--danger); }
.toasts { position: fixed; bottom: calc(86px + var(--safe-b)); inset-inline: 16px; z-index: 100; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow); max-width: 520px; font-weight: 600; animation: pop .2s ease-out; }
.toast.err { background: var(--danger); color: #fff; }
.toast.out { opacity: 0; transition: opacity .3s; }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } }
.offline-bar { position: fixed; top: 0; inset-inline: 0; z-index: 90; background: var(--accent); color: var(--on-accent); text-align: center; padding: calc(4px + var(--safe-t)) 10px 4px; font-size: .85rem; font-weight: 700; }
.update-bar { position: fixed; bottom: calc(86px + var(--safe-b)); inset-inline: 16px; z-index: 95; background: var(--primary); color: #fff; padding: 12px 14px; border-radius: 14px; display: flex; gap: 10px; align-items: center; box-shadow: var(--shadow); max-width: 520px; margin-inline: auto; }
.update-bar .btn { background: #fff; color: var(--primary); }
.modal-back { position: fixed; inset: 0; background: rgba(10, 20, 16, .5); z-index: 80; display: grid; place-items: end center; padding: 16px; }
@media (min-width: 600px) { .modal-back { place-items: center; } }
.modal { background: var(--surface); border-radius: 18px; width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto; display: grid; animation: pop .2s ease-out; }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; gap: 10px; }
.modal-h h3 { font-size: 1.15rem; }
.modal-b { padding: 6px 16px; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 16px 16px; flex-wrap: wrap; }
.code-box { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.8rem; letter-spacing: .2em; text-align: center; padding: 14px; background: var(--surface-2); border-radius: 12px; direction: ltr; user-select: all; }
.ad-slot { border: 1px dashed var(--line); border-radius: var(--r); padding: 10px; display: grid; gap: 6px; background: var(--surface); }
.ad-slot .ad-tag { font-size: .7rem; color: var(--muted); }
.ad-slot img { border-radius: 10px; width: 100%; max-height: 180px; object-fit: cover; }
.block-screen { position: fixed; inset: 0; z-index: 200; background: var(--bg); display: grid; place-items: center; padding: 24px; text-align: center; }
.block-screen > div { max-width: 420px; display: grid; gap: 14px; justify-items: center; }
.cover-band { height: 92px; background: linear-gradient(120deg, var(--primary), var(--info)); border-radius: 18px; }
.profile-head { display: grid; justify-items: center; gap: 4px; margin-top: -48px; text-align: center; }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; font-variant-numeric: tabular-nums; }
.stats3 b { display: block; font-size: 1.2rem; }
.list-link { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); min-height: 52px; cursor: pointer; width: 100%; text-align: start; }
.list-link .grow small { display: block; color: var(--muted); font-size: .8rem; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* الصفحات الرسمية */
.pg-av { border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); display: inline-grid; place-items: center; font-size: 1.4em; border: 2px solid var(--primary); }
.pg-ver { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--info, #2E7FA8); color: #fff; font-size: 10px; vertical-align: middle; }
.pg-line { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; margin-bottom: 8px; }
.pg-line small { display: block; }
.pg-strip { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 12px; scrollbar-width: none; }
.pg-strip::-webkit-scrollbar { display: none; }
.pg-chip { display: grid; justify-items: center; gap: 6px; width: 76px; flex: none; text-decoration: none; color: inherit; font-size: 12px; text-align: center; line-height: 1.3; }
.pg-chip span:last-child { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pg-head { text-align: center; display: grid; justify-items: center; gap: 6px; }
.pg-head h2 { margin: 4px 0 0; font-size: 1.35rem; }

/* تم التعديل + سجل التعديلات */
.edited-tag { border: 0; background: none; color: var(--muted); font-size: 12px; padding: 2px 0; cursor: pointer; text-decoration: underline dotted; justify-self: start; display: inline-block; margin: 2px 0; }
.hist { max-height: 60vh; overflow: auto; }
.hist-v { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface-2); }
.hist-v.now { border-color: var(--primary); background: var(--surface); }
.hist-v .body-text { margin: 6px 0 0; white-space: pre-wrap; }

/* صفحة المحل */
.pg-cover { width: 100%; aspect-ratio: 16/6; object-fit: cover; border-radius: 16px; display: block; cursor: zoom-in; background: var(--surface-2); }
.pg-head.has-cover { margin-top: -46px; position: relative; padding-top: 10px; }
.pg-head.has-cover .pg-av { border: 3px solid var(--surface); box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.owner-panel { display: grid; gap: 10px; border: 1.5px dashed var(--primary); }
.as-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.as-chip { display: flex; align-items: center; gap: 8px; flex: none; border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px 5px 6px; font: inherit; color: inherit; cursor: pointer; }
.as-chip.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--surface)); font-weight: 700; }
.as-chip .av, .as-chip .pg-av { width: 34px !important; height: 34px !important; font-size: 15px; }

/* شاشة طلب الإشعارات */
.notif-gate { position: fixed; inset: 0; z-index: 900; background: rgba(10, 30, 24, .72); display: grid; place-items: center; padding: 16px; backdrop-filter: blur(3px); }
.gate-box { background: var(--surface); color: var(--ink); border-radius: 22px; padding: 26px 20px 20px; max-width: 420px; width: 100%; display: grid; gap: 12px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.gate-box h2 { margin: 0; font-size: 1.35rem; }
.gate-box p { margin: 0; color: var(--muted); line-height: 1.7; }
.gate-ic { font-size: 54px; line-height: 1; }
.gate-steps { text-align: start; margin: 0; padding-inline-start: 22px; line-height: 1.9; }

/* منطقة حذف الحساب */
.danger-zone { margin-top: 28px; border: 1.5px solid color-mix(in srgb, var(--danger) 45%, transparent); border-radius: 16px; padding: 14px; display: grid; gap: 6px; }
.danger-zone p { margin: 0; }

/* ===== 1.7.0: صفحات المحلات ===== */
.shop-card { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; padding: 12px 14px; }
.shop-card .ttl { font-weight: 700; }
.shop-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.open-pill { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; line-height: 1.6; }
.open-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.open-pill.on { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.open-pill.off { color: var(--danger); background: color-mix(in srgb, var(--danger) 11%, transparent); }
.stars { display: inline-flex; gap: 1px; color: var(--line); letter-spacing: 0; }
.stars i { font-style: normal; }
.stars i.on { color: #F2B01E; }
.stars i.half { background: linear-gradient(270deg, #F2B01E 50%, var(--line) 50%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pg-sub { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; color: var(--muted); font-size: .88rem; }
.kind-tag { background: var(--surface-2); border: 1px solid var(--line); padding: 2px 10px; border-radius: 999px; color: var(--ink); }
.pg-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.btn.wa { background: #1FA855; color: #fff; border-color: #1FA855; }
.rating-btn { background: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; color: var(--ink); }
.tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin: 14px 0 12px; position: sticky; top: calc(var(--safe-t) + 56px); z-index: 5; }
.tab { flex: 1; border: 0; background: transparent; padding: 8px 6px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--muted); min-height: 40px; font-size: .9rem; }
.tab.on { background: var(--primary); color: var(--on-primary); }
.info-list { padding: 4px 0; }
.info-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; text-decoration: none; color: inherit; }
.info-row + .info-row { border-top: 1px solid var(--line); }
.info-row .ib { color: var(--primary); }
.hours-tbl { display: grid; margin-top: 8px; }
.hr-row { display: flex; justify-content: space-between; padding: 8px 6px; border-bottom: 1px dashed var(--line); font-size: .92rem; }
.hr-row:last-child { border-bottom: 0; }
.hr-row.today { background: color-mix(in srgb, var(--primary) 9%, transparent); border-radius: 8px; font-weight: 700; }
.hr-row .closed { color: var(--danger); }
.star-pick { display: flex; gap: 4px; justify-content: center; margin: 8px 0; }
.star-pick button { background: none; border: 0; font-size: 2.1rem; line-height: 1; color: var(--line); cursor: pointer; padding: 2px 4px; min-width: 44px; min-height: 44px; }
.star-pick button.on { color: #F2B01E; }
.rv-sum { display: flex; gap: 18px; align-items: center; }
.rv-avg { display: grid; justify-items: center; gap: 2px; min-width: 92px; }
.rv-avg b { font-size: 2.4rem; font-family: var(--f-display); line-height: 1; }
.rv-bars { flex: 1; display: grid; gap: 4px; }
.rv-bar { display: grid; grid-template-columns: 30px 1fr 26px; align-items: center; gap: 6px; font-size: .8rem; }
.rv-bar .track { height: 7px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.rv-bar .track i { display: block; height: 100%; background: #F2B01E; border-radius: 6px; }
.rv-reply { margin-top: 8px; background: var(--surface-2); border-inline-start: 3px solid var(--primary); padding: 8px 10px; border-radius: 8px; font-size: .9rem; }
.rv-reply p { margin: 4px 0 0; }
.hours-ed { display: grid; gap: 6px; margin-top: 6px; }
.hr-ed-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.hr-day { display: flex; align-items: center; gap: 8px; min-width: 100px; cursor: pointer; }
.hr-day input { width: 20px; height: 20px; }
.hr-times { display: flex; align-items: center; gap: 6px; }
.hr-times input { width: 110px; min-height: 38px; padding: 4px 6px; }
.hr-ed-row .closed { color: var(--danger); font-weight: 600; }

/* ===== 1.7.0: البنر المتحرك ===== */
.adc { position: relative; margin: 4px 0 14px; }
.adc-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 16px; gap: 0; align-items: center; background: var(--surface-2); box-shadow: var(--shadow); }
.adc-track::-webkit-scrollbar { display: none; }
.adc-slide { flex: 0 0 100%; scroll-snap-align: start; position: relative; display: grid; place-items: center; min-height: 120px; }
.adc-slide img { width: 100%; height: auto; max-height: 260px; object-fit: contain; display: block; }
.adc-slide .ad-tag { position: absolute; top: 8px; inset-inline-start: 8px; background: rgba(0,0,0,.55); color: #fff; font-size: .7rem; padding: 1px 8px; border-radius: 999px; }
.adc-slide.txt { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; padding: 30px 18px 18px; text-align: center; gap: 4px; align-content: center; min-height: 140px; }
.adc-slide.txt b { font-size: 1.15rem; font-family: var(--f-display); }
.adc-cta { margin-top: 6px; background: var(--accent); color: var(--on-accent); padding: 4px 14px; border-radius: 999px; font-weight: 700; font-size: .85rem; }
.adc-dots { display: flex; justify-content: center; gap: 5px; margin-top: 7px; }
.adc-dots i { width: 7px; height: 7px; border-radius: 999px; background: var(--line); transition: width .25s, background .25s; }
.adc-dots i.on { width: 20px; background: var(--primary); }

/* ===== 1.7.0: النوافذ المنبثقة ===== */
.pu-back { position: fixed; inset: 0; z-index: 9000; background: rgba(5,15,12,.72); display: grid; place-items: center; padding: 12px; animation: puIn .2s ease-out; }
.pu-back.out { opacity: 0; transition: opacity .18s; }
@keyframes puIn { from { opacity: 0; } to { opacity: 1; } }
.pu-box { position: relative; display: grid; justify-items: center; gap: 10px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); animation: puPop .22s ease-out; }
@keyframes puPop { from { transform: scale(.94); } to { transform: none; } }
.pu-box.is-msg, .pu-box:not(.has-img) { background: var(--surface); border-radius: 18px; padding: 22px 18px 16px; width: min(440px, calc(100vw - 24px)); overflow: auto; }
.pu-box.is-msg.has-img { padding-top: 14px; }
.pu-img { display: block; border-radius: 14px; max-width: calc(100vw - 24px); object-fit: contain; background: transparent; box-shadow: 0 18px 50px -20px rgba(0,0,0,.6); }
.pu-x { position: absolute; top: -6px; inset-inline-end: -6px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 0; background: #fff; color: #111; display: grid; place-items: center; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.pu-x svg.i { width: 18px; height: 18px; }
.pu-cd { position: absolute; bottom: -4px; inset-inline-start: -4px; background: var(--accent); color: var(--on-accent); font-size: 10px; min-width: 18px; height: 18px; border-radius: 999px; display: grid; place-items: center; font-weight: 700; }
.pu-txt { text-align: center; color: var(--ink); }
.pu-box.is-ad.has-img .pu-txt { color: #fff; }
.pu-txt h3 { font-size: 1.2rem; margin-bottom: 4px; }
.pu-txt p { margin: 0; white-space: pre-wrap; }
.pu-foot { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; }
.pu-foot .btn { min-width: 170px; }
.pu-tag { color: rgba(255,255,255,.75); font-size: .72rem; }
.pu-box:not(.has-img) .pu-tag { color: var(--muted); }
html.no-scroll, html.no-scroll body { overflow: hidden; }

.tab-pane > * + * { margin-top: 10px; }
.star-pick + textarea { width: 100%; margin-bottom: 10px; }

/* ===== 1.8.0: تطبيق أندرويد ===== */
.inapp-banner { position: fixed; top: calc(8px + var(--safe-t)); inset-inline: 10px; z-index: 9500; display: flex; gap: 10px; align-items: center; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; box-shadow: 0 12px 30px -12px rgba(0,0,0,.45); cursor: pointer; animation: bnIn .25s ease-out; max-width: 560px; margin-inline: auto; }
.inapp-banner img { border-radius: 10px; flex: none; }
.inapp-banner b { display: block; font-size: .95rem; }
.inapp-banner span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: .85rem; }
.inapp-banner.out { opacity: 0; transform: translateY(-20px); transition: .3s; }
@keyframes bnIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: none; } }
html.is-native body { overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent; }
