/* ============================================================
   نظام واجهة على نهج «ثمانية» — سلوك تطبيق جوال
   الألوان من نظام تصميم ثمانية الرسمي (@thmanyah/design-system, MIT)
   ============================================================ */

:root {
  --brand-50:  #FFF5E6;
  --brand-100: #FFE5BF;
  --brand:     #FF9500;
  --brand-600: #CC7700;
  --brand-700: #995A00;

  --gray-50:  #F5F7FA;
  --gray-100: #E4E7EB;
  --gray-500: #616E7C;
  --gray-600: #52606D;
  --gray-700: #3E4C59;

  --success: #10B981;
  --error:   #EF4444;

  --bg: #ffffff;
  --bg-alt: var(--gray-50);
  --surface: #ffffff;
  --surface-2: var(--gray-50);
  --border: var(--gray-100);
  --border-strong: #d3d9e0;
  --heading: #1c2430;
  --text: var(--gray-700);
  --muted: var(--gray-500);
  --on-brand: #ffffff;

  --font-sans: "Thmanyah Sans", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Thmanyah Serif Display", "Noto Naskh Arabic", "Thmanyah Serif Text", Georgia, serif;

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(28,36,48,.05);
  --shadow: 0 4px 6px -2px rgba(28,36,48,.05), 0 14px 34px -12px rgba(28,36,48,.14);
  --shadow-brand: 0 8px 22px -8px rgba(255,149,0,.55);
  --max: 1160px;

  --tabbar-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/*
 * ثلاث حالات لا اثنتان: اختيارٌ صريح للفاتح، اختيارٌ صريح للداكن، وتَبَعٌ للنظام
 * حين لا يختار الزائر. الكتلتان أدناه متطابقتان عمدًا — الأولى تخدم متّبعي النظام،
 * والثانية تخدم من ضغط الزر. عدّلهما معًا.
 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1116;
    --bg-alt: #131820;
    --surface: #161C25;
    --surface-2: #1D242F;
    --border: #28313d;
    --border-strong: #3a4553;
    --heading: #F2F5F9;
    --text: #C3CCD8;
    --muted: #8B97A6;
    --brand-50: rgba(255,149,0,.12);
    --brand-100: rgba(255,149,0,.24);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow: 0 4px 6px -2px rgba(0,0,0,.35), 0 16px 38px -14px rgba(0,0,0,.6);
  }
}

:root[data-theme="dark"] {
    --bg: #0e1116;
    --bg-alt: #131820;
    --surface: #161C25;
    --surface-2: #1D242F;
    --border: #28313d;
    --border-strong: #3a4553;
    --heading: #F2F5F9;
    --text: #C3CCD8;
    --muted: #8B97A6;
    --brand-50: rgba(255,149,0,.12);
    --brand-100: rgba(255,149,0,.24);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow: 0 4px 6px -2px rgba(0,0,0,.35), 0 16px 38px -14px rgba(0,0,0,.6);
}

/* ===== الأساس ===== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b));
}

h1, h2, h3 { font-family: var(--font-display); color: var(--heading); font-weight: 700; line-height: 1.45; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand); }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
::selection { background: var(--brand); color: #fff; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

.shell { max-width: var(--max); margin: 0 auto; padding-inline: 18px; }

/* مخفيٌّ بصريًا ومقروءٌ لقارئ الشاشة ومحرك البحث */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; inset-inline-start: -9999px; top: 8px; z-index: 200;
  background: var(--brand); color: #fff; padding: 10px 18px; border-radius: 10px; font-weight: 600;
}
.skip:focus { inset-inline-start: 16px; color: #fff; }

/* ===== الشريط العلوي ===== */
.appbar {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.appbar::before {
  content: ""; position: absolute; inset-inline: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand-700), var(--brand) 45%, #FFC46B);
}
.appbar__inner {
  max-width: var(--max); margin: 0 auto; padding: 0 18px;
  min-height: 62px; display: flex; align-items: center; gap: 16px;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand:hover { color: inherit; }
.brand__mark {
  width: 36px; height: 36px; flex: 0 0 36px;
  color: var(--brand);
  border-radius: 11px;
  box-shadow: var(--shadow-brand);
}
.brand__name { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--heading); }

.appbar__nav { margin-inline-start: auto; display: flex; gap: 22px; }
.appbar__nav a {
  color: var(--muted); font-size: 15.5px; font-weight: 500;
  padding-bottom: 2px; border-bottom: 2px solid transparent;
}
.appbar__nav a:hover { color: var(--heading); border-color: var(--brand); }
.appbar__nav a[aria-current="page"] { color: var(--heading); border-color: var(--brand); font-weight: 600; }

.theme-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 50%; cursor: pointer;
  background: transparent; border: 1px solid var(--border-strong);
  color: var(--muted); transition: .16s;
}
.theme-btn:hover { color: var(--brand); border-color: var(--brand); }
.theme-btn:active { transform: scale(.92); }
.theme-btn svg { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* الشمس تظهر في الوضع الداكن (أي: اضغط لتُصبح صباحيًا) والقمر في الفاتح */
.theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: block; }
:root[data-theme="dark"] .theme-btn .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .moon { display: none; }
}

