/* ==========================================================================
   ستوري سيفر — ورقة الأنماط الرئيسية
   ترتيب الملف: المتغيرات، الأساسيات، الهيكل، المكونات، الإعلانات، الاستجابة
   ========================================================================== */

/* ── المتغيرات ─────────────────────────────────────────────────────────── */
:root {
  --bg: #f7f8fb;
  --bg-soft: #eef1f6;
  --surface: #ffffff;
  --surface-2: #f4f6fa;
  --border: #e3e7ee;
  --border-strong: #cfd6e2;
  --text: #0f1729;
  --text-soft: #4a5568;
  --text-muted: #79839a;
  --accent: #1f6feb;
  --accent-hover: #1a5fd0;
  --accent-soft: #e8f0fe;
  --accent-contrast: #ffffff;
  --danger: #c0392b;
  --success: #14804a;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 41, .06), 0 1px 3px rgba(15, 23, 41, .04);
  --shadow: 0 4px 16px rgba(15, 23, 41, .08);
  --shadow-lg: 0 18px 48px rgba(15, 23, 41, .16);

  --container: 1180px;
  --header-h: 68px;
  /* الخط الأول يغطي العربية واللاتينية، وما بعده احتياط لبقية النصوص:
     الصينية والديفاناغاري والبنغالية والسيريلية */
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, system-ui, -apple-system,
    "Noto Sans", "Noto Sans Devanagari", "Noto Sans Bengali",
    "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1120;
    --bg-soft: #0e1626;
    --surface: #121b2d;
    --surface-2: #17223a;
    --border: #22304b;
    --border-strong: #31415f;
    --text: #e9eefa;
    --text-soft: #b3bed3;
    --text-muted: #8494ae;
    --accent: #4b8dff;
    --accent-hover: #6ba1ff;
    --accent-soft: #16263f;
    --accent-contrast: #06101f;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 6px 20px rgba(0, 0, 0, .45);
    --shadow-lg: 0 20px 56px rgba(0, 0, 0, .6);
  }
}

:root[data-theme="dark"] {
  --bg: #0b1120;
  --bg-soft: #0e1626;
  --surface: #121b2d;
  --surface-2: #17223a;
  --border: #22304b;
  --border-strong: #31415f;
  --text: #e9eefa;
  --text-soft: #b3bed3;
  --text-muted: #8494ae;
  --accent: #4b8dff;
  --accent-hover: #6ba1ff;
  --accent-soft: #16263f;
  --accent-contrast: #06101f;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 6px 20px rgba(0, 0, 0, .45);
  --shadow-lg: 0 20px 56px rgba(0, 0, 0, .6);
}

/* ── الأساسيات ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.35; margin: 0 0 .5rem; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3.1rem); }
h2 { font-size: clamp(1.4rem, 1rem + 1.4vw, 2.1rem); }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }

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

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 20px; }
.container.narrow { max-width: 820px; }

.skip-link {
  position: absolute; inset-inline-start: -9999px; top: 0;
  background: var(--accent); color: var(--accent-contrast);
  padding: 10px 18px; z-index: 100; border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.skip-link:focus { inset-inline-start: 12px; }

/* ── الأزرار ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: .68rem 1.25rem; font-weight: 600; font-size: .95rem;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .12s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--accent); }

.btn-sm { padding: .45rem .8rem; font-size: .85rem; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0;
  background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: background-color .18s ease, border-color .18s ease;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.icon-btn svg { width: 20px; height: 20px; }

.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--text-muted); font-size: .85rem; text-decoration: underline;
}
.link-btn:hover { color: var(--text); }

/* ── الترويسة ──────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 1.25rem; height: var(--header-h); }

.brand { display: flex; align-items: center; gap: .65rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none;
  border-radius: 11px; background: var(--accent); color: var(--accent-contrast);
}
.brand-mark svg { width: 21px; height: 21px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 1rem; }
.brand-text small { font-size: .74rem; color: var(--text-muted); }

.nav { display: flex; gap: 1.5rem; margin-inline-start: auto; }
.nav a { color: var(--text-soft); font-size: .92rem; font-weight: 500; }
.nav a:hover { color: var(--accent); text-decoration: none; }

.header-actions { display: flex; align-items: center; gap: .6rem; }

/* ── مبدّل اللغة ───────────────────────────────────────────────────────── */
.lang-picker { position: relative; display: inline-flex; align-items: center; }