.install-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px; border-radius: 999px; cursor: pointer;
  font-size: 14.5px; font-weight: 600;
  color: var(--brand-700); background: var(--brand-50);
  border: 1px solid var(--brand-100); transition: .16s;
}
.install-btn:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.install-btn svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ===== شريط التبويبات السفلي (سلوك تطبيق) ===== */
.tabbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 70;
  display: flex; align-items: stretch;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--border);
}
.tabbar__item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--muted); font-size: 11.5px; font-weight: 600;
  transition: color .14s, transform .14s;
}
.tabbar__item svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar__item:active { transform: scale(.93); }
.tabbar__item:hover { color: var(--heading); }
.tabbar__item.is-active { color: var(--brand); }
.tabbar__item.is-active svg { stroke-width: 2.2; }

@media (min-width: 861px) {
  .tabbar { display: none; }
  body { padding-bottom: 0; }
}
@media (max-width: 860px) {
  .appbar__nav { display: none; }
  .theme-btn { margin-inline-start: auto; }
  .install-btn { margin-inline-start: 0; }
}

/* ===== الشريط العلوي: قصير عمدًا — الكود يبدأ فوق الطيّة ===== */
.topline {
  padding: 22px 0 16px;
  background: linear-gradient(180deg, var(--brand-50), transparent);
}
.topline h1 {
  margin: 0; font-size: clamp(23px, 4.4vw, 32px); line-height: 1.35;
}
.topline h1 em { font-style: normal; color: var(--brand); }
.topline__meta {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  margin: 6px 0 0; font-size: 13.5px; color: var(--muted); font-weight: 500;
}
.topline__meta .sep { opacity: .5; }

/* نبضة خضراء صغيرة: إشارة «حيّ ومحدَّث» دون جملة تشرحها */
.live-dot {
  width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto;
  background: var(--success);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 22%, transparent);
}

.lander {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 0 20px;
}
.lander h1 { margin: 0; font-size: clamp(23px, 4.4vw, 33px); line-height: 1.35; }
.lander__meta {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  margin: 6px 0 0; font-size: 13.5px; color: var(--muted); font-weight: 500;
}
.lander__meta .sep { opacity: .5; }
.lander--plain { padding-top: 10px; }

.searchbar { position: relative; margin: 26px auto 0; max-width: 540px; }
.searchbar svg {
  position: absolute; inset-inline-start: 18px; top: 50%; transform: translateY(-50%);
  color: var(--muted); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round;
  pointer-events: none;
}
.searchbar input {
  width: 100%; padding: 15px 50px 15px 18px;
  font: inherit; font-size: 16px; font-family: var(--font-sans);
  color: var(--heading); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 999px;
  box-shadow: var(--shadow-sm); transition: .18s;
}
.searchbar input::placeholder { color: var(--muted); }
.searchbar input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.searchbar--page { margin: 18px 0 0; max-width: 100%; }
.searchbar--slim { margin: 14px 0 0; max-width: 420px; }
.searchbar--slim input { padding: 12px 46px 12px 16px; font-size: 15.5px; }
.searchbar--slim svg { inset-inline-start: 16px; }

/* ===== شرائح التصنيف ===== */
.chips {
  display: flex; gap: 8px; margin: 16px 0 18px;
  overflow-x: auto; scrollbar-width: none; padding-bottom: 4px;
  scroll-snap-type: x proximity;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; scroll-snap-align: start;
  padding: 8px 17px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--muted); font-size: 14.5px; font-weight: 500; transition: .16s;
}
.chip:hover { color: var(--heading); border-color: var(--brand); }
.chip[aria-pressed="true"] {
  background: var(--brand); border-color: var(--brand); color: var(--on-brand);
  font-weight: 600; box-shadow: var(--shadow-brand);
}

@media (min-width: 861px) { .chips { justify-content: center; flex-wrap: wrap; overflow: visible; } }

/* ===== عناوين الأقسام ===== */
.sec-title {
  display: flex; align-items: baseline; gap: 11px; flex-wrap: wrap;
  margin: 38px 0 18px; font-size: 23px;
  padding-inline-start: 15px; position: relative;
}
.sec-title::before {
  content: ""; position: absolute; inset-inline-start: 0; top: .33em;
  width: 5px; height: .84em; border-radius: 3px; background: var(--brand);
}
.sec-title span { font-family: var(--font-sans); font-size: 14px; font-weight: 500; color: var(--muted); }
.sec-title a { color: var(--heading); }
.sec-title a:hover { color: var(--brand-600); }

.page-title { margin: 22px 0 6px; font-size: clamp(26px, 5vw, 36px); }
.page-lede { margin: 0 0 22px; color: var(--muted); font-size: 16px; }

.crumbs { font-size: 14px; color: var(--muted); padding-top: 20px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand); }

/* ============================================================
   بلاطة الكود: شعار البراند، وتحته الكود وزر النسخ. لا شيء غيره.
   ============================================================ */

.tile-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 1020px; margin-inline: auto;
}
@media (min-width: 700px) {
  .tile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
}

.tile {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding: 44px 13px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--brand) 42%, var(--border));
}
.tile.is-featured { border-color: color-mix(in srgb, var(--brand) 48%, var(--border)); }

/* زاويتا البلاطة: النسبة والمفضلة — أيقونتان لا جملتان */
.tile__off {
  position: absolute; top: 12px; inset-inline-end: 12px;
  font-size: 12.5px; font-weight: 700; line-height: 1;
  color: #fff; background: var(--brand);
  padding: 6px 10px; border-radius: 999px;
  box-shadow: var(--shadow-brand);
}
.tile__fav {
  position: absolute; top: 10px; inset-inline-start: 10px;
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center;
  background: transparent; border: 0; color: var(--muted);
  opacity: .55; transition: .16s;
}
.tile__fav svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.tile__fav:hover { opacity: 1; color: var(--error); }
.tile__fav:active { transform: scale(.88); }
.tile__fav.is-on { opacity: 1; color: var(--error); }
.tile__fav.is-on svg { fill: currentColor; }

/* الشعار: مربّع موزون، وبلاطة بيضاء دائمًا حتى في الوضع الداكن */
.tile__brand {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center; min-width: 0; width: 100%;
}
.tile__brand:hover { color: inherit; }
.tile__brand:hover .tile__name { color: var(--brand-600); }

.tile .tile__logo {
  width: 54px; height: 54px; flex: 0 0 54px;
  border-radius: 15px; font-size: 22px;
}
@media (max-width: 460px) {
  .tile .tile__logo { width: 46px; height: 46px; flex-basis: 46px; border-radius: 13px; font-size: 19px; }
}

.tile__name {
  font-family: var(--font-display); font-weight: 700;
  font-size: 16.5px; color: var(--heading); line-height: 1.4;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/*
 * الكود فوق بعرض البلاطة كاملًا وزر النسخ تحته.
 * جنبًا إلى جنب كان يضيّق خانة الكود في العمودين على الجوال فيُقصّ نصّه —
 * والكود المقصوص لا قيمة له. العمود يضمن ظهوره كاملًا في كل المقاسات.
 */
.tile__row {
  display: flex; flex-direction: column; gap: 8px;
  width: 100%; margin-top: auto;
}

.tile__code {
  width: 100%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 11px 8px;
  font-size: 16px; font-weight: 700; letter-spacing: .6px;
  color: var(--heading); background: var(--surface-2);
  border: 2px dashed var(--border-strong); border-radius: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: .16s;
}
.tile__code:hover { border-color: var(--brand); border-style: solid; color: var(--brand-700); background: var(--brand-50); }

/* صفّ الإجراءات: «نسخ» يأخذ المساحة، و«زيارة» زرٌّ صغير بجانبه */
.tile__acts { display: flex; gap: 6px; width: 100%; }

.tile__copy {
  flex: 1; min-width: 0; cursor: pointer;
  padding: 11px 12px; border: 0; border-radius: 12px;
  font-family: var(--font-sans); font-size: 15px; font-weight: 700;
  color: var(--on-brand); background: var(--brand);
  box-shadow: var(--shadow-brand); transition: .16s;
}

/* زيارة المتجر بلا نسخ — لمن يريد التصفّح فقط */
.tile__visit {
  flex: 0 0 auto; width: 42px;
  display: grid; place-items: center;
  border-radius: 12px;
  color: var(--muted); background: var(--surface-2);
  border: 1px solid var(--border); transition: .16s;
}
.tile__visit svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tile__visit:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-50); }
.tile__visit:active { transform: scale(.94); }
.tile__copy:hover { background: var(--brand-600); }
.tile__copy:active { transform: scale(.96); }

/* حالة «نُسخ»: البلاطة كلها تتغيّر، فالإشارة واضحة أيًّا كان ما ضُغط */
.tile.is-copied .tile__code {
  border-style: solid; border-color: var(--success);
  color: var(--success); background: color-mix(in srgb, var(--success) 12%, var(--surface));
}
.tile.is-copied .tile__copy { background: var(--success); box-shadow: none; }

.tile__exp { margin: 0; font-size: 12px; color: var(--muted); }