.lang-icon {
  position: absolute; inset-inline-start: .55rem;
  display: grid; place-items: center; pointer-events: none;
  color: var(--text-muted);
}
.lang-icon svg { width: 17px; height: 17px; display: block; }

.lang-picker select {
  appearance: none; -webkit-appearance: none;
  height: 40px; padding-inline: 2.1rem 1.75rem;
  max-width: 11rem;
  background: transparent; color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font: inherit; font-size: .88rem; line-height: 1;
  cursor: pointer; transition: background-color .18s ease, border-color .18s ease;
}
.lang-picker select:hover { background: var(--surface-2); border-color: var(--border-strong); }
.lang-picker select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* سهم مرسوم بالـ CSS يغني عن السهم الافتراضي المختلف بين المتصفحات.
   موضعه منطقي ليتبع اتجاه الصفحة، لكن حدّيه فيزيائيان لأن السهم يشير إلى
   الأسفل دائمًا؛ الحدود المنطقية كانت تقلبه فيصير مائلًا في اللغات RTL. */
.lang-picker::after {
  content: ""; position: absolute; inset-inline-end: .7rem;
  width: 8px; height: 8px; pointer-events: none;
  border-right: 1.7px solid var(--text-muted);
  border-bottom: 1.7px solid var(--text-muted);
  transform: translateY(-2px) rotate(45deg);
}

/* قوائم النظام لا ترث ألوان الصفحة، فتُضبط الخيارات صراحةً */
.lang-picker option { background: var(--surface); color: var(--text); }

.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}

/* ── الواجهة الرئيسية ──────────────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(2.5rem, 1rem + 6vw, 5.5rem) 0 clamp(2rem, 1rem + 3vw, 3.5rem);
  background:
    radial-gradient(900px 420px at 80% -10%, var(--accent-soft), transparent 70%),
    linear-gradient(180deg, var(--bg-soft), var(--bg));
  border-bottom: 1px solid var(--border);
}
.hero-inner { max-width: 820px; margin-inline: auto; text-align: center; }

.eyebrow {
  display: inline-block; margin: 0 0 1rem;
  padding: .3rem .85rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-soft); font-size: .8rem; font-weight: 500;
}
.hero-sub { color: var(--text-soft); font-size: clamp(1rem, .95rem + .3vw, 1.12rem); max-width: 620px; margin-inline: auto; }

/* حقل البحث */
.search { margin: 2rem auto 0; max-width: 720px; }
.search-field {
  display: flex; align-items: center; gap: .5rem;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: .45rem .45rem .45rem 1rem;
  box-shadow: var(--shadow);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.search-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search-icon { display: grid; place-items: center; color: var(--text-muted); flex: none; }
.search-icon svg { width: 20px; height: 20px; }
.search-field input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  color: var(--text); font: inherit; font-size: 1rem; padding: .6rem .25rem;
  text-align: start;
}
.search-field input::placeholder { color: var(--text-muted); opacity: .85; }
.search-submit { min-width: 138px; }
.search-note { margin: .8rem 0 0; font-size: .85rem; color: var(--text-muted); }

.spinner {
  display: none; width: 17px; height: 17px; flex: none;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite;
}
.is-loading .spinner { display: block; }
.is-loading .btn-label { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: 1.1rem; }
.chip {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: .32rem .85rem;
  font-size: .82rem; color: var(--text-soft); cursor: pointer;
  transition: border-color .18s ease, color .18s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }

.assurances {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem;
  margin-top: 2rem; color: var(--text-soft); font-size: .88rem;
}
.assurances li { display: flex; align-items: center; gap: .45rem; }
.assurances svg { width: 18px; height: 18px; color: var(--accent); }

/* ── النتائج ───────────────────────────────────────────────────────────── */
.results { padding: 2rem 0 .5rem; }

.results-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
.results-main { min-width: 0; }
.results-aside { display: none; }

.state {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 2.5rem 1.5rem; text-align: center; box-shadow: var(--shadow-sm);
}
.state-title { margin-bottom: .35rem; font-size: 1.15rem; }
.state-text { margin: 0; color: var(--text-muted); font-size: .92rem; }
.state.is-error .state-title { color: var(--danger); }

.profile-card {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.25rem; box-shadow: var(--shadow-sm);
}
.profile-avatar {
  width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none;
  background: var(--surface-2); border: 1px solid var(--border);
}
.profile-avatar[data-fallback] { visibility: hidden; }
.profile-meta { min-width: 0; flex: 1; }
.profile-meta h2 { margin: 0; font-size: 1.1rem; }
.profile-meta p { margin: 0; color: var(--text-muted); font-size: .86rem; }

.profile-stats { display: flex; gap: 1.5rem; margin: 0; }
.profile-stats dt { color: var(--text-muted); font-size: .75rem; }
.profile-stats dd { margin: 0; font-size: 1.15rem; font-weight: 700; }

.toolbar { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1.25rem 0 1rem; }
.tab {
  background: transparent; border: 1px solid var(--border); border-radius: 999px;
  padding: .38rem .95rem; font-size: .86rem; color: var(--text-soft); cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.tab:hover { border-color: var(--border-strong); }
.tab.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }

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

.story {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.story:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }

.story-thumb {
  position: relative; display: block; width: 100%; aspect-ratio: 9 / 16;
  background: var(--surface-2); border: 0; padding: 0; cursor: pointer; overflow: hidden;
}
.story-thumb img { width: 100%; height: 100%; object-fit: cover; }
.story-thumb.is-empty::after {
  content: "لا تتوفر معاينة"; position: absolute; inset: 0;
  display: grid; place-items: center; color: var(--text-muted); font-size: .8rem;
}

.story-badge {
  position: absolute; inset-block-start: .5rem; inset-inline-start: .5rem;
  display: inline-flex; align-items: center; gap: .3rem;
  background: rgba(10, 16, 28, .72); color: #fff; backdrop-filter: blur(4px);
  border-radius: 999px; padding: .2rem .55rem; font-size: .72rem; font-weight: 500;
}
.story-badge svg { width: 13px; height: 13px; }

.story-play {
  position: absolute; inset: 0; margin: auto; width: 44px; height: 44px;
  display: grid; place-items: center; border-radius: 50%;
  background: rgba(10, 16, 28, .55); color: #fff; backdrop-filter: blur(3px);
  pointer-events: none;
}
.story-play svg { width: 20px; height: 20px; }

.story-foot {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .6rem .7rem;
}
.story-date { color: var(--text-muted); font-size: .76rem; }
.story-dl {
  display: inline-flex; align-items: center; gap: .3rem;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .3rem .6rem; font-size: .78rem; color: var(--text-soft); cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.story-dl:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); text-decoration: none; }
.story-dl svg { width: 14px; height: 14px; }

/* ── المعاينة ──────────────────────────────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0; z-index: 80;
  display: grid; grid-template-rows: 1fr auto; place-items: center;
  background: rgba(6, 10, 20, .92); padding: 1rem;
}
.lightbox[hidden] { display: none; }
.lightbox-body {
  margin: 0; max-width: min(92vw, 520px); max-height: 76vh;
  display: grid; place-items: center;
}
.lightbox-body img, .lightbox-body video {
  max-width: 100%; max-height: 76vh; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); background: #000;
}
.lightbox-close { position: absolute; inset-block-start: 1rem; inset-inline-end: 1rem; color: #fff; border-color: rgba(255, 255, 255, .25); }
.lightbox-nav { position: absolute; inset-block-start: 50%; transform: translateY(-50%); color: #fff; border-color: rgba(255, 255, 255, .25); }
/* الخصائص المنطقية تقلب الزرين تلقائيًا: السابق في جهة بداية القراءة */
.lightbox-nav.prev { inset-inline-start: 1rem; }
.lightbox-nav.next { inset-inline-end: 1rem; }
/* السهمان مرسومان للاتجاه من اليسار لليمين، فيُعكسان في اللغات الأخرى */
[dir="rtl"] .lightbox-nav svg { transform: scaleX(-1); }
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255, 255, 255, .12); }
.lightbox-bar {
  display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap;
  padding: 1rem 0 .25rem; color: rgba(255, 255, 255, .8); font-size: .85rem;
}