/* صفحة المتجر: الشعار نفسه يتكرّر، فنصغّره ونُبقي التركيز على الكود */
.tile-grid--lander .tile__brand { margin-top: 2px; }
.tile-grid--lander .tile__logo { width: 46px; height: 46px; flex-basis: 46px; border-radius: 13px; font-size: 19px; }

.tile__brand--plain { cursor: default; }

/* ===== الأزرار ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 19px; border-radius: 999px; border: 1px solid transparent;
  font-family: var(--font-sans); font-size: 15px; font-weight: 600;
  cursor: pointer; transition: .16s; white-space: nowrap;
}
.btn-primary { background: var(--brand); color: var(--on-brand); box-shadow: var(--shadow-brand); }
.btn-primary:hover { background: var(--brand-600); color: var(--on-brand); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--heading); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-600); }

/* ===== شعارات المتاجر ===== */
.store-logo {
  width: 44px; height: 44px; flex: 0 0 44px;
  border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-2); object-fit: contain; padding: 4px;
}

/* بلاطة الشعارات المجلوبة: بيضاء دائمًا — أغلب الشعارات داكنة على شفاف */
.store-logo--img {
  background: #fff;
  border-color: rgba(28, 36, 48, .12);
  padding: 5px;
}

/* الحرف البديل: تدرّجٌ خفيف من لون العلامة بدل مسطّحٍ باهت */
.store-logo--text {
  display: grid; place-items: center; border: 0; padding: 0;
  font-family: var(--font-display); font-weight: 700; font-size: 20px;
  background:
    linear-gradient(150deg,
      color-mix(in srgb, var(--logo-bg, var(--brand)) 78%, #fff),
      var(--logo-bg, var(--brand)) 62%,
      color-mix(in srgb, var(--logo-bg, var(--brand)) 88%, #000));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 0 0 1px rgba(28,36,48,.1);
}
.store-logo--sm { width: 36px; height: 36px; flex-basis: 36px; border-radius: 10px; font-size: 16px; }
.store-logo--lg { width: 76px; height: 76px; flex-basis: 76px; border-radius: 18px; font-size: 32px; }

/* ===== بطاقات المتاجر ===== */
.store-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); }

.store-strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: 152px; gap: 12px;
  overflow-x: auto; scrollbar-width: none;
  padding-bottom: 6px; scroll-snap-type: x proximity;
}
.store-strip::-webkit-scrollbar { display: none; }
.store-strip .store-card { scroll-snap-align: start; }

.store-card {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  text-align: center; padding: 18px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.store-card:hover {
  transform: translateY(-2px); border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
  box-shadow: var(--shadow); color: inherit;
}
.store-card__name { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--heading); }
.store-card__meta { font-size: 12.5px; color: var(--muted); }
.store-card__best {
  font-size: 12px; font-weight: 600; color: var(--brand-700);
  background: var(--brand-50); border: 1px solid var(--brand-100);
  padding: 2px 10px; border-radius: 999px;
}

/* ===== رأس صفحة المتجر ===== */
.store-head {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 24px; margin: 14px 0 6px;
}
.store-head::after {
  content: ""; position: absolute; top: 18px; bottom: 18px; inset-inline-start: 0; width: 5px;
  border-start-end-radius: 4px; border-end-end-radius: 4px;
  background: linear-gradient(180deg, var(--brand), var(--brand-700));
}
.store-head__info { flex: 1 1 260px; min-width: 0; }
.store-head h1 { margin: 0 0 4px; font-size: clamp(24px, 4.4vw, 34px); }
.store-head p { margin: 0; color: var(--muted); font-size: 15.5px; }
.store-head__stat { margin-top: 6px !important; font-weight: 600; color: var(--brand-600) !important; font-size: 14.5px !important; }

/* ===== خطوات ===== */
.howto { margin-top: 8px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(216px, 1fr)); counter-reset: s; }
.steps li {
  counter-increment: s; position: relative;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 18px 18px 18px 18px;
}
.steps li::before {
  content: counter(s); display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 10px; margin-bottom: 10px;
  background: var(--brand-50); color: var(--brand-700);
  font-weight: 700; font-size: 15px; border: 1px solid var(--brand-100);
}
.steps strong { display: block; font-family: var(--font-display); font-size: 17px; color: var(--heading); margin-bottom: 2px; }
.steps span { font-size: 14.5px; color: var(--muted); }

/* ===== نص وأسئلة ===== */
.prose { max-width: 760px; margin: 44px 0 0; }
.prose h2 { font-size: 23px; margin: 30px 0 10px; }
.prose h3 { font-size: 18.5px; margin: 24px 0 8px; }
.prose p, .prose li { color: var(--text); font-size: 15.5px; }
.prose ol, .prose ul { padding-inline-start: 22px; }
.prose li { margin-bottom: 5px; }
.prose li::marker { color: var(--brand); font-weight: 700; }