/* ── الأقسام ───────────────────────────────────────────────────────────── */
.section { padding: clamp(2.5rem, 1.5rem + 3vw, 4.5rem) 0; }
.section-alt { background: var(--bg-soft); border-block: 1px solid var(--border); }
.section-head { max-width: 640px; margin: 0 auto 2.25rem; text-align: center; }
.section-head p { color: var(--text-soft); margin: 0; }

.steps { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); counter-reset: step; }
.steps li {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem 1.35rem;
}
.step-num {
  display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: .9rem;
  border-radius: 10px; background: var(--accent-soft); color: var(--accent);
  font-weight: 700; font-size: .95rem;
}
.steps p { margin: 0; color: var(--text-soft); font-size: .92rem; }

.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem 1.35rem; transition: border-color .18s ease, transform .18s ease;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.card-icon {
  display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: .9rem;
  border-radius: 11px; background: var(--accent-soft); color: var(--accent);
}
.card-icon svg { width: 21px; height: 21px; }
.card p { margin: 0; color: var(--text-soft); font-size: .92rem; }

.faq details {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .25rem 1.15rem; margin-bottom: .6rem;
}
.faq details[open] { border-color: var(--border-strong); }
.faq summary {
  cursor: pointer; list-style: none; padding: .9rem 0; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 9px; height: 9px;
  border-inline-end: 2px solid var(--text-muted); border-block-end: 2px solid var(--text-muted);
  transform: rotate(45deg); transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq p { margin: 0 0 1rem; color: var(--text-soft); font-size: .93rem; }

/* ── التذييل ───────────────────────────────────────────────────────────── */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding-top: 2.5rem; margin-top: 1rem; }
.footer-inner { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr); }
.footer-brand { display: flex; gap: .8rem; align-items: flex-start; max-width: 420px; }
.footer-brand p { margin: 0; color: var(--text-muted); font-size: .86rem; }
.footer-links { display: grid; gap: 2rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.footer-links h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: .6rem; }
.footer-links a { display: block; color: var(--text-soft); font-size: .9rem; padding: .18rem 0; }
.footer-links a:hover { color: var(--accent); text-decoration: none; }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin-top: 2rem; padding-block: 1rem; border-top: 1px solid var(--border);
  color: var(--text-muted); font-size: .84rem;
}
.footer-bottom p { margin: 0; }

/* ── المواضع الإعلانية ─────────────────────────────────────────────────────
   كل موضع يبقى مخفيًا ما لم تُملأ مساحته فعليًا، حتى لا تظهر فجوات فارغة.
   الفئة is-filled تضيفها الوحدة ads.js بعد حقن كود الشبكة الإعلانية.
   ------------------------------------------------------------------------ */
.ad-slot { display: none; }
.ad-slot.is-filled, .ad-slot.is-placeholder {
  display: block; position: relative;
  margin: 1.75rem auto; overflow: hidden;
  text-align: center;
}
.ad-slot.is-filled::before, .ad-slot.is-placeholder::before {
  content: attr(data-ad-label);
  display: block; margin-bottom: .35rem;
  color: var(--text-muted); font-size: .68rem; letter-spacing: .08em;
}
.ad-slot[data-ad-format="leaderboard"] { min-height: 100px; }
.ad-slot[data-ad-format="billboard"] { min-height: 260px; }
.ad-slot[data-ad-format="halfpage"] { min-height: 600px; margin-block: 0; }
.ad-slot[data-ad-format="in-grid"] { min-height: 250px; margin: 0; }
.ad-slot[data-ad-format="mobile-banner"] { min-height: 50px; margin: 0; }