.faq { margin-top: 10px; }
.faq details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 15px 18px; margin-bottom: 10px; transition: border-color .16s;
}
.faq details:hover { border-color: var(--border-strong); }
.faq details[open] { border-color: color-mix(in srgb, var(--brand) 35%, var(--border)); }
.faq summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 16.5px; color: var(--heading);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "+"; color: var(--brand); font-size: 20px; font-weight: 700; line-height: 1; }
.faq details[open] summary::before { content: "−"; }
.faq details[open] summary { margin-bottom: 9px; }
.faq p { margin: 0; font-size: 15px; color: var(--muted); }

.empty {
  text-align: center; padding: 44px 20px; color: var(--muted);
  background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--r);
}

.strip { margin-top: 6px; }

/* ===== التذييل ===== */
.site-footer {
  margin-top: 56px; padding: 26px 0;
  border-top: 1px solid var(--border); background: var(--bg-alt);
  font-size: 14px; color: var(--muted);
}
.site-footer .shell { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; }
.site-footer p { margin: 0; }

/* ===== التنبيه العائم ===== */
.toast {
  position: fixed; z-index: 90;
  inset-inline: 16px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px);
  max-width: 440px; margin-inline: auto;
  background: var(--heading); color: var(--bg);
  padding: 13px 18px; border-radius: 13px;
  font-size: 14.5px; font-weight: 500; text-align: center;
  box-shadow: 0 12px 34px -10px rgba(0,0,0,.5);
  opacity: 0; transform: translateY(14px); transition: opacity .24s, transform .24s;
}
.toast.is-on { opacity: 1; transform: translateY(0); }
@media (min-width: 861px) { .toast { bottom: 22px; } }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   المساحات الإعلانية
   ============================================================ */

.ad {
  --ad-accent: var(--brand);
  position: relative;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px 20px 20px 20px;
  margin: 20px 0;
}
.ad::before {
  content: ""; position: absolute; top: 16px; bottom: 16px; inset-inline-start: 0; width: 4px;
  border-start-end-radius: 3px; border-end-end-radius: 3px;
  background: var(--ad-accent);
}
.ad__label {
  position: absolute; top: -9px; inset-inline-end: 18px;
  font-size: 11px; font-weight: 700; letter-spacing: .4px;
  color: var(--muted); background: var(--bg);
  border: 1px solid var(--border); border-radius: 999px; padding: 1px 10px;
}
.ad__img {
  width: 62px; height: 62px; flex: 0 0 62px;
  border-radius: 14px; object-fit: contain;
  background: var(--surface-2); border: 1px solid var(--border); padding: 5px;
}
.ad__body { flex: 1 1 240px; min-width: 0; }
.ad__advertiser { margin: 0 0 2px; font-size: 12.5px; font-weight: 600; color: var(--ad-accent); }
.ad__title { margin: 0; font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--heading); line-height: 1.45; }
.ad__text { margin: 3px 0 0; font-size: 14.5px; color: var(--muted); }
.ad__cta { flex: 0 0 auto; }

/* مساحة شاغرة: مدعوّة للحجز لا فراغ في التصميم */
.ad--house {
  background:
    repeating-linear-gradient(135deg, transparent, transparent 9px, color-mix(in srgb, var(--brand) 5%, transparent) 9px, color-mix(in srgb, var(--brand) 5%, transparent) 18px),
    var(--surface);
  border-style: dashed;
  border-color: color-mix(in srgb, var(--brand) 38%, var(--border));
}
.ad--house .ad__title { color: var(--brand-700); }

/* إعلان بهيئة بطاقة داخل شبكة الأكواد — المحتوى في الوسط لا مشدودًا لطرفي البطاقة */
.ad--card {
  flex-direction: column; align-items: stretch; justify-content: center;
  gap: 12px; margin: 0; padding: 20px;
}
.ad--card .ad__body { flex: 0 0 auto; }
.ad--card .ad__cta { width: 100%; }
.ad--card .ad__img { width: 44px; height: 44px; flex-basis: 44px; border-radius: 12px; }

/* ============================================================
   المدونة
   ============================================================ */

.post-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); }

.post-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 20px;
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.post-card:hover {
  transform: translateY(-2px); color: inherit;
  border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
  box-shadow: var(--shadow);
}
.post-card__meta { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.post-card__title { margin: 0; font-size: 18px; line-height: 1.5; color: var(--heading); }
.post-card__excerpt {
  margin: 0; font-size: 14.5px; color: var(--muted); line-height: 1.75;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card__tie {
  margin-top: auto; padding-top: 8px;
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; color: var(--brand-600);
}
.post-card__tie--cat::before { content: "#"; opacity: .6; }
.post-card--compact { padding: 16px; }
.post-card--compact .post-card__title { font-size: 16.5px; }

.post-lead {
  background: linear-gradient(180deg, var(--brand-50), var(--surface) 65%);
  border: 1px solid color-mix(in srgb, var(--brand) 40%, var(--border));
  border-radius: var(--r-lg); padding: 28px; margin-bottom: 22px;
}
.post-lead a { display: block; color: inherit; }
.post-lead a:hover { color: inherit; }
.post-lead h2 { margin: 8px 0 10px; font-size: clamp(22px, 4vw, 31px); line-height: 1.4; }
.post-lead p { margin: 0; color: var(--muted); font-size: 16px; max-width: 640px; }
.post-lead__cta { display: inline-block; margin-top: 16px; font-weight: 700; color: var(--brand-600); }
.post-lead a:hover .post-lead__cta { color: var(--brand); }

.strip__more { margin: 16px 0 0; font-weight: 600; }

/* --- مقال --- */
.post-shell { max-width: 820px; }

.post__head { padding: 6px 0 22px; border-bottom: 1px solid var(--border); margin-bottom: 26px; }
.post__head h1 { margin: 10px 0 12px; font-size: clamp(26px, 5vw, 40px); line-height: 1.4; }
.post__excerpt { margin: 0 0 14px; font-size: 17px; color: var(--muted); line-height: 1.8; }
.post__meta { margin: 0; font-size: 13.5px; color: var(--muted); }
.post__meta .sep { margin: 0 7px; opacity: .55; }

/* الجسر بين المقال والأكواد */
.post-tie {
  display: flex; align-items: center; gap: 12px; margin-top: 18px;
  background: var(--brand-50); border: 1px solid var(--brand-100);
  border-radius: var(--r); padding: 13px 16px;
  transition: .16s;
}
.post-tie:hover { border-color: var(--brand); color: inherit; }
.post-tie span { display: flex; flex-direction: column; font-size: 13.5px; color: var(--muted); min-width: 0; }
.post-tie strong { font-family: var(--font-display); font-size: 16px; color: var(--heading); font-weight: 700; }
.post-tie__go { margin-inline-start: auto; color: var(--brand); font-size: 19px; flex: 0 0 auto; }
.post-tie--store { margin: 20px 0 4px; }

.toc {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r); padding: 18px 22px; margin-bottom: 28px;
}
.toc__title {
  margin: 0 0 8px; font-family: var(--font-display);
  font-size: 15px; font-weight: 700; color: var(--heading);
}
.toc ol { margin: 0; padding-inline-start: 20px; }
.toc li { margin-bottom: 4px; font-size: 15px; }
.toc a { color: var(--text); }
.toc a:hover { color: var(--brand-600); }

.post__body { font-size: 17px; line-height: 1.95; }
.post__body > h2 { font-size: clamp(21px, 3.6vw, 27px); margin: 40px 0 12px; scroll-margin-top: 82px; }
.post__body > h3 { font-size: 19.5px; margin: 28px 0 8px; scroll-margin-top: 82px; }
.post__body > p { margin: 0 0 18px; }
.post__body > ul, .post__body > ol { margin: 0 0 20px; padding-inline-start: 24px; }
.post__body li { margin-bottom: 9px; }
.post__body li::marker { color: var(--brand); font-weight: 700; }
.post__body strong { color: var(--heading); font-weight: 700; }
.post__body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 1px 6px;
}

.callout {
  background: var(--brand-50); border: 1px solid var(--brand-100);
  border-inline-start: 4px solid var(--brand);
  border-radius: var(--r-sm); padding: 16px 20px; margin: 0 0 22px;
}
.callout p { margin: 0; font-size: 16px; color: var(--heading); }

.table-wrap { overflow-x: auto; margin: 0 0 24px; border: 1px solid var(--border); border-radius: var(--r); }
.post__body table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 460px; }
.post__body th, .post__body td { padding: 12px 16px; text-align: start; border-bottom: 1px solid var(--border); }
.post__body th { background: var(--surface-2); font-family: var(--font-display); font-weight: 700; color: var(--heading); white-space: nowrap; }
.post__body tbody tr:last-child td { border-bottom: 0; }

/* أكواد حيّة داخل المقال — تُقرأ من بيانات الأكواد نفسها */
.live-codes {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 22px; margin: 28px 0;
}
.live-codes__title {
  margin: 0 0 4px; font-size: 20px;
  padding-inline-start: 14px; position: relative;
}
.live-codes__title::before {
  content: ""; position: absolute; inset-inline-start: 0; top: .3em;
  width: 4px; height: .84em; border-radius: 3px; background: var(--brand);
}
.live-codes__note { margin: 0 0 16px; font-size: 13.5px; color: var(--muted); }
.live-codes .tile-grid { max-width: none; }
.live-codes .tile { background: var(--surface); }