.ad-slot.is-placeholder {
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 10px, var(--surface) 10px, var(--surface) 20px);
  color: var(--text-muted); font-size: .8rem;
}
.ad-slot.is-placeholder .ad-placeholder-body { display: grid; place-items: center; height: 100%; min-height: inherit; padding: 1rem; }

.ad-sticky { position: sticky; top: calc(var(--header-h) + 20px); }

.grid > .ad-slot.is-filled, .grid > .ad-slot.is-placeholder { margin: 0; align-self: stretch; }

.ad-anchor {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: .35rem 2.5rem; background: var(--surface);
  border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(15, 23, 41, .12);
}
.ad-anchor[hidden] { display: none; }
.ad-anchor .ad-slot.is-filled, .ad-anchor .ad-slot.is-placeholder { margin: 0; }
.ad-anchor .ad-slot::before { display: none; }
.ad-anchor-close {
  position: absolute; inset-inline-end: .4rem; inset-block-start: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 50%;
  color: var(--text-muted); cursor: pointer;
}
.ad-anchor-close svg { width: 14px; height: 14px; }
@media (min-width: 900px) { .ad-anchor { display: none !important; } }

/* ── موافقة الخصوصية ───────────────────────────────────────────────────── */
.consent {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 90;
  padding: 1rem; background: var(--surface); border-top: 1px solid var(--border);
  box-shadow: 0 -8px 32px rgba(15, 23, 41, .18);
}
.consent[hidden] { display: none; }
.consent-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; flex-wrap: wrap;
  max-width: var(--container); margin-inline: auto;
}
.consent-inner p { margin: 0; flex: 1; min-width: 260px; font-size: .88rem; color: var(--text-soft); }
.consent-actions { display: flex; gap: .6rem; flex-wrap: wrap; }

/* ── الإعلان البيني عند التحميل ────────────────────────────────────────── */
.interstitial {
  position: fixed; inset: 0; z-index: 95;
  display: grid; place-items: center; padding: 1.25rem;
  background: rgba(8, 13, 25, .72); backdrop-filter: blur(3px);
  animation: interstitial-in .18s ease-out;
}

.interstitial-box {
  position: relative;
  width: min(420px, 100%); padding: 2rem 1.75rem 1.75rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  text-align: center;
}
.interstitial-box h2 { font-size: 1.25rem; margin-bottom: .6rem; }
.interstitial-box p { color: var(--text-soft); font-size: .9rem; }
.interstitial-box .btn { width: 100%; justify-content: center; margin-top: .35rem; }

.interstitial-count {
  font-variant-numeric: tabular-nums;
  font-weight: 600; color: var(--text-muted); font-size: .84rem;
}

.interstitial-close {
  position: absolute; inset-block-start: .6rem; inset-inline-end: .6rem;
  width: 34px; height: 34px; border-color: transparent; color: var(--text-muted);
}
.interstitial-close svg { width: 16px; height: 16px; }

@keyframes interstitial-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── الاستجابة ─────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .nav { display: none; }
  .header-cta { display: none; }
  /* ‎.nav‎ كانت تدفع الأدوات إلى الطرف، فتتولى هي ذلك بعد إخفائها */
  .header-actions { margin-inline-start: auto; }
  /* أسماء اللغات قد تطول، فتُقلَّص القائمة على الشاشات الصغيرة */
  .lang-picker select { max-width: 8.5rem; padding-inline: 2rem 1.5rem; }
  .search-field { flex-wrap: wrap; padding: .75rem; }
  .search-field input { width: 100%; flex-basis: 100%; }
  .search-icon { display: none; }
  .search-submit { width: 100%; }
  .profile-card { align-items: flex-start; }
  .profile-card .btn { width: 100%; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; }
}

@media (min-width: 720px) {
  .footer-inner { grid-template-columns: 1.4fr 1fr; }
}

@media (min-width: 1200px) {
  .results-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .results-aside { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