/* ============================================================
   صفحة «أعلن معنا»
   ============================================================ */

.ad-formats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); margin: 26px 0 10px; }
.ad-format {
  position: relative; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r); padding: 24px 22px;
}
.ad-format__tag {
  display: inline-block; margin-bottom: 10px;
  font-size: 12px; font-weight: 700; color: var(--brand-700);
  background: var(--brand-50); border: 1px solid var(--brand-100);
  padding: 3px 11px; border-radius: 999px;
}
.ad-format h2 { margin: 0 0 8px; font-size: 20px; }
.ad-format p { margin: 0 0 12px; font-size: 15px; color: var(--muted); }
.ad-format ul { margin: 0; padding-inline-start: 20px; }
.ad-format li { font-size: 14.5px; color: var(--muted); margin-bottom: 5px; }
.ad-format li::marker { color: var(--brand); }

/* ============================================================
   إضافات صغيرة
   ============================================================ */

.store-logo--xs { width: 22px; height: 22px; flex-basis: 22px; border-radius: 7px; font-size: 11px; padding: 2px; }

.store-card { position: relative; }
.store-card__guide {
  position: absolute; top: 10px; inset-inline-start: 10px;
  font-size: 10.5px; font-weight: 700; color: var(--brand-700);
  background: var(--brand-50); border: 1px solid var(--brand-100);
  padding: 1px 8px; border-radius: 999px;
}

.site-footer__links { display: flex; gap: 16px; flex-wrap: wrap; }
.site-footer__links a { font-weight: 500; }

@media (max-width: 600px) {
  .ad { padding: 18px 16px; gap: 12px; }
  .ad__cta { width: 100%; }
  .post-lead { padding: 22px 18px; }
  .live-codes { padding: 16px; border-radius: var(--r); }
  .live-codes .tile-grid { gap: 10px; }
  .post__body { font-size: 16.5px; }
}

/* ============================================================
   صفحة الهبوط: الكود أولًا، وكل ما عداه في الذيل
   ============================================================ */

/* الذيل: كل ما ليس كودًا — يبدأ بفاصل بصري واضح */
.tail {
  margin-top: 44px; padding-top: 30px;
  border-top: 1px solid var(--border);
}
.tail .sec-title { font-size: 19px; margin: 26px 0 14px; }
.tail .sec-title::before { height: .8em; width: 4px; }

.about {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
}
.about p { margin: 0; flex: 1 1 260px; font-size: 15px; color: var(--muted); }

.faq--mini details { padding: 12px 16px; margin-bottom: 8px; }
.faq--mini summary { font-size: 15.5px; }
.faq--mini p { font-size: 14.5px; }

.ad--shell { max-width: var(--max); margin-inline: auto; }

/* الأسئلة العامة في أسفل الرئيسية — مطويّة ومنزوية */
.faq.shell { margin-top: 36px; padding-top: 26px; border-top: 1px solid var(--border); }
.faq.shell .sec-title { font-size: 19px; }

@media (max-width: 700px) {
  .lander { gap: 12px; }
  .lander .store-logo--lg { width: 56px; height: 56px; flex-basis: 56px; border-radius: 15px; font-size: 24px; }
  .code-card.is-hero { padding: 20px; }
  .tail { margin-top: 34px; padding-top: 24px; }
}

/* ============================================================
   الشاشة الإعلانية العلوية — أول ما تقع عليه العين
   ============================================================ */

.ad--stage {
  margin: 18px 0 0;
  padding: 26px 28px;
  border-radius: var(--r-lg);
  gap: 20px;
}
.ad--stage .ad__title { font-size: clamp(19px, 3vw, 24px); }
.ad--stage .ad__text { font-size: 15.5px; max-width: 46ch; }
.ad--stage .ad__img { width: 76px; height: 76px; flex-basis: 76px; border-radius: 18px; }
.ad--stage .ad__cta { padding: 13px 24px; font-size: 16px; }
.ad--stage::before { top: 22px; bottom: 22px; width: 5px; }

@media (max-width: 600px) {
  .ad--stage { padding: 22px 18px; gap: 14px; text-align: start; }
  .ad--stage .ad__cta { width: 100%; }
}

/* ============================================================
   إعلان بصورة مصمَّمة — الصورة هي الإعلان
   ============================================================ */

.ad--banner {
  display: block;
  padding: 0;
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface-2);
}
.ad--banner::before { display: none; }
.ad--banner a, .ad--banner picture { display: block; }
.ad--banner img {
  width: 100%; height: auto; display: block;
  aspect-ratio: 6 / 1; object-fit: cover;
}
.ad--banner .ad__label {
  top: 10px; inset-inline-end: 12px;
  background: rgba(14, 17, 22, .72); color: #fff; border-color: transparent;
  backdrop-filter: blur(4px);
}

/* بطاقة داخل شبكة الأكواد: الصورة مربّعة تقريبًا لا عريضة */
.ad--banner.ad--card img { aspect-ratio: 4 / 3; }

@media (max-width: 600px) {
  .ad--banner img { aspect-ratio: 2 / 1; }
}

/* الأكواد الطويلة على الشاشات الضيقة: خطٌّ أصغر قليلًا يمنع القصّ */
@media (max-width: 460px) {
  .tile { padding: 42px 11px 13px; }
  .tile__code { font-size: 14.5px; letter-spacing: .3px; padding: 10px 6px; }
  .tile__copy { font-size: 14.5px; padding: 10px 8px; }
  .tile__visit { width: 38px; }
  .tile__name { font-size: 15px; }
}

/* ============================================================
   لوحة العمل الخاصة
   ============================================================ */

.dash__lead { margin: 0 0 20px; font-size: 16px; color: var(--text); line-height: 1.85; }
.dash__lead strong { color: var(--heading); }

.dash__nets { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(262px, 1fr)); }
.dash__net {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 20px;
  display: flex; flex-direction: column; gap: 9px;
}
.dash__net.is-direct { border-color: color-mix(in srgb, var(--success) 45%, var(--border)); }
.dash__net h3 { margin: 0; font-size: 18px; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.dash__net p { margin: 0; font-size: 14.5px; color: var(--muted); flex: 1; }
.dash__net .btn { align-self: flex-start; margin-top: 4px; }
.dash__tag {
  font-family: var(--font-sans); font-size: 11.5px; font-weight: 700;
  color: var(--success); background: color-mix(in srgb, var(--success) 13%, transparent);
  padding: 3px 10px; border-radius: 999px;
}

.dash__table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 620px; }
.dash__table th, .dash__table td {
  padding: 12px 14px; text-align: start; border-bottom: 1px solid var(--border); vertical-align: middle;
}
.dash__table th {
  background: var(--surface-2); font-family: var(--font-display);
  font-weight: 700; color: var(--heading); white-space: nowrap;
}
.dash__table tbody tr:last-child td { border-bottom: 0; }
.dash__table tbody tr:hover { background: var(--surface-2); }
.dash__table strong { display: block; color: var(--heading); }
.dash__dom {
  display: block; font-size: 12.5px; color: var(--muted);
  font-family: ui-monospace, Menlo, monospace; direction: ltr; text-align: start;
}

.dash__demand {
  display: inline-block; font-size: 12.5px; font-weight: 600;
  padding: 3px 11px; border-radius: 999px; white-space: nowrap;
}
.dash__demand--hi { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.dash__demand--mid { background: var(--brand-50); color: var(--brand-700); }
.dash__demand--low { background: var(--surface-2); color: var(--muted); }

.dash .btn-sm { padding: 7px 15px; font-size: 14px; }

.dash__note {
  margin: 16px 0 0; font-size: 14px; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 13px 16px; line-height: 1.8;
}

/* أزرار التواصل في صفحة الإعلانات */
.contact { display: flex; gap: 11px; flex-wrap: wrap; margin: 6px 0 0; }
.contact__btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 22px; border-radius: 999px;
  font-family: var(--font-sans); font-size: 15.5px; font-weight: 600;
  color: var(--heading); background: var(--surface);
  border: 1px solid var(--border-strong); transition: .16s;
}
.contact__btn:hover { border-color: var(--brand); color: var(--brand-600); transform: translateY(-1px); }
.contact__btn--wa { background: #25D366; border-color: #25D366; color: #fff; }
.contact__btn--wa:hover { background: #1eb85a; border-color: #1eb85a; color: #fff; }

/* نموذج طلب الإعلان */
.adform {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 24px; margin: 6px 0 10px;
}
.adform form { display: grid; gap: 14px; }
.adform__row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
@media (max-width: 620px) { .adform__row { grid-template-columns: 1fr; } }
.adform .field > span { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.adform .field > span em { font-style: normal; font-weight: 500; opacity: .75; }
.adform input, .adform select, .adform textarea {
  width: 100%; padding: 12px 14px;
  font-family: var(--font-sans); font-size: 15.5px;
  color: var(--heading); background: var(--bg);
  border: 1px solid var(--border-strong); border-radius: 11px;
}
.adform textarea { resize: vertical; min-height: 76px; line-height: 1.7; }
.adform input:focus, .adform select:focus, .adform textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50);
}
.adform__send { width: 100%; background: #25D366; box-shadow: 0 8px 22px -8px rgba(37,211,102,.55); }
.adform__send:hover { background: #1eb85a; }
.adform__hint { margin: 0; font-size: 13px; color: var(--muted); text-align: center; }
